[evolvis-commits] r17577: [#1056] Selecting a "dependent on task" in Task Detail View is not stored. //Bugfix

papel at evolvis.org papel at evolvis.org
Wed Oct 5 11:42:15 CEST 2011


Author: papel
Date: 2011-10-05 11:42:15 +0200 (Wed, 05 Oct 2011)
New Revision: 17577

Added:
   trunk/gforge_base/evolvisforge/gforge/common/include/pkginfo.inc.php
Modified:
   trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
   trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php
   trunk/gforge_base/evolvisforge/gforge/www/include/Layout.class.php
   trunk/gforge_base/evolvisforge/gforge/www/pm/include/ProjectTaskHTML.class.php
   trunk/gforge_base/evolvisforge/gforge/www/pm/mod_task.php
   trunk/gforge_base/evolvisforge/gforge/www/pm/task.php
Log:
[#1056] Selecting a "dependent on task" in Task Detail View is not stored. //Bugfix

Added: trunk/gforge_base/evolvisforge/gforge/common/include/pkginfo.inc.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/pkginfo.inc.php	                        (rev 0)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/pkginfo.inc.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -0,0 +1,13 @@
+<?php
+$forge_pkg_name = 'EvolvisForge';
+$forge_pkg_version = '4.8.3+evolvis36+fixes3';
+
+function forgeplucker_meta() {
+        /*-
+         * Forge-Identification Meta Header, Version 1.0
+         * cf. http://home.gna.org/forgeplucker/forge-identification.html
+         */
+        return '<meta name="Forge-Identification" ' .
+            "content=\"FusionForge:4.8.3+evolvis36+fixes3\" />\n";
+}
+?>

Modified: trunk/gforge_base/evolvisforge/gforge/common/include/utils.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2011-10-05 09:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/common/include/utils.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -1323,6 +1323,14 @@
 	return false;
 }
 
+function removeEmptyArrayIndexes($arr) {
+	for ($i=0 ; $i<=count($arr);$i++) { 
+   		if ($arr[$i]=="" || $arr[$i] == null) {
+    		unset($arr[$i]); //eleminate empty indexes
+    	}
+	}  	
+	return $arr;
+}
 
 // Local Variables:
 // mode: php

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:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/common/pm/ProjectTask.class.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -25,6 +25,7 @@
  * USA
  */
 
+require_once $gfcommon.'include/utils.php';
 require_once $gfcommon.'include/Error.class.php';
 require_once $gfcommon.'include/Validator.class.php';
 
@@ -747,7 +748,7 @@
 	 */
 	function checkCircular($depend_on_id, $original_id) {
 		//for msproject users - ms project has more complex logic than gforge
-		return true;
+		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\''));
@@ -774,11 +775,11 @@
 	 * @param	array	The array of project_task_id's.
 	 * @returns	boolean	success.
 	 */
