From eaf4d4830c5b449170dbef0d0ad5f88863f1e8bd Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 15 Feb 2007 13:25:19 +0000 Subject: [PATCH] Einheiten sortierbar gemacht. --- SL/AM.pm | 51 +++++++++++++++++-- bin/mozilla/am.pl | 26 +++++++--- image/transparent16x16.gif | Bin 0 -> 80 bytes locale/de/am | 1 + sql/Pg-upgrade2/units_sortkey.sql | 8 +++ templates/webpages/am/edit_units_de.html | 5 +- templates/webpages/am/edit_units_master.html | 5 +- 7 files changed, 79 insertions(+), 17 deletions(-) create mode 100644 image/transparent16x16.gif create mode 100644 sql/Pg-upgrade2/units_sortkey.sql diff --git a/SL/AM.pm b/SL/AM.pm index a0a15899c..e0b983a49 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -2284,7 +2284,7 @@ sub unit_select_data { push(@{$select}, { "name" => "", "base_unit" => "", "factor" => "", "selected" => "" }); } - foreach my $unit (sort({ lc($a) cmp lc($b) } keys(%{$units}))) { + foreach my $unit (sort({ $a->{"sortkey"} <=> $b->{"sortkey"} } keys(%{$units}))) { push(@{$select}, { "name" => $unit, "base_unit" => $units->{$unit}->{"base_unit"}, "factor" => $units->{$unit}->{"factor"}, @@ -2303,7 +2303,7 @@ sub unit_select_html { my $select = " @@ -119,7 +119,6 @@ - diff --git a/templates/webpages/am/edit_units_master.html b/templates/webpages/am/edit_units_master.html index f873e0fc0..da1c7e40a 100644 --- a/templates/webpages/am/edit_units_master.html +++ b/templates/webpages/am/edit_units_master.html @@ -94,7 +94,7 @@ - + @@ -106,8 +106,8 @@ + -
 <translate>up</translate><translate>down</translate> Delete Unit Base unit
<translate>up</translate><translate>down</translate> @@ -119,7 +119,6 @@ - -- 2.20.1