3 #script to provide bookshelf management
6 # Copyright 2000-2002 Katipo Communications
8 # This file is part of Koha.
10 # Koha is free software; you can redistribute it and/or modify it under the
11 # terms of the GNU General Public License as published by the Free Software
12 # Foundation; either version 2 of the License, or (at your option) any later
15 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License along with
20 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
21 # Suite 330, Boston, MA 02111-1307 USA
27 addbookbybiblionumber.pl
31 This script allow to add a book in a virtual shelf from a biblionumber.
43 the shelfnumber where to add the book.
47 if this parameter exists, then it must be equals to the name of the shelf
52 if this script has to add a shelf, it add one with this category.
63 use C4::Circulation::Circ2;
65 use C4::Interface::CGI::Output;
68 #use it only to debug !
69 use CGI::Carp qw/fatalsToBrowser/;
73 my $biblionumber = $query->param('biblionumber');
74 my $shelfnumber = $query->param('shelfnumber');
75 my $newbookshelf = $query->param('newbookshelf');
76 my $category = $query->param('category');
78 my ($template, $loggedinuser, $cookie)
79 = get_template_and_user({template_name => "bookshelves/addbookbybiblionumber.tmpl",
83 flagsrequired => {catalogue => 1},
86 $shelfnumber = AddShelf($newbookshelf,$loggedinuser,$category) if $newbookshelf;
88 if ($shelfnumber || ($shelfnumber == -1)) { # the shelf already exist.
89 &AddToShelfFromBiblio($biblionumber, $shelfnumber);
90 print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
92 } else { # this shelf doesn't already exist.
93 my ( $bibliocount, @biblios ) = GetBiblio($biblionumber);
95 my ($shelflist) = GetShelves($loggedinuser,3);
98 foreach my $element (sort keys %$shelflist) {
99 push (@shelvesloop, $element);
100 $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
103 my $CGIbookshelves=CGI::scrolling_list(
104 -name => 'shelfnumber',
105 -values => \@shelvesloop,
106 -labels => \%shelvesloop,
112 biblionumber => $biblionumber,
113 title => $biblios[0]->{'title'},
114 author => $biblios[0]->{'author'},
115 CGIbookshelves => $CGIbookshelves,
116 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
117 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
118 IntranetNav => C4::Context->preference("IntranetNav"),
121 output_html_with_http_headers $query, $cookie, $template->output;
125 # Revision 1.6 2007/03/09 14:32:26 tipaul
126 # rel_3_0 moved to HEAD
128 # Revision 1.4.2.6 2006/12/18 16:35:17 toins
129 # removing use HTML::Template from *.pl.
131 # Revision 1.4.2.5 2006/12/05 11:35:29 toins
133 # additionalauthors, bibliosubject, bibliosubtitle tables are now unused.
134 # Some functions renamed according to the coding guidelines.
136 # Revision 1.4.2.4 2006/11/30 18:23:51 toins
137 # theses scripts don't need to use C4::Search.
139 # Revision 1.4.2.3 2006/10/30 09:48:19 tipaul
140 # samll bugfix to create a bookshelf correctly
142 # Revision 1.4.2.2 2006/08/30 16:13:54 toins
143 # correct an error in the "if condition".
145 # Revision 1.4.2.1 2006/08/30 15:59:14 toins
146 # Code cleaned according to coding guide lines.
148 # Revision 1.4 2006/07/04 14:36:51 toins
149 # Head & rel_2_2 merged
151 # Revision 1.3.2.4 2006/06/20 16:21:42 oleonard
152 # Adding "tabindex=''" to CGI:scrolling_lists to prevent incorrect tabbing. See Bug 1098
154 # Revision 1.3.2.3 2006/02/05 21:59:21 kados
155 # Adds script support for IntranetNav ... see mail to koha-devel for
158 # Revision 1.3.2.2 2006/02/05 21:45:25 kados
159 # Adds support for intranetstylesheet system pref in Koha scripts