Revision 46ee23a1
Von Tamino Steinert vor 11 Monaten hinzugefügt
SL/Controller/VariantProperty.pm | ||
---|---|---|
10 | 10 |
use SL::DB::Manager::VariantProperty; |
11 | 11 |
|
12 | 12 |
use Rose::Object::MakeMethods::Generic ( |
13 |
'scalar --get_set_init' => [ qw(variant_property variant_property_value) ]
|
|
13 |
'scalar --get_set_init' => [ qw(variant_property) ] |
|
14 | 14 |
); |
15 | 15 |
|
16 | 16 |
#__PACKAGE__->run_before('check_auth'); |
17 |
__PACKAGE__->run_before('add_javascripts', only => [ qw(edit_property) ]); |
|
17 |
__PACKAGE__->run_before('add_javascripts', only => [ qw(edit_variant_property) ]);
|
|
18 | 18 |
|
19 | 19 |
# |
20 | 20 |
# actions |
21 | 21 |
# |
22 | 22 |
|
23 |
sub action_list_properties { |
|
23 |
sub action_list_variant_properties {
|
|
24 | 24 |
my ($self) = @_; |
25 | 25 |
|
26 | 26 |
$self->_setup_list_action_bar; |
... | ... | |
30 | 30 |
); |
31 | 31 |
} |
32 | 32 |
|
33 |
sub action_edit_property { |
|
33 |
sub action_edit_variant_property {
|
|
34 | 34 |
my ($self) = @_; |
35 | 35 |
|
36 | 36 |
my $is_new = !$self->variant_property->id; |
37 | 37 |
$self->_setup_form_action_bar; |
38 |
$self->render('variant_property/variant_property_form', title => ($is_new ? t8('Add Variant Property') : t8('Edit Variant Property'))); |
|
38 |
$self->render( |
|
39 |
'variant_property/variant_property_form', |
|
40 |
title => ($is_new ? t8('Add Variant Property') : t8('Edit Variant Property')), |
|
41 |
); |
|
39 | 42 |
} |
40 | 43 |
|
41 |
sub action_save_property { |
|
44 |
sub action_save_variant_property {
|
|
42 | 45 |
my ($self) = @_; |
43 | 46 |
|
44 |
$self->create_or_update_property; |
|
47 |
$self->create_or_update_variant_property;
|
|
45 | 48 |
} |
46 | 49 |
|
47 |
sub action_delete_property { |
|
50 |
sub action_delete_variant_property {
|
|
48 | 51 |
my ($self) = @_; |
49 | 52 |
|
50 |
if ( eval { $self->shop->delete; 1; } ) { |
|
51 |
flash_later('info', $::locale->text('The shop has been deleted.')); |
|
53 |
if ( eval { |
|
54 |
SL::DB->client->with_transaction(sub { |
|
55 |
$_->delete for $self->variant_property->property_values; |
|
56 |
$self->variant_property->delete; |
|
57 |
}); |
|
58 |
1; |
|
59 |
} ) { |
|
60 |
flash_later('info', t8('The Variant Property has been deleted.')); |
|
52 | 61 |
} else { |
53 |
flash_later('error', $::locale->text('The shop is in use and cannot be deleted.'));
|
|
62 |
flash_later('error', t8('The Variant Property is in use and cannot be deleted.'));
|
|
54 | 63 |
}; |
55 |
$self->redirect_to(action => 'list_properties'); |
|
64 |
$self->redirect_to(action => 'list_variant_properties');
|
|
56 | 65 |
} |
57 | 66 |
|
58 |
sub action_reorder_properties { |
|
67 |
sub action_reorder_variant_properties {
|
|
59 | 68 |
my ($self) = @_; |
60 | 69 |
|
61 | 70 |
SL::DB::VariantProperty->reorder_list(@{ $::form->{variant_property_id} || [] }); |
62 | 71 |
$self->render(\'', { type => 'json' }); # ' emacs happy again |
63 | 72 |
} |
64 | 73 |
|
65 |
sub action_edit_property_value {
|
|
74 |
sub action_reorder_variant_property_values {
|
|
66 | 75 |
my ($self) = @_; |
67 | 76 |
|
68 |
$self->render_variant_edit_dialog(); |
|
77 |
SL::DB::VariantPropertyValue->reorder_list(@{ $::form->{variant_property_value_id} || [] }); |
|
78 |
$self->render(\'', { type => 'json' }); # ' emacs happy again |
|
69 | 79 |
} |
70 | 80 |
|
71 |
sub action_save_property_value {
|
|
81 |
sub action_edit_variant_property_value {
|
|
72 | 82 |
my ($self) = @_; |
73 | 83 |
|
74 |
$self->create_or_update_property_value; |
|
75 |
} |
|
76 |
|
|
77 |
|
|
78 |
sub render_variant_edit_dialog { |
|
79 |
my ($self) = @_; |
|
80 | 84 |
$self->js |
81 | 85 |
->run( |
82 |
'kivi.VariantProperty.variant_dialog', |
|
83 |
t8('Variant Value'), |
|
84 |
$self->render('variant_property/variant_property_value_form', { output => 0 }) |
|
86 |
'kivi.VariantProperty.variant_property_value_dialog', |
|
87 |
t8('Variant Property Value'), |
|
88 |
$self->render( |
|
89 |
'variant_property/variant_property_value_form', |
|
90 |
{ output => 0 }, |
|
91 |
variant_property_value => SL::DB::Manager::VariantPropertyValue->find_by( |
|
92 |
id => $::form->{variant_property_value_id} |
|
93 |
), |
|
94 |
) |
|
85 | 95 |
) |
86 | 96 |
->reinit_widgets; |
87 | 97 |
|
88 | 98 |
$self->js->render; |
89 | 99 |
} |
90 | 100 |
|
91 |
#sub action_list_property_values_list { |
|
92 |
# my ($self) = @_; |
|
93 |
# |
|
94 |
# $self->_setup_list_action_bar; |
|
95 |
# $self->render('variant_property/variant_property_list', |
|
96 |
# title => t8('Variant Property'), |
|
97 |
# VARIANTPROPERTIES => SL::DB::Manager::VariantProperty->get_all_sorted, |
|
98 |
# ); |
|
99 |
#} |
|
100 |
|
|
101 |
#sub action_reorder { |
|
102 |
# my ($self) = @_; |
|
103 |
# |
|
104 |
# SL::DB::DeliveryTerm->reorder_list(@{ $::form->{delivery_term_id} || [] }); |
|
105 |
# |
|
106 |
# $self->render(\'', { type => 'json' }); # ' make Emacs happy |
|
107 |
#} |
|
108 |
# |
|
101 |
sub action_save_variant_property_value { |
|
102 |
my ($self) = @_; |
|
103 |
|
|
104 |
die "'variant_property_value.id' is needed" unless $::form->{variant_property_value}->{id}; |
|
105 |
|
|
106 |
my $variant_property_value = SL::DB::Manager::VariantPropertyValue->find_by( |
|
107 |
id => $::form->{variant_property_value}->{id} |
|
108 |
) or die t8("Could not find Variant Property Value"); |
|
109 |
|
|
110 |
$variant_property_value->update_attributes( |
|
111 |
%{$::form->{variant_property_value}} |
|
112 |
); |
|
113 |
|
|
114 |
flash_later('info', t8('The Variant Property Value has been saved.')); |
|
115 |
$self->redirect_to( |
|
116 |
action => 'edit_variant_property', |
|
117 |
id => $variant_property_value->variant_property_id, |
|
118 |
); |
|
119 |
} |
|
120 |
|
|
121 |
sub action_add_variant_property_value { |
|
122 |
my ($self) = @_; |
|
123 |
|
|
124 |
my $new_variant_property_value = SL::DB::VariantPropertyValue->new( |
|
125 |
%{ $::form->{new_variant_property_value} }, |
|
126 |
variant_property => $self->variant_property, |
|
127 |
)->save; |
|
128 |
|
|
129 |
$self->redirect_to( |
|
130 |
action => 'edit_variant_property', |
|
131 |
id => $self->variant_property->id, |
|
132 |
); |
|
133 |
} |
|
134 |
|
|
109 | 135 |
# |
110 | 136 |
#inits |
111 | 137 |
# |
... | ... | |
114 | 140 |
SL::DB::Manager::VariantProperty->find_by_or_create(id => $::form->{id} || 0)->assign_attributes(%{ $::form->{variant_property} }); |
115 | 141 |
} |
116 | 142 |
|
117 |
sub init_variant_property_value { |
|
118 |
SL::DB::Manager::VariantPropertyValue->find_by_or_create(id => $::form->{variant_property_value_id} || 0)->assign_attributes(%{ $::form->{variant_property_value} }); |
|
119 |
} |
|
120 |
|
|
121 | 143 |
sub add_javascripts { |
122 | 144 |
$::request->{layout}->add_javascripts(qw(kivi.VariantProperty.js)); |
123 | 145 |
} |
... | ... | |
126 | 148 |
# helpers |
127 | 149 |
# |
128 | 150 |
|
129 |
sub create_or_update_property { |
|
151 |
sub create_or_update_variant_property {
|
|
130 | 152 |
my ($self) = @_; |
131 | 153 |
|
132 | 154 |
my $is_new = !$self->variant_property->id; |
... | ... | |
134 | 156 |
my @errors = $self->variant_property->validate; |
135 | 157 |
if (@errors) { |
136 | 158 |
flash('error', @errors); |
137 |
$self->action_edit_property(); |
|
159 |
$self->action_edit_variant_property();
|
|
138 | 160 |
return; |
139 | 161 |
} |
140 | 162 |
|
141 | 163 |
$self->variant_property->save; |
142 | 164 |
|
143 | 165 |
flash_later('info', $is_new ? t8('The Variant Property has been created.') : t8('The Variant Property has been saved.')); |
144 |
$self->redirect_to(action => 'list_properties'); |
|
145 |
} |
|
146 |
|
|
147 |
sub create_or_update_property_value { |
|
148 |
my ($self) = @_; |
|
149 |
|
|
150 |
$main::lxdebug->dump(0, "TST:FORM ", $::form); |
|
151 |
my $is_new = !$self->variant_property_value->id; |
|
152 |
|
|
153 |
# my @errors = $self->variant_property_value->validate; |
|
154 |
# if (@errors) { |
|
155 |
# flash('error', @errors); |
|
156 |
# $self->action_edit_property(); |
|
157 |
# return; |
|
158 |
# } |
|
159 |
$main::lxdebug->dump(0, "TST:PV ", $self->variant_property_value); |
|
160 |
$self->variant_property_value->assign_attributes( variant_property_id => $::form->{property_value_id}); |
|
161 |
$self->variant_property_value->save; |
|
162 |
|
|
163 |
flash_later('info', $is_new ? t8('The Variant Property Value has been created.') : t8('The Variant Property Value has been saved.')); |
|
164 |
$self->action_edit_property(); |
|
165 |
return; |
|
166 |
$self->redirect_to( |
|
167 |
action => 'edit_variant_property', |
|
168 |
id => $self->variant_property->id, |
|
169 |
); |
|
166 | 170 |
} |
167 | 171 |
|
168 | 172 |
sub _setup_form_action_bar { |
... | ... | |
173 | 177 |
combobox => [ |
174 | 178 |
action => [ |
175 | 179 |
t8('Save'), |
176 |
submit => [ '#form', { action => "VariantProperty/save_property" } ], |
|
180 |
submit => [ '#form', { action => "VariantProperty/save_variant_property" } ],
|
|
177 | 181 |
accesskey => 'enter', |
178 | 182 |
], |
179 | 183 |
action => [ |
180 | 184 |
t8('Delete'), |
181 |
submit => [ '#form', { action => "VariantProperty/delete_property" } ], |
|
185 |
submit => [ '#form', { action => "VariantProperty/delete_variant_property" } ],
|
|
182 | 186 |
], |
183 | 187 |
], |
184 | 188 |
action => [ |
185 | 189 |
t8('Cancel'), |
186 |
submit => [ '#form', { action => "VariantProperty/list_properties" } ], |
|
190 |
submit => [ '#form', { action => "VariantProperty/list_variant_properties" } ],
|
|
187 | 191 |
], |
188 | 192 |
); |
189 | 193 |
} |
... | ... | |
196 | 200 |
$bar->add( |
197 | 201 |
link => [ |
198 | 202 |
t8('Add'), |
199 |
link => $self->url_for(action => 'edit_property'), |
|
203 |
link => $self->url_for(action => 'edit_variant_property'),
|
|
200 | 204 |
], |
201 | 205 |
) |
202 | 206 |
}; |
SL/DB/VariantProperty.pm | ||
---|---|---|
9 | 9 |
use SL::DB::Manager::VariantProperty; |
10 | 10 |
use SL::DB::Helper::ActsAsList; |
11 | 11 |
use SL::DB::Helper::TranslatedAttributes; |
12 |
use SL::DB::Helper::AttrSorted; |
|
12 | 13 |
|
13 | 14 |
__PACKAGE__->meta->add_relationships( |
14 | 15 |
parent_variants => { |
... | ... | |
24 | 25 |
} |
25 | 26 |
); |
26 | 27 |
|
28 |
__PACKAGE__->attr_sorted({ unsorted => 'property_values', position => 'sortkey'}); |
|
29 |
|
|
27 | 30 |
__PACKAGE__->meta->initialize; |
28 | 31 |
|
29 | 32 |
sub validate { |
SL/DB/VariantPropertyValue.pm | ||
---|---|---|
7 | 7 |
|
8 | 8 |
use SL::DB::MetaSetup::VariantPropertyValue; |
9 | 9 |
use SL::DB::Manager::VariantPropertyValue; |
10 |
use SL::DB::Helper::ActsAsList; |
|
10 | 11 |
|
11 | 12 |
__PACKAGE__->meta->add_relationships( |
12 | 13 |
parent_variants => { |
js/kivi.VariantProperty.js | ||
---|---|---|
1 | 1 |
namespace('kivi.VariantProperty', function(ns) { |
2 | 2 |
var $dialog; |
3 | 3 |
|
4 |
ns.variant_dialog = function(title, html) { |
|
5 |
var id = 'jqueryui_popup_dialog';
|
|
4 |
ns.variant_property_value_dialog = function(title, html) {
|
|
5 |
var id = 'jqueryui_popup_dialog'; |
|
6 | 6 |
var dialog_params = { |
7 | 7 |
id: id, |
8 | 8 |
width: 800, |
9 | 9 |
height: 500, |
10 | 10 |
modal: true, |
11 |
close: function(event, ui) { $dialog.remove(); },
|
|
11 |
close: function(_event, _ui) { $dialog.remove(); },
|
|
12 | 12 |
}; |
13 | 13 |
|
14 | 14 |
$('#' + id).remove(); |
... | ... | |
23 | 23 |
return true; |
24 | 24 |
}; |
25 | 25 |
|
26 |
|
|
27 |
ns.save_variant_value = function() { |
|
28 |
var form = $('#variant_property_value_form').serializeArray(); |
|
29 |
console.log("my", form) |
|
30 |
form.push( { name: 'action', value: 'VariantProperty/save_property_value' } |
|
31 |
); |
|
32 |
|
|
33 |
$.post('controller.pl', form, function(data) { |
|
34 |
kivi.eval_json_result(data); |
|
35 |
}); |
|
26 |
ns.save_variant_property_value = function() { |
|
27 |
var data = $('#variant_property_value_form').serializeArray(); |
|
28 |
data.push({ name: 'action', value: 'VariantProperty/save_variant_property_value' }); |
|
29 |
$.post('controller.pl', data, kivi.eval_json_result); |
|
36 | 30 |
}; |
37 | 31 |
|
38 |
ns.add_or_edit_variant_value = function(id) { |
|
39 |
$.post('controller.pl', { action: 'VariantProperty/edit_property_value', id: id }, function(data) { |
|
40 |
kivi.eval_json_result(data); |
|
41 |
}); |
|
32 |
ns.add_variant_property_value = function() { |
|
33 |
var data = $('#variant_property_value_list_form').serializeArray(); |
|
34 |
data.push({ name: 'action', value: 'VariantProperty/add_variant_property_value' }); |
|
35 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
36 |
} |
|
37 |
|
|
38 |
ns.edit_variant_property_value = function(variant_property_value_id) { |
|
39 |
$.post('controller.pl', { |
|
40 |
action: 'VariantProperty/edit_variant_property_value', |
|
41 |
variant_property_value_id: variant_property_value_id |
|
42 |
}, kivi.eval_json_result); |
|
42 | 43 |
}; |
43 | 44 |
|
44 | 45 |
}); |
menus/user/10-variant_properties.yaml | ||
---|---|---|
4 | 4 |
name: Variant Properties |
5 | 5 |
order: 1110 |
6 | 6 |
params: |
7 |
action: VariantProperty/list_properties |
|
7 |
action: VariantProperty/list_variant_properties |
templates/design40_webpages/variant_property/variant_property_form.html | ||
---|---|---|
1 | 1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %][%- USE P -%] |
2 | 2 |
[% USE Dumper %] |
3 |
|
|
3 | 4 |
<h1>[% FORM.title %]</h1> |
5 |
[%- INCLUDE 'common/flash.html' %] |
|
4 | 6 |
|
5 |
[% #Dumper.dump_html(SELF.variant_property.property_values) %] |
|
6 | 7 |
<div class="wrapper"> |
7 | 8 |
<form method="post" action="controller.pl" id="form"> |
8 |
[%- INCLUDE 'common/flash.html' %]
|
|
9 |
[% P.hidden_tag("id", SELF.variant_property.id) %]
|
|
9 | 10 |
|
10 | 11 |
<table class="tbl-horizontal"> |
11 | 12 |
<caption> [% LxERP.t8("Variant Property") %] </caption> |
... | ... | |
23 | 24 |
<td> [%- 'Abbreviation' | $T8 %] </td> |
24 | 25 |
<td> [% P.input_tag("variant_property.abbreviation", SELF.variant_property.abbreviation, "data-validate"="required", "data-title"=LxERP.t8("Abbreviation")) %] </td> |
25 | 26 |
</tr> |
26 |
[% IF SELF.variant_property.id %] |
|
27 |
[% END %] |
|
28 | 27 |
</tbody> |
29 | 28 |
</table> |
30 | 29 |
|
31 |
|
|
32 | 30 |
<table class="tbl-horizontal"> |
33 | 31 |
<caption> [%- 'Translation' | $T8 %] </caption> |
34 | 32 |
<tbody> |
35 |
[%- FOREACH language = SELF.languages %]
|
|
33 |
[%- FOREACH language = SELF.languages %] |
|
36 | 34 |
<tr><th class="caption" colspan="2">[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</th></tr> |
37 | 35 |
<tr> |
38 | 36 |
<td> [%- 'Name' | $T8 %] </td> |
... | ... | |
48 | 46 |
</tr> |
49 | 47 |
<tr> |
50 | 48 |
<th> [% LxERP.t8("Texts for quotations & orders") %] </th> |
51 |
<td>
|
|
49 |
<td> |
|
52 | 50 |
<input type="text" name="translation_[% language.id %]" value="[%- HTML.escape(SELF.variant_property.translated_attribute('description_long', language, 1)) %]" size="60"> |
53 | 51 |
</td> |
54 | 52 |
</tr> |
55 | 53 |
<tr> |
56 | 54 |
<th> [% LxERP.t8("Texts for invoices") %] </th> |
57 |
<td>
|
|
55 |
<td> |
|
58 | 56 |
<input type="text" name="translation_invoice_[% language.id %]" value="[%- HTML.escape(SELF.variant_property.translated_attribute('description_long_invoice', language, 1)) %]" size="60"> |
59 | 57 |
</td> |
60 | 58 |
</tr> |
61 |
[%- END %]
|
|
59 |
[%- END %] |
|
62 | 60 |
</tbody> |
63 | 61 |
</table> |
64 |
[% P.hidden_tag("id", SELF.variant_property.id) %] |
|
65 |
|
|
66 |
|
|
67 | 62 |
</form> |
68 | 63 |
|
69 |
[% IF !SELF.variant_property.property_values.size %] |
|
70 |
<p> |
|
71 |
[%- 'No Variantpropertyvalues has been created yet.' | $T8 %] |
|
72 |
</p> |
|
73 |
[%- ELSE %] |
|
74 |
[% PROCESS "variant_property/variant_property_value_list.html" %] |
|
75 |
[% END %] |
|
64 |
[% IF SELF.variant_property.id %] |
|
65 |
[% PROCESS "variant_property/variant_property_value_list.html" %] |
|
66 |
[% END %] |
|
76 | 67 |
|
77 |
[% L.button_tag('kivi.VariantProperty.add_or_edit_variant_value(' _ SELF.variant_property.id _ ')', LxERP.t8("Add")) %] |
|
78 | 68 |
</div> |
templates/design40_webpages/variant_property/variant_property_list.html | ||
---|---|---|
9 | 9 |
<h1>[% title %]</h1> |
10 | 10 |
|
11 | 11 |
<div class="wrapper"> |
12 |
[% IF !VARIANTPROPERTIES.size %]
|
|
12 |
[% IF !VARIANTPROPERTIES.size %] |
|
13 | 13 |
<p> |
14 |
[%- 'No Variantproperty has been created yet.' | $T8 %]
|
|
14 |
[%- 'No Variantproperty has been created yet.' | $T8 %] |
|
15 | 15 |
</p> |
16 |
[%- ELSE %]
|
|
16 |
[%- ELSE %] |
|
17 | 17 |
<table id="variant_properties" class="tbl-list width-moderate"> |
18 | 18 |
<caption>[% 'Variant Properties' | $T8 %]</caption> |
19 | 19 |
<thead> |
20 |
<tr> |
|
20 | 21 |
<th><img src="image/updown.png" alt="[% LxERP.t8('reorder item') %]"></th> |
21 | 22 |
<th>[% 'Name' | $T8 %]</th> |
22 | 23 |
<th>[% 'Unique Name' | $T8 %]</th> |
... | ... | |
27 | 28 |
[% FOREACH variant_property = VARIANTPROPERTIES %] |
28 | 29 |
<tr id="variant_property_id_[% variant_property.id %]"> |
29 | 30 |
<td class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td> |
30 |
<td>[% L.link(SELF.url_for(action="edit_property", |
|
31 |
<td>[% L.link(SELF.url_for(action="edit_variant_property",
|
|
31 | 32 |
id=variant_property.id), variant_property.name) %]</td> |
32 | 33 |
<td>[% variant_property.unique_name | html %]</td> |
33 | 34 |
<td>[% variant_property.abbreviation | html %]</td> |
34 |
</tr>
|
|
35 |
</tr> |
|
35 | 36 |
[% END %] |
36 | 37 |
</tbody> |
37 | 38 |
</table> |
38 |
[%- END %]
|
|
39 |
[%- END %] |
|
39 | 40 |
</div> |
40 | 41 |
|
41 | 42 |
[% L.sortable_element('#variant_properties tbody', url => |
42 |
SELF.url_for(action='reorder_properties'), with => 'variant_property_id') %] |
|
43 |
|
|
43 |
SELF.url_for(action='reorder_variant_properties'), with => 'variant_property_id') %] |
templates/design40_webpages/variant_property/variant_property_value_form.html | ||
---|---|---|
1 | 1 |
[% USE HTML %][% USE T8 %][% USE L %][% USE LxERP %][%- USE P -%] |
2 | 2 |
[% USE Dumper %] |
3 | 3 |
<h1>[% FORM.title %]</h1> |
4 |
[%- INCLUDE 'common/flash.html' %]
|
|
4 |
[%- INCLUDE 'common/flash.html' %] |
|
5 | 5 |
|
6 | 6 |
<form id="variant_property_value_form"> |
7 |
[% P.hidden_tag("variant_property_id", SELF.variant_property.id) %] |
|
8 |
[% P.input_tag("h_variant_property_id", SELF.variant_property.id) %] |
|
9 |
Name:[% SELF.variant_property.name %] |
|
7 |
[% P.hidden_tag("variant_property_value.id", variant_property_value.id) %] |
|
10 | 8 |
<div class="wrapper"> |
11 | 9 |
<table class="tbl-horizontal"> |
12 | 10 |
<caption> [% LxERP.t8("Value") %] </caption> |
... | ... | |
14 | 12 |
<tbody> |
15 | 13 |
<tr> |
16 | 14 |
<td> [%- 'Value' | $T8 %] </td> |
17 |
<td> [% P.input_tag("variant_property_value.value", SELF.variant_property_value.value, "data-validate"="required", "data-title"=LxERP.t8("Value")) %] </td> |
|
15 |
<td> |
|
16 |
[% P.input_tag( |
|
17 |
"variant_property_value.value", |
|
18 |
variant_property_value.value, |
|
19 |
"data-validate"="required", |
|
20 |
"data-title"=LxERP.t8("Value") |
|
21 |
) %] |
|
22 |
</td> |
|
18 | 23 |
</tr> |
19 |
<tr>
|
|
24 |
<tr> |
|
20 | 25 |
<td> [%- 'Abbreviation' | $T8 %] </td> |
21 |
<td> [% P.input_tag("variant_property_value.abbreviation", SELF.variant_property_value.abbreviation, "data-validate"="required", "data-title"=LxERP.t8("Abbreviation")) %] </td> |
|
26 |
<td> |
|
27 |
[% P.input_tag( |
|
28 |
"variant_property_value.abbreviation", |
|
29 |
variant_property_value.abbreviation, |
|
30 |
"data-validate"="required", |
|
31 |
"data-title"=LxERP.t8("Abbreviation"), |
|
32 |
) %] |
|
33 |
</td> |
|
22 | 34 |
</tr> |
23 | 35 |
</tbody> |
24 | 36 |
</table> |
... | ... | |
28 | 40 |
<table class="tbl-horizontal"> |
29 | 41 |
<caption> [%- 'Translation' | $T8 %] </caption> |
30 | 42 |
<tbody> |
31 |
[%- FOREACH language = SELF.languages %]
|
|
43 |
[%- FOREACH language = SELF.languages %] |
|
32 | 44 |
<tr><th class="caption" colspan="2">[%- HTML.escape(language.description) %] ([%- LxERP.t8('Translation') %])</th></tr> |
33 | 45 |
<tr> |
34 | 46 |
<td> [%- 'Value' | $T8 %] </td> |
35 |
<input type="text" name="translation_[% language.id %]" value="[%- HTML.escape(SELF.variant_property_value.translated_attribute('description_long', language, 1)) %]" size="60">
|
|
36 |
<td> [% P.input_tag("variant_property_value.value", SELF.variant_property_value.value, "data-validate"="required", "data-title"=LxERP.t8("value")) %] </td>
|
|
47 |
<input type="text" name="translation_[% language.id %]" value="[%- HTML.escape(variant_property_value.translated_attribute('description_long', language, 1)) %]" size="60"> |
|
48 |
<td> [% P.input_tag("variant_property_value.value", variant_property_value.value, "data-validate"="required", "data-title"=LxERP.t8("value")) %] </td> |
|
37 | 49 |
</tr> |
38 | 50 |
<tr> |
39 | 51 |
<td> [%- 'Abbreviation' | $T8 %] </td> |
40 |
<input type="text" name="translation_invoice_[% language.id %]" value="[%- HTML.escape(SELF.variant_property_value.translated_attribute('description_long_invoice', language, 1)) %]" size="60">
|
|
41 |
<td> [% P.input_tag("variant_property_value.description", SELF.variant_property_value.description, "data-validate"="required", "data-title"=LxERP.t8("Description")) %] </td>
|
|
52 |
<input type="text" name="translation_invoice_[% language.id %]" value="[%- HTML.escape(variant_property_value.translated_attribute('description_long_invoice', language, 1)) %]" size="60"> |
|
53 |
<td> [% P.input_tag("variant_property_value.description", variant_property_value.description, "data-validate"="required", "data-title"=LxERP.t8("Description")) %] </td> |
|
42 | 54 |
</tr> |
43 |
[%- END %]
|
|
55 |
[%- END %] |
|
44 | 56 |
</tbody> |
45 | 57 |
</table> |
46 |
[% P.hidden_tag("variant_property_value_id", SELF.variant_property_value.id) %] |
|
47 | 58 |
</div> |
48 | 59 |
</form> |
49 | 60 |
|
50 | 61 |
<div class="buttons"> |
51 |
[% L.button_tag("kivi.VariantProperty.save_variant_value()", LxERP.t8("Save")) %] |
|
62 |
[% L.button_tag("kivi.VariantProperty.save_variant_property_value()", LxERP.t8("Save")) %]
|
|
52 | 63 |
</div> |
53 | 64 |
|
templates/design40_webpages/variant_property/variant_property_value_list.html | ||
---|---|---|
3 | 3 |
[% USE L %] |
4 | 4 |
[% USE LxERP %] |
5 | 5 |
|
6 |
|
|
7 | 6 |
<div class="wrapper"> |
8 |
|
|
7 |
<form id="variant_property_value_list_form"> |
|
8 |
[% L.hidden_tag("id", SELF.variant_property.id) %] |
|
9 | 9 |
<table class="tbl-list width-moderate" id="variant_property_values"> |
10 |
<caption>[% 'Value' | $T8 %]</caption> |
|
10 |
<caption>[% 'Values' | $T8 %]</caption>
|
|
11 | 11 |
<thead> |
12 | 12 |
<tr> |
13 | 13 |
<th><img src="image/updown.png" alt="[% LxERP.t8('reorder item') %]"></th> |
... | ... | |
16 | 16 |
</tr> |
17 | 17 |
</thead> |
18 | 18 |
<tbody> |
19 |
[% FOREACH value = SELF.variant_property.property_values %]
|
|
20 |
<tr id="variant_property_value_id_[% variant_property_value.id %]">
|
|
21 |
<td class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td>
|
|
22 |
<td><a href="#" onclick="kivi.VariantProperty.add_or_edit_variant_value('[% value.id %]');">[% value.value | html %]</a></td>
|
|
23 |
<td>[% value.abbreviation | html %]</td>
|
|
24 |
</tr>
|
|
19 |
[% FOREACH value = SELF.variant_property.property_values_sorted %]
|
|
20 |
<tr id="variant_property_value_id_[% value.id %]">
|
|
21 |
<td class="dragdrop"><img src="image/updown.png" alt="[ LxERP.t8('reorder item') %]"></td> |
|
22 |
<td><a href="#" onclick="kivi.VariantProperty.edit_variant_property_value('[% value.id %]');">[% value.value | html %]</a></td>
|
|
23 |
<td>[% value.abbreviation | html %]</td> |
|
24 |
</tr> |
|
25 | 25 |
[% END %] |
26 | 26 |
</tbody> |
27 |
<tfoot> |
|
28 |
<tr> |
|
29 |
<td> |
|
30 |
[% L.button_tag( |
|
31 |
'kivi.VariantProperty.add_variant_property_value()', |
|
32 |
LxERP.t8("Add counted") |
|
33 |
) %] |
|
34 |
</td> |
|
35 |
<td> |
|
36 |
[% L.input_tag( |
|
37 |
"new_variant_property_value.value", |
|
38 |
'', |
|
39 |
class="wi-small", |
|
40 |
) %] |
|
41 |
</td> |
|
42 |
<td> |
|
43 |
[% L.input_tag( |
|
44 |
"new_variant_property_value.abbreviation", |
|
45 |
'', |
|
46 |
class="wi-small", |
|
47 |
) %] |
|
48 |
</td> |
|
49 |
</tr> |
|
50 |
</tfoot> |
|
27 | 51 |
</table> |
52 |
</form> |
|
28 | 53 |
</div> |
29 | 54 |
|
30 | 55 |
[% L.sortable_element('#variant_property_values tbody', url => |
31 | 56 |
SELF.url_for(action='reorder_variant_property_values'), with => 'variant_property_value_id') %] |
57 |
|
Auch abrufbar als: Unified diff
Varianten: Bearbeiten von Varianten Eigenschaften und Ausprägungen