Bugzilla – Attachment 29032 Details for
Bug 11431
Custom notification sounds
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11431 [3] - Add ability to customize the warning, action, and success sounds
Bug-11431-3---Add-ability-to-customize-the-warning.patch (text/plain), 5.14 KB, created by
Kyle M Hall (khall)
on 2014-06-19 14:04:40 UTC
(
hide
)
Description:
Bug 11431 [3] - Add ability to customize the warning, action, and success sounds
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-06-19 14:04:40 UTC
Size:
5.14 KB
patch
obsolete
>From 454aefdd17c893813bf86c34fe4ec752b197f1cf Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Thu, 19 Jun 2014 09:17:06 -0400 >Subject: [PATCH] Bug 11431 [3] - Add ability to customize the warning, action, and success sounds > >--- > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../prog/en/includes/doc-head-close.inc | 6 +++++- > koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js | 11 +++++++---- > .../en/modules/admin/preferences/circulation.pref | 15 +++++++++++++++ > 4 files changed, 34 insertions(+), 5 deletions(-) > >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index d8ea64b..b8a650e 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8564,6 +8564,13 @@ $DBversion = "3.17.00.XXX"; > if ( CheckVersion($DBversion) ) { > $dbh->do(q{UPDATE systempreferences SET variable = 'AudioAlerts' WHERE variable = 'soundon'}); > >+ $dbh->do(q{ >+ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) VALUES >+ ( 'OverrideAudioAlertWarning', '', NULL, 'URL to an audio file to replace the default warning sound.', 'free' ), >+ ( 'OverrideAudioAlertAction', '', NULL, 'URL to an audio file to replace the default "action required" sound.', 'free' ), >+ ( 'OverrideAudioAlertSuccess', '', NULL, 'URL to an audio file to replace the default success sound.', 'free' ) >+ }); >+ > print "Upgrade to $DBversion done (Bug 11169 - Add OPACAcquisitionDetails syspref)\n"; > SetVersion($DBversion); > } >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 2d375bd..90d4c76 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,3 +1,4 @@ >+[% USE Koha %] > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> > >@@ -65,7 +66,10 @@ > [% IF AudioAlerts %] > <script type="text/javascript"> > //<![CDATA[ >- var TMPL_SOUND_PATH = "[% interface %]/[% theme %]/sound/"; >+ var AUDIO_ALERT_PATH = "[% interface %]/[% theme %]/sound/"; >+ var AUDIO_ALERT_ACTION = "[% Koha.Preference('OverrideAudioAlertAction') || 'opening.ogg' %]"; >+ var AUDIO_ALERT_WARNING = "[% Koha.Preference('OverrideAudioAlertWarning') || 'critical.ogg' %]"; >+ var AUDIO_ALERT_SUCCESS = "[% Koha.Preference('OverrideAudioAlertSuccess') || 'beep.ogg' %]"; > //]]> > > $( document ).ready(function() { >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 97fdd7a..ed85d0a 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/js/staff-global.js >@@ -119,18 +119,21 @@ function confirmDelete(message) { > } > > function playSound( sound ) { >- sound = TMPL_SOUND_PATH + sound; >+ // This is way faster than substring >+ if ( ! ( sound.charAt(4) == ':' && sound.charAt(5) == '/' && sound.charAt(6) == '/' ) ) { >+ sound = AUDIO_ALERT_PATH + sound; >+ } > document.getElementById("audio-alert").innerHTML = "<embed src='" + sound + "' hidden='true' autostart='true' loop='false' />"; > } > > function playSoundWarning() { >- playSound( 'critical.ogg' ); >+ playSound( AUDIO_ALERT_WARNING ); > } > > function playSoundAction() { >- playSound( 'opening.ogg' ); >+ playSound( AUDIO_ALERT_ACTION ); > } > > function playSoundSuccess() { >- playSound( 'beep.ogg' ); >+ playSound( AUDIO_ALERT_SUCCESS ); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index e1b90d3..8251f4b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -626,3 +626,18 @@ Circulation: > yes: "Enable" > no: "Don't enable" > - circulation sounds during checkin and checkout in the staff interface. Not supported by all web browsers yet. >+ - >+ - Replace the default audio alert for <i>warning</i> alerts with the sound found at >+ - pref: OverrideAudioAlertWarning >+ class: url >+ - (This should be a complete URL, starting with <code>http://</code>) >+ - >+ - Replace the default audio alert for <i>action</i> alerts with the sound found at >+ - pref: OverrideAudioAlertAction >+ class: url >+ - (This should be a complete URL, starting with <code>http://</code>) >+ - >+ - Replace the default audio alert for <i>success</i> alerts with the sound found at >+ - pref: OverrideAudioAlertSuccess >+ class: url >+ - (This should be a complete URL, starting with <code>http://</code>) >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11431
:
29030
|
29031
|
29032
|
29033
|
29034
|
29035
|
29036
|
29037
|
29038
|
29039
|
29119
|
29120
|
29404
|
29764
|
29765
|
29766
|
29767
|
29768
|
29769
|
31145
|
31146
|
31147
|
31148
|
31149
|
31150
|
34637
|
34638
|
34639
|
34640
|
34641
|
34642
|
34643
|
34644
|
34645
|
34646
|
34647
|
34648
|
34649
|
34650
|
34651
|
34652
|
34653
|
34717
|
34718
|
34719
|
34720
|
34864
|
34865
|
34866
|
34867
|
35843
|
35844
|
35845
|
35846
|
38547
|
38548
|
40726
|
40727
|
40728
|
40729
|
40730
|
40731
|
40732
|
41634
|
41661
|
41662
|
42678
|
42679
|
42680
|
42681
|
42682
|
42683
|
42684
|
42685
|
42686
|
42687
|
42688
|
42689
|
42696
|
43753
|
43754
|
43755
|
43756
|
43757
|
43758
|
43759
|
43760
|
43761
|
43762
|
43763
|
43764
|
43765
|
43817
|
43820
|
43821
|
43822
|
43823
|
43824
|
43825
|
43887
|
43888
|
43889
|
43890
|
43891
|
43892
|
43893
|
43894
|
43895
|
43896
|
43897
|
43898
|
43899
|
43900
|
43901
|
43902
|
43903
|
44391
|
44392
|
44393
|
44394
|
44395
|
44396
|
44397
|
44398
|
44399
|
44400
|
44401
|
44402
|
44404
|
44405
|
44407
|
44408
|
44409
|
44411
|
44412
|
44599
|
45135