From a5b847f3c4b67c6ae746a72a3118e93c72a65063 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Thu, 10 Nov 2011 10:13:44 +0100
Subject: [PATCH] Fix: void warning and uniform code

---
 htdocs/core/class/commonobject.class.php | 29 ++++++++++++------------
 1 file changed, 15 insertions(+), 14 deletions(-)

diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index d6ac6834b96..38ef6df39d2 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1356,13 +1356,14 @@ abstract class CommonObject
 	}
 
     /**
-     * 	   Fetch array of objects linked to current object. Links are loaded into this->linked_object array.
+     *	Fetch array of objects linked to current object. Links are loaded into this->linked_object array.
      *
-     *     @param  sourceid
-     *     @param  sourcetype
-     *     @param  targetid
-     *     @param  targettype
-     *     @param  clause			OR, AND
+     *	@param	int		$sourceid		Object source id
+     *	@param  string	$sourcetype		Object source type
+     *	@param  int		$targetid		Object target id
+     *	@param  string	$targettype		Object target type
+     *	@param  string	$clause			OR, AND clause
+     *	@return	void
      */
     function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
     {
@@ -1436,27 +1437,27 @@ abstract class CommonObject
                     if ($objecttype == 'facture')			{
                         $classpath = 'compta/facture/class';
                     }
-                    if ($objecttype == 'propal')			{
+                    else if ($objecttype == 'propal')			{
                         $classpath = 'comm/propal/class';
                     }
-                    if ($objecttype == 'shipping')			{
+                    else if ($objecttype == 'shipping')			{
                         $classpath = 'expedition/class'; $subelement = 'expedition'; $module = 'expedition_bon';
                     }
-                    if ($objecttype == 'delivery')			{
+                    else if ($objecttype == 'delivery')			{
                         $classpath = 'livraison/class'; $subelement = 'livraison'; $module = 'livraison_bon';
                     }
-                    if ($objecttype == 'invoice_supplier')	{
+                    else if ($objecttype == 'invoice_supplier')	{
                         $classpath = 'fourn/class';
                     }
-                    if ($objecttype == 'order_supplier')	{
+                    else if ($objecttype == 'order_supplier')	{
                         $classpath = 'fourn/class';
                     }
-                    if ($objecttype == 'fichinter')			{
+                    else if ($objecttype == 'fichinter')			{
                         $classpath = 'fichinter/class'; $subelement = 'fichinter'; $module = 'ficheinter';
                     }
 
                     // TODO ajout temporaire - MAXIME MANGIN
-                    if ($objecttype == 'contratabonnement')	{
+                    else if ($objecttype == 'contratabonnement')	{
                         $classpath = 'contrat/class'; $subelement = 'contrat'; $module = 'contratabonnement';
                     }
 
@@ -1464,7 +1465,7 @@ abstract class CommonObject
                     if ($objecttype == 'invoice_supplier') {
                         $classfile = 'fournisseur.facture'; $classname = 'FactureFournisseur';
                     }
-                    if ($objecttype == 'order_supplier')   {
+                    else if ($objecttype == 'order_supplier')   {
                         $classfile = 'fournisseur.commande'; $classname = 'CommandeFournisseur';
                     }
 
-- 
GitLab