From 1bceb919880bc5f5a1064311a6bd115fc8eb039d 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 Signed-off-by: Tomas Cohen Arazi --- 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 927533d14d..6af813c2fd 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -590,6 +590,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); @@ -617,6 +618,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 bca8b25940..5edb6cc416 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 @@ -431,6 +431,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' %]