Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 2fda509c

Von Thomas Kasulke vor mehr als 17 Jahren hinzugefügt

  • ID 2fda509c7dc417aad28ed072e91e8ffe2396314d
  • Vorgänger 6b76ebb4
  • Nachfolger bd34eaea

Lieferanten-/Kundenauswahlmenu angepasst, so dass nicht immer die komplette Auswahlliste mitgeschleppt werden muss.

Unterschiede anzeigen:

bin/mozilla/oe.pl
269 269

  
270 270
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
271 271

  
272
  # sales staff
273
  if (@{ $form->{all_employees} }) {
274
    $form->{selectemployee} = "";
275
    map { $form->{selectemployee} .= "<option>$_->{name}--$_->{id}</option>\n" }
276
      (@{ $form->{all_employees} });
277
  }
278

  
279 272
  # forex
280 273
  $form->{forex} = $form->{exchangerate};
281 274

  
......
372 365

  
373 366
    # without JavaScript Calendar
374 367
    $button1 = qq|
375
                              <td><input name=transdate id=transdate size=11 title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>|;
368
                              <td><input name="transdate" id="transdate" size="11" title="$myconfig{dateformat}" value="$form->{transdate}" onBlur=\"check_right_date_format(this)\"></td>|;
376 369
    $button2 = qq|
377
                              <td width="13"><input name=reqdate id=reqdate size=11 title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>|;
370
                              <td width="13"><input name="reqdate" id="reqdate" size="11" title="$myconfig{dateformat}" value="$form->{reqdate}" onBlur=\"check_right_date_format(this)\"></td>|;
378 371
  }
379 372

  
380 373
  my @tmp;
......
402 395
  }
403 396

  
404 397
  # set option selected
405
  foreach $item ($form->{vc}, currency, department, employee) {
398
  foreach $item ($form->{vc}, currency, department, employee, ($form->{vc} eq "customer" ? customer : vendor)) {
406 399
    $form->{"select$item"} =~ s/ selected//;
407 400
    $form->{"select$item"} =~
408 401
      s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
......
426 419
                   "employees" => "ALL_SALESMEN",
427 420
                   "taxzones" => "ALL_TAXZONES",
428 421
                   "currencies" => "ALL_CURRENCIES");
429

  
422
                  ($form->{vc} eq "customer" 
423
                      ? $form->get_lists("customers" => "ALL_CUSTOMERS") 
424
                      : $form->get_lists("vendors" => "ALL_VENDORS"));
425
  
430 426
  my %labels;
431 427
  my @values = (undef);
432 428
  foreach my $item (@{ $form->{"ALL_CONTACTS"} }) {
......
438 434
    NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
439 435
                         '-labels' => \%labels, '-default' => $form->{"cp_id"}));
440 436

  
437
  %labels = ();
438
  @values = ();
439

  
440
  foreach my $item (@{ $form->{($form->{vc} eq "customer" ? "ALL_CUSTOMERS" : "ALL_VENDORS")}}) {
441
    push(@values, $item->{name}.qq|--|.$item->{"id"});
442
    $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
443
  }
444

  
445
  my $vc = qq|
446
      <th align="right">| . $locale->text(ucfirst($form->{vc})) . qq|</th>
447
      <td>| . 
448
        (($myconfig{vclimit} == 1 ) 
449
              ? qq|<input type="text" value="$form->{old$form->{vc}}" name="$form->{vc}">| 
450
              : (NTI($cgi->popup_menu('-name' => "$form->{vc}", '-default' => $form->{"old$form->{vc}"}, 
451
                             '-onChange' => 'document.getElementById(\'update_button\').click();',
452
                             '-values' => \@values, '-labels' => \%labels)))) . qq|
453
      </td><input type=hidden name="select$form->{vc}" value="| .
454
    Q($form->{"select$form->{vc}"}) . qq|">|;
455

  
441 456
  %labels = ();
442 457
  @values = ("");
443 458
  foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
......
483 498
         </tr>|;
484 499
  }
485 500

  
501
  %labels = ();
502
  @values = ();
503
  foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
504
    push(@values, $item->{"id"});
505
    $labels{$item->{"id"}} = $item->{"name"};
506
  }
507

  
508
  my $employees = qq|
509
    <tr>
510
      <th align="right">| . $locale->text('Employee') . qq|</th>
511
      <td>| .
512
        NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee"},
513
                             '-values' => \@values, '-labels' => \%labels)) . qq|
514
      </td>
515
    </tr>|;
486 516

  
487 517
  %labels = ();
488 518
  @values = ();
......
553 583
    }
554 584
  }
555 585

  
556
  $vclabel = ucfirst $form->{vc};
557
  $vclabel = $locale->text($vclabel);
