View | Details | Raw Unified | Return to bug 11431
Collapse All | Expand All

(-)a/Koha/Template/Plugin/AudioAlerts.pm (+36 lines)
Line 0 Link Here
1
package Koha::Template::Plugin::AudioAlerts;
2
3
# Copyright ByWater Solutions 2013
4
5
# This file is part of Koha.
6
#
7
# Koha is free software; you can redistribute it and/or modify it
8
# under the terms of the GNU General Public License as published by
9
# the Free Software Foundation; either version 3 of the License, or
10
# (at your option) any later version.
11
#
12
# Koha is distributed in the hope that it will be useful, but
13
# WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
16
#
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20
use Modern::Perl;
21
22
use Encode qw( encode );
23
use JSON;
24
25
use base qw( Template::Plugin );
26
27
use C4::Context;
28
use Koha;
29
30
sub AudioAlerts {
31
    my $dbh = C4::Context->dbh;
32
    my $audio_alerts = $dbh->selectall_arrayref( 'SELECT * FROM audio_alerts ORDER BY precedence', { Slice => {} } );
33
    return encode_json($audio_alerts);
34
}
35
36
1;
(-)a/Koha/Template/Plugin/Koha.pm (-8 lines)
Lines 18-25 package Koha::Template::Plugin::Koha; Link Here
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
use Encode qw( encode );
22
use JSON;
23
21
24
use base qw( Template::Plugin );
22
use base qw( Template::Plugin );
25
23
Lines 59-68 sub Version { Link Here
59
    };
57
    };
60
}
58
}
61
59
62
sub AudioAlerts {
63
    my $dbh = C4::Context->dbh;
64
    my $audio_alerts = $dbh->selectall_arrayref( 'SELECT * FROM audio_alerts ORDER BY precedence', { Slice => {} } );
65
    return encode_json($audio_alerts);
66
}
67
68
1;
60
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc (-2 / +2 lines)
Lines 1-4 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE AudioAlerts %]
2
[% USE String %]
3
[% USE String %]
3
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
5
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" />
Lines 67-73 Link Here
67
    <script type="text/javascript">
68
    <script type="text/javascript">
68
        //<![CDATA[
69
        //<![CDATA[
69
            var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/';
70
            var AUDIO_ALERT_PATH = '[% interface %]/[% theme %]/sound/';
70
            var AUDIO_ALERTS = JSON.parse( '[% Koha.AudioAlerts | replace( "'", "\\'" ) %]' );
71
            var AUDIO_ALERTS = JSON.parse( '[% AudioAlerts.AudioAlerts | replace( "'", "\\'" ) %]' );
71
        //]]>
72
        //]]>
72
73
73
        $( document ).ready(function() {
74
        $( document ).ready(function() {
74
- 

Return to bug 11431