From b9422bc4fb99339054ec838f34574f69231048e2 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Mon, 22 Apr 2024 00:07:48 -0300 Subject: [PATCH] Bug 25996: Add restrictions to the log viewer This patch adds the new log actions, related to restrictions, to the log viewer. To test: 0. Set BorrowersLog to 'Log' 1. Pick a patron 2. Add a restriction and identify it's id, maybe using the DB: $ ktd --shell k$ koha-mysql kohadev > SELECT * FROM borrower_debarments; 3. Run [1]: k$ perl -MKoha::Patron::Debarments \ -e 'Koha::Patron::Debarments::ModDebarment( { borrower_debarment_id => 195, comment => "potato" } );' 4. Visit the log viewer. => SUCCESS: You can filter on 'Create restriction', 'Modify restriction' and 'Delete restriction', things are displayed correctly. [1] There's the ModDebarment method in the codebase, but I couldn't find a way to trigger it for testing, so my last resort was to do it from the CLI, manually. The tests on the previous patches cover the method anyway. Sponsored-by: Karlsruhe Institute of Technology (KIT) --- koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 8afd131d242..6b99b08547e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt @@ -145,6 +145,9 @@ [% CASE 'CREATE_FUND' %]Create a fund [% CASE 'MODIFY_FUND' %]Modify a fund [% CASE 'DELETE_FUND' %]Delete a fund +[% CASE 'CREATE_RESTRICTION' %]Create restriction +[% CASE 'MODIFY_RESTRICTION' %]Modify restriction +[% CASE 'DELETE_RESTRICTION' %]Delete restriction [% CASE 'Run' %]Run [% CASE 'End' %]End [% CASE 'EDIT_MAPPINGS' %]Edit mappings @@ -240,7 +243,7 @@ [% END %] - [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'MODCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'RESET 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' 'ACQUISITION CLAIM' 'ACQUISITION ORDER' 'OVERDUE' 'EXPIRE' ] %] + [% FOREACH actx IN [ 'ADD' 'DELETE' 'MODIFY' 'ISSUE' 'RETURN' 'RENEW' 'CREATE' 'CANCEL' 'FILL' 'SUSPEND' 'RESUME' 'ADDCIRCMESSAGE' 'MODCIRCMESSAGE' 'DELCIRCMESSAGE' 'STATUS_CHANGE' 'PATRON_NOTICE' 'CHANGE PASS' 'RESET 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' 'ACQUISITION CLAIM' 'ACQUISITION ORDER' 'OVERDUE' 'EXPIRE' 'CREATE_RESTRICTION' 'MODIFY_RESTRICTION' 'DELETE_RESTRICTION' ] %] [% IF actions.grep(actx).size %] [% ELSE %] -- 2.44.0