From 23453891e644b280714ab954cad4b204039115df Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Thu, 19 Jun 2014 08:12:45 -0400 Subject: [PATCH] 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 | 15 ++---- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 41 +++------------- 5 files changed, 68 insertions(+), 57 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 5b086f1..8758103 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -120,3 +120,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 6963c90..17f1faf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -172,7 +172,7 @@ $(document).ready(function() { [% IF ( NEEDSCONFIRMATION ) %]
-
+
[% IF CAN_user_circulate_force_checkout %]

Please confirm checkout

[% ELSE %] @@ -345,12 +345,8 @@ $(document).ready(function() { [% IF ( IMPOSSIBLE ) %] -[% IF ( soundon ) %] - -[% END %] -
-
+
    [% IF ( STATS ) %] @@ -462,15 +458,12 @@ $(document).ready(function() {
[% ELSE %] -[% IF ( soundon ) %] - -[% END %] - [% IF (forceallow) %]
Restriction overridden temporarily
[% END %] +[% END %] - [% END %] + [% IF ( issued ) %]

Item checked out

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 3fe2e53..96389d0 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' %] @@ -174,11 +175,7 @@ $(document).ready(function () { [% IF ( waiting ) %] -[% IF ( soundon ) %] - -[% END %] - -
+

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

[% IF ( reservenotes ) %]

Notes: [% reservenotes %]

[% END %]

Hold for:

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

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

Hold for:

    @@ -263,20 +257,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 %] @@ -301,10 +289,7 @@ $(document).ready(function () { [% IF ( diffbranch ) %] - [% IF ( soundon ) %] - - [% END %] -

    Item consigned:

    +

    Item consigned:

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

    Hold found: [% title |html %]

    [% IF ( reservenotes ) %]

    Notes: [% reservenotes %]

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

    Check in message

    [% FOREACH errmsgloo IN errmsgloop %] [% IF ( errmsgloo.NotForLoanStatusUpdated ) %] @@ -444,13 +425,7 @@ $(document).ready(function () { [% END %] [% END %] -[% IF ( soundon ) %] - -[% END %] [% ELSE %] -[% IF ( soundon ) %] - -[% END %] [% END %]
    -- 1.7.2.5
    [% title |html %]