Bugzilla – Attachment 85951 Details for
Bug 18925
Move maxissueqty and maxonsiteissueqty to circulation_rules
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18925: Fix 'Default checkout, hold policy by patron category' block
Bug-18925-Fix-Default-checkout-hold-policy-by-patr.patch (text/plain), 3.29 KB, created by
Jonathan Druart
on 2019-03-02 17:16:00 UTC
(
hide
)
Description:
Bug 18925: Fix 'Default checkout, hold policy by patron category' block
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-03-02 17:16:00 UTC
Size:
3.29 KB
patch
obsolete
>From 6d574593e4d8232b99dd28fabdece7af3c48256e Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sat, 2 Mar 2019 14:14:11 -0300 >Subject: [PATCH] Bug 18925: Fix 'Default checkout, hold policy by patron > category' block > >We want ->Search to return undef if the rule does not exist. >--- > Koha/Template/Plugin/CirculationRules.pm | 20 ++++++++++++++++++++ > .../prog/en/modules/admin/smart-rules.tt | 11 +++++------ > 2 files changed, 25 insertions(+), 6 deletions(-) > >diff --git a/Koha/Template/Plugin/CirculationRules.pm b/Koha/Template/Plugin/CirculationRules.pm >index d6c79c8c00..004ba92736 100644 >--- a/Koha/Template/Plugin/CirculationRules.pm >+++ b/Koha/Template/Plugin/CirculationRules.pm >@@ -42,4 +42,24 @@ sub Get { > return $rule->rule_value if $rule; > } > >+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{}; >+ >+ my $rule = Koha::CirculationRules->search( >+ { >+ branchcode => $branchcode, >+ categorycode => $categorycode, >+ itemtype => $itemtype, >+ rule_name => $rule_name, >+ } >+ )->next; >+ >+ return $rule->rule_value if $rule; >+} >+ >+ > 1; >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 b5134fb1d9..e41d59b655 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 >@@ -533,9 +533,9 @@ > <th> </th> > </tr> > [% FOREACH c IN categorycodes %] >- [% SET patron_maxissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxissueqty' ) %] >- [% SET patron_maxonsiteissueqty = CirculationRules.Get( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] >- [% SET max_holds = CirculationRules.Get( branchcode, c, undef, 'max_holds' ) %] >+ [% SET patron_maxissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxissueqty' ) %] >+ [% SET patron_maxonsiteissueqty = CirculationRules.Search( branchcode, c, undef, 'patron_maxonsiteissueqty' ) %] >+ [% SET max_holds = CirculationRules.Search( branchcode, c, undef, 'max_holds' ) %] > > [% IF patron_maxissueqty || patron_maxonsiteissueqty || max_holds %] > <tr> >@@ -561,9 +561,8 @@ > [% END %] > </td> > <td> >- [% SET rule_value = CirculationRules.Get( branch_cat_rule_loo.branchcode || '*', branch_cat_rule_loo.categorycode, branch_cat_rule_loo.itemtype, 'max_holds' ) %] >- [% IF rule_value.defined && rule_value != '' %] >- [% rule_value | html %] >+ [% IF max_holds.defined && max_holds != '' %] >+ [% max_holds | html %] > [% ELSE %] > <span>Unlimited</span> > [% END %] >-- >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 18925
:
65238
|
65239
|
65240
|
67024
|
67025
|
67026
|
67621
|
70992
|
70993
|
70994
|
70995
|
70996
|
71032
|
71033
|
71043
|
71044
|
71045
|
71046
|
71047
|
72225
|
72226
|
72227
|
72228
|
72229
|
77225
|
77226
|
77227
|
77228
|
77229
|
78881
|
78882
|
78883
|
78884
|
78885
|
78886
|
79642
|
79643
|
79644
|
79645
|
79646
|
81091
|
81092
|
81093
|
81094
|
81095
|
82927
|
82928
|
82929
|
82930
|
82931
|
85480
|
85481
|
85482
|
85483
|
85484
|
85485
|
85486
|
85939
|
85940
|
85941
|
85942
|
85943
|
85944
|
85945
|
85946
|
85947
|
85948
|
85949
|
85950
|
85951
|
85953
|
85954
|
85955
|
85956
|
85957
|
85958
|
85959
|
85960
|
85961
|
85962
|
85963
|
85964
|
85965
|
86068
|
86069
|
86070
|
86071
|
86072
|
86073
|
86074
|
86075
|
86076
|
86077
|
86078
|
86079
|
86080
|
86081
|
86121
|
86165
|
86206
|
86207