[Fusionforge-commits] r8981 - branches/Branch_5_0/gforge/www/tracker

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Sat Mar 6 18:56:14 CET 2010


Author: aljeux
Date: 2010-03-06 18:56:14 +0100 (Sat, 06 Mar 2010)
New Revision: 8981

Modified:
   branches/Branch_5_0/gforge/www/tracker/mod.php
Log:
Fix SQL query for DataTypes (trackers)

Modified: branches/Branch_5_0/gforge/www/tracker/mod.php
===================================================================
--- branches/Branch_5_0/gforge/www/tracker/mod.php	2010-03-06 17:29:52 UTC (rev 8980)
+++ branches/Branch_5_0/gforge/www/tracker/mod.php	2010-03-06 17:56:14 UTC (rev 8981)
@@ -94,23 +94,30 @@
 //
 	$perm =& $group->getPermission(session_get_user());
 	if ($perm->isArtifactAdmin()) {
-		$alevel=' >= 0';	
+		$res = db_query_params ('SELECT agl.group_artifact_id, agl.name
+			FROM artifact_group_list agl, role_setting rs, user_group ug
+			WHERE agl.group_artifact_id=rs.ref_id
+			AND ug.user_id=$1
+			AND rs.value IN (0, 1, 2)
+			AND agl.group_id=$2
+			AND ug.role_id = rs.role_id
+			AND rs.section_name=$3',
+				array(user_getid() ,
+				      $group_id,
+				      'tracker'));
 	} else {
-		$alevel=' > 1';	
-	}
-
-	$res = db_query_params ('SELECT agl.group_artifact_id, agl.name
-		FROM artifact_group_list agl, role_setting rs, user_group ug
-		WHERE agl.group_artifact_id=rs.ref_id
-		AND ug.user_id=$1
-		AND rs.value::integer $2
-		AND agl.group_id=$3
-                AND ug.role_id = rs.role_id
-                AND rs.section_name=$4',
+		$res = db_query_params ('SELECT agl.group_artifact_id, agl.name
+			FROM artifact_group_list agl, role_setting rs, user_group ug
+			WHERE agl.group_artifact_id=rs.ref_id
+			AND ug.user_id=$1
+			AND rs.value IN (1, 2)
+			AND agl.group_id=$2
+			AND ug.role_id = rs.role_id
+			AND rs.section_name=$3',
 				array(user_getid() ,
-				      $alevel,
 				      $group_id,
 				      'tracker'));
+	}
 
 	echo html_build_select_box ($res,'new_artifact_type_id',$ath->getID(),false);
 




More information about the Fusionforge-commits mailing list