[Fusionforge-commits] r9340 - trunk/gforge/www/tracker

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


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

Modified:
   trunk/gforge/www/tracker/query.php
Log:
Allow text fields and selectbox to be sorted in a query (tracker)

Modified: trunk/gforge/www/tracker/query.php
===================================================================
--- trunk/gforge/www/tracker/query.php	2010-04-02 20:41:42 UTC (rev 9339)
+++ trunk/gforge/www/tracker/query.php	2010-04-02 20:41:46 UTC (rev 9340)
@@ -330,6 +330,22 @@
 	</tr>';
 	$ath->renderExtraFields($extra_fields,true,'None',true,'Any','',false,'QUERY');
 
+	// Compute the list of fields which can be sorted.
+	// Currently, only scalar artifacts are taken.
+	$efarr = $ath->getExtraFields(ARTIFACT_EXTRAFIELDTYPE_TEXT.",".
+								  ARTIFACT_EXTRAFIELDTYPE_TEXTAREA.",".
+								  ARTIFACT_EXTRAFIELDTYPE_INTEGER.",".
+								  ARTIFACT_EXTRAFIELDTYPE_SELECT.",".
+								  ARTIFACT_EXTRAFIELDTYPE_RADIO.",".
+								  ARTIFACT_EXTRAFIELDTYPE_STATUS);
+	$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'];
+	}
+	array_multisort($order_name_arr, $order_arr);
+
 	$tips = '<i>'._('(% for wildcards)').'</i>&nbsp;&nbsp;&nbsp;';
 	
 echo '




More information about the Fusionforge-commits mailing list