Bug 33013 - Add age, interface and operator as additional report stats
Summary: Add age, interface and operator as additional report stats
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Peter Vashchuk
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-20 12:22 UTC by Peter Vashchuk
Modified: 2023-09-18 22:26 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 33013: add age, interface and operator to pseudonymized statistics (11.56 KB, patch)
2023-02-20 12:28 UTC, Peter Vashchuk
Details | Diff | Splinter Review
Bug 33013: add age, interface and operator to pseudonymized statistics (11.62 KB, patch)
2023-09-13 13:33 UTC, Peter Vashchuk
Details | Diff | Splinter Review
Bug 33013: add age, interface and operator to pseudonymized statistics (11.70 KB, patch)
2023-09-18 09:23 UTC, Peter Vashchuk
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Vashchuk 2023-02-20 12:22:39 UTC

    
Comment 1 Peter Vashchuk 2023-02-20 12:28:53 UTC
Created attachment 146955 [details] [review]
Bug 33013: add age, interface and operator to pseudonymized statistics

This patch adds: age (patron's age), interface (sip/api/opac/intranet/cron/etc) 
and operator (user id if it has extra permissions, for example: librarian) 
to the pseudonymized statistics table.

To reproduce:
1. With Pseudonymization enabled, perform a check-out, check-in or renew to 
add an entry to the pseudonymized_transactions table.
2. Apply the patch and perform the atomic update. 
3. Go to sysprefs and enable "Interface" and "Operator ID" for PseudonymizationTransactionFields
and "Patron's age" for PseudonymizationPatronFields.
4. Perform the same actions as you did earlier (check-out, check-in, or renew) to add another
entry to the pseudonymized_transactions table. Compare those two entries, the one that was
added should have new stats.
Comment 2 Jonathan Druart 2023-05-04 13:22:30 UTC
I don't understand the "operator", can you detail please?
Comment 3 Emily-Rose Francoeur 2023-09-12 20:11:03 UTC
When I try to apply the patch (git bz apply 33013) at step 2, I got this error

error: sha1 information is lacking or useless (Koha/PseudonymizedTransaction.pm).
error: could not build fake ancestor
Patch failed at 0001 Bug 33013: add age, interface and operator to pseudonymized statistics
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-33013-add-age-interface-and-operator-to-pseudo-xu_nqqh0.patch
Comment 4 Peter Vashchuk 2023-09-13 13:33:55 UTC
Created attachment 155591 [details] [review]
Bug 33013: add age, interface and operator to pseudonymized statistics

This patch adds: age (patron's age), interface (sip/api/opac/intranet/cron/etc)
and operator (user id if it has extra permissions, for example: librarian)
to the pseudonymized statistics table.

To reproduce:
1. With Pseudonymization enabled, perform a check-out, check-in or renew to
add an entry to the pseudonymized_transactions table.
2. Apply the patch and perform the atomic update.
3. Go to sysprefs and enable "Interface" and "Operator ID" for PseudonymizationTransactionFields
and "Patron's age" for PseudonymizationPatronFields.
4. Perform the same actions as you did earlier (check-out, check-in, or renew) to add another
entry to the pseudonymized_transactions table. Compare those two entries, the one that was
added should have new stats.
Comment 5 Peter Vashchuk 2023-09-13 13:34:49 UTC
(In reply to Émily-Rose Francoeur from comment #3)

Rebased on the current master, it should work now
Comment 6 Lucas Gass 2023-09-13 21:11:28 UTC
Hi Peter,

Can you perltidy you changes?

 WARN	Koha/PseudonymizedTransaction.pm
   WARN	  tidiness
		The file is less tidy than before (bad/messy lines before: 14, now: 26)

 WARN	Koha/Schema/Result/PseudonymizedTransaction.pm
   WARN	  tidiness
		The file is less tidy than before (bad/messy lines before: 56, now: 62)

 WARN	installer/data/mysql/atomicupdate/bug-33013_more-pseudonymization-fields.pl
   WARN	  tidiness
		The file is less tidy than before (bad/messy lines before: 0, now: 19)
Comment 7 Peter Vashchuk 2023-09-18 09:23:12 UTC
Created attachment 155780 [details] [review]
Bug 33013: add age, interface and operator to pseudonymized statistics

This patch adds: age (patron's age), interface (sip/api/opac/intranet/cron/etc)
and operator (user id if it has extra permissions, for example: librarian)
to the pseudonymized statistics table.

To reproduce:
1. With Pseudonymization enabled, perform a check-out, check-in or renew to
add an entry to the pseudonymized_transactions table.
2. Apply the patch and perform the atomic update.
3. Go to sysprefs and enable "Interface" and "Operator ID" for PseudonymizationTransactionFields
and "Patron's age" for PseudonymizationPatronFields.
4. Perform the same actions as you did earlier (check-out, check-in, or renew) to add another
entry to the pseudonymized_transactions table. Compare those two entries, the one that was
added should have new stats.
Comment 8 Lucas Gass 2023-09-18 22:26:35 UTC
Hi Peter, a couple things:

1. Your DB update still reads 'bug_number  => "BUG_NUMBER",'. Can you replace that with the actual bug number.

2. If I run the 'updatedatabase' multiple times it will continue to output:
	Warning: PseudonymizationPatronFields already has 'age'
	Warning: PseudonymizationTransactionFields already has 'interface'
	Warning: pseudonymized_transactions already has 'age'
	Warning: pseudonymized_transactions already has 'interface'
	Warning: pseudonymized_transactions already has 'operator

3. Can we get an explain of "operator" as Jonathan requested in comment 2?