Bug 36118

Summary: ILL request log does not display patron information
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: Needs documenting --- QA Contact: Victor Grousset/tuxayo <victor>
Severity: enhancement    
Priority: P5 - low CC: andrew.auld, edith.speller, jeremy.evans, kyle, lucas, martin.renvoize, nugged, pedro.amorim, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
URL: https://github.com/PTFS-Europe/koha/commits/bug_36118/
Change sponsored?: Sponsored Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
With the ILLlog system preference enabled, the actions logged for each ILL request lacked details about which patron user performed the action. This enhancement addresses this.
Version(s) released in:
24.11.00
Circulation function:
Bug Depends on: 37103    
Bug Blocks:    
Attachments: Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Update status and send notice core actions logging
Bug 36118: Send patron object to template
Bug 36118: Update status and send notice core actions logging
Bug 36118: Tidy changed code block
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Update status and send notice core actions logging
Bug 36118: Tidy changed code block
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Update status and send notice core actions logging
Bug 36118: Tidy changed code block
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
[23.11] Bug 36118: Send patron object to template
[23.11] Bug 36118: Preparation: Move action logs tt methods
[23.11] Bug 36118: Move common ILL log parts to single ill-request-log.inc file
[23.11] Bug 36118: Update status and send notice core actions logging
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: (QA follow-up): Make labels translatable
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: (QA follow-up): Make labels translatable
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: (QA follow-up): Make labels translatable
Bug 36118: [DONT PUSH] patch to test patron notice only
Bug 36118: Send patron object to template
Bug 36118: Preparation: Move action logs tt methods
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Bug 36118: Update status and send notice core actions logging
Bug 36118: (QA follow-up): Make labels translatable

Description Pedro Amorim 2024-02-16 16:22:50 UTC

    
Comment 1 Pedro Amorim 2024-02-19 16:21:55 UTC Comment hidden (obsolete)
Comment 2 Pedro Amorim 2024-02-19 16:21:57 UTC Comment hidden (obsolete)
Comment 3 Pedro Amorim 2024-02-19 16:21:59 UTC Comment hidden (obsolete)
Comment 4 Martin Renvoize (ashimema) 2024-02-29 10:36:45 UTC Comment hidden (obsolete)
Comment 5 Martin Renvoize (ashimema) 2024-02-29 10:36:48 UTC Comment hidden (obsolete)
Comment 6 Martin Renvoize (ashimema) 2024-02-29 10:36:50 UTC Comment hidden (obsolete)
Comment 7 Martin Renvoize (ashimema) 2024-02-29 10:37:10 UTC
Nice improvement. Signing off
Comment 8 Victor Grousset/tuxayo 2024-03-12 20:49:12 UTC
> 4) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'

picking a type results in error 403

> Programming error - No CSRF token passed for POST
> http://localhost:8081/intranet/ill/ill-requests.pl?method=create&backend=FreeForm 
> (referer: 
> http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm)

Is that already reported? It doesn't seem to be in Bug 36195 's pad and bug 34478 's dependencies.

So can't test for now.
Code looks good at least :)
Comment 9 Pedro Amorim 2024-03-15 09:12:20 UTC Comment hidden (obsolete)
Comment 10 Pedro Amorim 2024-03-15 09:12:23 UTC Comment hidden (obsolete)
Comment 11 Pedro Amorim 2024-03-15 09:12:26 UTC Comment hidden (obsolete)
Comment 12 Pedro Amorim 2024-03-15 09:12:28 UTC Comment hidden (obsolete)
Comment 13 Pedro Amorim 2024-03-15 09:13:02 UTC
(In reply to Victor Grousset/tuxayo from comment #8)
> > 4) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
> 
> picking a type results in error 403
> 
> > Programming error - No CSRF token passed for POST
> > http://localhost:8081/intranet/ill/ill-requests.pl?method=create&backend=FreeForm 
> > (referer: 
> > http://localhost:8081/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm)
> 
> Is that already reported? It doesn't seem to be in Bug 36195 's pad and bug
> 34478 's dependencies.
> 
> So can't test for now.
> Code looks good at least :)

