2 #script to provide bookshelf management
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;
35 my ($loggedinuser, $cookie, $sessionID) = checkauth($query);
36 print $query->header(-cookie => $cookie);
37 my $headerbackgroundcolor='#663266';
38 my $circbackgroundcolor='#555555';
39 my $circbackgroundcolor='#550000';
40 my $linecolor1='#bbbbbb';
41 my $linecolor2='#dddddd';
44 print startmenu('catalogue');
47 print "<p align=left>Logged in as: $loggedinuser [<a href=/cgi-bin/koha/logout.pl>Log Out</a>]</p>\n";
50 my ($shelflist) = GetShelfList();
52 if ($query->param('modifyshelfcontents')) {
53 my $shelfnumber=$query->param('shelfnumber');
54 my $barcode=$query->param('addbarcode');
55 my ($item) = getiteminformation($env, 0, $barcode);
56 AddToShelf($env, $item->{'itemnumber'}, $shelfnumber);
57 foreach ($query->param) {
60 RemoveFromShelf($env, $itemnumber, $shelfnumber);
66 if ($query->param('viewshelf')) { viewshelf($query->param('viewshelf')); last SWITCH;}
67 if ($query->param('shelves')) { shelves(); last SWITCH;}
70 <table border=0 cellpadding=4 cellspacing=0>
71 <tr><td bgcolor=$headerbackgroundcolor>
72 <table border=0 cellpadding=5 cellspacing=0 width=100%>
73 <tr><th bgcolor=$headerbackgroundcolor>
74 <font color=white>Shelf List</font>
80 foreach (sort keys %$shelflist) {
81 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
82 print "<tr><td bgcolor=$color><a href=shelves.pl?viewshelf=$_>$shelflist->{$_}->{'shelfname'} ($shelflist->{$_}->{'count'} books)</a></td></tr>\n";
85 print "<P><a href=shelves.pl?shelves=1>Add or Remove Book Shelves</a>\n";
91 if (my $newshelf=$query->param('addshelf')) {
92 my ($status, $string) = AddShelf($env,$newshelf);
94 print "<font color=red>$string</font><p>\n";
97 foreach ($query->param()) {
100 my ($status, $string) = RemoveShelf($env,$delshelf);
102 print "<font color=red>$string</font><p>\n";
106 my ($shelflist) = GetShelfList();
109 <a href=shelves.pl>Modify Shelf Contents</a><p>
111 <table border=0 cellpadding=7>
112 <tr><td align=center>
114 <input type=hidden name=shelves value=1>
115 <table border=0 cellpadding=0 cellspacing=0>
116 <tr><th bgcolor=$headerbackgroundcolor>
117 <font color=white>Select Shelves to Delete</font>
122 foreach (sort keys %$shelflist) {
123 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
124 print "<tr><td bgcolor=$color><input type=checkbox name=DEL-$_> $shelflist->{$_}->{'shelfname'} ($shelflist->{$_}->{'count'} books)</td></tr>\n";
127 print '<p><input type=submit value="Delete Shelves"><p>';
128 print "</td><td align=center valign=top>\n";
129 print "<form method=post>\n";
130 print "<input type=hidden name=shelves value=1>\n";
131 print "<p>Add Shelf: <input name=addshelf size=25><p>\n";
132 print '<p><input type=submit value="Add New Shelf"><p>';
134 print "</td></tr></table>\n";
140 my $shelfnumber=shift;
141 my ($itemlist) = GetShelfContents($env, $shelfnumber);
146 <a href=shelves.pl>Shelf List</a><p>
147 <table border=0 cellpadding=0 cellspacing=0>
150 <tr><td>Add a book by barcode:</td><td><input name=addbarcode></td></tr>
153 <table border=0 cellpadding=5 cellspacing=0 width=100%>
154 <tr><th bgcolor=$headerbackgroundcolor>
155 <font color=white>Contents of $shelflist->{$shelfnumber}->{'shelfname'} shelf</font>
161 foreach $item (sort {$a->{'barcode'} cmp $b->{'barcode'}} @$itemlist) {
162 ($color eq $linecolor1) ? ($color=$linecolor2) : ($color=$linecolor1);
165 <td bgcolor=$color><input type=checkbox name=REM-$item->{'itemnumber'}></td>
166 <td bgcolor=$color width=10 align=center><img src=/images/blankdot.gif></td>
167 <td bgcolor=$color>$item->{'barcode'}</td>
168 <td bgcolor=$color width=10 align=center><img src=/images/blankdot.gif></td>
169 <td bgcolor=$color>$item->{'title'}</td>
170 <td bgcolor=$color width=10 align=center><img src=/images/blankdot.gif></td>
171 <td bgcolor=$color>$item->{'author'}</td>
178 <input type=hidden name=shelfnumber value=$shelfnumber>
179 <input type=hidden name=modifyshelfcontents value=1>
180 <input type=hidden name=viewshelf value=$shelfnumber>
181 <input type=submit value="Remove Selected Items">
190 # Revision 1.8 2002/08/14 18:12:51 tonnesen
191 # Added copyright statement to all .pl and .pm files
193 # Revision 1.7 2002/07/05 05:03:37 tonnesen
194 # Minor changes to authentication routines.
196 # Revision 1.5 2002/07/04 19:42:48 tonnesen
199 # Revision 1.4 2002/07/04 19:21:29 tonnesen
200 # Beginning of authentication api. Applied to shelves.pl for now as a test case.
202 # Revision 1.2.2.1 2002/06/26 20:28:15 tonnesen
203 # Some udpates that I made here locally a while ago. Still won't be useful, but
204 # should be functional
212 print endmenu('catalogue');