Revision 23a8d2c0
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Controller/BackgroundJob.pm | ||
---|---|---|
83 | 83 |
flash_later('error', $::locale->text('There was an error executing the background job.')); |
84 | 84 |
} |
85 | 85 |
|
86 |
$self->redirect_to(controller => 'BackgroundJobHistory', action => 'show', id => $history->id); |
|
86 |
$self->redirect_to(controller => 'BackgroundJobHistory', |
|
87 |
action => 'show', |
|
88 |
id => $history->id, |
|
89 |
back_to => $self->url_for(action => 'edit', id => $self->background_job->id)); |
|
87 | 90 |
} |
88 | 91 |
|
89 | 92 |
# |
SL/Controller/BackgroundJobHistory.pm | ||
---|---|---|
1 |
package SL::Controller::BackgroundJobHistory; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use parent qw(SL::Controller::Base); |
|
6 |
|
|
7 |
use SL::DB::BackgroundJobHistory; |
|
8 |
use SL::Helper::Flash; |
|
9 |
use SL::System::TaskServer; |
|
10 |
|
|
11 |
use Rose::Object::MakeMethods::Generic |
|
12 |
( |
|
13 |
scalar => [ qw(history) ], |
|
14 |
'scalar --get_set_init' => [ qw(task_server) ], |
|
15 |
); |
|
16 |
|
|
17 |
__PACKAGE__->run_before('check_auth'); |
|
18 |
__PACKAGE__->run_before('add_stylesheet'); |
|
19 |
__PACKAGE__->run_before('check_task_server'); |
|
20 |
|
|
21 |
# |
|
22 |
# actions |
|
23 |
# |
|
24 |
|
|
25 |
sub action_list { |
|
26 |
my ($self) = @_; |
|
27 |
|
|
28 |
$self->render('background_job_history/list', |
|
29 |
title => $::locale->text('Background job history'), |
|
30 |
ENTRIES => SL::DB::Manager::BackgroundJobHistory->get_all_sorted); |
|
31 |
} |
|
32 |
|
|
33 |
sub action_show { |
|
34 |
my ($self) = @_; |
|
35 |
|
|
36 |
my $back_to = $::form->{back_to} || $self->url_for(action => 'list'); |
|
37 |
|
|
38 |
$self->history(SL::DB::BackgroundJobHistory->new(id => $::form->{id})->load); |
|
39 |
$self->render('background_job_history/show', |
|
40 |
title => $::locale->text('View background job execution result'), |
|
41 |
back_to => $back_to); |
|
42 |
} |
|
43 |
|
|
44 |
# |
|
45 |
# filters |
|
46 |
# |
|
47 |
|
|
48 |
sub check_auth { |
|
49 |
$::auth->assert('admin'); |
|
50 |
} |
|
51 |
|
|
52 |
# |
|
53 |
# helpers |
|
54 |
# |
|
55 |
|
|
56 |
sub init_task_server { |
|
57 |
return SL::System::TaskServer->new; |
|
58 |
} |
|
59 |
|
|
60 |
sub check_task_server { |
|
61 |
my ($self) = @_; |
|
62 |
flash('warning', $::locale->text('The task server does not appear to be running.')) if !$self->task_server->is_running; |
|
63 |
} |
|
64 |
|
|
65 |
sub add_stylesheet { |
|
66 |
$::form->use_stylesheet('lx-office-erp/background_jobs.css'); |
|
67 |
} |
|
68 |
|
|
69 |
1; |
SL/DB/BackgroundJobHistory.pm | ||
---|---|---|
6 | 6 |
use strict; |
7 | 7 |
|
8 | 8 |
use SL::DB::MetaSetup::BackgroundJobHistory; |
9 |
|
|
10 |
# Creates get_all, get_all_count, get_all_iterator, delete_all and update_all. |
|
11 |
__PACKAGE__->meta->make_manager_class; |
|
9 |
use SL::DB::Manager::BackgroundJobHistory; |
|
12 | 10 |
|
13 | 11 |
1; |
SL/DB/Manager/BackgroundJobHistory.pm | ||
---|---|---|
1 |
package SL::DB::Manager::BackgroundJobHistory; |
|
2 |
|
|
3 |
use strict; |
|
4 |
|
|
5 |
use SL::DB::Helper::Manager; |
|
6 |
use base qw(SL::DB::Helper::Manager); |
|
7 |
|
|
8 |
use SL::DB::Helper::Sorted; |
|
9 |
|
|
10 |
sub object_class { 'SL::DB::BackgroundJobHistory' } |
|
11 |
|
|
12 |
__PACKAGE__->make_manager_methods; |
|
13 |
|
|
14 |
sub _sort_spec { |
|
15 |
return ( default => [ 'run_at', 1 ], |
|
16 |
columns => { SIMPLE => 'ALL' } ); |
|
17 |
} |
|
18 |
|
|
19 |
1; |
css/Mobile/background_jobs.css | ||
---|---|---|
1 |
../lx-office-erp/background_jobs.css |
css/Win2000/background_jobs.css | ||
---|---|---|
1 |
../lx-office-erp/background_jobs.css |
css/kivitendo/background_jobs.css | ||
---|---|---|
1 |
../lx-office-erp/background_jobs.css |
css/lx-office-erp/background_jobs.css | ||
---|---|---|
1 |
/* Jobverwaltung */ |
|
2 |
.background_job_history_list tbody pre, |
|
3 |
.background_job_history_details tbody pre { |
|
4 |
margin: 0px; |
|
5 |
} |
|
6 |
|
|
7 |
.background_job_history_details tbody th { |
|
8 |
text-align: right; |
|
9 |
vertical-align: top; |
|
10 |
} |
|
11 |
|
|
12 |
.background_job_history_details tbody td { |
|
13 |
vertical-align: top; |
|
14 |
} |
locale/de/all | ||
---|---|---|
819 | 819 |
'Execution date from' => 'Ausführungsdatum von', |
820 | 820 |
'Execution date to' => 'Ausführungsdatum bis', |
821 | 821 |
'Execution schedule' => 'Ausführungszeitplan', |
822 |
'Execution status' => 'Ausführungsstatus', |
|
822 | 823 |
'Execution type' => 'Ausführungsart', |
823 | 824 |
'Existing Buchungsgruppen' => 'Existierende Buchungsgruppen', |
824 | 825 |
'Existing Datasets' => 'Existierende Datenbanken', |
... | ... | |
1560 | 1561 |
'Required by' => 'Lieferdatum', |
1561 | 1562 |
'Reset' => 'Zurücksetzen', |
1562 | 1563 |
'Restore Dataset' => 'Datenbank wiederherstellen', |
1564 |
'Result' => 'Ergebnis', |
|
1563 | 1565 |
'Revenue' => 'Erlöskonto', |
1564 | 1566 |
'Revenue Account' => 'Erlöskonto', |
1565 | 1567 |
'Revenues EU with UStId' => 'Erlöse EU m. UStId', |
1566 | 1568 |
'Revenues EU without UStId' => 'Erlöse EU o. UStId', |
1567 | 1569 |
'Review of Aging list' => 'Altersstrukturliste', |
1568 | 1570 |
'Right' => 'Rechts', |
1571 |
'Run at' => 'Ausgeführt um', |
|
1569 | 1572 |
'SAVED' => 'Gespeichert', |
1570 | 1573 |
'SAVED FOR DUNNING' => 'Gespeichert', |
1571 | 1574 |
'SCREENED' => 'Angezeigt', |
... | ... | |
1825 | 1828 |
'The background job has been created.' => 'Der Hintergrund-Job wurden angelegt.', |
1826 | 1829 |
'The background job has been deleted.' => 'Der Hintergrund-Job wurde gelöscht.', |
1827 | 1830 |
'The background job has been saved.' => 'Der Hintergrund-Job wurde gespeichert.', |
1831 |
'The background job was executed successfully.' => 'Der Hintergrund-Job wurde erfolgreich ausgeführt.', |
|
1828 | 1832 |
'The backup you upload here has to be a file created with "pg_dump -o -Ft".' => 'Die von Ihnen hochzuladende Sicherungsdatei muss mit dem Programm und den Parametern "pg_dump -o -Ft" erstellt worden sein.', |
1829 | 1833 |
'The bank information must not be empty.' => 'Die Bankinformationen müssen vollständig ausgefüllt werden.', |
1830 | 1834 |
'The base unit does not exist or it is about to be deleted in row %d.' => 'Die Basiseinheit in Zeile %d existiert nicht oder soll gelöscht werden.', |
... | ... | |
1964 | 1968 |
'There are #1 unfinished follow-ups of which #2 are due.' => 'Es gibt #1 Wiedervorlage(n), von denen #2 fällig ist/sind.', |
1965 | 1969 |
'There are bookings to the account 3803 after 01.01.2007. If you didn\'t change this account manually to 19% the bookings are probably incorrect.' => 'Das Konto 3803 wurde nach dem 01.01.2007 bebucht. Falls Sie dieses Konto nicht manuell auf 19% gestellt haben sind die Buchungen wahrscheinlich mit falscher Umsatzsteuer gebucht worden.', |
1966 | 1970 |
'There are four tax zones.' => 'Es gibt vier Steuerzonen.', |
1971 |
'There are no entries in the background job history.' => 'Es gibt keine Einträge im Hintergrund-Job-Verlauf.', |
|
1967 | 1972 |
'There are no items in stock.' => 'Dieser Artikel ist nicht eingelagert.', |
1968 | 1973 |
'There are no items on your TODO list at the moment.' => 'Ihre Aufgabenliste enthält momentan keine Einträge.', |
1969 | 1974 |
'There are still entries in the database for which no unit has been assigned.' => 'Es gibt noch Einträge in der Datenbank, für die keine Einheit zugeordnet ist.', |
... | ... | |
1975 | 1980 |
'There is not enough available of \'#1\' at warehouse \'#2\', bin \'#3\', #4, for the transfer of #5.' => 'Von \'#1\' ist in Lager \'#2\', Lagerplatz \'#3\', #4 nicht genügend eingelagert, um insgesamt #5 auszulagern.', |
1976 | 1981 |
'There is not enough left of \'#1\' in bin \'#2\' for the removal of #3.' => 'In Lagerplatz \'#2\' ist nicht genug von \'#1\' vorhanden, um #3 zu entnehmen.', |
1977 | 1982 |
'There is nothing to do in this step.' => 'In diesem Schritt gibt es nichts mehr zu tun.', |
1983 |
'There was an error executing the background job.' => 'Bei der Ausführung des Hintergrund-Jobs trat ein Fehler auf.', |
|
1978 | 1984 |
'Therefore the definition of "kg" with the base unit "g" and a factor of 1000 is valid while defining "g" with a base unit of "kg" and a factor of "0.001" is not.' => 'So ist die Definition von "kg" mit der Basiseinheit "g" und dem Faktor 1000 zulässig, die Definition von "g" mit der Basiseinheit "kg" und dem Faktor "0,001" hingegen nicht.', |
1979 | 1985 |
'Therefore there\'s no need to create the same article more than once if it is sold or bought in/from another tax zone.' => 'Deswegen muss man den gleichen Artikel nicht mehr mehrmals anlegen, wenn er in verschiedenen Steuerzonen gehandelt werden soll.', |
1980 | 1986 |
'These units can be based on other units so that kivitendo can convert prices when the user switches from one unit to another.' => 'Einheiten können auf anderen Einheiten basieren, sodass kivitendo Preise automatisch umrechnen kann, wenn die Benutzer zwischen solchen Einheiten umschalten.', |
... | ... | |
2121 | 2127 |
'Version' => 'Version', |
2122 | 2128 |
'Version 2.4.0 introduces two new concepts: tax zones and Buchungsgruppen.' => 'Version 2.4.0 hat zwei neue Konzepte eingeführt: Steuerzonen und Buchungsgruppen.', |
2123 | 2129 |
'View SEPA export' => 'SEPA-Export-Details ansehen', |
2130 |
'View background job execution result' => 'Verlauf der Hintergrund-Job-Ausführungen anzeigen', |
|
2131 |
'View background job history' => 'Hintergrund-Job-Verlauf anzeigen', |
|
2132 |
'View background jobs' => '', |
|
2124 | 2133 |
'View warehouse content' => 'Lagerbestand ansehen', |
2125 | 2134 |
'View/edit all employees sales documents' => 'Bearbeiten/ansehen der Verkaufsdokumente aller Mitarbeiter', |
2126 | 2135 |
'Von Konto: ' => 'von Konto: ', |
... | ... | |
2268 | 2277 |
'emailed to' => 'gemailt an', |
2269 | 2278 |
'empty' => 'leer', |
2270 | 2279 |
'executed' => 'ausgeführt', |
2280 |
'failed' => 'fehlgeschlagen', |
|
2271 | 2281 |
'female' => 'weiblich', |
2272 | 2282 |
'follow_up_list' => 'wiedervorlageliste', |
2273 | 2283 |
'for' => 'für', |
... | ... | |
2369 | 2379 |
'soldtotal' => 'Verkaufte Anzahl', |
2370 | 2380 |
'stock' => 'Einlagerung', |
2371 | 2381 |
'submit' => 'abschicken', |
2382 |
'succeeded' => 'erfolgreich', |
|
2372 | 2383 |
'tax_chartaccno' => 'Automatikkonto', |
2373 | 2384 |
'tax_percent' => 'Prozentsatz', |
2374 | 2385 |
'tax_rate' => 'Prozent', |
templates/webpages/background_job/form.html | ||
---|---|---|
8 | 8 |
|
9 | 9 |
<table> |
10 | 10 |
<tr> |
11 |
<td>[%- LxERP.t8('Active') %]</td>
|
|
11 |
<th align="right">[%- LxERP.t8('Active') %]</th>
|
|
12 | 12 |
<td>[% L.yes_no_tag("background_job.active", SELF.background_job.active) %]</td> |
13 | 13 |
</tr> |
14 | 14 |
|
15 | 15 |
<tr> |
16 |
<td>[%- LxERP.t8('Execution type') %]</td>
|
|
16 |
<th align="right">[%- LxERP.t8('Execution type') %]</th>
|
|
17 | 17 |
<td>[% L.select_tag("background_job.type", L.options_for_select([ [ 'once', LxERP.t8('one-time execution') ], [ 'interval', LxERP.t8('repeated execution') ] ], |
18 | 18 |
'default' => SELF.background_job.type)) %]</td> |
19 | 19 |
</tr> |
20 | 20 |
|
21 | 21 |
<tr> |
22 |
<td>[%- LxERP.t8('Package name') %]</td>
|
|
22 |
<th align="right">[%- LxERP.t8('Package name') %]</th>
|
|
23 | 23 |
<td>[% L.input_tag("background_job.package_name", SELF.background_job.package_name, 'size' => 40) %]</td> |
24 | 24 |
</tr> |
25 | 25 |
|
26 | 26 |
<tr> |
27 |
<td>[%- LxERP.t8('Execution schedule') %]</td>
|
|
27 |
<th align="right">[%- LxERP.t8('Execution schedule') %]</th>
|
|
28 | 28 |
<td>[% L.input_tag("background_job.cron_spec", SELF.background_job.cron_spec, 'size' => 40) %]</td> |
29 | 29 |
</tr> |
30 | 30 |
|
31 | 31 |
<tr> |
32 |
<td>[%- LxERP.t8('Data') %]</td>
|
|
33 |
<td>[% L.textarea_tag("background_job.data", SELF.background_job.data, 'cols' => 80, 'rows' => 10) %]</td> |
|
32 |
<th align="right" valign="top">[%- LxERP.t8('Data') %]</th>
|
|
33 |
<td valign="top">[% L.textarea_tag("background_job.data", SELF.background_job.data, 'cols' => 80, 'rows' => 10) %]</td>
|
|
34 | 34 |
</tr> |
35 | 35 |
|
36 | 36 |
</table> |
templates/webpages/background_job/list.html | ||
---|---|---|
14 | 14 |
[%- ELSE %] |
15 | 15 |
<table id="background_job_list" width="100%"> |
16 | 16 |
<thead> |
17 |
<tr class="listheading"> |
|
18 |
<th>[%- LxERP.t8('Execution type') %]</th> |
|
19 |
<th>[%- LxERP.t8('Package name') %]</th> |
|
20 |
<th>[%- LxERP.t8('Active') %]</th> |
|
21 |
<th>[%- LxERP.t8('Execution schedule') %]</th> |
|
22 |
<th>[%- LxERP.t8('Last run at') %]</th> |
|
23 |
<th>[%- LxERP.t8('Next run at') %]</th> |
|
24 |
</tr> |
|
17 |
<tr class="listheading">
|
|
18 |
<th>[%- LxERP.t8('Execution type') %]</th>
|
|
19 |
<th>[%- LxERP.t8('Package name') %]</th>
|
|
20 |
<th>[%- LxERP.t8('Active') %]</th>
|
|
21 |
<th>[%- LxERP.t8('Execution schedule') %]</th>
|
|
22 |
<th>[%- LxERP.t8('Last run at') %]</th>
|
|
23 |
<th>[%- LxERP.t8('Next run at') %]</th>
|
|
24 |
</tr>
|
|
25 | 25 |
</thead> |
26 | 26 |
|
27 | 27 |
<tbody> |
... | ... | |
35 | 35 |
[% ELSE %] |
36 | 36 |
[%- HTML.escape(background_job.type) %] |
37 | 37 |
[%- END %] |
38 |
</td> |
|
38 | 39 |
<td> |
39 | 40 |
<a href="[% SELF.url_for(action => 'edit', id => background_job.id) %]"> |
40 | 41 |
[%- HTML.escape(background_job.package_name) %] |
... | ... | |
68 | 69 |
<p> |
69 | 70 |
<a href="[% SELF.url_for(action => 'new') %]">[%- LxERP.t8('Create new background job') %]</a> |
70 | 71 |
| |
72 |
<a href="[% SELF.url_for(controller => 'BackgroundJobHistory', action => 'list') %]">[%- LxERP.t8('View background job history') %]</a> |
|
73 |
| |
|
71 | 74 |
<a href="[% SELF.url_for(controller => 'TaskServer', action => 'show') %]">[%- LxERP.t8('Task server control') %]</a> |
72 | 75 |
</p> |
73 | 76 |
</form> |
templates/webpages/background_job_history/list.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %] |
|
2 |
|
|
3 |
<body> |
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<form method="post" action="controller.pl"> |
|
9 |
[% IF !ENTRIES.size %] |
|
10 |
<p> |
|
11 |
[%- LxERP.t8('There are no entries in the background job history.') %] |
|
12 |
</p> |
|
13 |
|
|
14 |
[%- ELSE %] |
|
15 |
<table id="background_job_history_list" class="background_job_history_list" width="100%"> |
|
16 |
<thead> |
|
17 |
<tr class="listheading"> |
|
18 |
<th>[%- LxERP.t8('Package name') %]</th> |
|
19 |
<th>[%- LxERP.t8('Run at') %]</th> |
|
20 |
<th>[%- LxERP.t8('Execution status') %]</th> |
|
21 |
<th>[%- LxERP.t8('Result') %]</th> |
|
22 |
<th>[%- LxERP.t8('Error') %]</th> |
|
23 |
</tr> |
|
24 |
</thead> |
|
25 |
|
|
26 |
<tbody> |
|
27 |
[%- FOREACH entry = ENTRIES %] |
|
28 |
<tr class="listrow[% loop.count % 2 %]" id="background_job_history_id_[% entry.id %]"> |
|
29 |
<td> |
|
30 |
<a href="[% SELF.url_for(action => 'show', id => entry.id) %]"> |
|
31 |
[%- HTML.escape(entry.package_name) %] |
|
32 |
</a> |
|
33 |
</td> |
|
34 |
<td>[%- HTML.escape(entry.run_at.to_lxoffice('precision' => 'second')) %]</td> |
|
35 |
<td> |
|
36 |
[%- IF entry.status == 'success' %] |
|
37 |
[%- LxERP.t8('succeeded') %] |
|
38 |
[%- ELSIF entry.status == 'failure' %] |
|
39 |
[%- LxERP.t8('failed') %] |
|
40 |
[%- ELSE %] |
|
41 |
[%- HTML.escape(entry.status) %] |
|
42 |
[%- END %] |
|
43 |
</td> |
|
44 |
<td>[%- HTML.escape(entry.result) %]</td> |
|
45 |
<td>[% IF entry.error_col %]<pre>[%- HTML.escape(L.truncate(entry.error_col)) %]</pre>[%- END %]</td> |
|
46 |
</tr> |
|
47 |
[%- END %] |
|
48 |
</tbody> |
|
49 |
</table> |
|
50 |
[%- END %] |
|
51 |
|
|
52 |
<hr size="3" noshade> |
|
53 |
|
|
54 |
<p> |
|
55 |
<a href="[% SELF.url_for(controller => 'BackgroundJob', action => 'list') %]">[%- LxERP.t8('View background jobs') %]</a> |
|
56 |
| |
|
57 |
<a href="[% SELF.url_for(controller => 'TaskServer', action => 'show') %]">[%- LxERP.t8('Task server control') %]</a> |
|
58 |
</p> |
|
59 |
</form> |
|
60 |
</body> |
|
61 |
</html> |
templates/webpages/background_job_history/show.html | ||
---|---|---|
1 |
[% USE HTML %][% USE L %][% USE LxERP %] |
|
2 |
<body> |
|
3 |
|
|
4 |
<div class="listtop">[% FORM.title %]</div> |
|
5 |
|
|
6 |
[%- INCLUDE 'common/flash.html' %] |
|
7 |
|
|
8 |
<table id="background_job_history_details" class="background_job_history_details"> |
|
9 |
<tbody> |
|
10 |
<tr class="listrow0"> |
|
11 |
<th>[%- LxERP.t8('Package name') %]</th> |
|
12 |
<td>[%- HTML.escape(SELF.history.package_name) %]</td> |
|
13 |
</tr> |
|
14 |
|
|
15 |
<tr class="listrow1"> |
|
16 |
<th>[%- LxERP.t8('Run at') %]</th> |
|
17 |
<td>[%- HTML.escape(SELF.history.run_at.to_lxoffice('precision' => 'second')) %]</td> |
|
18 |
</tr> |
|
19 |
|
|
20 |
<tr class="listrow0"> |
|
21 |
<th>[%- LxERP.t8('Execution status') %]</th> |
|
22 |
<td> |
|
23 |
[%- IF SELF.history.status == 'success' %] |
|
24 |
[%- LxERP.t8('succeeded') %] |
|
25 |
[%- ELSIF SELF.history.status == 'failed' %] |
|
26 |
[%- LxERP.t8('failed') %] |
|
27 |
[%- ELSE %] |
|
28 |
[%- HTML.escape(SELF.history.status) %] |
|
29 |
[%- END %] |
|
30 |
</td> |
|
31 |
</tr> |
|
32 |
|
|
33 |
<tr class="listrow1"> |
|
34 |
<th>[%- LxERP.t8('Result') %]</th> |
|
35 |
<td>[%- HTML.escape(SELF.history.result) %]</td> |
|
36 |
</tr> |
|
37 |
|
|
38 |
<tr class="listrow0"> |
|
39 |
<th>[%- LxERP.t8('Error') %]</th> |
|
40 |
<td>[% IF SELF.history.error_col %]<pre>[%- HTML.escape(SELF.history.error_col) %]</pre>[%- END %]</td> |
|
41 |
</tr> |
|
42 |
|
|
43 |
<tr class="listrow1"> |
|
44 |
<th>[%- LxERP.t8('Data') %]</th> |
|
45 |
<td>[% IF SELF.history.data %]<pre>[%- HTML.escape(SELF.history.data) %]</pre>[%- END %]</td> |
|
46 |
</tr> |
|
47 |
</tbody> |
|
48 |
</table> |
|
49 |
|
|
50 |
<p> |
|
51 |
<a href="[% back_to %]">[%- LxERP.t8('Back') %]</a> |
|
52 |
</p> |
|
53 |
</body> |
|
54 |
</html> |
Auch abrufbar als: Unified diff
Controller zur Verwaltung von BackgroundJobHistory-Einträgen