+field "priority"
[www.jankratochvil.net.git] / project / list.cgi.pl
index 983dd9c..be9dd21 100755 (executable)
@@ -25,6 +25,8 @@ $CVS_ID=q$Id$;
 use strict;
 use warnings;
 
+use lib qw(/home/short/lib/perl5/site_perl/5.6.0/i386-linux /home/short/lib/perl5/site_perl/5.6.0 /home/short/lib/perl5/site_perl/i386-linux /home/short/lib/perl5/site_perl /home/short/lib/perl5/5.6.0/i386-linux /home/short/lib/perl5/5.6.0 /home/short/lib/perl5/i386-linux /home/short/lib/perl5);
+
 use lib "../";
 use My::Web;
 require CGI;
@@ -57,9 +59,7 @@ HERE
 my %dirs;
 for my $ENTRIES (ENTRIES,ENTRIES_LOG) {
        local *E;
-       if (!open E,$ENTRIES) {
-               die "File \"".$ENTRIES."\" cannot be opened";
-               }
+       next if !open E,$ENTRIES;
        while (<E>) {
                chomp;
                do { $dirs{$1}=1; next; } if m#^(?:A )?D/([^/]*)/#;
@@ -83,7 +83,7 @@ for my $dir (keys(%dirs)) {
 # $col{"name"}{""}="Project name";
 # @col_order
 
-my @row_order;
+my @row_order=qw(-priority);
 my @col_order=qw(name summary license maintenance language);
 my %col;
 
@@ -127,7 +127,10 @@ print '<table border="1">'."\n";
        print '</tr>'."\n";
        my @rows_ordered=sort {
                        for my $order_by (@row_order,"name") {
+                               my $order_by=$order_by;
+                               my $minus=($order_by=~s/^(-)//)[0];
                                my $r=($item{$a}{$order_by} cmp $item{$b}{$order_by});
+                               $r=-$r if $minus;
                                return $r if $r;
                                }
                        return 0;