From 88052eae63f5a78e4631b5bc0b1c9baba2ec78a1 Mon Sep 17 00:00:00 2001 From: Kyle Hall Date: Fri, 15 Jul 2022 14:10:37 -0400 Subject: [PATCH] Bug 31166: Digest option is not selectable for phone when PhoneNotification is enabled Digests are not available via Talking Tech, but the artificial limit should not be in place for the non-TT phone notices. If only phone is selected, digest remains disabled. Test Plan: 1) Apply this patch 2) Enable TalkingTechPhoneNotification 3) Verify behavior hasn't changed 4) Disable TalkingTechPhoneNotification, Enable PhoneNotification 5) Note disgest option is now selectable if only phone is selected Signed-off-by: Evelyn Hartline --- .../prog/en/includes/messaging-preference-form.inc | 12 ++++++++---- .../prog/js/messaging-preference-form.js | 8 +++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 279e78c84c..8d7fa55f9c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -1,6 +1,10 @@ [% USE Koha %] + @@ -105,12 +109,12 @@ + value="itiva" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% ELSE %] + value="itiva" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% END %] [% END %] @@ -137,12 +141,12 @@ + value="phone" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% ELSE %] + value="phone" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js index 9fc1eb079f..63bb344cad 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js +++ b/koha-tmpl/intranet-tmpl/prog/js/messaging-preference-form.js @@ -55,7 +55,10 @@ $(document).ready(function(){ } function toggle_digest(id){ - if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) { + console.log("TEST: " + PhoneNotification ); + let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false; + console.log("PHONE: " + phone_checked ); + if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) { $("#digest"+id).attr("disabled", false).tooltip('disable'); } else { $("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable'); @@ -74,6 +77,9 @@ $(document).ready(function(){ $(".pmp_sms").click(function(){ toggle_digest(Number($(this).attr("id").replace("sms", ""))); }); + $(".pmp_phone").click(function(){ + toggle_digest(Number($(this).attr("id").replace("phone", ""))); + }); // $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip(); }); -- 2.30.2