From 63d831a14459c76493b5758790e1e0a794a036a5 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 12 Nov 2019 09:30:40 +0100 Subject: [PATCH] Bug 23777: Use To.json in request.tt Test plan: Use quotes in a library's name, then place an item on hold for a patron that cannot do it. If you are allowed to overwrite this restriction you will get a warning: "This item normally cannot be put on hold except for patrons from BRANCHNAME" The library's name should be correcty displayed Signed-off-by: Hayley Mapley Signed-off-by: Martin Renvoize --- koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt index fede00d3ec..00b7b66243 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt @@ -1,4 +1,5 @@ [% USE raw %] +[% USE To %] [% USE Asset %] [% USE Koha %] [% USE KohaDates %] @@ -953,10 +954,10 @@ var biblionumber = "[% biblionumber | $raw %]"; var borrowernumber = "[% patron.borrowernumber | $raw %]"; var MSG_CONFIRM_DELETE_HOLD = _("Are you sure you want to cancel this hold?"); - var patron_homebranch = "[% Branches.GetName( patron.branchcode ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]"; + var patron_homebranch = "[% To.json( Branches.GetName( patron.branchcode ) ) | $raw %]"; var override_items = {[% FOREACH bibitemloo IN bibitemloop %][% FOREACH itemloo IN bibitemloo.itemloop %][% IF ( itemloo.override ) %] [% itemloo.itemnumber | html %]: { - homebranch: "[% Branches.GetName( itemloo.homebranch ) |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') | html %]", + homebranch: "[% To.json( Branches.GetName( itemloo.homebranch ) ) | $raw %]"; holdallowed: [% itemloo.holdallowed | html %] }, [% END %][% END %][% END %] -- 2.39.5