Bug 18251: (QA follow-up) Add 'renew' operation and check renewal vs checkout

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
Nick Clemens 2017-03-28 14:21:29 -04:00 committed by root
parent eb62686630
commit 0b61c8e5d0
2 changed files with 5 additions and 5 deletions

View file

@ -121,7 +121,7 @@
[% UNLESS ( renew ) %] [% UNLESS ( renew ) %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post"> <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<input type="hidden" name="op" value="checkout" /> <input type="hidden" name="op" value="renew" />
<input type="hidden" name="patronid" value="[% patronid | html %]" /> <input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" /> <input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="confirmed" value="1" /> <input type="hidden" name="confirmed" value="1" />
@ -130,7 +130,7 @@
</form> </form>
[% ELSE %] [% ELSE %]
<form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post"> <form action="/cgi-bin/koha/sco/sco-main.pl" name="confirmForm" class="inline" method="post">
<input type="hidden" name="op" value="checkout" /> <input type="hidden" name="op" value="renew" />
<input type="hidden" name="patronid" value="[% patronid | html %]" /> <input type="hidden" name="patronid" value="[% patronid | html %]" />
<input type="hidden" name="barcode" value="[% barcode | html %]" /> <input type="hidden" name="barcode" value="[% barcode | html %]" />
<input type="hidden" name="confirmed" value="1" /> <input type="hidden" name="confirmed" value="1" />
@ -296,7 +296,7 @@
<input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" /> <input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
<input type="hidden" name="newissues" value="[% newissues | html %]" /> <input type="hidden" name="newissues" value="[% newissues | html %]" />
[% IF ISSUE.can_be_renewed %] [% IF ISSUE.can_be_renewed %]
<input type="hidden" name="op" value="checkout" /> <input type="hidden" name="op" value="renew" />
<input type="hidden" name="confirmed" value="1" /> <input type="hidden" name="confirmed" value="1" />
[% UNLESS ( ISSUE.renew ) %] [% UNLESS ( ISSUE.renew ) %]
<input type="submit" value="Renew item" name="confirm " class="btn renew" /> <input type="submit" value="Renew item" name="confirm " class="btn renew" />

View file

@ -131,7 +131,7 @@ elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
my ($doreturn) = AddReturn( $barcode, $branch ); my ($doreturn) = AddReturn( $barcode, $branch );
$template->param( returned => $doreturn ); $template->param( returned => $doreturn );
} }
elsif ( $patron and $op eq "checkout" ) { elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) {
my $impossible = {}; my $impossible = {};
my $needconfirm = {}; my $needconfirm = {};
( $impossible, $needconfirm ) = CanBookBeIssued( ( $impossible, $needconfirm ) = CanBookBeIssued(
@ -174,7 +174,7 @@ elsif ( $patron and $op eq "checkout" ) {
barcode => $barcode, barcode => $barcode,
); );
} }
} elsif ( $needconfirm->{RENEW_ISSUE} ) { } elsif ( $needconfirm->{RENEW_ISSUE} || $op eq 'renew' ) {
if ($confirmed) { if ($confirmed) {
#warn "renewing"; #warn "renewing";
AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} ); AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} );