From ab598b028f26f38fd48a12670ba836f1a8998623 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Tue, 14 Aug 2012 12:50:02 +0200 Subject: [PATCH] employees direkt in der Datenbank sortieren. --- SL/Form.pm | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index a7ed01b73..70d3a6550 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2576,7 +2576,8 @@ sub all_vc { # setup sales contacts $query = qq|SELECT e.id, e.name FROM employee e - WHERE (e.sales = '1') AND (NOT e.id = ?)|; + WHERE (e.sales = '1') AND (NOT e.id = ?) + ORDER BY name|; $self->{all_employees} = selectall_hashref_query($self, $dbh, $query, $self->{employee_id}); # this is for self @@ -2584,11 +2585,6 @@ sub all_vc { { id => $self->{employee_id}, name => $self->{employee} }); - # sort the whole thing - @{ $self->{all_employees} } = - sort { $a->{name} cmp $b->{name} } @{ $self->{all_employees} }; - - # prepare query for departments $query = qq|SELECT id, description FROM department -- 2.20.1