From 240975af26b4846ac3bb54a982afb2eac4700fc0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Mar 2021 14:22:54 +0000 Subject: [PATCH] Bug 27930: [stables] Move _escape_* from acqui/parcel.tt to js/staff-global.js This patch moves the _escape_str and _escape_price functions into the staff-global.js include Test plan 1/ The acquisitions parcel page should look the same before and after the patch. 2/ Signoff Signed-off-by: Jonathan Druart Note: For stable branch the functions didn't exist. --- koha-tmpl/intranet-tmpl/prog/js/staff-global.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 4f06af9465..5a7f7fff74 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -26,6 +26,9 @@ String.prototype.escapeHtml = function() { return HtmlCharsToEscape[c] || c; }); }; +function escape_str(s){ + return s != null ? s.escapeHtml() : ""; +} /* * Void method for numbers, for consistency @@ -33,6 +36,9 @@ String.prototype.escapeHtml = function() { Number.prototype.escapeHtml = function() { return this; }; +function escape_price(p){ + return p != null ? p.escapeHtml().format_price() : ""; +} // http://stackoverflow.com/questions/14859281/select-tab-by-name-in-jquery-ui-1-10-0/16550804#16550804 $.fn.tabIndex = function () { -- 2.20.1