Bug 11577: Add 'auto_renew' and 'auto_too_soon' to renewal page
authorHolger Meißner <h.meissner.82@web.de>
Wed, 21 May 2014 13:15:11 +0000 (15:15 +0200)
committerTomas Cohen Arazi <tomascohen@gmail.com>
Wed, 17 Sep 2014 22:23:16 +0000 (19:23 -0300)
This patch adds the new renewal errors 'auto_renew' and 'auto_too_soon'
to the renewal interface.

To test:

1) Issue two items:
   - one with automatic renewal and no value for "No renewal before"
   - another with automatic renewal and a value for "No renewal before"
2) Try to renew:
   Home > Circulation > Renew
3) Confirm there are error messages explaining that the items have been
   scheduled for automatic renewal and that one of the renewals is also
   premature.
4) If global syspref AllowRenewalLimitOverride is set to "Allow" you
   should be given the option to override.

Sponsored-by: Hochschule für Gesundheit (hsg), Germany
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>

circ/renew.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt

index 38a7611..7800fc9 100755 (executable)
@@ -76,7 +76,7 @@ if ($barcode) {
                     }
                 }
 
-                if ( $error && ($error eq 'too_soon') ) {
+                if ( $error && ($error eq 'too_soon' or $error eq 'auto_too_soon') ) {
                     $soonest_renew_date = C4::Circulation::GetSoonestRenewDate(
                         $borrower->borrowernumber(),
                         $item->itemnumber(),
index 3ebd006..46a68ea 100644 (file)
                                     </form>
                                 [% END %]
 
+                            [% ELSIF error == "auto_too_soon" %]
+
+                                <p>[% item.biblio.title | $EncodeUTF8 %] [% item.biblioitem.subtitle | $EncodeUTF8 %] ( [% item.barcode %] ) has been scheduled for automatic renewal and cannot be renewed before [% soonestrenewdate | $KohaDates %]. </p>
+
+                                [% IF Koha.Preference('AllowRenewalLimitOverride') %]
+                                    <form method="post" action="/cgi-bin/koha/circ/renew.pl">
+                                        <input type="hidden" name="barcode" value="[% item.barcode %]"/>
+                                        <input type="hidden" name="override_limit" value="1" />
+                                        <input type="submit" class="approve" value="Override and renew" />
+                                    </form>
+                                [% END %]
+
+                            [% ELSIF error == "auto_renew" %]
+
+                                <p>[% item.biblio.title | $EncodeUTF8 %] [% item.biblioitem.subtitle | $EncodeUTF8 %] ( [% item.barcode %] ) has been scheduled for automatic renewal. </p>
+
+                                [% IF Koha.Preference('AllowRenewalLimitOverride') %]
+                                    <form method="post" action="/cgi-bin/koha/circ/renew.pl">
+                                        <input type="hidden" name="barcode" value="[% item.barcode %]"/>
+                                        <input type="hidden" name="override_limit" value="1" />
+                                        <input type="submit" class="approve" value="Override limit and renew" />
+                                    </form>
+                                [% END %]
+
                             [% ELSIF error == "on_reserve" %]
 
                                 <p>This item is on hold for another patron.</p>