aboutsummaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-03 11:22:18 -0800
committerMax Kanat-Alexander <mkanat@bugzilla.org>2011-03-03 11:22:18 -0800
commit9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee (patch)
tree407af93e3a4b48f87d629680223395e8afcd296c /Bugzilla
parent6c94f376d915398ffb0a2fc21202430236f49b5f (diff)
downloadbugs-9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee.tar
bugs-9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee.tar.gz
bugs-9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee.tar.bz2
bugs-9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee.tar.xz
bugs-9785bd9b3e44af9cbd4fc37b37b5eb00a94b69ee.zip
Bug 638509 - Make all boolean charts work with all attachment fields except
for "Attachment data" r=mkanat, a=mkanat (module owner)
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Search.pm35
1 files changed, 10 insertions, 25 deletions
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 578c0e43d..ce4b1605e 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -271,11 +271,9 @@ use constant OPERATOR_FIELD_OVERRIDE => {
_non_changed => \&_attach_data_thedata,
},
# We check all attachment fields against this.
- 'attachments' => {
- _non_changed => \&_attachments,
- },
- blocked => MULTI_SELECT_OVERRIDE,
- bug_group => MULTI_SELECT_OVERRIDE,
+ attachments => MULTI_SELECT_OVERRIDE,
+ blocked => MULTI_SELECT_OVERRIDE,
+ bug_group => MULTI_SELECT_OVERRIDE,
classification => {
_non_changed => \&_classification_nonchanged,
},
@@ -2351,26 +2349,6 @@ sub _attach_data_thedata {
$args->{full_field} = "$data_table.thedata";
}
-sub _attachments {
- my ($self, $args) = @_;
- my ($chart_id, $joins, $field) =
- @$args{qw(chart_id joins field)};
- my $dbh = Bugzilla->dbh;
-
- my $table = "attachments_$chart_id";
- my $extra = $self->_user->is_insider ? [] : ["$table.isprivate = 0"];
- my $join = {
- table => 'attachments',
- as => $table,
- extra => $extra,
- };
- push(@$joins, $join);
- $field =~ /^attachments\.(.+)$/;
- my $attach_field = $1;
-
- $args->{full_field} = "$table.$attach_field";
-}
-
sub _join_flag_tables {
my ($self, $args) = @_;
my ($joins, $chart_id) = @$args{qw(joins chart_id)};
@@ -2616,6 +2594,13 @@ sub _multiselect_table {
$args->{full_field} = 'isprivate';
return "longdescs";
}
+ elsif ($field =~ /^attachments/) {
+ $args->{_extra_where} = " AND isprivate = 0"
+ if !$self->_user->is_insider;
+ $field =~ /^attachments\.(.+)$/;
+ $args->{full_field} = $1;
+ return "attachments";
+ }
my $table = "bug_$field";
$args->{full_field} = "bug_$field.value";
return $table;