]> wagnertech.de Git - kivitendo-erp.git/commitdiff
Bugfix (böse klammer zuviel).
authorSven Schöling <s.schoeling@linet-services.de>
Fri, 22 Feb 2008 15:01:16 +0000 (15:01 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Fri, 22 Feb 2008 15:01:16 +0000 (15:01 +0000)
Ausserdem Department Dropdownbox ausgelagert ins template.

SL/OE.pm
bin/mozilla/oe.pl
templates/webpages/oe/form_header_de.html
templates/webpages/oe/form_header_master.html

index f9d5daba21efbdd982d9aa13d5a44b72f4fb655d..18daae128c174b8e8ad3bec57ef48959d04d28d3 100644 (file)
--- a/SL/OE.pm
+++ b/SL/OE.pm
@@ -419,7 +419,7 @@ sub save {
 
   my $quotation = $form->{type} =~ /_order$/ ? 'f' : 't';
 
-  ($null, $form->{department_id}) = split(/--/, $form->{department});
+  ($null, $form->{department_id}) = split(/--/, $form->{department}) if $form->{department};
 
   # save OE record
   $query =
index 993c29fdc755b385a11fc2d99b84259465bec62a..fbd6a9cb3887387a4af18f73e3cccf7038541a72 100644 (file)
@@ -202,7 +202,7 @@ sub order_links {
   # the content from the field)
   $form->error($locale->text('Collective Orders only work for orders from one customer!'))
     if          $form->{rowcount}  && $form->{type}     eq 'sales_order'
-     && defined $form->{customer}  && $form->{customer} eq '');
+     && defined $form->{customer}  && $form->{customer} eq '';
 
   $form->{"$form->{vc}_id"} ||= $form->{"all_$form->{vc}"}->[0]->{id} if $form->{"all_$form->{vc}"};
 
@@ -220,13 +220,8 @@ sub order_links {
   $form->{employee}    = "$form->{employee}--$form->{employee_id}";
 
   # build vendor/customer drop down comatibility... don't ask
-  $form->{"old$form->{vc}"} = $form->{"select$form->{vc}"} = 1;
-
-  # departments
-  if (@{ $form->{all_departments} }) {
-    $form->{department}       = "$form->{department}--$form->{department_id}";
-    $form->{selectdepartment} = join "\n", "<option>", map "<option>$_->{description}--$_->{id}</option>", @{ $form->{all_departments} };
-  }
+  $form->{"old$form->{vc}"} = $form->{vc};
+  $form->{"select$form->{vc}"} = 1;
 
   $lxdebug->leave_sub();
 }
@@ -321,14 +316,16 @@ sub form_header {
                    "taxzones"      => "ALL_TAXZONES",
                    "payments"      => "ALL_PAYMENTS",
                    "currencies"    => "ALL_CURRENCIES",
+                   "departments"   => "ALL_DEPARTMENTS",
                    $vc             => { key   => "ALL_" . uc($vc),
                                         limit => $myconfig{vclimit} + 1 },
                    "price_factors" => "ALL_PRICE_FACTORS");
 
   # label subs
   $TMPL_VAR{sales_employee_labels} = sub { $_[0]->{name} || $_[0]->{login} };
-  $TMPL_VAR{shipto_labels} = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) };
-  $TMPL_VAR{contact_labels} = sub { $_[0]->{"cp_name"} . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") };
+  $TMPL_VAR{shipto_labels}         = sub { join "; ", grep { $_ } map { $_[0]->{"shipto${_}" } } qw(name department_1 street city) };
+  $TMPL_VAR{contact_labels}        = sub { $_[0]->{"cp_name"} . ($_[0]->{cp_abteilung} ? " ($_[0]->{cp_abteilung})" : "") };
+  $TMPL_VAR{department_labels}     = sub { "$_[0]->{description}--$_[0]->{id}" }; 
 
   # vendor/customer
   $TMPL_VAR{vc_keys} = sub { "$_[0]->{name}--$_[0]->{id}" };
index 209d4fa1f566679a88d57b729ac229ace6d3e0cf..8d92710179f36c771b65c1da522339aee65f06d6 100644 (file)
                            label_key  = 'description' -%]
                     </td>
                   </tr>
-[%- IF selectdepartment %]
+[%- IF ALL_DEPARTMENTS %]
                   <tr>
                     <th align="right" nowrap>Abteilung</th>
-                    <td colspan="3"><select name="department" style="width: 250px">[% selectdepartment %]</select>
-                    <input type="hidden" name="selectdepartment" value="[% HTML.escape(selectdepartment) %]">
+                    <td colspan="3">
+                      [%- INCLUDE 'generic/multibox.html'
+                           name       = 'department_id',
+                           style      = 'width: 250px',
+                           DATA       = ALL_DEPARTMENTS,
+                           id_key     = 'id',
+                           label_sub  = 'department_labels',
+                           show_empty = 1 -%]
                     </td>
                   </tr>
 [%- END %]
index f5df7d6488d1e496dcf38c2a6d8cafe1ff01861c..64636b25a59a13e69eccc8f9173f1dbc0928e54a 100644 (file)
                            label_key  = 'description' -%]
                     </td>
                   </tr>
-[%- IF selectdepartment %]
+[%- IF ALL_DEPARTMENTS %]
                   <tr>
                     <th align="right" nowrap><translate>Department</translate></th>
-                    <td colspan="3"><select name="department" style="width: 250px">[% selectdepartment %]</select>
-                    <input type="hidden" name="selectdepartment" value="[% HTML.escape(selectdepartment) %]">
+                    <td colspan="3">
+                      [%- INCLUDE 'generic/multibox.html'
+                           name       = 'department_id',
+                           style      = 'width: 250px',
+                           DATA       = ALL_DEPARTMENTS,
+                           id_key     = 'id',
+                           label_sub  = 'department_labels',
+                           show_empty = 1 -%]
                     </td>
                   </tr>
 [%- END %]