[Fusionforge-commits] r8673 - in trunk/gforge/common: include pm reporting survey

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Fri Jan 15 20:34:23 CET 2010


Author: aljeux
Date: 2010-01-15 20:34:23 +0100 (Fri, 15 Jan 2010)
New Revision: 8673

Modified:
   trunk/gforge/common/include/Stats.class.php
   trunk/gforge/common/pm/ProjectCategory.class.php
   trunk/gforge/common/pm/ProjectGroup.class.php
   trunk/gforge/common/pm/ProjectTask.class.php
   trunk/gforge/common/reporting/report_utils.php
   trunk/gforge/common/survey/SurveyFactory.class.php
   trunk/gforge/common/survey/SurveyQuestion.class.php
   trunk/gforge/common/survey/SurveyQuestionFactory.class.php
Log:
Misc cleanup, mostly $sql removed

Modified: trunk/gforge/common/include/Stats.class.php
===================================================================
--- trunk/gforge/common/include/Stats.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/include/Stats.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -59,7 +59,6 @@
 	* @return a resultset of group_name, unix_group_name, group_id, ranking, percentile
 	*/
 	function getMostActiveStats($type, $offset) {
-		$sql="";
 		if ($type == 'week') 	{
 			return db_query_params ('SELECT groups.group_name,groups.unix_group_name,groups.group_id,project_weekly_metric.ranking,project_weekly_metric.percentile FROM groups,project_weekly_metric WHERE groups.group_id=project_weekly_metric.group_id AND groups.is_public=1 ORDER BY ranking ASC',
 						array(),

Modified: trunk/gforge/common/pm/ProjectCategory.class.php
===================================================================
--- trunk/gforge/common/pm/ProjectCategory.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/pm/ProjectCategory.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -184,10 +184,6 @@
 			$this->setMissingParamsError();
 			return false;
 		}   
-		$sql="UPDATE project_category 
-			SET category_name='".htmlspecialchars($name)."'
-			WHERE category_id='". $this->getID() ."' 
-			AND group_project_id='".$this->ProjectGroup->getID()."'";
 		$result = db_query_params ('UPDATE project_category SET category_name=$1
 			WHERE category_id=$2 AND group_project_id=$3',
 					   array (htmlspecialchars($name),

Modified: trunk/gforge/common/pm/ProjectGroup.class.php
===================================================================
--- trunk/gforge/common/pm/ProjectGroup.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/pm/ProjectGroup.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -308,7 +308,6 @@
 	 */
 	function getTechnicians () {
 		if (!$this->technicians) {
-			$sql="";
 			$this->technicians = db_query_params ('SELECT users.user_id, users.realname 
 				FROM users, role_setting, user_group
 				WHERE users.user_id=user_group.user_id

Modified: trunk/gforge/common/pm/ProjectTask.class.php
===================================================================
--- trunk/gforge/common/pm/ProjectTask.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/pm/ProjectTask.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -693,8 +693,6 @@
 	 * @returns	boolean	success.
 	 */
 	function addHistory ($field_name,$old_value) {
-		$sql="insert into project_history(project_task_id,field_name,old_value,mod_by,mod_date) 
-			VALUES ('". $this->getID() ."','$field_name','$old_value','".user_getid()."','".time()."')";
 		$result = db_query_params ('INSERT INTO project_history (project_task_id,field_name,old_value,mod_by,mod_date) VALUES ($1,$2,$3,$4,$5)',
 					   array ($this->getID(),
 						  $field_name,

Modified: trunk/gforge/common/reporting/report_utils.php
===================================================================
--- trunk/gforge/common/reporting/report_utils.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/reporting/report_utils.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -63,7 +63,7 @@
 }
 
 function report_day_adjust_box($Report, $name='days_adjust', $selected=false) {
-	$days[]='0.0';
+	$days[]='0';
 	$days[]='1';
 	$days[]='2';
 	$days[]='3';

Modified: trunk/gforge/common/survey/SurveyFactory.class.php
===================================================================
--- trunk/gforge/common/survey/SurveyFactory.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/survey/SurveyFactory.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -92,6 +92,7 @@
 			$this->setError(_('No Survey is found').db_error());
 			return false;
 		} else {
+			$this->surveys = array();
 			while ($arr = db_fetch_array($result)) {
 				$this->surveys[] = new Survey($this->Group, $arr['survey_id'], $arr);
 			}

Modified: trunk/gforge/common/survey/SurveyQuestion.class.php
===================================================================
--- trunk/gforge/common/survey/SurveyQuestion.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/survey/SurveyQuestion.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -143,8 +143,6 @@
 		$group_id = $this->Group->GetID();
 		$question_id = $this->getID();
 
-		$sql="";
-	
 		$res = db_query_params ('UPDATE survey_questions SET question=$1, question_type=$2 where question_id=$3 AND group_id=$4',
 					array (htmlspecialchars($question),
 					       $question_type,

Modified: trunk/gforge/common/survey/SurveyQuestionFactory.class.php
===================================================================
--- trunk/gforge/common/survey/SurveyQuestionFactory.class.php	2010-01-14 17:21:55 UTC (rev 8672)
+++ trunk/gforge/common/survey/SurveyQuestionFactory.class.php	2010-01-15 19:34:23 UTC (rev 8673)
@@ -85,13 +85,11 @@
 		}
 
 		$group_id = $this->Group->GetID();		
-		$sql="";
-
 		$result = db_query_params ('SELECT survey_questions.*,survey_question_types.type 
 			FROM survey_questions,survey_question_types 
 			WHERE survey_question_types.id=survey_questions.question_type 
                         AND survey_questions.group_id=$1
-			ORDER BY survey_questions.question_id DESC',
+			ORDER BY survey_questions.question_id ASC',
 					   array ($group_id));
 
 		if (!$result) {




More information about the Fusionforge-commits mailing list