got modifying reserves working correctly
This commit is contained in:
parent
70458ad800
commit
8fc581ee1c
2 changed files with 4 additions and 4 deletions
|
@ -229,11 +229,11 @@ sub getnextacctno {
|
|||
|
||||
sub updatereserves{
|
||||
#subroutine to update a reserve
|
||||
my ($rank,$biblio,$borrower,$del)=@_;
|
||||
my ($rank,$biblio,$borrower,$del,$branch)=@_;
|
||||
my $dbh=C4Connect;
|
||||
my $query="Update reserves ";
|
||||
if ($del ==0){
|
||||
$query.="set priority='$rank' where
|
||||
$query.="set priority='$rank',branchcode='$branch' where
|
||||
biblionumber=$biblio and borrowernumber=$borrower";
|
||||
} else {
|
||||
$query="Select * from reserves where biblionumber=$biblio and
|
||||
|
|
|
@ -19,12 +19,12 @@ my $input = new CGI;
|
|||
my @rank=$input->param('rank-request');
|
||||
my @biblio=$input->param('biblio');
|
||||
my @borrower=$input->param('borrower');
|
||||
|
||||
my @branch=$input->param('pickup');
|
||||
my $count=@rank;
|
||||
my $del=0;
|
||||
for (my $i=0;$i<$count;$i++){
|
||||
if ($rank[$i] ne 'del' && $del == 0){
|
||||
updatereserves($rank[$i],$biblio[$i],$borrower[$i],0); #from C4::Reserves2
|
||||
updatereserves($rank[$i],$biblio[$i],$borrower[$i],0,$branch[$i]); #from C4::Reserves2
|
||||
|
||||
} elsif ($rank[$i] eq 'del'){
|
||||
updatereserves($rank[$i],$biblio[$i],$borrower[$i],1); #from C4::Reserves2
|
||||
|
|
Loading…
Reference in a new issue