Bugzilla – Attachment 113542 Details for
Bug 26991
Add action logs to search engine administration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26991: Add action logs to search engine administration
Bug-26991-Add-action-logs-to-search-engine-adminis.patch (text/plain), 5.24 KB, created by
Fridolin Somers
on 2020-11-12 08:26:45 UTC
(
hide
)
Description:
Bug 26991: Add action logs to search engine administration
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-11-12 08:26:45 UTC
Size:
5.24 KB
patch
obsolete
>From 5b7688e72190f94fe58c7acf31bb6035111dd3da Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Tue, 10 Nov 2020 15:51:24 +0100 >Subject: [PATCH] Bug 26991: Add action logs to search engine administration > >Search engine administration is very important, >we should log who/when it is changed. >I don't add a preference system to disable it, >like there is no for preference system logs. > >Test plan : >1) Use searchengine Elasticsearch >2) Go to Administation > Search engine configuration (Elasticsearch) >3) Click on 'Reset Mappings' and accept >4) Edit some lines and save >5) Go to 'Tools' > 'Log viewer' >6) Select only 'Search engine' in Modules and submit >7) Select only 'Edit mappings' in Actions >8) Check you see a log >9) Select only 'Reset mappings' in Actions >10) Check you see a log >--- > admin/searchengine/elasticsearch/mappings.pl | 5 +++++ > koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 8 ++++++-- > 2 files changed, 11 insertions(+), 2 deletions(-) > >diff --git a/admin/searchengine/elasticsearch/mappings.pl b/admin/searchengine/elasticsearch/mappings.pl >index e43c7a8516..89740f0c2b 100755 >--- a/admin/searchengine/elasticsearch/mappings.pl >+++ b/admin/searchengine/elasticsearch/mappings.pl >@@ -22,6 +22,7 @@ use List::Util qw( first ); > use C4::Koha; > use C4::Output; > use C4::Auth; >+use C4::Log; > > use Koha::SearchEngine::Elasticsearch; > use Koha::SearchMarcMaps; >@@ -168,6 +169,9 @@ if ( $op eq 'edit' ) { > $schema->storage->txn_rollback; > } else { > push @messages, { type => 'message', code => 'success_on_update' }; >+ >+ C4::Log::logaction( 'SEARCHENGINE', 'EDIT_MAPPINGS', undef, q{} ); >+ > $schema->storage->txn_commit; > > Koha::SearchEngine::Elasticsearch->clear_search_fields_cache(); >@@ -178,6 +182,7 @@ if ( $op eq 'edit' ) { > elsif( $op eq 'reset_confirmed' ) { > Koha::SearchEngine::Elasticsearch->reset_elasticsearch_mappings; > push @messages, { type => 'message', code => 'success_on_reset' }; >+ C4::Log::logaction( 'SEARCHENGINE', 'RESET_MAPPINGS', undef, q{} ); > } > elsif( $op eq 'reset_confirm' ) { > $template->param( reset_confirm => 1 ); >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 8d6949981f..3ba5fee4bf 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt >@@ -94,6 +94,8 @@ > > [% CASE 'REPORTS' %]Reports[% UNLESS Koha.Preference('ReportsLog') %] <i class="fa fa-warning" title="Log not enabled"></i>[% END %] > >+[% CASE 'SEARCHENGINE' %]Search engine >+ > [% CASE %][% module | html %] > [% END %] > [% END %] >@@ -116,6 +118,8 @@ > [% CASE 'DELCIRCMESSAGE' %]Delete circulation message > [% CASE 'STATUS_CHANGE' %]Change ILL request status > [% CASE 'Run' %]Run >+[% CASE 'EDIT_MAPPINGS' %]Edit mappings >+[% CASE 'RESET_MAPPINGS' %]Reset mappings > [% CASE %][% action | html %] > [% END %] > [% END %] >@@ -167,7 +171,7 @@ > [% ELSE %] > <label for="moduleALL" class="viewlog"><input type="checkbox" id="moduleALL" name="modules" value=""> All</label> > [% END %] >- [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS' ] %] >+ [% FOREACH modx IN [ 'AUTH' 'CATALOGUING' 'AUTHORITIES' 'MEMBERS' 'ACQUISITIONS' 'SERIAL' 'HOLDS' 'ILL' 'CIRCULATION' 'LETTER' 'FINES' 'SYSTEMPREFERENCE' 'CRONJOBS', 'REPORTS', 'SEARCHENGINE' ] %] > [% IF modules.grep(modx).size %] > <label for="module[% modx | html %]" class="viewlog"><input type="checkbox" id="module[% modx | html %]" name="modules" value="[% modx | html %]" checked="checked"> [% PROCESS translate_log_module module=modx %]</label> > [% ELSE %] >@@ -189,7 +193,7 @@ > <label for="actionALL" class="viewlog"><input type="checkbox" id="actionALL" name="actions" value=""> All</label> > [% END %] > >- [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' ] %] >+ [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'CHANGE PASS' 'Run' 'EDIT_MAPPINGS' 'RESET_MAPPINGS'] %] > [% IF actions.grep(actx).size %] > <label for="action[% actx| replace('\s+', '_') | html %]" class="viewlog"><input type="checkbox" id="action[% actx | replace('\s+', '_') | html %]" name="actions" value="[% actx | html %]" checked="checked"> [% PROCESS translate_log_action action=actx %]</label> > [% ELSE %] >-- >2.29.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 26991
:
113542
|
114150
|
114157
|
115032