[Fusionforge-commits] r10753 - trunk/src/www/tracker/admin

Roland Mas lolando at libremir.placard.fr.eu.org
Tue Sep 28 15:29:06 CEST 2010


Author: lolando
Date: 2010-09-28 15:29:06 +0200 (Tue, 28 Sep 2010)
New Revision: 10753

Modified:
   trunk/src/www/tracker/admin/form-workflow_roles.php
Log:
Less SQL, more code reuse

Modified: trunk/src/www/tracker/admin/form-workflow_roles.php
===================================================================
--- trunk/src/www/tracker/admin/form-workflow_roles.php	2010-09-28 12:55:59 UTC (rev 10752)
+++ trunk/src/www/tracker/admin/form-workflow_roles.php	2010-09-28 13:29:06 UTC (rev 10753)
@@ -66,13 +66,12 @@
 		<input type="hidden" name="next" value="<?php echo $next ?>" />
     	
 <?php 
-		$res=db_query_params ('SELECT role_id,role_name 
-			FROM role WHERE group_id=$1 ORDER BY role_name',
-			array($group_id));
-		while($arr = db_fetch_array($res)) {
-			$value = in_array($arr['role_id'], $roles)? ' checked="checked"' : '';
-			$str = '<input type="checkbox" name="role['.$arr['role_id'].']"'.$value.' />';
-			$str .= ' '.$arr['role_name'];
+		$group_roles = $group->getRoles() ;
+		sortRoleList ($group_roles) ;
+		foreach ($group_roles as $role) {
+			$value = in_array($role->getID(), $roles)? ' checked="checked"' : '';
+			$str = '<input type="checkbox" name="role['.$role->getID().']"'.$value.' />';
+			$str .= ' '.$role->getDisplayableName($group);
 			echo $str."<br />\n";
 		}
 ?>		




More information about the Fusionforge-commits mailing list