Thanks Victor, the original test plan was missing a step, I've since added it:
4) You need to checkout FreeForm's branch compatible with the CSRF work:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
koha-plack --restart kohadev
Comment 14 Victor Grousset/tuxayo 2024-03-15 22:33:18 UTC Comment hidden (obsolete)
Comment 15 Victor Grousset/tuxayo 2024-03-15 22:33:21 UTC Comment hidden (obsolete)
Comment 16 Victor Grousset/tuxayo 2024-03-15 22:33:24 UTC Comment hidden (obsolete)
Comment 17 Victor Grousset/tuxayo 2024-03-15 22:33:26 UTC Comment hidden (obsolete)
Comment 18 Victor Grousset/tuxayo 2024-03-15 23:27:28 UTC
> 7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.

Testing notes: need to have this commit applied "Bug 36118: [DONT PUSH] patch to test patron notice only"
Comment 19 Victor Grousset/tuxayo 2024-03-15 23:27:51 UTC
Works, makes sense, QA script happy, code looks good, passing QA :)
Comment 20 Pedro Amorim 2024-04-01 13:01:13 UTC
Created attachment 164181 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only
Comment 21 Pedro Amorim 2024-04-01 13:01:15 UTC
Created attachment 164182 [details] [review]
Bug 36118: Send patron object to template
Comment 22 Pedro Amorim 2024-04-01 13:01:18 UTC
Created attachment 164183 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable
Comment 23 Pedro Amorim 2024-04-01 13:01:21 UTC
Created attachment 164184 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file
Comment 24 Pedro Amorim 2024-04-01 13:01:24 UTC
Created attachment 164185 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with the CSRF work:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.
Comment 25 Pedro Amorim 2024-04-01 13:01:44 UTC
Hi guys, Martin and Victor, thanks for SO and QA.
Implementing this for another backend, I found some flaws in the original implementation:
- patron_notice.tt and status_change.tt were not DRY.
- The previous implementation did not consider the possibility of a log entry not having a patron (it may have been added by command-line or cron). The new implementation considers this and displays accordingly.

I've revisited it and since this had not yet been pushed I'm resubmitting here. The test plan is the same.
Comment 26 Katrin Fischer 2024-04-01 13:31:31 UTC
Hi Pedro, 

better to add the Sponsored by to the bug, see here:
https://wiki.koha-community.org/wiki/Commit_messages#Sponsor_line

And also this here from Martin ;)
https://gitlab.com/koha-community/qa-test-tools/-/merge_requests/67

It will look better and can be counted by the release script for the sponsorships I believe.
Comment 27 Victor Grousset/tuxayo 2024-04-03 23:35:49 UTC
Created attachment 164398 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 28 Victor Grousset/tuxayo 2024-04-03 23:35:52 UTC
Created attachment 164399 [details] [review]
Bug 36118: Send patron object to template

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 29 Victor Grousset/tuxayo 2024-04-03 23:35:55 UTC
Created attachment 164400 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 30 Victor Grousset/tuxayo 2024-04-03 23:35:58 UTC
Created attachment 164401 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 31 Victor Grousset/tuxayo 2024-04-03 23:36:00 UTC
Created attachment 164402 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with the CSRF work:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 32 Victor Grousset/tuxayo 2024-04-04 02:07:21 UTC
It works :)

---

> [% content | $raw %]

Where is the `content` variable from?

----

Review note: here is how to see the diff with the moved parts colored as such, thus leaving less lines to analyze in details.
git diff upstream/master --color-moved --color-moved-ws=allow-indentation-change

Also, there are some parts with alignment changes that are trivial to read with this:
git diff --color-words=. upstream/master
Comment 33 Pedro Amorim 2024-04-04 09:08:10 UTC
Thank you, Victor.

The content variable contains the HTML within the WRAPPER directive:
https://template-toolkit.org/docs/manual/Directives.html#section_WRAPPER
Comment 34 Pedro Amorim 2024-04-04 09:14:22 UTC
Created attachment 164405 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 35 Pedro Amorim 2024-04-04 09:14:25 UTC
Created attachment 164406 [details] [review]
Bug 36118: Send patron object to template

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 36 Pedro Amorim 2024-04-04 09:14:27 UTC
Created attachment 164407 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 37 Pedro Amorim 2024-04-04 09:14:30 UTC
Created attachment 164408 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 38 Pedro Amorim 2024-04-04 09:14:33 UTC
Created attachment 164409 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with the CSRF work:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout b_36243
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 39 Victor Grousset/tuxayo 2024-04-17 17:45:07 UTC
(In reply to Pedro Amorim from comment #33)
> The content variable contains the HTML within the WRAPPER directive:
> https://template-toolkit.org/docs/manual/Directives.html#section_WRAPPER

Oh, right! Thanks.

Works, makes sense, QA script happy, code looks good, count my QA stamp in :)

Needs a signoff, looks a bit too much to directly pass QA.
Is it already in production/pre-production? with other people (librarian or colleagues) having used the enhancement?
Comment 40 Pedro Amorim 2024-08-16 14:14:36 UTC
Created attachment 170450 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 41 Pedro Amorim 2024-08-16 14:14:40 UTC
Created attachment 170451 [details] [review]
Bug 36118: Send patron object to template

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 42 Pedro Amorim 2024-08-16 14:14:45 UTC
Created attachment 170452 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 43 Pedro Amorim 2024-08-16 14:14:50 UTC
Created attachment 170453 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 44 Pedro Amorim 2024-08-16 14:14:54 UTC
Created attachment 170454 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with 24.05:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout 24.05.x
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 45 Pedro Amorim 2024-09-12 10:11:28 UTC
Created attachment 171372 [details] [review]
[23.11] Bug 36118: Send patron object to template

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 46 Pedro Amorim 2024-09-12 10:11:31 UTC
Created attachment 171373 [details] [review]
[23.11] Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 47 Pedro Amorim 2024-09-12 10:11:34 UTC
Created attachment 171374 [details] [review]
[23.11] Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 48 Pedro Amorim 2024-09-12 10:11:37 UTC
Created attachment 171375 [details] [review]
[23.11] Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with 24.05:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout 24.05.x
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Comment 49 Pedro Amorim 2024-10-15 15:56:16 UTC
Created attachment 172785 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 50 Pedro Amorim 2024-10-15 15:56:19 UTC
Created attachment 172786 [details] [review]
Bug 36118: Send patron object to template

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 51 Pedro Amorim 2024-10-15 15:56:23 UTC
Created attachment 172787 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 52 Pedro Amorim 2024-10-15 15:56:26 UTC
Created attachment 172788 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 53 Pedro Amorim 2024-10-15 15:56:29 UTC
Created attachment 172789 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with 24.05:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout 24.05.x
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 54 Pedro Amorim 2024-10-15 15:57:40 UTC
(In reply to Victor Grousset/tuxayo from comment #39)
> Needs a signoff, looks a bit too much to directly pass QA.
> Is it already in production/pre-production? with other people (librarian or
> colleagues) having used the enhancement?

Hi Victor. Yes, we have been using it in production and I've now added the sign-off from Jeremy Evans.
Comment 55 Victor Grousset/tuxayo 2024-10-15 16:28:11 UTC
Thanks, that was the last missing piece. No code change since my last test on Comment 39

QA script still happy.
Comment 56 Katrin Fischer 2024-10-18 14:56:37 UTC
1) This is untranslatable:

+[% WRAPPER ill_request_log action_label = "Patron notice sent: " %]
+[% WRAPPER ill_request_log action_label = "Status changed" %]

...

The rough guideline for TT is that the parser will parce everything that is inside an HTML element. We can also get some attributes like button texts etc. from HTML elements. But in this here there is no indicator for the translation script that this is a display text.



Please fix!
Comment 57 Katrin Fischer 2024-10-18 15:09:32 UTC
Hope you are not going to hate me for it, but please rebase on top of bug 37103.

