Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 4f6a2fa1

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

CVars in Ansprechpartnern.

Unterschiede anzeigen:

SL/CT.pm
448 448
                              'trans_id'  => $form->{id},
449 449
                              'variables' => $form,
450 450
                              'always_valid' => 1);
451
  CVar->save_custom_variables('dbh'       => $dbh,
452
                              'module'    => 'Contacts',
453
                              'trans_id'  => $form->{cp_id},
454
                              'variables' => $form,
455
                              'name_prefix'  => 'cp',
456
                              'always_valid' => 1);
451 457

  
452 458
  my $rc = $dbh->commit();
453 459

  
......
657 663
                              'trans_id'  => $form->{id},
658 664
                              'variables' => $form,
659 665
                              'always_valid' => 1);
666
  CVar->save_custom_variables('dbh'       => $dbh,
667
                              'module'    => 'Contacts',
668
                              'trans_id'  => $form->{cp_id},
669
                              'variables' => $form,
670
                              'name_prefix'  => 'cp',
671
                              'always_valid' => 1);
660 672

  
661 673
  my $rc = $dbh->commit();
662 674

  
bin/mozilla/amcvar.pl
60 60
our @types = qw(text textfield number date bool select customer); # timestamp
61 61

  
62 62
our @modules = ({ module => 'CT',       description => $locale->text('Customers and vendors')          },
63
                { module => 'Contacts', description => $locale->text('Contact persons')                },
63 64
                { module => 'IC',       description => $locale->text('Parts, services and assemblies') },
64 65
                { module => 'Projects', description => $locale->text('Projects')                       },
65 66
               );
bin/mozilla/ct.pl
353 353
    $form->{currency} = $form->{curr};
354 354
  }
355 355

  
356
  $form->{CUSTOM_VARIABLES} = CVar->get_custom_variables('module' => 'CT', 'trans_id' => $form->{id});
356
  $::form->{CUSTOM_VARIABLES} = { };
357
  my %specs = ( CT       => { field => 'id',    name_prefix => '',   },
358
                Contacts => { field => 'cp_id', name_prefix => 'cp', },
359
              );
357 360

  
358
  CVar->render_inputs('variables' => $form->{CUSTOM_VARIABLES}) if (scalar @{ $form->{CUSTOM_VARIABLES} });
361
  for my $module (keys %specs) {
362
    my $spec = $specs{$module};
363

  
364
    $::form->{CUSTOM_VARIABLES}->{$module} = CVar->get_custom_variables(module => $module, trans_id => $::form->{ $spec->{field} });
365
    CVar->render_inputs(variables => $::form->{CUSTOM_VARIABLES}->{$module}, name_prefix => $spec->{name_prefix})
366
      if scalar @{ $::form->{CUSTOM_VARIABLES}->{$module} };
367
  }
359 368

  
360 369
  $form->header;
361 370
  print $form->parse_html_template('ct/form_header');
......
672 681
  CT->query_titles_and_greetings(\%::myconfig, $::form);
673 682
  CT->get_contact(\%::myconfig, $::form) if $::form->{cp_id};
674 683

  
684
  $::form->{CUSTOM_VARIABLES}{Contacts} = CVar->get_custom_variables(module => 'Contacts', trans_id => $::form->{cp_id});
685
  CVar->render_inputs(variables => $::form->{CUSTOM_VARIABLES}{Contacts}, name_prefix => 'cp')
686
    if scalar @{ $::form->{CUSTOM_VARIABLES}->{Contacts} };
687

  
675 688
  $::form->{contacts_label} = \&_contacts_label;
676 689

  
677 690
  print $::form->ajax_response_header(), $::form->parse_html_template('ct/_contact');
locale/de/all
422 422
  'Contact deleted.'            => 'Ansprechpartner gelöscht.',
423 423
  'Contact is in use and was flagged invalid.' => 'Ansprechpartner ist noch in Verwendung, und wurde als ungültig markiert.',
424 424
  'Contact person (surname)'    => 'Ansprechpartner (Nachname)',
425
  'Contact persons'             => 'Ansprechpartner',
425 426
  'Contacts'                    => 'Ansprechpartner',
426 427
  'Continue'                    => 'Weiter',
427 428
  'Contra'                      => 'gegen',
templates/webpages/ct/_contact.html
114 114
      <th align="left" nowrap>[% 'Bcc' | $T8 %]</th>
115 115
      <td><input name="bcc" size="40" value="[% HTML.escape(bcc) %]"></td>
116 116
     </tr>
117
     [% IF CUSTOM_VARIABLES.Contacts.size %]
118
     <tr>
119
      <td colspan="2"><hr></td>
120
     </tr>
121

  
122
     [%- FOREACH var = CUSTOM_VARIABLES.Contacts %]
123
     <tr>
124
      <th align="left" valign="top" nowrap>[% HTML.escape(var.description) %]</th>
125
      <td valign="top">[% var.HTML_CODE %]</td>
126
     </tr>
127
     [%- END %]
128
     [%- END %]
129

  
117 130
    </table>
118 131

  
119 132
[% IF cp_id %]
templates/webpages/ct/form_header.html
17 17
   <li><a href="#" rel="deliveries">[% 'Supplies' | $T8 %]</a></li>
18 18
[%- END %]
19 19
   <li><a href="#" rel="vcnotes">[% 'Notes' | $T8 %]</a></li>
20
   [%- IF CUSTOM_VARIABLES.size %]
20
   [%- IF CUSTOM_VARIABLES.CT.size %]
21 21
   <li><a href="#" rel="custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
22 22
   [%- END %]
23 23
  </ul>
......
413 413
    <br style="clear: left" />
414 414
   </div>
415 415

  
416
   [%- IF CUSTOM_VARIABLES.size %]
416
   [%- IF CUSTOM_VARIABLES.CT.size %]
417 417
   <div id="custom_variables" class="tabcontent">
418 418

  
419 419
    <p>
420 420
     <table>
421
      [%- FOREACH var = CUSTOM_VARIABLES %]
421
      [%- FOREACH var = CUSTOM_VARIABLES.CT %]
422 422
      <tr>
423 423
       <td align="right" valign="top">[% HTML.escape(var.description) %]</td>
424 424
       <td valign="top">[% var.HTML_CODE %]</td>

Auch abrufbar als: Unified diff