From 927de93ba23f0d3611ffd665129fd4851a5e3a6b Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 12 Oct 2023 12:53:34 +0100 Subject: [PATCH] Bug 35030: Add 'article' to patron activity triggers This patch adds 'article' to the list of triggers available for tracking patron activity. Test plan 1) Select 'Placing an article request 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 --- Koha/ArticleRequest.pm | 14 ++++++++++++++ .../prog/en/modules/admin/preferences/patrons.pref | 1 + 2 files changed, 15 insertions(+) diff --git a/Koha/ArticleRequest.pm b/Koha/ArticleRequest.pm index 42d2d011f1d..1bfbda34847 100644 --- a/Koha/ArticleRequest.pm +++ b/Koha/ArticleRequest.pm @@ -64,6 +64,7 @@ sub request { if $debit; $self->store(); + $self->patron->update_lastseen('article'); $self->notify(); return $self; } @@ -226,6 +227,19 @@ sub borrower { return Koha::Patron->_new_from_dbic($rs); } +=head3 patron + +Returns the Koha::Patron object for this article request + +=cut + +sub patron { + my ($self) = @_; + my $rs = $self->_result->borrowernumber; + return unless $rs; + return Koha::Patron->_new_from_dbic($rs); +} + =head3 branch Returns the Koha::Library object for this article request 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..32d37aa5451 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" + article: "Places an article request" - - pref: AutoApprovePatronProfileSettings choices: -- 2.41.0