From c654c46b8b5f9475d2515750aa4bbb3fdddc63fc Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 7 Jul 2008 10:03:23 +0000 Subject: [PATCH] =?utf8?q?Die=20Sortierung=20soll=20standardm=C3=A4=C3=9Fi?= =?utf8?q?g=20aufsteigend=20erfolgen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/AP.pm | 2 +- SL/AR.pm | 2 +- SL/DO.pm | 2 +- SL/OE.pm | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/AP.pm b/SL/AP.pm index e9e1a7ecd..24054c8cb 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -464,7 +464,7 @@ sub ap_transactions { my @a = (transdate, invnumber, name); push @a, "employee" if $self->{l_employee}; - my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; + my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = join(', ', map { "$_ $sortdir" } @a); if (grep({ $_ eq $form->{sort} } diff --git a/SL/AR.pm b/SL/AR.pm index d9a42ce36..e37128c19 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -468,7 +468,7 @@ sub ar_transactions { my @a = (transdate, invnumber, name); push @a, "employee" if $form->{l_employee}; - my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; + my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = join(', ', map { "$_ $sortdir" } @a); if (grep({ $_ eq $form->{sort} } diff --git a/SL/DO.pm b/SL/DO.pm index 390f51f32..2ad076a80 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -142,7 +142,7 @@ sub transactions { "transaction_description" => "dord.transaction_description" ); - my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; + my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = "dord.id"; if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) { $sortorder = $allowed_sort_columns{$form->{sort}}; diff --git a/SL/OE.pm b/SL/OE.pm index faae5d6f7..846590166 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -148,7 +148,7 @@ sub transactions { push(@values, '%' . $form->{transaction_description} . '%'); } - my $sortdir = $form->{sortdir} ? 'ASC' : 'DESC'; + my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name"))); my %allowed_sort_columns = ( "transdate" => "o.transdate", -- 2.20.1