From 7289214e30083ae6addb9137b0480ea5b68b8d71 Mon Sep 17 00:00:00 2001 From: Jacek Ablewicz Date: Sat, 23 Aug 2014 16:36:21 +0200 Subject: [PATCH] Bug 12811 - Patron 'Details' and 'Check out' pages not working for staff users without renewal override permissions In case when the staff user doesn't have (circulate) -> (override_renewals) permission granted, this code part var AllowRenewalLimitOverride = [% CAN_user_circulate_override_renewals && AllowRenewalLimitOverride %]; in circ/circulation.tt and members/moremember.tt leads to javascript error, because TT statement evaluates to empty string. To reproduce: - set AllowRenewalLimitOverride syspref to "Don't allow" (this step is possibly redundant / not quite relevant), - for testing purposes, log in as some (sample) staff user whitch does not have permission granted for "(override_renewals) Override blocked renewals", - have a look at some patron accounts (preferably, ones with 1+ check-out), observe that page layout is incorrect in "Check Out" and "Details" tab. To test: - apply patch, - retest and ensure that this issue is no longer reproductible, - make sure that there are no regressions of any kinds regarding renewal override permission for staff users (i.e, that it still works like intended). Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Works as described, passes QA script and tests. Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 9734c0fdab..28381389f6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -32,7 +32,7 @@ var theme = "[% theme %]"; var borrowernumber = "[% borrowernumber %]"; var branchcode = "[% branch %]"; var exports_enabled = "[% exports_enabled %]"; -var AllowRenewalLimitOverride = [% CAN_user_circulate_override_renewals && AllowRenewalLimitOverride %]; +var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && AllowRenewalLimitOverride)? 1: 0 %]; var relatives_borrowernumbers = new Array(); [% FOREACH b IN relatives_borrowernumbers %] relatives_borrowernumbers.push("[% b %]"); 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 8b3fbdd155..794e383bb7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -26,7 +26,7 @@ var theme = "[% theme %]"; var borrowernumber = "[% borrowernumber %]"; var branchcode = "[% branch %]"; var exports_enabled = "[% exports_enabled %]"; -var AllowRenewalLimitOverride = [% CAN_user_circulate_override_renewals && AllowRenewalLimitOverride %]; +var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && AllowRenewalLimitOverride)? 1: 0 %]; var relatives_borrowernumbers = new Array(); [% FOREACH b IN relatives_borrowernumbers %] relatives_borrowernumbers.push("[% b %]"); -- 2.39.5