Bugzilla – Attachment 69475 Details for
Bug 18450
Renew in header bypasses hold block and renewal limits
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18450 - Followup - Implemented 'IF A OR B OR C {stuff}" for checking what to display
Bug-18450---Followup---Implemented-IF-A-OR-B-OR-C-.patch (text/plain), 7.16 KB, created by
Alex Buckley
on 2017-12-04 04:47:26 UTC
(
hide
)
Description:
Bug 18450 - Followup - Implemented 'IF A OR B OR C {stuff}" for checking what to display
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-12-04 04:47:26 UTC
Size:
7.16 KB
patch
obsolete
>From 3791be6da5eb8189fd210293a527d291cfe164aa Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Mon, 4 Dec 2017 15:23:02 +1300 >Subject: [PATCH] Bug 18450 - Followup - Implemented 'IF A OR B OR C {stuff}" > for checking what to display > >Implemented a conditional checking if the item that the patron is trying >to renew has more than 1 copy available which can be renewed. This means >the AllowRebnewalIfOtherItemsAvailable system preference is now >appropriately implemented. > >Test plan: >1. In More->Administration->Global system preferences >ensure that both the AllowRenewalLimitOverride and >AllowRenewalIfOtherItemsAvaliable preferences are both set to 'Dont >allow'. > >2. Place a hold on an item > >3. Checkout the item out to a different patron > >4. Renew the item and notice the 'Cannot renew: The item is on hold for >another patron' warning > >5. Click the 'Override and renew' button and notice that you >can bypass the hold > >6. Apply patch > >7. Try to renew an item (with item level hold on it) which belongs to a biblio with either only one >item or a biblio with multiple items all of which have holds on them. >Notice the only button in the yellow message box displayed is >'Continue without renewing' > >8. Repeat step 7 but change the hold to a 'Next available' hold rather >than an item level hold. Again notice only the 'Continue without >renewing' button is displayed > >9. Try to renew an item (with item level hold on it) which belongs to a >biblio with mutliple aviable items of it in the catalogue. Notice only >the 'Continue without renewing' button is displayed > >10. Repeat step 9 but change the hold to a 'Next available' hold rather >than an item level hold. Notice only the 'Continue without renewing' >button is displayed > >11. Set both AllowRenewalLimitOverride and >AllowRenewalIfOtherItemsAvaliable systempreferences to 'Allow' and >repeat step 7 notice only the 'Continue without renewing' button is >displayed in the yellow message box > >12. Repeat step 8 and notice only the 'Continue without renewing' button >is displayed > >13. Repeat step 9 and notice only the 'Continue without renewing' button >is displayed > >14. Repeat step 10 and notice the item is immediately renewed and the >yellow message box is not displayed > >15. Set the AllowRenewalIfOtheritemsAvailable to 'Dont' Allow' and >repeat step 7 and notice that both the 'Override and renew' and 'Continue without renewal' buttons are >displayed > >16. Repeat step 8 and notice both buttons are displayed > >17. Repeat step 9 and notice both buttons are displayed > >18. Repeat step 10 and notice both buttons are displayed > >19. Set AllowRenewalIfOtherItemsAvailable syspref to 'Allow' and >AllowRenewalLimitOverride syspref to 'Dont' Allow' and repeat step 7 and >notice only the 'Continue without renewal' button is displayed > >20. Repeat step 8 and notice only 'Continue without renewal' button is >displayed > >21. Repeat step 9 and notice only the 'Continue without renewal' button >is displayed > >22. Repeat step 10 and notice both buttons are displayed > >Sponsored-By: Catalyst IT >--- > C4/Circulation.pm | 1 + > circ/renew.pl | 2 ++ > .../intranet-tmpl/prog/en/modules/circ/renew.tt | 21 +++++++-------------- > 3 files changed, 10 insertions(+), 14 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 9397cbc..17c321b 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -2639,6 +2639,7 @@ sub CanBookBeRenewed { > my ( $reserve_found, $reserve, undef ) = > C4::Reserves::CheckReserves( $itemnumber, undef, undef, \@borrowernumbers ); > >+ warn $reserve_found; > if ($reserve_found) { > push( @borrowernumbers, $reserve->{borrowernumber} ); > } >diff --git a/circ/renew.pl b/circ/renew.pl >index 246c266..fdcfe9d 100755 >--- a/circ/renew.pl >+++ b/circ/renew.pl >@@ -76,6 +76,8 @@ if ($barcode) { > else { > $can_renew = 0; > } >+ >+ $template->param(can_renew => $can_renew ); > } > > if ( $error && ($error eq 'too_soon' or $error eq 'auto_too_soon') ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >index 7603710..c5769d5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/renew.tt >@@ -106,20 +106,13 @@ > > <p>This item is on hold for another patron.</p> > >- [% IF (Koha.Preference('AllowRenewalLimitOverride')) && (Koha.Preference('AllowRenewalIfOtherItemsAvailable')) %] >- <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="hidden" name="override_holds" value="1" /> >- <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button> >- </form> >- [% ELSIF (!(Koha.Preference('AllowRenewalLimitOverride')) && (Koha.Preference('AllowRenewalIfOtherItemsAvailable'))) || (Koha.Preference('AllowRenewalLimitOverride') && (!(Koha.Preference('AllowRenewalIfOtherItemsAvaliable')))) %] >- <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="hidden" name="override_holds" value="1" /> >- <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button> >- </form> >+ [% IF (can_renew == 1 && (!Koha.Preference('AllowRenewalLimitOverride')) && ((Koha.Preference('AllowRenewalIfOtherItemsAvailable')))) || (can_renew==1 && (Koha.Preference('AllowRenewalLimitOverride')) && (!(Koha.Preference('AllowRenewalIfOtherItemsAvaliable')))) || (can_renew == 1 && (Koha.Preference('AllowRenewalLimitOverride')) && ((Koha.Preference('AllowRenewalIfOtherItemsAvailable')))) %] >+ <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="hidden" name="override_holds" value="1" /> >+ <button type="submit" class="approve"><i class="fa fa-check"></i> Override and renew</button> >+ </form> > [% END %] > [% ELSIF error == "patron_restricted" %] > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18450
:
62339
|
62447
|
62811
|
63226
|
63292
|
63293
|
63377
|
63764
|
64402
|
69475
|
69476
|
69489
|
72835
|
72836
|
86587
|
86588
|
86589
|
86590
|
86591
|
87337
|
87338
|
87528
|
87529