[Fusionforge-commits] r13755 - in trunk/src: common/include common/search www/project/stats www/trove

Franck VILLAUME nerville at fusionforge.org
Tue Jul 12 13:49:49 CEST 2011


Author: nerville
Date: 2011-07-12 13:49:49 +0200 (Tue, 12 Jul 2011)
New Revision: 13755

Modified:
   trunk/src/common/include/database-pgsql.php
   trunk/src/common/search/SearchQuery.class.php
   trunk/src/www/project/stats/project_stats_utils.php
   trunk/src/www/trove/TroveCategory.class.php
Log:
fix error on db_server constants

Modified: trunk/src/common/include/database-pgsql.php
===================================================================
--- trunk/src/common/include/database-pgsql.php	2011-07-12 11:44:44 UTC (rev 13754)
+++ trunk/src/common/include/database-pgsql.php	2011-07-12 11:49:49 UTC (rev 13755)
@@ -107,10 +107,10 @@
 /**
  *  db_connect_if_needed() - Set up the DB connection if it's unset
  */
-function db_connect_if_needed () {
-        global $gfconn ;
+function db_connect_if_needed() {
+        global $gfconn;
         if (!isset ($gfconn)) {
-                db_connect () ;
+                db_connect();
         }
 }
 
@@ -156,7 +156,7 @@
  *  @return int result set handle.
  */
 function db_query_from_file($file,$limit='-1',$offset=0,$dbserver=NULL) {
-	db_connect_if_needed () ;
+	db_connect_if_needed();
 	$dbconn = db_switcher($dbserver) ;
 
 	global $QUERY_COUNT;
@@ -194,10 +194,10 @@
  *	@param int ability to spread load to multiple db servers.
  *	@return int result set handle.
  */
-function db_query_params($qstring,$params,$limit='-1',$offset=0,$dbserver=NULL) {
+function db_query_params($qstring, $params, $limit = '-1', $offset = 0, $dbserver = NULL) {
 	global $sysdebug_dbquery;
 
-	db_connect_if_needed () ;
+	db_connect_if_needed();
 	$dbconn = db_switcher($dbserver) ;
 
 	global $QUERY_COUNT;
@@ -286,10 +286,10 @@
 /**
  *	db_begin() - Begin a transaction.
  *
- *  @param		constant		Database server ('DB_PRIMARY', 'DB_STATS', 'DB_TROVE', 'DB_SEARCH')
- *	@return true.
+ *	@param	constant	Database server ('SYS_DB_PRIMARY', 'SYS_DB_STATS', 'SYS_DB_TROVE', 'SYS_DB_SEARCH')
+ *	@return	true.
  */
-function db_begin($dbserver=NULL) {
+function db_begin($dbserver = NULL) {
 	global $_sys_db_transaction_level;
 
 	// start database transaction only for the top-level
@@ -305,10 +305,10 @@
 /**
  *	db_commit() - Commit a transaction.
  *
- *  @param		constant		Database server ('DB_PRIMARY', 'DB_STATS', 'DB_TROVE', 'DB_SEARCH')
- *	@return true on success/false on failure.
+ *	@param	constant	Database server ('SYS_DB_PRIMARY', 'SYS_DB_STATS', 'SYS_DB_TROVE', 'SYS_DB_SEARCH')
+ *	@return	true on success/false on failure.
  */
-function db_commit($dbserver=NULL) {
+function db_commit($dbserver = NULL) {
 	global $_sys_db_transaction_level;
 
 	// check for transaction stack underflow
@@ -330,10 +330,10 @@
 /**
  *	db_rollback() - Rollback a transaction.
  *
- *  @param		constant		Database server ('DB_PRIMARY', 'DB_STATS', 'DB_TROVE', 'DB_SEARCH')
+ *	@param	constant	Database server ('SYS_DB_PRIMARY', 'SYS_DB_STATS', 'SYS_DB_TROVE', 'SYS_DB_SEARCH')
  *	@return true on success/false on failure.
  */
-function db_rollback($dbserver=NULL) {
+function db_rollback($dbserver = NULL) {
 	global $_sys_db_transaction_level;
 
 	// check for transaction stack underflow

Modified: trunk/src/common/search/SearchQuery.class.php
===================================================================
--- trunk/src/common/search/SearchQuery.class.php	2011-07-12 11:44:44 UTC (rev 13754)
+++ trunk/src/common/search/SearchQuery.class.php	2011-07-12 11:49:49 UTC (rev 13755)
@@ -178,11 +178,11 @@
 			db_query_params('select set_curcfg($1)',
 					 array ('default'));
 		}
-		$this->result = db_query_qpa (
+		$this->result = db_query_qpa(
 			$qpa,
 			$this->rowsPerPage + 1,
 			$this->offset,
-			'DB_SEARCH'
+			'SYS_DB_SEARCH'
 		);
 		$this->rowsTotalCount = db_numrows($this->result);
 		$this->rowsCount = min($this->rowsPerPage, $this->rowsTotalCount);

Modified: trunk/src/www/project/stats/project_stats_utils.php
===================================================================
--- trunk/src/www/project/stats/project_stats_utils.php	2011-07-12 11:44:44 UTC (rev 13754)
+++ trunk/src/www/project/stats/project_stats_utils.php	2011-07-12 11:49:49 UTC (rev 13755)
@@ -57,12 +57,12 @@
 		WHERE group_id=$1 ORDER BY month DESC, day DESC";
 
 	if ($span == 30) {
-		$res = db_query_params($sql, array($group_id), 30, 0, 'DB_STATS');
+		$res = db_query_params($sql, array($group_id), 30, 0, 'SYS_DB_STATS');
 	} else {
-		$res = db_query_params($sql, array($group_id),  7, 0, 'DB_STATS');
+		$res = db_query_params($sql, array($group_id),  7, 0, 'SYS_DB_STATS');
 	}
 
-	echo db_error('DB_STATS');
+	echo db_error('SYS_DB_STATS');
 
    // if there are any days, we have valid data.
 	if ( ($valid_days = db_numrows( $res )) > 0 ) {
@@ -108,7 +108,7 @@
 
 	} else {
 		echo _('Project did not exist on this date.');
-		echo db_error('DB_STATS') .'</p>';
+		echo db_error('SYS_DB_STATS') .'</p>';
 	}
 
 }
@@ -120,7 +120,7 @@
 		SELECT * FROM stats_project_months
 		WHERE group_id=$1
 		ORDER BY group_id DESC, month DESC
-	",array($group_id), -1, 0, 'DB_STATS');
+	",array($group_id), -1, 0, 'SYS_DB_STATS');
 
 	   // if there are any weeks, we have valid data.
 	if ( ($valid_months = db_numrows( $res )) > 1 ) {
@@ -167,7 +167,7 @@
 
 	} else {
 		echo _('Project did not exist on this date.')."<p>";
-		echo db_error('DB_STATS');
+		echo db_error('SYS_DB_STATS');
 	}
 }
 
@@ -177,7 +177,7 @@
 		SELECT *
 		FROM stats_project_all_vw
 		WHERE group_id=$1
-	", array($group_id), -1, 0, 'DB_STATS');
+	", array($group_id), -1, 0, 'SYS_DB_STATS');
 	$row = db_fetch_array($res);
 
 	?>

Modified: trunk/src/www/trove/TroveCategory.class.php
===================================================================
--- trunk/src/www/trove/TroveCategory.class.php	2011-07-12 11:44:44 UTC (rev 13754)
+++ trunk/src/www/trove/TroveCategory.class.php	2011-07-12 11:49:49 UTC (rev 13755)
@@ -61,7 +61,7 @@
 			if (!$dataArray || !is_array($dataArray)) {
 				if (!$this->fetchData($categoryId)) {
 					$this->setError(_('Invalid Trove Category'),
-							_('That Trove category does not exist.').' '.db_error('DB_TROVE')
+							_('That Trove category does not exist.').' '.db_error('SYS_DB_TROVE')
 					);
 				}
 			} else {
@@ -180,7 +180,7 @@
 				)
 				AND trove_cat.parent=$1
 				ORDER BY fullname",
-				array($this->categoryId), -1, 0, 'DB_TROVE');
+				array($this->categoryId), -1, 0, 'SYS_DB_TROVE');
 
 			if(!$result) {
 				$this->setError();




More information about the Fusionforge-commits mailing list