-	function setDependentOn(&$arr_) {
-//printr($arr_,'setDependentOn entry');
+	function setDependentOn($arr_) {
 //
 //	IMPORTANT - MUST VERIFY NO CIRCULAR DEPENDENCY!!
-//
+//		
+		
 		if (!$arr_ || empty($arr_)) {
 			$arr_=array('100'=>PM_LINK_DEFAULT);
 		}
@@ -788,9 +789,7 @@
 
 		if (count($arr) || count($arr2)) {
 			$add_arr = array_values (array_diff ($arr, $arr2));
-//echo "add arr: ".print_r($add_arr);
 			$del_arr = array_values (array_diff ($arr2, $arr));
-//echo "del arr: ".print_r($del_arr);
 			for ($i=0; $i<count($del_arr); $i++) {
 				db_query_params ('DELETE FROM project_dependencies
 					WHERE project_task_id=$1
@@ -806,9 +805,9 @@
 				//
 				//	Check task for circular dependencies
 				//
-				if (!$this->checkCircular($add_arr[$i],$this->getID())) {
+				/* 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;
@@ -817,8 +816,9 @@
 						 array ($this->getID(),
 							$add_arr[$i],
 							$lnk)) ;
+							
 				if (db_error()) {
-					$this->setError('setDependentOn()-2:: '.db_error().$sql);
+					$this->setError('setDependentOn()-2:: '.db_error());
 					return false;
 				}
 			}
@@ -835,8 +835,9 @@
 	 *  Here we are converting an array like array(1,5,9,77) to array(1=>SS,5=>SF,9=>FS,77=>SS)
 	 */
 	function &convertDependentOn($arr) {
-//echo "<p>Convert Dep0: ".print_r($arr);
-		$deps =& $this->getDependentOn();
+		
+		$deps = $this->getDependentOn();
+		
 		for ($i=0; $i<count($arr); $i++) {
 			if (util_ifsetor($deps[$arr[$i]])) {
 				//use existing link_type if it exists
@@ -846,7 +847,6 @@
 				$new[$arr[$i]]=PM_LINK_DEFAULT;
 			}
 		}
-//echo "<p>Convert Dep1: ".print_r($new);
 		return $new;
 	}
 
@@ -1000,6 +1000,8 @@
 			return false;
 		}
 
+		/* We should remove out commented source code if not needed anymore or 
+		 * comment the reason why it is still in the source code */
 		/*if ( ($this->getSummary() != $summary) || ($this->getDetails() != $details) ||
 			 ($this->getPriority() != $priority) || ($this->getHours() != $hours) ||
 			 ($this->getStartDate() != $start_date) || ($this->getEndDate() != $end_date) ||
@@ -1035,7 +1037,6 @@
 			//
 			$status_id=1;
 			$category_id='100';
-			unset($assigned_to);
 			$assigned_to=array('100');
 			$this->ProjectGroup =& $newProjectGroup;
 			$this->addHistory('group_project_id', $group_project_id, $new_group_project_id);
@@ -1047,7 +1048,7 @@
 		if ($details) {
 			$has_changes = true;
 			if($details != "" && $details != null) {$arrChangedAndInNotice['details'] = ">";}
-			//Message vorhanden;
+			//Message available
 			if (!$this->addMessage($details)) {
 				db_rollback();
 				return false;
@@ -1111,13 +1112,12 @@
 		if (!is_array($depend_arr)) {
 			$depend_arr = array();
 		}
-		$diff_array=array_diff($old_array,array_keys($depend_arr));
-		if (count($diff_array)>0) {
-			for ($tmp=0;$tmp<count($old_array);$tmp++) {
-				$this->addHistory('dependent_on_id',
-				    util_ifsetor($old_array[$tmp]),
-				    util_ifsetor($depend_arr[$tmp]));
-			}
+		
+		$diff_array=array_diff(array_keys($depend_arr),$old_array);
+		if (count($diff_array)>0) {	
+			$commaSeparatedOldArray = implode(",", $old_array);
+			$commaSeparatedDependArray = implode(",", array_keys($depend_arr));
+			$this->addHistory('dependent_on_id', $commaSeparatedOldArray, $commaSeparatedDependArray);
 			$has_changes = true;
 		}
 
@@ -1156,7 +1156,7 @@
 						       $group_project_id,
 						       $this->getID())) ;
 			if (!$res) {
-				$this->setError('Error On ProjectTask::update-5: '.db_error().$sql);
+				$this->setError('Error On ProjectTask::update-5: '.db_error());
 				db_rollback();
 				return false;
 			} else {

Modified: trunk/gforge_base/evolvisforge/gforge/www/include/Layout.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/include/Layout.class.php	2011-10-05 09:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/www/include/Layout.class.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -14,7 +14,7 @@
  
 require_once $gfcommon.'include/constants.php';
 require_once $gfwww.'search/include/SearchManager.class.php';
-require_once $gfcommon.'pkginfo.inc.php';
+require_once $gfcommon.'/include/pkginfo.inc.php';
 
 class Layout extends Error {
 

Modified: trunk/gforge_base/evolvisforge/gforge/www/pm/include/ProjectTaskHTML.class.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/pm/include/ProjectTaskHTML.class.php	2011-10-05 09:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/www/pm/include/ProjectTaskHTML.class.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -75,10 +75,9 @@
 
 
 	function showDependentTasks () {
-		$sql="SELECT project_task.project_task_id,project_task.summary 
-			FROM project_task,project_dependencies 
-			WHERE project_task.project_task_id=project_dependencies.project_task_id 
-			AND project_dependencies.is_dependent_on_task_id='". $this->getID() ."'";
+		$sql="SELECT project_task.project_task_id,project_task.summary FROM project_task".
+		" INNER JOIN project_dependencies ON (project_task.project_task_id = project_dependencies.is_dependent_on_task_id)".
+		" WHERE project_dependencies.project_task_id='". $this->getID() ."'";
 		$result=db_query($sql);
 		$rows=db_numrows($result);
 
@@ -95,7 +94,7 @@
 				echo '
 				<tr '. $GLOBALS['HTML']->boxGetAltRowStyle($i) .'>
 					<td>'
-					.util_make_link ('/pm/task.php?func=detailtask&project_task_id='. db_result($result, $i, 'project_task_id'). '&group_id='. $this->ProjectGroup->Group->getID() . '&group_project_id='. $this->ProjectGroup->getID(), db_result($result, $i, 'project_task_id')).'</td>
+					.util_make_link ('/pm/task.php?func=detailtask&project_task_id='. db_result($result, $i, 'project_task_id'). '&group_id='. $this->ProjectGroup->Group->getID() . '&group_project_id='. $this->ProjectGroup->getID(), db_result($result, $i, 'project_task_id')).'</td>
 					<td>'.db_result($result, $i, 'summary').'</td></tr>';
 			}
 

Modified: trunk/gforge_base/evolvisforge/gforge/www/pm/mod_task.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/pm/mod_task.php	2011-10-05 09:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/www/pm/mod_task.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -222,7 +222,7 @@
 		/*
 			List of possible users that this one could be assigned to
 		*/
-		echo $pt->multipleAssignedBox ();
+		echo $pt->multipleAssignedBox();
 		?>
 		</td>
 

Modified: trunk/gforge_base/evolvisforge/gforge/www/pm/task.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/pm/task.php	2011-10-05 09:34:14 UTC (rev 17576)
+++ trunk/gforge_base/evolvisforge/gforge/www/pm/task.php	2011-10-05 09:42:15 UTC (rev 17577)
@@ -273,8 +273,6 @@
 				}
 				$feedback=_('Task Updated Successfully');
 				
-				#Detailtask begin
-				#include $gfwww.'pm/browse_task.php'; OLD	
 				$pt=new ProjectTaskHTML($pg,$project_task_id);
 				if (!$pt || !is_object($pt)) {
 					exit_error('Error','Could Not Get ProjectTask');
@@ -286,9 +284,7 @@
 					include $gfwww.'pm/mod_task.php';
 				} else {
 					include $gfwww.'pm/detail_task.php';
-				}	
-				#detailtask end
-				
+				}
 			}
 		} else {
 			exit_permission_denied();



More information about the evolvis-commits mailing list