Bug 31357: Separate holds history from intranetreadinghistory

Currently the system preference intranetreadinghistory determines visibility of both circulation history and holds history tabs in the patron record.  It would be helpful to allow the option of setting each of those independently.

Specifically, libraries have requested the option of being able to view the holds history in a patron record without having to enable viewing of the circulation history.

Test Plan:
1) Apply this patch
2) Restart all the things!
3) Run updatadatabase.pl
4) Verify the new syspref intranetReadingHistoryHolds has the same value
   as the existing syspref intranetreadinghistory
5) Disable intranetreadinghistory, enable intranetReadingHistoryHolds
6) Verify you can view a patron's holds history but not reading history

Signed-off-by: Sam Lau <samalau@gmail.com>

JD amended patch:
* renamed syspref intranetReadingHistoryHolds => IntranetReadingHistoryHolds
* tidy

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Kyle Hall 2023-06-29 14:17:09 -04:00 committed by Tomas Cohen Arazi
parent 472e38f9ad
commit cdf18a0015
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F
5 changed files with 27 additions and 3 deletions

View file

@ -498,6 +498,7 @@ sub get_template_and_user {
IntranetmainUserblock => C4::Context->preference("IntranetmainUserblock"),
IntranetNav => C4::Context->preference("IntranetNav"),
intranetreadinghistory => C4::Context->preference("intranetreadinghistory"),
IntranetReadingHistoryHolds => C4::Context->preference("IntranetReadingHistoryHolds"),
intranetstylesheet => C4::Context->preference("intranetstylesheet"),
IntranetUserCSS => C4::Context->preference("IntranetUserCSS"),
IntranetUserJS => C4::Context->preference("IntranetUserJS"),

View file

@ -0,0 +1,17 @@
use Modern::Perl;
return {
bug_number => "31357",
description => "Add new system preference IntranetReadingHistoryHolds",
up => sub {
my ($args) = @_;
my ( $dbh, $out ) = @$args{qw(dbh out)};
$dbh->do(
q{
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) SELECT
'IntranetReadingHistoryHolds', value, '', 'If ON, Holds history is enabled for all patrons', 'YesNo'
FROM systempreferences WHERE variable = 'intranetreadinghistory';
}
);
},
}

View file

@ -151,7 +151,7 @@
[% END %]
[% END %]
[% IF CAN_user_borrowers_edit_borrowers %]
[% IF ( intranetreadinghistory ) %]
[% IF ( IntranetReadingHistoryHolds ) %]
[% IF ( holdshistoryview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/members/holdshistory.pl?borrowernumber=[% patron.borrowernumber | uri %]">Holds history</a></li>
[% END %]
[% END %]

View file

@ -26,7 +26,13 @@ Patrons:
choices:
1: "Allow"
0: "Don't allow"
- "staff to access a patron's checkout and hold history (checkout history is still stored, regardless of staff being allowed access or not)."
- "staff to access a patron's checkout (checkout history is still stored, regardless of staff being allowed access or not)."
-
- pref: IntranetReadingHistoryHolds
choices:
1: "Allow"
0: "Don't allow"
- "staff to access a patron's hold history (hold history is still stored, regardless of staff being allowed access or not)."
-
- "When deleting a patron who owns public or shared lists,"
- pref: ListOwnershipUponPatronDeletion

View file

@ -44,7 +44,7 @@
[% INCLUDE 'members-toolbar.inc' %]
<h1>Holds history</h1>
[% UNLESS Koha.Preference('intranetreadinghistory') %]
[% UNLESS Koha.Preference('IntranetReadingHistoryHolds') %]
<div class="dialog alert">Staff members are not allowed to access patron's holds history</div>
[% ELSIF is_anonymous %]
<div class="dialog alert">This is the anonymous patron, so no holds history is displayed.</div>