Revision 95c80e5e
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
bin/mozilla/amtemplates.pl | ||
---|---|---|
37 | 37 |
use SL::DB::Default; |
38 | 38 |
use SL::AM; |
39 | 39 |
use SL::Form; |
40 |
use SL::Locale::String qw(t8); |
|
40 | 41 |
|
41 | 42 |
use Data::Dumper; |
42 | 43 |
|
... | ... | |
278 | 279 |
$options{"CAN_EDIT"} = $form->{"edit"}; |
279 | 280 |
|
280 | 281 |
if (!$form->{edit}) { |
281 |
$options{"content"} = "\n\n" if (!$options{"content"}); |
|
282 |
$options{"SHOW_SECOND_EDIT_BUTTON"} = $options{"lines"} > 25; |
|
282 |
$options{"content"} = "\n\n" if (!$options{"content"}); |
|
283 | 283 |
} |
284 | 284 |
} |
285 | 285 |
|
286 | 286 |
$options{"HIDDEN"} = [ map(+{ "name" => $_, "value" => $form->{$_} }, @hidden) ]; |
287 | 287 |
|
288 |
setup_amtemplates_display_form_action_bar( |
|
289 |
mode => $form->{edit} ? 'edit' : 'show', |
|
290 |
template_selected => $options{SHOW_CONTENT}, |
|
291 |
); |
|
292 |
|
|
288 | 293 |
$form->header; |
289 | 294 |
print($form->parse_html_template("am/edit_templates", \%options)); |
290 | 295 |
|
291 | 296 |
$main::lxdebug->leave_sub(); |
292 | 297 |
} |
293 | 298 |
|
299 |
sub setup_amtemplates_display_form_action_bar { |
|
300 |
my %params = @_; |
|
301 |
|
|
302 |
for my $bar ($::request->layout->get('actionbar')) { |
|
303 |
$bar->add( |
|
304 |
action => [ |
|
305 |
t8('Edit'), |
|
306 |
submit => [ '#form', { action => 'edit_template' } ], |
|
307 |
accesskey => 'enter', |
|
308 |
only_if => $params{mode} eq 'show', |
|
309 |
disabled => !$params{template_selected} ? t8('No template has been selected yet.') : undef, |
|
310 |
], |
|
311 |
|
|
312 |
action => [ |
|
313 |
t8('Save'), |
|
314 |
submit => [ '#form', { action => 'save_template' } ], |
|
315 |
accesskey => 'enter', |
|
316 |
only_if => $params{mode} eq 'edit', |
|
317 |
], |
|
318 |
|
|
319 |
action => [ |
|
320 |
t8('Abort'), |
|
321 |
call => [ 'kivi.history_back' ], |
|
322 |
only_if => $params{mode} eq 'edit', |
|
323 |
], |
|
324 |
); |
|
325 |
} |
|
326 |
} |
|
327 |
|
|
294 | 328 |
1; |
locale/de/all | ||
---|---|---|
1900 | 1900 |
'No start date given, setting to #1' => 'Kein Startdatum gegeben, setze Startdatum auf #1', |
1901 | 1901 |
'No such job #1 in the database.' => 'Hintergrund-Job #1 existiert nicht mehr.', |
1902 | 1902 |
'No summary account' => 'Kein Sammelkonto', |
1903 |
'No template has been selected yet.' => 'Es wurde noch keine Vorlage ausgewählt.', |
|
1903 | 1904 |
'No template was found.' => 'Es wurde keine Vorlage gefunden.', |
1904 | 1905 |
'No text blocks have been created for this position.' => 'Für diese Position wurden noch keine Textblöcke angelegt.', |
1905 | 1906 |
'No text has been entered yet.' => 'Es wurde noch kein Text eingegeben.', |
... | ... | |
3794 | 3795 |
'report_generator_dispatch_to is not defined.' => 'report_generator_dispatch_to ist nicht definiert.', |
3795 | 3796 |
'report_generator_nextsub is not defined.' => 'report_generator_nextsub ist nicht definiert.', |
3796 | 3797 |
'request_quotation' => 'Angebotsanforderung', |
3797 |
'reset' => 'zurücksetzen', |
|
3798 | 3798 |
'return_material' => 'Materialrückgabe', |
3799 | 3799 |
'rfq_list' => 'anfragenliste', |
3800 | 3800 |
'running' => 'läuft', |
... | ... | |
3823 | 3823 |
'start upload' => 'Hochladen beginnt', |
3824 | 3824 |
'stock' => 'Einlagerung', |
3825 | 3825 |
'stock_br' => 'Eingel.', |
3826 |
'submit' => 'abschicken', |
|
3827 | 3826 |
'succeeded' => 'erfolgreich', |
3828 | 3827 |
'sum' => 'Summe', |
3829 | 3828 |
'tax_chartaccno' => 'Automatikkonto', |
templates/webpages/am/edit_templates.html | ||
---|---|---|
7 | 7 |
<p style="text-align: right;">[<a href="doc/html/ch03s03.html" target="_blank" title="[% 'Open in new window' | $T8 %]">[% 'Help Template Variables' | $T8 %]</a>]</p> |
8 | 8 |
[% END %] |
9 | 9 |
|
10 |
<form method="post" name="Form" action="amtemplates.pl"> |
|
10 |
<form method="post" name="Form" action="amtemplates.pl" id="form">
|
|
11 | 11 |
|
12 | 12 |
[% FOREACH var = HIDDEN %]<input type="hidden" name="[% HTML.escape(var.name) %]" value="[% HTML.escape(var.value) %]">[% END %] |
13 | 13 |
|
... | ... | |
43 | 43 |
<hr> |
44 | 44 |
[% END %] |
45 | 45 |
|
46 |
|
|
47 |
|
|
48 | 46 |
[% IF SHOW_CONTENT %] |
49 | 47 |
<h2> |
50 | 48 |
[% IF CAN_EDIT %][% 'Edit file' | $T8 %][% ELSE %][% 'Display file' | $T8 %][% END %] [% HTML.escape(display_filename) %] |
... | ... | |
53 | 51 |
[% IF CAN_EDIT %] |
54 | 52 |
<p><textarea name="content" id="edit_content" cols="100" rows="25"[% IF edit %] class="initial_focus"[% END %]>[% HTML.escape(content) %]</textarea></p> |
55 | 53 |
|
56 |
<p> |
|
57 |
<input type="hidden" name="save_nextsub" value="save_template"> |
|
58 |
<input type="submit" name="action" value="[% 'Save' | $T8 %]"> |
|
59 |
<input type="button" onclick="history.back()" value="[% 'Back' | $T8 %]"> |
|
60 |
</p> |
|
61 |
|
|
62 | 54 |
[% ELSE %] |
63 | 55 |
|
64 |
<input type="hidden" name="edit_nextsub" value="edit_template"> |
|
65 |
|
|
66 |
<p><input name="action" type="submit" class="submit" value="[% 'Edit' | $T8 %]"></p> |
|
67 |
|
|
68 | 56 |
<p><pre class="filecontent">[% HTML.escape(content) %]</pre></p> |
69 | 57 |
|
70 |
[% IF SHOW_SECOND_EDIT_BUTTON %] |
|
71 |
<p><input name="action" type="submit" class="submit" value="[% 'Edit' | $T8 %]"></p> |
|
72 |
[% END %] |
|
73 |
|
|
74 | 58 |
[% END %] <!-- CAN_EDIT --> |
75 | 59 |
|
76 | 60 |
[% END %] <!-- SHOW_CONTENT --> |
Auch abrufbar als: Unified diff
ActionBar: Verwendung bei »System« → »Vorlagen« → *