From ca871ea334962296b209c3d38e7bd725a0109db3 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 27 Feb 2014 14:30:50 +0100 Subject: [PATCH] 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 --------------- Testing report: --------------- Followed the test plan. Reviewed the code modifications. Feature works as expected. Signed-off-by: Kyle M Hall Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/modules/tools/letter.tt | 11 ++++++++++- .../prog/en/modules/tools/overduerules.tt | 9 ++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt index eb0b8a22ca..f2a705184d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/letter.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Notices[% IF ( add_form ) %][% IF ( modify ) %] › Modify notice[% ELSE %] › Add notice[% END %][% END %][% IF ( add_validate ) %] › Notice added[% END %][% IF ( delete_confirm ) %] › Confirm deletion[% END %] [% INCLUDE 'doc-head-close.inc' %] @@ -310,7 +311,15 @@ $(document).ready(function() { [% FOREACH letter IN letters %]
  • -
    + [% IF letter.message_transport_type == "sms" and not Koha.Preference("SMSSendDriver") %] +
    +
    You should enable the SMSSendDriver preference to use the sms templates.
    + [% ELSIF letter.message_transport_type == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] +
    +
    You should enable the TalkingTechItivaPhoneNotification preference to use the phone templates.
    + [% ELSE %] +
    + [% END %] [% SWITCH letter.message_transport_type %] [% CASE 'email' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt index dba8493f9f..387f93fef7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt @@ -1,3 +1,4 @@ +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › Tools › Notice triggers [% INCLUDE 'doc-head-close.inc' %] @@ -146,7 +147,13 @@ $(document).ready(function() { [% IF mtt.selected %] [% ELSE %] - + [% IF mtt.value == "sms" and not Koha.Preference("SMSSendDriver") %] + + [% ELSIF mtt.value == "phone" and not Koha.Preference("TalkingTechItivaPhoneNotification") %] + + [% ELSE %] + + [% END %] [% END %] [% END %] -- 2.39.5