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 <evelyn@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Bug 31166: (QA follow-up) Remove debugging lines Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Bug 31166: (QA follow-up) Implement on OPAC side Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Squashed by RM
This commit is contained in:
parent
b00c213876
commit
0622e118db
3 changed files with 23 additions and 8 deletions
|
@ -1,6 +1,10 @@
|
||||||
[% USE Koha %]
|
[% USE Koha %]
|
||||||
<!-- snippet for form to set borrower and patron category messaging preferences -->
|
<!-- snippet for form to set borrower and patron category messaging preferences -->
|
||||||
|
|
||||||
|
<script>
|
||||||
|
var TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
|
||||||
|
var PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
|
||||||
|
</script>
|
||||||
<input type="hidden" name="modify" value="yes" />
|
<input type="hidden" name="modify" value="yes" />
|
||||||
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
|
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
|
||||||
<table>
|
<table>
|
||||||
|
@ -109,12 +113,12 @@
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
id="itiva[% messaging_preference.message_attribute_id | html %]"
|
id="itiva[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="itiva" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
value="itiva" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
id="itiva[% messaging_preference.message_attribute_id | html %]"
|
id="itiva[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="itiva" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
value="itiva" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
|
@ -141,12 +145,12 @@
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
id="phone[% messaging_preference.message_attribute_id | html %]"
|
id="phone[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="phone" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
value="phone" checked="checked" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
id="phone[% messaging_preference.message_attribute_id | html %]"
|
id="phone[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="phone" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
value="phone" class="pmp_phone active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" />
|
||||||
[% END %]
|
[% END %]
|
||||||
[% END %]
|
[% END %]
|
||||||
</td>
|
</td>
|
||||||
|
|
|
@ -55,7 +55,8 @@ $(document).ready(function(){
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggle_digest(id){
|
function toggle_digest(id){
|
||||||
if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
|
let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false;
|
||||||
|
if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
|
||||||
$("#digest"+id).attr("disabled", false).tooltip('disable');
|
$("#digest"+id).attr("disabled", false).tooltip('disable');
|
||||||
} else {
|
} else {
|
||||||
$("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
|
$("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
|
||||||
|
@ -74,6 +75,9 @@ $(document).ready(function(){
|
||||||
$(".pmp_sms").click(function(){
|
$(".pmp_sms").click(function(){
|
||||||
toggle_digest(Number($(this).attr("id").replace("sms", "")));
|
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();
|
// $('#memberentry_messaging_prefs [data-toggle="tooltip"][disabled]').tooltip();
|
||||||
});
|
});
|
||||||
|
|
|
@ -110,13 +110,13 @@
|
||||||
<td class="selectcol">
|
<td class="selectcol">
|
||||||
[% IF ( messaging_preference.transports_phone ) %]
|
[% IF ( messaging_preference.transports_phone ) %]
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="phone"
|
class="pmp_phone"
|
||||||
id="phone[% messaging_preference.message_attribute_id | html %]"
|
id="phone[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="phone" checked="checked" />
|
value="phone" checked="checked" />
|
||||||
[% ELSE %]
|
[% ELSE %]
|
||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="phone"
|
class="pmp_phone"
|
||||||
id="phone[% messaging_preference.message_attribute_id | html %]"
|
id="phone[% messaging_preference.message_attribute_id | html %]"
|
||||||
name="[% messaging_preference.message_attribute_id | html %]"
|
name="[% messaging_preference.message_attribute_id | html %]"
|
||||||
value="phone" />
|
value="phone" />
|
||||||
|
@ -259,7 +259,11 @@
|
||||||
$("#info_digests").tooltip();
|
$("#info_digests").tooltip();
|
||||||
|
|
||||||
function toggle_digest(id){
|
function toggle_digest(id){
|
||||||
if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") ) {
|
let PhoneNotification = [% Koha.Preference('PhoneNotification') || 0 | html %];
|
||||||
|
let TalkingTechItivaPhoneNotification = [% Koha.Preference('TalkingTechItivaPhoneNotification') || 0 | html %];
|
||||||
|
let phone_checked = TalkingTechItivaPhoneNotification ? false : PhoneNotification ? $("#phone"+id).prop("checked") : false;
|
||||||
|
|
||||||
|
if ( $("#email"+id).prop("checked") || $("#sms"+id).prop("checked") || phone_checked ) {
|
||||||
$("#digest"+id).attr("disabled", false).tooltip('disable');
|
$("#digest"+id).attr("disabled", false).tooltip('disable');
|
||||||
} else {
|
} else {
|
||||||
$("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
|
$("#digest"+id).attr("disabled", true).prop("checked",false).tooltip('enable');
|
||||||
|
@ -278,6 +282,9 @@
|
||||||
$(".pmp_sms").click(function(){
|
$(".pmp_sms").click(function(){
|
||||||
toggle_digest(Number($(this).attr("id").replace("sms", "")));
|
toggle_digest(Number($(this).attr("id").replace("sms", "")));
|
||||||
});
|
});
|
||||||
|
$(".pmp_phone").click(function(){
|
||||||
|
toggle_digest(Number($(this).attr("id").replace("phone", "")));
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue