From 03daa77e7027b499fdbc4f1376bacebf9aa57fb0 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 29 May 2007 11:13:55 +0000 Subject: [PATCH] =?utf8?q?Diverse=20Listen=20nach=20Namen=20sortieren.=20F?= =?utf8?q?ix=20f=C3=BCr=20Bug=20661.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 29 ++++++++--------------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 921832edd..7022acc9d 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1611,23 +1611,10 @@ sub _get_taxzones { sub _get_employees { $main::lxdebug->enter_sub(); - my ($self, $dbh, $key) = @_; - - $key = "all_employees" unless ($key); - $self->{$key} = - selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee|); - - $main::lxdebug->leave_sub(); -} + my ($self, $dbh, $default_key, $key) = @_; -sub _get_salesmen { - $main::lxdebug->enter_sub(); - - my ($self, $dbh, $key) = @_; - - $key = "all_salesmen" unless ($key); - $self->{$key} = - selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee|); + $key = $default_key unless ($key); + $self->{$key} = selectall_hashref_query($self, $dbh, qq|SELECT * FROM employee ORDER BY name|); $main::lxdebug->leave_sub(); } @@ -1707,7 +1694,7 @@ sub _get_customers { $key = "all_customers" unless ($key); - my $query = qq|SELECT * FROM customer|; + my $query = qq|SELECT * FROM customer ORDER BY name|; $self->{$key} = selectall_hashref_query($self, $dbh, $query); @@ -1721,7 +1708,7 @@ sub _get_vendors { $key = "all_vendors" unless ($key); - my $query = qq|SELECT * FROM vendor|; + my $query = qq|SELECT * FROM vendor ORDER BY name|; $self->{$key} = selectall_hashref_query($self, $dbh, $query); @@ -1735,7 +1722,7 @@ sub _get_departments { $key = "all_departments" unless ($key); - my $query = qq|SELECT * FROM department|; + my $query = qq|SELECT * FROM department ORDER BY description|; $self->{$key} = selectall_hashref_query($self, $dbh, $query); @@ -1789,11 +1776,11 @@ sub get_lists { } if ($params{"employees"}) { - $self->_get_employees($dbh, $params{"employees"}); + $self->_get_employees($dbh, "all_employees", $params{"employees"}); } if ($params{"salesmen"}) { - $self->_get_salesmen($dbh, $params{"salesmen"}); + $self->_get_employees($dbh, "all_salesmen", $params{"salesmen"}); } if ($params{"business_types"}) { -- 2.20.1