Revision 36703a86
Von Bernd Blessmann vor etwa 10 Jahren hinzugefügt
SL/Controller/CustomVariableConfig.pm | ||
---|---|---|
8 | 8 |
|
9 | 9 |
use SL::DB::CustomVariableConfig; |
10 | 10 |
use SL::DB::CustomVariableValidity; |
11 |
use SL::DB::PartsGroup; |
|
11 | 12 |
use SL::Helper::Flash; |
12 | 13 |
use SL::Locale::String; |
13 | 14 |
use Data::Dumper; |
... | ... | |
66 | 67 |
split m/:/, ($self->config->flags || '') |
67 | 68 |
}); |
68 | 69 |
|
70 |
$params{all_partsgroups} = SL::DB::Manager::PartsGroup->get_all(); |
|
71 |
|
|
72 |
$::request->layout->use_javascript("${_}.js") for qw(jquery.selectboxes jquery.multiselect2side); |
|
69 | 73 |
$self->render('custom_variable_config/form', %params); |
70 | 74 |
} |
71 | 75 |
|
... | ... | |
90 | 94 |
sub action_destroy { |
91 | 95 |
my ($self) = @_; |
92 | 96 |
|
97 |
# delete relationship to partsgroups (for filter) before cvar can be deleted |
|
98 |
$self->config->update_attributes(partsgroups => []); |
|
99 |
|
|
93 | 100 |
if (eval { $self->config->delete; 1; }) { |
94 | 101 |
flash_later('info', t8('The custom variable has been deleted.')); |
95 | 102 |
} else { |
... | ... | |
166 | 173 |
my $params = delete($::form->{config}) || { }; |
167 | 174 |
delete $params->{id}; |
168 | 175 |
|
176 |
if ($self->module eq 'IC') { |
|
177 |
$params->{partsgroups} = [] if !$params->{flag_partsgroup_filter}; |
|
178 |
} else { |
|
179 |
delete $params->{flag_partsgroup_filter}; |
|
180 |
$params->{partsgroups} = []; |
|
181 |
} |
|
182 |
|
|
183 |
$params->{partsgroups} ||= []; # The list is empty, if control is not send by the browser. |
|
169 | 184 |
$params->{default_value} = $::form->parse_amount(\%::myconfig, $params->{default_value}) if $params->{type} eq 'number'; |
170 | 185 |
$params->{included_by_default} = 0 if !$params->{includeable}; |
171 | 186 |
$params->{flags} = join ':', map { m/^flag_(.*)/; "${1}=" . delete($params->{$_}) } grep { m/^flag_/ } keys %{ $params }; |
Auch abrufbar als: Unified diff
Warengruppen-Filter f. CVars bei Waren
cherry-pick aus Kundenprojekt und Anpassungen an unstable (hauptsächlich
Umstellung auf Controller)
Conflicts: