From cf876ab25b31834e9b0e54be69ca886a53695a55 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Wed, 28 Oct 2020 12:34:01 +0000
Subject: [PATCH] Bug 26844: Add warning to disabled logs on log viewer

To test:
1 - Go to Admin->System preferences->Logs tab
2 - Make sure some logs are disabled
3 - Go to Tools->Log viewer
4 - Note you can select logs that are disabled
5 - Apply patch
6 - Reload page
7 - Note disabled logs have a warning icon and hover text
---
 .../intranet-tmpl/prog/en/modules/tools/viewlog.tt | 39 ++++++++++++++--------
 1 file changed, 26 insertions(+), 13 deletions(-)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
index 1a1f8fb18c..22a17720c8 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
@@ -67,20 +67,33 @@
 
 [% BLOCK translate_log_module %]
 [%    SWITCH module %]
-[%        CASE 'AUTH'         %]Authentication
-[%        CASE 'CATALOGUING'  %]Catalog
-[%        CASE 'AUTHORITIES'  %]Authorities
-[%        CASE 'MEMBERS'      %]Patrons
-[%        CASE 'ACQUISITIONS' %]Acquisitions
-[%        CASE 'SERIAL'       %]Serials
-[%        CASE 'HOLDS'        %]Holds
-[%        CASE 'ILL'          %]Interlibrary loans
-[%        CASE 'CIRCULATION'  %]Circulation
-[%        CASE 'LETTER'       %]Letter
-[%        CASE 'FINES'        %]Fines
+[%        CASE 'AUTH'         %]Authentication[% UNLESS Koha.Preference('AuthFailureLog') || Koha.Preference('AuthScuccessLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+[%        CASE 'CATALOGUING'  %]Catalog[% UNLESS Koha.Preference('CataloguingLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'AUTHORITIES'  %]Authorities[% UNLESS Koha.Preference('AuthoritiesLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'MEMBERS'      %]Patrons[% UNLESS Koha.Preference('BorrowersLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'ACQUISITIONS' %]Acquisitions <i class="fa fa-warning" title="Log not enabled"></i>
+
+[%        CASE 'SERIAL'       %]Serials[% UNLESS Koha.Preference('SubscriptionLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'HOLDS'        %]Holds[% UNLESS Koha.Preference('HoldsLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'ILL'          %]Interlibrary loans[% UNLESS Koha.Preference('IllLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'CIRCULATION'  %]Circulation[% UNLESS Koha.Preference('IssueLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'LETTER'       %]Letter[% UNLESS Koha.Preference('LetterLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'FINES'        %]Fines[% UNLESS Koha.Preference('FinesLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
 [%        CASE 'SYSTEMPREFERENCE' %]System prefs
-[%        CASE 'CRONJOBS' %]Cron jobs
-[%        CASE 'REPORTS'      %]Reports
+
+[%        CASE 'CRONJOBS' %]Cron jobs[% UNLESS Koha.Preference('CronjobLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
+[%        CASE 'REPORTS'      %]Reports[% UNLESS Koha.Preference('ReportsLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %]
+
 [%        CASE %][% module | html %]
 [%    END %]
 [% END %]
-- 
2.11.0