From: Sven Schöling Date: Fri, 22 Feb 2008 15:01:16 +0000 (+0000) Subject: Bugfix (böse klammer zuviel). X-Git-Tag: release-2.6.0beta1~216 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8cdaa6f0c4bb9b3c1dcdd18335e67f4c4842aaa4;p=kivitendo-erp.git Bugfix (böse klammer zuviel). Ausserdem Department Dropdownbox ausgelagert ins template. --- diff --git a/SL/OE.pm b/SL/OE.pm index f9d5daba2..18daae128 100644 --- 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 = diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 993c29fdc..fbd6a9cb3 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -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", "", @{ $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}" }; diff --git a/templates/webpages/oe/form_header_de.html b/templates/webpages/oe/form_header_de.html index 209d4fa1f..8d9271017 100644 --- a/templates/webpages/oe/form_header_de.html +++ b/templates/webpages/oe/form_header_de.html @@ -106,11 +106,17 @@ label_key = 'description' -%] -[%- IF selectdepartment %] +[%- IF ALL_DEPARTMENTS %] Abteilung - - + + [%- INCLUDE 'generic/multibox.html' + name = 'department_id', + style = 'width: 250px', + DATA = ALL_DEPARTMENTS, + id_key = 'id', + label_sub = 'department_labels', + show_empty = 1 -%] [%- END %] diff --git a/templates/webpages/oe/form_header_master.html b/templates/webpages/oe/form_header_master.html index f5df7d648..64636b25a 100644 --- a/templates/webpages/oe/form_header_master.html +++ b/templates/webpages/oe/form_header_master.html @@ -106,11 +106,17 @@ label_key = 'description' -%] -[%- IF selectdepartment %] +[%- IF ALL_DEPARTMENTS %] Department - - + + [%- INCLUDE 'generic/multibox.html' + name = 'department_id', + style = 'width: 250px', + DATA = ALL_DEPARTMENTS, + id_key = 'id', + label_sub = 'department_labels', + show_empty = 1 -%] [%- END %]