Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 8cdaa6f0

Von Sven Schöling vor fast 17 Jahren hinzugefügt

  • ID 8cdaa6f0c4bb9b3c1dcdd18335e67f4c4842aaa4
  • Vorgänger 21207f52
  • Nachfolger 0a60b9c2

Bugfix (böse klammer zuviel).

Ausserdem Department Dropdownbox ausgelagert ins template.

Unterschiede anzeigen:

SL/OE.pm
419 419

  
420 420
  my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
421 421

  
422
  ($null, $form->{department_id}) = split(/--/, $form->{department});
422
  ($null, $form->{department_id}) = split(/--/, $form->{department}) if $form->{department};
423 423

  
424 424
  # save OE record
425 425
  $query =
bin/mozilla/oe.pl
202 202
  # the content from the field)
203 203
  $form->error($locale->text('Collective Orders only work for orders from one customer!'))
204 204
    if          $form->{rowcount}  && $form->{type}     eq 'sales_order'
205
     && defined $form->{customer}  && $form->{customer} eq '');
205
     && defined $form->{customer}  && $form->{customer} eq '';
206 206

  
207 207
  $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
208 208

  
......
220 220
  $form->{employee}    = "$form->{employee}--$form->{employee_id}";
221 221

  
222 222
  # build vendor/customer drop down comatibility... don't ask
223
  $form->{"old$form->{vc}"} = $form->{"select$form->{vc}"} = 1;
224

  
225
  # departments
226
  if (@{ $form->{all_departments} }) {
227
    $form->{department}       = "$form->{department}--$form->{department_id}";
228
    $form->{selectdepartment} = join "\n", "<option>", map "<option>$_->{description}--$_->{id}</option>", @{ $form->{all_departments} };
229
  }
223
  $form->{"old$form->{vc}"} = $form->{vc};
224
  $form->{"select$form->{vc}"} = 1;
230 225

  
231 226
  $lxdebug->leave_sub();
232 227
}
......
321 316
                   "taxzones"      => "ALL_TAXZONES",
322 317
                   "payments"      => "ALL_PAYMENTS",
323 318
                   "currencies"    => "ALL_CURRENCIES",
319
                   "departments"   => "ALL_DEPARTMENTS",
324 320
                   $vc             => { key   => "ALL_" . uc($vc),
325 321
                                        limit => $myconfig{vclimit} + 1 },
326 322
                   "price_factors" => "ALL_PRICE_FACTORS");
327 323

  
328 324
  # label subs
329 325
  $TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} };
330
  $TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) };
331
  $TMPL_VAR{contact_labels} = sub { $_[0]->{"cp_name"} . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") };
326
  $TMPL_VAR{shipto_labels}         = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) };
327
  $TMPL_VAR{contact_labels}        = sub { $_[0]->{"cp_name"} . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") };
328
  $TMPL_VAR{department_labels}     = sub { "$_[0]->{description}--$_[0]->{id}" }; 
332 329

  
333 330
  # vendor/customer
334 331
  $TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" };
templates/webpages/oe/form_header_de.html
106 106
                           label_key  = 'description' -%]
107 107
                    </td>
108 108
                  </tr>
109
[%- IF selectdepartment %]
109
[%- IF ALL_DEPARTMENTS %]
110 110
                  <tr>
111 111
                    <th align="right" nowrap>Abteilung</th>
112
                    <td colspan="3"><select name="department" style="width: 250px">[% selectdepartment %]</select>
113
                    <input type="hidden" name="selectdepartment" value="[% HTML.escape(selectdepartment) %]">
112
                    <td colspan="3">
113
                      [%- INCLUDE 'generic/multibox.html'
114
                           name       = 'department_id',
115
                           style      = 'width: 250px',
116
                           DATA       = ALL_DEPARTMENTS,
117
                           id_key     = 'id',
118
                           label_sub  = 'department_labels',
119
                           show_empty = 1 -%]
114 120
                    </td>
115 121
                  </tr>
116 122
[%- END %]
templates/webpages/oe/form_header_master.html
106 106
                           label_key  = 'description' -%]
107 107
                    </td>
108 108
                  </tr>
109
[%- IF selectdepartment %]
109
[%- IF ALL_DEPARTMENTS %]
110 110
                  <tr>
111 111
                    <th align="right" nowrap><translate>Department</translate></th>
112
                    <td colspan="3"><select name="department" style="width: 250px">[% selectdepartment %]</select>
113
                    <input type="hidden" name="selectdepartment" value="[% HTML.escape(selectdepartment) %]">
112
                    <td colspan="3">
113
                      [%- INCLUDE 'generic/multibox.html'
114
                           name       = 'department_id',
115
                           style      = 'width: 250px',
116
                           DATA       = ALL_DEPARTMENTS,
117
                           id_key     = 'id',
118
                           label_sub  = 'department_labels',
119
                           show_empty = 1 -%]
114 120
                    </td>
115 121
                  </tr>
116 122
[%- END %]

Auch abrufbar als: Unified diff