From fdc176c361f154eaf5f47481709abd7da8b4a623 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 19 Jun 2014 08:12:45 -0400 Subject: [PATCH] [SIGNED OFF] Bug 11431 [1] - Replace existing system with no change in functionality This patch set adds the ability to select which sounds are used for Koha's audio alerts, and which elements trigger those audio alerts. Test Plan: 1) Apply this patch set 2) Run updatedatabase.pl 3) Enable the AudioAlerts system preference 4) Test existing sounds 5) Set the various OverrideAudioAlert preferences to different sounds 6) Retest, verify new sounds play 7) Add/remove selectors from the AudioAlertSelector system preferences 8) Observe the difference in audio alert behavior based on your selections Signed-off-by: Nick Clemens --- .../prog/en/includes/doc-head-close.inc | 51 +++++++++++++++----- .../prog/en/includes/intranet-bottom.inc | 1 + koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 17 +++++++ .../prog/en/modules/circ/circulation.tt | 13 ++--- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 41 +++------------- 5 files changed, 68 insertions(+), 55 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc index f6269de..d9f9171 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-close.inc @@ -1,13 +1,13 @@ + [% INCLUDE intranetstylesheet.inc %] -[% IF ( bidi ) %] - -[% END %] +[% IF ( bidi ) %][% END %] [% IF ( IntranetUserCSS ) %][% END %] + @@ -22,14 +22,17 @@ + [% INCLUDE 'validator-strings.inc' %] + [% IF ( intranetuserjs ) %] [% END %] + [% IF ( virtualshelves || intranetbookbag ) %] - + + [% END %] + [% IF LocalCoverImages %] - - + + +[% END %] + +[% IF soundon %] + [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc index d937656..f9103ce 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -65,5 +65,6 @@ [% END %] [% END %] + diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js index fa75b44..bfd8e1e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -122,3 +122,20 @@ function toUC(f) { function confirmDelete(message) { return (confirm(message) ? true : false); } + +function playSound( sound ) { + sound = TMPL_SOUND_PATH + sound; + document.getElementById("audio-alert").innerHTML = ""; +} + +function playSoundWarning() { + playSound( 'critical.ogg' ); +} + +function playSoundAction() { + playSound( 'opening.ogg' ); +} + +function playSoundSuccess() { + playSound( 'beep.ogg' ); +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt index 9734c0f..ca24508 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -143,7 +143,7 @@ $(document).ready(function() { [% IF ( NEEDSCONFIRMATION ) %]
-
+
[% IF CAN_user_circulate_force_checkout %]

Please confirm checkout

[% ELSE %] @@ -308,12 +308,8 @@ $(document).ready(function() { [% IF ( IMPOSSIBLE ) %] -[% IF ( soundon ) %] - -[% END %] -
-
+
    [% IF ( STATS ) %] @@ -416,11 +412,10 @@ $(document).ready(function() {
[% ELSE %] -[% IF ( soundon ) %] - -[% END %] [% END %] + + [% IF ( issued ) %]

Item checked out

[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 068f710..363f6c1 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -89,6 +89,7 @@ $(document).ready(function () { + [% INCLUDE 'header.inc' %] [% INCLUDE 'checkin-search.inc' %] @@ -172,11 +173,7 @@ $(document).ready(function () { [% IF ( waiting ) %] -[% IF ( soundon ) %] - -[% END %] - -
+

Hold found (item is already waiting): [% title |html %]

[% IF ( reservenotes ) %]

Notes: [% reservenotes %]

[% END %]

Hold for:

@@ -215,10 +212,7 @@ $(document).ready(function () { [% IF ( diffbranch ) %] - [% IF ( soundon ) %] - - [% END %] -
+

Hold needing transfer found: [% title |html %]

Hold for:

    @@ -255,20 +249,14 @@ $(document).ready(function () { [% IF ( transfer ) %] -
    +

    Please return [% title or "item" |html %] to [% homebranchname %]
    ( Print slip )

    - [% IF ( soundon ) %] - - [% END %] [% END %] [% IF ( needstransfer ) %] - [% IF ( soundon ) %] - - [% END %] -

    This item needs to be transferred to [% homebranchname %]

    +

    This item needs to be transferred to [% homebranchname %]

    Transfer now?
    [% IF itemnumber %] @@ -291,10 +279,7 @@ $(document).ready(function () { [% IF ( diffbranch ) %] - [% IF ( soundon ) %] - - [% END %] -

    Item consigned:

    +

    Item consigned:

    @@ -319,11 +304,7 @@ $(document).ready(function () { [% IF ( reserved ) %] - [% IF ( soundon ) %] - - [% END %] - -
    +

    Hold found: [% title |html %]

    [% IF ( reservenotes ) %]

    Notes: [% reservenotes %]

    [% END %]
    Hold for:
    @@ -369,7 +350,7 @@ $(document).ready(function () { [% END %] [% IF ( errmsgloop ) %] -
    +

    Check in message

    [% FOREACH errmsgloo IN errmsgloop %] [% IF ( errmsgloo.NotForLoanStatusUpdated ) %] @@ -424,13 +405,7 @@ $(document).ready(function () {

    Reminder: Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]

    [% END %] [% END %] -[% IF ( soundon ) %] - -[% END %] [% ELSE %] -[% IF ( soundon ) %] - -[% END %] [% END %]
    -- 1.7.10.4
    [% title |html %]