From b694c85edf1c0a371728b1c0637cfdb23a8a27e7 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 Signed-off-by: Martin Renvoize Signed-off-by: David Nind Signed-off-by: Marcel de Rooy Signed-off-by: Tomas Cohen Arazi --- ...g_15504-add-tracklastpatronactivityoptions.pl | 16 ++++++++++++++++ installer/data/mysql/mandatory/sysprefs.sql | 1 + .../en/modules/admin/preferences/patrons.pref | 12 ++++++++++-- 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 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 100755 index 0000000000..537d824e91 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_15504-add-tracklastpatronactivityoptions.pl @@ -0,0 +1,16 @@ +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 every time 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 91989ef7bc..89e9e7175f 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -754,6 +754,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 3126811d97..9b43bf8109 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 @@ -103,8 +103,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.39.5