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.
67 #use it only to debug !
68 use CGI::Carp qw/fatalsToBrowser/;
72 my $biblionumber = $query->param('biblionumber');
73 my $shelfnumber = $query->param('shelfnumber');
74 my $newbookshelf = $query->param('newbookshelf');
75 my $category = $query->param('category');
77 my ($template, $loggedinuser, $cookie)
78 = get_template_and_user({template_name => "bookshelves/addbookbybiblionumber.tmpl",
82 flagsrequired => {catalogue => 1},
85 $shelfnumber = AddShelf($newbookshelf,$loggedinuser,$category) if $newbookshelf;
87 if ($shelfnumber || ($shelfnumber == -1)) { # the shelf already exist.
88 &AddToShelfFromBiblio($biblionumber, $shelfnumber);
89 print "Content-Type: text/html\n\n<html><body onload=\"window.close()\"></body></html>";
91 } else { # this shelf doesn't already exist.
92 my ( $bibliocount, @biblios ) = GetBiblio($biblionumber);
94 my ($shelflist) = GetShelves($loggedinuser,3);
97 foreach my $element (sort keys %$shelflist) {
98 push (@shelvesloop, $element);
99 $shelvesloop{$element} = $shelflist->{$element}->{'shelfname'};
102 my $CGIbookshelves=CGI::scrolling_list(
103 -name => 'shelfnumber',
104 -values => \@shelvesloop,
105 -labels => \%shelvesloop,
111 biblionumber => $biblionumber,
112 title => $biblios[0]->{'title'},
113 author => $biblios[0]->{'author'},
114 CGIbookshelves => $CGIbookshelves,
115 intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"),
116 intranetstylesheet => C4::Context->preference("intranetstylesheet"),
117 IntranetNav => C4::Context->preference("IntranetNav"),
120 output_html_with_http_headers $query, $cookie, $template->output;
124 # Revision 1.8 2007/04/24 13:54:29 hdl
125 # functions that were in C4::Interface::CGI::Output are now in C4::Output.
126 # So this implies quite a change for files.
127 # Sorry about conflicts which will be caused.
128 # directory Interface::CGI should now be dropped.
129 # I noticed that many scripts (reports ones, but also some circ/stats.pl or opac-topissues) still use Date::Manip.
131 # Revision 1.7 2007/04/04 16:46:22 tipaul
132 # HUGE COMMIT : code cleaning circulation.
134 # some stuff to do, i'll write a mail on koha-devel NOW !
136 # Revision 1.6 2007/03/09 14:32:26 tipaul
137 # rel_3_0 moved to HEAD
139 # Revision 1.4.2.6 2006/12/18 16:35:17 toins
140 # removing use HTML::Template from *.pl.
142 # Revision 1.4.2.5 2006/12/05 11:35:29 toins
144 # additionalauthors, bibliosubject, bibliosubtitle tables are now unused.
145 # Some functions renamed according to the coding guidelines.
147 # Revision 1.4.2.4 2006/11/30 18:23:51 toins
148 # theses scripts don't need to use C4::Search.
150 # Revision 1.4.2.3 2006/10/30 09:48:19 tipaul
151 # samll bugfix to create a bookshelf correctly
153 # Revision 1.4.2.2 2006/08/30 16:13:54 toins
154 # correct an error in the "if condition".
156 # Revision 1.4.2.1 2006/08/30 15:59:14 toins
157 # Code cleaned according to coding guide lines.
159 # Revision 1.4 2006/07/04 14:36:51 toins
160 # Head & rel_2_2 merged
162 # Revision 1.3.2.4 2006/06/20 16:21:42 oleonard
163 # Adding "tabindex=''" to CGI:scrolling_lists to prevent incorrect tabbing. See Bug 1098
165 # Revision 1.3.2.3 2006/02/05 21:59:21 kados
166 # Adds script support for IntranetNav ... see mail to koha-devel for
169 # Revision 1.3.2.2 2006/02/05 21:45:25 kados
170 # Adds support for intranetstylesheet system pref in Koha scripts