From 6c171cccef1ede2ea0cfe17625f3518f10fc8089 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Fri, 23 Oct 2015 07:55:18 -0400 Subject: [PATCH] Bug 11431 [QA Followup] - Add ability to edit audio alerts --- admin/audio_alerts.pl | 15 +++++-- .../prog/en/modules/admin/audio_alerts.tt | 43 ++++++++++++++++++-- 2 files changed, 49 insertions(+), 9 deletions(-) diff --git a/admin/audio_alerts.pl b/admin/audio_alerts.pl index d592be4..8470255 100755 --- a/admin/audio_alerts.pl +++ b/admin/audio_alerts.pl @@ -45,7 +45,16 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( } ); -if ( $selector && $sound ) { +if ( $id && $action && $where && $action eq 'move' ) { + Koha::AudioAlerts->find($id)->move($where); +} +elsif ( $id && $selector && $sound ) { + my $alert = Koha::AudioAlerts->find($id); + $alert->selector( $selector ); + $alert->sound( $sound ); + $alert->store(); +} +elsif ( $selector && $sound ) { Koha::AudioAlert->new( { selector => $selector, sound => $sound } )->store(); } @@ -54,10 +63,6 @@ if (@delete) { Koha::AudioAlerts->fix_precedences(); } -if ( $id && $action && $where && $action eq 'move' ) { - Koha::AudioAlerts->find($id)->move($where); -} - $template->param( AudioAlerts => 1, audio_alerts => scalar Koha::AudioAlerts->search() ); output_html_with_http_headers $cgi, $cookie, $template->output; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt index 82b3b87..fcd121e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/audio_alerts.tt @@ -4,6 +4,8 @@ @@ -50,6 +78,7 @@ $( document ).ready(function() {
Add new alert + @@ -79,23 +108,28 @@ $( document ).ready(function() { - +

+ + + Cancel edit +

- - +
+ + - + [% FOREACH a IN audio_alerts %] @@ -119,6 +153,7 @@ $( document ).ready(function() { + [% END %] -- 1.7.2.5
  Precedence   Selector Sound 
[% a.selector %] [% a.sound %] Edit