@@ -, +, @@ or not --- Koha/Template/Plugin/CirculationRules.pm | 4 +- .../prog/en/modules/admin/smart-rules.tt | 57 +++++++++++++--------- 2 files changed, 36 insertions(+), 25 deletions(-) --- a/Koha/Template/Plugin/CirculationRules.pm +++ a/Koha/Template/Plugin/CirculationRules.pm @@ -43,7 +43,7 @@ sub Get { } sub Search { - my ( $self, $branchcode, $categorycode, $itemtype, $rule_name ) = @_; + my ( $self, $branchcode, $categorycode, $itemtype, $rule_name, $want_rule) = @_; $branchcode = undef if $branchcode eq q{} or $branchcode eq q{*}; $categorycode = undef if $categorycode eq q{} or $categorycode eq q{*}; @@ -58,8 +58,8 @@ sub Search { } )->next; + return $rule if $want_rule; return $rule->rule_value if $rule; } - 1; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt @@ -543,28 +543,39 @@ Return policy Actions + [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty', 1, 1 ) %] + [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty', 1, 1 ) %] + [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds', 1, 1 ) %] + [% SET holdallowed = CirculationRules.Search( current_branch, undef, undef, 'holdallowed', 1 ) %] + [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy', 1 ) %] + [% SET returnbranch = CirculationRules.Search( current_branch, undef, undef, 'returnbranch', 1 ) %] + [% SET dcharp = ( patron_maxissueqty || patron_maxonsiteissueqty || rule_value || holdallowed || hold_fulfillment_policy || returnbranch ) %] - Defaults - [% SET patron_maxissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxissueqty' ) %] - + [% IF ( dcharp ) %] + + Defaults + + [% ELSE %] + Not set + [% END %] + + + - [% SET patron_maxonsiteissueqty = CirculationRules.Search( current_branch, undef, undef, 'patron_maxonsiteissueqty' ) %] - + - [% SET rule_value = CirculationRules.Search( current_branch, undef , undef, 'max_holds' ) %] - + - [% SET hold_fulfillment_policy = CirculationRules.Search( current_branch, undef, undef, 'hold_fulfillment_policy' ) %] - [% IF hold_fulfillment_policy == 'any' %] + [% IF hold_fulfillment_policy.rule_value == 'any' %] @@ -615,7 +625,7 @@ [% END %] - [% IF hold_fulfillment_policy == 'holdgroup' %] + [% IF hold_fulfillment_policy.rule_value == 'holdgroup' %] @@ -625,7 +635,7 @@ [% END %] - [% IF hold_fulfillment_policy == 'patrongroup' %] + [% IF hold_fulfillment_policy.rule_value == 'patrongroup' %] @@ -635,7 +645,7 @@ [% END %] - [% IF hold_fulfillment_policy == 'homebranch' %] + [% IF hold_fulfillment_policy.rule_value == 'homebranch' %] @@ -645,7 +655,7 @@ [% END %] - [% IF hold_fulfillment_policy == 'holdingbranch' %] + [% IF hold_fulfillment_policy.rule_value == 'holdingbranch' %] @@ -658,27 +668,26 @@