|
Lines 2307-2313
Wraps the call to $patron->track_login, the method used to update borrowers.last
Link Here
|
| 2307 |
|
2307 |
|
| 2308 |
sub track_login_daily { |
2308 |
sub track_login_daily { |
| 2309 |
my $userid = shift; |
2309 |
my $userid = shift; |
| 2310 |
return if !$userid || !C4::Context->preference('TrackLastPatronActivity'); |
2310 |
my $activity = shift; |
|
|
2311 |
return if !$userid || !$activity || !C4::Context->preference('TrackLastPatronActivity'); |
| 2311 |
|
2312 |
|
| 2312 |
my $cache = Koha::Caches->get_instance(); |
2313 |
my $cache = Koha::Caches->get_instance(); |
| 2313 |
my $cache_key = "track_login_" . $userid; |
2314 |
my $cache_key = "track_login_" . $userid; |
|
Lines 2317-2322
sub track_login_daily {
Link Here
|
| 2317 |
|
2318 |
|
| 2318 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
2319 |
my $patron = Koha::Patrons->find({ userid => $userid }); |
| 2319 |
return unless $patron; |
2320 |
return unless $patron; |
|
|
2321 |
|
| 2322 |
my $tracked_activities = { map { (lc $_, 1); } split /\s*\,\s*/, C4::Context->preference('TrackLastPatronActivityTriggers') }; |
| 2323 |
return unless $tracked_activities->{$activity}; |
| 2324 |
|
| 2320 |
$patron->track_login; |
2325 |
$patron->track_login; |
| 2321 |
$cache->set_in_cache( $cache_key, $today ); |
2326 |
$cache->set_in_cache( $cache_key, $today ); |
| 2322 |
} |
2327 |
} |
| 2323 |
- |
|
|