|
From: Ulf E. <ulf...@us...> - 2005-08-22 20:44:23
|
Update of /cvsroot/phpbt/phpbt/inc/db In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21276/phpbt/inc/db Modified Files: mysql.php Log Message: RFE #784058 - show number of comments, attachments and/or votes in buglist Index: mysql.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/db/mysql.php,v retrieving revision 1.24 retrieving revision 1.25 diff -u -r1.24 -r1.25 --- mysql.php 22 Aug 2005 20:30:56 -0000 1.24 +++ mysql.php 22 Aug 2005 20:44:16 -0000 1.25 @@ -77,11 +77,17 @@ 'and b.component_id = c.component_id and b.project_id = p.project_id '. 'and b.status_id = st.status_id', 'bug-prev-next' => 'select b.bug_id, reporter.login as reporter, '. - 'owner.login as owner '. + 'owner.login as owner, '. + 'count(distinct comment.comment_id) as comments, '. + 'count(distinct attachment.attachment_id) as attachments, '. + 'count(distinct vote.user_id) as votes '. 'from '.TBL_BUG.' b '. 'left join '.TBL_AUTH_USER.' owner on b.assigned_to = owner.user_id '. 'left join '.TBL_AUTH_USER.' reporter on b.created_by = reporter.user_id '. 'left join '.TBL_AUTH_USER.' lastmodifier on b.last_modified_by = lastmodifier.user_id '. + 'left join '.TBL_COMMENT.' comment on b.bug_id = comment.bug_id '. + 'left join '.TBL_ATTACHMENT.' attachment on b.bug_id = attachment.bug_id '. + 'left join '.TBL_BUG_VOTE.' vote on b.bug_id = vote.bug_id '. 'left join '.TBL_BOOKMARK.' bookmark on b.bug_id = bookmark.bug_id '. 'left join '.TBL_RESOLUTION.' resolution on b.resolution_id = resolution.resolution_id '. 'left join '.TBL_DATABASE.' on b.database_id = '.TBL_DATABASE.'.database_id '. @@ -157,6 +163,9 @@ 'left join '.TBL_AUTH_USER.' owner on b.assigned_to = owner.user_id '. 'left join '.TBL_AUTH_USER.' reporter on b.created_by = reporter.user_id '. 'left join '.TBL_AUTH_USER.' lastmodifier on b.last_modified_by = lastmodifier.user_id '. + 'left join '.TBL_COMMENT.' comment on b.bug_id = comment.bug_id '. + 'left join '.TBL_ATTACHMENT.' attachment on b.bug_id = attachment.bug_id '. + 'left join '.TBL_BUG_VOTE.' vote on b.bug_id = vote.bug_id '. 'left join '.TBL_BOOKMARK.' bookmark on b.bug_id = bookmark.bug_id '. 'left join '.TBL_RESOLUTION.' resolution on b.resolution_id = resolution.resolution_id '. 'left join '.TBL_DATABASE.' on b.database_id = '.TBL_DATABASE.'.database_id '. |