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
46e5d925
Commit
46e5d925
authored
Nov 26, 2012
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 718289: The deadline field should be visible by non-members of the timetracking group
r=dkl a=LpSolit
parent
ccf2d3e5
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
30 additions
and
30 deletions
+30
-30
Bug.pm
Bugzilla/Bug.pm
+4
-5
Constants.pm
Bugzilla/Constants.pm
+1
-2
Search.pm
Bugzilla/Search.pm
+0
-1
Bug.pm
Bugzilla/WebService/Bug.pm
+4
-7
buglist.cgi
buglist.cgi
+3
-5
colchange.cgi
colchange.cgi
+1
-0
config.cgi
config.cgi
+3
-1
using.xml
docs/en/xml/using.xml
+2
-1
query.cgi
query.cgi
+3
-3
show_bug.cgi
show_bug.cgi
+1
-1
edit.html.tmpl
template/en/default/bug/edit.html.tmpl
+4
-1
show-multiple.html.tmpl
template/en/default/bug/show-multiple.html.tmpl
+2
-0
form.html.tmpl
template/en/default/search/form.html.tmpl
+2
-3
No files found.
Bugzilla/Bug.pm
View file @
46e5d925
...
@@ -3734,9 +3734,7 @@ sub editable_bug_fields {
...
@@ -3734,9 +3734,7 @@ sub editable_bug_fields {
# Custom multi-select fields are not stored in the bugs table.
# Custom multi-select fields are not stored in the bugs table.
splice
(
@fields
,
$location
,
1
)
if
(
$location
>
-
1
);
splice
(
@fields
,
$location
,
1
)
if
(
$location
>
-
1
);
}
}
# Sorted because the old @::log_columns variable, which this replaces,
return
@fields
;
# was sorted.
return
sort
(
@fields
);
}
}
# XXX - When Bug::update() will be implemented, we should make this routine
# XXX - When Bug::update() will be implemented, we should make this routine
...
@@ -4049,8 +4047,9 @@ sub check_can_change_field {
...
@@ -4049,8 +4047,9 @@ sub check_can_change_field {
# $PrivilegesRequired = PRIVILEGES_REQUIRED_ASSIGNEE : the assignee or an empowered user;
# $PrivilegesRequired = PRIVILEGES_REQUIRED_ASSIGNEE : the assignee or an empowered user;
# $PrivilegesRequired = PRIVILEGES_REQUIRED_EMPOWERED : an empowered user.
# $PrivilegesRequired = PRIVILEGES_REQUIRED_EMPOWERED : an empowered user.
# Only users in the time-tracking group can change time-tracking fields.
# Only users in the time-tracking group can change time-tracking fields,
if
(
grep
(
$_
eq
$field
,
TIMETRACKING_FIELDS
)
)
{
# including the deadline.
if
(
grep
{
$_
eq
$field
}
(
TIMETRACKING_FIELDS
,
'deadline'
))
{
if
(
!
$user
->
is_timetracker
)
{
if
(
!
$user
->
is_timetracker
)
{
$$PrivilegesRequired
=
PRIVILEGES_REQUIRED_EMPOWERED
;
$$PrivilegesRequired
=
PRIVILEGES_REQUIRED_EMPOWERED
;
return
0
;
return
0
;
...
...
Bugzilla/Constants.pm
View file @
46e5d925
...
@@ -399,8 +399,7 @@ use constant ABNORMAL_SELECTS => {
...
@@ -399,8 +399,7 @@ use constant ABNORMAL_SELECTS => {
# The fields from fielddefs that are blocked from non-timetracking users.
# The fields from fielddefs that are blocked from non-timetracking users.
# work_time is sometimes called actual_time.
# work_time is sometimes called actual_time.
use
constant
TIMETRACKING_FIELDS
=>
use
constant
TIMETRACKING_FIELDS
=>
qw(estimated_time remaining_time work_time actual_time
qw(estimated_time remaining_time work_time actual_time percentage_complete)
;
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
;
...
...
Bugzilla/Search.pm
View file @
46e5d925
...
@@ -1475,7 +1475,6 @@ sub _special_parse_chfield {
...
@@ -1475,7 +1475,6 @@ sub _special_parse_chfield {
sub
_special_parse_deadline
{
sub
_special_parse_deadline
{
my
(
$self
)
=
@_
;
my
(
$self
)
=
@_
;
return
if
!
$self
->
_user
->
is_timetracker
;
my
$params
=
$self
->
_params
;
my
$params
=
$self
->
_params
;
my
$clause
=
new
Bugzilla::Search::
Clause
();
my
$clause
=
new
Bugzilla::Search::
Clause
();
...
...
Bugzilla/WebService/Bug.pm
View file @
46e5d925
...
@@ -418,7 +418,7 @@ sub search {
...
@@ -418,7 +418,7 @@ sub search {
delete
$params
->
{
WHERE
};
delete
$params
->
{
WHERE
};
unless
(
Bugzilla
->
user
->
is_timetracker
)
{
unless
(
Bugzilla
->
user
->
is_timetracker
)
{
delete
$params
->
{
$_
}
foreach
qw(estimated_time remaining_time deadline)
;
delete
$params
->
{
$_
}
foreach
TIMETRACKING_FIELDS
;
}
}
# Do special search types for certain fields.
# Do special search types for certain fields.
...
@@ -851,6 +851,9 @@ sub _bug_to_hash {
...
@@ -851,6 +851,9 @@ sub _bug_to_hash {
classification
=>
$self
->
type
(
'string'
,
$bug
->
classification
),
classification
=>
$self
->
type
(
'string'
,
$bug
->
classification
),
component
=>
$self
->
type
(
'string'
,
$bug
->
component
),
component
=>
$self
->
type
(
'string'
,
$bug
->
component
),
creation_time
=>
$self
->
type
(
'dateTime'
,
$bug
->
creation_ts
),
creation_time
=>
$self
->
type
(
'dateTime'
,
$bug
->
creation_ts
),
# No need to format $bug->deadline specially, because Bugzilla::Bug
# already does it for us.
deadline
=>
$self
->
type
(
'string'
,
$bug
->
deadline
),
id
=>
$self
->
type
(
'int'
,
$bug
->
bug_id
),
id
=>
$self
->
type
(
'int'
,
$bug
->
bug_id
),
is_confirmed
=>
$self
->
type
(
'boolean'
,
$bug
->
everconfirmed
),
is_confirmed
=>
$self
->
type
(
'boolean'
,
$bug
->
everconfirmed
),
last_change_time
=>
$self
->
type
(
'dateTime'
,
$bug
->
delta_ts
),
last_change_time
=>
$self
->
type
(
'dateTime'
,
$bug
->
delta_ts
),
...
@@ -943,9 +946,6 @@ sub _bug_to_hash {
...
@@ -943,9 +946,6 @@ sub _bug_to_hash {
if
(
Bugzilla
->
user
->
is_timetracker
)
{
if
(
Bugzilla
->
user
->
is_timetracker
)
{
$item
{
'estimated_time'
}
=
$self
->
type
(
'double'
,
$bug
->
estimated_time
);
$item
{
'estimated_time'
}
=
$self
->
type
(
'double'
,
$bug
->
estimated_time
);
$item
{
'remaining_time'
}
=
$self
->
type
(
'double'
,
$bug
->
remaining_time
);
$item
{
'remaining_time'
}
=
$self
->
type
(
'double'
,
$bug
->
remaining_time
);
# No need to format $bug->deadline specially, because Bugzilla::Bug
# already does it for us.
$item
{
'deadline'
}
=
$self
->
type
(
'string'
,
$bug
->
deadline
);
$item
{
'actual_time'
}
=
$self
->
type
(
'double'
,
$bug
->
actual_time
);
$item
{
'actual_time'
}
=
$self
->
type
(
'double'
,
$bug
->
actual_time
);
}
}
...
@@ -1782,9 +1782,6 @@ C<string> The login name of the person who filed this bug (the reporter).
...
@@ -1782,9 +1782,6 @@ C<string> The login name of the person who filed this bug (the reporter).
C<string> The day that this bug is due to be completed, in the format
C<string> The day that this bug is due to be completed, in the format
C<YYYY-MM-DD>.
C<YYYY-MM-DD>.
If you are not in the time-tracking group, this field will not be included
in the return value.
=item C<depends_on>
=item C<depends_on>
C<array> of C<int>s. The ids of bugs that this bug "depends on".
C<array> of C<int>s. The ids of bugs that this bug "depends on".
...
...
buglist.cgi
View file @
46e5d925
...
@@ -522,11 +522,9 @@ else {
...
@@ -522,11 +522,9 @@ else {
# Remove the timetracking columns if they are not a part of the group
# Remove the timetracking columns if they are not a part of the group
# (happens if a user had access to time tracking and it was revoked/disabled)
# (happens if a user had access to time tracking and it was revoked/disabled)
if
(
!
$user
->
is_timetracker
)
{
if
(
!
$user
->
is_timetracker
)
{
@displaycolumns
=
grep
(
$_
ne
'estimated_time'
,
@displaycolumns
);
foreach
my
$tt_field
(
TIMETRACKING_FIELDS
)
{
@displaycolumns
=
grep
(
$_
ne
'remaining_time'
,
@displaycolumns
);
@displaycolumns
=
grep
(
$_
ne
$tt_field
,
@displaycolumns
);
@displaycolumns
=
grep
(
$_
ne
'actual_time'
,
@displaycolumns
);
}
@displaycolumns
=
grep
(
$_
ne
'percentage_complete'
,
@displaycolumns
);
@displaycolumns
=
grep
(
$_
ne
'deadline'
,
@displaycolumns
);
}
}
# Remove the relevance column if the user is not doing a fulltext search.
# Remove the relevance column if the user is not doing a fulltext search.
...
...
colchange.cgi
View file @
46e5d925
...
@@ -26,6 +26,7 @@ use constant COLUMN_PARAMS => {
...
@@ -26,6 +26,7 @@ use constant COLUMN_PARAMS => {
'usetargetmilestone'
=>
[
'target_milestone'
],
'usetargetmilestone'
=>
[
'target_milestone'
],
'useqacontact'
=>
[
'qa_contact'
,
'qa_contact_realname'
],
'useqacontact'
=>
[
'qa_contact'
,
'qa_contact_realname'
],
'usestatuswhiteboard'
=>
[
'status_whiteboard'
],
'usestatuswhiteboard'
=>
[
'status_whiteboard'
],
'timetrackinggroup'
=>
[
'deadline'
],
};
};
# We only show these columns if an object of this type exists in the
# We only show these columns if an object of this type exists in the
...
...
config.cgi
View file @
46e5d925
...
@@ -100,7 +100,9 @@ $vars->{'closed_status'} = \@closed_status;
...
@@ -100,7 +100,9 @@ $vars->{'closed_status'} = \@closed_status;
my
@fields
=
@
{
Bugzilla::
Field
->
match
({
obsolete
=>
0
})};
my
@fields
=
@
{
Bugzilla::
Field
->
match
({
obsolete
=>
0
})};
# Exclude fields the user cannot query.
# Exclude fields the user cannot query.
if
(
!
$user
->
is_timetracker
)
{
if
(
!
$user
->
is_timetracker
)
{
@fields
=
grep
{
$_
->
name
!~
/^(estimated_time|remaining_time|work_time|percentage_complete|deadline)$/
}
@fields
;
foreach
my
$tt_field
(
TIMETRACKING_FIELDS
)
{
@fields
=
grep
{
$_
->
name
ne
$tt_field
}
@fields
;
}
}
}
my
%
FIELD_PARAMS
=
(
my
%
FIELD_PARAMS
=
(
...
...
docs/en/xml/using.xml
View file @
46e5d925
...
@@ -1174,7 +1174,8 @@
...
@@ -1174,7 +1174,8 @@
Users who belong to the group specified by the
<quote>
timetrackinggroup
</quote>
Users who belong to the group specified by the
<quote>
timetrackinggroup
</quote>
parameter have access to time-related fields. Developers can see
parameter have access to time-related fields. Developers can see
deadlines and estimated times to fix bugs, and can provide time spent
deadlines and estimated times to fix bugs, and can provide time spent
on these bugs.
on these bugs. Users who do not belong to this group can only see the deadline,
but not edit it. Other time-related fields remain invisible to them.
</para>
</para>
<para>
<para>
...
...
query.cgi
View file @
46e5d925
...
@@ -190,9 +190,9 @@ foreach my $val (editable_bug_fields()) {
...
@@ -190,9 +190,9 @@ foreach my $val (editable_bug_fields()) {
if
(
$user
->
is_timetracker
)
{
if
(
$user
->
is_timetracker
)
{
push
@chfields
,
"work_time"
;
push
@chfields
,
"work_time"
;
}
else
{
}
else
{
@chfields
=
grep
(
$_
ne
"deadline"
,
@chfields
);
foreach
my
$tt_field
(
TIMETRACKING_FIELDS
)
{
@chfields
=
grep
(
$_
ne
"estimated_time"
,
@chfields
);
@chfields
=
grep
(
$_
ne
$tt_field
,
@chfields
);
@chfields
=
grep
(
$_
ne
"remaining_time"
,
@chfields
);
}
}
}
@chfields
=
(
sort
(
@chfields
));
@chfields
=
(
sort
(
@chfields
));
$vars
->
{
'chfield'
}
=
\
@chfields
;
$vars
->
{
'chfield'
}
=
\
@chfields
;
...
...
show_bug.cgi
View file @
46e5d925
...
@@ -111,7 +111,7 @@ if ($cgi->param("field")) {
...
@@ -111,7 +111,7 @@ if ($cgi->param("field")) {
}
}
unless
(
$user
->
is_timetracker
)
{
unless
(
$user
->
is_timetracker
)
{
@fieldlist
=
grep
(
$_
!~
/
(^deadline|_time)
$/
,
@fieldlist
);
@fieldlist
=
grep
(
$_
!~
/
_time
$/
,
@fieldlist
);
}
}
foreach
(
@fieldlist
)
{
foreach
(
@fieldlist
)
{
...
...
template/en/default/bug/edit.html.tmpl
View file @
46e5d925
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
[% PROCESS section_spacer %]
[% PROCESS section_spacer %]
[%# *** severity, priority, version
and milesto
ne *** %]
[%# *** severity, priority, version
, milestone, and deadli
ne *** %]
[% PROCESS section_details2 %]
[% PROCESS section_details2 %]
[%# *** assigned to and qa contact *** %]
[%# *** assigned to and qa contact *** %]
...
@@ -356,6 +356,9 @@
...
@@ -356,6 +356,9 @@
</tr>
</tr>
[% END %]
[% END %]
[% IF Param("timetrackinggroup") && bug.deadline %]
[% INCLUDE bug/field.html.tmpl field = bug_fields.deadline, value = bug.deadline, editable = 0 %]
[% END %]
[% END %]
[% END %]
[%############################################################################%]
[%############################################################################%]
...
...
template/en/default/bug/show-multiple.html.tmpl
View file @
46e5d925
...
@@ -233,6 +233,8 @@
...
@@ -233,6 +233,8 @@
</table>
</table>
</td>
</td>
</tr>
</tr>
[% END %]
[% IF Param("timetrackinggroup") && bug.deadline %]
[% PROCESS row cell="deadline" %]
[% PROCESS row cell="deadline" %]
[% END %]
[% END %]
...
...
template/en/default/search/form.html.tmpl
View file @
46e5d925
...
@@ -114,7 +114,7 @@ TUI_hide_default('information_query');
...
@@ -114,7 +114,7 @@ TUI_hide_default('information_query');
[%+ field_descs.longdesc FILTER html %]s, [%+ field_descs.bug_file_loc FILTER html %],
[%+ field_descs.longdesc FILTER html %]s, [%+ field_descs.bug_file_loc FILTER html %],
[% IF Param('usestatuswhiteboard') %] [%+ field_descs.status_whiteboard FILTER html %], [%+ END %]
[% IF Param('usestatuswhiteboard') %] [%+ field_descs.status_whiteboard FILTER html %], [%+ END %]
[% IF use_keywords %] [%+ field_descs.keywords FILTER html %], [%+ END %]
[% IF use_keywords %] [%+ field_descs.keywords FILTER html %], [%+ END %]
[% IF
user.is_timetracker
%] [%+ field_descs.deadline FILTER html %], [%+ END %]
[% IF
Param('timetrackinggroup')
%] [%+ field_descs.deadline FILTER html %], [%+ END %]
[% terms.Bug %] Numbers, [%+ field_descs.version FILTER html %],
[% terms.Bug %] Numbers, [%+ field_descs.version FILTER html %],
[% IF Param('usetargetmilestone') %] [%+ field_descs.target_milestone FILTER html %], [%+ END %]
[% IF Param('usetargetmilestone') %] [%+ field_descs.target_milestone FILTER html %], [%+ END %]
[% field_descs.bug_severity FILTER html %], [%+ field_descs.priority FILTER html %], [%+ field_descs.rep_platform FILTER html %],
[% field_descs.bug_severity FILTER html %], [%+ field_descs.priority FILTER html %], [%+ field_descs.rep_platform FILTER html %],
...
@@ -153,8 +153,7 @@ TUI_hide_default('information_query');
...
@@ -153,8 +153,7 @@ TUI_hide_default('information_query');
</div>
</div>
[% END %]
[% END %]
[%# Deadline %]
[% IF Param('timetrackinggroup') %]
[% IF user.is_timetracker %]
<div class="search_field_row">
<div class="search_field_row">
[% INCLUDE "search/field.html.tmpl"
[% INCLUDE "search/field.html.tmpl"
field = bug_fields.deadline
field = bug_fields.deadline
...
...
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