From 0f20a2c97acb04e137db35499f0c46d27d57bf0c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marc=20V=C3=A9ron?= Date: Sun, 4 Jun 2017 18:04:00 +0200 Subject: [PATCH] Bug 18689: calendar error with double quotes in title or description of holiday This patch fixes the calendar display with holidays having double qoutes in title or description. To test: - Apply patch - Go to Home > Tools > Calendar - Create new holidays of each type (Day only, repeated wekly/yearly, range, yearly repeated range and enter double qoutes in their titles and descriptions - Verify that calendar displays and works as expected - Verify that you can edit the holidays Signed-off-by: Lee Jamison Signed-off-by: Jonathan Druart (cherry picked from commit f1d90f205e3dc8177c0d524b208d9d4a367cf56e) Signed-off-by: Fridolin Somers --- .../intranet-tmpl/prog/en/modules/tools/holidays.tt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt index 27a060c69f..4aa4e3a327 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/holidays.tt @@ -17,18 +17,17 @@ var day_month_holidays = new Array(); var hola= "[% code %]"; [% FOREACH WEEK_DAYS_LOO IN WEEK_DAYS_LOOP %] - week_days["[% WEEK_DAYS_LOO.KEY %]"] = {title:"[% WEEK_DAYS_LOO.TITLE %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION %]"}; + week_days["[% WEEK_DAYS_LOO.KEY %]"] = {title:"[% WEEK_DAYS_LOO.TITLE | replace('"','\"') %]", description:"[% WEEK_DAYS_LOO.DESCRIPTION | replace('"','\"') %]"}; [% END %] [% FOREACH HOLIDAYS_LOO IN HOLIDAYS_LOOP %] holidates.push("[% HOLIDAYS_LOO.KEY %]"); - holidays["[% HOLIDAYS_LOO.KEY %]"] = {title:"[% HOLIDAYS_LOO.TITLE %]", description:"[% HOLIDAYS_LOO.DESCRIPTION %]"}; - + holidays["[% HOLIDAYS_LOO.KEY %]"] = {title:"[% HOLIDAYS_LOO.TITLE | replace('"','\"') %]", description:"[% HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') %]"}; [% END %] [% FOREACH EXCEPTION_HOLIDAYS_LOO IN EXCEPTION_HOLIDAYS_LOOP %] - exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION %]"}; + exception_holidays["[% EXCEPTION_HOLIDAYS_LOO.KEY %]"] = {title:"[% EXCEPTION_HOLIDAYS_LOO.TITLE | replace('"','\"') %]", description:"[% EXCEPTION_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') %]"}; [% END %] [% FOREACH DAY_MONTH_HOLIDAYS_LOO IN DAY_MONTH_HOLIDAYS_LOOP %] - day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION %]"}; + day_month_holidays["[% DAY_MONTH_HOLIDAYS_LOO.KEY %]"] = {title:"[% DAY_MONTH_HOLIDAYS_LOO.TITLE | replace('"','\"') %]", description:"[% DAY_MONTH_HOLIDAYS_LOO.DESCRIPTION | replace('"','\"') %]"}; [% END %] function holidayOperation(formObject, opType) { -- 2.39.5