[Fusionforge-commits] r7878 - in trunk/gforge/www/tracker: admin reporting

Roland Mas lolando at libremir.placard.fr.eu.org
Fri Jun 19 15:00:29 CEST 2009


Author: lolando
Date: 2009-06-19 15:00:28 +0200 (Fri, 19 Jun 2009)
New Revision: 7878

Modified:
   trunk/gforge/www/tracker/admin/form-workflow_roles.php
   trunk/gforge/www/tracker/admin/updates.php
   trunk/gforge/www/tracker/reporting/index.php
Log:
Semi-automated db_query_params() transition for simple cases

Modified: trunk/gforge/www/tracker/admin/form-workflow_roles.php
===================================================================
--- trunk/gforge/www/tracker/admin/form-workflow_roles.php	2009-06-19 13:00:17 UTC (rev 7877)
+++ trunk/gforge/www/tracker/admin/form-workflow_roles.php	2009-06-19 13:00:28 UTC (rev 7878)
@@ -42,8 +42,9 @@
 		<input type="hidden" name="next" value="<?php echo $next ?>" />
     	
 <?php 
-		$res=db_query("SELECT role_id,role_name 
-			FROM role WHERE group_id='$group_id' ORDER BY role_name");
+		$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.' />';

Modified: trunk/gforge/www/tracker/admin/updates.php
===================================================================
--- trunk/gforge/www/tracker/admin/updates.php	2009-06-19 13:00:17 UTC (rev 7877)
+++ trunk/gforge/www/tracker/admin/updates.php	2009-06-19 13:00:28 UTC (rev 7878)
@@ -139,8 +139,9 @@
 				//
 				// create an object for each selected type
 				//
-				$result = db_query("SELECT * FROM artifact_extra_field_list 
-					WHERE extra_field_id='$selectid'");
+				$result = db_query_params ('SELECT * FROM artifact_extra_field_list 
+					WHERE extra_field_id=$1',
+			array($selectid));
 				$typeid = db_result($result,0,'group_artifact_id');
 				$dest_tracker =& artifactType_get_object($typeid);
 				if (!$dest_tracker || !is_object($dest_tracker)) {

Modified: trunk/gforge/www/tracker/reporting/index.php
===================================================================
--- trunk/gforge/www/tracker/reporting/index.php	2009-06-19 13:00:17 UTC (rev 7877)
+++ trunk/gforge/www/tracker/reporting/index.php	2009-06-19 13:00:28 UTC (rev 7878)
@@ -49,7 +49,8 @@
 /*
  * Set the start date to birth of the project.
  */
-$res=db_query("SELECT register_time FROM groups WHERE group_id=$group_id");
+$res=db_query_params ('SELECT register_time FROM groups WHERE group_id=$1',
+			array($group_id));
 $report->site_start_date=db_result($res,0,'register_time');
 
 if (!$start) {




More information about the Fusionforge-commits mailing list