From 465f51249baaa653a9d31d26d8de96525edb6b24 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 --- 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 43c0f2aa84..f426c19b71 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 %] @@ -939,10 +940,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.11.0