Fix for bug 1402, now if a renewal fails, the librarian is aware of it

Another patch to come

Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Cormack 2007-11-06 14:28:31 -06:00 committed by Joshua Ferraro
parent e24c036094
commit 9123b86bb8
3 changed files with 15 additions and 9 deletions

View File

@ -214,6 +214,9 @@
<!-- /TMPL_IF -->
</td>
<td><a href="/cgi-bin/koha/circ/returns.pl?barcode=<!-- TMPL_VAR NAME="barcode" -->">Check In</a></td>
<!-- TMPL_IF NAME="renew_failed" -->
<td>Renewal Failed</td>
<!-- /TMPL_IF -->
</tr>
<!-- /tmpl_loop -->
<tr>

View File

@ -50,6 +50,10 @@ my $dbh = C4::Context->dbh;
my $input = new CGI;
my $print = $input->param('print');
my @failedrenews = $input->param('failedrenew');
my @renew_failed;
for (@failedrenews) { $renew_failed[$_] = 1; }
my $template_name;
if ($print eq "page") { $template_name = "members/moremember-print.tmpl"; }
@ -208,6 +212,7 @@ for ( my $i = 0 ; $i < $count ; $i++ ) {
#check item is not reserved
my ( $restype, $reserves ) = CheckReserves( $issue->[$i]{'itemnumber'} );
$row{'norenew'} = ($restype) ? 1 : 0;
$row{'renew_failed'} = $renew_failed[$issue->[$i]{'itemnumber'}];
push( @issuedata, \%row );
}

View File

@ -44,16 +44,14 @@ my $branch=$input->param('branch');
#
my $cardnumber = $input->param("cardnumber");
my $borrowernumber = $input->param("borrowernumber");
my $failedrenews;
foreach my $itemno (@data) {
#check status before renewing issue
# warn "CanBookbeRenewed";
# check status before renewing issue
if (CanBookBeRenewed($borrowernumber,$itemno)){
# warn "$itemno can be renewed for $borrowernumber";
AddRenewal($borrowernumber,$itemno,$branch);
# warn "renewal added";
# }else {
# warn "cannot renew";
}
else {
$failedrenews.="&failedrenew=$itemno";
}
}
@ -62,11 +60,11 @@ foreach my $itemno (@data) {
#
if ($input->param('destination') eq "circ"){
print $input->redirect(
'/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber
'/cgi-bin/koha/circ/circulation.pl?findborrower='.$cardnumber.$failedrenews
);
}
else {
print $input->redirect(
'/cgi-bin/koha/members/moremember.pl?borrowernumber='.$borrowernumber
'/cgi-bin/koha/members/moremember.pl?borrowernumber='.$borrowernumber.$failedrenews
);
}