Bug 11868: MTT: disable SMS and phone if not in use

On both pages "Notices and slips" and "Overdue rules", it would be great
to disable SMS and phone if there are not in use.  This patch implements
this.

Test plan:
1/ Edit a notice
2/ Enable/disable the SMSSendDriver pref and verify the sms block is
enabled/disabled.
3/ Enable/disable the TalkingTechItivaPhoneNotification pref and verify
the phone block is enabled/disabled.

4/ Go on tools/overdues.pl
5/ Enable/disable the SMSSendDriver pref and verify the sms checkboxes
are enabled/disabled.
6/ Enable/disable the TalkingTechItivaPhoneNotification pref and verify
the phone checkboxes are enabled/disabled.

Signed-off-by: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi>

---------------
Testing report:
---------------
Followed the test plan. Reviewed the code modifications.
Feature works as expected.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
This commit is contained in:
Jonathan Druart 2014-02-27 14:30:50 +01:00 committed by Galen Charlton
parent 45a6e7efd1
commit ca871ea334
2 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,4 @@
[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Notices[% IF ( add_form ) %][% IF ( modify ) %] &rsaquo; Modify notice[% ELSE %] &rsaquo; Add notice[% END %][% END %][% IF ( add_validate ) %] &rsaquo; Notice added[% END %][% IF ( delete_confirm ) %] &rsaquo; Confirm deletion[% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -310,7 +311,15 @@ $(document).ready(function() {
[% FOREACH letter IN letters %]
<li>
<fieldset class="rows mtt" id="[% letter.message_transport_type %]">
[% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %]
<fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
<div class="dialog message">You should enable the SMSSendDriver preference to use the sms templates.</div>
[% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
<fieldset class="rows mtt" id="[% letter.message_transport_type %]" disabled="disabled">
<div class="dialog message">You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.</div>
[% ELSE %]
<fieldset class="rows mtt" id="[% letter.message_transport_type %]">
[% END %]
<legend>
[% SWITCH letter.message_transport_type %]
[% CASE 'email' %]

View File

@ -1,3 +1,4 @@
[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Notice triggers</title>
[% INCLUDE 'doc-head-close.inc' %]
@ -146,7 +147,13 @@ $(document).ready(function() {
[% IF mtt.selected %]
<input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" checked="checked" />
[% ELSE %]
<input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" />
[% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %]
<input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
[% ELSIF mtt.value == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %]
<input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" disabled="disabled" />
[% ELSE %]
<input type="checkbox" name="mtt[% tab.number %]-[% value.overduename %]" value="[% mtt.value %]" />
[% END %]
[% END %]
</td>
[% END %]