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
6ead1a25
Commit
6ead1a25
authored
Nov 09, 2009
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 524669: Allow every simple field in fielddefs to be specified directly in search URLs.
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=gerv, a=mkanat
parent
6188fad0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
Constants.pm
Bugzilla/Constants.pm
+8
-0
Search.pm
Bugzilla/Search.pm
+19
-20
query.cgi
query.cgi
+2
-4
No files found.
Bugzilla/Constants.pm
View file @
6ead1a25
...
@@ -126,6 +126,8 @@ use File::Basename;
...
@@ -126,6 +126,8 @@ use File::Basename;
FIELD_TYPE_BUG_ID
FIELD_TYPE_BUG_ID
FIELD_TYPE_BUG_URLS
FIELD_TYPE_BUG_URLS
TIMETRACKING_FIELDS
USAGE_MODE_BROWSER
USAGE_MODE_BROWSER
USAGE_MODE_CMDLINE
USAGE_MODE_CMDLINE
USAGE_MODE_XMLRPC
USAGE_MODE_XMLRPC
...
@@ -358,6 +360,12 @@ use constant FIELD_TYPE_DATETIME => 5;
...
@@ -358,6 +360,12 @@ use constant FIELD_TYPE_DATETIME => 5;
use
constant
FIELD_TYPE_BUG_ID
=>
6
;
use
constant
FIELD_TYPE_BUG_ID
=>
6
;
use
constant
FIELD_TYPE_BUG_URLS
=>
7
;
use
constant
FIELD_TYPE_BUG_URLS
=>
7
;
# The fields from fielddefs that are blocked from non-timetracking users.
# work_time is sometimes called actual_time.
use
constant
TIMETRACKING_FIELDS
=>
qw(estimated_time remaining_time work_time actual_time
percentage_complete deadline)
;
# The maximum number of days a token will remain valid.
# The maximum number of days a token will remain valid.
use
constant
MAX_TOKEN_AGE
=>
3
;
use
constant
MAX_TOKEN_AGE
=>
3
;
# How many days a logincookie will remain valid if not used.
# How many days a logincookie will remain valid if not used.
...
...
Bugzilla/Search.pm
View file @
6ead1a25
...
@@ -328,27 +328,30 @@ sub init {
...
@@ -328,27 +328,30 @@ sub init {
}
}
}
}
my
@legal_fields
=
(
"product"
,
"version"
,
"assigned_to"
,
"reporter"
,
# All fields that don't have a . in their name should be specifyable
"component"
,
"classification"
,
"target_milestone"
,
# in the URL directly.
"bug_group"
);
my
@legal_fields
=
grep
{
$_
->
name
!~
/\./
}
Bugzilla
->
get_fields
;
if
(
!
$user
->
is_timetracker
)
{
# Include custom select fields.
foreach
my
$field
(
TIMETRACKING_FIELDS
)
{
push
(
@legal_fields
,
map
{
$_
->
name
}
@select_fields
);
@legal_fields
=
grep
{
$_
->
name
ne
$field
}
@legal_fields
;
push
(
@legal_fields
,
map
{
$_
->
name
}
@multi_select_fields
);
}
}
foreach
my
$field
(
$params
->
param
())
{
foreach
my
$field
(
$params
->
param
())
{
if
(
lsearch
(
\
@legal_fields
,
$field
)
!=
-
1
)
{
if
(
grep
{
$_
->
name
eq
$field
}
@legal_fields
)
{
push
(
@specialchart
,
[
$field
,
"anyexact"
,
my
$type
=
$params
->
param
(
"${field}_type"
);
join
(
','
,
$params
->
param
(
$field
))]);
if
(
!
$type
)
{
if
(
$field
eq
'keywords'
)
{
$type
=
'anywords'
;
}
else
{
$type
=
'anyexact'
;
}
}
}
}
$type
=
'matches'
if
$field
eq
'content'
;
if
(
$params
->
param
(
'keywords'
))
{
push
(
@specialchart
,
[
$field
,
$type
,
my
$t
=
$params
->
param
(
'keywords_type'
);
join
(
','
,
$params
->
param
(
$field
))]);
if
(
!
$t
||
$t
eq
"or"
)
{
$t
=
"anywords"
;
}
}
push
(
@specialchart
,
[
"keywords"
,
$t
,
$params
->
param
(
'keywords'
)]);
}
}
foreach
my
$id
(
"1"
,
"2"
)
{
foreach
my
$id
(
"1"
,
"2"
)
{
...
@@ -574,10 +577,6 @@ sub init {
...
@@ -574,10 +577,6 @@ sub init {
}
}
}
}
if
(
defined
$params
->
param
(
'content'
))
{
push
(
@specialchart
,
[
'content'
,
'matches'
,
$params
->
param
(
'content'
)]);
}
my
$multi_fields
=
join
(
'|'
,
map
(
$_
->
name
,
@multi_select_fields
));
my
$multi_fields
=
join
(
'|'
,
map
(
$_
->
name
,
@multi_select_fields
));
my
$chartid
;
my
$chartid
;
...
...
query.cgi
View file @
6ead1a25
...
@@ -266,10 +266,8 @@ $vars->{'resolution'} = Bugzilla::Field->new({name => 'resolution'})->legal_valu
...
@@ -266,10 +266,8 @@ $vars->{'resolution'} = Bugzilla::Field->new({name => 'resolution'})->legal_valu
my
@fields
=
Bugzilla
->
get_fields
({
obsolete
=>
0
});
my
@fields
=
Bugzilla
->
get_fields
({
obsolete
=>
0
});
# If we're not in the time-tracking group, exclude time-tracking fields.
# If we're not in the time-tracking group, exclude time-tracking fields.
if
(
!
Bugzilla
->
user
->
in_group
(
Bugzilla
->
params
->
{
'timetrackinggroup'
}))
{
if
(
!
Bugzilla
->
user
->
is_timetracker
)
{
foreach
my
$tt_field
(
qw(estimated_time remaining_time work_time
foreach
my
$tt_field
(
TIMETRACKING_FIELDS
)
{
percentage_complete deadline)
)
{
@fields
=
grep
(
$_
->
name
ne
$tt_field
,
@fields
);
@fields
=
grep
(
$_
->
name
ne
$tt_field
,
@fields
);
}
}
}
}
...
...
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