Bug 18251: (QA follow-up) Add 'renew' operation and check renewal vs checkout
authorNick Clemens <nick@bywatersolutions.com>
Tue, 28 Mar 2017 18:21:29 +0000 (14:21 -0400)
committerroot <root@f1ebe1bec408>
Tue, 26 Feb 2019 13:18:28 +0000 (13:18 +0000)
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>
koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt
opac/sco/sco-main.pl

index 14f543a..317a8d3 100644 (file)
 
                             [% UNLESS ( renew ) %]
                                 <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="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="confirmed" value="1" />
                                   </form>
                             [% ELSE %]
                                 <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="barcode" value="[% barcode | html %]" />
                                     <input type="hidden" name="confirmed" value="1" />
                                                         <input type="hidden" name="barcode" value="[% ISSUE.barcode | html %]" />
                                                         <input type="hidden" name="newissues" value="[% newissues | html %]" />
                                                         [% 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" />
                                                             [% UNLESS ( ISSUE.renew ) %]
                                                                 <input type="submit" value="Renew item"  name="confirm  " class="btn renew" />
index bbe0e90..dcb4c92 100755 (executable)
@@ -131,7 +131,7 @@ elsif ( $op eq "returnbook" && $allowselfcheckreturns ) {
     my ($doreturn) = AddReturn( $barcode, $branch );
     $template->param( returned => $doreturn );
 }
-elsif ( $patron and $op eq "checkout" ) {
+elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) {
     my $impossible  = {};
     my $needconfirm = {};
     ( $impossible, $needconfirm ) = CanBookBeIssued(
@@ -174,7 +174,7 @@ elsif ( $patron and $op eq "checkout" ) {
                 barcode    => $barcode,
             );
         }
-    } elsif ( $needconfirm->{RENEW_ISSUE} ) {
+    } elsif ( $needconfirm->{RENEW_ISSUE} || $op eq 'renew' ) {
         if ($confirmed) {
             #warn "renewing";
             AddRenewal( $borrower->{borrowernumber}, $item->{itemnumber} );