[Fusionforge-commits] r9338 - in trunk/gforge/www/tracker: . admin

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Apr 2 22:41:37 CEST 2010


Author: aljeux
Date: 2010-04-02 22:41:37 +0200 (Fri, 02 Apr 2010)
New Revision: 9338

Modified:
   trunk/gforge/www/tracker/admin/form-customizelist.php
   trunk/gforge/www/tracker/browse.php
Log:
Add 'related tasks' in the possible displayed fields in the browse list (trackers)

Modified: trunk/gforge/www/tracker/admin/form-customizelist.php
===================================================================
--- trunk/gforge/www/tracker/admin/form-customizelist.php	2010-04-02 20:41:27 UTC (rev 9337)
+++ trunk/gforge/www/tracker/admin/form-customizelist.php	2010-04-02 20:41:37 UTC (rev 9338)
@@ -28,13 +28,22 @@
 			'assigned_to' => _('Assigned To'),
 			'submitted_by' => _('Submitted By'),
 			'close_date' => _('Close Date'),
-			'details' => _('Detailed description')
-			);
+			'details' => _('Detailed description'),
+			'related_tasks' => _('Related tasks')
+		);
 
-    if(count($ath->getExtraFields(ARTIFACT_EXTRAFIELDTYPE_STATUS)) > 0) {
-      unset($fields['status_id']);
-    }
+    	if(count($ath->getExtraFields(ARTIFACT_EXTRAFIELDTYPE_STATUS)) > 0) {
+      		unset($fields['status_id']);
+    	}
 
+		// Extra fields
+		foreach ($efarr as $f) {
+			$fields[$f[0]] = $f['field_name'];
+		}
+
+		asort($fields);
+
+		// Display fields
 		foreach ($fields as $f => $name) {
 			$pos = array_search($f, $browse_fields);
 			echo "<input type=\"text\" name=\"browse_fields[$f]\" value=\"" .

Modified: trunk/gforge/www/tracker/browse.php
===================================================================
--- trunk/gforge/www/tracker/browse.php	2010-04-02 20:41:27 UTC (rev 9337)
+++ trunk/gforge/www/tracker/browse.php	2010-04-02 20:41:37 UTC (rev 9338)
@@ -446,6 +446,8 @@
 				$title=_('Assigned to');
 			if ($f == 'submitted_by')
 				$title=_('Submitted by');
+			if ($f == 'related_tasks')
+				$title=_('Related tasks');
 		}
 		$title_arr[] = $title;
 	}
@@ -493,11 +495,31 @@
 				date(_('Y-m-d H:i'),$art_arr[$i]->getCloseDate()) :'&nbsp; ') .'</td>';
 			} else if ($f == 'details') {
 				echo '<td>'. $art_arr[$i]->getDetails() .'</td>';
+			} else if ($f == 'related_tasks') {
+				echo '<td>';
+				$tasks_res = $art_arr[$i]->getRelatedTasks();
+				$s ='';
+				while ($rest = db_fetch_array($tasks_res)) {
+					$link = '/pm/task.php?func=detailtask&amp;project_task_id='.$rest['project_task_id'].
+						'&amp;group_id='.$group_id.'&amp;group_project_id='.$rest['group_project_id'];
+					$title = '[T'.$rest['project_task_id'].']';
+					if ($rest['status_id'] == 2) {
+						$title = '<strike>'.$title.'</strike>';
+					}
+					print $s.'<a href="'.$link.'" title="'.$rest['summary'].'">'.$title.'</a>';
+					$s = ' ';
+				}
+				echo '</td>';
 			} else if (intval($f) > 0) {
 				// Now display extra-fields (fields are numbers).
 				$value = $extra_data[$f]['value'];
 				if ($extra_data[$f]['type'] == 9) {
 					$value = preg_replace('/\b(\d+)\b/e', "_artifactid2url('\\1')", $value);
+				} else if ($extra_data[$f]['type'] == 7) {
+					if ($art_arr[$i]->getStatusID() == 2) {
+						$value = '<strike>'.$value.'</strike>';
+					}
+					
 				}
 				echo '<td>' . $value .'</td>';
 			} else {




More information about the Fusionforge-commits mailing list