Bugzilla – Attachment 109791 Details for
Bug 26301
Self-checkout blocks renew for overdues even when OverduesBlockRenewing allows it in opac-user.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26301: Use CanBookBeRenewed when renewing via self-checkout
Bug-26301-Use-CanBookBeRenewed-when-renewing-via-s.patch (text/plain), 5.61 KB, created by
Martin Renvoize (ashimema)
on 2020-09-09 12:18:23 UTC
(
hide
)
Description:
Bug 26301: Use CanBookBeRenewed when renewing via self-checkout
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-09-09 12:18:23 UTC
Size:
5.61 KB
patch
obsolete
>From fd70eb8ad523774d2535f172be08e20139a4226f Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Wed, 26 Aug 2020 07:35:36 +0000 >Subject: [PATCH] Bug 26301: Use CanBookBeRenewed when renewing via > self-checkout > >Currently, if you have OverduesBlockCirc set to "Ask for confirmation" >and OverduesBlockRenewing set to "allow renewing", you get caught >in a loop where you can never renew an overdue material. > >This patch uses CanBookBeRenewed for renewals, rather than CanBookBeIssued, >which means the correct rules are applied to the correct scenario. > >To test: > >a. Set OverduesBlockCirc to "Ask for confirmation" >b. Ensure "OverduesBlockRenewing" set to "allow renewing" >0. Apply the patch >1. Checkin item barcode 3999900000001 >2. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 >3. Checkout item barcode 3999900000001 to 1 year ago >4. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl >5. Login as the "koha" user >6. Click on "Renew item" >7. Note that the item is renewed > >8. Checkin item barcode 3999900000001 >9. Go to http://localhost:8081/cgi-bin/koha/circ/circulation.pl?borrowernumber=51 >10. Checkout item barcode 3999900000001 to 1 year ago >11. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl >12. Login as the "koha" user >13. Type "3999900000001" into the box under "Scan a new item or enter its barcode" >14. Click "Submit" >15. Note the system says the item is already checked out and it prompts >you to click "Renew item" in this screen >16. Click "Renew item" >17. Note the system says "Item renewed" near the top of the screen, and the "Due" >date near the bottom of the screen is more recent than the original due date > >18. Checkin item barcode 3999900000001 >19. Go to http://localhost:8080/cgi-bin/koha/sco/sco-main.pl >20. Login as the "koha" user >21. Type "3999900000001" into the box under "Scan a new item or enter its barcode" >22. Click "Submit" >23. Note the system says "Item checked out" and the item appears in the checkouts >at the bottom of the screen > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > .../bootstrap/en/modules/sco/sco-main.tt | 2 +- > opac/sco/sco-main.pl | 26 ++++++++++--------- > 2 files changed, 15 insertions(+), 13 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >index 8a05dd4d0b..2acdfff7c1 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt >@@ -316,7 +316,7 @@ > <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" /> >diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl >index c55791fbfc..4c405f5b5c 100755 >--- a/opac/sco/sco-main.pl >+++ b/opac/sco/sco-main.pl >@@ -138,7 +138,7 @@ elsif ( $op eq "returnbook" && $allowselfcheckreturns ) { > my ($doreturn) = AddReturn( $barcode, $branch ); > $template->param( returned => $doreturn ); > } >-elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { >+elsif ( $patron && ( $op eq 'checkout' ) ) { > my $impossible = {}; > my $needconfirm = {}; > ( $impossible, $needconfirm ) = CanBookBeIssued( >@@ -182,22 +182,14 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { > barcode => $barcode, > ); > } >- } elsif ( $needconfirm->{RENEW_ISSUE} || $op eq 'renew' ) { >- if ($confirmed) { >- #warn "renewing"; >- AddRenewal( $borrower->{borrowernumber}, $item->itemnumber ); >- push @newissueslist, $barcode; >- $template->param( renewed => 1 ); >- } else { >- #warn "renew confirmation"; >- $template->param( >+ } elsif ( $needconfirm->{RENEW_ISSUE} ){ >+ $template->param( > renew => 1, > barcode => $barcode, > confirm => 1, > confirm_renew_issue => 1, > hide_main => 1, >- ); >- } >+ ); > } elsif ( $confirm_required && !$confirmed ) { > #warn "failed confirmation"; > $template->param( >@@ -260,6 +252,16 @@ elsif ( $patron && ( $op eq 'checkout' || $op eq 'renew' ) ) { > } > } # $op > >+if ( $patron && ( $op eq 'renew' ) ) { >+ my ($status,$renewerror) = CanBookBeRenewed( $borrower->{borrowernumber}, $item->itemnumber ); >+ if ($status) { >+ #warn "renewing"; >+ AddRenewal( $borrower->{borrowernumber}, $item->itemnumber ); >+ push @newissueslist, $barcode; >+ $template->param( renewed => 1 ); >+ } >+} >+ > if ($borrower) { > # warn "issuer's branchcode: " . $issuer->{branchcode}; > # warn "user's branchcode: " . $borrower->{branchcode}; >-- >2.20.1
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 26301
:
109137
|
109791
|
109941