Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 0000e2ae

Von Moritz Bunkus vor mehr als 16 Jahren hinzugefügt

  • ID 0000e2ae1b32d360b1cb44996f5a86a7207340a2
  • Vorgänger 16d8d326
  • Nachfolger 23c7245a

Sortierung in Berichten über Angebote / Aufträge / Presianfragen auch auf- und absteigbar sortierbar gemacht.

Unterschiede anzeigen:

SL/OE.pm
148 148
    push(@values, '%' . $form->{transaction_description} . '%');
149 149
  }
150 150

  
151
  my $sortorder = join(', ', ("o.id", $form->sort_columns("transdate", $ordnumber, "name")));
151
  my $sortdir   = $form->{sortdir} ? 'ASC' : 'DESC';
152
  my $sortorder = join(', ', map { "${_} ${sortdir} " } ("o.id", $form->sort_columns("transdate", $ordnumber, "name")));
152 153
  my %allowed_sort_columns = (
153 154
    "transdate"               => "o.transdate",
154 155
    "reqdate"                 => "o.reqdate",
......
162 163
    "transaction_description" => "o.transaction_description"
163 164
  );
164 165
  if ($form->{sort} && grep($form->{sort}, keys(%allowed_sort_columns))) {
165
    $sortorder = $allowed_sort_columns{$form->{sort}};
166
    $sortorder = $allowed_sort_columns{$form->{sort}} . " ${sortdir}";
166 167
  }
167 168
  $query .= qq| ORDER by | . $sortorder;
168 169

  
bin/mozilla/oe.pl
888 888

  
889 889
  ($form->{ $form->{vc} }, $form->{"${form->{vc}}_id"}) = split(/--/, $form->{ $form->{vc} });
890 890

  
891
  $form->{sort} ||= 'transdate';
891
  $form->{sort}    ||= 'transdate';
892
  $form->{sortdir}   = 1 unless (defined $form->{sortdir});
893
  $form->{sortdir}   = $form->{sortdir} ? 1 : 0;
892 894

  
893 895
  OE->transactions(\%myconfig, \%$form);
894 896

  
......
967 969
  );
968 970

  
969 971
  foreach my $name (qw(id transdate reqdate quonumber ordnumber name employee salesman shipvia)) {
970
    $column_defs{$name}->{link} = $href . "&sort=$name";
972
    my $sortdir                 = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
973
    $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
971 974
  }
972 975

  
973 976
  my %column_alignment = map { $_ => 'right' } qw(netamount tax amount curr);
......
979 982
  $report->set_columns(%column_defs);
980 983
  $report->set_column_order(@columns);
981 984
  $report->set_export_options('orders', @hidden_variables);
982
  $report->set_sort_indicator($form->{sort}, 1);
985
  $report->set_sort_indicator($form->{sort}, $form->{sortdir});
983 986

  
984 987
  my @options;
985 988
  my ($department) = split m/--/, $form->{department};

Auch abrufbar als: Unified diff