Lines 19-24
use Modern::Perl;
Link Here
|
19 |
use CGI qw ( -utf8 ); |
19 |
use CGI qw ( -utf8 ); |
20 |
|
20 |
|
21 |
use C4::Context; |
21 |
use C4::Context; |
|
|
22 |
use Koha::DateUtils qw( dt_from_string ); |
22 |
use C4::Auth qw( get_template_and_user ); |
23 |
use C4::Auth qw( get_template_and_user ); |
23 |
use C4::Output qw( output_html_with_http_headers ); |
24 |
use C4::Output qw( output_html_with_http_headers ); |
24 |
|
25 |
|
Lines 86-98
if ( $op eq 'list' ) {
Link Here
|
86 |
); |
87 |
); |
87 |
$template->param( queued => $queued_jobs ); |
88 |
$template->param( queued => $queued_jobs ); |
88 |
|
89 |
|
|
|
90 |
my $ended_since = dt_from_string->subtract( minutes => '60' ); |
91 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
92 |
|
89 |
my $complete_jobs = |
93 |
my $complete_jobs = |
90 |
$can_manage_background_jobs |
94 |
$can_manage_background_jobs |
91 |
? Koha::BackgroundJobs->search( { ended_on => { '!=' => undef } }, |
95 |
? Koha::BackgroundJobs->search( |
92 |
{ order_by => { -desc => 'enqueued_on' } } ) |
96 |
{ |
|
|
97 |
ended_on => { '>=' => $dtf->format_date($ended_since) } |
98 |
}, |
99 |
{ order_by => { -desc => 'enqueued_on' } } |
100 |
) |
93 |
: Koha::BackgroundJobs->search( |
101 |
: Koha::BackgroundJobs->search( |
94 |
{ borrowernumber => $logged_in_user->borrowernumber, ended_on => { '!=' => undef } }, |
102 |
{ |
95 |
{ order_by => { -desc => 'enqueued_on' } } |
103 |
borrowernumber => $logged_in_user->borrowernumber, |
|
|
104 |
ended_on => { '>=' => $dtf->format_date($ended_since) } |
105 |
}, |
106 |
{ order_by => { -desc => 'enqueued_on' } } |
96 |
); |
107 |
); |
97 |
$template->param( complete => $complete_jobs ); |
108 |
$template->param( complete => $complete_jobs ); |
98 |
} |
109 |
} |