I hope as this is only template changes it won't give to much trouble.
Comment 58 Pedro Amorim 2024-10-21 11:14:26 UTC Comment hidden (obsolete)
Comment 59 Pedro Amorim 2024-10-21 11:15:43 UTC Comment hidden (obsolete)
Comment 60 Pedro Amorim 2024-10-21 11:15:47 UTC Comment hidden (obsolete)
Comment 61 Pedro Amorim 2024-10-21 11:15:50 UTC Comment hidden (obsolete)
Comment 62 Pedro Amorim 2024-10-21 11:15:53 UTC Comment hidden (obsolete)
Comment 63 Pedro Amorim 2024-10-21 11:15:56 UTC Comment hidden (obsolete)
Comment 64 Pedro Amorim 2024-10-21 11:16:00 UTC Comment hidden (obsolete)
Comment 65 Pedro Amorim 2024-10-21 11:23:15 UTC Comment hidden (obsolete)
Comment 66 Pedro Amorim 2024-10-21 11:23:19 UTC Comment hidden (obsolete)
Comment 67 Pedro Amorim 2024-10-21 11:23:22 UTC Comment hidden (obsolete)
Comment 68 Pedro Amorim 2024-10-21 11:23:25 UTC Comment hidden (obsolete)
Comment 69 Pedro Amorim 2024-10-21 11:23:28 UTC Comment hidden (obsolete)
Comment 70 Pedro Amorim 2024-10-21 11:23:32 UTC Comment hidden (obsolete)
Comment 71 Pedro Amorim 2024-10-21 11:25:25 UTC
Created attachment 173036 [details] [review]
Bug 36118: [DONT PUSH] patch to test patron notice only

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Comment 72 Pedro Amorim 2024-10-21 11:25:28 UTC
Created attachment 173037 [details] [review]
Bug 36118: Send patron object to template

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 73 Pedro Amorim 2024-10-21 11:25:32 UTC
Created attachment 173038 [details] [review]
Bug 36118: Preparation: Move action logs tt methods

This moves action logs related methods to its own .inc file in order to be reusable

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 74 Pedro Amorim 2024-10-21 11:25:35 UTC
Created attachment 173039 [details] [review]
Bug 36118: Move common ILL log parts to single ill-request-log.inc file

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 75 Pedro Amorim 2024-10-21 11:25:38 UTC
Created attachment 173040 [details] [review]
Bug 36118: Update status and send notice core actions logging

1) Enable ILLlog sys pref
2) Enable ILLModule and install 'FreeForm', run:
bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev.sh)
3) Create a new FreeForm request, visit:
<INTRA_URL>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=FreeForm
4) You need to checkout FreeForm's branch compatible with 24.05:
cd /kohadevbox/koha/Koha/Illbackends/FreeForm
git checkout 24.05.x
koha-plack --restart kohadev
5) Pick a type, insert '42' on cardnumber and pick a library, hit 'Create'
6) On the next screen, click 'Confirm request' and confirm.
7) Click 'ILL request log', notice the entry is there but has no information about who did the logged action.
8) Apply patches. Repeat steps 3) to 6). Notice the logged action now has information about the user who did the action.
9) Extra: Click 'Send notice to patron' and confirm that action is also logged with patron information.

To my knowledge, these are the only 2 actions logged by core Logger.
Backends logging their own actions that want patron information need to add it themselves following this pattern.

Sponsored-by: UKHSA - UK Health Security Agency
Sponsored-by: PTFS Europe Ltd

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Jeremy Evans <Jeremy.Evans@ukhsa.gov.uk>
Comment 76 Pedro Amorim 2024-10-21 11:25:42 UTC
Created attachment 173041 [details] [review]
Bug 36118: (QA follow-up): Make labels translatable

Also move the space+colon from 'Patron notice sent: ' label to ill-request-log.inc template
Adjust status_change.tt 'From' capitalized because for status changed this is now:
$ Status changed: From "New request" to "Requested"
Instead of the previous:
$ Status changed from "New request" to "Requested"
Comment 77 Katrin Fischer 2024-10-22 09:38:44 UTC
(In reply to Katrin Fischer from comment #57)
> Hope you are not going to hate me for it, but please rebase on top of bug
> 37103.
> 
> I hope as this is only template changes it won't give to much trouble.

Can you please do a quick rebase? I will get back to it ASAP.
Comment 78 Pedro Amorim 2024-10-22 11:27:32 UTC
Applies nicely for me.
Please note to apply interactively and comment out any [23.11] patch.
Comment 79 Katrin Fischer 2024-10-22 11:35:43 UTC
That might have been it, will re-try.
Comment 80 Katrin Fischer 2024-10-23 17:31:35 UTC
(In reply to Katrin Fischer from comment #79)
> That might have been it, will re-try.

Yep, that was the issue. 

I think we will need a follow-up then for 23.11 too - leaving with additional_work_needed.
Comment 81 Katrin Fischer 2024-10-23 18:03:12 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 82 Lucas Gass (lukeg) 2024-11-18 23:02:50 UTC
Enhancement, no 24.05.x backport