From 17190de524c58b8abeca5c65506fe44bfdd93adc Mon Sep 17 00:00:00 2001 From: Natasha Date: Tue, 19 Jan 2016 00:56:56 +0000 Subject: [PATCH] bug 12920 - Remove AllowRenewalLimitOverride from pl scripts and tt files, use Koha.Preference instead Test Plan: 1) Apply this patch 2) Go to circulation.pl 3) Ensure you can still override renewal limits with pref enabled 4) Ensure you can not override renewal limits with pref disabled 5) Go to moremember.pl 6) Repeat steps 3-4 Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- circ/circulation.pl | 1 - koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- members/moremember.pl | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 57702f64cd..ea07e29532 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -636,7 +636,6 @@ $template->param( debt_confirmed => $debt_confirmed, SpecifyDueDate => $duedatespec_allow, CircAutocompl => C4::Context->preference("CircAutocompl"), - AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"), canned_bor_notes_loop => $canned_notes, debarments => GetDebarments({ borrowernumber => $borrowernumber }), todaysdate => output_pref( { dt => dt_from_string()->set(hour => 23)->set(minute => 59), dateformat => 'sql' } ), diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index fba51eebf5..5038e47371 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -37,7 +37,7 @@ var theme = "[% theme %]"; var borrowernumber = "[% borrowernumber %]"; var branchcode = "[% branch %]"; var exports_enabled = "[% exports_enabled %]"; -var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && AllowRenewalLimitOverride)? 1: 0 %]; +var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %]; var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %]; var script = "circulation"; var relatives_borrowernumbers = new Array(); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index 30cda467e6..adaedb5731 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -35,7 +35,7 @@ var borrowernumber = "[% borrowernumber %]"; var branchcode = "[% branch %]"; var exports_enabled = "[% exports_enabled %]"; var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 %] -var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && AllowRenewalLimitOverride)? 1: 0 %]; +var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 %]; var script = "moremember"; var relatives_borrowernumbers = new Array(); [% FOREACH b IN relatives_borrowernumbers %] diff --git a/members/moremember.pl b/members/moremember.pl index 796e19aff0..5426cf2ef9 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -336,7 +336,6 @@ if (C4::Context->preference('EnhancedMessagingPreferences')) { $template->param( $data->{'categorycode'} => 1 ); $template->param( detailview => 1, - AllowRenewalLimitOverride => C4::Context->preference("AllowRenewalLimitOverride"), borrowernumber => $borrowernumber, othernames => $data->{'othernames'}, categoryname => $data->{'description'}, -- 2.39.5