From 1ca64ce757ca92071d1c0c6c4c9fc306e8808972 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 20 Feb 2019 20:00:01 +0000 Subject: [PATCH] Bug 22378: Fix audio alerts on SCO Note: The SCO only supports sounds with a full URL, not KOha built in sounds To test: 1 - Enable audio alerts 2 - Enable SCO 3 - Note JS error on loading the alerts 4 - Apply patch 5 - No more error 6 - Test with bug 18251 Signed-off-by: Josef Moravec Signed-off-by: Nick Clemens (cherry picked from commit fb4707b97cec006e0e6f5c4b4dd430146e97f16a) Signed-off-by: Martin Renvoize --- koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index df09322dc4..1bb8ec4b72 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -3,6 +3,7 @@ [% USE Koha %] [% USE KohaDates %] [% USE AudioAlerts %] +[% USE To %] [% USE Price %] [% INCLUDE 'doc-head-open.inc' %] [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] › Self checkout @@ -368,7 +369,7 @@ return true; } [% IF Koha.Preference('AudioAlerts') %] - var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) | replace( '"', '\\"' ) | html %]' ); + var AUDIO_ALERTS = JSON.parse( "[% To.json(AudioAlerts.AudioAlerts) | $raw %]" ); $( document ).ready(function() { if ( AUDIO_ALERTS ) { for ( var k in AUDIO_ALERTS ) { -- 2.39.5