summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-09-19 05:20:11 +0200
committerlpsolit%gmail.com <>2006-09-19 05:20:11 +0200
commite1cdcb29f47b7c9c3ccd6d782a566e3a9b03a956 (patch)
treec53d8b02477fa63c2dd57f2e9dc68591eaa66eda /Bugzilla
parentfef6f78c2c8b9441dfd268257d40691ec79ef9a1 (diff)
downloadbugzilla-e1cdcb29f47b7c9c3ccd6d782a566e3a9b03a956.tar.gz
bugzilla-e1cdcb29f47b7c9c3ccd6d782a566e3a9b03a956.tar.xz
Bug 333040: Cannot search based on "Attachment Creator" - Patch by Frédéric Buclin <LpSolit@gmail.com> r=mkanat a=myk
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Field.pm1
-rw-r--r--Bugzilla/Search.pm14
2 files changed, 15 insertions, 0 deletions
diff --git a/Bugzilla/Field.pm b/Bugzilla/Field.pm
index 2dfd8aa6e..602ab5e4d 100644
--- a/Bugzilla/Field.pm
+++ b/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/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 0d72b5873..7c0fe7fdd 100644
--- a/Bugzilla/Search.pm
+++ b/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 = "";