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 <josef.moravec@gmail.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit fb4707b97c)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Nick Clemens 2019-02-20 20:00:01 +00:00 committed by Martin Renvoize
parent f9892cd621
commit 1ca64ce757
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@
[% USE Koha %]
[% USE KohaDates %]
[% USE AudioAlerts %]
[% USE To %]
[% USE Price %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha [% END %] &rsaquo; Self checkout </title>
@ -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 ) {