From 461b3caf1c243642ea98e2b132335e4e907ed9d4 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 28 Feb 2017 11:57:01 +0100 Subject: [PATCH] =?utf8?q?ActionBar:=20Verwendung=20bei=20=C2=BBTask-Serve?= =?utf8?q?r-Steuerung=C2=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/TaskServer.pm | 24 ++++++++++++++++++++++++ locale/de/all | 6 ++++-- templates/webpages/task_server/show.html | 16 ++++------------ 3 files changed, 32 insertions(+), 14 deletions(-) diff --git a/SL/Controller/TaskServer.pm b/SL/Controller/TaskServer.pm index 97c41c629..325edaf5f 100644 --- a/SL/Controller/TaskServer.pm +++ b/SL/Controller/TaskServer.pm @@ -5,6 +5,7 @@ use strict; use parent qw(SL::Controller::Base); use SL::Helper::Flash; +use SL::Locale::String qw(t8); use SL::System::TaskServer; use Rose::Object::MakeMethods::Generic @@ -25,6 +26,7 @@ sub action_show { flash('warning', $::locale->text('The task server does not appear to be running.')) if !$self->task_server->is_running; + $self->setup_show_action_bar; $self->render('task_server/show', title => $::locale->text('Task server status'), last_command_output => $::auth->get_session_value('TaskServer::last_command_output')); @@ -84,4 +86,26 @@ sub init_task_server { return SL::System::TaskServer->new; } +sub setup_show_action_bar { + my ($self) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + $self->task_server->is_running ? t8('Stop server') : t8('Start server'), + submit => [ '#form' ], + accesskey => 'enter', + ], + link => [ + t8('List of jobs'), + link => $self->url_for(controller => 'BackgroundJob', action => 'list'), + ], + link => [ + t8('Job history'), + link => $self->url_for(controller => 'BackgroundJobHistory', action => 'list'), + ], + ); + } +} + 1; diff --git a/locale/de/all b/locale/de/all index 9bf27212d..f5c5694cb 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1616,6 +1616,7 @@ $self->{texts} = { 'Jahresverkehrszahlen neu' => 'Jahresverkehrszahlen neu', 'Jan' => 'Jan', 'January' => 'Januar', + 'Job history' => 'Jobverlauf', 'Journal' => 'Buchungsjournal', 'Journal of Last 10 Transfers' => 'Letzte 10 Lagertransaktionen', 'Jul' => 'Jul', @@ -1694,6 +1695,7 @@ $self->{texts} = { 'List of bank transfers' => 'Überweisungsliste', 'List of custom variables' => 'Liste der benutzerdefinierten Variablen', 'List of database upgrades to be applied:' => 'Liste der noch einzuspielenden Datenbankupgrades:', + 'List of jobs' => 'Jobliste', 'List of tax zones' => 'Liste der Steuerzonen', 'List open SEPA exports' => 'Noch nicht ausgeführte SEPA-Exporte anzeigen', 'Load' => 'Laden', @@ -2718,7 +2720,7 @@ $self->{texts} = { 'Start date' => 'Startdatum', 'Start of year' => 'Jahresanfang', 'Start process' => 'Prozess starten', - 'Start task server' => 'Task-Server starten', + 'Start server' => 'Server starten', 'Start the correction assistant' => 'Korrekturassistenten starten', 'Startdate_coa' => 'Gültig ab', 'Starting Balance' => 'Eröffnungsbilanzwerte', @@ -2740,7 +2742,7 @@ $self->{texts} = { 'Stock for part #1' => 'Bestand für Artikel #1', 'Stock value' => 'Bestandswert', 'Stocked Qty' => 'Lagermenge', - 'Stop task server' => 'Task-Server beenden', + 'Stop server' => 'Server stoppen', 'Stopping the task server failed. Output:' => 'Das Beenden des Task-Servers schlug fehl.', 'Storage Backends' => 'Datei-Speicher', 'Storage Type for Attachments' => 'Speichertyp für Anhänge', diff --git a/templates/webpages/task_server/show.html b/templates/webpages/task_server/show.html index 4a44ad0db..4b56f9e0f 100644 --- a/templates/webpages/task_server/show.html +++ b/templates/webpages/task_server/show.html @@ -1,4 +1,4 @@ -[% USE HTML %][% USE L %][% USE LxERP %] +[% USE HTML %][% USE L %][% USE LxERP %][%- USE P -%]

[% FORM.title %]

[%- INCLUDE 'common/flash.html' %] @@ -20,14 +20,6 @@ -

-[% IF SELF.task_server.is_running %] - [%- LxERP.t8('Stop task server') %] -[%- ELSE %] - [%- LxERP.t8('Start task server') %] -[%- END %] - | - [%- LxERP.t8('View background jobs') %] - | - [%- LxERP.t8('View background job history') %] -

+
+ [% P.hidden_tag("action", "TaskServer/" _ (SELF.task_server.is_running ? "stop" : "start")) %] +
-- 2.20.1