Bugzilla – Attachment 159522 Details for
Bug 18139
'Too many checked out' can confuse librarians
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18139: Display the rule critera used to determin the checkout limits to the template
Bug-18139-Display-the-rule-critera-used-to-determi.patch (text/plain), 9.21 KB, created by
Martin Renvoize (ashimema)
on 2023-12-04 14:10:33 UTC
(
hide
)
Description:
Bug 18139: Display the rule critera used to determin the checkout limits to the template
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2023-12-04 14:10:33 UTC
Size:
9.21 KB
patch
obsolete
>From 1ba31f6c0f054934be424d61e68cc6a23b17532e Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 28 Nov 2023 14:57:55 +0000 >Subject: [PATCH] Bug 18139: Display the rule critera used to determin the > checkout limits to the template >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >The too many checked out message can be very confusing for librarians >when the limit specified is more or less than the number of checkouts >the patron already has. We should make it clear to the librarian that >his is only counting certain types of checkouts by giving them the >issuing rule criteria used. > >Test Plan: >1) Apply this patch >2) Try to check out more items than the circ rules allow for > regular and on-site checkouts > >Signed-off-by: Eric Gosselin <eric.gosselin@inlibro.com> >Signed-off-by: Marc Véron <veron@veron.ch> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > C4/Circulation.pm | 41 ++++++++++++------- > .../prog/en/modules/circ/circulation.tt | 41 +++++++++++++++++++ > 2 files changed, 67 insertions(+), 15 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index ac28b2e74b5..13ca90e9f24 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -541,6 +541,8 @@ sub TooMany { > max_checkouts_allowed => $maxissueqty_rule ? $maxissueqty_rule->rule_value : undef, > max_onsite_checkouts_allowed => $maxonsiteissueqty_rule ? $maxonsiteissueqty_rule->rule_value : undef, > switch_onsite_checkout => $switch_onsite_checkout, >+ circulation_rule => $maxissueqty_rule, >+ onsite_circulation_rule => $maxonsiteissueqty_rule, > }; > # If parent rules exists > if ( defined($parent_maxissueqty_rule) and defined($parent_maxissueqty_rule->rule_value) ){ >@@ -589,7 +591,8 @@ sub TooMany { > onsite_checkout => $onsite_checkout, > max_checkouts_allowed => $max_checkouts_allowed, > max_onsite_checkouts_allowed => $max_onsite_checkouts_allowed, >- switch_onsite_checkout => $switch_onsite_checkout >+ switch_onsite_checkout => $switch_onsite_checkout, >+ circulation_rule => $branch_borrower_circ_rule, > } > ); > return $qty_over if defined $qty_over; >@@ -611,14 +614,17 @@ sub _check_max_qty { > my $max_checkouts_allowed = $params->{max_checkouts_allowed}; > my $max_onsite_checkouts_allowed = $params->{max_onsite_checkouts_allowed}; > my $switch_onsite_checkout = $params->{switch_onsite_checkout}; >+ my $circulation_rule = $params->{circulation_rule}; >+ my $onsite_circulation_rule = $params->{onsite_circulation_rule}; > > if ( $onsite_checkout and defined $max_onsite_checkouts_allowed ) { > if ( $max_onsite_checkouts_allowed eq '' ) { return; } > if ( $onsite_checkout_count >= $max_onsite_checkouts_allowed ) { > return { >- reason => 'TOO_MANY_ONSITE_CHECKOUTS', >- count => $onsite_checkout_count, >- max_allowed => $max_onsite_checkouts_allowed, >+ reason => 'TOO_MANY_ONSITE_CHECKOUTS', >+ count => $onsite_checkout_count, >+ max_allowed => $max_onsite_checkouts_allowed, >+ circulation_rule => $onsite_circulation_rule, > }; > } > } >@@ -627,9 +633,10 @@ sub _check_max_qty { > my $delta = $switch_onsite_checkout ? 1 : 0; > if ( $checkout_count >= $max_checkouts_allowed + $delta ) { > return { >- reason => 'TOO_MANY_CHECKOUTS', >- count => $checkout_count, >- max_allowed => $max_checkouts_allowed, >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => $checkout_count, >+ max_allowed => $max_checkouts_allowed, >+ circulation_rule => $circulation_rule, > }; > } > } >@@ -639,9 +646,10 @@ sub _check_max_qty { > $checkout_count - $onsite_checkout_count >= $max_checkouts_allowed ) > { > return { >- reason => 'TOO_MANY_CHECKOUTS', >- count => $checkout_count - $onsite_checkout_count, >- max_allowed => $max_checkouts_allowed, >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => $checkout_count - $onsite_checkout_count, >+ max_allowed => $max_checkouts_allowed, >+ circulation_rule => $circulation_rule, > }; > } > } >@@ -1019,16 +1027,19 @@ sub CanBookBeIssued { > # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book > if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { > if ( $toomany->{max_allowed} == 0 ) { >- $needsconfirmation{PATRON_CANT} = 1; >+ $needsconfirmation{PATRON_CANT} = 1; >+ $needsconfirmation{circulation_rule_PATRON_CANT} = $toomany->{circulation_rule}; > } > if ( C4::Context->preference("AllowTooManyOverride") ) { >- $needsconfirmation{TOO_MANY} = $toomany->{reason}; >+ $needsconfirmation{TOO_MANY} = $toomany->{reason}; > $needsconfirmation{current_loan_count} = $toomany->{count}; >- $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; >+ $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; >+ $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; > } else { >- $issuingimpossible{TOO_MANY} = $toomany->{reason}; >+ $issuingimpossible{TOO_MANY} = $toomany->{reason}; > $issuingimpossible{current_loan_count} = $toomany->{count}; >- $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; >+ $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; >+ $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; > } > } > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index 91a77187d5a..94dcaf6dbc1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -171,10 +171,18 @@ > > [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %] > <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li> >+ <li> >+ Maximum checkouts calculated from the circulation rule for >+ [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %] >+ </li> > [% END %] > > [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %] > <li>Too many on-site checked out. [% current_loan_count | html %] on-site checked out, only [% max_loans_allowed | html %] are allowed.</li> >+ <li> >+ Maximum checkouts calculated from the circulation rule for >+ [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %] >+ </li> > [% END %] > > [% IF ( BORRNOTSAMEBRANCH ) %] >@@ -557,6 +565,10 @@ > > [% IF ( TOO_MANY ) %] > <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li> >+ <li> >+ Maximum checkouts calculated from the circulation rule for >+ [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %] >+ </li> > [% END %] > > [% IF ( ITEMNOTSAMEBRANCH ) %] >@@ -1055,3 +1067,32 @@ > [% END %] > > [% INCLUDE 'intranet-bottom.inc' %] >+ >+[% BLOCK circulation_rule_criteria %] >+ <ul> >+ <li> >+ Item type: >+ [% IF rule.itemtype %] >+ [% ItemTypes.GetDescription( rule.itemtype ) | html %] >+ [% ELSE %] >+ <i>All</i> >+ [% END %] >+ </li> >+ <li> >+ Patron category: >+ [% IF rule.categorycode %] >+ [% Categories.GetName( rule.categorycode ) | html %] >+ [% ELSE %] >+ <i>All</i> >+ [% END %] >+ </li> >+ <li> >+ Library: >+ [% IF rule.branchcode %] >+ [% Branches.GetName( rule.branchcode ) | html %] >+ [% ELSE %] >+ <i>All libraries</i> >+ [% END %] >+ </li> >+ </ul> >+[% END %] >-- >2.43.0
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 18139
:
60427
|
60428
|
60429
|
61489
|
61490
|
61491
|
61541
|
61542
|
61543
|
61663
|
159307
|
159308
|
159522
|
159523
|
159728
|
159729
|
159740
|
159904
|
159905
|
159906
|
159907