From ee5ddb2cf3c4f3ed12ba23c672cd8ae7075b3345 Mon Sep 17 00:00:00 2001 From: Matt Blenkinsop Date: Wed, 14 Jun 2023 14:08:17 +0000 Subject: [PATCH] Bug 15504: Add new syspref TrackLastPatronActivityTriggers This patch adds a new syspref TrackLastPatronActivityTriggers to determine which actions should update borrowers.lastseen --- ...bug_15504-add-tracklastpatronactivityoptions.pl | 14 ++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/patrons.pref | 12 ++++++++++-- 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl diff --git a/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl b/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl new file mode 100644 index 0000000000..5e96b8c4c2 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl @@ -0,0 +1,14 @@ +use Modern::Perl; + +return { + bug_number => "15504", + description => "Adds a new system preference - TrackLastPatronActivityTriggers", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + + $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('TrackLastPatronActivityTriggers','',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron is does a selected option','multiple') }); + + say $out "Added system preference 'TrackLastPatronActivityTriggers'"; + }, +}; diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index b224c147fe..843a0c0d41 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -739,6 +739,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('TraceSubjectSubdivisions','0','1','Create searches on all subdivisions for subject tracings.','YesNo'), ('TrackClicks','0',NULL,'Track links clicked','Integer'), ('TrackLastPatronActivity','0',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron is seen','YesNo'), +('TrackLastPatronActivityTriggers','',NULL,'If set, the field borrowers.lastseen will be updated everytime a patron is does a selected option','multiple'), ('TransfersBlockCirc','1',NULL,'Should the transfer modal block circulation staff from continuing scanning items','YesNo'), ('TransfersMaxDaysWarning','3',NULL,'Define the days before a transfer is suspected of having a problem','Integer'), ('TransferWhenCancelAllWaitingHolds','0',NULL,'Transfer items when cancelling all waiting holds','YesNo'), 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 fa71e787e7..42a5b8f2b8 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 @@ -89,8 +89,16 @@ Patrons: choices: 1: Do 0: "Don't" - - track last patron activity. - - The first time each day that a patron logs into the OPAC, connects to Koha via SIP or ILS-DI, or checks an item out the borrowers.lastseen will update with the current date and time. + - track last patron activity. Use TrackLastPatronActivityTriggers to select which activities should be tracked. + - + - Select which activities should be tracked. The first time each day that one of these activities occurs, borrowers.lastseen will update with the current date and time. + - pref: TrackLastPatronActivityTriggers + multiple: + login: "Login to OPAC" + connection: "Connection to Koha via SIP or ILSDI" + check_out: "Checking out an item" + renewal: "Renewing an item" + check_in: "Returning an item" - - pref: AutoApprovePatronProfileSettings choices: -- 2.37.1 (Apple Git-137.1)