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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
63dde600
Commit
63dde600
authored
Feb 25, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 280500: Replace "DATE_FORMAT()" with Bugzilla::DB function call
Patch By Tomas Kopal <Tomas.Kopal@altap.cz> r=mkanat, a=myk
parent
32882b6e
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
36 additions
and
22 deletions
+36
-22
Attachment.pm
Bugzilla/Attachment.pm
+5
-3
Bug.pm
Bugzilla/Bug.pm
+10
-9
CGI.pl
CGI.pl
+4
-3
attachment.cgi
attachment.cgi
+5
-2
buglist.cgi
buglist.cgi
+1
-1
globals.pl
globals.pl
+3
-1
request.cgi
request.cgi
+2
-1
whine.pl
whine.pl
+6
-2
No files found.
Bugzilla/Attachment.pm
View file @
63dde600
...
...
@@ -67,6 +67,8 @@ sub query
# "attachments" variable.
my
(
$bugid
)
=
@_
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$in_editbugs
=
&::
UserInGroup
(
"editbugs"
);
&::
SendSQL
(
"SELECT product_id
FROM bugs
...
...
@@ -76,9 +78,9 @@ sub query
# Retrieve a list of attachments for this bug and write them into an array
# of hashes in which each hash represents a single attachment.
&::
SendSQL
(
"
SELECT attach_id, DATE_FORMAT(creation_ts, '%Y.%m.%d %H:%i'),
mimetype, description, ispatch, isobsolete, isprivate,
&::
SendSQL
(
"
SELECT attach_id, "
.
$dbh
->
sql_date_format
(
'creation_ts'
,
'%Y.%m.%d %H:%i'
)
.
",
mimetype, description, ispatch, isobsolete, isprivate,
submitter_id, LENGTH(thedata)
FROM attachments WHERE bug_id = $bugid ORDER BY attach_id
"
);
...
...
Bugzilla/Bug.pm
View file @
63dde600
...
...
@@ -144,18 +144,19 @@ sub initBug {
rep_platform, op_sys, bug_status, resolution, priority,
bug_severity, bugs.component_id, components.name, assigned_to,
reporter, bug_file_loc, short_desc, target_milestone,
qa_contact, status_whiteboard,
DATE_FORMAT(creation_ts,'%Y.%m.%d %H:%i')
,
qa_contact, status_whiteboard,
"
.
$dbh
->
sql_date_format
(
'creation_ts'
,
'%Y.%m.%d %H:%i'
)
.
"
,
delta_ts, COALESCE(SUM(votes.vote_count), 0),
reporter_accessible, cclist_accessible,
estimated_time, remaining_time, DATE_FORMAT(deadline,'%Y-%m-%d')
from bugs left join votes using(bug_id),
estimated_time, remaining_time, "
.
$dbh
->
sql_date_format
(
'deadline'
,
'%Y-%m-%d'
)
.
",
FROM bugs LEFT JOIN votes using(bug_id),
classifications, products, components
WHERE bugs.bug_id = ?
AND classifications.id = products.classification_id
AND products.id = bugs.product_id
AND components.id = bugs.component_id
group by
bugs.bug_id"
;
GROUP BY
bugs.bug_id"
;
my
$bug_sth
=
$dbh
->
prepare
(
$query
);
$bug_sth
->
execute
(
$bug_id
);
...
...
@@ -534,11 +535,11 @@ sub GetComments {
my
@comments
;
my
$sth
=
$dbh
->
prepare
(
"SELECT profiles.realname AS name, profiles.login_name AS email,
date_format(longdescs.bug_when,'%Y.%m.%d %H:%i') AS time,
longdescs.thetext AS body, longdescs.work_time,
"
.
$dbh
->
sql_date_format
(
'longdescs.bug_when'
,
'%Y.%m.%d %H:%i'
)
.
"
AS time,
longdescs.thetext AS body, longdescs.work_time,
isprivate, already_wrapped,
date_format(longdescs.bug_when,'%Y%m%d%H%i%s')
FROM
longdescs, profiles
"
.
$dbh
->
sql_date_format
(
'longdescs.bug_when'
,
'%Y%m%d%H%i%s'
)
.
"
FROM
longdescs, profiles
WHERE profiles.userid = longdescs.who
AND longdescs.bug_id = ?
ORDER BY longdescs.bug_when"
);
...
...
CGI.pl
View file @
63dde600
...
...
@@ -317,6 +317,7 @@ sub LogActivityEntry {
sub
GetBugActivity
{
my
(
$id
,
$starttime
)
=
(
@_
);
my
$datepart
=
""
;
my
$dbh
=
Bugzilla
->
dbh
;
die
"Invalid id: $id"
unless
$id
=~
/^\s*\d+\s*$/
;
...
...
@@ -333,9 +334,9 @@ sub GetBugActivity {
my
$query
=
"
SELECT COALESCE(fielddefs.description, bugs_activity.fieldid),
fielddefs.name,
bugs_activity.attach_id,
DATE_FORMAT(bugs_activity.bug_when,'%Y.%m.%d %H:%i:%s'),
bugs_activity.removed, bugs_activity.added,
bugs_activity.attach_id,
"
.
$dbh
->
sql_date_format
(
'bugs_activity.bug_when'
,
'%Y.%m.%d %H:%i:%s'
)
.
",
bugs_activity.removed, bugs_activity.added,
profiles.login_name
FROM bugs_activity $suppjoins LEFT JOIN fielddefs ON
bugs_activity.fieldid = fielddefs.fieldid,
...
...
attachment.cgi
View file @
63dde600
...
...
@@ -800,11 +800,14 @@ sub viewall
# Retrieve the attachments from the database and write them into an array
# of hashes where each hash represents one attachment.
my
$privacy
=
""
;
my
$dbh
=
Bugzilla
->
dbh
;
if
(
Param
(
"insidergroup"
)
&&
!
(
UserInGroup
(
Param
(
"insidergroup"
))))
{
$privacy
=
"AND isprivate < 1 "
;
}
SendSQL
(
"SELECT attach_id, DATE_FORMAT(creation_ts, '%Y.%m.%d %H:%i'),
mimetype, description, ispatch, isobsolete, isprivate,
SendSQL
(
"SELECT attach_id, "
.
$dbh
->
sql_date_format
(
'creation_ts'
,
'%Y.%m.%d %H:%i'
)
.
",
mimetype, description, ispatch, isobsolete, isprivate,
LENGTH(thedata)
FROM attachments WHERE bug_id = $::FORM{'bugid'} $privacy
ORDER BY attach_id"
);
...
...
buglist.cgi
View file @
63dde600
...
...
@@ -505,7 +505,7 @@ DefineColumn("remaining_time" , "bugs.remaining_time" , "Remaining Hou
DefineColumn
(
"actual_time"
,
"(SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id)) AS actual_time"
,
"Actual Hours"
);
DefineColumn
(
"percentage_complete"
,
"(100*((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))/((SUM(ldtime.work_time)*COUNT(DISTINCT ldtime.bug_when)/COUNT(bugs.bug_id))+bugs.remaining_time))) AS percentage_complete"
,
"% Complete"
);
DefineColumn
(
"relevance"
,
"relevance"
,
"Relevance"
);
DefineColumn
(
"deadline"
,
"DATE_FORMAT(bugs.deadline, '%Y-%m-%d')"
,
"Deadline"
);
DefineColumn
(
"deadline"
,
$dbh
->
sql_date_format
(
'bugs.deadline'
,
'%Y-%m-%d'
)
,
"Deadline"
);
################################################################################
# Display Column Determination
...
...
globals.pl
View file @
63dde600
...
...
@@ -971,7 +971,9 @@ sub GetLongDescriptionAsText {
my
$result
=
""
;
my
$count
=
0
;
my
$anyprivate
=
0
;
my
(
$query
)
=
(
"SELECT profiles.login_name, DATE_FORMAT(longdescs.bug_when,'%Y.%m.%d %H:%i'), "
.
my
$dbh
=
Bugzilla
->
dbh
;
my
(
$query
)
=
(
"SELECT profiles.login_name, "
.
$dbh
->
sql_date_format
(
'longdescs.bug_when'
,
'%Y.%m.%d %H:%i'
)
.
", "
.
" longdescs.thetext, longdescs.isprivate, "
.
" longdescs.already_wrapped "
.
"FROM longdescs, profiles "
.
...
...
request.cgi
View file @
63dde600
...
...
@@ -56,6 +56,7 @@ exit;
sub
queue
{
my
$cgi
=
Bugzilla
->
cgi
;
my
$dbh
=
Bugzilla
->
dbh
;
validateStatus
(
$cgi
->
param
(
'status'
));
validateGroup
(
$cgi
->
param
(
'group'
));
...
...
@@ -75,7 +76,7 @@ sub queue {
flags.attach_id, attachments.description,
requesters.realname, requesters.login_name,
requestees.realname, requestees.login_name,
DATE_FORMAT(flags.creation_date,'%Y.%m.%d %H:%i')
,
"
.
$dbh
->
sql_date_format
(
'flags.creation_date'
,
'%Y.%m.%d %H:%i'
)
.
"
,
"
.
# Select columns that help us weed out secure bugs to which the user
# should not have access.
...
...
whine.pl
View file @
63dde600
...
...
@@ -118,12 +118,16 @@ if (open(NOMAIL, '<', "$datadir/nomail")) {
}
# get the current date and time from the database
$sth
=
$dbh
->
prepare
(
'SELECT DATE_FORMAT( NOW(), "%y,%m,%e,%w,%k,%i")'
);
$sth
=
$dbh
->
prepare
(
'SELECT '
.
$dbh
->
sql_date_format
(
'NOW()'
,
'%y,%m,%d,%a,%H,%i'
)
);
$sth
->
execute
;
my
(
$now_year
,
$now_month
,
$now_day
,
$now_weekday
,
$now_hour
,
$now_minute
)
=
my
(
$now_year
,
$now_month
,
$now_day
,
$now_weekday
name
,
$now_hour
,
$now_minute
)
=
split
(
','
,
$sth
->
fetchrow_array
);
$sth
->
finish
;
# As DBs have different days numbering, use day name and convert it
# to the range 0-6
my
$now_weekday
=
index
(
"SunMonTueWedThuFriSat"
,
$now_weekdayname
)
/
3
;
my
@daysinmonth
=
qw(0 31 28 31 30 31 30 31 31 30 31 30 31)
;
# Alter February in case of a leap year. This simple way to do it only
# applies if you won't be looking at February of next year, which whining
...
...
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