[Fusionforge-commits] r8407 - trunk/gforge/plugins/svntracker/common

Roland Mas lolando at libremir.placard.fr.eu.org
Wed Nov 18 21:24:46 CET 2009


Author: lolando
Date: 2009-11-18 21:24:46 +0100 (Wed, 18 Nov 2009)
New Revision: 8407

Modified:
   trunk/gforge/plugins/svntracker/common/svntrackerPlugin.class.php
Log:
db_query_params() transition

Modified: trunk/gforge/plugins/svntracker/common/svntrackerPlugin.class.php
===================================================================
--- trunk/gforge/plugins/svntracker/common/svntrackerPlugin.class.php	2009-11-18 20:24:33 UTC (rev 8406)
+++ trunk/gforge/plugins/svntracker/common/svntrackerPlugin.class.php	2009-11-18 20:24:46 UTC (rev 8407)
@@ -47,9 +47,8 @@
 	* @param   integer  $group_id Group_id of the actual Group_id
 	*
 	*/
-	function getCommitEntries($Query,$group_id) {
+	function getCommitEntries($DBResult,$group_id) {
 		$group = &group_get_object($group_id);
-		$DBResult = db_query($Query);
 		$Rows= db_numrows($DBResult);
 		
 		if ($Rows > 0) {
@@ -255,20 +254,15 @@
 				$group->setPluginUse ( $this->name, false );
 			}
 		} elseif ($hookname == "artifact_extra_detail") {
-			$Query="SELECT * FROM plugin_svntracker_data_master,".
-				"plugin_svntracker_data_artifact".
-				" WHERE plugin_svntracker_data_artifact.group_artifact_id='$aid' ".
-				" AND plugin_svntracker_data_master.holder_id=".
-				" plugin_svntracker_data_artifact.id ORDER BY svn_date";
-			$this->getCommitEntries($Query, $group_id);
+			$DBResult = db_query_params ('SELECT * FROM plugin_svntracker_data_master,
+plugin_svntracker_data_artifact WHERE plugin_svntracker_data_artifact.group_artifact_id=$1 AND plugin_svntracker_data_master.holder_id=plugin_svntracker_data_artifact.id ORDER BY svn_date',
+						     array ($aid));
+			$this->getCommitEntries($DBResult, $group_id);
 		} elseif ($hookname == "task_extra_detail") {
-			$Query="SELECT * FROM plugin_svntracker_data_master,".
-				"plugin_svntracker_data_artifact".
-				" WHERE plugin_svntracker_data_artifact.project_task_id='".
-				$params['task_id']."' ".
-				" AND plugin_svntracker_data_master.holder_id=".
-				" plugin_svntracker_data_artifact.id ORDER BY svn_date";
-			$this->getCommitEntries($Query, $group_id);
+			$DBResult = db_query_params ('SELECT * FROM plugin_svntracker_data_master,
+plugin_svntracker_data_artifact WHERE plugin_svntracker_data_artifact.project_task_id=$1 AND plugin_svntracker_data_master.holder_id=plugin_svntracker_data_artifact.id ORDER BY svn_date',
+						     array ($params['task_id']));
+			$this->getCommitEntries($DBResult, $group_id);
 		} /*elseif ($hookname == "update_svn_repository") {
 			$Group = group_get_object($params["group_id"]);
 			if ($Group->usesPlugin("cvstracker")) {




More information about the Fusionforge-commits mailing list