Bugzilla – Attachment 29764 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 [1] - Replace existing system with no change in functionality
Bug-11431-1---Replace-existing-system-with-no-chan.patch (text/plain), 12.17 KB, created by
Kyle M Hall (khall)
on 2014-07-16 18:10:53 UTC
(
hide
)
Description:
Bug 11431 [1] - Replace existing system with no change in functionality
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-07-16 18:10:53 UTC
Size:
12.17 KB
patch
obsolete
>From dbabdcb921ef3c711ff4a9604207579b33da677a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >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 | 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 @@ > <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" /> >+ > <link rel="stylesheet" type="text/css" href="[% interface %]/lib/jquery/jquery-ui.css" /> > <link rel="stylesheet" type="text/css" href="[% interface %]/lib/bootstrap/bootstrap.min.css" /> > <link rel="stylesheet" type="text/css" media="print" href="[% themelang %]/css/print.css" /> > [% INCLUDE intranetstylesheet.inc %] >-[% IF ( bidi ) %] >- <link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" /> >-[% END %] >+[% IF ( bidi ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/right-to-left.css" />[% END %] > [% IF ( IntranetUserCSS ) %]<style type="text/css">[% IntranetUserCSS %]</style>[% END %] >+ > <script type="text/javascript" src="[% interface %]/lib/jquery/jquery.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/jquery-ui.js"></script> > <script type="text/javascript" src="[% interface %]/lib/shortcut/shortcut.js"></script> >@@ -22,14 +22,17 @@ > > <!-- koha core js --> > <script type="text/javascript" src="[% themelang %]/js/staff-global.js"></script> >+ > [% INCLUDE 'validator-strings.inc' %] >+ > [% IF ( intranetuserjs ) %] > <script type="text/javascript"> >- //<![CDATA[ >- [% intranetuserjs %] >- //]]> >+ //<![CDATA[ >+ [% intranetuserjs %] >+ //]]> > </script> > [% END %] >+ > [% IF ( virtualshelves || intranetbookbag ) %] > <script type="text/javascript"> > //<![CDATA[ >@@ -46,13 +49,35 @@ > var MSG_NON_RESERVES_SELECTED = _("One or more selected items cannot be reserved."); > //]]> > </script> >-<script type="text/javascript" src="[% themelang %]/js/basket.js"></script> >+ >+ <script type="text/javascript" src="[% themelang %]/js/basket.js"></script> > [% END %] >+ > [% IF LocalCoverImages %] >-<script type="text/javascript" src="[% themelang %]/js/localcovers.js"></script> >-<script type="text/javascript"> >-//<![CDATA[ >-var NO_LOCAL_JACKET = _("No cover image available"); >-//]]> >-</script> >+ <script type="text/javascript" src="[% themelang %]/js/localcovers.js"></script> >+ <script type="text/javascript"> >+ //<![CDATA[ >+ var NO_LOCAL_JACKET = _("No cover image available"); >+ //]]> >+ </script> >+[% END %] >+ >+[% IF soundon %] >+ <script type="text/javascript"> >+ //<![CDATA[ >+ var TMPL_SOUND_PATH = "[% interface %]/[% theme %]/sound/"; >+ //]]> >+ >+ $( document ).ready(function() { >+ if ( $(".audio-alert-action").length ) { >+ playSoundAction(); >+ } >+ else if ( $(".audio-alert-warning").length ) { >+ playSoundWarning(); >+ } >+ else if ( $(".audio-alert-success").length ) { >+ playSoundSuccess(); >+ } >+ }); >+ </script> > [% 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 @@ > </div> > [% END %] > [% END %] >+ <span id="audio-alert"></span> > </body> > </html> >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 = "<embed src='" + sound + "' hidden='true' autostart='true' loop='false' />"; >+} >+ >+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 d573ba4..1e38ffc 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 ) %] > <div class="yui-g"> > >-<div id="circ_needsconfirmation" class="dialog alert"> >+<div id="circ_needsconfirmation" class="dialog alert audio-alert-action"> > [% IF CAN_user_circulate_force_checkout %] > <h3>Please confirm checkout</h3> > [% ELSE %] >@@ -308,12 +308,8 @@ $(document).ready(function() { > > [% IF ( IMPOSSIBLE ) %] > >-[% IF ( soundon ) %] >-<audio src="[% interface %]/[% theme %]/sound/critical.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-[% END %] >- > <div class="yui-g"> >-<div id="circ_impossible" class="dialog alert"> >+<div id="circ_impossible" class="dialog alert audio-alert-warning"> > <!-- RESULT OF ISSUING REQUEST --> > <ul> > [% IF ( STATS ) %] >@@ -416,11 +412,10 @@ $(document).ready(function() { > > </div></div> > [% ELSE %] >-[% IF ( soundon ) %] >-<audio src="[% interface %]/[% theme %]/sound/beep.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-[% END %] > [% END %] <!-- /impossible --> > >+<span class="audio-alert-success"></span> >+ > [% IF ( issued ) %] > <p>Item checked out</p> > [% 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 5e67044..2c10738 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 () { > </script> > </head> > <body id="circ_returns" class="circ"> >+<span class="audio-alert-success"></span> > > [% INCLUDE 'header.inc' %] > [% INCLUDE 'checkin-search.inc' %] >@@ -172,11 +173,7 @@ $(document).ready(function () { > [% IF ( waiting ) %] > <!-- waiting --> > >-[% IF ( soundon ) %] >-<audio src="[% interface %]/[% theme %]/sound/ending.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-[% END %] >- >-<div id="hold-found1" class="dialog message"> >+ <div id="hold-found1" class="dialog message audio-alert-action"> > <h3>Hold found (item is already waiting): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3> > [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %] > <h4>Hold for:</h4> >@@ -215,10 +212,7 @@ $(document).ready(function () { > > [% IF ( diffbranch ) %] > <!-- diffbranch --> >- [% IF ( soundon ) %] >- <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >- [% END %] >- <div id="transfer-needed" class="dialog message"> >+ <div id="transfer-needed" class="dialog message audio-alert-action"> > <h3>Hold needing transfer found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3> > <h4>Hold for: </h4> > <ul> >@@ -255,20 +249,14 @@ $(document).ready(function () { > > [% IF ( transfer ) %] > <!-- transfer: item with no reservation, must be returned to its home library --> >- <div id="return1" class="dialog message"> >+ <div id="return1" class="dialog message audio-alert-action"> > <h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]">[% title or "item" |html %]</a> to [% homebranchname %]<br/>( <a href="#" onclick="Dopop('transfer-slip.pl?transferitem=[% itemnumber %]&branchcode=[% homebranch %]&op=slip'); return true;">Print slip</a> )</h3> > </div> >- [% IF ( soundon ) %] >- <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >- [% END %] > [% END %] > > [% IF ( needstransfer ) %] > <!-- needstransfer --> >- [% IF ( soundon ) %] >- <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >- [% END %] >- <div id="item-transfer" class="dialog message"><h3> This item needs to be transferred to [% homebranchname %]</h3> >+ <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% homebranchname %]</h3> > Transfer now?<br /> > <form method="post" action="returns.pl" name="mainform" id="mainform"> > [% IF itemnumber %] >@@ -291,10 +279,7 @@ $(document).ready(function () { > > [% IF ( diffbranch ) %] > <!-- diffbranch --> >- [% IF ( soundon ) %] >- <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >- [% END %] >- <h3>Item consigned:</h3> >+ <h3 class="audio-alert-action">Item consigned:</h3> > <table> > <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption> > <tr> >@@ -319,11 +304,7 @@ $(document).ready(function () { > [% IF ( reserved ) %] > <!-- reserved --> > >- [% IF ( soundon ) %] >- <audio src="[% interface %]/[% theme %]/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >- [% END %] >- >- <div id="hold-found2" class="dialog message"> >+ <div id="hold-found2" class="dialog message audio-alert-action"> > <h3>Hold found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3> > [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %] > <h5>Hold for:</h5> >@@ -369,7 +350,7 @@ $(document).ready(function () { > [% END %] > > [% IF ( errmsgloop ) %] >- <div class="dialog alert"> >+ <div class="dialog alert audio-alert-warning"> > <h3>Check in message</h3> > [% FOREACH errmsgloo IN errmsgloop %] > [% IF ( errmsgloo.NotForLoanStatusUpdated ) %] >@@ -424,13 +405,7 @@ $(document).ready(function () { > <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %]</p> > [% END %] > [% END %] >-[% IF ( soundon ) %] >-<audio src="[% interface %]/[% theme %]/sound/critical.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-[% END %] > [% ELSE %] >-[% IF ( soundon ) %] >-<audio src="[% interface %]/[% theme %]/sound/beep.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio> >-[% END %] > [% END %] > </div> > >-- >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