Lines 1054-1059
itemnumber and supplying itemnumber.
Link Here
|
1054 |
sub ModReserve { |
1054 |
sub ModReserve { |
1055 |
#subroutine to update a reserve |
1055 |
#subroutine to update a reserve |
1056 |
my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_; |
1056 |
my ( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until) = @_; |
|
|
1057 |
warn "ModReserve( $rank, $biblio, $borrower, $branch , $itemnumber, $suspend_until)"; |
1057 |
return if $rank eq "W"; |
1058 |
return if $rank eq "W"; |
1058 |
return if $rank eq "n"; |
1059 |
return if $rank eq "n"; |
1059 |
my $dbh = C4::Context->dbh; |
1060 |
my $dbh = C4::Context->dbh; |
Lines 1517-1536
be cleared when it is unsuspended.
Link Here
|
1517 |
=cut |
1518 |
=cut |
1518 |
|
1519 |
|
1519 |
sub ToggleSuspend { |
1520 |
sub ToggleSuspend { |
1520 |
my ( $borrowernumber, $biblionumber ) = @_; |
1521 |
my ( $borrowernumber, $biblionumber, $suspend_until ) = @_; |
|
|
1522 |
|
1523 |
$suspend_until = C4::Dates->new( $suspend_until )->output('iso') if ( $suspend_until ); |
1524 |
|
1525 |
my $do_until = ( $suspend_until ) ? '?' : 'NULL'; |
1521 |
|
1526 |
|
1522 |
my $dbh = C4::Context->dbh; |
1527 |
my $dbh = C4::Context->dbh; |
1523 |
|
1528 |
|
1524 |
my $sth = $dbh->prepare( |
1529 |
my $sth = $dbh->prepare( |
1525 |
"UPDATE reserves SET suspend = NOT suspend, |
1530 |
"UPDATE reserves SET suspend = NOT suspend, |
1526 |
suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE suspend_until END |
1531 |
suspend_until = CASE WHEN suspend = 0 THEN NULL ELSE $do_until END |
1527 |
WHERE biblionumber = ? |
1532 |
WHERE biblionumber = ? |
1528 |
AND borrowernumber = ? |
1533 |
AND borrowernumber = ? |
1529 |
"); |
1534 |
"); |
1530 |
$sth->execute( |
1535 |
|
1531 |
$biblionumber, |
1536 |
my @params; |
1532 |
$borrowernumber, |
1537 |
push( @params, $suspend_until ) if ( $suspend_until ); |
1533 |
); |
1538 |
push( @params, $biblionumber ); |
|
|
1539 |
push( @params, $borrowernumber ); |
1540 |
|
1541 |
$sth->execute( @params ); |
1534 |
$sth->finish; |
1542 |
$sth->finish; |
1535 |
} |
1543 |
} |
1536 |
|
1544 |
|