Bugzilla – Attachment 89335 Details for
Bug 22847
Specific circ rule by patron category is displaying the default (or not displaying)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 22847: Correctly displayed circ rule values for max_holds and maxissue*
Bug-22847-Correctly-displayed-circ-rule-values-for.patch (text/plain), 4.06 KB, created by
Jonathan Druart
on 2019-05-03 21:35:40 UTC
(
hide
)
Description:
Bug 22847: Correctly displayed circ rule values for max_holds and maxissue*
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-05-03 21:35:40 UTC
Size:
4.06 KB
patch
obsolete
>From 371757735afa648989b3fe32d68b9ec5ba7f6a69 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 3 May 2019 17:34:22 -0400 >Subject: [PATCH] Bug 22847: Correctly displayed circ rule values for max_holds > and maxissue* > >There are several things going wrong on the circulation rules screen. The global rule is displayed for specific libraries (even if the rule does not exist for the library), and max_holds is always blank. > >I have trouble finding the root of the issue, but I will propose a patch to fix both problem. > >Certainly a mismatch between bug 18887 and bug 18925. > >Test plan: >0. Do not apply the patch >1. Notice the issue on the circulation rules screen >2. Apply the patch >3. Confirm that the value you set are correctly displayed (and not the propagated ones!) >--- > Koha/Template/Plugin/CirculationRules.pm | 12 ++++++------ > koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt | 6 +++--- > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/Koha/Template/Plugin/CirculationRules.pm b/Koha/Template/Plugin/CirculationRules.pm >index 004ba92736..04587d4d51 100644 >--- a/Koha/Template/Plugin/CirculationRules.pm >+++ b/Koha/Template/Plugin/CirculationRules.pm >@@ -26,9 +26,9 @@ use Koha::CirculationRules; > sub Get { > my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_; > >- $branchcode = undef if $branchcode eq q{}; >- $categorycode = undef if $categorycode eq q{}; >- $itemtype = undef if $itemtype eq q{}; >+ $branchcode = undef if $branchcode eq q{} or $branchcode eq q{*}; >+ $categorycode = undef if $categorycode eq q{} or $branchcode eq q{*}; >+ $itemtype = undef if $itemtype eq q{} or $branchcode eq q{*}; > > my $rule = Koha::CirculationRules->get_effective_rule( > { >@@ -45,9 +45,9 @@ sub Get { > sub Search { > my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_; > >- $branchcode = undef if $branchcode eq q{}; >- $categorycode = undef if $categorycode eq q{}; >- $itemtype = undef if $itemtype eq q{}; >+ $branchcode = undef if $branchcode eq q{} or $branchcode eq q{*}; >+ $categorycode = undef if $categorycode eq q{} or $branchcode eq q{*}; >+ $itemtype = undef if $itemtype eq q{} or $branchcode eq q{*}; > > my $rule = Koha::CirculationRules->search( > { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >index bca8b25940..0f26380c9b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt >@@ -411,15 +411,15 @@ > <tr> > <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td> > <td> >- [% SET patron_maxissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxissueqty' ) %] >+ [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %] > <input type="text" name="patron_maxissueqty" size="3" value="[% patron_maxissueqty | html %]"/> > </td> > <td> >- [% SET patron_maxonsiteissueqty = CirculationRules.Get( branchcode, undef, undef, 'patron_maxonsiteissueqty' ) %] >+ [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty' ) %] > <input type="text" name="patron_maxonsiteissueqty" size="3" value="[% patron_maxonsiteissueqty | html %]"/> > </td> > <td> >- [% SET rule_value = CirculationRules.Get( current_branch, '*', undef, 'max_holds' ) %] >+ [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %] > <input name="max_holds" size="3" value="[% rule_value | html %]" /> > </td> > <td> >-- >2.11.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 22847
:
89335
|
89373
|
89401
|
89439
|
89863