Revision 1163cee7
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/CVar.pm | ||
---|---|---|
438 | 438 |
|
439 | 439 |
my $f_op = $params{filter}->{"${name}_qtyop"}; |
440 | 440 |
|
441 |
my $op; |
|
441 | 442 |
if ($f_op eq '==') { |
442 | 443 |
$op = '='; |
443 | 444 |
|
... | ... | |
515 | 516 |
return; |
516 | 517 |
} |
517 | 518 |
|
519 |
# allow sub_module to be a coderef or a fixed value |
|
520 |
if (ref $params{sub_module} ne 'CODE') { |
|
521 |
$params{sub_module} = sub { "$params{sub_module}" }; |
|
522 |
} |
|
523 |
|
|
518 | 524 |
my %cfg_map = map { $_->{id} => $_ } @{ $configs }; |
519 | 525 |
my @cfg_ids = keys %cfg_map; |
520 | 526 |
|
... | ... | |
527 | 533 |
my $sth = prepare_query($form, $dbh, $query); |
528 | 534 |
|
529 | 535 |
foreach my $row (@{ $params{data} }) { |
530 |
do_statement($form, $sth, $query, @cfg_ids, conv_i($row->{$params{trans_id_field}}), "$params{sub_module}");
|
|
536 |
do_statement($form, $sth, $query, @cfg_ids, conv_i($row->{$params{trans_id_field}}), $params{sub_module}->($row));
|
|
531 | 537 |
|
532 | 538 |
while (my $ref = $sth->fetchrow_hashref()) { |
533 | 539 |
my $cfg = $cfg_map{$ref->{config_id}}; |
... | ... | |
535 | 541 |
$row->{"cvar_$cfg->{name}"} = |
536 | 542 |
$cfg->{type} eq 'date' ? $ref->{date_value} |
537 | 543 |
: $cfg->{type} eq 'timestamp' ? $ref->{timestamp_value} |
538 |
: $cfg->{type} eq 'number' ? $form->format_amount($myconfig, $ref->{number_value} * 1, $config->{precision})
|
|
544 |
: $cfg->{type} eq 'number' ? $form->format_amount($myconfig, $ref->{number_value} * 1, $cfg->{precision})
|
|
539 | 545 |
: $cfg->{type} eq 'bool' ? ($ref->{bool_value} ? $locale->text('Yes') : $locale->text('No')) |
540 | 546 |
: $ref->{text_value}; |
541 | 547 |
} |
Auch abrufbar als: Unified diff
Warensuche: überlagerte custom variables werden nun korrekt auch in der Warensuche überlagert.