Browse Source

work on reserves

master
chris 22 years ago
parent
commit
5a05e9e07d
  1. 11
      C4/Reserves2.pm
  2. 21
      placerequest.pl
  3. 11
      request.pl

11
C4/Reserves2.pm

@ -54,7 +54,8 @@ my $priv_func = sub {
sub FindReserves {
my ($bib)=@_;
my $dbh=C4Connect;
my $query="Select * from reserves where biblionumber=$bib";
my $query="Select * from reserves,borrowers where biblionumber=$bib and
reserves.borrowernumber=borrowers.borrowernumber";
my $sth=$dbh->prepare($query);
$sth->execute;
my $i=0;
@ -69,7 +70,7 @@ sub FindReserves {
}
sub CreateReserve {
my ($env,$branch,$borrnum,$biblionumber,$constraint,$bibitems) = @_;
my ($env,$branch,$borrnum,$biblionumber,$constraint,$bibitems,$priority) = @_;
my $fee=CalcReserveFee($env,$borrnum,$biblionumber,$constraint,$bibitems);
my $dbh = &C4Connect;
my $const = lc substr($constraint,0,1);
@ -88,8 +89,8 @@ sub CreateReserve {
$usth->finish;
}
my $query="insert into reserves
(borrowernumber,biblionumber,reservedate,branchcode,constrainttype)
values ('$borrnum','$biblionumber','$resdate','$branch','$const')";
(borrowernumber,biblionumber,reservedate,branchcode,constrainttype,priority)
values ('$borrnum','$biblionumber','$resdate','$branch','$const','$priority')";
my $sth = $dbh->prepare($query);
$sth->execute();
if (($const eq "o") || ($const eq "e")) {
@ -108,7 +109,7 @@ sub CreateReserve {
$i++;
}
}
print $query;
# print $query;
$dbh->disconnect();
return();
}

21
placerequest.pl

@ -11,14 +11,17 @@ use C4::Output;
use C4::Reserves2;
my $input = new CGI;
print $input->header;
#print $input->header;
my @bibitems=$input->param('biblioitem');
my $biblio=$input->param('biblio');
my $borrower=$input->param('member');
my $branch=$input->param('pickup');
my $count=@bibitems;
my @rank=$input->param('rank-request');
my $type=$input->param('type');
my $bornum=borrdata($borrower);
if ($type eq 'str8' && $bornum ne ''){
my $count=@bibitems;
@bibitems=sort @bibitems;
my $i2=1;
my @realbi;
@ -30,12 +33,18 @@ for (my $i=1;$i<$count;$i++){
$i2++;
}
}
print $input->dump;
#print $input->dump;
my $env;
my $bornum=borrdata($borrower);
my $const;
if ($input->param('request') eq 'any'){
$const='a';
}
CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@realbi);
CreateReserve(\$env,$branch,$bornum->{'borrowernumber'},$biblio,$const,\@realbi,$rank[0]);
#print @realbi;
print $input->redirect("request.pl?bib=$biblio");
} elsif ($bornum eq ''){
print $input->header();
print "Invalid card number please try again";
}

11
request.pl

@ -32,6 +32,7 @@ print <<printend
<form action="placerequest.pl" method=post>
<INPUT TYPE="image" name="submit" VALUE="request" height=42 WIDTH=187 BORDER=0 src="/images/place-request.gif" align=right >
<input type=hidden name=biblio value=$bib>
<input type=hidden name=type value=str8>
<TABLE CELLSPACING=0 CELLPADDING=5 border=1 align=left >
<!----------------BIBLIO RESERVE TABLE-------------->
@ -66,9 +67,9 @@ print <<printend
<TD><input type=text size=20 name=member></td>
<TD>$date</td>
<TD><select name=pickup>
<option value=levin>Levin
<option value=foxton>Foxton
<option value=Shannon>Shannon
<option value=L>Levin
<option value=F>Foxton
<option value=S>Shannon
</select>
</td>
<td><input type=checkbox name=request value=any>Next Available, <br>(or choose from list below)</td>
@ -147,8 +148,8 @@ print "<tr VALIGN=TOP >
<option value=\"\">Del
</select>
</td>
<TD><a href=/members/rachey-record.html>Rachey Hamilton-Williams</a></td>
<TD>1/2/00</td>
<TD><a href=/cgi-bin/koha/members.pl>$reserves->[$i]{'firstname'} $reserves->[$i]{'surname'}</a></td>
<TD>$reserves->[$i]{'reservedate'}</td>
<TD><select name=pickup>
<option value=levin>Levin
<option value=foxton>Foxton

Loading…
Cancel
Save