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
32b3964d
Commit
32b3964d
authored
Jul 13, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 578308: Move the parsing of special fields and the creation of
@specialcharts out of init in Search.pm r=mkanat, a=mkanat (module owner)
parent
3dc3a015
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
37 deletions
+34
-37
Search.pm
Bugzilla/Search.pm
+34
-37
No files found.
Bugzilla/Search.pm
View file @
32b3964d
...
@@ -719,9 +719,39 @@ sub _skip_group_by {
...
@@ -719,9 +719,39 @@ sub _skip_group_by {
# Internal Accessors: Special Params Parsing #
# Internal Accessors: Special Params Parsing #
##############################################
##############################################
sub
_convert_special_params_to_charts
{
my
(
$self
)
=
@_
;
my
$params
=
$self
->
_params
;
my
@special_charts
=
$self
->
_special_charts
();
# first we delete any sign of "Chart #-1" from the HTML form hash
# since we want to guarantee the user didn't hide something here
my
@badcharts
=
grep
{
/^(field|type|value)-1-/
}
$params
->
param
();
foreach
my
$field
(
@badcharts
)
{
$params
->
delete
(
$field
);
}
# now we take our special chart and stuff it into the form hash
my
$chart
=
-
1
;
my
$and
=
0
;
foreach
my
$or_array
(
@special_charts
)
{
my
$or
=
0
;
while
(
@$or_array
)
{
$params
->
param
(
"field$chart-$and-$or"
,
shift
@$or_array
);
$params
->
param
(
"type$chart-$and-$or"
,
shift
@$or_array
);
$params
->
param
(
"value$chart-$and-$or"
,
shift
@$or_array
);
$or
++
;
}
$and
++
;
}
}
sub
_params
{
$_
[
0
]
->
{
params
}
}
sub
_params
{
$_
[
0
]
->
{
params
}
}
sub
_parse_params
{
# This parses all the standard search parameters except for the boolean
# charts.
sub
_special_charts
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
$self
->
_special_parse_bug_status
();
$self
->
_special_parse_bug_status
();
$self
->
_special_parse_resolution
();
$self
->
_special_parse_resolution
();
...
@@ -1037,40 +1067,7 @@ sub init {
...
@@ -1037,40 +1067,7 @@ sub init {
my
$dbh
=
Bugzilla
->
dbh
;
my
$dbh
=
Bugzilla
->
dbh
;
my
@specialchart
=
$self
->
_parse_params
();
$self
->
_convert_special_params_to_charts
();
foreach
my
$f
(
"short_desc"
,
"longdesc"
,
"bug_file_loc"
,
"status_whiteboard"
)
{
if
(
defined
$params
->
param
(
$f
))
{
my
$s
=
trim
(
$params
->
param
(
$f
));
if
(
$s
ne
""
)
{
my
$type
=
$params
->
param
(
$f
.
"_type"
);
push
(
@specialchart
,
[
$f
,
$type
,
$s
]);
}
}
}
# first we delete any sign of "Chart #-1" from the HTML form hash
# since we want to guarantee the user didn't hide something here
my
@badcharts
=
grep
/^(field|type|value)-1-/
,
$params
->
param
();
foreach
my
$field
(
@badcharts
)
{
$params
->
delete
(
$field
);
}
# now we take our special chart and stuff it into the form hash
my
$chart
=
-
1
;
my
$row
=
0
;
foreach
my
$ref
(
@specialchart
)
{
my
$col
=
0
;
while
(
@$ref
)
{
$params
->
param
(
"field$chart-$row-$col"
,
shift
(
@$ref
));
$params
->
param
(
"type$chart-$row-$col"
,
shift
(
@$ref
));
$params
->
param
(
"value$chart-$row-$col"
,
shift
(
@$ref
));
$col
++
;
}
$row
++
;
}
# A boolean chart is a way of representing the terms in a logical
# A boolean chart is a way of representing the terms in a logical
...
@@ -1156,8 +1153,8 @@ sub init {
...
@@ -1156,8 +1153,8 @@ sub init {
# $suppstring = String which is pasted into query containing all table names
# $suppstring = String which is pasted into query containing all table names
my
$sequence
=
0
;
my
$sequence
=
0
;
$row
=
0
;
my
$row
=
0
;
for
(
$chart
=-
1
;
for
(
my
$chart
=-
1
;
$chart
<
0
||
$params
->
param
(
"field$chart-0-0"
)
;
$chart
<
0
||
$params
->
param
(
"field$chart-0-0"
)
;
$chart
++
)
$chart
++
)
{
{
...
...
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