From 9fffb85fbd0d4aa4f7e0633abe6861b9aabc28fa Mon Sep 17 00:00:00 2001 From: David Flater Date: Wed, 23 Jul 2025 19:45:32 +0000 Subject: [PATCH] Bug 32682: Add permission for viewing patron reading history Create or modify a staff user with edit_borrowers permssion enabled ( Staff A ) Create or modify a staff user without edit_borrowers permssion enabled ( Staff B ) Ensure the "intranetreadinghistory" syspref is enabled Check out an assortment of items to any patron Apply patch, update_database, then restart_all Check the permissions of the staff user A and ensure that they have been automatically assigned the new "view_checkout_history" permission Check the permissions of the staff user B and ensure that they have NOT been automatically assigned the new "view_checkout_history" permission View the same patron and ensure you can still see their checkout history as Staff A and as a superlibrarain Disable the "intranetreadinghistory" syspref and remove the "view_checkout_history" permission of the staff user update_database, then restart_all, and check the staff user (Staff A and Staff B). Neither should have the "view_checkout_history" permission L:i --- koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc | 2 +- .../intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt | 2 +- koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index 60e05901e3..9600c57722 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -188,7 +188,7 @@ [% END %] [% END %] - [% IF CAN_user_borrowers_view_checkout_history %] + [% IF (CAN_user_borrowers_view_checkout_history && Koha.Preference('intranetreadinghistory')) %]
  • Circulation history
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 18c9f348fc..6fa7a927cf 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -151,7 +151,7 @@ [% END %] [% END %] - [% IF CAN_user_borrowers_view_checkout_history %] + [% IF CAN_user_borrowers_view_checkout_history && Koha.Preference('intranetreadinghistory') %] [% IF ( patron.privacy == 2 ) %]
  • Export today's checked in barcodes diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt index 91e021ff02..3660b82e0b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt @@ -41,7 +41,7 @@

    Checkout history for [% INCLUDE 'biblio-title.inc' %]

    [% IF biblio.author %]

    by [% biblio.author | html %]

    [% END %] - [% SET show_patron_column = CAN_user_borrowers_view_checkout_history) AND CAN_user_circulate_circulate_remaining_permissions %] + [% SET show_patron_column = (CAN_user_borrowers_view_checkout_history && Koha.Preference('intranetreadinghistory')) AND CAN_user_circulate_circulate_remaining_permissions %]
    [% IF checkouts %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt index 3ddd2144e9..409cd5ac5c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt @@ -46,7 +46,7 @@ [% UNLESS checkouts %][% checkouts = [] %][% END %] [% UNLESS old_checkouts %][% old_checkouts = [] %][% END %] [% SET all_checkouts = checkouts.merge(old_checkouts) %] - [% UNLESS CAN_user_borrowers_view_checkout_history %] + [% UNLESS (CAN_user_borrowers_view_checkout_history && Koha.Preference('intranetreadinghistory')) %]
    Staff members are not allowed to access patron's checkout history
    [% ELSIF is_anonymous %]
    This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.
    -- 2.39.5