Bugzilla – Attachment 171784 Details for
Bug 37103
Link log viewer options to corresponding system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37103: Link log viewer options to corresponding system preference
Bug-37103-Link-log-viewer-options-to-corresponding.patch (text/plain), 9.54 KB, created by
Laura Escamilla
on 2024-09-19 15:50:58 UTC
(
hide
)
Description:
Bug 37103: Link log viewer options to corresponding system preference
Filename:
MIME Type:
Creator:
Laura Escamilla
Created:
2024-09-19 15:50:58 UTC
Size:
9.54 KB
patch
obsolete
>From 70bd8fe4f11d627efb073f614c89bf6526e62ba6 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 17 Jun 2024 15:41:53 +0000 >Subject: [PATCH] Bug 37103: Link log viewer options to corresponding system > preference > >This patch updates the log viewer interface so that users with the >correct permissions can click a module's "Log not enabled" icon to go >directly to the corresponding system preference for enabling the log. > >To test, apply the patch and go to Tools -> Log viewer (must have >"view_system_logs" permission). > >- You should see an icon next to each module for which logging is > disabled. Hovering over the icon should give a tooltip: "Log not > enabled." >- If you are logged in as a user with "manage_sysprefs" permission, > clicking the icon should take you directly to the system preference > for enabling or disabling that module's logs. >- If your user does not have "manage_sysprefs" permission the icon > should not be a link. > >Sponsored-By: Athens County Public Libraries >Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org> >Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com> >--- > .../prog/en/modules/tools/viewlog.tt | 35 ++++++++++--------- > koha-tmpl/intranet-tmpl/prog/js/viewlog.js | 8 +++++ > 2 files changed, 26 insertions(+), 17 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 545b038b3d..78a181b9b3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -69,39 +69,39 @@ > > [% BLOCK translate_log_module %] > [% SWITCH module %] >-[% CASE 'AUTH' %]<span>Authentication</span>[% UNLESS Koha.Preference('AuthFailureLog') || Koha.Preference('AuthScuccessLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >-[% CASE 'CATALOGUING' %]<span>Catalog</span>[% UNLESS Koha.Preference('CataloguingLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'AUTH' %]<span>Authentication</span>[% UNLESS Koha.Preference('AuthFailureLog') || Koha.Preference('AuthScuccessLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="AuthFailureLog"></i>[% END %] >+[% CASE 'CATALOGUING' %]<span>Cataloging</span>[% UNLESS Koha.Preference('CataloguingLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="CataloguingLog"></i>[% END %] > >-[% CASE 'AUTHORITIES' %]<span>Authorities</span>[% UNLESS Koha.Preference('AuthoritiesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'AUTHORITIES' %]<span>Authorities</span>[% UNLESS Koha.Preference('AuthoritiesLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="AuthoritiesLog"></i>[% END %] > >-[% CASE 'MEMBERS' %]<span>Patrons</span>[% UNLESS Koha.Preference('BorrowersLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'MEMBERS' %]<span>Patrons</span>[% UNLESS Koha.Preference('BorrowersLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="BorrowersLog"></i>[% END %] > >-[% CASE 'ACQUISITIONS' %]<span>Acquisitions</span>[% UNLESS Koha.Preference('AcquisitionLog') %]<i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'ACQUISITIONS' %]<span>Acquisitions</span>[% UNLESS Koha.Preference('AcquisitionLog') %]<i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="AcquisitionLog"></i>[% END %] > >-[% CASE 'SERIAL' %]<span>Serials</span>[% UNLESS Koha.Preference('SubscriptionLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'SERIAL' %]<span>Serials</span>[% UNLESS Koha.Preference('SubscriptionLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="SubscriptionLog"></i>[% END %] > >-[% CASE 'HOLDS' %]<span>Holds</span>[% UNLESS Koha.Preference('HoldsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'HOLDS' %]<span>Holds</span>[% UNLESS Koha.Preference('HoldsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="HoldsLog"></i>[% END %] > >-[% CASE 'ILL' %]<span>Interlibrary loans</span>[% UNLESS Koha.Preference('IllLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'ILL' %]<span>Interlibrary loans</span>[% UNLESS Koha.Preference('IllLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="IllLog"></i>[% END %] > >-[% CASE 'CIRCULATION' %]<span>Circulation</span>[% UNLESS Koha.Preference('IssueLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'CIRCULATION' %]<span>Circulation</span>[% UNLESS Koha.Preference('IssueLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="IssueLog"></i>[% END %] > >-[% CASE 'CLAIMS' %]<span>Claims</span>[% UNLESS Koha.Preference('ClaimsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'CLAIMS' %]<span>Claims</span>[% UNLESS Koha.Preference('ClaimsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="ClaimsLog"></i>[% END %] > >-[% CASE 'FINES' %]<span>Fines</span>[% UNLESS Koha.Preference('FinesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'FINES' %]<span>Fines</span>[% UNLESS Koha.Preference('FinesLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="FinesLog"></i>[% END %] > > [% CASE 'SYSTEMPREFERENCE' %]<span>System preferences</span> > >-[% CASE 'CRONJOBS' %]<span>Cron jobs</span>[% UNLESS Koha.Preference('CronjobLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'CRONJOBS' %]<span>Cron jobs</span>[% UNLESS Koha.Preference('CronjobLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="CronjobLog"></i>[% END %] > >-[% CASE 'REPORTS' %]<span>Reports</span>[% UNLESS Koha.Preference('ReportsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'REPORTS' %]<span>Reports</span>[% UNLESS Koha.Preference('ReportsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="ReportsLog"></i>[% END %] > > [% CASE 'SEARCHENGINE' %]<span>Search engine</span> > >-[% CASE 'NOTICES' %]<span>Notices</span>[% UNLESS Koha.Preference('NoticesLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >-[% CASE 'NEWS' %]<span>News</span>[% UNLESS Koha.Preference('NewsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >-[% CASE 'RECALLS' %]<span>Recalls</span>[% UNLESS Koha.Preference('RecallsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >-[% CASE 'SUGGESTION' %]<span>Suggestions</span>[% UNLESS Koha.Preference('SuggestionsLog') %] <i class="fa-solid fa-triangle-exclamation" title="Log not enabled"></i>[% END %] >+[% CASE 'NOTICES' %]<span>Notices</span>[% UNLESS Koha.Preference('NoticesLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="NoticesLog"></i>[% END %] >+[% CASE 'NEWS' %]<span>News</span>[% UNLESS Koha.Preference('NewsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="NewsLog"></i>[% END %] >+[% CASE 'RECALLS' %]<span>Recalls</span>[% UNLESS Koha.Preference('RecallsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="RecallsLog"></i>[% END %] >+[% CASE 'SUGGESTION' %]<span>Suggestions</span>[% UNLESS Koha.Preference('SuggestionsLog') %] <i class="log-disabled fa-solid fa-triangle-exclamation" title="Log not enabled" data-log="SuggestionsLog"></i>[% END %] > > [% CASE %][% module | html %] > [% END %] >@@ -491,6 +491,7 @@ > [% Asset.js("lib/jsdiff/jsdiff.min.js") | $raw %] > <script> > var table_settings = [% TablesSettings.GetTableSettings('tools', 'logviewer', 'logst', 'json') | $raw %]; >+ var CAN_user_parameters_manage_sysprefs = "[% CAN_user_parameters_manage_sysprefs | html %]"; > </script> > [% Asset.js("js/viewlog.js") | $raw %] > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >index 568320af81..52c9582233 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/viewlog.js >@@ -149,4 +149,12 @@ $(document).ready(function(){ > return false; > } > }); >+ >+ $(".log-disabled").each(function(){ >+ if( CAN_user_parameters_manage_sysprefs ){ >+ let pref = $(this).data("log") >+ url = "/cgi-bin/koha/admin/preferences.pl?op=search&searchfield="; >+ $(this).wrap("<a href='" + url + pref + "' target='_blank'></a>") >+ } >+ }).tooltip(); > }); >-- >2.39.2
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 37103
:
167788
|
167800
|
171782
|
171783
| 171784 |
171785