Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 15682dc4

Von Moritz Bunkus vor fast 18 Jahren hinzugefügt

  • ID 15682dc47316fcc2deab66730045cd38afec001f
  • Vorgänger f27a8a8f
  • Nachfolger 8e206587

Drop-Down-Auswahlboxen für Ansprechpartner und Lieferadresse bei jedem Maskenaufbau aus der Datenbank aufbauen. Für den HTML-Code wird jetzt das CGI-Modul verwendet.

Unterschiede anzeigen:

bin/mozilla/ir.pl
219 219
  $lxdebug->enter_sub();
220 220

  
221 221
  # set option selected
222
  foreach $item (qw(AP vendor currency department contact)) {
222
  foreach $item (qw(AP vendor currency department)) {
223 223
    $form->{"select$item"} =~ s/ selected//;
224 224
    $form->{"select$item"} =~
225 225
      s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
......
239 239
  $form->{creditremaining} =
240 240
    $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
241 241

  
242
  #build contacts
243
  if ($form->{all_contacts}) {
244

  
245
    $form->{selectcontact} = "";
246
    foreach $item (@{ $form->{all_contacts} }) {
247
      if ($form->{cp_id} == $item->{cp_id}) {
248
        $form->{selectcontact} .=
249
          "<option selected>$item->{cp_name}--$item->{cp_id}";
250
      } else {
251
        $form->{selectcontact} .= "<option>$item->{cp_name}--$item->{cp_id}";
252
      }
253
    }
254
  }
255

  
256 242
  $exchangerate = "";
257 243
  if ($form->{currency} ne $form->{defaultcurrency}) {
258 244
    if ($form->{forex}) {
......
273 259
<input type=hidden name=forex value=$form->{forex}>
274 260
|;
275 261

  
262
  $form->get_lists("contacts" => "ALL_CONTACTS");
263

  
264
  my (%labels, @values);
265
  foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
266
    push(@values, $item->{"cp_id"});
267
    $labels{$item->{"cp_id"}} = $item->{"cp_name"} .
268
      ($item->{"cp_abteilung"} ? " ($item->{cp_abteilung})" : "");
269
  }
270
  my $contact =
271
    $cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
272
                     '-labels' => \%labels, '-default' => $form->{"cp_id"});
276 273

  
277 274
  if (@{ $form->{TAXZONE} }) {
278 275
    $form->{selecttaxzone} = "";
......
308 305
    ? qq|<select name=vendor>$form->{selectvendor}</select>\n<input type=hidden name="selectvendor" value="$form->{selectvendor}">|
309 306
    : qq|<input name=vendor value="$form->{vendor}" size=35>|;
310 307

  
311
  $contact =
312
    ($form->{selectcontact})
313
    ? qq|<select name=contact>$form->{selectcontact}</select>\n<input type=hidden name="selectcontact" value="$form->{selectcontact}">|
314
    : qq|<input name=contact value="$form->{contact}" size=35>|;
315

  
316 308
  $department = qq|
317 309
              <tr>
318 310
	      <th align="right" nowrap>| . $locale->text('Department') . qq|</th>

Auch abrufbar als: Unified diff