sub action_list {
my ($self) = @_;
+ $self->setup_list_action_bar;
$self->render('background_job/list',
title => $::locale->text('Background jobs'),
BACKGROUND_JOBS => $self->models->get,
my ($self) = @_;
$self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *', package_name => 'Test'));
+ $self->setup_form_action_bar;
$self->render('background_job/form',
title => $::locale->text('Create a new background job'),
JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]);
sub action_edit {
my ($self) = @_;
+ $self->setup_form_action_bar;
$self->render('background_job/form',
title => $::locale->text('Edit background job'),
JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]);
);
}
+sub setup_list_action_bar {
+ my ($self) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ link => [
+ t8('Add'),
+ link => $self->url_for(action => 'new'),
+ accesskey => 'enter',
+ ],
+ link => [
+ t8('Server control'),
+ link => $self->url_for(controller => 'TaskServer', action => 'show'),
+ ],
+ link => [
+ t8('Job history'),
+ link => $self->url_for(controller => 'BackgroundJobHistory', action => 'list'),
+ ],
+ );
+ }
+}
+
+sub setup_form_action_bar {
+ my ($self) = @_;
+
+ my $is_new = !$self->background_job->id;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ combobox => [
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => 'BackgroundJob/' . ($is_new ? 'create' : 'update') } ],
+ accesskey => 'enter',
+ ],
+ action => [
+ t8('Save and execute'),
+ submit => [ '#form', { action => 'BackgroundJob/save_and_execute' } ],
+ ],
+ ], # end of combobox "Save"
+
+ action => [
+ t8('Delete'),
+ submit => [ '#form', { action => 'BackgroundJob/delete' } ],
+ confirm => t8('Do you really want to delete this object?'),
+ disabled => $is_new ? t8('This object has not been saved yet.') : undef,
+ ],
+
+ link => [
+ t8('Abort'),
+ link => $self->url_for(action => 'list'),
+ ],
+
+ link => [
+ t8('Job history'),
+ link => $self->url_for(controller => 'BackgroundJobHistory', action => 'list', 'filter.package_name:substr::ilike' => $self->background_job->package_name),
+ disabled => $is_new ? t8('This object has not been saved yet.') : undef,
+ ],
+ );
+ }
+}
+
1;
'Ar aging on %s' => 'Offene Forderungen zum %s',
'Are you sure to generate cb/ob transactions?' => 'Sollen die EB/SB Buchungen wirklich erzeugt werden?',
'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:',
- 'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?',
'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?',
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?',
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?',
'Create invoice' => 'Buchung erstellen',
'Create invoice?' => 'Rechnung erstellen?',
'Create new' => 'Neu erfassen',
- 'Create new background job' => 'Neuen Hintergrund-Job anlegen',
'Create new client #1' => 'Neuen Mandanten #1 anlegen',
'Create new delivery term' => 'Neue Lieferbedingungen anlegen',
'Create new payment term' => 'Neue Zahlungsbedingung anlegen',
'Exchangerate Difference' => 'Wechselkursunterschied',
'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!',
'Exchangerate missing!' => 'Es fehlt der Wechselkurs!',
- 'Execute now' => 'Jetzt ausführen',
'Executed' => 'Ausgeführt',
'Execution date' => 'Ausführungsdatum',
'Execution date from' => 'Ausführungsdatum von',
'September' => 'September',
'Serial No.' => 'Seriennummer',
'Serial Number' => 'Seriennummer',
+ 'Server control' => 'Serversteuerung',
'Service' => 'Dienstleistung',
'Service (typeabbreviation)' => 'D',
'Service Items' => 'Dienstleistungen',
'Show fields used for the best before date?' => 'Felder zur Eingabe des Mindesthaltbarkeitsdatums anzeigen?',
'Show follow ups...' => 'Zeige Wiedervorlagen...',
'Show help text' => 'Hilfetext anzeigen',
- 'Show history' => 'Verlauf anzeigen',
'Show images' => 'Bilder zeigen',
'Show items from invoices individually' => 'Artikel aus Rechnungen anzeigen',
'Show mappings (csv_import)' => 'Spaltenzuordnungen anzeigen',
'Versions' => 'Versionen',
'View SEPA export' => 'SEPA-Export-Details ansehen',
'View background job execution result' => 'Verlauf der Hintergrund-Job-Ausführungen anzeigen',
- 'View background job history' => 'Hintergrund-Job-Verlauf anzeigen',
'View background jobs' => 'Hintergrund-Jobs anzeigen',
'View sent email' => 'Verschickte E-Mail anzeigen',
'View warehouse content' => 'Lagerbestand ansehen',
[%- INCLUDE 'common/flash.html' %]
- <form method="post" action="controller.pl">
+ <form method="post" action="controller.pl" id="form">
+ [% L.hidden_tag("id", SELF.background_job.id) %]
+ [% L.hidden_tag("back_to", SELF.back_to) %]
+
<table>
<tr>
<th align="right">[%- LxERP.t8('Active') %]</th>
</tr>
</table>
-
- <p>
- [% L.hidden_tag("id", SELF.background_job.id) %]
- [% L.hidden_tag("back_to", SELF.back_to) %]
- [% L.hidden_tag("action", "BackgroundJob/dispatch") %]
- [% L.submit_tag("action_" _ (SELF.background_job.id ? "update" : "create"), LxERP.t8('Save')) %]
- [%- IF SELF.background_job.id %]
- [% L.submit_tag("action_execute", LxERP.t8("Execute now")) %]
- [% L.submit_tag("action_destroy", LxERP.t8("Delete"), "confirm", LxERP.t8("Are you sure you want to delete this background job?")) %]
- [%- ELSE %]
- [% L.submit_tag("action_save_and_execute", LxERP.t8("Save and execute")) %]
- [%- END %]
- <a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a>
- [%- IF SELF.background_job.id %]
- <a href="[% SELF.url_for(controller='BackgroundJobHistory', action='list', 'filter.package_name:substr::ilike'=SELF.background_job.package_name) %]">[%- LxERP.t8('Show history') %]</a>
- [%- END %]
- </p>
</form>
[%- INCLUDE 'common/flash.html' %]
- <form method="post" action="controller.pl">
[% IF !BACKGROUND_JOBS.size %]
<p>
[%- LxERP.t8('No background job has been created yet.') %]
[%- END %]
[% L.paginate_controls %]
-
- <hr size="3" noshade>
-
- <p>
- <a href="[% SELF.url_for(action => 'new', back_to => SELF.get_callback) %]">[%- LxERP.t8('Create new background job') %]</a>
- |
- <a href="[% SELF.url_for(controller => 'BackgroundJobHistory', action => 'list') %]">[%- LxERP.t8('View background job history') %]</a>
- |
- <a href="[% SELF.url_for(controller => 'TaskServer', action => 'show') %]">[%- LxERP.t8('Task server control') %]</a>
- </p>
- </form>