[evolvis-commits] r17568: [#2025] task tracker: missing headline in .csv-files //Bugfix

papel at evolvis.org papel at evolvis.org
Thu Sep 22 12:43:43 CEST 2011


Author: papel
Date: 2011-09-22 12:43:43 +0200 (Thu, 22 Sep 2011)
New Revision: 17568

Modified:
   trunk/gforge_base/evolvisforge/gforge/www/pm/downloadcsv.php
Log:
[#2025] task tracker: missing headline in .csv-files //Bugfix

Modified: trunk/gforge_base/evolvisforge/gforge/www/pm/downloadcsv.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/pm/downloadcsv.php	2011-09-20 12:56:52 UTC (rev 17567)
+++ trunk/gforge_base/evolvisforge/gforge/www/pm/downloadcsv.php	2011-09-22 10:43:43 UTC (rev 17568)
@@ -57,6 +57,8 @@
     exit_error('Error',$ptf->getErrorMessage());
 }
 
+echo 'project_task_id,external_id,parent_id,summary,duration,hours,start_date,end_date,percent_complete,priority,details,assigned_to,is_dependent_on_task_id,link_type';
+echo "\n";
 //
 //	Iterate the array of tasks and dump them out to a comma-separated file
 //
@@ -68,7 +70,6 @@
 	echo $pt_arr[$i]->getID().','.
 		$pt_arr[$i]->getExternalID().','.
 		$pt_arr[$i]->getParentID().','.
-		','.
 		str_replace($arrRemove, ' ', $pt_arr[$i]->getSummary()).','.
 		$pt_arr[$i]->getDuration().','.
 		$pt_arr[$i]->getHours().','.
@@ -79,27 +80,42 @@
 		str_replace($arrRemove, ' ', $pt_arr[$i]->getDetails()).',';
 
 		$users =& user_get_objects($pt_arr[$i]->getAssignedTo());
-		for ($j=0; $j<5; $j++) {
+		for ($j=0; $j<count($users); $j++) {
 			if ($j < count($users)) {
 				if ($users[$j]->getUnixName() != 'none') {
-					echo $users[$j]->getUnixName();
+					echo $users[$j]->getUnixName(). ' ';
 				}
 			}
-			echo ',';
+			echo ' ';
 		}
+		
+		echo ',';	
 
 		$dependentOn =& $pt_arr[$i]->getDependentOn();
 		$keys=array_keys($dependentOn);
-		for ($j=0; $j<5; $j++) {
+		for ($j=0; $j<count($keys); $j++) {
 			if ($j < count($keys)) {
-				echo $keys[$j].',,'.$dependentOn[$keys[$j]];
+				echo $keys[$j].' ';
+				
+				
+			/* Disabled because I don't get the reason of this code. Please correct me if I am wrong with this.	
 			} else {
 				echo ',,';
 			}
+			
 			if ($j<4) {
 				echo ',';
 			}
+			*/
+			}
 		}
+		
+		echo ',';
+		for($j=0; $j<count($keys);$j++) {
+			if($j < count($keys)) {
+				echo $dependentOn[$keys[$j]].' ';
+			}
+		}
 	echo "\n";
 }
 ?>



More information about the evolvis-commits mailing list