From e9aa4b3fa1c8c3e524ee8c8bc742e9c1f6344945 Mon Sep 17 00:00:00 2001
From: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Date: Wed, 2 Dec 2020 10:52:27 +0100
Subject: [PATCH] Bug 26953: Hide phone and itiva from "Overdue notice/status
 triggers"

If the prefs are off we should not display the checkboxes

Test plan:
1. Turn off PhoneNotification and TalkingTechItivaPhoneNotification
2. Go to the "Overdue notice/status triggers" and confirm that phone and
itiva columns are not displayed
3. Turn the prefs on and confirm the checkboxes are now displayed
---
 koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt | 4 ++++
 1 file changed, 4 insertions(+)

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 22d4050fe0..eecc236fff 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/overduerules.tt
@@ -73,6 +73,8 @@
               <th scope="col">Letter</th>
               <th scope="col">Restrict</th>
               [% FOREACH mtt IN message_transport_types %]
+                [% NEXT IF mtt == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
+                [% NEXT IF mtt == 'phone' AND !Koha.Preference('PhoneNotification') %]
                 <th scpre="col">
                   [% SWITCH mtt %]
                   [% CASE 'email' %]
@@ -121,6 +123,8 @@
               [% END %]
               </td>
               [% FOREACH mtt IN value.message_transport_types %]
+                [% NEXT IF mtt.value == 'itiva' AND !Koha.Preference('TalkingTechItivaPhoneNotification') %]
+                [% NEXT IF mtt.value == 'phone' AND !Koha.Preference('PhoneNotification') %]
                 <td>
                   [% IF mtt.selected %]
                     <input type="checkbox" name="mtt[% tab.number | html %]-[% value.overduename | html %]" value="[% mtt.value | html %]" checked="checked" />
-- 
2.20.1