[Fusionforge-commits] r9341 - in trunk/gforge/www/tracker: . include

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


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

Modified:
   trunk/gforge/www/tracker/browse.php
   trunk/gforge/www/tracker/include/ArtifactTypeHtml.class.php
Log:
Manage integer fields in tracker.

Modified: trunk/gforge/www/tracker/browse.php
===================================================================
--- trunk/gforge/www/tracker/browse.php	2010-04-02 20:41:46 UTC (rev 9340)
+++ trunk/gforge/www/tracker/browse.php	2010-04-02 20:41:52 UTC (rev 9341)
@@ -325,6 +325,16 @@
 	</td>
 	<td align="right">';
 
+// Compute the list of fields which can be sorted.
+// Currently, only text & integer are taken (for simplicity only).
+$efarr = $ath->getExtraFields(ARTIFACT_EXTRAFIELDTYPE_TEXT.",".ARTIFACT_EXTRAFIELDTYPE_INTEGER);
+$keys=array_keys($efarr);
+for ($k=0; $k<count($keys); $k++) {
+	$i=$keys[$k];
+	$order_name_arr[] = $efarr[$i]['field_name'];
+	$order_arr[] = $efarr[$i]['extra_field_id'];
+}
+
 echo _('Order by').
 	':&nbsp;<a href="javascript:help_window(\'/help/tracker.php?helpname=sort_by\')">' .
 	'<strong>(?)</strong></a>'.

Modified: trunk/gforge/www/tracker/include/ArtifactTypeHtml.class.php
===================================================================
--- trunk/gforge/www/tracker/include/ArtifactTypeHtml.class.php	2010-04-02 20:41:46 UTC (rev 9340)
+++ trunk/gforge/www/tracker/include/ArtifactTypeHtml.class.php	2010-04-02 20:41:52 UTC (rev 9341)
@@ -219,7 +219,8 @@
 
 				$str = $this->renderRadio($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$show_100,$text_100,$show_any,$text_any);
 
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT) {
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+					$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
 
 				$str = $this->renderTextField($efarr[$i]['extra_field_id'],$selected[$efarr[$i]['extra_field_id']],$efarr[$i]['attribute1'],$efarr[$i]['attribute2']);
 				if ($mode == 'QUERY') {
@@ -381,7 +382,8 @@
 				$return .= '
 					<td width="50%" valign="top">'.$name.'<br /><!--'.$efarr[$i]['field_name'].'--></td>';
 
-			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT) {
+			} elseif ($efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_TEXT ||
+				$efarr[$i]['field_type'] == ARTIFACT_EXTRAFIELDTYPE_INTEGER) {
 
 				//text fields might be really wide, so need a row to themselves.
 				if (($col_count == 1) && ($efarr[$i]['attribute1'] > 30)) {




More information about the Fusionforge-commits mailing list