From 2707d67836e75cbaa07c525b3f93c4a1102fd26c Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Mon, 25 Mar 2019 00:43:05 -0300 Subject: [PATCH] Bug 22284: New hold group options in smart-rules This patch adds new options for 'Default checkout, hold and return policy' and 'Default holds policy by item type', both in 'Hold policy' and 'Hold pickup library match' columns To test: 1) Go to 'Circulation and fines rules' in admin 2) Check that there are no options for hold group in 'Hold policy' and 'Hold pickup library match' columns 3) Apply this patch SUCCESS => in 'Hold policy' you should see 'From local hold group' option, and in 'Hold pickup library match' you should see "Item's hold group" 4) Select any of those options and save SUCCESS => options should be selected when page reloads 5) Sign off Sponsored-by: VOKAL --- admin/smart-rules.pl | 2 ++ .../prog/en/modules/admin/smart-rules.tt | 39 ++++++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index d248f4ae48..3899d4350c 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -586,6 +586,7 @@ my @sorted_branch_item_rules = sort { lc $a->{translated_description} cmp lc $b- foreach my $entry (@sorted_branch_item_rules) { $entry->{holdallowed_any} = 1 if ( $entry->{holdallowed} == 2 ); $entry->{holdallowed_same} = 1 if ( $entry->{holdallowed} == 1 ); + $entry->{holdallowed_group} = 1 if ( $entry->{holdallowed} == 3 ); } $template->param(show_branch_cat_rule_form => 1); @@ -613,6 +614,7 @@ if ($defaults) { $template->param( default_holdallowed_none => 1 ) if ( $defaults->{holdallowed} == 0 ); $template->param( default_holdallowed_same => 1 ) if ( $defaults->{holdallowed} == 1 ); $template->param( default_holdallowed_any => 1 ) if ( $defaults->{holdallowed} == 2 ); + $template->param( default_holdallowed_group => 1 ) if ( $defaults->{holdallowed} == 3 ); $template->param( default_hold_fulfillment_policy => $defaults->{hold_fulfillment_policy} ); $template->param( default_maxissueqty => $defaults->{maxissueqty} ); $template->param( default_maxonsiteissueqty => $defaults->{maxonsiteissueqty} ); 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 e41d59b655..4cb1266872 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 @@ -430,6 +430,13 @@ [% END %] From any library + [% IF ( default_holdallowed_group ) %] + [% IF ( default_holdallowed_same ) %] [% END %] + [% IF default_hold_fulfillment_policy == 'holdgroup' %] + + [% ELSE %] + + [% END %] + [% IF default_hold_fulfillment_policy == 'homebranch' %]