Bugzilla – Attachment 93880 Details for
Bug 18595
Move C4::Members::Messaging to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18595: Disable digest checkbox when forced on
Bug-18595-Disable-digest-checkbox-when-forced-on.patch (text/plain), 7.19 KB, created by
Lari Taskula
on 2019-10-08 14:32:11 UTC
(
hide
)
Description:
Bug 18595: Disable digest checkbox when forced on
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2019-10-08 14:32:11 UTC
Size:
7.19 KB
patch
obsolete
>From d90b341d842834fe47809f3536fbc1989d6977a0 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@jns.fi> >Date: Tue, 28 Nov 2017 19:32:22 +0200 >Subject: [PATCH] Bug 18595: Disable digest checkbox when forced on > >To test: >1. Force a digest on via message_transports table > (delete rows where message_attribute is 1 and is_digest is 0) >SQL: delete from message_transports where message_attribute_id=1 and is_digest=0; >2. Go to either OPAC or staff client messaging preferences >3. Observe digest checkbox is disabled for message attribute 1 > (normally Item due row) > >Signed-off-by: David Bourgault <david.bourgault@inlibro.com> >--- > .../en/includes/messaging-preference-form.inc | 39 ++++++++++++++++++- > .../bootstrap/en/modules/opac-messaging.tt | 11 ++++-- > 2 files changed, 45 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 2f948c6236..78f7b9a1c3 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,5 +1,30 @@ > [% USE Koha %] > <!-- snippet for form to set borrower and patron category messaging preferences --> >+<script type="text/javascript">//<![CDATA[ >+$(document).ready(function(){ >+ $(".none").click(function(){ >+ if($(this).prop("checked")){ >+ var rowid = $(this).attr("id"); >+ newid = Number(rowid.replace("none","")); >+ $("#sms"+newid).prop("checked", false); >+ $("#email"+newid).prop("checked", false); >+ $("#phone"+newid).prop("checked", false); >+ if (!$("#forcedigest"+newid).length) { >+ $("#digest"+newid).prop("checked", false); >+ } >+ $("#rss"+newid).prop("checked", false); >+ } >+ }); >+ $(".active_notify").on("change",function(){ >+ var attr_id = $(this).data("attr-id"); >+ if( $(this).prop("checked") ){ >+ $("#none" + attr_id ).prop("checked", false); >+ } >+ }); >+ $("#info_digests").tooltip(); >+}); >+//]]> >+</script> > > <input type="hidden" name="modify" value="yes" /> > <input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" /> >@@ -158,12 +183,22 @@ > <input type="checkbox" > id="digest[% messaging_preference.message_attribute_id | html %]" > value="[% messaging_preference.message_attribute_id | html %]" >- name="digest" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> >+ name="digest" checked="checked" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" >+ [% IF ( !messaging_preference.has_digest_off ) %] disabled="disabled"[% END %] /> > [% ELSE %] > <input type="checkbox" > id="digest[% messaging_preference.message_attribute_id | html %]" > value="[% messaging_preference.message_attribute_id | html %]" >- name="digest" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" /> >+ name="digest" class="active_notify" data-attr-id="[% messaging_preference.message_attribute_id | html %]" >+ [% IF ( !messaging_preference.has_digest_off ) %] checked="checked" disabled="disabled"[% END %] /> >+ [% END %] >+ [% IF ( !messaging_preference.has_digest_off ) # Because of disabled checkboxes are considered as false, use hidden input field to send true value %] >+ <input >+ name="digest" >+ type="hidden" >+ id="forcedigest[% messaging_preference.message_attribute_id | html %]" >+ value="[% messaging_preference.message_attribute_id | html %]" >+ /> > [% END %] > [% END %] > </td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >index d33c7b7b88..9a6b52afa4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt >@@ -113,9 +113,12 @@ > [% IF ( messaging_preference.has_digest ) %] > <td> > [% IF ( messaging_preference.digest ) %] >- <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" /> >+ <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;"[% IF ( !messaging_preference.has_digest_off ) %] title="This option cannot be changed" disabled[% END %] /> > [% ELSE %] >- <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" /> >+ <input type="checkbox" id="digest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]" name="digest" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;"[% IF ( !messaging_preference.has_digest_off ) %] checked="checked" title="This option cannot be changed" disabled[% END %] /> >+ [% END %] >+ [% IF ( !messaging_preference.has_digest_off ) # Because of disabled checkboxes are considered as false, use hidden input field to send true value %] >+ <input name="digest" type="hidden" id="forcedigest[% messaging_preference.message_attribute_id | html %]" value="[% messaging_preference.message_attribute_id | html %]"/> > [% END %] > </td> > [% ELSE %] >@@ -177,7 +180,9 @@ > newid = Number(rowid.replace("none","")) > $("#sms"+newid).removeAttr("checked"); > $("#email"+newid).removeAttr("checked"); >- $("#digest"+newid).removeAttr("checked"); >+ if (!$("#forcedigest"+newid).length) { >+ $("#digest"+newid).removeAttr("checked"); >+ } > $("#rss"+newid).removeAttr("checked"); > } > }); >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18595
:
63435
|
63436
|
63437
|
63438
|
63439
|
63440
|
63441
|
63794
|
63795
|
63796
|
63797
|
63798
|
63799
|
63800
|
63813
|
63815
|
63816
|
63817
|
63818
|
63819
|
63820
|
63821
|
63822
|
63823
|
63824
|
63825
|
63826
|
63827
|
63828
|
63829
|
69441
|
69442
|
69443
|
69444
|
69445
|
69446
|
69447
|
69448
|
69449
|
69450
|
69451
|
69452
|
69453
|
69667
|
69668
|
69669
|
69670
|
69671
|
69672
|
69673
|
69674
|
93873
|
93874
|
93875
|
93876
|
93877
|
93878
|
93879
|
93880
|
93908
|
94753
|
94754
|
103444
|
103445
|
103446
|
103447
|
103448
|
103449
|
103450
|
103451
|
103452
|
110151
|
110152
|
110153
|
110154
|
110155
|
110156
|
110157
|
110158
|
110159
|
112147
|
112148
|
112149
|
112150
|
112151
|
112152
|
112153
|
112154
|
112155
|
112690
|
113126
|
113192
|
113221
|
113222
|
113769
|
146541
|
146542
|
146543
|
146544
|
146545
|
146546
|
146547
|
146548
|
146549
|
146550
|
146551
|
146552