From 88c9e8fc220d3588c00f00dab47f26929b5f5604 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 12 Oct 2023 12:40:17 +0100 Subject: [PATCH] Bug 35027: Add 'hold' to patron activity triggers This patch adds 'hold' to the list of triggers available for tracking patron activity. Test plan 1) Select 'Placing a hold on an item' in the TrackPatronLastActivityTriggers system preference 2) As a staff member, place a hold on any item for a test user 3) Confirm that the borrowers.lastseen field is updated for that test borrower --- C4/Reserves.pm | 4 +++- .../prog/en/modules/admin/preferences/patrons.pref | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 36257378852..f06c1d29c19 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -258,6 +258,9 @@ sub AddReserve { )->store(); $hold->set_waiting() if $found && $found eq 'W'; + # record patron activity + $hold->patron->update_lastseen('hold'); + logaction( 'HOLDS', 'CREATE', $hold->id, $hold ) if C4::Context->preference('HoldsLog'); @@ -273,7 +276,6 @@ sub AddReserve { # Send e-mail to librarian if syspref is active if(C4::Context->preference("emailLibrarianWhenHoldIsPlaced")){ - my $patron = Koha::Patrons->find( $borrowernumber ); my $library = $patron->library; if ( my $letter = C4::Letters::GetPreparedLetter ( module => 'reserves', diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref index 9e80c862652..2f416cb2e92 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -101,6 +101,7 @@ Patrons: check_out: "Checking out an item" renewal: "Renewing an item" check_in: "Returning an item" + hold: "Placing a hold on an item" - - pref: AutoApprovePatronProfileSettings choices: -- 2.41.0