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