$self->make_filter_summary;
+ $self->setup_list_action_bar;
$self->render('background_job_history/list',
title => $::locale->text('Background job history'),
ENTRIES => $self->models->get,
my $back_to = $::form->{back_to} || $self->url_for(action => 'list');
$self->history(SL::DB::BackgroundJobHistory->new(id => $::form->{id})->load);
+ $self->setup_show_action_bar;
$self->render('background_job_history/show',
title => $::locale->text('View background job execution result'),
back_to => $back_to);
}
sub add_stylesheet {
- $::request->{layout}->use_stylesheet('lx-office-erp/background_jobs.css');
+ $::request->{layout}->use_stylesheet('background_jobs.css');
}
sub make_filter_summary {
@filters;
my %status = (
- failed => $::locale->text('failed'),
+ failure => $::locale->text('failed'),
success => $::locale->text('succeeded'),
);
push @filter_strings, $status{ $filter->{'status:eq_ignore_empty'} } if $filter->{'status:eq_ignore_empty'};
SL::Controller::Helper::GetModels->new(
controller => $self,
- model => 'BackgroundJobHistory',
sorted => {
package_name => t8('Package name'),
run_at => t8('Run at'),
);
}
+sub setup_list_action_bar {
+ my ($self) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ link => [
+ t8('Server control'),
+ link => $self->url_for(controller => 'TaskServer', action => 'show'),
+ ],
+ link => [
+ t8('List of jobs'),
+ link => $self->url_for(controller => 'BackgroundJob', action => 'list'),
+ ],
+ );
+ }
+}
+
+sub setup_show_action_bar {
+ my ($self) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ link => [
+ t8('Back'),
+ link => $self->url_for(action => 'list'),
+ ],
+ );
+ }
+}
+
1;