Revision 20e24a4a
Von Moritz Bunkus vor fast 8 Jahren hinzugefügt
SL/Controller/DeliveryTerm.pm | ||
---|---|---|
7 | 7 |
use SL::DB::DeliveryTerm; |
8 | 8 |
use SL::DB::Language; |
9 | 9 |
use SL::Helper::Flash; |
10 |
use SL::Locale::String qw(t8); |
|
10 | 11 |
|
11 | 12 |
use Rose::Object::MakeMethods::Generic |
12 | 13 |
( |
... | ... | |
25 | 26 |
sub action_list { |
26 | 27 |
my ($self) = @_; |
27 | 28 |
|
29 |
$self->setup_list_action_bar; |
|
28 | 30 |
$self->render('delivery_term/list', |
29 | 31 |
title => $::locale->text('Delivery terms'), |
30 | 32 |
DELIVERY_TERMS => SL::DB::Manager::DeliveryTerm->get_all_sorted); |
... | ... | |
34 | 36 |
my ($self) = @_; |
35 | 37 |
|
36 | 38 |
$self->{delivery_term} = SL::DB::DeliveryTerm->new; |
39 |
$self->setup_form_action_bar; |
|
37 | 40 |
$self->render('delivery_term/form', title => $::locale->text('Create a new delivery term')); |
38 | 41 |
} |
39 | 42 |
|
40 | 43 |
sub action_edit { |
41 | 44 |
my ($self) = @_; |
45 |
$self->setup_form_action_bar; |
|
42 | 46 |
$self->render('delivery_term/form', title => $::locale->text('Edit delivery term')); |
43 | 47 |
} |
44 | 48 |
|
... | ... | |
120 | 124 |
$self->{languages} = SL::DB::Manager::Language->get_all_sorted; |
121 | 125 |
} |
122 | 126 |
|
127 |
sub setup_list_action_bar { |
|
128 |
my ($self) = @_; |
|
129 |
|
|
130 |
for my $bar ($::request->layout->get('actionbar')) { |
|
131 |
$bar->add( |
|
132 |
link => [ |
|
133 |
t8('Add'), |
|
134 |
link => $self->url_for(action => 'new'), |
|
135 |
], |
|
136 |
); |
|
137 |
} |
|
138 |
} |
|
139 |
|
|
140 |
sub setup_form_action_bar { |
|
141 |
my ($self) = @_; |
|
142 |
|
|
143 |
my $is_new = !$self->delivery_term->id; |
|
144 |
|
|
145 |
for my $bar ($::request->layout->get('actionbar')) { |
|
146 |
$bar->add( |
|
147 |
action => [ |
|
148 |
t8('Save'), |
|
149 |
submit => [ '#form', { action => 'DeliveryTerm/' . ($is_new ? 'create' : 'update') } ], |
|
150 |
checks => [ 'kivi.validate_form' ], |
|
151 |
accesskey => 'enter', |
|
152 |
], |
|
153 |
|
|
154 |
action => [ |
|
155 |
t8('Delete'), |
|
156 |
submit => [ '#form', { action => 'DeliveryTerm/destroy' } ], |
|
157 |
confirm => t8('Do you really want to delete this object?'), |
|
158 |
disabled => $is_new ? t8('This object has not been saved yet.') : undef, |
|
159 |
], |
|
160 |
|
|
161 |
'separator', |
|
162 |
|
|
163 |
link => [ |
|
164 |
t8('Abort'), |
|
165 |
link => $self->url_for(action => 'list'), |
|
166 |
], |
|
167 |
); |
|
168 |
} |
|
169 |
} |
|
170 |
|
|
123 | 171 |
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 delivery term?' => 'Wollen Sie diese Lieferbedingungen wirklich löschen?', |
|
304 | 303 |
'Are you sure you want to delete this letter?' => 'Sind Sie sicher, dass Sie diesen Brief löschen wollen?', |
305 | 304 |
'Are you sure you want to remove the marked entries from the queue?' => 'Sind Sie sicher, dass die markierten Einträge von der Warteschlange gelöscht werden sollen?', |
306 | 305 |
'Are you sure you want to update the prices' => 'Sind Sie sicher, dass Sie die Preise aktualisieren wollen?', |
... | ... | |
712 | 711 |
'Create invoice?' => 'Rechnung erstellen?', |
713 | 712 |
'Create new' => 'Neu erfassen', |
714 | 713 |
'Create new client #1' => 'Neuen Mandanten #1 anlegen', |
715 |
'Create new delivery term' => 'Neue Lieferbedingungen anlegen', |
|
716 | 714 |
'Create new quotation or order' => 'Neues Angebot oder neuen Auftrag anlegen', |
717 | 715 |
'Create new quotation/order' => 'Neues Angebot/neuen Auftrag anlegen', |
718 | 716 |
'Create new qutoation/order' => 'Neues Angebot/neuen Auftrag anlegen', |
templates/webpages/delivery_term/form.html | ||
---|---|---|
1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %] |
|
1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %][%- USE P -%]
|
|
2 | 2 |
<h1>[% FORM.title %]</h1> |
3 | 3 |
|
4 |
<form method="post" action="controller.pl"> |
|
4 |
<form method="post" action="controller.pl" id="form">
|
|
5 | 5 |
|
6 | 6 |
[%- INCLUDE 'common/flash.html' %] |
7 | 7 |
|
... | ... | |
9 | 9 |
<tr> |
10 | 10 |
<td>[%- 'Description' | $T8 %]</td> |
11 | 11 |
<td> |
12 |
<input name="delivery_term.description" value="[%- HTML.escape(SELF.delivery_term.description) %]">
|
|
12 |
[% P.input_tag("delivery_term.description", SELF.delivery_term.description, size="60", "data-validate"="required", "data-title"=LxERP.t8("Description")) %]
|
|
13 | 13 |
</td> |
14 | 14 |
</tr> |
15 | 15 |
|
16 | 16 |
<tr> |
17 | 17 |
<td>[%- 'Long Description' | $T8 %]</td> |
18 | 18 |
<td> |
19 |
<input name="delivery_term.description_long" value="[%- HTML.escape(SELF.delivery_term.description_long) %]" size="60">
|
|
19 |
[% P.input_tag("delivery_term.description_long", SELF.delivery_term.description_long, size="60", "data-validate"="required", "data-title"=LxERP.t8("Long Description")) %]
|
|
20 | 20 |
</td> |
21 | 21 |
</tr> |
22 | 22 |
|
... | ... | |
28 | 28 |
</td> |
29 | 29 |
</tr> |
30 | 30 |
[%- END %] |
31 |
</table> |
|
31 | 32 |
|
32 |
<p> |
|
33 |
<input type="hidden" name="id" value="[% SELF.delivery_term.id %]"> |
|
34 |
<input type="hidden" name="action" value="DeliveryTerm/dispatch"> |
|
35 |
<input type="submit" class="submit" name="action_[% IF SELF.delivery_term.id %]update[% ELSE %]create[% END %]" value="[% 'Save' | $T8 %]"> |
|
36 |
[%- IF SELF.delivery_term.id %] |
|
37 |
<input type="submit" class="submit" name="action_destroy" value="[% 'Delete' | $T8 %]" |
|
38 |
onclick="if (confirm('[% 'Are you sure you want to delete this delivery term?' | $T8 %]')) return true; else return false;"> |
|
39 |
[%- END %] |
|
40 |
<a href="[% SELF.url_for(action => 'list') %]">[%- 'Abort' | $T8 %]</a> |
|
41 |
</p> |
|
42 |
|
|
33 |
[% P.hidden_tag("id", SELF.delivery_term.id) %] |
|
43 | 34 |
</form> |
44 |
|
templates/webpages/delivery_term/list.html | ||
---|---|---|
3 | 3 |
|
4 | 4 |
[%- INCLUDE 'common/flash.html' %] |
5 | 5 |
|
6 |
<form method="post" action="controller.pl"> |
|
6 |
<form method="post" action="controller.pl" id="form">
|
|
7 | 7 |
[% IF !DELIVERY_TERMS.size %] |
8 | 8 |
<p> |
9 | 9 |
[%- 'No delivery term has been created yet.' | $T8 %] |
... | ... | |
34 | 34 |
</tbody> |
35 | 35 |
</table> |
36 | 36 |
[%- END %] |
37 |
|
|
38 |
<p> |
|
39 |
<a href="[% SELF.url_for(action => 'new') %]">[%- 'Create new delivery term' | $T8 %]</a> |
|
40 |
</p> |
|
41 | 37 |
</form> |
42 | 38 |
|
43 | 39 |
[% L.sortable_element('#delivery_term_list tbody', url => 'controller.pl?action=DeliveryTerm/reorder', with => 'delivery_term_id') %] |
44 |
|
Auch abrufbar als: Unified diff
ActionBar: Verwendung bei »System« → »Lieferbedingungen«