summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2014-09-11 17:48:48 +0200
committerByron Jones <glob@mozilla.com>2014-09-11 17:49:01 +0200
commit747f1f1cacb06bc19cedd376371e4b3109b2983a (patch)
tree8d30aab742d134da77e64f3709c4d015746ab469 /Bugzilla
parentcdf7ace8009c37ce5e5c29ed10a6f4f151b47a7a (diff)
downloadbugzilla-747f1f1cacb06bc19cedd376371e4b3109b2983a.tar.gz
bugzilla-747f1f1cacb06bc19cedd376371e4b3109b2983a.tar.xz
Bug 1052851: add the ability to search by "assignee last login date"
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Field.pm2
-rw-r--r--Bugzilla/Search.pm26
2 files changed, 28 insertions, 0 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index 0a26b9320..d5f8e33f9 100644
--- a/Bugzilla/Field.pm
+++ b/Bugzilla/Field.pm
@@ -216,6 +216,8 @@ use constant DEFAULT_FIELDS => (
{name => 'blocked', desc => 'Blocks', in_new_bugmail => 1,
is_numeric => 1, buglist => 1},
+ {name => 'assignee_last_login', desc => 'Assignee Last Login Date', buglist => 1},
+
{name => 'attachments.description', desc => 'Attachment description'},
{name => 'attachments.filename', desc => 'Attachment filename'},
{name => 'attachments.mimetype', desc => 'Attachment mime type'},
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 356af1870..86e6764ff 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -288,6 +288,9 @@ use constant OPERATOR_FIELD_OVERRIDE => {
'attach_data.thedata' => MULTI_SELECT_OVERRIDE,
# We check all attachment fields against this.
attachments => MULTI_SELECT_OVERRIDE,
+ assignee_last_login => {
+ _default => \&_assignee_last_login,
+ },
blocked => MULTI_SELECT_OVERRIDE,
bug_file_loc => { _non_changed => \&_nullable },
bug_group => MULTI_SELECT_OVERRIDE,
@@ -485,6 +488,13 @@ sub COLUMN_JOINS {
table => 'profiles',
join => 'INNER',
},
+ assignee_last_login => {
+ as => 'assignee',
+ from => 'assigned_to',
+ to => 'userid',
+ table => 'profiles',
+ join => 'INNER',
+ },
reporter => {
from => 'reporter',
to => 'userid',
@@ -624,6 +634,7 @@ sub COLUMNS {
'longdescs.count' => 'COUNT(DISTINCT map_longdescs_count.comment_id)',
last_visit_ts => 'bug_user_last_visit.last_visit_ts',
+ assignee_last_login => 'assignee.last_seen_date',
);
# Backward-compatibility for old field names. Goes new_name => old_name.
@@ -2793,6 +2804,21 @@ sub _days_elapsed {
$dbh->sql_to_days('bugs.delta_ts') . ")";
}
+sub _assignee_last_login {
+ my ($self, $args) = @_;
+
+ push @{ $args->{joins} }, {
+ as => 'assignee',
+ table => 'profiles',
+ from => 'assigned_to',
+ to => 'userid',
+ join => 'INNER',
+ };
+ # coalesce to 1998 to make it easy to search for users who haven't logged
+ # in since we added last_seen_date
+ $args->{full_field} = "COALESCE(assignee.last_seen_date, '1998-01-01')";
+}
+
sub _component_nonchanged {
my ($self, $args) = @_;