From: Moritz Bunkus Date: Fri, 31 Aug 2012 14:15:17 +0000 (+0200) Subject: Listenansicht in BackgroundJobHistory-Controller sortierbar gemacht X-Git-Tag: release-3.0.0beta1~258 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=35f3e56a405aefe3042126bb2b9269b6b524e457;p=kivitendo-erp.git Listenansicht in BackgroundJobHistory-Controller sortierbar gemacht --- diff --git a/SL/Controller/BackgroundJobHistory.pm b/SL/Controller/BackgroundJobHistory.pm index 54d733808..0629edf8f 100644 --- a/SL/Controller/BackgroundJobHistory.pm +++ b/SL/Controller/BackgroundJobHistory.pm @@ -4,6 +4,8 @@ use strict; use parent qw(SL::Controller::Base); +use SL::Controller::Helper::GetModels; +use SL::Controller::Helper::Sorted; use SL::DB::BackgroundJobHistory; use SL::Helper::Flash; use SL::System::TaskServer; @@ -18,6 +20,20 @@ __PACKAGE__->run_before('check_auth'); __PACKAGE__->run_before('add_stylesheet'); __PACKAGE__->run_before('check_task_server'); +__PACKAGE__->make_sorted( + DEFAULT_BY => 'run_at', + DEFAULT_DIR => 1, + MODEL => 'BackgroundJobHistory', + FORM_PARAMS => [ qw(sort_by sort_dir) ], + ONLY => [ qw(list) ], + + package_name => $::locale->text('Package name'), + run_at => $::locale->text('Run at'), + status => $::locale->text('Execution status'), + result => $::locale->text('Result'), + error => $::locale->text('Error'), +); + # # actions # @@ -27,7 +43,7 @@ sub action_list { $self->render('background_job_history/list', title => $::locale->text('Background job history'), - ENTRIES => SL::DB::Manager::BackgroundJobHistory->get_all_sorted); + ENTRIES => $self->get_models); } sub action_show { diff --git a/templates/webpages/background_job_history/list.html b/templates/webpages/background_job_history/list.html index 83c8dae1d..6086776d1 100644 --- a/templates/webpages/background_job_history/list.html +++ b/templates/webpages/background_job_history/list.html @@ -15,11 +15,11 @@ - - - - - + + + + + @@ -27,7 +27,7 @@ [%- FOREACH entry = ENTRIES %]
[%- LxERP.t8('Package name') %][%- LxERP.t8('Run at') %][%- LxERP.t8('Execution status') %][%- LxERP.t8('Result') %][%- LxERP.t8('Error') %][% L.sortable_table_header('package_name') %][% L.sortable_table_header('run_at') %][% L.sortable_table_header('status') %][% L.sortable_table_header('result') %][% L.sortable_table_header('error') %]
- + [%- HTML.escape(entry.package_name) %]