]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 244927: Add search on time owner has left the bug idle
authorbugreport%peshkin.net <>
Wed, 2 Jun 2004 03:29:04 +0000 (03:29 +0000)
committerbugreport%peshkin.net <>
Wed, 2 Jun 2004 03:29:04 +0000 (03:29 +0000)
r=jouni
a=myk

Bugzilla/Search.pm
checksetup.pl

index 5f0e625aa5d4d98d099e86db1d50fb34b1936ee8..2f92131fc8d610370731d8f8e1a89f1f6b847706 100644 (file)
@@ -703,6 +703,42 @@ sub init {
                 push(@wherepart, "$table.dependson = bugs.bug_id");
          },
 
+         "^owner_idle_time,(greaterthan|lessthan)" => sub {
+                my $table = "idle_" . $chartid;
+                $v =~ /^(\d+)\s*([hHdDwWmMyY])?$/;
+                my $quantity = $1;
+                my $unit = lc $2;
+                my $unitinterval = 'DAY';
+                if ($unit eq 'h') {
+                    $unitinterval = 'HOUR';
+                } elsif ($unit eq 'w') {
+                    $unitinterval = ' * 7 DAY';
+                } elsif ($unit eq 'm') {
+                    $unitinterval = 'MONTH';
+                } elsif ($unit eq 'y') {
+                    $unitinterval = 'YEAR';
+                }
+                my $cutoff = "DATE_SUB(NOW(), 
+                              INTERVAL $quantity $unitinterval)";
+                my $assigned_fieldid = &::GetFieldID('assigned_to');
+                push(@supptables, "LEFT JOIN longdescs comment_$table " .
+                                  "ON comment_$table.who = bugs.assigned_to " .
+                                  "AND comment_$table.bug_id = bugs.bug_id " .
+                                  "AND comment_$table.bug_when > $cutoff");
+                push(@supptables, "LEFT JOIN bugs_activity activity_$table " .
+                                  "ON (activity_$table.who = bugs.assigned_to " .
+                                  "OR activity_$table.fieldid = $assigned_fieldid) " .
+                                  "AND activity_$table.bug_id = bugs.bug_id " .
+                                  "AND activity_$table.bug_when > $cutoff");
+                if ($t =~ /greater/) {
+                    push(@wherepart, "(comment_$table.who IS NULL " .
+                                     "AND activity_$table.who IS NULL)");
+                } else {
+                    push(@wherepart, "(comment_$table.who IS NOT NULL " .
+                                     "OR activity_$table.who IS NOT NULL)");
+                }
+                $term = "0=0";
+         },
 
          ",equals" => sub {
              $term = "$ff = $q";
index 9d23579454a0b97dae9d25d68e852a53ffc64e37..ec7e998c4c64f8293c06a00567700d937a0eeefb 100755 (executable)
@@ -3897,6 +3897,8 @@ if (!$series_exists) {
     }
 }
 
+AddFDef("owner_idle_time", "Time Since Owner Touched", 0);
+
 # If you had to change the --TABLE-- definition in any way, then add your
 # differential change code *** A B O V E *** this comment.
 #