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
9ffc6eb5
Commit
9ffc6eb5
authored
Mar 10, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 283561: Move AppendComment out of globals.pl
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=vladd, a=justdave
parent
7bfeeb63
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
29 deletions
+33
-29
Bug.pm
Bugzilla/Bug.pm
+33
-0
globals.pl
globals.pl
+0
-29
No files found.
Bugzilla/Bug.pm
View file @
9ffc6eb5
...
...
@@ -47,6 +47,7 @@ use Bugzilla::Error;
use
base
qw(Exporter)
;
@
Bugzilla::Bug::
EXPORT
=
qw(
AppendComment
bug_alias_to_id
ValidateComment
)
;
...
...
@@ -603,6 +604,38 @@ sub bug_alias_to_id ($) {
# Subroutines
#####################################################################
sub
AppendComment
($$$;$$$) {
my
(
$bugid
,
$who
,
$comment
,
$isprivate
,
$timestamp
,
$work_time
)
=
@_
;
$work_time
||=
0
;
my
$dbh
=
Bugzilla
->
dbh
;
ValidateTime
(
$work_time
,
"work_time"
)
if
$work_time
;
trick_taint
(
$work_time
);
# Use the date/time we were given if possible (allowing calling code
# to synchronize the comment's timestamp with those of other records).
$timestamp
=
"NOW()"
unless
$timestamp
;
$comment
=~
s/\r\n/\n/g
;
# Handle Windows-style line endings.
$comment
=~
s/\r/\n/g
;
# Handle Mac-style line endings.
if
(
$comment
=~
/^\s*$/
)
{
# Nothin' but whitespace
return
;
}
# Comments are always safe, because we always display their raw contents,
# and we use them in a placeholder below.
trick_taint
(
$comment
);
my
$whoid
=
&::
DBNameToIdAndCheck
(
$who
);
my
$privacyval
=
$isprivate
?
1
:
0
;
$dbh
->
do
(
q{INSERT INTO longdescs
(bug_id, who, bug_when, thetext, isprivate, work_time)
VALUES (?,?,?,?,?,?)}
,
undef
,
(
$bugid
,
$whoid
,
$timestamp
,
$comment
,
$privacyval
,
$work_time
));
$dbh
->
do
(
"UPDATE bugs SET delta_ts = ? WHERE bug_id = ?"
,
undef
,
$timestamp
,
$bugid
);
}
sub
EmitDependList
{
my
(
$myfield
,
$targetfield
,
$bug_id
)
=
(
@_
);
my
$dbh
=
Bugzilla
->
dbh
;
...
...
globals.pl
View file @
9ffc6eb5
...
...
@@ -109,35 +109,6 @@ $::SIG{PIPE} = 'IGNORE';
#}
#$::SIG{__DIE__} = \&die_with_dignity;
sub
AppendComment
{
my
(
$bugid
,
$who
,
$comment
,
$isprivate
,
$timestamp
,
$work_time
)
=
@_
;
$work_time
||=
0
;
if
(
$work_time
)
{
require
Bugzilla::
Bug
;
Bugzilla::Bug::
ValidateTime
(
$work_time
,
"work_time"
);
}
# Use the date/time we were given if possible (allowing calling code
# to synchronize the comment's timestamp with those of other records).
$timestamp
=
(
$timestamp
?
SqlQuote
(
$timestamp
)
:
"NOW()"
);
$comment
=~
s/\r\n/\n/g
;
# Get rid of windows-style line endings.
$comment
=~
s/\r/\n/g
;
# Get rid of mac-style line endings.
if
(
$comment
=~
/^\s*$/
)
{
# Nothin' but whitespace
return
;
}
my
$whoid
=
DBNameToIdAndCheck
(
$who
);
my
$privacyval
=
$isprivate
?
1
:
0
;
SendSQL
(
"INSERT INTO longdescs (bug_id, who, bug_when, thetext, isprivate, work_time) "
.
"VALUES($bugid, $whoid, $timestamp, "
.
SqlQuote
(
$comment
)
.
", "
.
$privacyval
.
", "
.
SqlQuote
(
$work_time
)
.
")"
);
SendSQL
(
"UPDATE bugs SET delta_ts = $timestamp WHERE bug_id = $bugid"
);
}
sub
GetFieldID
{
my
(
$f
)
=
(
@_
);
SendSQL
(
"SELECT fieldid FROM fielddefs WHERE name = "
.
SqlQuote
(
$f
));
...
...
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