Bug 25996: Add restrictions to the log viewer
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 22 Apr 2024 03:07:48 +0000 (00:07 -0300)
committerKatrin Fischer <katrin.fischer@bsz-bw.de>
Fri, 3 May 2024 16:02:17 +0000 (18:02 +0200)
commit38970ac9d6282c2851055b943e9ec2bf31c928e3
tree0ad8a653fbb046a4514286506095381ead7999c7
parent00ec0035cffadf14357a81ee20a07a1ed3033fa3
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)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt