Browse Source

Revert "new virtual shelves changes, keyed by biblionumber -- approved"

This reverts commit 8af76042d8.
3.0.x
Joshua Ferraro 17 years ago
parent
commit
81c0d9e821
  1. 53
      C4/Auth.pm
  2. 3
      C4/Branch.pm
  3. 190
      C4/VirtualShelves.pm
  4. 1
      Makefile.PL
  5. 82
      help.pl
  6. 20
      installer/kohastructure.sql
  7. 2
      koha-tmpl/intranet-tmpl/prog/en/about.tmpl
  8. 11
      koha-tmpl/intranet-tmpl/prog/en/auth.tmpl
  9. 4
      koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl
  10. 15
      koha-tmpl/intranet-tmpl/prog/en/help/nohelp.tmpl
  11. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc
  12. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/error-top.inc
  13. 5
      koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc
  14. 5
      koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc
  15. 2
      koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc
  16. 7
      koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl
  17. 12
      koha-tmpl/intranet-tmpl/prog/en/virtualshelves/addbybiblionumber.tmpl
  18. 89
      koha-tmpl/intranet-tmpl/prog/en/virtualshelves/shelves.tmpl
  19. 2
      koha-tmpl/opac-tmpl/prog/en/includes/basket.js
  20. 2
      koha-tmpl/opac-tmpl/prog/en/opac-ISBDdetail.tmpl
  21. 2
      koha-tmpl/opac-tmpl/prog/en/opac-MARCdetail.tmpl
  22. 18
      koha-tmpl/opac-tmpl/prog/en/opac-addbybiblionumber.tmpl
  23. 2
      koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl
  24. 62
      koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl
  25. 16
      opac/opac-addbybiblionumber.pl
  26. 2
      opac/opac-main.pl
  27. 20
      opac/opac-shelves.pl
  28. 18
      t/VirtualShelves.t
  29. 3
      tools/export.pl
  30. 2
      updater/updatedatabase
  31. 99
      virtualshelves/addbybiblionumber.pl
  32. 115
      virtualshelves/shelves.pl

53
C4/Auth.pm

