3 #script to provide bookshelf management
4 # WARNING: This file uses 4-character tabs!
8 # Copyright 2000-2002 Katipo Communications
10 # This file is part of Koha.
12 # Koha is free software; you can redistribute it and/or modify it under the
13 # terms of the GNU General Public License as published by the Free Software
14 # Foundation; either version 2 of the License, or (at your option) any later
17 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
18 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
19 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License along with
22 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
23 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Circulation::Circ2;
32 use C4::Interface::CGI::Output;
35 my $biblionumber = $query->param('biblionumber');
36 my $shelfnumber = $query->param('shelfnumber');
37 my $newbookshelf = $query->param('newbookshelf');
38 my $category = $query->param('category');
40 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
42 template_name => "opac-addbookbybiblionumber.tmpl",
49 $shelfnumber = AddShelf( '', $newbookshelf, $loggedinuser, $category ) if $newbookshelf;
51 # to know if we had to add more than one biblio.
53 $multiple = 1 if $biblionumber =~ /^(\d*\/)*$/;
59 foreach (split /\//,$biblionumber){
60 &AddToShelfFromBiblio($_,$shelfnumber);
64 &AddToShelfFromBiblio( $biblionumber, $shelfnumber );
67 print "<html><body onload=\"window.close();\"></body></html>";
71 my ($shelflist) = GetShelves( $loggedinuser, 3 );
74 foreach my $element ( sort keys %$shelflist ) {
75 push( @shelvesloop, $element );
76 $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
80 if ( @shelvesloop > 0 ) {
81 $CGIbookshelves = CGI::scrolling_list (
82 -name => 'shelfnumber',
83 -values => \@shelvesloop,
84 -labels => \%shelvesloop,
93 foreach (split /\//,$biblionumber){
94 my $data = GetBiblioData($_);
99 biblionumber => $biblionumber,
100 total => scalar @biblios,
101 biblios => \@biblios,
104 else { # just one to add.
105 my $data = GetBiblioData( $biblionumber );
107 biblionumber => $biblionumber,
108 title => $data->{'title'},
109 author => $data->{'author'},
114 CGIbookshelves => $CGIbookshelves,
117 output_html_with_http_headers $query, $cookie, $template->output;