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 88-100
if ( $op eq 'list' ) {
Link Here
|
88 |
); |
89 |
); |
89 |
$template->param( queued => $queued_jobs ); |
90 |
$template->param( queued => $queued_jobs ); |
90 |
|
91 |
|
|
|
92 |
my $ended_since = dt_from_string->subtract( minutes => '60' ); |
93 |
my $dtf = Koha::Database->new->schema->storage->datetime_parser; |
94 |
|
91 |
my $complete_jobs = |
95 |
my $complete_jobs = |
92 |
$can_manage_background_jobs |
96 |
$can_manage_background_jobs |
93 |
? Koha::BackgroundJobs->search( { ended_on => { '!=' => undef } }, |
97 |
? Koha::BackgroundJobs->search( |
94 |
{ order_by => { -desc => 'enqueued_on' } } ) |
98 |
{ |
|
|
99 |
ended_on => { '>=' => $dtf->format_date($ended_since) } |
100 |
}, |
101 |
{ order_by => { -desc => 'enqueued_on' } } |
102 |
) |
95 |
: Koha::BackgroundJobs->search( |
103 |
: Koha::BackgroundJobs->search( |
96 |
{ borrowernumber => $logged_in_user->borrowernumber, ended_on => { '!=' => undef } }, |
104 |
{ |
97 |
{ order_by => { -desc => 'enqueued_on' } } |
105 |
borrowernumber => $logged_in_user->borrowernumber, |
|
|
106 |
ended_on => { '>=' => $dtf->format_date($ended_since) } |
107 |
}, |
108 |
{ order_by => { -desc => 'enqueued_on' } } |
98 |
); |
109 |
); |
99 |
$template->param( complete => $complete_jobs ); |
110 |
$template->param( complete => $complete_jobs ); |
100 |
} |
111 |
} |