From 78d0995aa18b250384021ca54f99df6e4443d46d 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 --- .../prog/en/includes/doc-head-close.inc | 79 +++++++++++++------- .../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, 82 insertions(+), 69 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 11f6f38..25d14e2 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,37 +22,62 @@ + [% 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 442a7bb..a71642b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc @@ -52,5 +52,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 c553a6d..97fdd7a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js @@ -117,3 +117,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 6805126..12ecb20 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt @@ -186,7 +186,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% IF ( NEEDSCONFIRMATION ) %]
-
+
[% IF CAN_user_circulate_force_checkout %]

Please confirm checkout

[% ELSE %] @@ -351,12 +351,8 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); [% IF ( IMPOSSIBLE ) %] -[% IF ( soundon ) %] - -[% END %] -
-
+
    [% IF ( STATS ) %] @@ -459,11 +455,10 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export");
[% 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 72f9ee3..7c1879d 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.2.5
    [% title |html %]