558

  
559

  
560

  
561 586
  if ($form->{business}) {
562 587
    $business = qq|
563 588
	      <tr>
......
677 702
                          </tr>|;
678 703
  }
679 704

  
680
  $vc =
681
    ($form->{"select$form->{vc}"})
682
    ? qq|<select name="$form->{vc}"
683
onchange="document.getElementById('update_button').click();">| .
684
    qq|$form->{"select$form->{vc}"}</select>\n<input type=hidden name="select$form->{vc}" value="| .
685
    Q($form->{"select$form->{vc}"}) . qq|">|
686
    : qq|<input name=$form->{vc} value="$form->{$form->{vc}}" size=35>|;
687

  
688 705
  $department = qq|
689 706
              <tr>
690 707
	        <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
691 708
		<td colspan=3><select name=department>$form->{selectdepartment}</select>
692 709
		<input type=hidden name=selectdepartment value="$form->{selectdepartment}">
693 710
		</td>
694
	      </tr>
695
| if $form->{selectdepartment};
696

  
697
  $employee = qq|
698
              <input type=hidden name=employee value="$form->{employee}">
699
|;
711
	      </tr> | if $form->{selectdepartment};
700 712

  
701 713
  if ($form->{type} eq 'sales_order') {
702 714
    if ($form->{selectemployee}) {
703 715
      $employee = qq|
704 716
    <input type=hidden name=customer_klass value=$form->{customer_klass}>
705
 	      <tr>
706
	        <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
707
		<td colspan=2><select name=employee>$form->{selectemployee}</select></td>
708
		<input type=hidden name=selectemployee value="$form->{selectemployee}">
709
                <td></td>
710
	      </tr>
717
        $employees
711 718
|;
712 719
    }
713 720
  } else {
714 721
    $employee = qq|
715 722
    <input type=hidden name=customer_klass value=$form->{customer_klass}>
716
 	      <tr>
717
	        <th align=right nowrap>| . $locale->text('Employee') . qq|</th>
718
		<td colspan=2><select name=employee>$form->{selectemployee}</select></td>
719
		<input type=hidden name=selectemployee value="$form->{selectemployee}">
720
                <td></td>
721
	      </tr>
723
        $employees
722 724
|;
723 725
  }
724 726
  if ($form->{resubmit} && ($form->{format} eq "html")) {
......
790 792
	  <td>
791 793
	    <table width=100%>
792 794
	      <tr>
793
		<th align=right>$vclabel</th>
794
		<td colspan=3>$vc</td>
795
		<input type=hidden name=$form->{vc}_id value=$form->{"$form->{vc}_id"}>
796
		<input type=hidden name="old$form->{vc}" value="$form->{"old$form->{vc}"}">
795
        $vc
797 796
                <th align=richt nowrap>|
798 797
    . $locale->text('Contact Person') . qq|</th>
799 798
                <td colspan=3>$contact</td>
......
1354 1353
  $form->all_vc(\%myconfig, $form->{vc},
1355 1354
                ($form->{vc} eq 'customer') ? "AR" : "AP");
1356 1355

  
1357
  map { $vc .= "<option>$_->{name}--$_->{id}</option>\n" }
1358
    @{ $form->{"all_$form->{vc}"} };
1359

  
1360
  $vclabel = ucfirst $form->{vc};
1361
  $vclabel = $locale->text($vclabel);
1362

  
1363
  # $locale->text('Vendor')
1364
  # $locale->text('Customer')
1365

  
1366
  $vc =
1367
    ($vc)
1368
    ? qq|<select name=$form->{vc}><option>\n$vc</option></select>|
1369
    : qq|<input name=$form->{vc} size=35>|;
1370

  
1371 1356
  # departments
1372 1357
  if (@{ $form->{all_departments} }) {
1373 1358
    $form->{selectdepartment} = "<option>\n";
......
1457 1442
    <td>
1458 1443
      <table>
1459 1444
        <tr>
1460
          <th align=right>$vclabel</th>
1461
          <td colspan="3">$vc</td>
1445
          $vc
1462 1446
        </tr>
1463 1447
	$department
1464 1448
        <tr>
......
1501 1485
    . $locale->text('Required by') . qq|</td>
1502 1486
	      </tr>
1503 1487
	      <tr>
1504
	        <td><input name="l_name" class=checkbox type=checkbox value=Y checked> $vclabel</td>
1488
	        <td><input name="l_name" class=checkbox type=checkbox value=Y checked> ucfirst($form->{vc})</td>
1505 1489
	        <td><input name="l_employee" class=checkbox type=checkbox value=Y checked> $employee</td>
1506 1490
		<td><input name="l_shipvia" class=checkbox type=checkbox value=Y> |
1507 1491
    . $locale->text('Ship via') . qq|</td>

Auch abrufbar als: Unified diff