]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 333040: Cannot search based on "Attachment Creator" - Patch by Frédéric Buclin...
authorlpsolit%gmail.com <>
Tue, 19 Sep 2006 03:20:11 +0000 (03:20 +0000)
committerlpsolit%gmail.com <>
Tue, 19 Sep 2006 03:20:11 +0000 (03:20 +0000)
Bugzilla/Field.pm
Bugzilla/Search.pm

index 2dfd8aa6ecd18da269c97a025d622be96bd0735d..602ab5e4df7da05a11aaa831ff60bf20b270fa92 100644 (file)
@@ -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},
index 0d72b5873e5b98b95fe48e2d976c4d30bb7ea314..7c0fe7fdd572cbb33384b573a97ed73b083153cf 100644 (file)
@@ -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 = "";