[Fusionforge-commits] r10469 - in trunk/src: common/docman www/docman

Franck VILLAUME nerville at libremir.placard.fr.eu.org
Tue Sep 14 11:06:08 CEST 2010


Author: nerville
Date: 2010-09-14 11:06:08 +0200 (Tue, 14 Sep 2010)
New Revision: 10469

Modified:
   trunk/src/common/docman/DocumentGroup.class.php
   trunk/src/common/docman/DocumentGroupFactory.class.php
   trunk/src/www/docman/index.php
Log:
various fix : php warning, empty lines, robust code

Modified: trunk/src/common/docman/DocumentGroup.class.php
===================================================================
--- trunk/src/common/docman/DocumentGroup.class.php	2010-09-14 08:39:00 UTC (rev 10468)
+++ trunk/src/common/docman/DocumentGroup.class.php	2010-09-14 09:06:08 UTC (rev 10469)
@@ -126,10 +126,11 @@
 			return false;
 		}
 
-		$result = db_query_params ('INSERT INTO doc_groups (group_id,groupname,parent_doc_group) VALUES ($1, $2, $3)',
+		$result = db_query_params ('INSERT INTO doc_groups (group_id,groupname,parent_doc_group,stateid) VALUES ($1, $2, $3, $4)',
 					   array ($this->Group->getID(),
 						  htmlspecialchars($name),
-						  $parent_doc_group)) ;
+                          $parent_doc_group,
+                          '1')) ;
 		if ($result && db_affected_rows($result) > 0) {
 			$this->clearError();
 		} else {
@@ -200,7 +201,7 @@
 			$this->setError(_('DocumentGroup: Invalid DocumentGroup ID'));
 			return false;
 		}
-		$this->data_array =& db_fetch_array($res);
+		$this->data_array = db_fetch_array($res);
 		db_free_result($res);
 		return true;
 	}

Modified: trunk/src/common/docman/DocumentGroupFactory.class.php
===================================================================
--- trunk/src/common/docman/DocumentGroupFactory.class.php	2010-09-14 08:39:00 UTC (rev 10468)
+++ trunk/src/common/docman/DocumentGroupFactory.class.php	2010-09-14 09:06:08 UTC (rev 10469)
@@ -66,7 +66,6 @@
 		}
 		$this->Group =& $Group;
 
-
 		return true;
 	}
 
@@ -82,7 +81,7 @@
 		}
 		
 		$result = db_query_params ('SELECT * FROM doc_groups WHERE group_id=$1 AND stateid=$2 ORDER BY groupname ASC',
-					   array ($this->Group->getID(),$stateid)) ;
+					   array ($this->Group->getID(),$stateid));
 		$rows = db_numrows($result);
 		
 		if (!$result || $rows < 1) {
@@ -101,11 +100,10 @@
 			
 		}
 
-		
 		return $this->nested_groups;
-
 	}
-		/**
+
+	/**
 	 *	getDocumentGroups - Return an array of DocumentGroup objects.
 	 *
 	 *	@param int		The stateid of DocumentGroups
@@ -129,10 +127,7 @@
 			}
 		}
 		
-
-		
 		return $this->flat_groups;
-
 	}
 }
 

Modified: trunk/src/www/docman/index.php
===================================================================
--- trunk/src/www/docman/index.php	2010-09-14 08:39:00 UTC (rev 10468)
+++ trunk/src/www/docman/index.php	2010-09-14 09:06:08 UTC (rev 10469)
@@ -68,10 +68,11 @@
 if ($dgf->isError())
 	exit_error(_('Error'),$dgf->getErrorMessage());
 
-$nested_groups =& $dgf->getNested();
+$nested_groups = $dgf->getNested();
+if ($dgf->isError())
+    exit_error(_('Error'),$dgf->getErrorMessage());
 
 $dgh = new DocumentGroupHTML($g);
-
 if ($dgh->isError())
 	exit_error('Error',$dgh->getErrorMessage());
 




More information about the Fusionforge-commits mailing list