Bug 13613: (Bug 22744 follow-up) Remove js handling for 'none'
authorNick Clemens <nick@bywatersolutions.com>
Wed, 17 Mar 2021 13:25:44 +0000 (13:25 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 11 May 2021 13:09:19 +0000 (15:09 +0200)
There was a function and a set of onclick events to handle the 'Do not notify'
checkboxes.

Those have been removed, so should this code

To test:
1 - Sign in to opac
2 - Click on 'your messaging' tab from 'your account'
3 - Check/uncheck some boxes
4 - Note error in the console:
    Uncaught TypeError: document.opacmessaging.none2 is undefined
5 - Apply patch
6 - repeat
7 - no more error

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt

index 40ff528..e1faabe 100644 (file)
                                                                    class="phone"
                                                                    id="phone[% messaging_preference.message_attribute_id | html %]"
                                                                    name="[% messaging_preference.message_attribute_id | html %]"
-                                                                   value="phone" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                                   value="phone" checked="checked" />
                                                         [% ELSE %]
                                                             <input type="checkbox"
                                                                    class="phone"
                                                                    id="phone[% messaging_preference.message_attribute_id | html %]"
                                                                    name="[% messaging_preference.message_attribute_id | html %]"
-                                                                   value="phone" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                                   value="phone" />
                                                         [% END %]
                                                     </td>
                                                 [% ELSE %]
                                                             class="itiva"
                                                             id="itiva[% messaging_preference.message_attribute_id | html %]"
                                                             name="[% messaging_preference.message_attribute_id | html %]"
-                                                            value="itiva" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                            value="itiva" checked="checked" />
                                                 [% ELSE %]
                                                 <input type="checkbox"
                                                             class="itiva"
                                                             id="itiva[% messaging_preference.message_attribute_id | html %]"
                                                             name="[% messaging_preference.message_attribute_id | html %]"
-                                                            value="itiva" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                            value="itiva" />
                                                 [% END %]
                                                 </td>
                                                 [% ELSE %]
                                             [% IF ( messaging_preference.transport_email ) %]
                                                 <td class="selectcol">
                                                     [% IF ( messaging_preference.transports_email ) %]
-                                                        <input type="checkbox" class="email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                        <input type="checkbox" class="email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" checked="checked" />
                                                     [% ELSE %]
-                                                        <input type="checkbox" class="email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id | html %].checked=false;" />
+                                                        <input type="checkbox" class="email" id="email[% messaging_preference.message_attribute_id | html %]" name="[% messaging_preference.message_attribute_id | html %]" value="email" />
                                                     [% END %]
                                                 </td>
                                             [% ELSE %]
                                             [% IF ( messaging_preference.has_digest ) %]
                                                 <td class="selectcol">
                                                     [% 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" />
                                                     [% 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" />
                                                     [% END %]
                                                 </td>
                                             [% ELSE %]
 [% BLOCK jsinclude %]
     <script>
         $(document).ready(function(){
-            $(".none").click(function(){
-                if($(this).attr("checked")){
-                    var rowid = $(this).attr("id");
-                    newid = Number(rowid.replace("none",""))
-                    $("#sms"+newid).removeAttr("checked");
-                    $("#email"+newid).removeAttr("checked");
-                    $("#digest"+newid).removeAttr("checked");
-                    $("#rss"+newid).removeAttr("checked");
-                }
-            });
             $("#info_digests").tooltip();
 
             // At load time, we want digest disabled if no digest using transport is enabled