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
5ce0b3db
Commit
5ce0b3db
authored
Aug 15, 2006
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 324296: Bugzilla::Bug->vote_count should be its own subroutine
Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
parent
2d8a09df
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
Bug.pm
Bugzilla/Bug.pm
+17
-14
No files found.
Bugzilla/Bug.pm
View file @
5ce0b3db
...
...
@@ -108,29 +108,18 @@ sub _init {
bug_file_loc, short_desc, target_milestone,
qa_contact AS qa_contact_id, status_whiteboard, "
.
$dbh
->
sql_date_format
(
'creation_ts'
,
'%Y.%m.%d %H:%i'
)
.
",
delta_ts, COALESCE(SUM(votes.vote_count), 0), everconfirmed,
reporter_accessible, cclist_accessible,
delta_ts, everconfirmed, reporter_accessible, cclist_accessible,
estimated_time, remaining_time, "
.
$dbh
->
sql_date_format
(
'deadline'
,
'%Y-%m-%d'
)
.
$custom_fields
.
"
FROM bugs
LEFT JOIN votes
ON bugs.bug_id = votes.bug_id
INNER JOIN components
ON components.id = bugs.component_id
INNER JOIN products
ON products.id = bugs.product_id
INNER JOIN classifications
ON classifications.id = products.classification_id
WHERE bugs.bug_id = ? "
.
$dbh
->
sql_group_by
(
'bugs.bug_id'
,
"alias, products.classification_id,
classifications.name, bugs.product_id, products.name, version,
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, everconfirmed, creation_ts,
delta_ts, reporter_accessible, cclist_accessible,
estimated_time, remaining_time, deadline $custom_fields"
);
WHERE bugs.bug_id = ?"
;
my
$bug_sth
=
$dbh
->
prepare
(
$query
);
$bug_sth
->
execute
(
$bug_id
);
...
...
@@ -146,7 +135,7 @@ sub _init {
"assigned_to_id"
,
"reporter_id"
,
"bug_file_loc"
,
"short_desc"
,
"target_milestone"
,
"qa_contact_id"
,
"status_whiteboard"
,
"creation_ts"
,
"delta_ts"
,
"
votes"
,
"
everconfirmed"
,
"creation_ts"
,
"delta_ts"
,
"everconfirmed"
,
"reporter_accessible"
,
"cclist_accessible"
,
"estimated_time"
,
"remaining_time"
,
"deadline"
,
Bugzilla
->
custom_field_names
)
...
...
@@ -658,6 +647,20 @@ sub settable_resolutions {
return
$resolutions
;
}
sub
votes
{
my
(
$self
)
=
@_
;
return
0
if
$self
->
{
error
};
return
$self
->
{
votes
}
if
defined
$self
->
{
votes
};
my
$dbh
=
Bugzilla
->
dbh
;
$self
->
{
votes
}
=
$dbh
->
selectrow_array
(
'SELECT SUM(vote_count) FROM votes
WHERE bug_id = ? '
.
$dbh
->
sql_group_by
(
'bug_id'
),
undef
,
$self
->
bug_id
);
$self
->
{
votes
}
||=
0
;
return
$self
->
{
votes
};
}
# Convenience Function. If you need speed, use this. If you need
# other Bug fields in addition to this, just create a new Bug with
# the alias.
...
...
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