Revision 1df575c4
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/BackgroundJob.pm | ||
---|---|---|
28 | 28 |
sub action_list { |
29 | 29 |
my ($self) = @_; |
30 | 30 |
|
31 |
$self->setup_list_action_bar; |
|
31 | 32 |
$self->render('background_job/list', |
32 | 33 |
title => $::locale->text('Background jobs'), |
33 | 34 |
BACKGROUND_JOBS => $self->models->get, |
... | ... | |
38 | 39 |
my ($self) = @_; |
39 | 40 |
|
40 | 41 |
$self->background_job(SL::DB::BackgroundJob->new(cron_spec => '* * * * *', package_name => 'Test')); |
42 |
$self->setup_form_action_bar; |
|
41 | 43 |
$self->render('background_job/form', |
42 | 44 |
title => $::locale->text('Create a new background job'), |
43 | 45 |
JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); |
... | ... | |
46 | 48 |
sub action_edit { |
47 | 49 |
my ($self) = @_; |
48 | 50 |
|
51 |
$self->setup_form_action_bar; |
|
49 | 52 |
$self->render('background_job/form', |
50 | 53 |
title => $::locale->text('Edit background job'), |
51 | 54 |
JOB_CLASSES => [ SL::BackgroundJob::Base->get_known_job_classes ]); |
... | ... | |
183 | 186 |
); |
184 | 187 |
} |
185 | 188 |
|
189 |
sub setup_list_action_bar { |
|
190 |
my ($self) = @_; |
|
191 |
|
|
192 |
for my $bar ($::request->layout->get('actionbar')) { |
|
193 |
$bar->add( |
|
194 |
link => [ |
|
195 |
t8('Add'), |
|
196 |
link => $self->url_for(action => 'new'), |
|
197 |
accesskey => 'enter', |
|
198 |
], |
|
199 |
link => [ |
|
200 |
t8('Server control'), |
|
201 |
link => $self->url_for(controller => 'TaskServer', action => 'show'), |
|
202 |
], |
|
203 |
link => [ |
|
204 |
t8('Job history'), |
|
205 |
link => $self->url_for(controller => 'BackgroundJobHistory', action => 'list'), |
|
206 |
], |
|
207 |
); |
|
208 |
} |
|
209 |
} |
|
210 |
|
|
211 |
sub setup_form_action_bar { |
|
212 |
my ($self) = @_; |
|
213 |
|
|
214 |
my $is_new = !$self->background_job->id; |
|
215 |
|
|
216 |
for my $bar ($::request->layout->get('actionbar')) { |
|
217 |
$bar->add( |
|
218 |
combobox => [ |
|
219 |
action => [ |
|
220 |
t8('Save'), |
|
221 |
submit => [ '#form', { action => 'BackgroundJob/' . ($is_new ? 'create' : 'update') } ], |
|
222 |
accesskey => 'enter', |
|
223 |
], |
|
224 |
action => [ |
|
225 |
t8('Save and execute'), |
|
226 |
submit => [ '#form', { action => 'BackgroundJob/save_and_execute' } ], |
|
227 |
], |
|
228 |
], # end of combobox "Save" |
|
229 |
|
|
230 |
action => [ |
|
231 |
t8('Delete'), |
|
232 |
submit => [ '#form', { action => 'BackgroundJob/delete' } ], |
|
233 |
confirm => t8('Do you really want to delete this object?'), |
|
234 |
disabled => $is_new ? t8('This object has not been saved yet.') : undef, |
|
235 |
], |
|
236 |
|
|
237 |
link => [ |
|
238 |
t8('Abort'), |
|
239 |
link => $self->url_for(action => 'list'), |
|
240 |
], |
|
241 |
|
|
242 |
link => [ |
|
243 |
t8('Job history'), |
|
244 |
link => $self->url_for(controller => 'BackgroundJobHistory', action => 'list', 'filter.package_name:substr::ilike' => $self->background_job->package_name), |
|
245 |
disabled => $is_new ? t8('This object has not been saved yet.') : undef, |
|
246 |
], |
|
247 |
); |
|
248 |
} |
|
249 |
} |
|
250 |
|
|
186 | 251 |
1; |
locale/de/all | ||
---|---|---|
300 | 300 |
'Ar aging on %s' => 'Offene Forderungen zum %s', |
301 | 301 |
'Are you sure to generate cb/ob transactions?' => 'Sollen die EB/SB Buchungen wirklich erzeugt werden?', |
302 | 302 |
'Are you sure you want to delete Invoice Number' => 'Soll die Rechnung mit folgender Nummer wirklich gelöscht werden:', |
303 |
'Are you sure you want to delete this background job?' => 'Sind Sie sicher, dass Sie diesen Hintergrund-Job löschen möchten?', |
|
304 | 303 |
'Are you sure you want to delete this delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?', |
305 | 304 |
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?', |
306 | 305 |
'Are you sure you want to delete this payment term?' => 'Wollen Sie diese Zahlungsbedingungen wirklich löschen?', |
... | ... | |
712 | 711 |
'Create invoice' => 'Buchung erstellen', |
713 | 712 |
'Create invoice?' => 'Rechnung erstellen?', |
714 | 713 |
'Create new' => 'Neu erfassen', |
715 |
'Create new background job' => 'Neuen Hintergrund-Job anlegen', |
|
716 | 714 |
'Create new client #1' => 'Neuen Mandanten #1 anlegen', |
717 | 715 |
'Create new delivery term' => 'Neue Lieferbedingungen anlegen', |
718 | 716 |
'Create new payment term' => 'Neue Zahlungsbedingung anlegen', |
... | ... | |
1274 | 1272 |
'Exchangerate Difference' => 'Wechselkursunterschied', |
1275 | 1273 |
'Exchangerate for payment missing!' => 'Es fehlt der Wechselkurs für die Bezahlung!', |
1276 | 1274 |
'Exchangerate missing!' => 'Es fehlt der Wechselkurs!', |
1277 |
'Execute now' => 'Jetzt ausführen', |
|
1278 | 1275 |
'Executed' => 'Ausgeführt', |
1279 | 1276 |
'Execution date' => 'Ausführungsdatum', |
1280 | 1277 |
'Execution date from' => 'Ausführungsdatum von', |
... | ... | |
2598 | 2595 |
'September' => 'September', |
2599 | 2596 |
'Serial No.' => 'Seriennummer', |
2600 | 2597 |
'Serial Number' => 'Seriennummer', |
2598 |
'Server control' => 'Serversteuerung', |
|
2601 | 2599 |
'Service' => 'Dienstleistung', |
2602 | 2600 |
'Service (typeabbreviation)' => 'D', |
2603 | 2601 |
'Service Items' => 'Dienstleistungen', |
... | ... | |
2664 | 2662 |
'Show fields used for the best before date?' => 'Felder zur Eingabe des Mindesthaltbarkeitsdatums anzeigen?', |
2665 | 2663 |
'Show follow ups...' => 'Zeige Wiedervorlagen...', |
2666 | 2664 |
'Show help text' => 'Hilfetext anzeigen', |
2667 |
'Show history' => 'Verlauf anzeigen', |
|
2668 | 2665 |
'Show images' => 'Bilder zeigen', |
2669 | 2666 |
'Show items from invoices individually' => 'Artikel aus Rechnungen anzeigen', |
2670 | 2667 |
'Show mappings (csv_import)' => 'Spaltenzuordnungen anzeigen', |
... | ... | |
3485 | 3482 |
'Versions' => 'Versionen', |
3486 | 3483 |
'View SEPA export' => 'SEPA-Export-Details ansehen', |
3487 | 3484 |
'View background job execution result' => 'Verlauf der Hintergrund-Job-Ausführungen anzeigen', |
3488 |
'View background job history' => 'Hintergrund-Job-Verlauf anzeigen', |
|
3489 | 3485 |
'View background jobs' => 'Hintergrund-Jobs anzeigen', |
3490 | 3486 |
'View sent email' => 'Verschickte E-Mail anzeigen', |
3491 | 3487 |
'View warehouse content' => 'Lagerbestand ansehen', |
templates/webpages/background_job/form.html | ||
---|---|---|
4 | 4 |
|
5 | 5 |
[%- INCLUDE 'common/flash.html' %] |
6 | 6 |
|
7 |
<form method="post" action="controller.pl"> |
|
7 |
<form method="post" action="controller.pl" id="form"> |
|
8 |
[% L.hidden_tag("id", SELF.background_job.id) %] |
|
9 |
[% L.hidden_tag("back_to", SELF.back_to) %] |
|
10 |
|
|
8 | 11 |
<table> |
9 | 12 |
<tr> |
10 | 13 |
<th align="right">[%- LxERP.t8('Active') %]</th> |
... | ... | |
38 | 41 |
</tr> |
39 | 42 |
|
40 | 43 |
</table> |
41 |
|
|
42 |
<p> |
|
43 |
[% L.hidden_tag("id", SELF.background_job.id) %] |
|
44 |
[% L.hidden_tag("back_to", SELF.back_to) %] |
|
45 |
[% L.hidden_tag("action", "BackgroundJob/dispatch") %] |
|
46 |
[% L.submit_tag("action_" _ (SELF.background_job.id ? "update" : "create"), LxERP.t8('Save')) %] |
|
47 |
[%- IF SELF.background_job.id %] |
|
48 |
[% L.submit_tag("action_execute", LxERP.t8("Execute now")) %] |
|
49 |
[% L.submit_tag("action_destroy", LxERP.t8("Delete"), "confirm", LxERP.t8("Are you sure you want to delete this background job?")) %] |
|
50 |
[%- ELSE %] |
|
51 |
[% L.submit_tag("action_save_and_execute", LxERP.t8("Save and execute")) %] |
|
52 |
[%- END %] |
|
53 |
<a href="[% SELF.url_for(action => 'list') %]">[%- LxERP.t8('Abort') %]</a> |
|
54 |
[%- IF SELF.background_job.id %] |
|
55 |
<a href="[% SELF.url_for(controller='BackgroundJobHistory', action='list', 'filter.package_name:substr::ilike'=SELF.background_job.package_name) %]">[%- LxERP.t8('Show history') %]</a> |
|
56 |
[%- END %] |
|
57 |
</p> |
|
58 | 44 |
</form> |
templates/webpages/background_job/list.html | ||
---|---|---|
4 | 4 |
|
5 | 5 |
[%- INCLUDE 'common/flash.html' %] |
6 | 6 |
|
7 |
<form method="post" action="controller.pl"> |
|
8 | 7 |
[% IF !BACKGROUND_JOBS.size %] |
9 | 8 |
<p> |
10 | 9 |
[%- LxERP.t8('No background job has been created yet.') %] |
... | ... | |
64 | 63 |
[%- END %] |
65 | 64 |
|
66 | 65 |
[% L.paginate_controls %] |
67 |
|
|
68 |
<hr size="3" noshade> |
|
69 |
|
|
70 |
<p> |
|
71 |
<a href="[% SELF.url_for(action => 'new', back_to => SELF.get_callback) %]">[%- LxERP.t8('Create new background job') %]</a> |
|
72 |
| |
|
73 |
<a href="[% SELF.url_for(controller => 'BackgroundJobHistory', action => 'list') %]">[%- LxERP.t8('View background job history') %]</a> |
|
74 |
| |
|
75 |
<a href="[% SELF.url_for(controller => 'TaskServer', action => 'show') %]">[%- LxERP.t8('Task server control') %]</a> |
|
76 |
</p> |
|
77 |
</form> |
Auch abrufbar als: Unified diff
ActionBar: Verwendung bei »Aktuelle Hintergrund-Jobs anzeigen«