]> git.donarmstrong.com Git - debbugs.git/commitdiff
- Allow ordering bugs by last action (closes: #318898)
authorDon Armstrong <don@donarmstrong.com>
Fri, 15 Jun 2007 16:26:53 +0000 (17:26 +0100)
committerDon Armstrong <don@donarmstrong.com>
Fri, 15 Jun 2007 16:26:53 +0000 (17:26 +0100)
cgi/pkgreport.cgi
debian/changelog

index 2216b1cb1206429fc5ecfa661ca7b86a7148697b..8b9af3a96212ec328d95db630e61e588728b961b 100755 (executable)
@@ -35,11 +35,15 @@ my $users = $param{'users'} || "";
 my $ordering = $param{'ordering'};
 my $raw_sort = ($param{'raw'} || "no") eq "yes";
 my $old_view = ($param{'oldview'} || "no") eq "yes";
+my $age_sort = ($param{'age'} || "no") eq "yes";
 unless (defined $ordering) {
    $ordering = "normal";
    $ordering = "oldview" if $old_view;
    $ordering = "raw" if $raw_sort;
+   $ordering = 'age' if $age_sort;
 }
+my ($bug_order) = $ordering =~ /(age(?:rev)?)/;
+$bug_order = '' if not defined $bug_order;
 
 my $bug_rev = ($param{'bug-rev'} || "no") eq "yes";
 my $pend_rev = ($param{'pend-rev'} || "no") eq "yes";
@@ -520,6 +524,7 @@ my $sel_rmn = ($repeatmerged ? "" : " selected");
 my $sel_ordraw = ($ordering eq "raw" ? " selected" : "");
 my $sel_ordold = ($ordering eq "oldview" ? " selected" : "");
 my $sel_ordnor = ($ordering eq "normal" ? " selected" : "");
+my $sel_ordage = ($ordering eq "age" ? " selected" : "");
 
 my $chk_bugrev = ($bug_rev ? " checked" : "");
 my $chk_pendrev = ($pend_rev ? " checked" : "");
@@ -543,6 +548,7 @@ print <<EOF;
 <option value=raw$sel_ordraw>bug number only</option>
 <option value=old$sel_ordold>status and severity</option>
 <option value=normal$sel_ordnor>status, severity and classification</option>
+<option value=age$sel_ordage>status, severity, classification, and age</option>
 EOF
 
 {
@@ -723,20 +729,28 @@ sub pkg_htmlizebugs {
         next unless %status;
         next if bugfilter($bug, %status);
 
-        my $html = sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
+       my $html = sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
             bugurl($bug), $bug, htmlsanit($status{subject});
         $html .= pkg_htmlindexentrystatus(\%status) . "\n";
-
+       push @status, [ $bug, \%status, $html ];
+    }
+    print STDERR "nbnug_order: $bug_order\n";
+    if ($bug_order eq 'age') {
+        # MWHAHAHAHA
+        @status = sort {$a->[1]{log_modified} <=> $b->[1]{log_modified}} @status;
+    }
+    elsif ($bug_order eq 'agerev') {
+        @status = sort {$b->[1]{log_modified} <=> $a->[1]{log_modified}} @status;
+    }
+    for my $entry (@status) {
         my $key = "";
        for my $i (0..$#prior) {
-           my $v = get_bug_order_index($prior[$i], \%status);
+           my $v = get_bug_order_index($prior[$i], $entry->[1]);
             $count{"g_${i}_${v}"}++;
            $key .= "_$v";
        }
-        $section{$key} .= $html;
+        $section{$key} .= $entry->[2];
         $count{"_$key"}++;
-
-        push @status, [ $bug, \%status, $html ];
     }
 
     my $result = "";
index 72d54119f9c71b8c100a0fde55b0f6587cda37ee..d5fd84fbdca4cb4e2291fd98ca70e49c32c0f77c 100644 (file)
@@ -188,6 +188,7 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     - Reorder title (closes: #265267)
     - Reopen bugs when a bug is found with a version greater than any
       fixed version (closes: #365352)
+    - Allow ordering bugs by last action (closes: #318898)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100