Bug 15504: (follow-up) Respect existing TrackLastPatronActivity
This patch updates the database update to set 'check_out,connection,login' as the activity triggers should we find at upgrade time that TrackLastPatronActivity is set to true. This retains the existing functionality. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
305a221112
commit
66b6c3e936
1 changed files with 7 additions and 1 deletions
|
@ -7,8 +7,14 @@ return {
|
|||
my ($args) = @_;
|
||||
my ( $dbh, $out ) = @$args{qw(dbh out)};
|
||||
|
||||
# Get existing value from the TrackLastPatronActivity system preference
|
||||
my ($tracklastactivity) = $dbh->selectrow_array( q|
|
||||
SELECT value FROM systempreferences WHERE variable='TrackLastPatronActivity';
|
||||
|);
|
||||
|
||||
my $triggers = $tracklastactivity ? 'check_out,connection,login' : '';
|
||||
$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') }
|
||||
qq{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('TrackLastPatronActivityTriggers',$triggers,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'";
|
||||
|
|
Loading…
Reference in a new issue