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
3e4ca161
Commit
3e4ca161
authored
Jul 01, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 545766: Figure out what columns can be reported on from the database,
instead of from a static list r=glob, a=mkanat
parent
71f44e68
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
39 additions
and
22 deletions
+39
-22
Search.pm
Bugzilla/Search.pm
+28
-0
Template.pm
Bugzilla/Template.pm
+3
-0
report.cgi
report.cgi
+4
-17
field-descs.none.tmpl
template/en/default/global/field-descs.none.tmpl
+3
-0
search-report-select.html.tmpl
template/en/default/search/search-report-select.html.tmpl
+1
-5
No files found.
Bugzilla/Search.pm
View file @
3e4ca161
...
...
@@ -55,6 +55,8 @@ use Bugzilla::Keyword;
use
Date::
Format
;
use
Date::
Parse
;
use
Storable
qw(dclone)
;
# If you specify a search type in the boolean charts, this describes
# which operator maps to which internal function here.
use
constant
OPERATORS
=>
{
...
...
@@ -365,6 +367,32 @@ sub COLUMNS {
return
$cache
->
{
search_columns
};
}
sub
REPORT_COLUMNS
{
my
$columns
=
dclone
(
COLUMNS
);
# There's no reason to support reporting on unique fields.
# Also, some other fields don't make very good reporting axises,
# or simply don't work with the current reporting system.
my
@no_report_columns
=
qw(bug_id alias short_short_desc opendate changeddate
flagtypes.name keywords relevance)
;
# Multi-select fields are not currently supported.
my
@multi_selects
=
Bugzilla
->
get_fields
(
{
obsolete
=>
0
,
type
=>
FIELD_TYPE_MULTI_SELECT
});
push
(
@no_report_columns
,
map
{
$_
->
name
}
@multi_selects
);
# If you're not a time-tracker, you can't use time-tracking
# columns.
if
(
!
Bugzilla
->
user
->
is_timetracker
)
{
push
(
@no_report_columns
,
TIMETRACKING_FIELDS
);
}
foreach
my
$name
(
@no_report_columns
)
{
delete
$columns
->
{
$name
};
}
return
$columns
;
}
# Create a new Search
# Note that the param argument may be modified by Bugzilla::Search
sub
new
{
...
...
Bugzilla/Template.pm
View file @
3e4ca161
...
...
@@ -44,6 +44,7 @@ use Bugzilla::Keyword;
use
Bugzilla::
Util
;
use
Bugzilla::
User
;
use
Bugzilla::
Error
;
use
Bugzilla::
Search
;
use
Bugzilla::
Status
;
use
Bugzilla::
Token
;
...
...
@@ -773,6 +774,8 @@ sub create {
'install_string'
=>
\&
Bugzilla::Install::Util::
install_string
,
'report_columns'
=>
\&
Bugzilla::Search::
REPORT_COLUMNS
,
# These don't work as normal constants.
DB_MODULE
=>
\&
Bugzilla::Constants::
DB_MODULE
,
REQUIRED_MODULES
=>
...
...
report.cgi
View file @
3e4ca161
...
...
@@ -107,30 +107,17 @@ else {
}
# Valid bug fields that can be reported on.
my
@columns
=
qw(
assigned_to
reporter
qa_contact
classification
version
keywords
target_milestone
)
;
# Single-select fields (custom or not) are also accepted as valid.
my
@single_selects
=
Bugzilla
->
get_fields
({
type
=>
FIELD_TYPE_SINGLE_SELECT
,
obsolete
=>
0
});
push
(
@columns
,
map
{
$_
->
name
}
@single_selects
);
my
%
valid_columns
=
map
{
$_
=>
1
}
@columns
;
my
$valid_columns
=
Bugzilla::Search::
REPORT_COLUMNS
;
# Validate the values in the axis fields or throw an error.
!
$row_field
||
(
$valid_columns
{
$row_field
}
&&
trick_taint
(
$row_field
))
||
(
$valid_columns
->
{
$row_field
}
&&
trick_taint
(
$row_field
))
||
ThrowCodeError
(
"report_axis_invalid"
,
{
fld
=>
"x"
,
val
=>
$row_field
});
!
$col_field
||
(
$valid_columns
{
$col_field
}
&&
trick_taint
(
$col_field
))
||
(
$valid_columns
->
{
$col_field
}
&&
trick_taint
(
$col_field
))
||
ThrowCodeError
(
"report_axis_invalid"
,
{
fld
=>
"y"
,
val
=>
$col_field
});
!
$tbl_field
||
(
$valid_columns
{
$tbl_field
}
&&
trick_taint
(
$tbl_field
))
||
(
$valid_columns
->
{
$tbl_field
}
&&
trick_taint
(
$tbl_field
))
||
ThrowCodeError
(
"report_axis_invalid"
,
{
fld
=>
"z"
,
val
=>
$tbl_field
});
my
@axis_fields
=
(
$row_field
||
EMPTY_COLUMN
,
...
...
template/en/default/global/field-descs.none.tmpl
View file @
3e4ca161
...
...
@@ -100,6 +100,7 @@
"actual_time" => "Actual Hours",
"alias" => "Alias",
"assigned_to" => "Assignee",
"assigned_to_realname" => "Assignee Real Name",
"attach_data.thedata" => "Attachment data",
"attachments.description" => "Attachment description",
"attachments.filename" => "Attachment filename",
...
...
@@ -143,10 +144,12 @@
"product_id" => "Product ID",
"product" => "Product",
"qa_contact" => "QA Contact",
"qa_contact_realname" => "QA Contact Real Name",
"remaining_time" => "Hours Left",
"rep_platform" => "Hardware",
"reporter" => "Reporter",
"reporter_accessible" => "Reporter accessible",
"reporter_realname" => "Reporter Real Name",
"requestees.login_name" => "Flag Requestee",
"resolution" => "Resolution",
"see_also" => "See Also",
...
...
template/en/default/search/search-report-select.html.tmpl
View file @
3e4ca161
...
...
@@ -26,16 +26,12 @@
[% PROCESS "global/field-descs.none.tmpl" %]
[% BLOCK select %]
[% rep_fields = ["classification", "product", "component", "version", "rep_platform",
"op_sys", "bug_status", "resolution", "bug_severity",
"priority", "target_milestone", "assigned_to",
"reporter", "qa_contact" ] %]
[% Hook.process('rep_fields', 'search/search-report-select.html.tmpl') %]
<select name="[% name FILTER html %]">
<option value=""><none></option>
[% FOREACH field = rep
_fields
%]
[% FOREACH field = rep
ort_columns.keys.sort
%]
[% NEXT IF field == "classification" AND !Param('useclassification') %]
[% NEXT IF field == "target_milestone" AND !Param('usetargetmilestone') %]
[% NEXT IF field == "qa_contact" AND !Param('useqacontact') %]
...
...
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