[evolvis-commits] r17582: I just verified that checkCircular is used nowhere else,↵ so we can indeed remove this method; thanks for spotting

mirabilos at evolvis.org mirabilos at evolvis.org
Wed Oct 5 11:53:53 CEST 2011


Author: mirabilos
Date: 2011-10-05 11:53:53 +0200 (Wed, 05 Oct 2011)
New Revision: 17582

Modified:
   trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php
Log:
I just verified that checkCircular is used nowhere else,
so we can indeed remove this method; thanks for spotting


Modified: trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php	2011-10-05 09:52:28 UTC (rev 17581)
+++ trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php	2011-10-05 09:53:53 UTC (rev 17582)
@@ -740,36 +740,6 @@
 	}
 
 	/**
-	 * checkCircular - recursive function calls itself to look at all tasks you are dependent on.
-	 *
-	 * @param	int	The project_task_id you are dependent on.
-	 * @param	int	The project_task_id you are checking circular dependencies for.
-	 * @returns	boolean	success.
-	 */
-	function checkCircular($depend_on_id, $original_id) {
-		//for msproject users - ms project has more complex logic than gforge
-		return true; //This method always returns true. We need to check the point of it. If not needed anymore we should remove this method.
-
-		if ($depend_on_id == $original_id) {
-			$this->setError(_('Circular Dependency Detected\''));
-	 		return false;
-		}
-
-		$res = db_query_params ('SELECT is_dependent_on_task_id AS id
-			FROM project_dependencies
-			WHERE project_task_id=$1',
-					array ($depend_on_id)) ;
-		$rows=db_numrows($res);
-
-		for ($i=0; $i<$rows; $i++) {
-			if (!$this->checkCircular(db_result($res,$i,'id'), $original_id)) {
-				return false;
-			}
-		}
-		return true;
-	}
-
-	/**
 	 * setDependentOn - takes an array of project_task_id's and builds dependencies.
 	 *
 	 * @param	array	The array of project_task_id's.
@@ -805,9 +775,6 @@
 				//
 				//	Check task for circular dependencies
 				//
-				/* if (!$this->checkCircular($add_arr[$i],$this->getID())) { returns always true so it is not needed anymore. Check method for more information.
-					return false;
-				} */
 				$lnk = $arr_[$add_arr[$i]];
 				if (!$lnk) {
 					$lnk=PM_LINK_DEFAULT;



More information about the evolvis-commits mailing list