From e6b474924b6ce4d0a82c65b38d4dcc4d69dea89e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Mon, 18 Sep 2006 20:20:11 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20333040:=20Cannot=20search=20based=20on=20?= =?UTF-8?q?"Attachment=20Creator"=20-=20Patch=20by=20Fr=C3=A9d=C3=A9ric=20?= =?UTF-8?q?Buclin=20=20r=3Dmkanat=20a=3Dmyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://10.0.0.236/trunk@211956 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/webtools/bugzilla/Bugzilla/Field.pm | 1 + mozilla/webtools/bugzilla/Bugzilla/Search.pm | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/mozilla/webtools/bugzilla/Bugzilla/Field.pm b/mozilla/webtools/bugzilla/Bugzilla/Field.pm index 2dfd8aa6ecd..602ab5e4df7 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Field.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Field.pm @@ -142,6 +142,7 @@ use constant DEFAULT_FIELDS => ( {name => 'attachments.ispatch', desc => 'Attachment is patch'}, {name => 'attachments.isobsolete', desc => 'Attachment is obsolete'}, {name => 'attachments.isprivate', desc => 'Attachment is private'}, + {name => 'attachments.submitter', desc => 'Attachment creator'}, {name => 'target_milestone', desc => 'Target Milestone'}, {name => 'creation_ts', desc => 'Creation date', in_new_bugmail => 1}, diff --git a/mozilla/webtools/bugzilla/Bugzilla/Search.pm b/mozilla/webtools/bugzilla/Bugzilla/Search.pm index 0d72b5873e5..7c0fe7fdd57 100644 --- a/mozilla/webtools/bugzilla/Bugzilla/Search.pm +++ b/mozilla/webtools/bugzilla/Bugzilla/Search.pm @@ -818,6 +818,20 @@ sub init { "ON $dtable.id = $atable.attach_id"); $f = "$dtable.thedata"; }, + "^attachments\.submitter," => sub { + my $atable = "map_attachment_submitter_$chartid"; + my $extra = ""; + if (Bugzilla->params->{"insidergroup"} + && !Bugzilla->user->in_group(Bugzilla->params->{"insidergroup"})) + { + $extra = "AND $atable.isprivate = 0"; + } + push(@supptables, "INNER JOIN attachments AS $atable " . + "ON bugs.bug_id = $atable.bug_id $extra"); + push(@supptables, "LEFT JOIN profiles AS attachers_$chartid " . + "ON $atable.submitter_id = attachers_$chartid.userid"); + $f = "attachers_$chartid.login_name"; + }, "^attachments\..*," => sub { my $table = "attachments_$chartid"; my $extra = "";