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
9f774e4a
Commit
9f774e4a
authored
Nov 05, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 401953: Move work_time validation from process_bug to Bugzilla::Bug
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
parent
682cf8e7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
27 deletions
+8
-27
Bug.pm
Bugzilla/Bug.pm
+6
-0
process_bug.cgi
process_bug.cgi
+2
-27
No files found.
Bugzilla/Bug.pm
View file @
9f774e4a
...
...
@@ -496,6 +496,10 @@ sub update {
$dbh
->
do
(
"INSERT INTO longdescs (bug_id, who, bug_when, $columns)
VALUES (?,?,?,$qmarks)"
,
undef
,
$self
->
bug_id
,
Bugzilla
->
user
->
id
,
$delta_ts
,
@values
);
if
(
$comment
->
{
work_time
})
{
LogActivityEntry
(
$self
->
id
,
"work_time"
,
""
,
$comment
->
{
work_time
},
Bugzilla
->
user
->
id
,
$delta_ts
);
}
}
# Insert the values into the multiselect value tables
...
...
@@ -1547,6 +1551,8 @@ sub add_comment {
$params
||=
{};
if
(
exists
$params
->
{
work_time
})
{
$params
->
{
work_time
}
=
$self
->
_check_work_time
(
$params
->
{
work_time
});
ThrowUserError
(
'comment_required'
)
if
$comment
eq
''
&&
$params
->
{
work_time
}
!=
0
;
}
if
(
exists
$params
->
{
type
})
{
$params
->
{
type
}
=
$self
->
_check_comment_type
(
$params
->
{
type
});
...
...
process_bug.cgi
View file @
9f774e4a
...
...
@@ -164,21 +164,6 @@ $cgi->param('dontchange','') unless defined $cgi->param('dontchange');
# Make sure the 'knob' param is defined; else set it to 'none'.
$cgi
->
param
(
'knob'
,
'none'
)
unless
defined
$cgi
->
param
(
'knob'
);
# Validate work_time
if
(
defined
$cgi
->
param
(
'work_time'
)
&&
$cgi
->
param
(
'work_time'
)
ne
$cgi
->
param
(
'dontchange'
))
{
$cgi
->
param
(
'work_time'
,
$bug
->
_check_time
(
$cgi
->
param
(
'work_time'
),
'work_time'
));
}
if
(
Bugzilla
->
user
->
in_group
(
Bugzilla
->
params
->
{
'timetrackinggroup'
}))
{
my
$wk_time
=
$cgi
->
param
(
'work_time'
);
if
(
!
comment_exists
()
&&
$wk_time
&&
$wk_time
!=
0
)
{
ThrowUserError
(
'comment_required'
);
}
}
$cgi
->
param
(
'comment'
,
$bug
->
_check_comment
(
$cgi
->
param
(
'comment'
)));
# If the bug(s) being modified have dependencies, validate them
...
...
@@ -927,17 +912,12 @@ foreach my $id (@idlist) {
exit
;
}
my
$work_time
;
if
(
Bugzilla
->
user
->
in_group
(
Bugzilla
->
params
->
{
'timetrackinggroup'
}))
{
$work_time
=
$cgi
->
param
(
'work_time'
);
}
if
(
$cgi
->
param
(
'comment'
)
||
$work_time
||
$duplicate
)
{
if
(
$cgi
->
param
(
'comment'
)
||
$cgi
->
param
(
'work_time'
)
||
$duplicate
)
{
my
$type
=
$duplicate
?
CMT_DUPE_OF
:
CMT_NORMAL
;
$bug_objects
{
$id
}
->
add_comment
(
scalar
(
$cgi
->
param
(
'comment'
)),
{
isprivate
=>
scalar
(
$cgi
->
param
(
'commentprivacy'
)),
work_time
=>
$work_time
,
type
=>
$type
,
work_time
=>
scalar
$cgi
->
param
(
'work_time'
)
,
type
=>
$type
,
extra_data
=>
$duplicate
});
$bug_changed
=
1
;
}
...
...
@@ -948,11 +928,6 @@ foreach my $id (@idlist) {
$timestamp
=
$dbh
->
selectrow_array
(
q{SELECT NOW()}
);
if
(
$work_time
)
{
LogActivityEntry
(
$id
,
"work_time"
,
""
,
$work_time
,
$whoid
,
$timestamp
);
}
$bug_objects
{
$id
}
->
update
(
$timestamp
);
$bug_objects
{
$id
}
->
update_keywords
(
$timestamp
);
...
...
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