Fix field value sort order

master
Vitaliy Filippov 2014-07-09 15:46:59 +04:00
parent c216ea2e83
commit 7fa03d41f2
2 changed files with 5 additions and 7 deletions

View File

@ -263,10 +263,11 @@ sub get_all
$order = [ split /[\s,]*,[\s,]*/, $order ];
$filtered = [ sort
{
# FIXME Think about "natural sort"?
my $t;
for (@$order)
{
if ($a->{$_} =~ /^[\d\.]+$/s && $b->{$_} =~ /^[\d\.]+$/s)
if ($a->{$_} =~ /^-?\d+(\.\d+)?$/so && $b->{$_} =~ /^-?\d+(\.\d+)?$/so)
{
$t = $a->{$_} <=> $b->{$_};
}

View File

@ -1,10 +1,7 @@
[%# 1.0@bugzilla.org %]
[%# Mass bug import from Excel and CSV files
# License: Dual-license GPL 3.0+ or MPL 1.1+ %]
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
[% title = 'Excel import' %]
[% PROCESS global/header.html.tmpl %]
[% PROCESS global/header.html.tmpl title = 'Excel import' %]
[% IF form || show_error %]
<h2>Mass Bug Import from Excel files</h2>