Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 40662c08

Von Thomas Kasulke vor mehr als 17 Jahren hinzugefügt

  • ID 40662c08e22db199189b147a3a05446f5e4ddf24
  • Vorgänger c275df95
  • Nachfolger ccc290ef

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

Unterschiede anzeigen:

bin/mozilla/is.pl
170 170
  $form->{oldcustomer} = "$form->{customer}--$form->{customer_id}";
171 171

  
172 172
  if (@{ $form->{all_customer} }) {
173
    $form->{customer} = "$form->{customer}--$form->{customer_id}";
174
    map { $form->{selectcustomer} .= "<option>$_->{name}--$_->{id}</option>\n" }
175
      (@{ $form->{all_customer} });
173
     $form->{customer} = "$form->{customer}--$form->{customer_id}";
174
     $form->{selectcustomer} = "$form->{customer}--$form->{customer_id}";
176 175
  }
177 176

  
178 177
  # departments
......
188 187

  
189 188
  $form->{employee} = "$form->{employee}--$form->{employee_id}";
190 189

  
191
  # sales staff
192
  if ($form->{all_employees}) {
193
    $form->{selectemployee} = "";
194
    map { $form->{selectemployee} .= "<option>$_->{name}--$_->{id}</option>\n" }
195
      (@{ $form->{all_employees} });
196
  }
197

  
198 190
  # forex
199 191
  $form->{forex} = $form->{exchangerate};
200 192
  $exchangerate = ($form->{exchangerate}) ? $form->{exchangerate} : 1;
......
338 330
                                   "old_id" => \@old_project_ids },
339 331
                   "employees" => "ALL_SALESMEN",
340 332
                   "taxzones" => "ALL_TAXZONES",
341
                   "currencies" => "ALL_CURRENCIES");
333
                   "currencies" => "ALL_CURRENCIES",
334
                   "customers" => "ALL_CUSTOMERS");
342 335

  
343 336
  my %labels;
344 337
  my @values = (undef);
......
351 344
    NTI($cgi->popup_menu('-name' => 'cp_id', '-values' => \@values,
352 345
                         '-labels' => \%labels, '-default' => $form->{"cp_id"}));
353 346

  
347
  %labels = ();
348
  @values = ();
349
  foreach my $item (@{ $form->{"ALL_SALESMEN"} }) {
350
    push(@values, $item->{"id"});
351
    $labels{$item->{"id"}} = $item->{"name"};
352
  }
353

  
354
  my $employees = qq|
355
    <tr>
356
      <th align="right">| . $locale->text('Employee') . qq|</th>
357
      <td>| .
358
        NTI($cgi->popup_menu('-name' => 'employee', '-default' => $form->{"employee_id"},
359
                             '-values' => \@values, '-labels' => \%labels)) . qq|
360
      </td>
361
    </tr>|;
362

  
363

  
364
  %labels = ();
365
  @values = ();
366
  foreach my $item (@{ $form->{"ALL_CUSTOMERS"} }) {
367
    push(@values, $item->{name}.qq|--|.$item->{"id"});
368
    $labels{$item->{"id"}} = $item->{name}.qq|--|.$item->{"id"};
369
  }
370

  
371
  my $customers = qq|
372
      <th align="right">| . $locale->text('Customer') . qq|</th>
373
      <td>| . 
374
        (($myconfig{vclimit} == 1 ) 
375
              ? qq|<input type="text" value="$form->{oldcustomer}" name="customer">| 
376
              : (NTI($cgi->popup_menu('-name' => 'customer', '-default' => $form->{oldcustomer}, 
377
                             '-onChange' => 'document.getElementById(\'update_button\').click();',
378
                             '-values' => \@values, '-labels' => \%labels)))) . qq|
379
      </td>|;
380
    
354 381
  %labels = ();
355 382
  @values = ("");
356 383
  foreach my $item (@{ $form->{"ALL_SHIPTO"} }) {
......
483 510
<input type="hidden" name="forex" value="$form->{forex}">
484 511
|;
485 512

  
486
  $customer =
487
    ($form->{selectcustomer})
488
    ? qq|<select name="customer"
489
onchange="document.getElementById('update_button').click();">| .
490
    qq|$form->{selectcustomer}</select>\n<input type="hidden" name="selectcustomer" value="| .
491
    Q($form->{selectcustomer}) . qq|">|
492
    : qq|<input name="customer" value="$form->{customer}" size="35">|;
493

  
494 513
  $department = qq|
495 514
              <tr>
496 515
	        <th align="right" nowrap>| . $locale->text('Department') . qq|</th>
......
653 672
	  <td>
654 673
	    <table>
655 674
	      <tr>
656
		<th align="right" nowrap>| . $locale->text('Customer') . qq|</th>
657
		<td colspan="3">$customer</td>
675
		$customers
658 676
    <input type="hidden" name="customer_klass" value="$form->{customer_klass}">
659 677
		<input type="hidden" name="customer_id" value="$form->{customer_id}">
660
		<input type="hidden" name="oldcustomer" value="$form->{oldcustomer}">
678
    <input type="hidden" name="oldcustomer" value="$form->{oldcustomer}">
679
        <input type="hidden" name="selectcustomer" value="1">
661 680
                <th align="right" nowrap>|
662 681
    . $locale->text('Contact Person') . qq|</th>
663 682
                <td colspan="3">$contact</td>
......
725 744
	  </td>
726 745
	  <td align="right">
727 746
	    <table>
728
	      <tr>
729
	        <th align="right" nowrap>| . $locale->text('Employee') . qq|</th>
730
		<td colspan="2"><select name="employee">$form->{selectemployee}</select></td>
731
		<input type="hidden" name="selectemployee" value="$form->{selectemployee}">
732
                <td></td>
733
	      </tr>
747
	      $employees
734 748
        $salesman
735 749
|;
736 750
if ($form->{type} eq "credit_note") {

Auch abrufbar als: Unified diff