diff options
author | Rob Snelders <programming@ertai.nl> | 2012-11-23 20:58:07 +0100 |
---|---|---|
committer | Rob Snelders <programming@ertai.nl> | 2012-11-23 20:58:07 +0100 |
commit | 6b799019fd4c6471961aa7761e9752b364f4f09f (patch) | |
tree | e6377e5763c403a5ed53cb7956eca61a9a2661c6 | |
parent | a37ad9d7635343d987d1f13f5abaf5dd07e30c23 (diff) |
fdo#43446 - BUGZILLAASSISTANT: Drop-down lists properties need fine tuning
-rw-r--r-- | bug/query.pl | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/bug/query.pl b/bug/query.pl index ad79e00..c56a2b5 100644 --- a/bug/query.pl +++ b/bug/query.pl @@ -14,6 +14,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see <http:www.gnu.org/licenses/>. # + +use Scalar::Util qw(looks_like_number); + while(<STDIN>) { eval $_ if(s/(cpts|vers)\[(\d+)\]\s+=/\$$1\[$2\]=/); if(/<select\s+name="product"/../<\/select/) { @@ -30,7 +33,14 @@ while(<STDIN>) { print "<?xml version='1.0' encoding='ISO-8859-1'?>\n"; -@versions = sort(@{$vers[$libreoffice]}); +@versions = sort { + if (looks_like_number(substr($a, 0, 1)) == 0) { + return 1; + } elsif (looks_like_number(substr($b, 0, 1)) == 0) { + return -1; + } else { + return lc($b) cmp lc($a); + } } @{$vers[$libreoffice]}; print <<EOF; <div class="versions select"> <div class="select-header"> |