115 |
115 |
$::lxdebug->enter_sub;
|
116 |
116 |
$::auth->assert('customer_vendor_edit');
|
117 |
117 |
|
118 |
|
$::form->{fokus} = 'Form.name';
|
|
118 |
|
|
119 |
$::form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'Contacts');
|
|
120 |
($::form->{CUSTOM_VARIABLES_FILTER_CODE},
|
|
121 |
$::form->{CUSTOM_VARIABLES_INCLUSION_CODE}) = CVar->render_search_options('variables' => $::form->{CUSTOM_VARIABLES},
|
|
122 |
'include_prefix' => 'l.',
|
|
123 |
'filter_prefix' => 'filter.',
|
|
124 |
'include_value' => 'Y');
|
119 |
125 |
|
120 |
126 |
$::form->header;
|
121 |
127 |
print $::form->parse_html_template('ct/search_contact');
|
... | ... | |
292 |
298 |
filter => $::form->{filter},
|
293 |
299 |
);
|
294 |
300 |
|
|
301 |
my $cvar_configs = CVar->get_configs('module' => 'Contacts');
|
|
302 |
|
295 |
303 |
my @columns = qw(
|
296 |
304 |
cp_id vcname vcnumber cp_name cp_givenname cp_street cp_phone1 cp_phone2
|
297 |
305 |
cp_mobile1 cp_mobile2 cp_email cp_abteilung cp_birthday cp_gender
|
298 |
306 |
);
|
299 |
307 |
|
|
308 |
my @includeable_custom_variables = grep { $_->{includeable} } @{ $cvar_configs };
|
|
309 |
my @searchable_custom_variables = grep { $_->{searchable} } @{ $cvar_configs };
|
|
310 |
my %column_defs_cvars = map { +"cvar_$_->{name}" => { 'text' => $_->{description} } } @includeable_custom_variables;
|
|
311 |
|
|
312 |
push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables;
|
|
313 |
|
300 |
314 |
my @visible_columns;
|
301 |
315 |
if ($::form->{l}) {
|
302 |
316 |
@visible_columns = grep { $::form->{l}{$_} } @columns;
|
... | ... | |
321 |
335 |
'cp_abteilung' => { 'text' => $::locale->text('Department'), },
|
322 |
336 |
'cp_birthday' => { 'text' => $::locale->text('Birthday'), },
|
323 |
337 |
'cp_gender' => { 'text' => $::locale->text('Gender'), },
|
|
338 |
%column_defs_cvars,
|
324 |
339 |
);
|
325 |
340 |
|
326 |
341 |
map { $column_defs{$_}->{visible} = 1 } @visible_columns;
|
... | ... | |
365 |
380 |
|
366 |
381 |
$report->set_sort_indicator($::form->{sort}, $::form->{sortdir});
|
367 |
382 |
|
|
383 |
CVar->add_custom_variables_to_report('module' => 'Contacts',
|
|
384 |
'trans_id_field' => 'cp_id',
|
|
385 |
'configs' => $cvar_configs,
|
|
386 |
'column_defs' => \%column_defs,
|
|
387 |
'data' => \@contacts);
|
|
388 |
|
|
389 |
|
368 |
390 |
foreach my $ref (@contacts) {
|
369 |
391 |
my $row = { map { $_ => { 'data' => $ref->{$_} } } @columns };
|
370 |
392 |
|
CVars in der Ansprechpartnersuche