2 #script to provide bookshelf management
3 # WARNING: This file uses 4-character tabs!
7 # Copyright 2000-2002 Katipo Communications
9 # This file is part of Koha.
11 # Koha is free software; you can redistribute it and/or modify it under the
12 # terms of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
16 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
18 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 # You should have received a copy of the GNU General Public License along with
21 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
22 # Suite 330, Boston, MA 02111-1307 USA
30 use C4::Circulation::Circ2;
32 use C4::Interface::CGI::Output;
37 my $biblionumber = $query->param('biblionumber');
38 my $shelfnumber = $query->param('shelfnumber');
39 my $newbookshelf = $query->param('newbookshelf');
40 my $category = $query->param('category');
42 my ($template, $loggedinuser, $cookie)
43 = get_template_and_user({template_name => "bookshelves/addbookbybiblionumber.tmpl",
47 flagsrequired => {catalogue => 1},
51 ($x,$x,$shelfnumber) = AddShelf('',$newbookshelf,$loggedinuser,$category) if $newbookshelf;
54 &AddToShelfFromBiblio($env, $biblionumber, $shelfnumber);
55 print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
59 my ( $bibliocount, @biblios ) = getbiblio($biblionumber);
61 my ($shelflist) = GetShelfList($loggedinuser,3);
64 foreach my $element (sort keys %$shelflist) {
65 push (@shelvesloop, $element);
66 $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
69 my $CGIbookshelves=CGI::scrolling_list( -name => 'shelfnumber',
70 -values => \@shelvesloop,
71 -labels => \%shelvesloop,
76 $template->param(biblionumber => $biblionumber,
77 title => $biblios[0]->{'title'},
78 author => $biblios[0]->{'author'},
79 CGIbookshelves => $CGIbookshelves,
80 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
81 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
82 IntranetNav => C4::Context->preference("IntranetNav"),
85 output_html_with_http_headers $query, $cookie, $template->output;
88 # Revision 1.4 2006/07/04 14:36:51 toins
89 # Head & rel_2_2 merged
91 # Revision 1.3.2.4 2006/06/20 16:21:42 oleonard
92 # Adding "tabindex=''" to CGI:scrolling_lists to prevent incorrect tabbing. See Bug 1098
94 # Revision 1.3.2.3 2006/02/05 21:59:21 kados
95 # Adds script support for IntranetNav ... see mail to koha-devel for
98 # Revision 1.3.2.2 2006/02/05 21:45:25 kados
99 # Adds support for intranetstylesheet system pref in Koha scripts
101 # Revision 1.3.2.1 2006/02/04 21:26:47 kados
102 # Adds support for intranetcolorstylesheet
104 # Revision 1.3 2004/12/15 17:28:22 tipaul
105 # adding bookshelf features :
106 # * create bookshelf on the fly
107 # * modify a bookshelf (this being not finished, will commit the rest soon)
109 # Revision 1.2 2004/11/19 16:31:30 tipaul
110 # bugfix for bookshelves not in official CVS
112 # Revision 1.1.2.2 2004/03/10 15:08:18 tipaul
113 # modifying shelves : introducing category of shelf : private, public, free for all
115 # Revision 1.1.2.1 2004/02/19 10:14:36 tipaul
116 # new feature : adding book to bookshelf from biblio detail screen.