From ed14204df3eb35e33247c5f5b0fec0298a141ef2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 11 Oct 2012 17:41:37 +0200 Subject: [PATCH] Suche nach und Anzeige von Abteilungen bei Lieferscheinsuche Implementiert #1952. --- SL/DO.pm | 8 ++++++-- bin/mozilla/do.pl | 7 +++++-- templates/webpages/do/search.html | 20 +++++++++++++------- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/SL/DO.pm b/SL/DO.pm index 237d523d9..4fbe8020a 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -66,13 +66,16 @@ sub transactions { dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, dord.transaction_description, pr.projectnumber AS globalprojectnumber, + dep.description AS department, e.name AS employee, sm.name AS salesman FROM delivery_orders dord LEFT JOIN $vc ct ON (dord.${vc}_id = ct.id) LEFT JOIN employee e ON (dord.employee_id = e.id) LEFT JOIN employee sm ON (dord.salesman_id = sm.id) - LEFT JOIN project pr ON (dord.globalproject_id = pr.id)|; + LEFT JOIN project pr ON (dord.globalproject_id = pr.id) + LEFT JOIN department dep ON (dord.department_id = dep.id) +|; push @where, ($form->{type} eq 'sales_delivery_order' ? '' : 'NOT ') . qq|COALESCE(dord.is_sales, FALSE)|; @@ -147,7 +150,8 @@ sub transactions { "employee" => "e.name", "salesman" => "sm.name", "shipvia" => "dord.shipvia", - "transaction_description" => "dord.transaction_description" + "transaction_description" => "dord.transaction_description", + "department" => "lower(dep.description)", ); my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 1bcf20985..1dc880ef9 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -453,6 +453,7 @@ sub search { $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, + "departments" => "ALL_DEPARTMENTS", "$form->{vc}s" => "ALL_VC"); $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); @@ -477,6 +478,7 @@ sub orders { my $locale = $main::locale; my $cgi = $::request->{cgi}; + $form->{department_id} = (split /--/, $form->{department})[-1]; ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} }); report_generator_set_default_sort('transdate', 1); @@ -491,7 +493,7 @@ sub orders { ordnumber customernumber name employee salesman shipvia globalprojectnumber - transaction_description + transaction_description department open delivered ); @@ -525,9 +527,10 @@ sub orders { 'transaction_description' => { 'text' => $locale->text('Transaction description'), }, 'open' => { 'text' => $locale->text('Open'), }, 'delivered' => { 'text' => $locale->text('Delivered'), }, + 'department' => { 'text' => $locale->text('Department'), }, ); - foreach my $name (qw(id transdate donumber ordnumber name employee salesman shipvia transaction_description)) { + foreach my $name (qw(id transdate donumber ordnumber name employee salesman shipvia transaction_description department)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; } diff --git a/templates/webpages/do/search.html b/templates/webpages/do/search.html index 66cd07f4e..f7ab5d591 100644 --- a/templates/webpages/do/search.html +++ b/templates/webpages/do/search.html @@ -62,7 +62,7 @@ @@ -182,6 +182,18 @@ [% END %] + + + + + + + + + + + + @@ -192,11 +204,6 @@ - - - - - @@ -230,4 +237,3 @@ - -- 2.20.1