Bugzilla – Attachment 135938 Details for
Bug 30462
Improve the default display for the background jobs queue management page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30462: (follow-up) Limit completed to 60 minutes
Bug-30462-follow-up-Limit-completed-to-60-minutes.patch (text/plain), 3.40 KB, created by
Martin Renvoize (ashimema)
on 2022-06-10 14:36:53 UTC
(
hide
)
Description:
Bug 30462: (follow-up) Limit completed to 60 minutes
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2022-06-10 14:36:53 UTC
Size:
3.40 KB
patch
obsolete
>From df60b861a629cdb59dd4ea3abbe83c99a13869d7 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 10 Jun 2022 15:35:47 +0100 >Subject: [PATCH] Bug 30462: (follow-up) Limit completed to 60 minutes > >This follow-up reduces the completed jobs list to only those jobs >completed within the last 60 minutes. >--- > admin/background_jobs.pl | 19 +++++++++++++++---- > .../prog/en/modules/admin/background_jobs.tt | 9 +++------ > 2 files changed, 18 insertions(+), 10 deletions(-) > >diff --git a/admin/background_jobs.pl b/admin/background_jobs.pl >index 326e8d596c..6cbc060621 100755 >--- a/admin/background_jobs.pl >+++ b/admin/background_jobs.pl >@@ -19,6 +19,7 @@ use Modern::Perl; > use CGI qw ( -utf8 ); > > use C4::Context; >+use Koha::DateUtils qw( dt_from_string ); > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > >@@ -86,13 +87,23 @@ if ( $op eq 'list' ) { > ); > $template->param( queued => $queued_jobs ); > >+ my $ended_since = dt_from_string->subtract( minutes => '60' ); >+ my $dtf = Koha::Database->new->schema->storage->datetime_parser; >+ > my $complete_jobs = > $can_manage_background_jobs >- ? Koha::BackgroundJobs->search( { ended_on => { '!=' => undef } }, >- { order_by => { -desc => 'enqueued_on' } } ) >+ ? Koha::BackgroundJobs->search( >+ { >+ ended_on => { '>=' => $dtf->format_date($ended_since) } >+ }, >+ { order_by => { -desc => 'enqueued_on' } } >+ ) > : Koha::BackgroundJobs->search( >- { borrowernumber => $logged_in_user->borrowernumber, ended_on => { '!=' => undef } }, >- { order_by => { -desc => 'enqueued_on' } } >+ { >+ borrowernumber => $logged_in_user->borrowernumber, >+ ended_on => { '>=' => $dtf->format_date($ended_since) } >+ }, >+ { order_by => { -desc => 'enqueued_on' } } > ); > $template->param( complete => $complete_jobs ); > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >index a98f06ef7f..cea9bef053 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/background_jobs.tt >@@ -164,8 +164,6 @@ > > <div class="tab-content"> > <div role="tabpanel" class="tab-pane active" id="queued"> >- <h2>Queued jobs</h2> >- > [% IF queued.count %] > <table id="table_queued_jobs"> > <thead> >@@ -211,10 +209,9 @@ > [% END %] > </div> > >- <div role="tabpanel" class="tab-pane active" id="complete"> >- <h2>Complete jobs</h2> >- >+ <div role="tabpanel" class="tab-pane" id="complete"> > [% IF complete.count %] >+ <p>Jobs completed in the last 60 minutes.</p> > <table id="table_complete_jobs"> > <thead> > <tr> >@@ -254,7 +251,7 @@ > </table> > [% ELSE %] > <div class="dialog message"> >- There are no completed background jobs yet. >+ There were no completed background jobs completed in the last 60 minutes. > </div> > [% END %] > </div> >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 30462
:
135570
|
135583
|
135749
|
135750
|
135938
|
136001
|
136002
|
136003
|
136004
|
140145
|
140146
|
140147
|
140148
|
140353
|
142860