#!/usr/bin/perl #script to place reserves/requests #writen 2/1/00 by chris@katipo.oc.nz # Copyright 2000-2002 Katipo Communications # # This file is part of Koha. # # Koha is free software; you can redistribute it and/or modify it under the # terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # Koha is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # # You should have received a copy of the GNU General Public License along with # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA use strict; #use DBI; use C4::Search; use C4::Output; use C4::Reserves2; use C4::Acquisitions; use C4::Koha; use C4::Circulation::Circ2; use CGI; my $input = new CGI; # get biblio information.... my $bib = $input->param('bib'); my $dat = bibdata($bib); # get existing reserves ..... my ($count,$reserves) = FindReserves($bib); foreach my $res (@$reserves) { if ($res->{'found'} eq 'W') { $count--; } } # make priorities options my $num = $count + 1; my $priorityoptions = priorityoptions($num, $num); # get branch information my $branch = $input->cookie('branch'); ($branch) || ($branch = 'L'); my $branches = getbranches(); my $branchoptions = branchoptions($branch); # todays date my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =localtime(time); $year=$year+1900; $mon++; my $date="$mday/$mon/$year"; # get biblioitem information and build rows for form my ($count2,@data) = bibitems($bib); my $bibitemrows = ""; for (my $i=0; $i<$count2; $i++) { my @barcodes = barcodes($data[$i]->{'biblioitemnumber'}); if ($data[$i]->{'dewey'} == 0){ $data[$i]->{'dewey'}=""; } $data[$i]->{'volumeddesc'} = " " unless $data[$i]->{'volumeddesc'}; $data[$i]->{'dewey'}=~ s/\.0000$//; $data[$i]->{'dewey'}=~ s/00$//; my $class="$data[$i]->{'classification'}$data[$i]->{'dewey'}$data[$i]->{'subclass'}"; my $select; if ($data[$i]->{'notforloan'}) { $select = "Reference Item."; } elsif ($data[$i]->{'itemlost'} == 1) { $select = "Item Lost"; } elsif ($data[$i]->{'itemlost'} == 2) { $select = "Long Overdue"; } elsif ($data[$i]->{'wthdrawn'}) { $select = "Item Cancelled"; } else { $select = " {'biblioitemnumber'}>{'biblioitemnumber'}>"; } $bibitemrows .= <<"EOF";