summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Search.pm
diff options
context:
space:
mode:
authorbugreport%peshkin.net <>2004-06-02 05:29:04 +0200
committerbugreport%peshkin.net <>2004-06-02 05:29:04 +0200
commit90974879619a0ea279173c3423fe6e5fd907255f (patch)
tree2f9208f0a86765e0377efb29f7b23f1b945094da /Bugzilla/Search.pm
parent1eafc024c9462b0bda63db336273d8f5652a3428 (diff)
downloadbugzilla-90974879619a0ea279173c3423fe6e5fd907255f.tar.gz
bugzilla-90974879619a0ea279173c3423fe6e5fd907255f.tar.xz
Bug 244927: Add search on time owner has left the bug idle
r=jouni a=myk
Diffstat (limited to 'Bugzilla/Search.pm')
-rw-r--r--Bugzilla/Search.pm36
1 files changed, 36 insertions, 0 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 5f0e625aa..2f92131fc 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -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";