Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision cc78d935

Von Sven Schöling vor mehr als 12 Jahren hinzugefügt

  • ID cc78d935992bbc0ec17fe2e0452dea36248d8ba8
  • Vorgänger c4713436
  • Nachfolger 1bc51655

CVars in der Ansprechpartnersuche

Unterschiede anzeigen:

SL/CT.pm
1254 1254
    push @where_tokens, map { "($_)" } join ' OR ', @tokens;
1255 1255
  }
1256 1256

  
1257
  my ($cvar_where, @cvar_values) = CVar->build_filter_query('module'         => 'Contacts',
1258
                                                            'trans_id_field' => 'cp.cp_id',
1259
                                                            'filter'         => $params{filter});
1260

  
1261
  if ($cvar_where) {
1262
    push @where_tokens, $cvar_where;
1263
    push @values, @cvar_values;
1264
  }
1265

  
1257 1266
  if (my $filter = $params{filter}) {
1258 1267
    for (qw(name title givenname email project abteilung)) {
1259 1268
      next unless $filter->{"cp_$_"};
bin/mozilla/ct.pl
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

  
templates/webpages/ct/search_contact.html
34 34
    <td><input name="filter.cp_project" size="35"></td>
35 35
   </tr>
36 36

  
37
   [% CUSTOM_VARIABLES_FILTER_CODE %]
38

  
37 39
   <tr>
38 40
    <td></td>
39 41
    <td>

Auch abrufbar als: Unified diff