From 7749e73526740d8288e444709b90edffc2724a57 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 21 Jul 2022 14:53:23 +0000 Subject: [PATCH] Bug 31203: Add End action to cronjobs and log viewer Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- C4/Log.pm | 4 +++- koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 3 ++- misc/cronjobs/advance_notices.pl | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/C4/Log.pm b/C4/Log.pm index 2d520013a8..cff2931515 100644 --- a/C4/Log.pm +++ b/C4/Log.pm @@ -133,9 +133,11 @@ Logs the path and name of the calling script plus the information privided by pa sub cronlogaction { my $params = shift; my $info = $params->{info}; + my $action = $params->{action}; + $action ||= "Run"; my $loginfo = (caller(0))[1]; $loginfo .= ' ' . $info if $info; - logaction( 'CRONJOBS', 'Run', $$, $loginfo ) if C4::Context->preference('CronjobLog'); + logaction( 'CRONJOBS', $action, $$, $loginfo ) if C4::Context->preference('CronjobLog'); } 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 d2c427d84c..d26dbf40a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -140,6 +140,7 @@ [% CASE 'MODIFY_FUND' %]Modify a fund [% CASE 'DELETE_FUND' %]Delete a fund [% CASE 'Run' %]Run +[% CASE 'End' %]End [% CASE 'EDIT_MAPPINGS' %]Edit mappings [% CASE 'RESET_MAPPINGS' %]Reset mappings [% CASE 'SERIAL CLAIM' %]Serial claim @@ -239,7 +240,7 @@ [% END %] - [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'EDIT_MAPPINGS' 'RESET_MAPPINGS' 'ADD_BASKET' 'MODIFY_BASKET' 'MODIFY_BASKET_HEADER' 'MODIFY_BASKET_USERS' 'CLOSE_BASKET' 'APPROVE_BASKET' 'REOPEN_BASKET' 'CANCEL_ORDER' 'CREATE_ORDER' 'MODIFY_ORDER' 'CREATE_INVOICE_ADJUSTMENT' 'UPDATE_INVOICE_ADJUSTMENT' 'DELETE_INVOICE_ADJUSTMENT' 'RECEIVE_ORDER' 'MODIFY_BUDGET' 'MODIFY_FUND' 'CREATE_FUND' 'DELETE_FUND' 'OVERDUE' 'EXPIRE' ] %] + [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'Run' 'End' 'EDIT_MAPPINGS' 'RESET_MAPPINGS' 'ADD_BASKET' 'MODIFY_BASKET' 'MODIFY_BASKET_HEADER' 'MODIFY_BASKET_USERS' 'CLOSE_BASKET' 'APPROVE_BASKET' 'REOPEN_BASKET' 'CANCEL_ORDER' 'CREATE_ORDER' 'MODIFY_ORDER' 'CREATE_INVOICE_ADJUSTMENT' 'UPDATE_INVOICE_ADJUSTMENT' 'DELETE_INVOICE_ADJUSTMENT' 'RECEIVE_ORDER' 'MODIFY_BUDGET' 'MODIFY_FUND' 'CREATE_FUND' 'DELETE_FUND' 'OVERDUE' 'EXPIRE' ] %] [% IF actions.grep(actx).size %] [% ELSE %] diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl index d27513017d..efa0f49e17 100755 --- a/misc/cronjobs/advance_notices.pl +++ b/misc/cronjobs/advance_notices.pl @@ -640,7 +640,7 @@ sub send_digests { } } -cronlogaction({ info => "COMPLETED" }); +cronlogaction({ action => 'End', info => "COMPLETED" }); 1; -- 2.39.5