[Fusionforge-commits] FusionForge branch master updated. a5d69073cc4051d66c9ef4326237521827265e0f

Franck Villaume nerville at fusionforge.org
Fri Aug 22 11:21:25 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "FusionForge".

The branch, master has been updated
       via  a5d69073cc4051d66c9ef4326237521827265e0f (commit)
      from  d5046aadfd5d0f3ab21c50cb3cbcc4bd536a13ed (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit a5d69073cc4051d66c9ef4326237521827265e0f
Author: Franck Villaume <franck.villaume at trivialdev.com>
Date:   Fri Aug 22 11:19:43 2014 +0200

    Project Report: use PM object rather than sql

diff --git a/src/www/project/report/index.php b/src/www/project/report/index.php
index 9b61fa6..6cfb1a0 100644
--- a/src/www/project/report/index.php
+++ b/src/www/project/report/index.php
@@ -26,6 +26,7 @@
 require_once '../../env.inc.php';
 require_once $gfcommon.'include/pre.php';
 require_once $gfcommon.'tracker/ArtifactsForUser.class.php';
+require_once $gfcommon.'pm/ProjectTasksForUser.class.php';
 
 global $HTML;
 
@@ -183,28 +184,16 @@ foreach ($group->getUsers() as $member) {
 		}
 		echo $HTML->multiTableRow(array('class' => 'priority'.$artifact->getPriority()), $cells);
 	}
-	$task_group=db_query_params("SELECT ptv.*,g.group_name,pgl.project_name
-				FROM project_task_vw ptv,
-					project_assigned_to pat,
-					groups g,
-					project_group_list pgl
-				WHERE ptv.project_task_id=pat.project_task_id
-					AND pgl.group_id=$1
-					AND g.group_id=$1
-					AND pgl.group_project_id=ptv.group_project_id
-					AND ptv.status_id=1
-					AND pat.assigned_to_id=$2
-				ORDER BY group_name,project_name",
-				array($group_id, $member->getID()));
-
-	while ( $task_type = db_fetch_array($task_group) ) {
-		if ( $task_type['percent_complete'] != 100 ) {
+	$ptfu = new ProjectTasksForUser($member);
+	$tasks = $ptfu->getTasksByGroupProjectName();
+	foreach ($tasks as $task) {
+		if ($task-> getPercentComplete() != 100) {
 			$cells = array();
-			$cells[][] = util_make_link('/pm/task.php?func=detailtask&project_task_id='. $task_type['project_task_id'].'&group_id='.$group_id.'&group_project_id='.$task_type['group_project_id'],_('Task').' '.$task_type['project_task_id']);
-			$cells[][] = $task_type['summary'];
-			$cells[][] = GetTime(time()-$task_type['start_date']);
-			$cells[][] = $task_type['percent_complete'].'% '._('done');
-			echo $HTML->multiTableRow(array('class' => 'priority'.$task_type['priority']), $cells);
+			$cells[][] = util_make_link('/pm/task.php?func=detailtask&project_task_id='. $task->getID().'&group_id='.$group_id.'&group_project_id='.$task->ProjectGroup->getID(),_('Task').' '.$task->getID());
+			$cells[][] = $task->getSummary();
+			$cells[][] = GetTime(time()-$task->getStartDate());
+			$cells[][] = $task->getPercentComplete().'% '._('done');
+			echo $HTML->multiTableRow(array('class' => 'priority'.$task->getPriority()), $cells);
 		}
 	}
 	$cells = array();

-----------------------------------------------------------------------

Summary of changes:
 src/www/project/report/index.php |   31 ++++++++++---------------------
 1 file changed, 10 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
FusionForge



More information about the Fusionforge-commits mailing list