[Fusionforge-commits] r10442 - trunk/src/common/pm

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Thu Sep 9 21:06:19 CEST 2010


Author: aljeux
Date: 2010-09-09 21:06:18 +0200 (Thu, 09 Sep 2010)
New Revision: 10442

Modified:
   trunk/src/common/pm/ProjectTasksForUser.class.php
Log:
Add getTasksForThisWeek() and refactor code.

Modified: trunk/src/common/pm/ProjectTasksForUser.class.php
===================================================================
--- trunk/src/common/pm/ProjectTasksForUser.class.php	2010-09-09 19:06:12 UTC (rev 10441)
+++ trunk/src/common/pm/ProjectTasksForUser.class.php	2010-09-09 19:06:18 UTC (rev 10442)
@@ -88,10 +88,7 @@
 							 array ($this->User->getID())) ;
 	}
 	
-	function &getTasksForToday() {
-		$now = getdate();
-		$today = mktime (18, 00, 00, $now['mon'], $now['mday'], $now['year']);
-		
+	function &getOpenTasksForDate($date) {
 		return $this->getTasksFromSQLwithParams ('SELECT ptv.*,g.group_name,pgl.project_name 
 			FROM project_task_vw ptv,
 				project_assigned_to pat,
@@ -104,9 +101,21 @@
 				AND ptv.status_id=1
 				AND pat.assigned_to_id=$2
 			ORDER BY group_name,project_name',
-							 array ($today,
+							 array ($date,
 								$this->User->getID())) ;
 	}
+
+	function &getTasksForToday() {
+		$now = getdate();
+		$today = mktime (18, 00, 00, $now['mon'], $now['mday'], $now['year']);
+		return $this->getOpenTasksForDate($today);
+	}
+
+	function &getTasksForThisWeek() {
+		$now = getdate();
+		$thisweek = mktime (18, 00, 00, $now['mon'], $now['mday'], $now['year'])+7*24*3600;
+		return $this->getOpenTasksForDate($thisweek);
+	}
 }
 
 // Local Variables:




More information about the Fusionforge-commits mailing list