[Fusionforge-commits] r10708 - trunk/src/www/pm/msproject

Roland Mas lolando at libremir.placard.fr.eu.org
Sat Sep 25 22:23:52 CEST 2010


Author: lolando
Date: 2010-09-25 22:23:52 +0200 (Sat, 25 Sep 2010)
New Revision: 10708

Modified:
   trunk/src/www/pm/msproject/msp.php
Log:
Less SQL, more code reuse, and less user_group

Modified: trunk/src/www/pm/msproject/msp.php
===================================================================
--- trunk/src/www/pm/msproject/msp.php	2010-09-25 20:09:05 UTC (rev 10707)
+++ trunk/src/www/pm/msproject/msp.php	2010-09-25 20:23:52 UTC (rev 10708)
@@ -220,12 +220,13 @@
 		$array['success']=false;
 		$array['errormessage']='Could Not Continue Session';
 	}
-	$group_res = db_query_params ('SELECT groups.group_id FROM groups NATURAL JOIN user_group WHERE user_id=$1 AND project_flags=$2',
-			array(user_getid(),
-				2));
-	$group_ids=&util_result_column_to_array($group_res,'group_id');
-	$groups=&group_get_objects($group_ids);
-	return $groups;
+	$projects = array () ;
+	foreach (user_get_session()->getGroups() as $p) {
+		if (forge_check_perm ('pm_admin', $p->getID())) {
+			$projects[] = $p ;
+		}
+	}
+	return $projects;
 }
 
 /**




More information about the Fusionforge-commits mailing list