@ -223,18 +223,17 @@ sub get_template_and_user {
if ( $in->{'type'} eq "intranet" ) { if ( $in->{'type'} eq "intranet" ) {
$template->param( $template->param(
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet => C4::Context->preference("intranetstylesheet"), intranetstylesheet => C4::Context->preference("intranetstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"), IntranetNav => C4::Context->preference("IntranetNav"),
intranetuserjs => C4::Context->preference("intranetuserjs"), intranetuserjs => C4::Context->preference("intranetuserjs"),
TemplateEncoding => C4::Context->preference("TemplateEncoding"), TemplateEncoding => C4::Context->preference("TemplateEncoding"),
AmazonContent => C4::Context->preference("AmazonContent"), AmazonContent => C4::Context->preference("AmazonContent"),
LibraryName => C4::Context->preference("LibraryName"), LibraryName => C4::Context->preference("LibraryName"),
LoginBranchcode => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"), LoginBranchcode => (C4::Context->userenv?C4::Context->userenv->{"branch"}:"insecure"),
LoginBranchname => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"), LoginBranchname => (C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),
LoginBranchnameShort => substr((C4::Context->userenv?C4::Context->userenv->{"branchname"}:"insecure"),0,10), AutoLocation => C4::Context->preference("AutoLocation"),
AutoLocation => C4::Context->preference("AutoLocation"), hide_marc => C4::Context->preference("hide_marc"),
hide_marc => C4::Context->preference("hide_marc"), patronimages => C4::Context->preference("patronimages"),
patronimages => C4::Context->preference("patronimages"),
"BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1,
advancedMARCEditor => C4::Context->preference("advancedMARCEditor"), advancedMARCEditor => C4::Context->preference("advancedMARCEditor"),
suggestion => C4::Context->preference("suggestion"), suggestion => C4::Context->preference("suggestion"),
@ -346,7 +345,7 @@ has authenticated.
sub checkauth { sub checkauth {
my $query = shift; my $query = shift;
# warn "Checking Auth";
# $authnotrequired will be set for scripts which will run without authentication # $authnotrequired will be set for scripts which will run without authentication
my $authnotrequired = shift; my $authnotrequired = shift;
my $flagsrequired = shift; my $flagsrequired = shift;
@ -389,7 +388,7 @@ sub checkauth {
# state variables # state variables
my $loggedin = 0; my $loggedin = 0;
my %info; my %info;
my ( $userid, $cookie, $sessionID, $flags, $envcookie ); my ( $userid, $cookie, $sessionID, $flags );
my $logout = $query->param('logout.x'); my $logout = $query->param('logout.x');
if ( $userid = $ENV{'REMOTE_USER'} ) { if ( $userid = $ENV{'REMOTE_USER'} ) {
@ -431,7 +430,7 @@ sub checkauth {
close L; close L;
} }
if ($userid) { if ($userid) {
warn "here $userid"; # warn "here $userid";
if ( $lasttime < time() - $timeout ) { if ( $lasttime < time() - $timeout ) {
# timed logout # timed logout
@ -551,10 +550,14 @@ sub checkauth {
# new op dev : # new op dev :
# launch a sequence to check if we have a ip for the branch, if we have one we replace the branchcode of the userenv by the branch bound in the ip. # launch a sequence to check if we have a ip for the branch, if we have one we replace the branchcode of the userenv by the branch bound in the ip.
my $ip = $ENV{'REMOTE_ADDR'}; my $ip = $ENV{'REMOTE_ADDR'};
# if they specify at login, use that
if ($query->param('branch')) {
$branchcode = $query->param('branch');
$branchname = GetBranchName($branchcode);
}
my $branches = GetBranches(); my $branches = GetBranches();
my @branchesloop; my @branchesloop;
foreach my $br ( keys %$branches ) { foreach my $br ( keys %$branches ) {
# now we work with the treatment of ip # now we work with the treatment of ip
my $domain = $branches->{$br}->{'branchip'}; my $domain = $branches->{$br}->{'branchip'};
if ( $domain && $ip =~ /^$domain/ ) { if ( $domain && $ip =~ /^$domain/ ) {
@ -593,7 +596,17 @@ sub checkauth {
$session->param('ip',$session->remote_addr()); $session->param('ip',$session->remote_addr());
$session->param('lasttime',time()); $session->param('lasttime',time());
} }
if ($session){
C4::Context::set_userenv(
$session->param('number'), $session->param('id'),
$session->param('cardnumber'), $session->param('firstname'),
$session->param('surname'), $session->param('branch'),
$session->param('branchname'), $session->param('flags'),
$session->param('emailaddress'), $session->param('branchprinter')
);
}
} }
else { else {
if ($userid) { if ($userid) {
$info{'invalid_username_or_password'} = 1; $info{'invalid_username_or_password'} = 1;
@ -623,8 +636,16 @@ sub checkauth {
my $value = $query->param($name); my $value = $query->param($name);
push @inputs, { name => $name, value => $value }; push @inputs, { name => $name, value => $value };
} }
# get the branchloop, which we need for authetication
use C4::Branch;
my $branches = GetBranches();
my @branch_loop;
for my $branch_hash (keys %$branches) {
push @branch_loop, {branchcode => "$branch_hash", branchname => $branches->{$branch_hash}->{'branchname'}, };
}
my $template = gettemplate( $template_name, $type, $query ); my $template = gettemplate( $template_name, $type, $query );
$template->param(branchloop => \@branch_loop,);
$template->param( $template->param(
INPUTS => \@inputs, INPUTS => \@inputs,
suggestion => C4::Context->preference("suggestion"), suggestion => C4::Context->preference("suggestion"),

3
C4/Branch.pm

@ -91,8 +91,7 @@ foreach my $thisbranch (keys %$branches) {
=cut =cut
sub GetBranches { sub GetBranches {
my ($onlymine)=@_;
my $onlymine=@_;
# returns a reference to a hash of references to ALL branches... # returns a reference to a hash of references to ALL branches...
my %branches; my %branches;
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;

190
C4/BookShelves.pm → C4/VirtualShelves.pm

@ -1,7 +1,7 @@
# -*- tab-width: 8 -*- # -*- tab-width: 8 -*-
# Please use 8-character tabs for this file (indents are every 4 characters) # Please use 8-character tabs for this file (indents are every 4 characters)
package C4::BookShelves; package C4::VirtualShelves;
# $Id$ # $Id$
@ -33,17 +33,17 @@ $VERSION = do { my @v = '$Revision$' =~ /\d+/g; shift(@v) . "." . join( "_", map
=head1 NAME =head1 NAME
C4::BookShelves - Functions for manipulating Koha virtual bookshelves C4::VirtualShelves - Functions for manipulating Koha virtual virtualshelves
=head1 SYNOPSIS =head1 SYNOPSIS
use C4::BookShelves; use C4::VirtualShelves;
=head1 DESCRIPTION =head1 DESCRIPTION
This module provides functions for manipulating virtual bookshelves, This module provides functions for manipulating virtual virtualshelves,
including creating and deleting bookshelves, and adding and removing including creating and deleting virtualshelves, and adding and removing
items to and from bookshelves. items to and from virtualshelves.
=head1 FUNCTIONS =head1 FUNCTIONS
@ -69,13 +69,13 @@ my $dbh = C4::Context->dbh;
$shelflist = &GetShelves($owner, $mincategory); $shelflist = &GetShelves($owner, $mincategory);
($shelfnumber, $shelfhash) = each %{$shelflist}; ($shelfnumber, $shelfhash) = each %{$shelflist};
Looks up the virtual bookshelves, and returns a summary. C<$shelflist> Looks up the virtual virtualshelves, and returns a summary. C<$shelflist>
is a reference-to-hash. The keys are the bookshelf numbers is a reference-to-hash. The keys are the virtualshelves numbers
(C<$shelfnumber>, above), and the values (C<$shelfhash>, above) are (C<$shelfnumber>, above), and the values (C<$shelfhash>, above) are
themselves references-to-hash, with the following keys: themselves references-to-hash, with the following keys:
C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select bookshelf for adding a book". C<mincategory> : 2 if the list is for "look". 3 if the list is for "Select virtualshelves for adding a virtual".
bookshelves of the owner are always selected, whatever the category virtualshelves of the owner are always selected, whatever the category
=over 4 =over 4
@ -85,7 +85,7 @@ A string. The name of the shelf.
=item C<$shelfhash-E<gt>{count}> =item C<$shelfhash-E<gt>{count}>
The number of books on that bookshelf. The number of virtuals on that virtualshelves.
=back =back
@ -100,14 +100,14 @@ sub GetShelves {
my ( $owner, $mincategory ) = @_; my ( $owner, $mincategory ) = @_;
my $query = qq( my $query = qq(
SELECT bookshelf.shelfnumber, bookshelf.shelfname,owner,surname,firstname,bookshelf.category, SELECT virtualshelves.shelfnumber, virtualshelves.shelfname,owner,surname,firstname,virtualshelves.category,
count(shelfcontents.itemnumber) as count count(virtualshelfcontents.biblionumber) as count
FROM bookshelf FROM virtualshelves
LEFT JOIN shelfcontents ON bookshelf.shelfnumber = shelfcontents.shelfnumber LEFT JOIN virtualshelfcontents ON virtualshelves.shelfnumber = virtualshelfcontents.shelfnumber
LEFT JOIN borrowers ON bookshelf.owner = borrowers.borrowernumber LEFT JOIN borrowers ON virtualshelves.owner = borrowers.borrowernumber
WHERE owner=? OR category>=? WHERE owner=? OR category>=?
GROUP BY bookshelf.shelfnumber GROUP BY virtualshelves.shelfnumber
ORDER BY bookshelf.category, bookshelf.shelfname, borrowers.firstname, borrowers.surname ORDER BY virtualshelves.category, virtualshelves.shelfname, borrowers.firstname, borrowers.surname
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
$sth->execute( $owner, $mincategory ); $sth->execute( $owner, $mincategory );
@ -134,10 +134,10 @@ sub GetShelves {
(shelfnumber,shelfname,owner,category) = &GetShelf($shelfnumber); (shelfnumber,shelfname,owner,category) = &GetShelf($shelfnumber);
Looks up information about the contents of virtual bookshelf number Looks up information about the contents of virtual virtualshelves number
C<$shelfnumber> C<$shelfnumber>
Returns the database's information on 'bookshelf' table. Returns the database's information on 'virtualshelves' table.
=cut =cut
@ -145,7 +145,7 @@ sub GetShelf {
my ($shelfnumber) = @_; my ($shelfnumber) = @_;
my $query = qq( my $query = qq(
SELECT shelfnumber,shelfname,owner,category SELECT shelfnumber,shelfname,owner,category
FROM bookshelf FROM virtualshelves
WHERE shelfnumber=? WHERE shelfnumber=?
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
@ -157,7 +157,7 @@ sub GetShelf {
$itemlist = &GetShelfContents($shelfnumber); $itemlist = &GetShelfContents($shelfnumber);
Looks up information about the contents of virtual bookshelf number Looks up information about the contents of virtual virtualshelves number
C<$shelfnumber>. C<$shelfnumber>.
Returns a reference-to-array, whose elements are references-to-hash, Returns a reference-to-array, whose elements are references-to-hash,
@ -170,23 +170,22 @@ sub GetShelfContents {
my ( $shelfnumber ) = @_; my ( $shelfnumber ) = @_;
my @itemlist; my @itemlist;
my $query = my $query =
" SELECT itemnumber " SELECT biblionumber
FROM shelfcontents FROM virtualshelfcontents
WHERE shelfnumber=? WHERE shelfnumber=?
ORDER BY itemnumber ORDER BY biblionumber
"; ";
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
$sth->execute($shelfnumber); $sth->execute($shelfnumber);
my $sth2 = $dbh->prepare(" my $sth2 = $dbh->prepare("
SELECT biblio.*,biblioitems.* FROM items SELECT biblio.*,biblioitems.* FROM biblio
LEFT JOIN biblio on items.biblionumber=biblio.biblionumber LEFT JOIN biblioitems on biblio.biblionumber=biblioitems.biblionumber
LEFT JOIN biblioitems on items.biblionumber=biblioitems.biblionumber WHERE biblio.biblionumber=?"
WHERE items.itemnumber=?"
); );
while ( my ($itemnumber) = $sth->fetchrow ) { while ( my ($biblionumber) = $sth->fetchrow ) {
$sth2->execute($itemnumber); $sth2->execute($biblionumber);
my $item = $sth2->fetchrow_hashref; my $item = $sth2->fetchrow_hashref;
$item->{'itemnumber'}=$itemnumber; $item->{'biblionumber'}=$biblionumber;
push( @itemlist, $item ); push( @itemlist, $item );
} }
return ( \@itemlist ); return ( \@itemlist );
@ -196,11 +195,11 @@ sub GetShelfContents {
$shelfnumber = &AddShelf( $shelfname, $owner, $category); $shelfnumber = &AddShelf( $shelfname, $owner, $category);
Creates a new virtual bookshelf with name C<$shelfname>, owner C<$owner> and category Creates a new virtual virtualshelves with name C<$shelfname>, owner C<$owner> and category
C<$category>. C<$category>.
Returns a code to know what's happen. Returns a code to know what's happen.
* -1 : if this bookshelf already exist. * -1 : if this virtualshelves already exist.
* $shelfnumber : if success. * $shelfnumber : if success.
=cut =cut
@ -209,7 +208,7 @@ sub AddShelf {
my ( $shelfname, $owner, $category ) = @_; my ( $shelfname, $owner, $category ) = @_;
my $query = qq( my $query = qq(
SELECT * SELECT *
FROM bookshelf FROM virtualshelves
WHERE shelfname=? AND owner=? WHERE shelfname=? AND owner=?
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
@ -219,7 +218,7 @@ sub AddShelf {
} }
else { else {
my $query = qq( my $query = qq(
INSERT INTO bookshelf INSERT INTO virtualshelves
(shelfname,owner,category) (shelfname,owner,category)
VALUES (?,?,?) VALUES (?,?,?)
); );
@ -232,35 +231,35 @@ sub AddShelf {
=item AddToShelf =item AddToShelf
&AddToShelf($itemnumber, $shelfnumber); &AddToShelf($biblionumber, $shelfnumber);
Adds item number C<$itemnumber> to virtual bookshelf number Adds item number C<$biblionumber> to virtual virtualshelves number
C<$shelfnumber>, unless that item is already on that shelf. C<$shelfnumber>, unless that item is already on that shelf.
=cut =cut
#' #'
sub AddToShelf { sub AddToShelf {
my ( $itemnumber, $shelfnumber ) = @_; my ( $biblionumber, $shelfnumber ) = @_;
return unless $itemnumber; return unless $biblionumber;
my $query = qq( my $query = qq(
SELECT * SELECT *
FROM shelfcontents FROM virtualshelfcontents
WHERE shelfnumber=? AND itemnumber=? WHERE shelfnumber=? AND biblionumber=?
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
$sth->execute( $shelfnumber, $itemnumber ); $sth->execute( $shelfnumber, $biblionumber );
unless ( $sth->rows ) { unless ( $sth->rows ) {
# already on shelf # already on shelf
my $query = qq( my $query = qq(
INSERT INTO shelfcontents INSERT INTO virtualshelfcontents
(shelfnumber, itemnumber, flags) (shelfnumber, biblionumber, flags)
VALUES VALUES
(?, ?, 0) (?, ?, 0)
); );
$sth = $dbh->prepare($query); $sth = $dbh->prepare($query);
$sth->execute( $shelfnumber, $itemnumber ); $sth->execute( $shelfnumber, $biblionumber );
} }
} }
@ -268,7 +267,7 @@ sub AddToShelf {
&AddToShelfFromBiblio($biblionumber, $shelfnumber) &AddToShelfFromBiblio($biblionumber, $shelfnumber)
this function allow to add a book into the shelf number $shelfnumber this function allow to add a virtual into the shelf number $shelfnumber
from biblionumber. from biblionumber.
=cut =cut
@ -277,30 +276,21 @@ sub AddToShelfFromBiblio {
my ( $biblionumber, $shelfnumber ) = @_; my ( $biblionumber, $shelfnumber ) = @_;
return unless $biblionumber; return unless $biblionumber;
my $query = qq( my $query = qq(
SELECT itemnumber
FROM items
WHERE biblionumber=?
);
my $sth = $dbh->prepare($query);
$sth->execute($biblionumber);
my ($itemnumber) = $sth->fetchrow;
$query = qq(
SELECT * SELECT *
FROM shelfcontents FROM virtualshelfcontents
WHERE shelfnumber=? AND itemnumber=? WHERE shelfnumber=? AND biblionumber=?
); );
$sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
$sth->execute( $shelfnumber, $itemnumber ); $sth->execute( $shelfnumber, $biblionumber );
unless ( $sth->rows ) { unless ( $sth->rows ) {
# "already on shelf";
my $query =qq( my $query =qq(
INSERT INTO shelfcontents INSERT INTO virtualshelfcontents
(shelfnumber, itemnumber, flags) (shelfnumber, biblionumber, flags)
VALUES VALUES
(?, ?, 0) (?, ?, 0)
); );
$sth = $dbh->prepare($query); $sth = $dbh->prepare($query);
$sth->execute( $shelfnumber, $itemnumber ); $sth->execute( $shelfnumber, $biblionumber );
} }
} }
@ -308,14 +298,14 @@ sub AddToShelfFromBiblio {
ModShelf($shelfnumber, $shelfname, $owner, $category ) ModShelf($shelfnumber, $shelfname, $owner, $category )
Modify the value into bookshelf table with values given on input arg. Modify the value into virtualshelves table with values given on input arg.
=cut =cut
sub ModShelf { sub ModShelf {
my ( $shelfnumber, $shelfname, $owner, $category ) = @_; my ( $shelfnumber, $shelfname, $owner, $category ) = @_;
my $query = qq( my $query = qq(
UPDATE bookshelf UPDATE virtualshelves
SET shelfname=?,owner=?,category=? SET shelfname=?,owner=?,category=?
WHERE shelfnumber=? WHERE shelfnumber=?
); );
@ -327,7 +317,7 @@ sub ModShelf {
($status) = &DelShelf($shelfnumber); ($status) = &DelShelf($shelfnumber);
Deletes virtual bookshelf number C<$shelfnumber>. The bookshelf must Deletes virtual virtualshelves number C<$shelfnumber>. The virtualshelves must
be empty. be empty.
Returns a two-element array, where C<$status> is 0 if the operation Returns a two-element array, where C<$status> is 0 if the operation
@ -354,7 +344,7 @@ sub ShelfPossibleAction {
my ( $user, $shelfnumber, $action ) = @_; my ( $user, $shelfnumber, $action ) = @_;
my $query = qq( my $query = qq(
SELECT owner,category SELECT owner,category
FROM bookshelf FROM virtualshelves
WHERE shelfnumber=? WHERE shelfnumber=?
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
@ -367,23 +357,23 @@ sub ShelfPossibleAction {
=item DelFromShelf =item DelFromShelf
&DelFromShelf( $itemnumber, $shelfnumber); &DelFromShelf( $biblionumber, $shelfnumber);
Removes item number C<$itemnumber> from virtual bookshelf number Removes item number C<$biblionumber> from virtual virtualshelves number
C<$shelfnumber>. If the item wasn't on that bookshelf to begin with, C<$shelfnumber>. If the item wasn't on that virtualshelves to begin with,
nothing happens. nothing happens.
=cut =cut
#' #'
sub DelFromShelf { sub DelFromShelf {
my ( $itemnumber, $shelfnumber ) = @_; my ( $biblionumber, $shelfnumber ) = @_;
my $query = qq( my $query = qq(
DELETE FROM shelfcontents DELETE FROM virtualshelfcontents
WHERE shelfnumber=? AND itemnumber=? WHERE shelfnumber=? AND biblionumber=?
); );
my $sth = $dbh->prepare($query); my $sth = $dbh->prepare($query);
$sth->execute( $shelfnumber, $itemnumber ); $sth->execute( $shelfnumber, $biblionumber );
} }
=head2 DelShelf =head2 DelShelf
@ -397,7 +387,7 @@ sub DelFromShelf {
#' #'
sub DelShelf { sub DelShelf {
my ( $shelfnumber ) = @_; my ( $shelfnumber ) = @_;
my $sth = $dbh->prepare("DELETE FROM bookshelf WHERE shelfnumber=?"); my $sth = $dbh->prepare("DELETE FROM virtualshelves WHERE shelfnumber=?");
$sth->execute($shelfnumber); $sth->execute($shelfnumber);
return 0; return 0;
} }
@ -419,53 +409,3 @@ Koha Developement team <info@koha.org>
C4::Circulation::Circ2(3) C4::Circulation::Circ2(3)
=cut =cut
#
# $Log$
# Revision 1.21 2007/04/04 16:46:22 tipaul
# HUGE COMMIT : code cleaning circulation.
#
# some stuff to do, i'll write a mail on koha-devel NOW !
#
# Revision 1.20 2007/03/09 14:31:47 tipaul
# rel_3_0 moved to HEAD
#
# Revision 1.15.8.10 2007/01/25 13:18:15 tipaul
# checking that a bookshelf with the same name AND OWNER does not exist before creating it
#
# Revision 1.15.8.9 2006/12/15 17:37:52 toins
# removing a function used only once.
#
# Revision 1.15.8.8 2006/12/14 17:22:55 toins
# bookshelves work perfectly with mod_perl and are cleaned.
#
# Revision 1.15.8.7 2006/12/13 19:46:41 hdl
# Some bug fixing.
#
# Revision 1.15.8.6 2006/12/11 17:10:06 toins
# fixing some bugs on bookshelves.
#
# Revision 1.15.8.5 2006/12/07 16:45:43 toins
# removing warn compilation. (perl -wc)
#
# Revision 1.15.8.4 2006/11/23 09:05:01 tipaul
# enable removal of a bookshelf even if there are items inside
#
# Revision 1.15.8.3 2006/10/30 09:50:20 tipaul
# removing getiteminformations (using direct SQL, as we are in a .pm, so it's "legal")
#
# Revision 1.15.8.2 2006/08/31 16:03:52 toins
# Add Pod to DelShelf
#
# Revision 1.15.8.1 2006/08/30 15:59:14 toins
# Code cleaned according to coding guide lines.
#
# Revision 1.15 2004/12/16 11:30:58 tipaul
# adding bookshelf features :
# * create bookshelf on the fly
# * modify a bookshelf name & status
#
# Revision 1.14 2004/12/15 17:28:23 tipaul
# adding bookshelf features :
# * create bookshelf on the fly
# * modify a bookshelf (this being not finished, will commit the rest soon)

1
Makefile.PL

@ -86,6 +86,7 @@ WriteMakefile(
PREREQ_PM => { PREREQ_PM => {
'CGI' => 3.15, 'CGI' => 3.15,
'CGI::Carp' => 1.29, 'CGI::Carp' => 1.29,
'CGI::Session' => '4.10',
'Class::Accessor' => 0.30, 'Class::Accessor' => 0.30,
'DBD::mysql' => 3.0008, 'DBD::mysql' => 3.0008,
'DBI' => 1.53, 'DBI' => 1.53,

82
help.pl

@ -1,27 +1,8 @@
#!/usr/bin/perl #!/usr/bin/perl
use HTML::Template;
# Copyright 2006 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation; either version 2 of the License, or (at your option) any later
# version.
#
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
# Suite 330, Boston, MA 02111-1307 USA
use strict; use strict;
require Exporter; require Exporter;
use C4::Output; # contains gettemplate use C4::Output; # contains gettemplate
use C4::Output;
# use C4::Auth; # use C4::Auth;
use C4::Context; use C4::Context;
use CGI; use CGI;
@ -29,46 +10,45 @@ use CGI;
my $query = new CGI; my $query = new CGI;
# find the script that called the online help using the CGI referer() # find the script that called the online help using the CGI referer()
my $refer = $query->referer();
my $refer = $query->referer();
# workaround for popup not functioning correctly in IE # workaround for popup not functioning correctly in IE
my $referurl = $query->param('url'); my $referurl = $query->param('url');
if ($referurl) { if($referurl){
$refer = $query->param('url'); $refer = $query->param('url');
} }
$refer =~ /.*koha\/(.*)\.pl.*/; $refer =~ /.*koha\/(.*)\.pl.*/;
my $from = "help/$1.tmpl"; my $from = "help/$1.tmpl";
my $template = gethelptemplate( $from, "intranet" ); my $template = gethelptemplate($from,"intranet");
# my $template # my $template
output_html_with_http_headers $query, "", $template->output; output_html_with_http_headers $query, "", $template->output;
sub gethelptemplate {
my ($tmplbase) = @_;
my $htdocs;
$htdocs = C4::Context->config('intrahtdocs');
my ( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
unless ( -e "$htdocs/$theme/$lang/$tmplbase" ) {
$tmplbase = "help/nohelp.tmpl";
( $theme, $lang ) = themelanguage( $htdocs, $tmplbase, "intranet" );
}
my $template = HTML::Template->new(
filename => "$htdocs/$theme/$lang/$tmplbase",
die_on_bad_params => 0,
global_vars => 1,
path => ["$htdocs/$theme/$lang/includes"]
);
# XXX temporary patch for Bug 182 for themelang sub gethelptemplate {
$template->param( my ($tmplbase) = @_;
themelang => '/intranet-tmpl' . "/$theme/$lang",
interface => '/intranet-tmpl', my $htdocs;
theme => $theme, $htdocs = C4::Context->config('intrahtdocs');
lang => $lang my ($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
); unless (-e "$htdocs/$theme/$lang/$tmplbase") {
return $template; $tmplbase="help/nohelp.tmpl";
($theme, $lang) = themelanguage($htdocs, $tmplbase, "intranet");
}
my $template = HTML::Template->new(filename => "$htdocs/$theme/$lang/$tmplbase",
die_on_bad_params => 0,
global_vars => 1,
path => ["$htdocs/$theme/$lang/includes"]);
# XXX temporary patch for Bug 182 for themelang
$template->param(themelang => '/intranet-tmpl' . "/$theme/$lang",
interface => '/intranet-tmpl',
theme => $theme,
lang => $lang,
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
intranetstylesheet => C4::Context->preference("intranetstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"),
referer => $refer,
);
return $template;
} }

20
installer/kohastructure.sql

@ -447,11 +447,11 @@ CREATE TABLE `biblioitems` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --
-- Table structure for table `bookshelf` -- Table structure for table `virtualshelves`
-- --
DROP TABLE IF EXISTS `bookshelf`; DROP TABLE IF EXISTS `virtualshelves`;
CREATE TABLE `bookshelf` ( CREATE TABLE `virtualshelves` (
`shelfnumber` int(11) NOT NULL auto_increment, `shelfnumber` int(11) NOT NULL auto_increment,
`shelfname` char(255) default NULL, `shelfname` char(255) default NULL,
`owner` char(80) default NULL, `owner` char(80) default NULL,
@ -1382,19 +1382,19 @@ CREATE TABLE sessions (
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --
-- Table structure for table `shelfcontents` -- Table structure for table `virtualshelfcontents`
-- --
DROP TABLE IF EXISTS `shelfcontents`; DROP TABLE IF EXISTS `virtualshelfcontents`;
CREATE TABLE `shelfcontents` ( CREATE TABLE `virtualshelfcontents` (
`shelfnumber` int(11) NOT NULL default '0', `shelfnumber` int(11) NOT NULL default '0',
`itemnumber` int(11) NOT NULL default '0', `biblionumber` int(11) NOT NULL default '0',
`flags` int(11) default NULL, `flags` int(11) default NULL,
`dateadded` timestamp NULL default NULL, `dateadded` timestamp NULL default NULL,
KEY `shelfnumber` (`shelfnumber`), KEY `shelfnumber` (`shelfnumber`),
KEY `itemnumber` (`itemnumber`), KEY `biblionumber` (`biblionumber`),
CONSTRAINT `shelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `bookshelf` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `virtualshelfcontents_ibfk_1` FOREIGN KEY (`shelfnumber`) REFERENCES `virtualshelves` (`shelfnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE CONSTRAINT `shelfcontents_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8; ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- --

2
koha-tmpl/intranet-tmpl/prog/en/about.tmpl

@ -5,7 +5,7 @@
<div id="main"> <div id="main">
<div id="mainbloc"> <div id="mainbloc">
<h1>Data about the current version of Koha for bug reports (or general interest).</h1> <h1>About Koha</h1>
<table> <table>
<caption>Server information</caption> <caption>Server information</caption>

11
koha-tmpl/intranet-tmpl/prog/en/auth.tmpl

@ -43,10 +43,17 @@
<p> <p>
<label>Password:<br /> <label>Password:<br />
<input type="password" name="password" id="password" class="input" value="" size="20" tabindex="20" /></label> <input type="password" name="password" id="password" class="input" value="" size="20" tabindex="20" /></label>
</p> </p>
<p>
<label for="branch">Library:</label>
<select name="branch" id="branch" class="input">
<!-- TMPL_LOOP NAME="branchloop" -->
<option value="<!-- TMPL_VAR NAME='branchcode' -->"><!-- TMPL_VAR NAME='branchname' --></option>
<!-- /TMPL_LOOP -->
</select>
</p>
<p class="submit"><input type="submit" value="Login &raquo;" /></p> <p class="submit"><input type="submit" value="Login &raquo;" /></p>
</form> </form>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<script type="text/javascript"> <script type="text/javascript">

4
koha-tmpl/intranet-tmpl/prog/en/help/admin/systempreferences.tmpl

@ -63,11 +63,11 @@
<li><b>printcirculationslips --</b> if set to 1, circulation "slips" are printed on your receipt printer. If set to 0, no slips are printed.</li> <li><b>printcirculationslips --</b> if set to 1, circulation "slips" are printed on your receipt printer. If set to 0, no slips are printed.</li>
<li><b>suggestion --</b> If set to 1, the Suggestions feature is activated in the OPAC. This feature allows OPAC users to suggest book purchases. When a suggestion is made in the OPAC, it is assigned the status "ASKED." A librarian then manages the suggestion and can set the status to "REJECTED" or "ORDERED." When a book is ordered and has arrived in the library, the status becomes "AVAILABLE." Suggestions that are not yet "AVAILABLE" are visible to all users of the OPAC.</li> <li><b>suggestion --</b> If set to 1, the Suggestions feature is activated in the OPAC. This feature allows OPAC users to suggest purchases. When a suggestion is made in the OPAC, it is assigned the status "ASKED." A librarian then manages the suggestion and can set the status to "REJECTED" or "ORDERED." When an itme is ordered and has arrived in the library, the status becomes "AVAILABLE." Suggestions that are not yet "AVAILABLE" are visible to all users of the OPAC.</li>
<li><b>template --</b> Preference order for screen templates. Koha comes with several different options for templates that control the look and feel of your Koha screens, and you can also write your own templates.</li> <li><b>template --</b> Preference order for screen templates. Koha comes with several different options for templates that control the look and feel of your Koha screens, and you can also write your own templates.</li>
<li><b>timeout --</b> Inactivity timeout period (in seconds). If a workstation is idle for longer than this period, the user will have to login again.</li> <li><b>timeout --</b> Inactivity timeout period (in seconds). If a workstation is idle for longer than this period, the user will have to login again.</li>
<li><b>virtualshelves --</b> Set virtual shelves management on or off ("1" or "0"). Users can set up and manage their own "virtual bookshelves" of favorite library items if this feature is turned on.</li></ul> <li><b>virtualshelves --</b> Set virtual shelves management on or off ("1" or "0"). Users can set up and manage their own "virtual shelves" of favorite library items if this feature is turned on.</li></ul>
<!-- TMPL_INCLUDE name="intranet-bottom.inc" --> <!-- TMPL_INCLUDE name="intranet-bottom.inc" -->

15
koha-tmpl/intranet-tmpl/prog/en/help/nohelp.tmpl

@ -1,8 +1,13 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> <!-- TMPL_INCLUDE NAME="help-top.inc" -->
<title>Online Help &rsaquo; No Help For This Topic!</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> <div id="main-compact">
<h1>Online Help</h1> <h1>Online Help</h1>
<p>Sorry, there is no help available for this topic</p> <p>Sorry, there is no help available for this topic</p>
<form action="/cgi-bin/koha/edithelp.pl" method="post">
<input type="hidden" name="referer" value="<!-- TMPL_VAR NAME="referer" -->">
<input type="hidden" name="type" value="addnew">
<input type="submit" name="submit" value="Add help">
</form>
</div> </div>
<!-- TMPL_INCLUDE name="intranet-bottom.inc" -->
<!-- TMPL_INCLUDE NAME="help-bottom.inc" -->

2
koha-tmpl/intranet-tmpl/prog/en/includes/action-catalogue.inc

@ -28,7 +28,7 @@
</div> </div>
<div class="others"> <div class="others">
<a href="#" onclick="JavaScript:window.open('/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Add_to_bookshelf','width=500,height=400,toolbar=false,scrollbars=yes'); return false;"> <a href="#" onclick="JavaScript:window.open('/cgi-bin/koha/virtualshelves/addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->','Add_to_virtualshelf','width=500,height=400,toolbar=false,scrollbars=yes'); return false;">
Add to shelf Add to shelf
</a> </a>
<a href="/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"> <a href="/cgi-bin/koha/catalogue/detailprint.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">

2
koha-tmpl/intranet-tmpl/prog/en/includes/error-top.inc

@ -54,7 +54,7 @@ a.catalogue:hover {
<div id="submenu"> <div id="submenu">
<span class="koha">options &gt;&gt;&nbsp;&nbsp;</span> <span class="koha">options &gt;&gt;&nbsp;&nbsp;</span>
<a href="/cgi-bin/koha/catalogue/search.pl" class="submenu2">search</a> <a href="/cgi-bin/koha/catalogue/search.pl" class="submenu2">search</a>
<a href="/cgi-bin/koha/bookshelves/shelves.pl" class="submenu">Virtual shelves</a> <a href="/cgi-bin/koha/virtualshelves/shelves.pl" class="submenu">Virtual shelves</a>
<a href="/cgi-bin/koha/cataloguing/addbiblio.pl" class="submenu2">Add biblio</a> <a href="/cgi-bin/koha/cataloguing/addbiblio.pl" class="submenu2">Add biblio</a>
<a href="/cgi-bin/koha/maint/catmaintain.pl" class="submenu">Cat maintenance</a> <a href="/cgi-bin/koha/maint/catmaintain.pl" class="submenu">Cat maintenance</a>
</div> </div>

5
koha-tmpl/intranet-tmpl/prog/en/includes/menu-bookshelves.inc

@ -1,5 +0,0 @@
<div id="submenu">
<a href="/cgi-bin/koha/bookshelves/shelves.pl">Shelves</a>
</div>
<div id="main">

5
koha-tmpl/intranet-tmpl/prog/en/includes/menu-virtualshelves.inc

@ -0,0 +1,5 @@
<div id="submenu">
<a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a>
</div>
<div id="main">

2
koha-tmpl/intranet-tmpl/prog/en/includes/menus.inc

@ -48,7 +48,7 @@
<input type="submit" value=" OK " class="submit" /> <input type="submit" value=" OK " class="submit" />
</form> </form>
</li> </li>
<li><a href="/cgi-bin/koha/bookshelves/shelves.pl">Virtual Shelves</a></li> <li><a href="/cgi-bin/koha/virtualshelves/shelves.pl">Virtual Shelves</a></li>
</ul> </ul>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CAN_user_editcatalogue" --> <!-- TMPL_IF NAME="CAN_user_editcatalogue" -->

7
koha-tmpl/intranet-tmpl/prog/en/tools/export.tmpl

@ -38,7 +38,7 @@
</p> </p>
<p> <p>
<label for="branch">Branch</label> <label for="branch">Library</label>
<select id="branch" name="branch"> <select id="branch" name="branch">
<option value="">-- All --</option> <option value="">-- All --</option>
<!-- TMPL_LOOP name="branchloop" --> <!-- TMPL_LOOP name="branchloop" -->
@ -69,7 +69,7 @@
<p> <p>
<label for="dont_export_fields">Don't export fields</label> <label for="dont_export_fields">Don't export fields</label>
<input id="dont_export_fields" type="text" name="dont_export_fields" /> <input id="dont_export_fields" type="text" name="dont_export_fields" />
<i>splitted by a blank. (for example: 100a 200 606)</i> <i>seperate by a blank. (e.g.: 100a 200 606)</i>
</p> </p>
</fieldset> </fieldset>
<fieldset> <fieldset>
@ -84,6 +84,9 @@
</select> </select>
format. format.
</p> </p>
<p>
<label for="filename">Filename:</label><input id="filename" tyle=text" name="filename" value="koha.mrc" />
</p>
</fieldset> </fieldset>
<input type="hidden" name="op" value="export" /> <input type="hidden" name="op" value="export" />
<input type="submit" value="Export" class="button" /> <input type="submit" value="Export" class="button" />

12
koha-tmpl/intranet-tmpl/prog/en/bookshelves/addbookbybiblionumber.tmpl → koha-tmpl/intranet-tmpl/prog/en/virtualshelves/addbybiblionumber.tmpl

@ -9,30 +9,32 @@
<!-- /TMPL_IF --> to a virtual shelf <!-- /TMPL_IF --> to a virtual shelf
</h1> </h1>
<form name="f1" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl"> <form name="f1" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"> <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
<b>Select an existing shelf</b> <b>Select an existing shelf</b>
<p> <p>
<label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIbookshelves" --> <label>Add to virtual shelf</label><!-- TMPL_VAR NAME="CGIvirtualshelves" -->
</p> </p>
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" /> <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="submit" value="Add to virtual shelf" class="submit" /> <input type="submit" value="Add to virtual shelf" class="submit" />
</form> </form>
<p>...or...</p> <p>...or...</p>
<form name="f2" method="post" action="/cgi-bin/koha/bookshelves/addbookbybiblionumber.pl"> <form name="f2" method="POST" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl">
<b>Add to a new shelf:</b> <b>Add to a new shelf:</b>
<p> <p>
<label for="newbookshelf"> <label for="newvirtualshelf">
Shelf name: Shelf name:
</label> </label>
<input type="text" name="newbookshelf" id="newbookshelf" size="40" /> <input type="hidden" name="biblionumber" id="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->"/>
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
</p> </p>
<p> <p>
<label for="category">Category:</label> <label for="category">Category:</label>
<select name="category" id="category"> <select name="category" id="category">
<option value="1">Private</option> <option value="1">Private</option>
<option value="2">Public</option> <option value="2">Public</option>
<option value="3">Free</option>
</select> </select>
</p> </p>
<input type="submit" value="Add to virtual shelf" class="submit" /> <input type="submit" value="Add to virtual shelf" class="submit" />

89
koha-tmpl/intranet-tmpl/prog/en/bookshelves/shelves.tmpl → koha-tmpl/intranet-tmpl/prog/en/virtualshelves/shelves.tmpl

@ -1,26 +1,25 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<title>Koha &rsaquo; Add to Virtual Shelf</title> <title>Koha &rsaquo; Virtual Shelves</title>
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_INCLUDE NAME="menus.inc" --> <!-- TMPL_INCLUDE NAME="menus.inc" -->
<!-- TMPL_INCLUDE NAME="menu-bookshelves.inc" --> <!-- TMPL_INCLUDE NAME="menu-virtualshelves.inc" -->
<!-- TMPL_IF Name="viewshelf" -->
<!-- TMPL_IF NAME="viewshelf" -->
<div id="action"> <div id="action">
<a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl">Back to virtual Shelves</a> <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl">Back to virtual Shelves</a>
<!-- TMPL_IF name="manageshelf" --> <!-- TMPL_IF name="manageshelf" -->
<a class="button" href="/cgi-bin/koha/bookshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR Name="shelfnumber" -->"> <a class="button" href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&shelf=<!-- TMPL_VAR NAME="shelfnumber" -->">
Modify this shelf</a> Edit this shelf</a>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
</div> </div>
<h3>Contents of <!-- TMPL_VAR Name="shelfname" --></h3> <h3>Contents of <!-- TMPL_VAR NAME="shelfname" --></h3>
<form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="post" name="mainform"> <form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post" name="mainform">
<!-- TMPL_IF NAME="itemsloop" --> <!-- TMPL_IF NAME="itemsloop" -->
<table> <table>
<input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" /> <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
<input type="hidden" name="modifyshelfcontents" value="1" /> <input type="hidden" name="modifyshelfcontents" value="1" />
<tr> <tr>
<th> <th>
@ -33,10 +32,10 @@
<th>Author</th> <th>Author</th>
<th>Call No.</th> <th>Call No.</th>
</tr> </tr>
<!-- TMPL_LOOP Name="itemsloop" --> <!-- TMPL_LOOP NAME="itemsloop" -->
<tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->> <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
<td> <td>
<input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" /> <input type="checkbox" name="REM-<!-- TMPL_VAR NAME="biblionumber" -->" />
</td> </td>
<td> <td>
<img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" /> <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
@ -58,7 +57,7 @@
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
</td> </td>
<td><!-- TMPL_VAR Name="author" --></td> <td><!-- TMPL_VAR NAME="author" --></td>
<td><!-- TMPL_VAR NAME="classification" --></td> <td><!-- TMPL_VAR NAME="classification" --></td>
</tr> </tr>
<!-- /TMPL_LOOP --> <!-- /TMPL_LOOP -->
@ -89,7 +88,7 @@
<!-- TMPL_IF name="manageshelf" --> <!-- TMPL_IF name="manageshelf" -->
<br /> <br />
<form action="/cgi-bin/koha/bookshelves/shelves.pl" method="post"> <form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="post">
<table> <table>
<tr><th colspan="2">Add an item to this shelf by barcode</th></tr> <tr><th colspan="2">Add an item to this shelf by barcode</th></tr>
<tr> <tr>
@ -98,7 +97,7 @@
</td> </td>
<td> <td>
<input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" /> <input name="addbarcode" type="text" id="addbarcode" size="14" maxlength="14" />
<input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" /> <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR NAME="shelfnumber" -->" />
<input type="hidden" name="modifyshelfcontents" value="1" /> <input type="hidden" name="modifyshelfcontents" value="1" />
<input type="submit" value="Save" /> <input type="submit" value="Save" />
</td> </td>
@ -107,16 +106,16 @@
</form> </form>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- TMPL_ELSE --> <!-- TMPL_ELSE -->
<!-- TMPL_IF Name="shelves" --> <!-- TMPL_IF NAME="shelves" -->
<!-- TMPL_IF Name="status1" --> <!-- TMPL_IF NAME="status1" -->
<p class="error"><!-- TMPL_VAR Name="string1" --></p> <p class="error"><!-- TMPL_VAR NAME="string1" --></p>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- TMPL_LOOP Name="paramsloop" --> <!-- TMPL_LOOP NAME="paramsloop" -->
<!-- TMPL_IF Name="status" --> <!-- TMPL_IF NAME="status" -->
<p class="error"><!-- TMPL_VAR Name="string" --></p> <p class="error"><!-- TMPL_VAR NAME="string" --></p>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- /TMPL_LOOP --> <!-- /TMPL_LOOP -->
<form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl"> <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl">
<input type="hidden" name="shelves" value="1"> <input type="hidden" name="shelves" value="1">
<h3>Create a new virtual shelf</h3> <h3>Create a new virtual shelf</h3>
<table> <table>
@ -125,32 +124,34 @@
<tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category"> <tr><th scope="row"><label for="category">Category:</label> </th><td><select name="category" id="category">
<option value="1">Private</option> <option value="1">Private</option>
<option value="2">Public</option> <option value="2">Public</option>
<option value="3">Free</option>
</select></td></tr></table> </select></td></tr></table>
<ul> <ul>
<li>A <b>private</b> virtual shelf is managed by you and can be seen only by you.</li> <li>A <b>private</b> virtual shelf is managed by you and can be seen only by you.</li>
<li> A <b>public</b> virtual shelf can be seen by everybody, but managed only by you.</li> <li> A <b>public</b> virtual shelf can be seen by everybody, but managed only by you.</li>
<li> An <b>open</b> virtual shelf can be seen and managed by everybody.</li>
</ul> </ul>
<p><input type="submit" value="Add a new shelf"></p> <p><input type="submit" value="Add a new shelf"></p>
</form> </form>
<!-- TMPL_IF NAME="numberCanManage" --> <!-- TMPL_IF NAME="numberCanManage" -->
<!-- TMPL_IF NAME="shelvesloop" --> <!-- TMPL_IF NAME="shelvesloop" -->
<form method="post" action="/cgi-bin/koha/bookshelves/shelves.pl" name="mainform"> <form method="post" action="/cgi-bin/koha/virtualshelves/shelves.pl" name="mainform">
<input type="hidden" name="shelves" value="1" /> <input type="hidden" name="shelves" value="1" />
<h3>Delete virtual shelves</h3> <h3>Delete virtual shelves</h3>
<table> <table>
<tr><th>&nbsp;</th><th>Shelf name</th><th>Contents</th></tr> <tr><th>&nbsp;</th><th>Shelf name</th><th>Contents</th></tr>
<!-- TMPL_LOOP Name="shelvesloop" --> <!-- TMPL_LOOP NAME="shelvesloop" -->
<!-- TMPL_IF name="canmanage" --> <!-- TMPL_IF name="canmanage" -->
<tr> <tr>
<td> <td>
<input type="checkbox" name="DEL-<!-- TMPL_VAR Name="shelf" -->" /> <input type="checkbox" name="DEL-<!-- TMPL_VAR NAME="shelf" -->" />
</td> </td>
<td> <td>
<a href="/cgi-bin/koha/bookshelves/shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a> <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a>
</td> </td>
<td> <td>
<!-- TMPL_VAR Name="shelfbookcount" --> item(s) <!-- TMPL_VAR NAME="shelfvirtualcount" --> item(s)
</td> </td>
</tr> </tr>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
@ -160,14 +161,14 @@
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<br /> <br />
<p><form class="inline" action="/cgi-bin/koha/bookshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p> <p><form class="inline" action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="submit" value="Back to virtual shelves" /></form></p>
<!-- TMPL_ELSE --> <!-- TMPL_ELSE -->
<!-- TMPL_IF name="edit" --> <!-- TMPL_IF name="edit" -->
<form method="post"> <form method="post">
<input type="hidden" name="op" value="modifsave"> <input type="hidden" name="op" value="modifsave">
<input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->"> <input type="hidden" name="shelfnumber" value="<!-- TMPL_VAR name="shelfnumber" -->">
<h3>Modify virtual shelf <!-- TMPL_VAR name="shelfname"--></h3> <h3>Edit virtual shelf '<!-- TMPL_VAR name="shelfname"-->'</h3>
<table> <table>
<tr><td><label for="shelfname">Shelf name: </label></td><td><input type="text" id="shelfname" name="shelfname" size="25" value="<!-- TMPL_VAR name="shelfname"-->" /></td></tr> <tr><td><label for="shelfname">Shelf name: </label></td><td><input type="text" id="shelfname" name="shelfname" size="25" value="<!-- TMPL_VAR name="shelfname"-->" /></td></tr>
<tr><td><label for="owner">Owner: </label></td><td><input type="hidden" id="owner" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></td></tr> <tr><td><label for="owner">Owner: </label></td><td><input type="hidden" id="owner" name="owner" value="<!-- TMPL_VAR NAME="loggedinuser" -->"><!-- TMPL_VAR NAME="loggedinusername" --></td></tr>
@ -181,27 +182,43 @@
<option value="2" selected>Public</option> <option value="2" selected>Public</option>
<!-- TMPL_ELSE --> <!-- TMPL_ELSE -->
<option value="2">Public</option> <option value="2">Public</option>
<!-- TMPL_IF NAME="category3" -->
<option value="3" selected>Free</option>
<!-- TMPL_ELSE -->
<option value="3">Free</option>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
</select></td></tr> </select></td></tr>
</table> </table>
<ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen <strong>only</strong> by you.</li> <ul><li>A <strong>private</strong> virtual shelf is managed by you and can be seen <strong>only</strong> by you.</li>
<li> A <strong>public</strong> virtual shelf can be seen by <strong>everybody</strong>, but managed only by you.</li> <li> A <strong>public</strong> virtual shelf can be seen by <strong>everybody</strong>, but managed only by you.</li>
<li> A <b>free</b> virtual shelf can be seen and managed by everybody.</li>
</ul> </ul>
<p><input type="submit" value="Save changes"></p> <p><input type="submit" value="Save changes"></p>
</form> </form>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<h3>Virtual shelves</h3> <h3>Virtual shelves</h3>
<table> <table>
<tr><th>Shelf name</th><th>Category</th><th>Content size</th><th>&nbsp;</th></tr> <tr><th>Shelf name</th><th>Category</th><th>Items</th><th>&nbsp;</th></tr>
<!-- TMPL_LOOP Name="shelvesloop" -->
<tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->><td><a href="/cgi-bin/koha/bookshelves/shelves.pl?viewshelf=<!-- TMPL_VAR Name="shelf" -->"><!-- TMPL_VAR Name="shelfname" --></a></td><td><!-- TMPL_IF NAME="category1" -->Private<!-- /TMPL_IF --><!-- TMPL_IF NAME="category2" -->Public<!-- /TMPL_IF --><!-- TMPL_IF NAME="category3" -->Free<!-- /TMPL_IF --></td><td><!-- TMPL_VAR Name="shelfbookcount" --> item(s)</td><td><!-- TMPL_IF name="mine" --><a href="/cgi-bin/koha/bookshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Modify</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr> <!-- TMPL_LOOP NAME="shelvesloop" -->
<!-- /TMPL_LOOP --> <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
</table> <td><a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=<!-- TMPL_VAR NAME="shelf" -->"><!-- TMPL_VAR NAME="shelfname" --></a></td>
<p><form action="/cgi-bin/koha/bookshelves/shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or remove virtual shelves" /></form></p> <td>
<!-- TMPL_IF NAME="viewcategory1" -->Private<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="viewcategory2" -->Public<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="viewcategory3" -->Free<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_VAR NAME="shelfvirtualcount" --> </td>
<td><!-- TMPL_IF name="mine" --><a href="/cgi-bin/koha/virtualshelves/shelves.pl?op=modif&amp;shelf=<!-- TMPL_VAR NAME="shelf" -->">Edit</a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td></tr>
<!-- /TMPL_LOOP -->
</table>
<p><form action="/cgi-bin/koha/virtualshelves/shelves.pl" method="get"><input type="hidden" value="1" name="shelves" /><input type="submit" value="Add or remove virtual shelves" /></form></p>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- /TMPL_IF -->
<br clear="both" /> <br clear="both" />

2
koha-tmpl/opac-tmpl/prog/en/includes/basket.js

@ -161,7 +161,7 @@ function addMultiple(){
function addSelToShelf() { function addSelToShelf() {
var items = document.getElementById('records').value; var items = document.getElementById('records').value;
document.location = "/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber="+items; document.location = "/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber="+items;
} }
function addSelRecords(valSel) { // function for adding a selection of biblios to the basket function addSelRecords(valSel) { // function for adding a selection of biblios to the basket

2
koha-tmpl/opac-tmpl/prog/en/opac-ISBDdetail.tmpl

@ -24,7 +24,7 @@
</a> </a>
<!-- TMPL_IF name="virtualshelves" --> <!-- TMPL_IF name="virtualshelves" -->
<!-- TMPL_IF NAME="loggedinusername" --> <!-- TMPL_IF NAME="loggedinusername" -->
<a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;"> <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
Add to My Book List Add to My Book List
</a> </a>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->

2
koha-tmpl/opac-tmpl/prog/en/opac-MARCdetail.tmpl

@ -24,7 +24,7 @@
</a> </a>
<!-- TMPL_IF name="virtualshelves" --> <!-- TMPL_IF name="virtualshelves" -->
<!-- TMPL_IF NAME="loggedinusername" --> <!-- TMPL_IF NAME="loggedinusername" -->
<a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;"> <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
Add to My Book List Add to My Book List
</a> </a>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->

18
koha-tmpl/opac-tmpl/prog/en/opac-addbookbybiblionumber.tmpl → koha-tmpl/opac-tmpl/prog/en/opac-addbybiblionumber.tmpl

@ -1,5 +1,5 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --> <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<!-- TMPL_VAR NAME="LibraryNameTitle" --> Catalog -- Add to My Book List <!-- TMPL_VAR NAME="LibraryNameTitle" --> Catalog -- Add to My Virtual Shelf
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" --> <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
@ -19,10 +19,10 @@
</h1> </h1>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<!-- TMPL_IF NAME="CGIbookshelves"--> <!-- TMPL_IF NAME="CGIvirtualshelves"-->
<form name="f1" action="/cgi-bin/koha/opac-addbookbybiblionumber.pl" method="post"> <form name="f1" action="/cgi-bin/koha/opac-addbybiblionumber.pl" method="POST">
<p><b>Select an Existing Bookshelf</b></p> <p><b>Select an Existing Virtualshelf</b></p>
<label>Add to virtual shelf</label> <!-- TMPL_VAR NAME="CGIbookshelves" --> <label>Add to virtual shelf</label> <!-- TMPL_VAR NAME="CGIvirtualshelves" -->
<input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" /> <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->" />
<input type="hidden" name="modifyshelfcontents" value="1" /> <input type="hidden" name="modifyshelfcontents" value="1" />
<input type="submit" value="Add to virtual shelf" class="submit" /> <input type="submit" value="Add to virtual shelf" class="submit" />
@ -30,13 +30,13 @@
<p>...or...</p> <p>...or...</p>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->
<form name="f2" method="post" action="/cgi-bin/koha/opac-addbookbybiblionumber.pl"> <form name="f2" method="POST" action="/cgi-bin/koha/opac-addbybiblionumber.pl">
<b>Add to a New Bookshelf:</b> <b>Add to a New Virtualshelf:</b>
<p> <p>
<label for="newbookshelf"> <label for="newvirtualshelf">
Shelf Name: Shelf Name:
</label> </label>
<input type="text" name="newbookshelf" id="newbookshelf" size="40" /> <input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
</p> </p>
<label for="category">Category:</label> <label for="category">Category:</label>
<select name="category" id="category"> <select name="category" id="category">

2
koha-tmpl/opac-tmpl/prog/en/opac-detail.tmpl

@ -24,7 +24,7 @@
</a> </a>
<!-- TMPL_IF name="virtualshelves" --> <!-- TMPL_IF name="virtualshelves" -->
<!-- TMPL_IF NAME="loggedinusername" --> <!-- TMPL_IF NAME="loggedinusername" -->
<a href="/cgi-bin/koha/opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbookbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;"> <a href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
Add to My Book List Add to My Book List
</a> </a>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->

62
koha-tmpl/opac-tmpl/prog/en/opac-shelves.tmpl

@ -13,25 +13,49 @@
<h3><a href="/cgi-bin/koha/opac-shelves.pl">Virtual Shelves</a> <img src="<!-- TMPL_VAR NAME="themelang" -->/images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <!-- TMPL_IF NAME="itemsloop" --><em><!-- TMPL_VAR Name="shelfname" --></em><!-- TMPL_ELSE -->The Virtual Shelf <em><!-- TMPL_VAR Name="shelfname" --></em> is empty<!-- /TMPL_IF --></h3> <h3><a href="/cgi-bin/koha/opac-shelves.pl">Virtual Shelves</a> <img src="<!-- TMPL_VAR NAME="themelang" -->/images/caret.gif" width="16" height="16" alt="&gt;" border="0" /> <!-- TMPL_IF NAME="itemsloop" --><em><!-- TMPL_VAR Name="shelfname" --></em><!-- TMPL_ELSE -->The Virtual Shelf <em><!-- TMPL_VAR Name="shelfname" --></em> is empty<!-- /TMPL_IF --></h3>
<form class="inline" action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform"> <form class="inline" action="/cgi-bin/koha/opac-shelves.pl" method="post" name="myform">
<table> <table>
<!-- TMPL_IF name="manageshelf" --><tr> <input type="hidden" name="viewshelf" value="<!-- TMPL_VAR Name="shelfnumber" -->" />
<th><a href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;"><img src="<!-- TMPL_VAR NAME="themelang" -->/images/checkall.gif" height="18" width="18" alt="Check All" title="Check All" border="0" /></a></th><th colspan="2">&nbsp;</th> <input type="hidden" name="modifyshelfcontents" value="1" />
</tr><!-- /TMPL_IF --> <tr>
<!-- TMPL_IF NAME="itemsloop" --> <th>
<!-- TMPL_LOOP Name="itemsloop" --> <a style="color:white;" href="/cgi-bin/koha/opac-shelves.pl" onclick="CheckAll(); return false;">Check All</a>
<tr> </th>
<!-- TMPL_IF name="manageshelf" --><td><input type="checkbox" name="REM-<!-- TMPL_VAR Name="itemnumber" -->" /></td><!-- /TMPL_IF --> <th>&nbsp;</th>
<td><!-- TMPL_IF NAME="AmazonContent" --><a class="p1" href="/cgi-bin/koha/opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->"><img src="<!-- TMPL_IF NAME="isbn" -->http://images.amazon.com/images/P/<!-- TMPL_VAR name="isbn" -->.01.TZZZZZZZ.jpg<!-- TMPL_ELSE -->http://g-images.amazon.com/images/G/01/x-site/icons/no-img-sm.gif<!-- /TMPL_IF -->" alt="image" class="thumbnail" /></a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --></td> <th>Title</th>
<td><a class="title" href="opac-detail.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR Name="title" --> <!-- TMPL_VAR NAME="subtitle" --></a> <!-- TMPL_IF NAME="author" -->by <a href="/search?q=au:<!-- TMPL_VAR NAME="author" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="author" --></a><!-- TMPL_ELSE -->&nbsp;<!-- /TMPL_IF --> <p> <!-- TMPL_IF name="publicationyear" --> - <!-- TMPL_VAR name="publicationyear" --><!-- /TMPL_IF --> <th>Author</th>
<!-- TMPL_IF name="publishercode" -->- <!-- TMPL_VAR name="publishercode" --><!-- /TMPL_IF --> <th>Call No.</th>
<!-- TMPL_IF name="place" --> ; <!-- TMPL_VAR name="place" --><!-- /TMPL_IF --> </tr>
<!-- TMPL_IF name="pages" --> <!-- TMPL_VAR name="pages" --><!-- /TMPL_IF --> <!-- TMPL_LOOP Name="itemsloop" -->
<!-- TMPL_IF name="notes" --> : <!-- TMPL_VAR name="notes" --><!-- /TMPL_IF --> <tr<!-- TMPL_IF name="color" --> class="highlight"<!-- /TMPL_IF -->>
<!-- TMPL_IF name="size" --> <!-- TMPL_VAR name="size" --><!-- /TMPL_IF --> <td>
<!-- TMPL_IF name="timestamp" --> <i>(modified on <!-- TMPL_VAR name="timestamp" -->)</i><!-- /TMPL_IF --></p> <input type="checkbox" name="MOD-<!-- TMPL_VAR Name="biblionumber" -->" />
<p><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="reserve" href="/cgi-bin/koha/opac-reserve.pl?bib=<!-- TMPL_VAR NAME="biblionumber" -->">Place Reserve</a><!-- /TMPL_IF --><!-- /TMPL_UNLESS --><img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="ccode" -->.gif" alt="<!-- TMPL_VAR NAME="ccode" -->" title="<!-- TMPL_VAR NAME="ccode" -->" /><a href="/search?q=callnum:<!-- TMPL_VAR NAME="classification" ESCAPE="URL" -->"><!-- TMPL_VAR NAME="classification" --></a></p> <input type="hidden" name="ModBiblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
</td> </td>
</tr> <td>
<!-- /TMPL_LOOP --> <img src="<!-- TMPL_VAR NAME="themelang" -->/images/<!-- TMPL_VAR NAME="itemtype" -->.gif" alt="<!-- TMPL_VAR NAME="itemtype" -->" title="<!-- TMPL_VAR NAME="itemtype" -->" />
</td>
<td>
<!-- TMPL_IF name="BiblioDefaultViewmarc" -->
<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
<!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
</a>
<!-- TMPL_ELSE -->
<!-- TMPL_IF name="BiblioDefaultViewisbd" -->
<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
<!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
</a>
<!-- TMPL_ELSE -->
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" ESCAPE="URL" -->">
<!-- TMPL_VAR NAME="title" --> <!-- TMPL_VAR NAME="subtitle" -->
</a>
<!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</a>
</td>
<td><!-- TMPL_VAR Name="author" --></td>
<td><!-- TMPL_VAR NAME="classification" --></td>
</tr>
<!-- /TMPL_LOOP -->
</table>
<!-- TMPL_ELSE --> <!-- TMPL_ELSE -->
<tr><td colspan="5">This Virtual Shelf is empty.</td></tr> <tr><td colspan="5">This Virtual Shelf is empty.</td></tr>
<!-- /TMPL_IF --> <!-- /TMPL_IF -->

16
opac/opac-addbookbybiblionumber.pl → opac/opac-addbybiblionumber.pl

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
#script to provide bookshelf management #script to provide virtualshelf management
# WARNING: This file uses 4-character tabs! # WARNING: This file uses 4-character tabs!
# #
# $Header$ # $Header$
@ -25,7 +25,7 @@
use strict; use strict;
use C4::Biblio; use C4::Biblio;
use CGI; use CGI;
use C4::BookShelves; use C4::VirtualShelves;
use C4::Circulation; use C4::Circulation;
use C4::Auth; use C4::Auth;
use C4::Output; use C4::Output;
@ -33,19 +33,19 @@ use C4::Output;
my $query = new CGI; my $query = new CGI;
my $biblionumber = $query->param('biblionumber'); my $biblionumber = $query->param('biblionumber');
my $shelfnumber = $query->param('shelfnumber'); my $shelfnumber = $query->param('shelfnumber');
my $newbookshelf = $query->param('newbookshelf'); my $newvirtualshelf = $query->param('newvirtualshelf');
my $category = $query->param('category'); my $category = $query->param('category');
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "opac-addbookbybiblionumber.tmpl", template_name => "opac-addbybiblionumber.tmpl",
query => $query, query => $query,
type => "opac", type => "opac",
authnotrequired => 1, authnotrequired => 1,
} }
); );
$shelfnumber = AddShelf( '', $newbookshelf, $loggedinuser, $category ) if $newbookshelf; $shelfnumber = AddShelf( '', $newvirtualshelf, $loggedinuser, $category ) if $newvirtualshelf;
# to know if we had to add more than one biblio. # to know if we had to add more than one biblio.
my $multiple = 0; my $multiple = 0;
@ -75,9 +75,9 @@ else {
$shelvesloop{$element} = $shelflist->{$element}->{'shelfname'}; $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
} }
my $CGIbookshelves; my $CGIvirtualshelves;
if ( @shelvesloop > 0 ) { if ( @shelvesloop > 0 ) {
$CGIbookshelves = CGI::scrolling_list ( $CGIvirtualshelves = CGI::scrolling_list (
-name => 'shelfnumber', -name => 'shelfnumber',
-values => \@shelvesloop, -values => \@shelvesloop,
-labels => \%shelvesloop, -labels => \%shelvesloop,
@ -110,7 +110,7 @@ else {
} }
$template->param ( $template->param (
CGIbookshelves => $CGIbookshelves, CGIvirtualshelves => $CGIvirtualshelves,
); );
output_html_with_http_headers $query, $cookie, $template->output; output_html_with_http_headers $query, $cookie, $template->output;

2
opac/opac-main.pl

@ -22,7 +22,7 @@ require Exporter;
use CGI; use CGI;
use C4::Auth; # get_template_and_user use C4::Auth; # get_template_and_user
use C4::Output; use C4::Output;
use C4::BookShelves; use C4::VirtualShelves;
use C4::Languages; # getTranslatedLanguages use C4::Languages; # getTranslatedLanguages
use C4::Branch; # GetBranches use C4::Branch; # GetBranches
use C4::Members; # GetMember use C4::Members; # GetMember

20
opac/opac-shelves.pl

@ -25,7 +25,7 @@
=head1 DESCRIPTION =head1 DESCRIPTION
this script is used to script to provide bookshelf management this script is used to script to provide virtualshelf management
=head1 CGI PARAMETERS =head1 CGI PARAMETERS
@ -67,10 +67,11 @@
use strict; use strict;
use CGI; use CGI;
use C4::Output; use C4::Output;
use C4::BookShelves; use C4::VirtualShelves;
use C4::Circulation; use C4::Circulation;
use C4::Auth; use C4::Auth;
use C4::Output; use C4::Output;
use C4::Biblio;
my $query = new CGI; my $query = new CGI;
@ -87,13 +88,14 @@ if ( $query->param('modifyshelfcontents') ) {
my $shelfnumber = $query->param('viewshelf'); my $shelfnumber = $query->param('viewshelf');
my $barcode = $query->param('addbarcode'); my $barcode = $query->param('addbarcode');
my ($item) = GetItemnumberFromBarcode($barcode); my ($item) = GetItemnumberFromBarcode($barcode);
my ($biblio) = GetBiblioFromItemNumber($item->{'itemnumber'});
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) { if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
AddToShelf( $item->{'itemnumber'}, $shelfnumber ); AddToShelf( $biblio->{'biblionumber'}, $shelfnumber );
foreach ( $query->param ) { foreach ( $query->param ) {
if (/MOD-(\d*)/) { if (/MOD-(\d*)/) {
my $itemnumber = $1; my $biblionumber = $1;
if ( $query->param('remove') eq "on" ) { if ( $query->param('remove') eq "on" ) {
DelFromShelf( $itemnumber, $shelfnumber ); DelFromShelf( $biblionumber, $shelfnumber );
} }
} }
} }
@ -183,7 +185,7 @@ SWITCH: {
$line{'toggle'} = $color; $line{'toggle'} = $color;
$line{'shelf'} = $element; $line{'shelf'} = $element;
$line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
$line{'shelfbookcount'} = $shelflist->{$element}->{'count'}; $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
push( @shelvesloop, \%line ); push( @shelvesloop, \%line );
} }
$template->param( $template->param(
@ -208,7 +210,7 @@ foreach my $element ( sort keys %$shelflist ) {
$line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
$line{ "category" . $shelflist->{$element}->{'category'} } = 1; $line{ "category" . $shelflist->{$element}->{'category'} } = 1;
$line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser; $line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser;
$line{'shelfbookcount'} = $shelflist->{$element}->{'count'}; $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
$line{'canmanage'} = $line{'canmanage'} =
ShelfPossibleAction( $loggedinuser, $element, 'manage' ); ShelfPossibleAction( $loggedinuser, $element, 'manage' );
$line{'firstname'} = $shelflist->{$element}->{'firstname'} $line{'firstname'} = $shelflist->{$element}->{'firstname'}
@ -265,13 +267,13 @@ output_html_with_http_headers $query, $cookie, $template->output;
# add the link to "BiblioDefaultView systempref" and not to opac-detail.pl # add the link to "BiblioDefaultView systempref" and not to opac-detail.pl
# #
# Revision 1.8.2.7 2006/12/14 17:22:55 toins # Revision 1.8.2.7 2006/12/14 17:22:55 toins
# bookshelves work perfectly with mod_perl and are cleaned. # virtualshelves work perfectly with mod_perl and are cleaned.
# #
# Revision 1.8.2.6 2006/12/14 16:04:25 toins # Revision 1.8.2.6 2006/12/14 16:04:25 toins
# sync with intranet. # sync with intranet.
# #
# Revision 1.8.2.5 2006/12/11 17:10:06 toins # Revision 1.8.2.5 2006/12/11 17:10:06 toins
# fixing some bugs on bookshelves. # fixing some bugs on virtualshelves.
# #
# Revision 1.8.2.4 2006/12/07 15:42:15 toins # Revision 1.8.2.4 2006/12/07 15:42:15 toins
# synching opac & intranet. # synching opac & intranet.

18
t/BookShelves.t → t/VirtualShelves.t

@ -1,7 +1,7 @@
#!/usr/bin/perl #!/usr/bin/perl
# #
# This file is a test script for C4::BookShelves.pm # This file is a test script for C4::VirtualShelves.pm
# Author : Antoine Farnault, antoine@koha-fr.org # Author : Antoine Farnault, antoine@koha-fr.org
# #
@ -53,16 +53,16 @@ while(my $biblionumber = $sth->fetchrow){
} }
# --- # ---
my $delete_bookshelf = qq/ my $delete_virtualshelf = qq/
DELETE FROM bookshelf WHERE 1 DELETE FROM virtualshelf WHERE 1
/; /;
my $delete_bookshelfcontent =qq/ my $delete_virtualshelfcontent =qq/
DELETE FROM shelfcontents WHERE 1 DELETE FROM shelfcontents WHERE 1
/; /;
my $sth = $dbh->prepare($delete_bookshelf); my $sth = $dbh->prepare($delete_virtualshelf);
$sth->execute; $sth->execute;
my $sth = $dbh->prepare($delete_bookshelfcontent); my $sth = $dbh->prepare($delete_virtualshelfcontent);
$sth->execute; $sth->execute;
# --- # ---
@ -72,9 +72,9 @@ $sth->execute;
# #
#----------------------------------------------------------------------# #----------------------------------------------------------------------#
use C4::BookShelves; use C4::VirtualShelves;
my $version = C4::BookShelves->VERSION; my $version = C4::VirtualShelves->VERSION;
print "\n----------Testing C4::BookShelves version ".$version."--------\n"; print "\n----------Testing C4::VirtualShelves version ".$version."--------\n";
ok($version); # First test: the module is loaded & the version is readable. ok($version); # First test: the module is loaded & the version is readable.

3
tools/export.pl

@ -29,12 +29,13 @@ use C4::Branch; # GetBranches
my $query = new CGI; my $query = new CGI;
my $op=$query->param("op"); my $op=$query->param("op");
my $filename=$query->param("filename");
my $dbh=C4::Context->dbh; my $dbh=C4::Context->dbh;
my $marcflavour = C4::Context->preference("marcflavour"); my $marcflavour = C4::Context->preference("marcflavour");
if ($op eq "export") { if ($op eq "export") {
print $query->header( -type => 'application/octet-stream', print $query->header( -type => 'application/octet-stream',
-attachment=>'koha.mrc'); -attachment=>$filename);
my $StartingBiblionumber = $query->param("StartingBiblionumber"); my $StartingBiblionumber = $query->param("StartingBiblionumber");
my $EndingBiblionumber = $query->param("EndingBiblionumber"); my $EndingBiblionumber = $query->param("EndingBiblionumber");

2
updater/updatedatabase

@ -1252,7 +1252,7 @@ my %foreign_keys = (
], ],
shelfcontents => [ shelfcontents => [
{ key => 'shelfnumber', { key => 'shelfnumber',
foreigntable => 'bookshelf', foreigntable => 'virtualshelf',
foreignkey => 'shelfnumber', foreignkey => 'shelfnumber',
onUpdate => 'CASCADE', onUpdate => 'CASCADE',
onDelete => 'CASCADE', onDelete => 'CASCADE',

99
bookshelves/addbookbybiblionumber.pl → virtualshelves/addbybiblionumber.pl

@ -1,6 +1,6 @@
#!/usr/bin/perl #!/usr/bin/perl
#script to provide bookshelf management #script to provide virtual shelf management
# #
# #
# Copyright 2000-2002 Katipo Communications # Copyright 2000-2002 Katipo Communications
@ -24,11 +24,11 @@
=head1 NAME =head1 NAME
addbookbybiblionumber.pl addbybiblionumber.pl
=head1 DESCRIPTION =head1 DESCRIPTION
This script allow to add a book in a virtual shelf from a biblionumber. This script allow to add a virtual in a virtual shelf from a biblionumber.
=head1 CGI PARAMETERS =head1 CGI PARAMETERS
@ -40,9 +40,9 @@
=item shelfnumber =item shelfnumber
the shelfnumber where to add the book. the shelfnumber where to add the virtual.
=item newbookshelf =item newvirtualshelf
if this parameter exists, then it must be equals to the name of the shelf if this parameter exists, then it must be equals to the name of the shelf
to add. to add.
@ -59,63 +59,68 @@ use strict;
use C4::Biblio; use C4::Biblio;
use CGI; use CGI;
use C4::Output; use C4::Output;
use C4::BookShelves; use C4::VirtualShelves;
use C4::Circulation; use C4::Circulation;
use C4::Auth; use C4::Auth;
#use it only to debug ! #use it only to debug !
use CGI::Carp qw/fatalsToBrowser/; use CGI::Carp qw/fatalsToBrowser/;
use warnings; use warnings;
my $query = new CGI; my $query = new CGI;
my $biblionumber = $query->param('biblionumber'); my $biblionumber = $query->param('biblionumber');
my $shelfnumber = $query->param('shelfnumber'); my $shelfnumber = $query->param('shelfnumber');
my $newbookshelf = $query->param('newbookshelf'); my $newvirtualshelf = $query->param('newvirtualshelf');
my $category = $query->param('category'); my $category = $query->param('category');
my ($template, $loggedinuser, $cookie) my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
= get_template_and_user({template_name => "bookshelves/addbookbybiblionumber.tmpl", {
query => $query, template_name => "virtualshelves/addbybiblionumber.tmpl",
type => "intranet", query => $query,
authnotrequired => 0, type => "intranet",
flagsrequired => {catalogue => 1}, authnotrequired => 0,
}); flagsrequired => { catalogue => 1 },
}
$shelfnumber = AddShelf($newbookshelf,$loggedinuser,$category) if $newbookshelf; );
if ($shelfnumber || ($shelfnumber == -1)) { # the shelf already exist. $shelfnumber = AddShelf( $newvirtualshelf, $loggedinuser, $category )
&AddToShelfFromBiblio($biblionumber, $shelfnumber); if $newvirtualshelf;
print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>"; if ( $shelfnumber || ( $shelfnumber == -1 ) ) { # the shelf already exist.
&AddToShelfFromBiblio( $biblionumber, $shelfnumber );
print
"Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
exit; exit;
} else { # this shelf doesn't already exist. }
my ( $bibliocount, @biblios ) = GetBiblio($biblionumber); else { # this shelf doesn't already exist.
my ( $bibliocount, @biblios ) = GetBiblio($biblionumber);
my ($shelflist) = GetShelves($loggedinuser,3); my ($shelflist) = GetShelves( $loggedinuser, 3 );
my @shelvesloop; my @shelvesloop;
my %shelvesloop; my %shelvesloop;
foreach my $element (sort keys %$shelflist) { foreach my $element ( sort keys %$shelflist ) {
push (@shelvesloop, $element); push( @shelvesloop, $element );
$shelvesloop{$element} = $shelflist->{$element}->{'shelfname'}; $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
} }
my $CGIbookshelves=CGI::scrolling_list( my $CGIvirtualshelves = CGI::scrolling_list(
-name => 'shelfnumber', -name => 'shelfnumber',
-values => \@shelvesloop, -values => \@shelvesloop,
-labels => \%shelvesloop, -labels => \%shelvesloop,
-size => 1, -size => 1,
-tabindex=>'', -tabindex => '',
-multiple => 0 ); -multiple => 0
);
$template->param( $template->param(
biblionumber => $biblionumber, biblionumber => $biblionumber,
title => $biblios[0]->{'title'}, title => $biblios[0]->{'title'},
author => $biblios[0]->{'author'}, author => $biblios[0]->{'author'},
CGIbookshelves => $CGIbookshelves, CGIvirtualshelves => $CGIvirtualshelves,
intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), intranetcolorstylesheet =>
intranetstylesheet => C4::Context->preference("intranetstylesheet"), C4::Context->preference("intranetcolorstylesheet"),
IntranetNav => C4::Context->preference("IntranetNav"), intranetstylesheet => C4::Context->preference("intranetstylesheet"),
); IntranetNav => C4::Context->preference("IntranetNav"),
);
output_html_with_http_headers $query, $cookie, $template->output; output_html_with_http_headers $query, $cookie, $template->output;
} }
@ -148,7 +153,7 @@ if ($shelfnumber || ($shelfnumber == -1)) { # the shelf already exist.
# theses scripts don't need to use C4::Search. # theses scripts don't need to use C4::Search.
# #
# Revision 1.4.2.3 2006/10/30 09:48:19 tipaul # Revision 1.4.2.3 2006/10/30 09:48:19 tipaul
# samll bugfix to create a bookshelf correctly # samll bugfix to create a virtualshelf correctly
# #
# Revision 1.4.2.2 2006/08/30 16:13:54 toins # Revision 1.4.2.2 2006/08/30 16:13:54 toins
# correct an error in the "if condition". # correct an error in the "if condition".

115
bookshelves/shelves.pl → virtualshelves/shelves.pl

@ -24,7 +24,7 @@
=head1 DESCRIPTION =head1 DESCRIPTION
this script is used to script to provide bookshelf management this script is used to script to provide virtualshelf management
=head1 CGI PARAMETERS =head1 CGI PARAMETERS
@ -65,7 +65,7 @@
use strict; use strict;
use CGI; use CGI;
use C4::BookShelves; use C4::VirtualShelves;
use C4::Biblio; use C4::Biblio;
use C4::Auth; use C4::Auth;
use C4::Output; use C4::Output;
@ -74,7 +74,7 @@ my $query = new CGI;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ {
template_name => "bookshelves/shelves.tmpl", template_name => "virtualshelves/shelves.tmpl",
query => $query, query => $query,
type => "intranet", type => "intranet",
authnotrequired => 0, authnotrequired => 0,
@ -86,12 +86,14 @@ if ( $query->param('modifyshelfcontents') ) {
my $shelfnumber = $query->param('viewshelf'); my $shelfnumber = $query->param('viewshelf');
my $barcode = $query->param('addbarcode'); my $barcode = $query->param('addbarcode');
my ($item) = GetItem( 0, $barcode ); my ($item) = GetItem( 0, $barcode );
my ($biblio) = GetBiblioFromItemNumber($item->{'itemnumber'});
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) { if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ) ) {
AddToShelf( $item->{'itemnumber'}, $shelfnumber ); AddToShelf( $biblio->{'biblionumber'}, $shelfnumber );
foreach ( $query->param ) { foreach ( $query->param ) {
if (/REM-(\d*)/) { if (/REM-(\d*)/) {
my $itemnumber = $1; my $biblionumber = $1;
DelFromShelf( $itemnumber, $shelfnumber ); DelFromShelf( $biblionumber, $shelfnumber );
} }
} }
} }
@ -124,6 +126,7 @@ SWITCH: {
last SWITCH; last SWITCH;
} }
if ( $query->param('viewshelf') ) { if ( $query->param('viewshelf') ) {
#check that the user can view the shelf #check that the user can view the shelf
my $shelfnumber = $query->param('viewshelf'); my $shelfnumber = $query->param('viewshelf');
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) { if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
@ -132,8 +135,9 @@ SWITCH: {
shelfname => $shelflist->{$shelfnumber}->{'shelfname'}, shelfname => $shelflist->{$shelfnumber}->{'shelfname'},
shelfnumber => $shelfnumber, shelfnumber => $shelfnumber,
viewshelf => $query->param('viewshelf'), viewshelf => $query->param('viewshelf'),
manageshelf => &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ), manageshelf =>
itemsloop => $items, &ShelfPossibleAction( $loggedinuser, $shelfnumber, 'manage' ),
itemsloop => $items,
); );
} }
last SWITCH; last SWITCH;
@ -154,47 +158,44 @@ SWITCH: {
} }
); );
} }
}
my @paramsloop;
foreach ( $query->param() ) {
my %line;
if (/DEL-(\d+)/) {
my $delshelf = $1;
my ( $status, $count ) = DelShelf($delshelf);
if ($status) {
$line{'status'} = $status;
$line{'count'} = $count;
}
} }
my @paramsloop;
foreach ( $query->param() ) {
my %line;
if (/DEL-(\d+)/) {
my $delshelf = $1;
my ( $status, $count ) = DelShelf($delshelf);
if ($status) {
$line{'status'} = $status;
$line{'count'} = $count;
}
}
#if the shelf is not deleted, %line points on null #if the shelf is not deleted, %line points on null
push( @paramsloop, \%line ); push( @paramsloop, \%line );
} }
$template->param( paramsloop => \@paramsloop ); $template->param( paramsloop => \@paramsloop );
my ($shelflist) = GetShelves( $loggedinuser, 2 ); my ($shelflist) = GetShelves( $loggedinuser, 2 );
my $color = ''; my $color = '';
my @shelvesloop; my @shelvesloop;
foreach my $element ( sort keys %$shelflist ) { foreach my $element ( sort keys %$shelflist ) {
my %line; my %line;
( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 ); ( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 );
$line{'toggle'} = $color; $line{'toggle'} = $color;
$line{'shelf'} = $element; $line{'shelf'} = $element;
$line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
$line{'shelfbookcount'} = $shelflist->{$element}->{'count'}; $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
push( @shelvesloop, \%line ); push( @shelvesloop, \%line );
} }
$template->param( $template->param(
shelvesloop => \@shelvesloop, shelvesloop => \@shelvesloop,
shelves => 1, shelves => 1,
); );
last SWITCH; last SWITCH;
} }
} }
($shelflist) = my $shelflist = GetShelves( $loggedinuser, 2 );
GetShelves( $loggedinuser, 2 )
; # rebuild shelflist in case a shelf has been added
my $color = ''; my $color = '';
my @shelvesloop; my @shelvesloop;
my $numberCanManage = 0; my $numberCanManage = 0;
@ -205,22 +206,22 @@ foreach my $element ( sort keys %$shelflist ) {
$line{'toggle'} = $color; $line{'toggle'} = $color;
$line{'shelf'} = $element; $line{'shelf'} = $element;
$line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
$line{ "category" . $shelflist->{$element}->{'category'} } = 1; $line{"viewcategory$shelflist->{$element}->{'category'}"} = 1;
$line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser; $line{'mine'} = 1 if $shelflist->{$element}->{'owner'} eq $loggedinuser;
$line{'shelfbookcount'} = $shelflist->{$element}->{'count'}; $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
$line{'canmanage'} = ShelfPossibleAction( $loggedinuser, $element, 'manage' ); $line{'canmanage'} =
ShelfPossibleAction( $loggedinuser, $element, 'manage' );
$line{'firstname'} = $shelflist->{$element}->{'firstname'} $line{'firstname'} = $shelflist->{$element}->{'firstname'}
unless $shelflist->{$element}->{'owner'} eq $loggedinuser; unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
$line{'surname'} = $shelflist->{$element}->{'surname'} $line{'surname'} = $shelflist->{$element}->{'surname'}
unless $shelflist->{$element}->{'owner'} eq $loggedinuser; unless $shelflist->{$element}->{'owner'} eq $loggedinuser;
$numberCanManage++ if $line{'canmanage'}; $numberCanManage++ if $line{'canmanage'};
push( @shelvesloop, \%line );
push( @shelvesloop, \%line );
} }
$template->param( $template->param(
shelvesloop => \@shelvesloop, shelvesloop => \@shelvesloop,
numberCanManage => $numberCanManage, numberCanManage => $numberCanManage,
); );
@ -266,10 +267,10 @@ sub shelves {
foreach my $element ( sort keys %$shelflist ) { foreach my $element ( sort keys %$shelflist ) {
my %line; my %line;
( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 ); ( $color eq 1 ) ? ( $color = 0 ) : ( $color = 1 );
$line{'toggle'} = $color; $line{'toggle'} = $color;
$line{'shelf'} = $element; $line{'shelf'} = $element;
$line{'shelfname'} = $shelflist->{$element}->{'shelfname'}; $line{'shelfname'} = $shelflist->{$element}->{'shelfname'};
$line{'shelfbookcount'} = $shelflist->{$element}->{'count'}; $line{'shelfvirtualcount'} = $shelflist->{$element}->{'count'};
push( @shelvesloop, \%line ); push( @shelvesloop, \%line );
} }
$innertemplate->param( $innertemplate->param(
@ -304,13 +305,13 @@ sub shelves {
# - adding syspref: BiblioDefaultView. # - adding syspref: BiblioDefaultView.
# #
# Revision 1.9.2.7 2006/12/14 17:22:55 toins # Revision 1.9.2.7 2006/12/14 17:22:55 toins
# bookshelves work perfectly with mod_perl and are cleaned. # virtualshelves work perfectly with mod_perl and are cleaned.
# #
# Revision 1.9.2.6 2006/12/13 10:06:05 toins # Revision 1.9.2.6 2006/12/13 10:06:05 toins
# fix a mod_perl specific bug. # fix a mod_perl specific bug.
# #
# Revision 1.9.2.5 2006/12/11 17:10:06 toins # Revision 1.9.2.5 2006/12/11 17:10:06 toins
# fixing some bugs on bookshelves. # fixing some bugs on virtualshelves.
# #
# Revision 1.9.2.4 2006/11/30 18:23:51 toins # Revision 1.9.2.4 2006/11/30 18:23:51 toins
# theses scripts don't need to use C4::Search. # theses scripts don't need to use C4::Search.
Loading…
Cancel
Save