From 8cdaa6f0c4bb9b3c1dcdd18335e67f4c4842aaa4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 22 Feb 2008 15:01:16 +0000 Subject: [PATCH] =?utf8?q?Bugfix=20(b=C3=B6se=20klammer=20zuviel).?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Ausserdem Department Dropdownbox ausgelagert ins template. --- SL/OE.pm | 2 +- bin/mozilla/oe.pl | 17 +++++++---------- templates/webpages/oe/form_header_de.html | 12 +++++++++--- templates/webpages/oe/form_header_master.html | 12 +++++++++--- 4 files changed, 26 insertions(+), 17 deletions(-) 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 %] -- 2.20.1