Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
4d7ce1e4
You need to sign in or sign up before continuing.
Commit
4d7ce1e4
authored
Jul 10, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 577803 - Make multi_select_fields into an accessor in Search.pm
r=mkanat, a=mkanat
parent
657f495a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
Search.pm
Bugzilla/Search.pm
+22
-7
No files found.
Bugzilla/Search.pm
View file @
4d7ce1e4
...
@@ -57,6 +57,10 @@ use Date::Parse;
...
@@ -57,6 +57,10 @@ use Date::Parse;
use
Storable
qw(dclone)
;
use
Storable
qw(dclone)
;
#############
# Constants #
#############
# If you specify a search type in the boolean charts, this describes
# If you specify a search type in the boolean charts, this describes
# which operator maps to which internal function here.
# which operator maps to which internal function here.
use
constant
OPERATORS
=>
{
use
constant
OPERATORS
=>
{
...
@@ -426,6 +430,21 @@ sub REPORT_COLUMNS {
...
@@ -426,6 +430,21 @@ sub REPORT_COLUMNS {
return
$columns
;
return
$columns
;
}
}
######################
# Internal Accessors #
######################
sub
_multi_select_fields
{
my
(
$self
)
=
@_
;
$self
->
{
multi_select_fields
}
||=
Bugzilla
->
fields
({
type
=>
[
FIELD_TYPE_MULTI_SELECT
,
FIELD_TYPE_BUG_URLS
]});
return
$self
->
{
multi_select_fields
};
}
###############
# Constructor #
###############
# Create a new Search
# Create a new Search
# Note that the param argument may be modified by Bugzilla::Search
# Note that the param argument may be modified by Bugzilla::Search
sub
new
{
sub
new
{
...
@@ -462,9 +481,6 @@ sub init {
...
@@ -462,9 +481,6 @@ sub init {
my
%
special_order_join
=
%
{
SPECIAL_ORDER_JOIN
()};
my
%
special_order_join
=
%
{
SPECIAL_ORDER_JOIN
()};
my
$select_fields
=
Bugzilla
->
fields
({
type
=>
FIELD_TYPE_SINGLE_SELECT
});
my
$select_fields
=
Bugzilla
->
fields
({
type
=>
FIELD_TYPE_SINGLE_SELECT
});
my
$multi_select_fields
=
Bugzilla
->
fields
({
type
=>
[
FIELD_TYPE_MULTI_SELECT
,
FIELD_TYPE_BUG_URLS
]});
foreach
my
$field
(
@$select_fields
)
{
foreach
my
$field
(
@$select_fields
)
{
next
if
$field
->
is_abnormal
;
next
if
$field
->
is_abnormal
;
my
$name
=
$field
->
name
;
my
$name
=
$field
->
name
;
...
@@ -520,7 +536,7 @@ sub init {
...
@@ -520,7 +536,7 @@ sub init {
push
(
@supptables
,
"LEFT JOIN longdescs AS ldtime "
.
push
(
@supptables
,
"LEFT JOIN longdescs AS ldtime "
.
"ON ldtime.bug_id = bugs.bug_id"
);
"ON ldtime.bug_id = bugs.bug_id"
);
}
}
foreach
my
$field
(
@
$multi_select_fields
)
{
foreach
my
$field
(
@
{
$self
->
_multi_select_fields
}
)
{
my
$field_name
=
$field
->
name
;
my
$field_name
=
$field
->
name
;
next
if
!
grep
(
$_
eq
$field_name
,
@fields
);
next
if
!
grep
(
$_
eq
$field_name
,
@fields
);
push
(
@supptables
,
"LEFT JOIN bug_$field_name AS map_bug_$field_name"
push
(
@supptables
,
"LEFT JOIN bug_$field_name AS map_bug_$field_name"
...
@@ -996,7 +1012,6 @@ sub init {
...
@@ -996,7 +1012,6 @@ sub init {
operator
=>
$operator
,
operator
=>
$operator
,
value
=>
$value
,
value
=>
$value
,
quoted
=>
$quoted
,
quoted
=>
$quoted
,
multi_fields
=>
$multi_select_fields
,
joins
=>
\
@supptables
,
joins
=>
\
@supptables
,
where
=>
\
@wherepart
,
where
=>
\
@wherepart
,
having
=>
\
@having
,
having
=>
\
@having
,
...
@@ -1122,7 +1137,7 @@ sub init {
...
@@ -1122,7 +1137,7 @@ sub init {
my
@skip_group_by
=
(
EMPTY_COLUMN
,
my
@skip_group_by
=
(
EMPTY_COLUMN
,
qw(bug_id actual_time percentage_complete flagtypes.name
qw(bug_id actual_time percentage_complete flagtypes.name
keywords)
);
keywords)
);
push
(
@skip_group_by
,
map
{
$_
->
name
}
@
$multi_select_fields
);
push
(
@skip_group_by
,
map
{
$_
->
name
}
@
{
$self
->
_multi_select_fields
}
);
next
if
grep
{
$_
eq
$field
}
@skip_group_by
;
next
if
grep
{
$_
eq
$field
}
@skip_group_by
;
my
$col
=
COLUMNS
->
{
$field
}
->
{
name
};
my
$col
=
COLUMNS
->
{
$field
}
->
{
name
};
...
@@ -1174,7 +1189,7 @@ sub do_search_function {
...
@@ -1174,7 +1189,7 @@ sub do_search_function {
my
$override
=
OPERATOR_FIELD_OVERRIDE
->
{
$actual_field
};
my
$override
=
OPERATOR_FIELD_OVERRIDE
->
{
$actual_field
};
if
(
!
$override
)
{
if
(
!
$override
)
{
# Multi-select fields get special handling.
# Multi-select fields get special handling.
if
(
grep
{
$_
->
name
eq
$actual_field
}
@
{
$
args
->
{
multi_fields
}
})
{
if
(
grep
{
$_
->
name
eq
$actual_field
}
@
{
$
self
->
_multi_select_fields
})
{
$override
=
OPERATOR_FIELD_OVERRIDE
->
{
_multi_select
};
$override
=
OPERATOR_FIELD_OVERRIDE
->
{
_multi_select
};
}
}
# And so do attachment fields, if they don't have a specific
# And so do attachment fields, if they don't have a specific
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment