Skip to content

Commit

Permalink
Merge pull request #403 from rych/exp_holds_bug
Browse files Browse the repository at this point in the history
[#36852303] Error in cancelling waiting reserve.
  • Loading branch information
ctfliblime committed Oct 3, 2012
2 parents c229a48 + 5edfa11 commit ebf50b1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 25 deletions.
23 changes: 10 additions & 13 deletions cgi/circ/waitingreserves.pl
Expand Up @@ -68,34 +68,31 @@
# Cancel item and promote next reserve status.
# This script assumes staff has the item in hand and can process it accordingly.

my ( $messages, $nextreservinfo ) = ModReserveCancelAll( $reservenumber, $item );
CancelReserve($reservenumber);
my ($status, $nextreserve) = CheckReserves($item);
# if we have a result
if ($nextreservinfo) {
my $borrowerinfo = GetMember( $nextreservinfo, 'borrowernumber' );
if ($nextreserve) {
my $borrowerinfo = GetMember( $nextreserve->{borrowernumber}, 'borrowernumber' );
my $iteminfo = GetBiblioFromItemNumber($item);
if ( $messages->{'transfert'} ) {
$template->param(
messagetransfert => $messages->{'transfert'},
branchname => GetBranchName($messages->{'transfert'}),
);
}
my $tx = ($nextreserve->{branchcode} ~~ C4::Context->userenv->{branch}) ? '' : $nextreserve->{branchcode};

$template->param(
message => 1,
nextreservnumber => $nextreservinfo,
messagetransfert => $tx,
branchname => ($tx) ? GetBranchName($tx) : '',
nextreservnumber => $nextreserve->{reservenumber},
nextreservsurname => $borrowerinfo->{'surname'},
nextreservfirstname => $borrowerinfo->{'firstname'},
nextborrowernumber => $borrowerinfo->{'borrowernumber'},
nextbiblionumber => $iteminfo->{'biblionumber'},
nexttransfer => $messages->{'transfert'},
nexttransfer => $tx,
nextreservitem => $item,
nextreservtitle => $iteminfo->{'title'},
waiting => ($messages->{'waiting'}) ? 1 : 0,
);
}

# if the document is not in his homebranch location and there is not reservation after, we transfer it
if ($fbr ne $tbr and not $nextreservinfo) {
if ($fbr ne $tbr and not $nextreserve) {
ModItemTransfer( $item, $fbr, $tbr );
}
}
Expand Down
14 changes: 2 additions & 12 deletions koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tmpl
Expand Up @@ -25,19 +25,9 @@ $(document).ready(function(){
<div class="yui-g">

<h2>Holds awaiting pickup for your library on: <!-- TMPL_VAR NAME="show_date" --></h2>
<!-- TMPL_IF NAME="messagetransfert" -->
<div>
<h2>Hold find for (<!-- TMPL_VAR NAME="nextreservtitle" -->) must transfered</h2>
<p>This hold placed by : <b> <!-- TMPL_VAR NAME="nextreservsurname" --> <!-- TMPL_VAR NAME="nextreservfirstname" --></b> at the library : <b> <!-- TMPL_VAR NAME="branchname" --> </b>, Please transfer this hold.
</p>
<form name="cancelReservewithtransfert" action="waitingreserves.pl" method="post">
<input type="submit" class="button" />
</form>
</div>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="waiting" -->
<!-- TMPL_IF NAME="nextreservnumber" -->
<div id="bloc25">
<h2>This hold is waiting</h2>
<h2>This item is on hold for another patron</h2>
<p>This hold (<!-- TMPL_VAR NAME="nextreservtitle" -->) was placed by <b> : <!-- TMPL_VAR NAME="nextreservsurname" --> <!-- TMPL_VAR NAME="nextreservfirstname" --></b>,
Please retain this hold.
</p>
Expand Down

0 comments on commit ebf50b1

Please sign in to comment.