Revision 36703a86
Von Bernd Blessmann vor etwa 10 Jahren hinzugefügt
bin/mozilla/io.pl | ||
---|---|---|
1861 | 1861 |
|
1862 | 1862 |
my $valid = CVar->custom_variables_validity_by_trans_id(trans_id => $params{part_id}); |
1863 | 1863 |
|
1864 |
# get partsgroup_id from part |
|
1865 |
my $partsgroup_id; |
|
1866 |
if ($params{part_id}) { |
|
1867 |
$partsgroup_id = SL::DB::Part->new(id => $params{part_id})->load->partsgroup_id; |
|
1868 |
} |
|
1869 |
|
|
1864 | 1870 |
my $num_visible_cvars = 0; |
1865 | 1871 |
foreach my $cvar (@{ $form->{CVAR_CONFIGS}->{IC} }) { |
1866 | 1872 |
$cvar->{valid} = $params{part_id} && $valid->($cvar->{id}); |
1867 | 1873 |
|
1874 |
# set partsgroup filter |
|
1875 |
my $partsgroup_filtered = 0; |
|
1876 |
if ($cvar->{flag_partsgroup_filter}) { |
|
1877 |
if (!$partsgroup_id || (!grep {$partsgroup_id == $_} @{ $cvar->{partsgroups} })) { |
|
1878 |
$partsgroup_filtered = 1; |
|
1879 |
} |
|
1880 |
} |
|
1881 |
|
|
1868 | 1882 |
my $show = 0; |
1869 | 1883 |
my $description = ''; |
1870 |
if ($cvar->{flag_editable} && $cvar->{valid}) {
|
|
1884 |
if (($cvar->{flag_editable} && $cvar->{valid}) && !$partsgroup_filtered) {
|
|
1871 | 1885 |
$num_visible_cvars++; |
1872 | 1886 |
$description = $cvar->{description} . ' '; |
1873 | 1887 |
$show = 1; |
... | ... | |
1886 | 1900 |
name_postfix => "_$params{row}", |
1887 | 1901 |
valid => $cvar->{valid}, |
1888 | 1902 |
value => CVar->parse($::form->{$form_key}, $cvar), |
1903 |
partsgroup_filtered => $partsgroup_filtered, |
|
1889 | 1904 |
} |
1890 | 1905 |
}; |
1891 | 1906 |
} |
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: