From: Bernd Bleßmann Date: Tue, 26 Feb 2013 13:03:01 +0000 (+0100) Subject: Kundenbericht/Lieferantenbericht: Wieder richtig Sortieren können. X-Git-Tag: release-3.1.0beta1~602^2~4 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=1ade8550a1972d30d9bbc654bdec8b7c3da6ed2f;p=kivitendo-erp.git Kundenbericht/Lieferantenbericht: Wieder richtig Sortieren können. Ist im commit e5e2493f45a28623c056023159f4166c2dac63a0 kaputt gegangen. --- diff --git a/SL/CT.pm b/SL/CT.pm index dd9d627b8..f820acfcf 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -635,16 +635,16 @@ sub search { "salesman" => "e.name" ); + $form->{sort} ||= "name"; my $sortorder; if ( $join_records ) { # in UNION case order by hash key, e.g. salesman # the UNION created an implicit select around the result - $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name"; + $sortorder = $allowed_sort_columns{$form->{sort}} ? $form->{sort} : "name"; } else { # in not UNION case order by hash value, e.g. e.name - $sortorder = $form->{sort} && $allowed_sort_columns{$form->{sort}} ? $allowed_sort_columns{$form->{sort}} : "ct.name"; + $sortorder = $allowed_sort_columns{$form->{sort}} ? $allowed_sort_columns{$form->{sort}} : "ct.name"; }; - $form->{sort} = $sortorder; my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; if ($sortorder !~ /(business|id)/ && !$join_records) {