From e1cdcb29f47b7c9c3ccd6d782a566e3a9b03a956 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Tue, 19 Sep 2006 03:20:11 +0000 Subject: Bug 333040: Cannot search based on "Attachment Creator" - Patch by Frédéric Buclin r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bugzilla/Search.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Bugzilla/Search.pm') 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 = ""; -- cgit v1.2.3-24-g4f1b