From 275b44c92debb6413c273229c83b22fa5e4ebbd5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 28 Feb 2020 14:28:21 +0100 Subject: [PATCH] Bug 24159: Add UI changes Sponsored-by: Institute of Technology Carlow --- admin/smart-rules.pl | 3 +++ .../prog/en/modules/admin/smart-rules.tt | 27 ++++++++++++++++--- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 236ca8f062..d01563e74b 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -96,6 +96,7 @@ if ($op eq 'delete') { chargeperiod => undef, chargeperiod_charge_at => undef, issuelength => undef, + useDaysMode => undef, lengthunit => undef, hardduedate => undef, hardduedatecompare => undef, @@ -279,6 +280,7 @@ elsif ($op eq 'add') { my $onshelfholds = $input->param('onshelfholds') || 0; my $issuelength = $input->param('issuelength'); $issuelength = $issuelength eq q{} ? undef : $issuelength; + my $useDaysMode = $input->param('useDaysMode'); my $lengthunit = $input->param('lengthunit'); my $hardduedate = $input->param('hardduedate') || undef; $hardduedate = eval { dt_from_string( $input->param('hardduedate') ) } if ( $hardduedate ); @@ -304,6 +306,7 @@ elsif ($op eq 'add') { chargeperiod => $chargeperiod, chargeperiod_charge_at => $chargeperiod_charge_at, issuelength => $issuelength, + useDaysMode => $useDaysMode, lengthunit => $lengthunit, hardduedate => $hardduedate, hardduedatecompare => $hardduedatecompare, 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 e0f50bf619..ff39f5850c 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 @@ -130,6 +130,7 @@ [% SET maxissueqty = all_rules.$c.$i.maxissueqty %] [% SET maxonsiteissueqty = all_rules.$c.$i.maxonsiteissueqty %] [% SET issuelength = all_rules.$c.$i.issuelength %] + [% SET useDaysMode = all_rules.$c.$i.useDaysMode %] [% SET lengthunit = all_rules.$c.$i.lengthunit %] [% SET hardduedate = all_rules.$c.$i.hardduedate %] [% SET hardduedatecompare = all_rules.$c.$i.hardduedatecompare %] @@ -156,7 +157,7 @@ [% SET article_requests = all_rules.$c.$i.article_requests %] [% SET rentaldiscount = all_rules.$c.$i.rentaldiscount %] - [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %] + [% SET show_rule = maxissueqty || maxonsiteissueqty || issuelength || useDaysMode || lengthunit || hardduedate || hardduedatebefore || hardduedateexact || fine || chargeperiod || chargeperiod_charge_at || firstremind || overduefinescap || cap_fine_to_replacement_price || finedays || maxsuspensiondays || suspension_chargeperiod || renewalsallowed || renewalsallowed || norenewalbefore || auto_renew || no_auto_renewal_after || no_auto_renewal_after_hard_limit || reservesallowed || holds_per_day || holds_per_record || onshelfholds || opacitemholds || article_requests || article_requests %] [% IF show_rule %] [% SET row_count = row_count + 1 %] @@ -198,6 +199,14 @@ [% END %] [% issuelength | html %] + + [% SWITCH useDaysMode %] + [% CASE 'Calendar' %]Calendar + [% CASE 'Datedue' %]Datedue + [% CASE 'Days' %]Days + [% CASE 'Dayweek' %]Dayweek + [% CASE %]Default + [% END %] [% IF ( lengthunit == 'days' ) %] Days @@ -335,6 +344,15 @@ + + + "); - } else if ( i == 4 || i == 5 || i == 24 || i == 25 || i == 26 ) { + } else if ( i == 5 || i == 6 || i == 25 || i == 26 || i == 27 ) { // If the value is not an integer for // - "Current checkouts allowed" // - "Current on-site checkouts allowed" -- 2.20.1