Revision b2f44e3d
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
SL/IC.pm | ||
---|---|---|
38 | 38 |
use List::MoreUtils qw(all); |
39 | 39 |
use YAML; |
40 | 40 |
|
41 |
use SL::CVar; |
|
41 | 42 |
use SL::DBUtils; |
42 | 43 |
|
43 | 44 |
sub get_part { |
... | ... | |
565 | 566 |
} |
566 | 567 |
} |
567 | 568 |
|
569 |
CVar->save_custom_variables('dbh' => $dbh, |
|
570 |
'module' => 'IC', |
|
571 |
'trans_id' => $form->{id}, |
|
572 |
'variables' => $form); |
|
573 |
|
|
568 | 574 |
# commit |
569 | 575 |
my $rc = $dbh->commit; |
570 | 576 |
$dbh->disconnect; |
... | ... | |
957 | 963 |
my $where_clause = join ' AND ', map { "($_)" } @where_tokens; |
958 | 964 |
my $group_clause = ' GROUP BY ' . join ', ', map { ($table_prefix{$_} || "p.") . $_ } @group_tokens if scalar @group_tokens; |
959 | 965 |
|
966 |
my ($cvar_where, @cvar_values) = CVar->build_filter_query('module' => 'IC', |
|
967 |
'trans_id_field' => 'p.id', |
|
968 |
'filter' => $form); |
|
969 |
|
|
970 |
if ($cvar_where) { |
|
971 |
$where_clause .= qq| AND ($cvar_where)|; |
|
972 |
push @bind_vars, @cvar_values; |
|
973 |
} |
|
974 |
|
|
960 | 975 |
my $query = qq|SELECT DISTINCT $select_clause FROM parts p $join_clause WHERE $where_clause $group_clause $order_clause $limit_clause|; |
961 | 976 |
|
962 | 977 |
$form->{parts} = selectall_hashref_query($form, $dbh, $query, @bind_vars); |
Auch abrufbar als: Unified diff
Das Definieren, Erstellen und Bearbeiten von benutzerdefinierten Variablen bei Waren, Dienstleistungen und Erzeugnissen implementiert.