diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 0d00a0a9127ab2a52df7df2e0bab96c1246583e8..3af059cad943c7d657f5d75227db40995cf939fe 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -3,7 +3,7 @@
  * Copyright (C) 2013-2014 Alexandre Spangaro	<alexandre.spangaro@gmail.com>
  * Copyright (C) 2014      Ari Elbaz (elarifr)	<github@accedinfo.com>
  * Copyright (C) 2013-2014 Florian Henry		<florian.henry@open-concept.pro>
- * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es> 
+ * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -26,7 +26,7 @@
  */
 
 require '../../main.inc.php';
-	
+
 // Class
 require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
 require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
@@ -64,22 +64,22 @@ if ($action == 'ventil') {
 		$cpt = 0;
 		foreach ( $mesCasesCochees as $maLigneCochee ) {
 			// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
-			$maLigneCourante = split("_", $maLigneCochee);
+			$maLigneCourante = explode("_", $maLigneCochee);
 			$monId = $maLigneCourante[0];
 			$monNumLigne = $maLigneCourante[1];
 			$monCompte = $mesCodesVentilChoisis[$monNumLigne];
-			
+
 			$sql = " UPDATE " . MAIN_DB_PREFIX . "facturedet";
 			$sql .= " SET fk_code_ventilation = " . $monCompte;
 			$sql .= " WHERE rowid = " . $monId;
-			
+
 			dol_syslog("/accountancy/customer/list.php sql=" . $sql, LOG_DEBUG);
 			if ($db->query($sql)) {
 				print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
 			} else {
 				print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
 			}
-			
+
 			$cpt ++;
 		}
 	} else {
@@ -130,15 +130,15 @@ $result = $db->query($sql);
 if ($result) {
 	$num_lines = $db->num_rows($result);
 	$i = 0;
-	
+
 	// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
 	print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
-	
+
 	print '<br><b>' . $langs->trans("DescVentilTodoCustomer") . '</b></br>';
-	
+
 	print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
 	print '<input type="hidden" name="action" value="ventil">';
-	
+
 	print '<table class="noborder" width="100%">';
 	print '<tr class="liste_titre"><td>' . $langs->trans("Invoice") . '</td>';
 	print '<td>' . $langs->trans("Ref") . '</td>';
@@ -149,24 +149,24 @@ if ($result) {
 	print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
 	print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
 	print '</tr>';
-	
+
 	$facture_static = new Facture($db);
 	$product_static = new Product($db);
 	$form = new Form($db);
-	
+
 	$var = True;
 	while ( $i < min($num_lines, $limit) ) {
 		$objp = $db->fetch_object($result);
 		$var = ! $var;
-		
+
 		// product_type: 0 = service ? 1 = product
 		// if product does not exist we use the value of product_type provided in facturedet to define if this is a product or service
 		// issue : if we change product_type value in product DB it should differ from the value stored in facturedet DB !
 		$code_sell_notset = '';
-		
+
 		if (empty($objp->code_sell)) {
 			$code_sell_notset = 'color:red';
-			
+
 			if (! empty($objp->type)) {
 				if ($objp->type == 1) {
 					$objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
@@ -175,7 +175,7 @@ if ($result) {
 				}
 			} else {
 				$code_sell_notset = 'color:blue';
-				
+
 				if ($objp->type == 1) {
 					$objp->code_sell = (! empty($conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT) ? $conf->global->ACCOUNTING_PRODUCT_SOLD_ACCOUNT : $langs->trans("CodeNotDef"));
 				} else {
@@ -183,14 +183,14 @@ if ($result) {
 				}
 			}
 		}
-		
+
 		print "<tr $bc[$var]>";
-		
+
 		// Ref facture
 		$facture_static->ref = $objp->facnumber;
 		$facture_static->id = $objp->facid;
 		print '<td>' . $facture_static->getNomUrl(1) . '</td>';
-		
+
 		// Ref produit
 		$product_static->ref = $objp->product_ref;
 		$product_static->id = $objp->product_id;
@@ -201,34 +201,34 @@ if ($result) {
 		else
 			print '&nbsp;';
 		print '</td>';
-		
+
 		print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
 		print '<td>' . nl2br(dol_trunc($objp->description, 32)) . '</td>';
-		
+
 		print '<td align="right">';
 		print price($objp->total_ht);
 		print '</td>';
-		
+
 		print '<td align="center" style="' . $code_sell_notset . '">';
 		print $objp->code_sell;
 		print '</td>';
-		
+
 		// Colonne choix du compte
 		print '<td align="center">';
 		print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
 		print '</td>';
-		
+
 		// Colonne choix ligne a ventiler
 		print '<td align="center">';
 		print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
 		print '</td>';
-		
+
 		print '</tr>';
 		$i ++;
 	}
-	
+
 	print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventilate") . '"></td></tr>';
-	
+
 	print '</table>';
 	print '</form>';
 } else {
diff --git a/htdocs/accountancy/journal/bankjournal.php b/htdocs/accountancy/journal/bankjournal.php
index cb308a7e1af9cef0e0a36769fd84a4b0e528d16a..dcd8fca4d41078a13b494b2d8b631c1973917464 100644
--- a/htdocs/accountancy/journal/bankjournal.php
+++ b/htdocs/accountancy/journal/bankjournal.php
@@ -189,7 +189,7 @@ if ($result) {
 			else if ($links[$key]['type'] == 'company')
 			{
 				$societestatic->id = $links[$key]['url_id'];
-				$societestatic->nom = $links[$key]['label'];
+				$societestatic->name = $links[$key]['label'];
 				$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
 				$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
 			}
diff --git a/htdocs/accountancy/journal/cashjournal.php b/htdocs/accountancy/journal/cashjournal.php
index 52cdbb4f616e4f1c0034e14cc28e87b0f46af2d3..8af84a9ed58a87ad3efc39d92b232cadf6cca54c 100644
--- a/htdocs/accountancy/journal/cashjournal.php
+++ b/htdocs/accountancy/journal/cashjournal.php
@@ -171,7 +171,7 @@ if ($result) {
 			} else if ($links[$key]['type'] == 'company') {
 
 				$societestatic->id = $links[$key]['url_id'];
-				$societestatic->nom = $links[$key]['label'];
+				$societestatic->name = $links[$key]['label'];
 				$tabpay[$obj->rowid]["soclib"] = $societestatic->getNomUrl(1, '', 30);
 				$tabtp[$obj->rowid][$compta_soc] += $obj->amount;
 			} else if ($links[$key]['type'] == 'sc') {
@@ -448,14 +448,14 @@ if ($action == 'export_csv') {
 
 	llxHeader('', $langs->trans("CashJournal"), '');
 
-	$nom = $langs->trans("CashJournal");
+	$name = $langs->trans("CashJournal");
 	$nomlink = '';
 	$periodlink = '';
 	$exportlink = '';
 	$builddate = time();
 	$description = $langs->trans("DescCashJournal") . '<br>';
 	$period = $form->select_date($date_start, 'date_start', 0, 0, 0, '', 1, 0, 1) . ' - ' . $form->select_date($date_end, 'date_end', 0, 0, 0, '', 1, 0, 1);
-	report_header($nom, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
+	report_header($name, $nomlink, $period, $periodlink, $description, $builddate, $exportlink, array('action' => ''));
 
 	print '<input type="button" class="button" style="float: right;" value="Export CSV" onclick="launch_export();" />';
 
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index f066821e0358560a141d34aadde5ccf691c0477b..4bf603236db8d14f801175c8abfe79fbe21902b3 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -1,7 +1,7 @@
 <?php
 /* Copyright (C) 2013-2014	Olivier Geffroy			<jeff@jeffinfo.com>
  * Copyright (C) 2013-2014	Alexandre Spangaro		<alexandre.spangaro@gmail.com>
- * Copyright (C) 2014		Ari Elbaz (elarifr)		<github@accedinfo.com>  
+ * Copyright (C) 2014		Ari Elbaz (elarifr)		<github@accedinfo.com>
  * Copyright (C) 2013-2014	Florian Henry			<florian.henry@open-concept.pro>
  * Copyright (C) 2014		Juanjo Menent			<jmenent@2byte.es>s
  *
@@ -26,7 +26,7 @@
  */
 
 require '../../main.inc.php';
-	
+
 // Class
 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
 require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
@@ -63,25 +63,25 @@ if ($action == 'ventil') {
 		print '<div><font color="red">' . count($_POST["mesCasesCochees"]) . ' ' . $langs->trans("SelectedLines") . '</font></div>';
 		$mesCodesVentilChoisis = $codeventil;
 		$cpt = 0;
-		
+
 		foreach ( $mesCasesCochees as $maLigneCochee ) {
 			// print '<div><font color="red">id selectionnee : '.$monChoix."</font></div>";
-			$maLigneCourante = split("_", $maLigneCochee);
+			$maLigneCourante = explode("_", $maLigneCochee);
 			$monId = $maLigneCourante[0];
 			$monNumLigne = $maLigneCourante[1];
 			$monCompte = $mesCodesVentilChoisis[$monNumLigne];
-			
+
 			$sql = " UPDATE " . MAIN_DB_PREFIX . "facture_fourn_det";
 			$sql .= " SET fk_code_ventilation = " . $monCompte;
 			$sql .= " WHERE rowid = " . $monId;
-			
+
 			dol_syslog('accountancy/supplier/list.php:: sql=' . $sql);
 			if ($db->query($sql)) {
 				print '<div><font color="green">' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("VentilatedinAccount") . ' : ' . $monCompte . '</font></div>';
 			} else {
 				print '<div><font color="red">' . $langs->trans("ErrorDB") . ' : ' . $langs->trans("Lineofinvoice") . ' ' . $monId . ' ' . $langs->trans("NotVentilatedinAccount") . ' : ' . $monCompte . '<br/> <pre>' . $sql . '</pre></font></div>';
 			}
-			
+
 			$cpt ++;
 		}
 	} else {
@@ -133,15 +133,15 @@ $result = $db->query($sql);
 if ($result) {
 	$num_lines = $db->num_rows($result);
 	$i = 0;
-	
+
 	// TODO : print_barre_liste always use $conf->liste_limit and do not care about custom limit in list...
 	print_barre_liste($langs->trans("InvoiceLines"), $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, '', $num_lines);
-	
+
 	print '<td align="left"><br><b>' . $langs->trans("DescVentilTodoSupplier") . '</b></br></td>';
-	
+
 	print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">' . "\n";
 	print '<input type="hidden" name="action" value="ventil">';
-	
+
 	print '<table class="noborder" width="100%">';
 	print '<tr class="liste_titre"><td>Facture</td>';
 	print '<td align="left">' . $langs->trans("Ref") . '</td>';
@@ -152,22 +152,22 @@ if ($result) {
 	print '<td align="center">' . $langs->trans("IntoAccount") . '</td>';
 	print '<td align="center">' . $langs->trans("Ventilate") . '</td>';
 	print "</tr>\n";
-	
+
 	$facturefourn_static = new FactureFournisseur($db);
 	$productfourn_static = new ProductFournisseur($db);
 	$form = new Form($db);
-	
+
 	$var = True;
 	while ( $i < min($num_lines, $limit) ) {
 		$objp = $db->fetch_object($result);
 		$var = ! $var;
 		print "<tr $bc[$var]>";
-		
+
 		// Ref facture
 		$facturefourn_static->ref = $objp->ref;
 		$facturefourn_static->id = $objp->facid;
 		print '<td>' . $facturefourn_static->getNomUrl(1) . '</td>';
-		
+
 		// Ref facture supplier
 		$productfourn_static->ref = $objp->product_ref;
 		$productfourn_static->id = $objp->product_id;
@@ -178,23 +178,23 @@ if ($result) {
 		else
 			print '&nbsp;';
 		print '</td>';
-		
+
 		// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref.'</a></td>';
-		
+
 		// print '<td><a href="'.DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$objp->facid.'">'.$objp->ref_supplier.'</a></td>';
-		
+
 		print '<td>' . dol_trunc($objp->product_label, 24) . '</td>';
-		
+
 		print '<td>' . stripslashes(nl2br($objp->description)) . '</td>';
-		
+
 		print '<td align="right">';
 		print price($objp->price);
 		print '</td>';
-		
+
 		print '<td align="right">';
 		print $objp->code_buy;
 		print '</td>';
-		
+
 		// Colonne choix du compte
 		print '<td align="center">';
 		print $formventilation->select_account($objp->aarowid, 'codeventil[]', 1);
@@ -203,15 +203,15 @@ if ($result) {
 		print '<td align="center">';
 		print '<input type="checkbox" name="mesCasesCochees[]" value="' . $objp->rowid . "_" . $i . '"' . ($objp->aarowid ? "checked" : "") . '/>';
 		print '</td>';
-		
+
 		print "</tr>";
 		$i ++;
 	}
-	
+
 	print '<tr><td colspan="8">&nbsp;</td></tr><tr><td colspan="8" align="center"><input type="submit" class="butAction" value="' . $langs->trans("Ventiler") . '"></td></tr>';
-	
+
 	print "</table>";
-	
+
 	print '</form>';
 } else {
 	print $db->error();
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 43a272cf5749d0ee61766ec49f382b14e51c40cc..2d5f3d835be71c8ed2dc8f2392b7db7fe82d85f0 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -119,7 +119,7 @@ class AdherentType extends CommonObject
         if ($result)
         {
         	$action='update';
-        	
+
         	// Actions on extra fields (by external module or standard code)
         	$hookmanager->initHooks(array('membertypedao'));
         	$parameters=array('membertype'=>$this->id);
@@ -151,21 +151,23 @@ class AdherentType extends CommonObject
      *	Fonction qui permet de supprimer le status de l'adherent
      *
      *	@param      int		$rowid		Id of member type to delete
-     *  @return		int					>0 if OK, < 0 if KO
+     *  @return		int					>0 if OK, 0 if not found, < 0 if KO
      */
-    function delete($rowid)
+    function delete($rowid='')
     {
-        $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = $rowid";
+    	if (empty($rowid)) $rowid=$this->id;
+
+        $sql = "DELETE FROM ".MAIN_DB_PREFIX."adherent_type WHERE rowid = ".$rowid;
 
         $resql=$this->db->query($sql);
         if ($resql)
         {
-            if ( $this->db->affected_rows($resql) )
+            if ($this->db->affected_rows($resql))
             {
                 return 1;
             }
             else
-            {
+			{
                 return 0;
             }
         }
diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 78c99916910f6af08962fbf9f8cca0925b6378a2..11341f632a2a24aaddb1d9c764baae4881f690ef 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -396,7 +396,7 @@ if ($conf->produit->enabled)
 	    			$var = !$var;
 
 	    			print '<tr '.$bc[$var].'>';
-	    			print '<td>'.$modBarCode->nom."</td><td>\n";
+	    			print '<td>'.(isset($modBarCode->name)?$modBarCode->name:$modBarCode->nom)."</td><td>\n";
 	    			print $modBarCode->info($langs);
 	    			print '</td>';
 	    			print '<td class="nowrap">'.$modBarCode->getExample($langs)."</td>\n";
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 1484566dbaff20949de0aded914959c32d8f4fa3..19fb5c193bb2ed64b5825f29ac80e940c54d9edd 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -287,7 +287,7 @@ if ($conf->product->enabled || $conf->product->service)
 	{
 		print $langs->trans("BarCodeNumberManager").": ";
 		$objproduct=new Product($db);
-		print '<b>'.$modBarCodeProduct->nom.'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
+		print '<b>'.(isset($modBarCodeProduct->name)?$modBarCodeProduct->name:$modBarCodeProduct->nom).'</b> - '.$langs->trans("NextValue").': <b>'.$modBarCodeProduct->getNextValue($objproduct).'</b><br>';
 		$disabled=0;
 	}
 	else
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index d4652b57353474986f3de89d60d49671c84ae543..a80796fe5746b3b4f206d49a2d15614ea9fa34d3 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -72,7 +72,7 @@ if ($type == "f")
  *
  */
 
-$sql = "SELECT s.rowid, s.nom,  st.libelle as stcomm";
+$sql = "SELECT s.rowid, s.nom as name, st.libelle as stcomm";
 $sql.= ", p.rowid as cidp, p.name, p.firstname, p.email, p.phone";
 $sql.= " FROM ".MAIN_DB_PREFIX."c_stcomm as st,";
 if (! $user->rights->societe->client->voir && ! $socid) $sql .= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
@@ -159,7 +159,7 @@ if ($resql)
 		print "<td>$obj->firstname</TD>";
 
 		print '<td><a href="'.$_SERVER["PHP_SELF"].'?type='.$type.'&socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").'</a>&nbsp;';
-		print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->nom</a></td>\n";
+		print "<a href=\"".$urlfiche."?socid=".$obj->rowid."\">$obj->name</a></td>\n";
 
 		print '<td>'.dol_print_phone($obj->email,$obj->cidp,$obj->rowid,'AC_EMAIL').'</td>';
 
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 22068860076bfef1a0f267bb9116932b57799810..c534724671982b458562683b16d475163c575c70 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -444,7 +444,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
 {
 	$langs->load("propal");
 
-	$sql = "SELECT s.nom, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
+	$sql = "SELECT s.nom as name, s.rowid, p.rowid as propalid, p.total as total_ttc, p.total_ht, p.ref, p.fk_statut, p.datep as dp, p.fin_validite as dfv";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 	$sql.= ", ".MAIN_DB_PREFIX."propal as p";
 	if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -497,7 +497,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire)
 
 				print "</td>";
 
-				print '<td align="left"><a href="card.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,44).'</a></td>'."\n";
+				print '<td align="left"><a href="card.php?socid='.$obj->rowid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,44).'</a></td>'."\n";
 				print '<td align="right">';
 				print dol_print_date($db->jdate($obj->dp),'day').'</td>'."\n";
 				print '<td align="right">'.price($obj->total_ttc).'</td>';
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 8c7f38ed60738b65b4f01c0deba6c17be44a2d0c..de51cf63104c66a42b678cd971382d338f5184d4 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -381,7 +381,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
 /*
 if (! empty($conf->propal->enabled))
 {
-	$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
 	$sql.=" FROM ".MAIN_DB_PREFIX."propal as c";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -433,7 +433,7 @@ if (! empty($conf->propal->enabled))
 
 				print '</td>';
 
-				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
 
 				print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 
@@ -453,7 +453,7 @@ if (! empty($conf->propal->enabled))
  */
 /*if (! empty($conf->propal->enabled))
 {
-	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -505,7 +505,7 @@ if (! empty($conf->propal->enabled))
 
 				print '</td>';
 
-				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
 
 				print '<td align="right">'.$propalstatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 51c07eaa5b2cdb8c5b8da958a0e73ba0fc73e21c..6522a592097946c2a8445cddabe905e2583c503d 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -142,7 +142,7 @@ if (! $sortorder) $sortorder='DESC';
 $limit = $conf->liste_limit;
 
 
-$sql = 'SELECT s.rowid, s.nom, s.town, s.client, s.code_client,';
+$sql = 'SELECT s.rowid, s.nom as name, s.town, s.client, s.code_client,';
 $sql.= ' p.rowid as propalid, p.note_private, p.total_ht, p.ref, p.ref_client, p.fk_statut, p.fk_user_author, p.datep as dp, p.fin_validite as dfv,';
 if (! $user->rights->societe->client->voir && ! $socid) $sql .= " sc.fk_soc, sc.fk_user,";
 $sql.= ' u.login';
@@ -246,7 +246,7 @@ if ($result)
 	if ($search_montant_ht)  $param.='&search_montant_ht='.$search_montant_ht;
 	if ($search_author)  	 $param.='&search_author='.$search_author;
 	if ($search_town)		 $param.='&search_town='.$search_town;
-	print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->nom:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
+	print_barre_liste($langs->trans('ListOfProposals').' '.($socid?'- '.$soc->name:''), $page, $_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
 
 	// Lignes des champs de filtre
 	print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@@ -375,7 +375,7 @@ if ($result)
 
 		// Company
 		$companystatic->id=$objp->rowid;
-		$companystatic->nom=$objp->nom;
+		$companystatic->name=$objp->name;
 		$companystatic->client=$objp->client;
 		$companystatic->code_client=$objp->code_client;
 		print '<td>';
diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php
index 7dada3e115f13f76a1b7c2f36674af34a180aadd..94286ee4c53e8b3612434bbaf3525e53d808bf74 100644
--- a/htdocs/comm/prospect/list.php
+++ b/htdocs/comm/prospect/list.php
@@ -178,7 +178,7 @@ if ($action == 'cstc')
 $formother=new FormOther($db);
 $form=new Form($db);
 
-$sql = "SELECT s.rowid, s.nom, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
+$sql = "SELECT s.rowid, s.nom as name, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
 $sql.= " st.libelle as stcomm, s.prefix_comm, s.fk_stcomm, s.fk_prospectlevel,";
 $sql.= " d.nom as departement";
 if ((!$user->rights->societe->client->voir && !$socid) || $search_sale) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
@@ -402,7 +402,7 @@ if ($resql)
 		print '<tr '.$bc[$var].'>';
 		print '<td>';
 		$prospectstatic->id=$obj->rowid;
-		$prospectstatic->nom=$obj->nom;
+		$prospectstatic->name=$obj->name;
         $prospectstatic->status=$obj->status;
         $prospectstatic->code_client=$obj->code_client;
         $prospectstatic->client=$obj->client;
diff --git a/htdocs/comm/prospect/recap-prospect.php b/htdocs/comm/prospect/recap-prospect.php
index 1eb30f02b5512520a28e6450a063835501715723..5d7358a806e38c96d4e81018ef876667c5b5aa2d 100644
--- a/htdocs/comm/prospect/recap-prospect.php
+++ b/htdocs/comm/prospect/recap-prospect.php
@@ -64,8 +64,8 @@ if ($socid > 0)
 
     print '<table class="border" width="100%">';
 
-    // Nom
-    print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
+    // Name
+    print '<tr><td width="20%">'.$langs->trans("Thirdpary").'</td><td width="80%" colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
 
 	// Prefix
     if (! empty($conf->global->SOCIETE_USEPREFIX))  // Old not used prefix field
diff --git a/htdocs/comm/recap-client.php b/htdocs/comm/recap-client.php
index bb079a34169b7f6dee2ddd609d31f01555cacd56..ec54e553bdb9911a626f8272043dc4c893dd5653 100644
--- a/htdocs/comm/recap-client.php
+++ b/htdocs/comm/recap-client.php
@@ -63,8 +63,8 @@ if ($socid > 0)
 
     print '<table class="border" width="100%">';
 
-    // Nom
-    print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
+    // Name
+    print '<tr><td width="20%">'.$langs->trans("Thirdparty").'</td><td width="80%" colspan="3">'.$societe->getNomUrl(1).'</td></tr>';
 
     // Prefix
     if (! empty($conf->global->SOCIETE_USEPREFIX))  // Old not used prefix field
diff --git a/htdocs/commande/apercu.php b/htdocs/commande/apercu.php
index 1257769b95411ead3457a6073620433d056ae6db..abb2be95076a197dd673303afefb55dc17d925b8 100644
--- a/htdocs/commande/apercu.php
+++ b/htdocs/commande/apercu.php
@@ -167,7 +167,7 @@ if ($id > 0 || ! empty($ref))
         // Client
         print "<tr><td>".$langs->trans("Customer")."</td>";
         print '<td colspan="2">';
-        print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->nom.'</a>';
+        print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->getNomUrl(1).'</a>';
         print '</td>';
         print '</tr>';
 
diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php
index 29812903d12b1a927424440062fbd26193e78aa1..f40277ea34ab53335e0fbee1bae5a2021daf84c7 100644
--- a/htdocs/commande/customer.php
+++ b/htdocs/commande/customer.php
@@ -67,7 +67,7 @@ $thirdpartystatic=new Societe($db);
  * Mode List
  */
 
-$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea";
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
 $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st, ".MAIN_DB_PREFIX."commande as c";
@@ -161,7 +161,7 @@ if ($resql)
         $lien=$lienfin='';
         $lien = '<a href="'.dol_buildpath('/commande/orderstoinvoice.php',1).'?socid='.$obj->rowid.'">';
         $lienfin='</a>';
-        $name=$obj->nom;
+        $name=$obj->name;
         $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
         $result.=$lien.(dol_trunc($name,$maxlen)).$lienfin;
 
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 705354d401bc8d1f8952e6b4be1d3763921b2d44..b7d9be0552970b9e152ecf624818e14181c9b874 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -166,7 +166,7 @@ else
  */
 if (! empty($conf->commande->enabled))
 {
-	$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -195,7 +195,7 @@ if (! empty($conf->commande->enabled))
 				print "<tr ".$bc[$var].">";
 				print '<td class="nowrap">';
 				print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
-				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
+				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td></tr>';
 				$i++;
 			}
 		}
@@ -215,7 +215,7 @@ $max=5;
  */
 
 $sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
-$sql.= " s.nom, s.rowid as socid";
+$sql.= " s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."commande as c,";
 $sql.= " ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -268,7 +268,7 @@ if ($resql)
 
 			print '</td>';
 
-			print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+			print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
 			print '<td>'.dol_print_date($db->jdate($obj->datem),'day').'</td>';
 			print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 			print '</tr>';
@@ -285,7 +285,7 @@ else dol_print_error($db);
  */
 if (! empty($conf->commande->enabled))
 {
-	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
 	$sql.=" FROM ".MAIN_DB_PREFIX."commande as c";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -337,7 +337,7 @@ if (! empty($conf->commande->enabled))
 
 				print '</td>';
 
-				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
 
 				print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 
@@ -356,7 +356,7 @@ if (! empty($conf->commande->enabled))
  */
 if (! empty($conf->commande->enabled))
 {
-	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom, s.rowid as socid";
+	$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.facture, s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -408,7 +408,7 @@ if (! empty($conf->commande->enabled))
 
 				print '</td>';
 
-				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
 
 				print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index daf73effed3ce17efa8b5c817ea294b76fba525c..bd31a438b057f45458a449fb91d7944955677164 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -112,7 +112,7 @@ $companystatic = new Societe($db);
 $help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes";
 llxHeader('',$langs->trans("Orders"),$help_url);
 
-$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
+$sql = 'SELECT s.nom as name, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
 $sql.= ' c.date_valid, c.date_commande, c.note_private, c.date_livraison, c.fk_statut, c.facture as facturee';
 $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
 $sql.= ', '.MAIN_DB_PREFIX.'commande as c';
@@ -221,7 +221,7 @@ if ($resql)
 	{
 		$soc = new Societe($db);
 		$soc->fetch($socid);
-		$title = $langs->trans('ListOfOrders') . ' - '.$soc->nom;
+		$title = $langs->trans('ListOfOrders') . ' - '.$soc->name;
 	}
 	else
 	{
@@ -367,7 +367,7 @@ if ($resql)
 
 		// Company
 		$companystatic->id=$objp->socid;
-		$companystatic->nom=$objp->nom;
+		$companystatic->name=$objp->name;
 		$companystatic->client=$objp->client;
 		print '<td>';
 		print $companystatic->getNomUrl(1,'customer');
@@ -380,7 +380,7 @@ if ($resql)
 				if (($objp->fk_statut > 0 && $objp->fk_statut < 3) || ($objp->fk_statut == 3 && $objp->facturee == 0))
 				{
 					print '&nbsp;<a href="'.DOL_URL_ROOT.'/commande/orderstoinvoice.php?socid='.$companystatic->id.'">';
-					print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->nom, 'object_bill', 'hideonsmartphone').'</a>';
+					print img_picto($langs->trans("CreateInvoiceForThisCustomer").' : '.$companystatic->name, 'object_bill', 'hideonsmartphone').'</a>';
 				}
 			}
 		}
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index eb29889f1150423b034c3f6c430ff2fd68085210..49824a7f6cb3f9df715461d37e928743f42389e1 100644
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -573,7 +573,7 @@ if (($action != 'create' && $action != 'add') || !$error)
 		{
 			// Company
 			$companystatic->id=$socid;
-			$companystatic->nom=$soc->nom;
+			$companystatic->name=$soc->name;
 			print '<h3>'.$companystatic->getNomUrl(1,'customer').'</h3>';
 		}
 
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 14b586c6d80cc9121b57a162f8c9623e2f8f3d7b..87b7d3e62c54a9ab8b97bff42dadc4e54de6c528 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -680,7 +680,7 @@ if ($id > 0 || ! empty($ref))
 					if ($links[$key]['type']=='company')
 					{
 						$societestatic->id=$links[$key]['url_id'];
-						$societestatic->nom=$links[$key]['label'];
+						$societestatic->name=$links[$key]['label'];
 						print $societestatic->getNomUrl(1,'',16);
 					}
 					else if ($links[$key]['type']=='user')
diff --git a/htdocs/compta/bank/search.php b/htdocs/compta/bank/search.php
index d30c1519f10e6b6387b97d92a00dbfedd9d3c160..25b7d91a3ffa80a83629c29b0cb35f4d14f9228c 100644
--- a/htdocs/compta/bank/search.php
+++ b/htdocs/compta/bank/search.php
@@ -4,7 +4,7 @@
  * Copyright (C) 2005-2010  Regis Houssin        <regis.houssin@capnetworks.com>
  * Copyright (C) 2012       Vinícius Nogueira    <viniciusvgn@gmail.com>
  * Copyright (C) 2014       Florian Henry    	 <florian.henry@open-cooncept.pro>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3 of the License, or
@@ -158,7 +158,7 @@ if ($resql)
 	if (GETPOST("bid"))
 	{
 		$result=$bankcateg->fetch(GETPOST("bid"));
-		print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->nom:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
+		print_barre_liste($langs->trans("BankTransactionForCategory",$bankcateg->label).' '.($socid?' '.$soc->name:''), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
 	}
 	else
 	{
@@ -166,18 +166,18 @@ if ($resql)
 	}
 
 	print '<form method="post" action="search.php" name="search_form">';
-	
+
 	$moreforfilter .= $langs->trans('Period') . ' ' . $langs->trans('StartDate') . ': ';
 	$moreforfilter .= $form->select_date($search_dt_start, 'search_start_dt', 0, 0, 1, "search_form", 1, 1, 1);
 	$moreforfilter .= $langs->trans('EndDate') . ':' . $form->select_date($search_dt_end, 'search_end_dt', 0, 0, 1, "search_form", 1, 1, 1);
-	
-	
+
+
 	if ($moreforfilter) {
 		print '<div class="liste_titre">';
 		print $moreforfilter;
 		print '</div>';
 	}
-	
+
 	print '<table class="liste" width="100%">';
 	print '<tr class="liste_titre">';
 	print_liste_field_titre($langs->trans('Ref'),$_SERVER['PHP_SELF'],'b.rowid','',$param,'',$sortfield,$sortorder);
@@ -278,7 +278,7 @@ if ($resql)
 			if ($objp->url_id)
 			{
 				$companystatic->id=$objp->url_id;
-				$companystatic->nom=$objp->labelurl;
+				$companystatic->name=$objp->labelurl;
 				print $companystatic->getNomUrl(1);
 			}
 			else
diff --git a/htdocs/compta/bank/treso.php b/htdocs/compta/bank/treso.php
index 909770cf38c7d9858e345fd9ce2ffc1e76afc743..7ac510525befb7e764d542d526e95c1aeae8a6b5 100644
--- a/htdocs/compta/bank/treso.php
+++ b/htdocs/compta/bank/treso.php
@@ -148,7 +148,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 
 	// Customer invoices
 	$sql = "SELECT 'invoice' as family, f.rowid as objid, f.facnumber as ref, f.total_ttc, f.type, f.date_lim_reglement as dlr,";
-	$sql.= " s.rowid as socid, s.nom, s.fournisseur";
+	$sql.= " s.rowid as socid, s.nom as name, s.fournisseur";
 	$sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON f.fk_soc = s.rowid";
 	$sql.= " WHERE f.entity = ".$conf->entity;
@@ -158,7 +158,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 
 	// Supplier invoices
 	$sql2= " SELECT 'invoice_supplier' as family, ff.rowid as objid, ff.ref_supplier as ref, (-1*ff.total_ttc) as total_ttc, ff.type, ff.date_lim_reglement as dlr,";
-	$sql2.= " s.rowid as socid, s.nom, s.fournisseur";
+	$sql2.= " s.rowid as socid, s.nom as name, s.fournisseur";
 	$sql2.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
 	$sql2.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON ff.fk_soc = s.rowid";
 	$sql2.= " WHERE ff.entity = ".$conf->entity;
@@ -265,7 +265,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 					$ref = $facturefournstatic->getNomUrl(1,'');
 
 					$societestatic->id = $obj->socid;
-					$societestatic->nom = $obj->nom;
+					$societestatic->name = $obj->name;
 					$refcomp=$societestatic->getNomUrl(1,'',24);
 
 					$paiement = -1*$facturefournstatic->getSommePaiement();	// Payment already done
@@ -279,7 +279,7 @@ if ($_REQUEST["account"] || $_REQUEST["ref"])
 				$ref = $facturestatic->getNomUrl(1,'');
 
 				$societestatic->id = $obj->socid;
-				$societestatic->nom = $obj->nom;
+				$societestatic->name = $obj->name;
 				$refcomp=$societestatic->getNomUrl(1,'',24);
 
 				$paiement = $facturestatic->getSommePaiement();	// Payment already done
diff --git a/htdocs/compta/clients.php b/htdocs/compta/clients.php
index dbdc8c7236844a0335c3128cec78d0613e2bcc3d..528ed14e84936cf38b2a5ea7b18e082844fb6f7b 100644
--- a/htdocs/compta/clients.php
+++ b/htdocs/compta/clients.php
@@ -73,7 +73,7 @@ if ($action == 'note')
 if ($mode == 'search') {
 	if ($modesearch == 'soc') {
 		$sql = "SELECT s.rowid FROM ".MAIN_DB_PREFIX."societe as s ";
-		$sql.= " WHERE lower(s.nom) LIKE '%".$db->escape(strtolower($socname))."%'";
+		$sql.= " WHERE s.nom LIKE '%".$db->escape(strtolower($socname))."%'";
 		$sql.= " AND s.entity IN (".getEntity('societe', 1).")";
 	}
 
@@ -93,7 +93,7 @@ if ($mode == 'search') {
  * Mode List
  */
 
-$sql = "SELECT s.rowid, s.nom, s.client, s.town, s.datec, s.datea";
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.town, s.datec, s.datea";
 $sql.= ", st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta ";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st";
@@ -107,13 +107,13 @@ if (dol_strlen($stcomm))
 }
 if ($socname)
 {
-	$sql.= " AND s.nom LIKE '%".$db->escape(strtolower($socname))."%'";
+	$sql.= " AND s.nom LIKE '%".$db->escape($socname)."%'";
 	$sortfield = "s.nom";
 	$sortorder = "ASC";
 }
 if ($_GET["search_nom"])
 {
-	$sql.= " AND s.nom LIKE '%".$db->escape(strtolower($_GET["search_nom"]))."%'";
+	$sql.= " AND s.nom LIKE '%".$db->escape($_GET["search_nom"])."%'";
 }
 if ($_GET["search_compta"])
 {
@@ -141,7 +141,7 @@ if ($resql)
 	$i = 0;
 
 	$langs->load('commercial');
-	
+
 	print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],"",$sortfield,$sortorder,'',$num);
 
 	print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
@@ -188,7 +188,7 @@ if ($resql)
 		print "<tr ".$bc[$var].">";
 		print '<td>';
 		$thirdpartystatic->id=$obj->rowid;
-		$thirdpartystatic->nom=$obj->nom;
+		$thirdpartystatic->name=$obj->name;
 		$thirdpartystatic->client=$obj->client;
 		print $thirdpartystatic->getNomUrl(1,'compta');
 		print '</td>';
diff --git a/htdocs/compta/dons/class/don.class.php b/htdocs/compta/dons/class/don.class.php
index ab33bdbb43dedc9934c71bfe45137d8db8fa467f..61e1b9cd9264931210c328bde9add39079225c1c 100644
--- a/htdocs/compta/dons/class/don.class.php
+++ b/htdocs/compta/dons/class/don.class.php
@@ -202,7 +202,8 @@ class Don extends CommonObject
 
 
     /**
-     *	Check params
+     *	Check params and init ->errors array.
+     *  TODO This function seems to not be used by core code.
      *
      *	@param	int	$minimum	Minimum
      *	@return	int				0 if KO, >0 if OK
@@ -212,39 +213,40 @@ class Don extends CommonObject
     	global $langs;
     	$langs->load('main');
     	$langs->load('companies');
-    	
+
+    	$error_string = array();
         $err = 0;
 
         if (dol_strlen(trim($this->societe)) == 0)
         {
             if ((dol_strlen(trim($this->lastname)) + dol_strlen(trim($this->firstname))) == 0)
             {
-                $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Company').'/'.$langs->trans('Firstname').'-'.$langs->trans('Lastname'));
+                $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Company').'/'.$langs->trans('Firstname').'-'.$langs->trans('Lastname'));
                 $err++;
             }
         }
 
         if (dol_strlen(trim($this->address)) == 0)
         {
-            $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Address'));
+            $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Address'));
             $err++;
         }
 
         if (dol_strlen(trim($this->zip)) == 0)
         {
-            $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Zip'));
+            $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Zip'));
             $err++;
         }
 
         if (dol_strlen(trim($this->town)) == 0)
         {
-            $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Town'));
+            $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Town'));
             $err++;
         }
 
         if (dol_strlen(trim($this->email)) == 0)
         {
-            $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('EMail'));
+            $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('EMail'));
             $err++;
         }
 
@@ -256,7 +258,7 @@ class Don extends CommonObject
         {
             if (!isset($map[substr($this->amount, $i, 1)] ))
             {
-                $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
+                $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
                 $err++;
                 $amount_invalid = 1;
                 break;
@@ -267,14 +269,14 @@ class Don extends CommonObject
         {
             if ($this->amount == 0)
             {
-                $error_string[$err] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
+                $error_string[] = $langs->trans('ErrorFieldRequired',$langs->trans('Amount'));
                 $err++;
             }
             else
             {
                 if ($this->amount < $minimum && $minimum > 0)
                 {
-                    $error_string[$err] = $langs->trans('MinimumAmount',$langs->trans('$minimum'));
+                    $error_string[] = $langs->trans('MinimumAmount',$langs->trans('$minimum'));
                     $err++;
                 }
             }
@@ -282,14 +284,13 @@ class Don extends CommonObject
 
         if ($err)
         {
-            $this->error = $error_string;
+            $this->errors = $error_string;
             return 0;
         }
         else
-        {
+		{
             return 1;
         }
-
     }
 
     /**
@@ -311,7 +312,7 @@ class Don extends CommonObject
         $this->country=($this->country?$this->country:$this->country);
 
         $now=dol_now();
-        
+
         $this->db->begin();
 
         $sql = "INSERT INTO ".MAIN_DB_PREFIX."don (";
@@ -368,7 +369,7 @@ class Don extends CommonObject
 
             // Call trigger
             $result=$this->call_trigger('DON_CREATE',$user);
-            if ($result < 0) { $error++; $this->db->rollback(); return -1; }            
+            if ($result < 0) { $error++; $this->db->rollback(); return -1; }
             // End call triggers
 
             $this->db->commit();
@@ -398,7 +399,7 @@ class Don extends CommonObject
         $this->country=($this->country?$this->country:$this->country);
 
         $this->db->begin();
-        
+
         $sql = "UPDATE ".MAIN_DB_PREFIX."don SET ";
         $sql .= "amount = " . price2num($this->amount);
         $sql .= ",fk_paiement = ".($this->modepaiementid?$this->modepaiementid:"null");
@@ -426,9 +427,9 @@ class Don extends CommonObject
         {
             // Call trigger
             $result=$this->call_trigger('DON_UPDATE',$user);
-            if ($result < 0) { $error++; $this->db->rollback(); return -1; }            
+            if ($result < 0) { $error++; $this->db->rollback(); return -1; }
             // End call triggers
-            
+
             $this->db->commit();
             return 1;
         }
@@ -448,7 +449,7 @@ class Don extends CommonObject
      */
     function delete($rowid)
     {
-        
+
         $this->db-begin();
 
         $sql = "DELETE FROM ".MAIN_DB_PREFIX."don WHERE rowid = $rowid AND fk_statut = 0;";
@@ -460,9 +461,9 @@ class Don extends CommonObject
             {
                 // Call trigger
                 $result=$this->call_trigger('DON_DELETE',$user);
-                if ($result < 0) { $error++; $this->db->rollback(); return -1; }            
+                if ($result < 0) { $error++; $this->db->rollback(); return -1; }
                 // End call triggers
-                
+
                 $this->db->commit();
                 return 1;
             }
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index c7514e96fbbe10a8f022e15d55a3c00e425783f2..02674b5974576af0039bc3e537cdd51f5dd45366 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -526,7 +526,7 @@ else
 			{
 			    	echo '<div class="inline-block divButAction"><a class="butAction" href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$object->thirdparty->id.'&amp;fac_rec='.$object->id.'">'.$langs->trans("CreateBill").'</a></div>';
 			}
-			
+
 			if ($object->statut == 0 && $user->rights->facture->supprimer)
 			{
 				print '<div class="inline-block divButAction"><a class="butActionDelete" href="'.$_SERVER['PHP_SELF'].'?action=delete&id='.$object->id.'">'.$langs->trans('Delete').'</a></div>';
@@ -544,7 +544,7 @@ else
 		/*
 		 *  List mode
 		 */
-		$sql = "SELECT s.nom, s.rowid as socid, f.titre, f.total, f.rowid as facid";
+		$sql = "SELECT s.nom as name, s.rowid as socid, f.titre, f.total, f.rowid as facid";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture_rec as f";
 		$sql.= " WHERE f.fk_soc = s.rowid";
 		$sql.= " AND f.entity = ".$conf->entity;
@@ -584,13 +584,13 @@ else
 					print "</a></td>\n";
 
 					$companystatic->id=$objp->socid;
-					$companystatic->name=$objp->nom;
+					$companystatic->name=$objp->name;
 					print '<td>'.$companystatic->getNomUrl(1,'customer').'</td>';
 
 					print '<td align="right">'.price($objp->total).'</td>'."\n";
 
 					echo '<td align="center">';
-					
+
 					if ($user->rights->facture->creer)
 					{
                         echo '<a href="'.DOL_URL_ROOT.'/compta/facture.php?action=create&amp;socid='.$objp->socid.'&amp;fac_rec='.$objp->facid.'">';
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 4db7935e69cd1b208aa7bed0b12a4ea172addfe1..d3987bcbad8145ef2efdf5dbb08344430799813d 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -395,7 +395,7 @@ if (! $sortorder) $sortorder="ASC";
 
 $limit = $conf->liste_limit;
 
-$sql = "SELECT s.nom, s.rowid as socid, s.email";
+$sql = "SELECT s.nom as name, s.rowid as socid, s.email";
 $sql.= ", f.rowid as facid, f.facnumber, f.ref_client, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc, f.localtax1, f.localtax2, f.revenuestamp";
 $sql.= ", f.datef as df, f.date_lim_reglement as datelimite";
 $sql.= ", f.paye as paye, f.fk_statut, f.type, f.fk_mode_reglement";
@@ -462,7 +462,7 @@ if ($resql)
 	$urlsource=$_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
 	$urlsource.=str_replace('&amp;','&',$param);
 
-	$titre=(! empty($socid)?$langs->trans("BillsCustomersUnpaidForCompany",$soc->nom):$langs->trans("BillsCustomersUnpaid"));
+	$titre=(! empty($socid)?$langs->trans("BillsCustomersUnpaidForCompany",$soc->name):$langs->trans("BillsCustomersUnpaid"));
 	if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
 	else $titre.=' ('.$langs->trans("All").')';
 
@@ -658,7 +658,7 @@ if ($resql)
             print '<td>';
             $thirdparty=new Societe($db);
             $thirdparty->id=$objp->socid;
-            $thirdparty->nom=$objp->nom;
+            $thirdparty->name=$objp->name;
             $thirdparty->client=$objp->client;
             $thirdparty->code_client=$objp->code_client;
             print $thirdparty->getNomUrl(1,'customer');
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 07ebfa5ad7d24df7634a44b5c4d85aa9163b46e2..39dcc6b64270dba265a02b344099ed1ac19c561b 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -144,7 +144,7 @@ else $sql = 'SELECT DISTINCT';
 $sql.= ' f.rowid as facid, f.facnumber, f.ref_client, f.type, f.note_private, f.increment, f.total as total_ht, f.tva as total_tva, f.total_ttc,';
 $sql.= ' f.datef as df, f.date_lim_reglement as datelimite,';
 $sql.= ' f.paye as paye, f.fk_statut,';
-$sql.= ' s.nom, s.rowid as socid, s.code_client, s.client ';
+$sql.= ' s.nom as name, s.rowid as socid, s.code_client, s.client ';
 if (! $sall) $sql.= ', SUM(pf.amount) as am';   // To be able to sort on status
 $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
 $sql.= ', '.MAIN_DB_PREFIX.'facture as f';
@@ -265,7 +265,7 @@ if ($resql)
     if ($search_user > 0)    $param.='&search_user=' .$search_user;
     if ($search_montant_ht)  $param.='&search_montant_ht='.$search_montant_ht;
     if ($search_montant_ttc) $param.='&search_montant_ttc='.$search_montant_ttc;
-    print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->nom:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
+    print_barre_liste($langs->trans('BillsCustomers').' '.($socid?' '.$soc->name:''),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
 
     $i = 0;
     print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">'."\n";
@@ -400,7 +400,7 @@ if ($resql)
             print '<td>';
             $thirdparty=new Societe($db);
             $thirdparty->id=$objp->socid;
-            $thirdparty->nom=$objp->nom;
+            $thirdparty->name=$objp->name;
             $thirdparty->client=$objp->client;
             $thirdparty->code_client=$objp->code_client;
             print $thirdparty->getNomUrl(1,'customer');
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index eecf5e757461944bc4b1cc8c803dd712d678f392..1908b0670ff9ae706da0a2fcb6b51cb80f3794de 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -145,7 +145,7 @@ if (! empty($conf->don->enabled) && $user->rights->don->lire)
 if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 {
 	$sql  = "SELECT f.facnumber, f.rowid, f.total_ttc, f.type,";
-	$sql.= " s.nom, s.rowid as socid";
+	$sql.= " s.nom as name, s.rowid as socid";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
 	$sql.= " FROM ".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -185,7 +185,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 				print '</td>';
 				print '<td class="nowrap">';
 				$companystatic->id=$obj->socid;
-				$companystatic->nom=$obj->nom;
+				$companystatic->name=$obj->name;
 				$companystatic->client=1;
 				print $companystatic->getNomUrl(1,'',16);
 				print '</td>';
@@ -219,7 +219,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
 {
 	$sql  = "SELECT f.ref, f.rowid, f.total_ttc, f.type,";
-	$sql.= " s.nom, s.rowid as socid";
+	$sql.= " s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as f, ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 	$sql.= " WHERE s.rowid = f.fk_soc AND f.fk_statut = 0";
@@ -254,7 +254,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 				print '</td>';
 				print '<td>';
 				$companystatic->id=$obj->socid;
-				$companystatic->nom=$obj->nom;
+				$companystatic->name=$obj->name;
 				$companystatic->client=1;
 				print $companystatic->getNomUrl(1,'',16);
 				print '</td>';
@@ -294,7 +294,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 
 	$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.type, f.total, f.total_ttc, f.paye, f.tms,";
 	$sql.= " f.date_lim_reglement as datelimite,";
-	$sql.= " s.nom, s.rowid as socid,";
+	$sql.= " s.nom as name, s.rowid as socid,";
 	$sql.= " sum(pf.amount) as am";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
@@ -351,7 +351,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 				print '</td>';
 				print '<td align="left">';
 				$thirdpartystatic->id=$obj->socid;
-				$thirdpartystatic->nom=$obj->nom;
+				$thirdpartystatic->name=$obj->name;
 				$thirdpartystatic->client=1;
 				print $thirdpartystatic->getNomUrl(1,'customer',44);
 				print '</td>';
@@ -392,7 +392,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 	$facstatic=new FactureFournisseur($db);
 
 	$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.tms, ff.paye";
-	$sql.= ", s.nom, s.rowid as socid";
+	$sql.= ", s.nom as name, s.rowid as socid";
 	$sql.= ", SUM(pf.amount) as am";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@@ -432,7 +432,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 				print '</td>';
 				print '<td>';
 				$thirdpartystatic->id=$obj->socid;
-				$thirdpartystatic->nom=$obj->nom;
+				$thirdpartystatic->name=$obj->name;
 				$thirdpartystatic->fournisseur=1;
 				print $thirdpartystatic->getNomUrl(1,'supplier',44);
 				print '</td>';
@@ -613,7 +613,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
 	$langs->load("orders");
 
 	$sql = "SELECT sum(f.total) as tot_fht, sum(f.total_ttc) as tot_fttc,";
-	$sql.= " s.nom, s.rowid as socid,";
+	$sql.= " s.nom as name, s.rowid as socid,";
 	$sql.= " c.rowid, c.ref, c.facture, c.fk_statut, c.total_ht, c.total_ttc";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -675,7 +675,7 @@ if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $us
 
 				print '<td align="left">';
                 $societestatic->id=$obj->socid;
-                $societestatic->nom=$obj->nom;
+                $societestatic->name=$obj->name;
                 $societestatic->client=1;
                 print $societestatic->getNomUrl(1,'customer',44);
 				print '</a></td>';
@@ -717,7 +717,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 
 	$sql = "SELECT f.rowid, f.facnumber, f.fk_statut, f.datef, f.type, f.total, f.total_ttc, f.paye, f.tms,";
 	$sql.= " f.date_lim_reglement as datelimite,";
-	$sql.= " s.nom, s.rowid as socid,";
+	$sql.= " s.nom as name, s.rowid as socid,";
 	$sql.= " sum(pf.amount) as am";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf on f.rowid=pf.fk_facture";
@@ -774,7 +774,7 @@ if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 				print '</td>';
 				print '<td align="left">' ;
                 $societestatic->id=$obj->socid;
-                $societestatic->nom=$obj->nom;
+                $societestatic->name=$obj->name;
                 $societestatic->client=1;
 				print $societestatic->getNomUrl(1,'customer',44);
 				print '</a></td>';
@@ -821,7 +821,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 	$facstatic=new FactureFournisseur($db);
 
 	$sql = "SELECT ff.rowid, ff.ref, ff.fk_statut, ff.libelle, ff.total_ht, ff.total_ttc, ff.paye,";
-	$sql.= " s.nom, s.rowid as socid,";
+	$sql.= " s.nom as name, s.rowid as socid,";
 	$sql.= " sum(pf.amount) as am";
 	$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as ff";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf on ff.rowid=pf.fk_facturefourn";
@@ -863,7 +863,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 				print $facstatic->getNomUrl(1,'');
 				print '</td>';
                 $societestatic->id=$obj->socid;
-                $societestatic->nom=$obj->nom;
+                $societestatic->name=$obj->name;
                 $societestatic->client=0;
 				print '<td>'.$societestatic->getNomUrl(1, 'supplier', 44).'</td>';
 				if (! empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) print '<td align="right">'.price($obj->total_ht).'</td>';
diff --git a/htdocs/compta/localtax/clients.php b/htdocs/compta/localtax/clients.php
index b6c0a13f246be23fe2a9c54be43f56770883222b..7c34cec1ed45bbd295ad52afac52a3dbd9db3161 100644
--- a/htdocs/compta/localtax/clients.php
+++ b/htdocs/compta/localtax/clients.php
@@ -149,7 +149,8 @@ $vatcust=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
 $vatsup=$langs->transcountry($local==1?"LT1":"LT2",$mysoc->country_code);
 
 // IRPF that the customer has retained me
-if($conf->global->$calc ==0 || $conf->global->$calc == 2){
+if($conf->global->$calc ==0 || $conf->global->$calc == 2)
+{
 	print "<table class=\"noborder\" width=\"100%\">";
 	print "<tr class=\"liste_titre\">";
 	print '<td align="left">'.$langs->trans("Num")."</td>";
@@ -160,7 +161,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
 	print "</tr>\n";
 
 	$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'sell');
-	
+
 	$action = "tvaclient";
 	$object = &$coll_list;
 	$parameters["mode"] = $modetax;
@@ -170,7 +171,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
 	// Initialize technical object to manage hooks of expenses. Note that conf->hooks_modules contains array array
 	$hookmanager->initHooks(array('externalbalance'));
 	$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
-	
+
 	if (is_array($coll_list))
 	{
 		$var=true;
@@ -196,7 +197,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
 				print "<tr ".$bc[$var].">";
 				print '<td class="nowrap">'.$i."</td>";
 				$company_static->id=$coll->socid;
-				$company_static->nom=$coll->nom;
+				$company_static->name=$coll->name;
 				print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
 				$find = array(' ','.');
 				$replace = array('','');
@@ -210,7 +211,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 2){
 			}
 		}
 	    $x_coll_sum = $total;
-	
+
 		print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
 	    print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
 		print '<td class="nowrap" align="right">'.price($total).'</td>';
@@ -240,7 +241,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
 	print "</tr>\n";
 
 	$company_static=new Societe($db);
-	
+
 	$coll_list = vat_by_thirdparty($db,0,$date_start,$date_end,$modetax,'buy');
 	$parameters["direction"] = 'buy';
 	$reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action);    // Note that $action and $object may have been modified by some hooks
@@ -269,7 +270,7 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
 				print "<tr ".$bc[$var].">";
 				print '<td class="nowrap">'.$i."</td>";
 				$company_static->id=$coll->socid;
-				$company_static->nom=$coll->nom;
+				$company_static->name=$coll->name;
 				print '<td class="nowrap">'.$company_static->getNomUrl(1).'</td>';
 				$find = array(' ','.');
 				$replace = array('','');
@@ -283,14 +284,14 @@ if($conf->global->$calc ==0 || $conf->global->$calc == 1){
 			}
 		}
 	    $x_paye_sum = $total;
-	
+
 		print '<tr class="liste_total"><td align="right" colspan="3">'.$langs->trans("Total").':</td>';
 	    print '<td class="nowrap" align="right">'.price($totalamount).'</td>';
 		print '<td class="nowrap" align="right">'.price($total).'</td>';
 		print '</tr>';
-	
+
 		print '</table>';
-	
+
 	}
 	else
 	{
diff --git a/htdocs/compta/paiement/card.php b/htdocs/compta/paiement/card.php
index 658e1992e9dab022c39bff0bfde2a9169547b720..d0e15307be50430e0ba969d969665a64378a3916 100644
--- a/htdocs/compta/paiement/card.php
+++ b/htdocs/compta/paiement/card.php
@@ -273,7 +273,7 @@ print '</table>';
  */
 
 $disable_delete = 0;
-$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom, s.rowid as socid';
+$sql = 'SELECT f.rowid as facid, f.facnumber, f.type, f.total_ttc, f.paye, f.fk_statut, pf.amount, s.nom as name, s.rowid as socid';
 $sql.= ' FROM '.MAIN_DB_PREFIX.'paiement_facture as pf,'.MAIN_DB_PREFIX.'facture as f,'.MAIN_DB_PREFIX.'societe as s';
 $sql.= ' WHERE pf.fk_facture = f.rowid';
 $sql.= ' AND f.fk_soc = s.rowid';
@@ -322,7 +322,7 @@ if ($resql)
 			// Third party
 			print '<td>';
 			$thirdpartystatic->id=$objp->socid;
-			$thirdpartystatic->nom=$objp->nom;
+			$thirdpartystatic->name=$objp->name;
 			print $thirdpartystatic->getNomUrl(1);
 			print '</td>';
 
diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php
index cd6ba5c59a2d1bb2ccf222e826534b969d9e35cc..95503db6ff97aeea6d5f3497b33ae83e8cc4524b 100644
--- a/htdocs/compta/paiement/class/paiement.class.php
+++ b/htdocs/compta/paiement/class/paiement.class.php
@@ -221,7 +221,7 @@ class Paiement extends CommonObject
                             if (!in_array($invoice->type, $affected_types)) dol_syslog("Invoice ".$facid." is not a standard, nor replacement invoice, nor credit note, nor deposit invoice. We do nothing more.");
                             else if ($remaintopay) dol_syslog("Remain to pay for invoice ".$facid." not null. We do nothing more.");
                             else if ($mustwait) dol_syslog("There is ".$mustwait." differed payment to process, we do nothing more.");
-                            else 
+                            else
                             {
                                 $result=$invoice->set_paid($user,'','');
                                 if ($result<0)
@@ -360,8 +360,8 @@ class Paiement extends CommonObject
 			{
 				// Appel des triggers
 				$result=$this->call_trigger('PAYMENT_DELETE', $user);
-				if ($result < 0) 
-				{ 
+				if ($result < 0)
+				{
 				    $this->db->rollback();
 				    return -1;
 				 }
@@ -483,7 +483,7 @@ class Paiement extends CommonObject
                                     $bank_line_id,
                                     $fac->thirdparty->id,
                                     DOL_URL_ROOT.'/comm/card.php?socid=',
-                                    $fac->thirdparty->nom,
+                                    $fac->thirdparty->name,
                                     'company'
                                 );
                                 if ($result <= 0) dol_print_error($this->db);
@@ -501,7 +501,7 @@ class Paiement extends CommonObject
                                     $bank_line_id,
                                     $fac->thirdparty->id,
                                     DOL_URL_ROOT.'/fourn/card.php?socid=',
-                                    $fac->thirdparty->nom,
+                                    $fac->thirdparty->name,
                                     'company'
                                 );
                                 if ($result <= 0) dol_print_error($this->db);
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 46fa00df68c75c666f2b154d8c4fdcc72aa5bc98..da1f2bd28331d1deef6fbe7f09ab09a7dc3e8b52 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -85,7 +85,7 @@ else
     //$sql.= " c.libelle as paiement_type,";
     $sql.= " c.code as paiement_code,";
     $sql.= " ba.rowid as bid, ba.label,";
-    $sql.= " s.rowid as socid, s.nom";
+    $sql.= " s.rowid as socid, s.nom as name";
     //$sql.= " f.facnumber";
     $sql.= " FROM (".MAIN_DB_PREFIX."c_paiement as c, ".MAIN_DB_PREFIX."paiement as p)";
     $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON p.fk_bank = b.rowid";
@@ -197,7 +197,7 @@ if ($resql)
         if ($objp->socid)
         {
             $companystatic->id=$objp->socid;
-            $companystatic->nom=$objp->nom;
+            $companystatic->name=$objp->name;
             print $companystatic->getNomUrl(1,'',24);
         }
         else print '&nbsp;';
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 527705e4ab02f601cb063419b14d37a27b9c0ad6..ed5b123d923007da89278d8672df078f6d073868 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -760,7 +760,7 @@ class BonPrelevement extends CommonObject
             $sql = "SELECT f.rowid, pfd.rowid as pfdrowid, f.fk_soc";
             $sql.= ", pfd.code_banque, pfd.code_guichet, pfd.number, pfd.cle_rib";
             $sql.= ", pfd.amount";
-            $sql.= ", s.nom";
+            $sql.= ", s.nom as name";
             $sql.= " FROM ".MAIN_DB_PREFIX."facture as f";
             $sql.= ", ".MAIN_DB_PREFIX."societe as s";
             $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd";
@@ -829,8 +829,8 @@ class BonPrelevement extends CommonObject
                             }
                             else
 							{
-								dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->nom, LOG_ERR);
-                                $facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->nom;
+								dol_syslog("Error on default bank number RIB/IBAN for thirdparty reported by verif() ".$fact->socid." ".$soc->name, LOG_ERR);
+                                $facture_errors[$fac[0]]="Error on default bank number RIB/IBAN for thirdparty reported by function verif() ".$fact->socid." ".$soc->name;
                             }
                         }
                         else
@@ -1262,7 +1262,7 @@ class BonPrelevement extends CommonObject
 			 * section Debiteur (sepa Debiteurs bloc lines)
 			 */
 			$sql = "SELECT soc.code_client as code, soc.address, soc.zip, soc.town, soc.datec, c.code as country_code,";
-			$sql.= " pl.client_nom as nom, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
+			$sql.= " pl.client_nom as name, pl.code_banque as cb, pl.code_guichet as cg, pl.number as cc, pl.amount as somme,";
 			$sql.= " f.facnumber as fac, pf.fk_facture as idfac, rib.iban_prefix as iban, rib.bic as bic, rib.rowid as drum";
 			$sql.= " FROM";
 			$sql.= " ".MAIN_DB_PREFIX."prelevement_lignes as pl,";
@@ -1286,7 +1286,7 @@ class BonPrelevement extends CommonObject
 				while ($i < $num)
 				{
 					$obj = $this->db->fetch_object($resql);
-					$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->nom, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
+					$fileDebiteurSection .= $this->EnregDestinataireSEPA($obj->code, $obj->name, $obj->address, $obj->zip, $obj->town, $obj->country_code, $obj->cb, $obj->cg, $obj->cc, $obj->somme, $obj->facnumber, $obj->idfac, $obj->iban, $obj->bic, $obj->datec, $obj->drum);
 					$this->total = $this->total + $obj->somme;
 					$i++;
 				}
@@ -1490,7 +1490,7 @@ class BonPrelevement extends CommonObject
      *	Write recipient of request (customer)
      *
      *	@param	string		$row_code_client	soc.code_client as code,
-     *	@param	string		$row_nom			pl.client_nom AS nom,
+     *	@param	string		$row_nom			pl.client_nom AS name,
      *	@param	string		$row_address		soc.address AS adr,
      *	@param	string		$row_zip			soc.zip
      *  @param	string		$row_town			soc.town
diff --git a/htdocs/compta/prelevement/class/rejetprelevement.class.php b/htdocs/compta/prelevement/class/rejetprelevement.class.php
index 51f9a83ed3c7bce9be5d7209a1c0946d07e605ad..27ae87ca3b4319ee78c3fada6f1ebd3e6fad42a2 100644
--- a/htdocs/compta/prelevement/class/rejetprelevement.class.php
+++ b/htdocs/compta/prelevement/class/rejetprelevement.class.php
@@ -244,7 +244,7 @@ class RejetPrelevement
 			$arr_mime = array();
 			$arr_name = array();
 			$facref = $fac->ref;
-			$socname = $soc->nom;
+			$socname = $soc->name;
 			$amount = price($fac->total_ttc);
 			$userinfo = $this->user->getFullName($langs);
 
diff --git a/htdocs/compta/prelevement/create.php b/htdocs/compta/prelevement/create.php
index a3f7ca2ace8afd9c21c5c06daa60ead89092315a..0326e4922f16167da7f126b0f495c84d23d68da3 100644
--- a/htdocs/compta/prelevement/create.php
+++ b/htdocs/compta/prelevement/create.php
@@ -156,7 +156,7 @@ print '<br>';
  * Invoices waiting for withdraw
  */
 
-$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom, s.rowid as socid,";
+$sql = "SELECT f.facnumber, f.rowid, f.total_ttc, s.nom as name, s.rowid as socid,";
 $sql.= " pfd.date_demande";
 $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
 $sql.= " ".MAIN_DB_PREFIX."societe as s,";
@@ -197,7 +197,7 @@ if ($resql)
             print '</td>';
             print '<td>';
             $thirdpartystatic->id=$obj->socid;
-            $thirdpartystatic->nom=$obj->nom;
+            $thirdpartystatic->name=$obj->name;
             print $thirdpartystatic->getNomUrl(1,'customer');
             print '</td>';
             print '<td align="right">';
diff --git a/htdocs/compta/prelevement/demandes.php b/htdocs/compta/prelevement/demandes.php
index 4cd3098bfc39b870c6e31fda67441f8c9bcfbc24..9b58f1e44c033e22e633c2dfb12e148916e118e8 100644
--- a/htdocs/compta/prelevement/demandes.php
+++ b/htdocs/compta/prelevement/demandes.php
@@ -67,7 +67,7 @@ if (! $sortfield) $sortfield="f.facnumber";
  */
 
 $sql= "SELECT f.facnumber, f.rowid, f.total_ttc,";
-$sql.= " s.nom, s.rowid as socid,";
+$sql.= " s.nom as name, s.rowid as socid,";
 $sql.= " pfd.date_demande as date_demande,";
 $sql.= " pfd.fk_user_demande";
 $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
@@ -137,7 +137,7 @@ if ($resql)
 
 		print '<td>';
 		$thirdpartystatic->id=$obj->socid;
-		$thirdpartystatic->nom=$obj->nom;
+		$thirdpartystatic->name=$obj->name;
 		print $thirdpartystatic->getNomUrl(1,'customer');
 		print '</td>';
 
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index 3833a45215ad06eb206148c02cc5f16f1edaee3d..bf3e428cd0e5ad5478f0e530bd37461ff84375bf 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -63,17 +63,17 @@ if ($prev_id)
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
 		print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
 		print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
-	
+
 		// Status
 		print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
 		print '<td>'.$bon->getLibStatut(1).'</td>';
 		print '</tr>';
-	
+
 		if($bon->date_trans <> 0)
 		{
 			$muser = new User($db);
 			$muser->fetch($bon->user_trans);
-	
+
 			print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
 			print dol_print_date($bon->date_trans,'day');
 			print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@@ -87,19 +87,19 @@ if ($prev_id)
 			print dol_print_date($bon->date_credit,'day');
 			print '</td></tr>';
 		}
-	
+
 		print '</table>';
-	
+
 		print '<br>';
-	
+
 		print '<table class="border" width="100%"><tr><td width="20%">';
 		print $langs->trans("WithdrawalFile").'</td><td>';
 		$relativepath = 'receipts/'.$bon->ref;
 		print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
 		print '</td></tr></table>';
-	
+
 		dol_fiche_end();
-      	
+
     }
   	else
     {
@@ -114,7 +114,7 @@ $offset = $conf->liste_limit * $page ;
  */
 $sql = "SELECT pf.rowid";
 $sql.= ",f.rowid as facid, f.facnumber as ref, f.total_ttc";
-$sql.= ", s.rowid as socid, s.nom, pl.statut";
+$sql.= ", s.rowid as socid, s.nom as name, pl.statut";
 $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
 $sql.= ", ".MAIN_DB_PREFIX."prelevement_lignes as pl";
 $sql.= ", ".MAIN_DB_PREFIX."prelevement_facture as pf";
@@ -166,7 +166,7 @@ if ($result)
       	print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
 
       	print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
-      	print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
+      	print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
 
       	print '<td align="center">'.price($obj->total_ttc)."</td>\n";
 
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index e43ea95ae44f0811d79063db1e23910c077f6d68..161227aa1213dff1572e11f9eccc84b9622364df 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -62,17 +62,17 @@ if ($prev_id)
 		print '<tr><td width="20%">'.$langs->trans("Ref").'</td><td>'.$bon->getNomUrl(1).'</td></tr>';
 		print '<tr><td width="20%">'.$langs->trans("Date").'</td><td>'.dol_print_date($bon->datec,'day').'</td></tr>';
 		print '<tr><td width="20%">'.$langs->trans("Amount").'</td><td>'.price($bon->amount).'</td></tr>';
-	
+
 		// Status
 		print '<tr><td width="20%">'.$langs->trans('Status').'</td>';
 		print '<td>'.$bon->getLibStatut(1).'</td>';
 		print '</tr>';
-	
+
 		if($bon->date_trans <> 0)
 		{
 			$muser = new User($db);
 			$muser->fetch($bon->user_trans);
-	
+
 			print '<tr><td width="20%">'.$langs->trans("TransData").'</td><td>';
 			print dol_print_date($bon->date_trans,'day');
 			print ' '.$langs->trans("By").' '.$muser->getFullName($langs).'</td></tr>';
@@ -86,19 +86,19 @@ if ($prev_id)
 			print dol_print_date($bon->date_credit,'day');
 			print '</td></tr>';
 		}
-	
+
 		print '</table>';
-	
+
 		print '<br>';
-	
+
 		print '<table class="border" width="100%"><tr><td width="20%">';
 		print $langs->trans("WithdrawalFile").'</td><td>';
 		$relativepath = 'receipts/'.$bon->ref;
 		print '<a data-ajax="false" href="'.DOL_URL_ROOT.'/document.php?type=text/plain&amp;modulepart=prelevement&amp;file='.urlencode($relativepath).'">'.$relativepath.'</a>';
 		print '</td></tr></table>';
-	
+
 		dol_fiche_end();
-      	
+
     }
   	else
     {
@@ -112,7 +112,7 @@ $rej = new RejetPrelevement($db, $user);
  * Liste des factures
  */
 $sql = "SELECT pl.rowid, pl.amount, pl.statut";
-$sql.= " , s.rowid as socid, s.nom";
+$sql.= " , s.rowid as socid, s.nom as name";
 $sql.= " , pr.motif, pr.afacturer, pr.fk_facture";
 $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
 $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@@ -152,7 +152,7 @@ if ($resql)
 		print img_picto('', 'statut'.$obj->statut).' ';
 		print substr('000000'.$obj->rowid, -6);
 		print '</a></td>';
-		print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
+		print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
 
 		print '<td align="right">'.price($obj->amount)."</td>\n";
 		print '<td>'.$rej->motifs[$obj->motif].'</td>';
diff --git a/htdocs/compta/prelevement/index.php b/htdocs/compta/prelevement/index.php
index 911ffde6f999fd6af54a0a861f72686b38a5c4b7..1abc421cf461ea9370244fe47c635af4b649db04 100644
--- a/htdocs/compta/prelevement/index.php
+++ b/htdocs/compta/prelevement/index.php
@@ -96,7 +96,7 @@ print '</td></tr></table><br>';
  */
 $sql = "SELECT f.facnumber, f.rowid, f.total_ttc, f.fk_statut, f.paye, f.type,";
 $sql.= " pfd.date_demande,";
-$sql.= " s.nom, s.rowid as socid";
+$sql.= " s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."facture as f,";
 $sql.= " ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -137,7 +137,7 @@ if ($resql)
 
             print '<td>';
             $thirdpartystatic->id=$obj->socid;
-            $thirdpartystatic->nom=$obj->nom;
+            $thirdpartystatic->name=$obj->name;
             print $thirdpartystatic->getNomUrl(1,'customer');
             print '</td>';
 
diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php
index 45bab4d69dcc79c54674b08c4e369919faf1a9b2..b3f9acb35709cffa2b8a0065197fa59e99d27a28 100644
--- a/htdocs/compta/prelevement/ligne.php
+++ b/htdocs/compta/prelevement/ligne.php
@@ -190,7 +190,7 @@ if ($id)
 		print '<td colspan="3">'.$langs->trans("WithdrawalRefused").'</td></tr>';
 
 		//Select yes/no
-		print '<tr><td class="valid">'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->nom.' ?</td>';
+		print '<tr><td class="valid">'.$langs->trans("WithdrawalRefusedConfirm").' '.$soc->name.' ?</td>';
 		print '<td colspan="2" class="valid">';
 		print $form->selectyesno("confirm",1,0);
 		print '</td></tr>';
@@ -257,7 +257,7 @@ if ($id)
 	 */
 	$sql = "SELECT pf.rowid";
 	$sql.= " ,f.rowid as facid, f.facnumber as ref, f.total_ttc";
-	$sql.= " , s.rowid as socid, s.nom";
+	$sql.= " , s.rowid as socid, s.nom as name";
 	$sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
 	$sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
 	$sql.= " , ".MAIN_DB_PREFIX."prelevement_facture as pf";
@@ -308,7 +308,7 @@ if ($id)
 			print '<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->ref."</a></td>\n";
 
 			print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">';
-			print img_object($langs->trans("ShowCompany"),"company"). ' '.stripslashes($obj->nom)."</a></td>\n";
+			print img_object($langs->trans("ShowCompany"),"company"). ' '.$obj->name."</a></td>\n";
 
 			print '<td align="right">'.price($obj->total_ttc)."</td>\n";
 
diff --git a/htdocs/compta/prelevement/lignes.php b/htdocs/compta/prelevement/lignes.php
index ef884f50edfa2f44ac1c517baa5fe505e09c8cd1..1e96e9276d8596b84dd19e9ebef5dd093811de0a 100644
--- a/htdocs/compta/prelevement/lignes.php
+++ b/htdocs/compta/prelevement/lignes.php
@@ -106,7 +106,7 @@ if ($prev_id)
 		print '</td></tr></table>';
 
 		dol_fiche_end();
-		
+
 	}
 	else
 	{
@@ -128,7 +128,7 @@ $pagenext = $page + 1;
  *
  */
 $sql = "SELECT pl.rowid, pl.statut, pl.amount";
-$sql.= ", s.rowid as socid, s.nom";
+$sql.= ", s.rowid as socid, s.nom as name";
 $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_lignes as pl";
 $sql.= ", ".MAIN_DB_PREFIX."prelevement_bons as pb";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -175,7 +175,7 @@ if ($result)
 		print substr('000000'.$obj->rowid, -6);
 		print '</a></td>';
 
-		print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.stripslashes($obj->nom)."</a></td>\n";
+		print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name."</a></td>\n";
 
 		print '<td align="center">'.price($obj->amount)."</td>\n";
 
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 819d879b098882245f847b494a6ed47eb4a43cfe..7e0b818279fab282932558a441f5f76ef0d0b074 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -63,7 +63,7 @@ llxHeader('',$langs->trans("WithdrawalsLines"));
 
 $sql = "SELECT p.rowid, p.ref, p.statut, p.datec";
 $sql.= " ,f.rowid as facid, f.facnumber, f.total_ttc";
-$sql.= " , s.rowid as socid, s.nom, s.code_client";
+$sql.= " , s.rowid as socid, s.nom as name, s.code_client";
 $sql.= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
 $sql.= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
 $sql.= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
@@ -162,7 +162,7 @@ if ($result)
           print '&nbsp;<a href="'.DOL_URL_ROOT.'/compta/facture.php?facid='.$obj->facid.'">'.$obj->facnumber."</a></td>\n";
         print '</a></td>';
 
-        print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->nom."</a></td>\n";
+        print '<td><a href="card.php?id='.$obj->rowid.'">'.$obj->name."</a></td>\n";
 
         print '<td align="center"><a href="card.php?id='.$obj->rowid.'">'.$obj->code_client."</a></td>\n";
 
diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php
index f56652fc4b67178f21d9e09ee5194a18d6de3492..59599e93dc649b87f2b7ad3720b90b84449dcdeb 100644
--- a/htdocs/compta/recap-compta.php
+++ b/htdocs/compta/recap-compta.php
@@ -64,8 +64,8 @@ if ($socid > 0)
 
 	print '<table class="border" width="100%">';
 
-	// Nom
-	print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->nom.'</td></tr>';
+	// Name
+	print '<tr><td width="20%">'.$langs->trans("Name").'</td><td width="80%" colspan="3">'.$societe->name.'</td></tr>';
 
 	// Prefix
 	if (! empty($conf->global->SOCIETE_USEPREFIX))  // Old not used prefix field
diff --git a/htdocs/compta/resultat/clientfourn.php b/htdocs/compta/resultat/clientfourn.php
index 19054bfd7c95a4e3fe74135f40bd53b793af7942..9122ece2ed9216cf205732f3c8dd303985b41296 100644
--- a/htdocs/compta/resultat/clientfourn.php
+++ b/htdocs/compta/resultat/clientfourn.php
@@ -120,7 +120,7 @@ $total_ttc=0;
 // Affiche en-tete de rapport
 if ($modecompta=="CREANCES-DETTES")
 {
-    $nom=$langs->trans("AnnualByCompaniesDueDebtMode");
+    $name=$langs->trans("AnnualByCompaniesDueDebtMode");
 	$calcmode=$langs->trans("CalcModeDebt");
     $calcmode.='<br>('.$langs->trans("SeeReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=RECETTES-DEPENSES">','</a>').')';
     $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
@@ -132,7 +132,7 @@ if ($modecompta=="CREANCES-DETTES")
     //$exportlink=$langs->trans("NotYetAvailable");
 }
 else {
-    $nom=$langs->trans("AnnualByCompaniesInputOutputMode");
+    $name=$langs->trans("AnnualByCompaniesInputOutputMode");
 	$calcmode=$langs->trans("CalcModeEngagement");
     $calcmode.='<br>('.$langs->trans("SeeReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year.(GETPOST("month")>0?'&month='.GETPOST("month"):'').'&modecompta=CREANCES-DETTES">','</a>').')';
     //$period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',1,1,0,'',1,0,1);
@@ -142,7 +142,7 @@ else {
     $builddate=time();
     //$exportlink=$langs->trans("NotYetAvailable");
 }
-report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode);
+report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array('modecompta'=>$modecompta),$calcmode);
 
 // Show report array
 print '<table class="noborder" width="100%">';
@@ -160,7 +160,7 @@ print '<tr><td colspan="4">'.$langs->trans("CustomersInvoices").'</td></tr>';
 
 if ($modecompta == 'CREANCES-DETTES')
 {
-    $sql = "SELECT s.nom, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc";
+    $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total) as amount_ht, sum(f.total_ttc) as amount_ttc";
     $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
     $sql.= ", ".MAIN_DB_PREFIX."facture as f";
     $sql.= " WHERE f.fk_soc = s.rowid";
@@ -178,7 +178,7 @@ else
      * Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
      * vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
      */
-    $sql = "SELECT s.nom as nom, s.rowid as socid, sum(pf.amount) as amount_ttc";
+    $sql = "SELECT s.nom as name, s.rowid as socid, sum(pf.amount) as amount_ttc";
     $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
     $sql.= ", ".MAIN_DB_PREFIX."facture as f";
     $sql.= ", ".MAIN_DB_PREFIX."paiement_facture as pf";
@@ -206,7 +206,7 @@ if ($result) {
         $var=!$var;
 
         print "<tr ".$bc[$var]."><td>&nbsp;</td>";
-        print "<td>".$langs->trans("Bills").' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$objp->socid.'">'.$objp->nom."</td>\n";
+        print "<td>".$langs->trans("Bills").' <a href="'.DOL_URL_ROOT.'/compta/facture/list.php?socid='.$objp->socid.'">'.$objp->name."</td>\n";
 
         if ($modecompta == 'CREANCES-DETTES')
         	print "<td align=\"right\">".price($objp->amount_ht)."</td>\n";
@@ -225,7 +225,7 @@ if ($result) {
 // On ajoute les paiements clients anciennes version, non lie par paiement_facture
 if ($modecompta != 'CREANCES-DETTES')
 {
-    $sql = "SELECT 'Autres' as nom, '0' as idp, sum(p.amount) as amount_ttc";
+    $sql = "SELECT 'Autres' as name, '0' as idp, sum(p.amount) as amount_ttc";
     $sql.= " FROM ".MAIN_DB_PREFIX."bank as b";
     $sql.= ", ".MAIN_DB_PREFIX."bank_account as ba";
     $sql.= ", ".MAIN_DB_PREFIX."paiement as p";
@@ -236,8 +236,8 @@ if ($modecompta != 'CREANCES-DETTES')
     $sql.= " AND ba.entity = ".$conf->entity;
     if (! empty($date_start) && ! empty($date_end))
     	$sql.= " AND p.datep >= '".$db->idate($date_start)."' AND p.datep <= '".$db->idate($date_end)."'";
-    $sql.= " GROUP BY nom, idp";
-    $sql.= " ORDER BY nom";
+    $sql.= " GROUP BY name, idp";
+    $sql.= " ORDER BY name";
 
     dol_syslog("get old customer payments not linked to invoices", LOG_DEBUG);
     $result = $db->query($sql);
@@ -290,7 +290,7 @@ print '</tr>';
  */
 if ($modecompta == 'CREANCES-DETTES')
 {
-    $sql = "SELECT s.nom, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
+    $sql = "SELECT s.nom as name, s.rowid as socid, sum(f.total_ht) as amount_ht, sum(f.total_ttc) as amount_ttc";
     $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
     $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f";
     $sql.= " WHERE f.fk_soc = s.rowid";
@@ -338,7 +338,7 @@ if ($result) {
             $var=!$var;
 
             print "<tr ".$bc[$var]."><td>&nbsp;</td>";
-            print "<td>".$langs->trans("Bills")." <a href=\"".DOL_URL_ROOT."/fourn/facture/list.php?socid=".$objp->socid."\">".$objp->nom."</a></td>\n";
+            print "<td>".$langs->trans("Bills")." <a href=\"".DOL_URL_ROOT."/fourn/facture/list.php?socid=".$objp->socid."\">".$objp->name."</a></td>\n";
 
             if ($modecompta == 'CREANCES-DETTES')
             	print "<td align=\"right\">".price(-$objp->amount_ht)."</td>\n";
@@ -381,7 +381,7 @@ print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->t
 
 if ($modecompta == 'CREANCES-DETTES')
 {
-    $sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
+    $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount";
     $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
     $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
     $sql.= " WHERE cs.fk_type = c.id";
@@ -391,7 +391,7 @@ if ($modecompta == 'CREANCES-DETTES')
 }
 else
 {
-    $sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
+    $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount";
     $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
     $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
     $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
@@ -424,7 +424,7 @@ if ($result) {
 
             $var = !$var;
             print "<tr ".$bc[$var]."><td>&nbsp;</td>";
-            print '<td>'.$obj->nom.'</td>';
+            print '<td>'.$obj->label.'</td>';
             if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price(-$obj->amount).'</td>';
             print '<td align="right">'.price(-$obj->amount).'</td>';
             print '</tr>';
@@ -455,7 +455,7 @@ print '<tr><td colspan="4">'.$langs->trans("SocialContributions").' ('.$langs->t
 
 if ($modecompta == 'CREANCES-DETTES')
 {
-    $sql = "SELECT c.id, c.libelle as nom, sum(cs.amount) as amount";
+    $sql = "SELECT c.id, c.libelle as label, sum(cs.amount) as amount";
     $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
     $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
     $sql.= " WHERE cs.fk_type = c.id";
@@ -468,7 +468,7 @@ if ($modecompta == 'CREANCES-DETTES')
 }
 else
 {
-    $sql = "SELECT c.id, c.libelle as nom, sum(p.amount) as amount";
+    $sql = "SELECT c.id, c.libelle as label, sum(p.amount) as amount";
     $sql.= " FROM ".MAIN_DB_PREFIX."c_chargesociales as c";
     $sql.= ", ".MAIN_DB_PREFIX."chargesociales as cs";
     $sql.= ", ".MAIN_DB_PREFIX."paiementcharge as p";
@@ -501,7 +501,7 @@ if ($result) {
 
             $var = !$var;
             print "<tr ".$bc[$var]."><td>&nbsp;</td>";
-            print '<td>'.$obj->nom.'</td>';
+            print '<td>'.$obj->label.'</td>';
             if ($modecompta == 'CREANCES-DETTES')
             	print '<td align="right">'.price(-$obj->amount).'</td>';
             print '<td align="right">'.price(-$obj->amount).'</td>';
@@ -550,7 +550,7 @@ if ($mysoc->tva_assuj == 'franchise')	// Non assujeti
 if ($conf->salaries->enabled)
 {
 	print '<tr><td colspan="4">'.$langs->trans("Salaries").'</td></tr>';
-	$sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as nom, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
+	$sql = "SELECT u.rowid, u.firstname, u.lastname, p.fk_user, p.label as label, date_format(p.datep,'%Y-%m') as dm, sum(p.amount) as amount";
 	$sql.= " FROM ".MAIN_DB_PREFIX."payment_salary as p";
 	$sql.= " INNER JOIN ".MAIN_DB_PREFIX."user as u ON u.rowid=p.fk_user";
 	$sql.= " WHERE p.entity = ".$conf->entity;
@@ -618,7 +618,7 @@ if ($conf->salaries->enabled)
 if ($conf->donation->enabled)
 {
 	print '<tr><td colspan="4">'.$langs->trans("Donation").'</td></tr>';
-	$sql = "SELECT p.societe as nom, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
+	$sql = "SELECT p.societe as name, p.firstname, p.lastname, date_format(p.datedon,'%Y-%m') as dm, sum(p.amount) as amount";
 	$sql.= " FROM ".MAIN_DB_PREFIX."don as p";
 	$sql.= " WHERE p.entity = ".$conf->entity;
 	$sql.= " AND fk_statut=2";
@@ -650,7 +650,7 @@ if ($conf->donation->enabled)
 				$var = !$var;
 				print "<tr ".$bc[$var]."><td>&nbsp;</td>";
 
-				print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/compta/dons/list.php?search_company=".$obj->nom."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->nom. " ".$obj->firstname." ".$obj->lastname."</a></td>\n";
+				print "<td>".$langs->trans("Donation")." <a href=\"".DOL_URL_ROOT."/compta/dons/list.php?search_company=".$obj->name."&search_name=".$obj->firstname." ".$obj->lastname."\">".$obj->name. " ".$obj->firstname." ".$obj->lastname."</a></td>\n";
 
 				if ($modecompta == 'CREANCES-DETTES') print '<td align="right">'.price($obj->amount).'</td>';
 				print '<td align="right">'.price($obj->amount).'</td>';
diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php
index 0ccd450e0cbb2fc6140ca25aae40163c3a464e09..af070901517f8d1e06f0817da3af7abcfa9b4fdf 100644
--- a/htdocs/compta/sociales/charges.php
+++ b/htdocs/compta/sociales/charges.php
@@ -153,60 +153,49 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->tax->charges->cr
 if ($action == 'confirm_clone' && $confirm != 'yes') { $action=''; }
 if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->tax->charges->creer))
 {
-    
-        $db->begin();
-
-		$originalId = $id;
-        
-		$object = new ChargeSociales($db);
-		$object->fetch($id);
-
-        if ($object->id > 0)
-        {
-            $object->paye = 0;
-            $object->id = $object->ref = null;
-     
-            if(GETPOST('clone_for_next_month') != '') {
-            	
-				$object->date_ech = strtotime('+1month', $object->date_ech);
-				$object->periode = strtotime('+1month', $object->periode);
-	        }
-			            
-            if ($object->check())
-            {
-                $id = $object->create($user);
-                if ($id > 0)
-                {
-                    $db->commit();
-                    $db->close();
-
-                    header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
-                    exit;
-                }
-                else
-                {
-                    $id=$originalId;
-					$db->rollback();
-                    
-				    if (count($object->errors))
-                    {
-                    	setEventMessage($object->errors, 'errors');
-                    	dol_print_error($db,$object->errors);
-                    }
-                    else
-                    {
-                    	setEventMessage($langs->trans($object->error), 'errors');
-                    	dol_print_error($db,$object->error);
-                    }
-                }
-            }
-        }
-        else
-        {
-            $db->rollback();
-            dol_print_error($db,$object->error);
-        }
-    
+	$db->begin();
+
+	$originalId = $id;
+
+	$object = new ChargeSociales($db);
+	$object->fetch($id);
+
+	if ($object->id > 0)
+	{
+		$object->paye = 0;
+		$object->id = $object->ref = null;
+
+		if(GETPOST('clone_for_next_month') != '') {
+
+			$object->date_ech = strtotime('+1month', $object->date_ech);
+			$object->periode = strtotime('+1month', $object->periode);
+		}
+
+		if ($object->check())
+		{
+			$id = $object->create($user);
+			if ($id > 0)
+			{
+				$db->commit();
+				$db->close();
+
+				header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
+				exit;
+			}
+			else
+			{
+				$id=$originalId;
+				$db->rollback();
+
+				setEventMessages($object->error,$object->errors, 'errors');
+			}
+		}
+	}
+	else
+	{
+		$db->rollback();
+		dol_print_error($db,$object->error);
+	}
 }
 
 
@@ -301,18 +290,18 @@ if ($id > 0)
 		$head=tax_prepare_head($object);
 
 		dol_fiche_head($head, 'card', $langs->trans("SocialContribution"),0,'bill');
-		
+
 		// Clone confirmation
 		if ($action === 'clone')
 		{
 			$formclone=array(
 				array('type' => 'checkbox', 'name' => 'clone_for_next_month','label' => $langs->trans("CloneTaxForNextMonth"), 'value' => 1),
-    
+
 			);
-			
+
 		    print $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id,$langs->trans('CloneTax'),$langs->trans('ConfirmCloneTax',$object->ref),'confirm_clone',$formclone,'yes');
 		}
-		
+
 		// Confirmation de la suppression de la charge
 		if ($action == 'paid')
 		{
@@ -492,7 +481,7 @@ if ($id > 0)
 			{
 				print "<a class=\"butAction\" href=\"".DOL_URL_ROOT."/compta/sociales/charges.php?id=$object->id&amp;action=paid\">".$langs->trans("ClassifyPaid")."</a>";
 			}
-			
+
 			// Clone
 			if ($user->rights->tax->charges->creer)
 			{
diff --git a/htdocs/compta/sociales/class/chargesociales.class.php b/htdocs/compta/sociales/class/chargesociales.class.php
index 807466ef95fc0aadc5336eb60a3b1149c4a689de..44e62ad0f1074d560127f205ad95498ad3eb5328 100644
--- a/htdocs/compta/sociales/class/chargesociales.class.php
+++ b/htdocs/compta/sociales/class/chargesociales.class.php
@@ -106,22 +106,23 @@ class ChargeSociales extends CommonObject
             return -1;
         }
     }
-	/* 
-	 * Check if a social contribution can be created into database 
-	 * 
-	*/
-	function check() {
-		
+
+	/**
+	 * Check if a social contribution can be created into database
+	 *
+	 * @return	boolean		True or false
+	 */
+	function check()
+	{
 		$newamount=price2num($this->amount,'MT');
 
         // Validation parametres
         if (! $newamount > 0 || empty($this->date_ech) || empty($this->periode))
         {
-           
             return false;
         }
-		
-		
+
+
 		return true;
 	}
 
@@ -138,7 +139,8 @@ class ChargeSociales extends CommonObject
         // Nettoyage parametres
         $newamount=price2num($this->amount,'MT');
 
-		if(!$this->check()) {
+		if (!$this->check())
+		{
 			 $this->error="ErrorBadParameter";
 			 return -2;
 		}
@@ -357,7 +359,7 @@ class ChargeSociales extends CommonObject
         global $langs;
         $langs->load('customers');
         $langs->load('bills');
-        
+
         if ($mode == 0)
         {
             if ($statut ==  0) return $langs->trans("Unpaid");
diff --git a/htdocs/compta/tva/clients.php b/htdocs/compta/tva/clients.php
index 422354ee7c33a8be391c99ceb63fbec1e70a9472..c2620fd34dfdebc2178918708f95a799fb76a6af 100644
--- a/htdocs/compta/tva/clients.php
+++ b/htdocs/compta/tva/clients.php
@@ -110,10 +110,10 @@ $fsearch.='  <input type="text" name="min" id="min" value="'.$min.'" size="6">';
 // Affiche en-tete du rapport
 if ($modetax==1)	// Calculate on invoice for goods and services
 {
-    $nom=$langs->trans("VATReportByCustomersInDueDebtMode");
+    $name=$langs->trans("VATReportByCustomersInDueDebtMode");
 	$calcmode=$langs->trans("CalcModeVATDebt");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-    //$nom.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
+    //$name.='<br>('.$langs->trans("SeeVATReportInInputOutputMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=0">','</a>').')';
     $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
     $description=$langs->trans("RulesVATDueServices");
@@ -138,10 +138,10 @@ if ($modetax==1)	// Calculate on invoice for goods and services
 }
 if ($modetax==0) 	// Invoice for goods, payment for services
 {
-    $nom=$langs->trans("VATReportByCustomersInInputOutputMode");
+    $name=$langs->trans("VATReportByCustomersInInputOutputMode");
     $calcmode=$langs->trans("CalcModeVATEngagement");
     $calcmode.='<br>('.$langs->trans("TaxModuleSetupToModifyRules",DOL_URL_ROOT.'/admin/taxes.php').')';
-    //$nom.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
+    //$name.='<br>('.$langs->trans("SeeVATReportInDueDebtMode",'<a href="'.$_SERVER["PHP_SELF"].'?year='.$year_start.'&modetax=1">','</a>').')';
     $period=$form->select_date($date_start,'date_start',0,0,0,'',1,0,1).' - '.$form->select_date($date_end,'date_end',0,0,0,'',1,0,1);
     //$periodlink=($year_start?"<a href='".$_SERVER["PHP_SELF"]."?year=".($year_start-1)."&modetax=".$modetax."'>".img_previous()."</a> <a href='".$_SERVER["PHP_SELF"]."?year=".($year_start+1)."&modetax=".$modetax."'>".img_next()."</a>":"");
     $description=$langs->trans("RulesVATInServices");
@@ -165,7 +165,7 @@ if ($modetax==0) 	// Invoice for goods, payment for services
 	$amountsup=$langs->trans("AmountHT");
 	if ($mysoc->tva_assuj) $vatsup.=' ('.$langs->trans("ToGetBack").')';
 }
-report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
+report_header($name,$nomlink,$period,$periodlink,$description,$builddate,$exportlink,array(),$calcmode);
 
 $vatcust=$langs->trans("VATReceived");
 $vatsup=$langs->trans("VATPaid");
@@ -223,7 +223,7 @@ if (is_array($coll_list))
 			print "<tr ".$bc[$var].">";
 			print '<td class="nowrap">'.$i."</td>";
 			$company_static->id=$coll->socid;
-			$company_static->nom=$coll->nom;
+			$company_static->name=$coll->name;
 			$company_static->client=1;
 			print '<td class="nowrap">'.$company_static->getNomUrl(1,'customer').'</td>';
 			$find = array(' ','.');
@@ -304,7 +304,7 @@ if (is_array($coll_list))
 			print "<tr ".$bc[$var].">";
 			print '<td class="nowrap">'.$i."</td>";
 			$company_static->id=$coll->socid;
-			$company_static->nom=$coll->nom;
+			$company_static->name=$coll->name;
 			$company_static->fournisseur=1;
 			print '<td class="nowrap">'.$company_static->getNomUrl(1,'supplier').'</td>';
 			$find = array(' ','.');
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index 19ce91f9c8284a866df99a5ea2d3432730a15b4e..9e93523a654567f072d84b45843af9703476a66f 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -185,7 +185,7 @@ class Contact extends CommonObject
             {
                 // Call trigger
                 $result=$this->call_trigger('CONTACT_CREATE',$user);
-                if ($result < 0) { $error++; }            
+                if ($result < 0) { $error++; }
                 // End call triggers
             }
 
@@ -304,7 +304,7 @@ class Contact extends CommonObject
 			{
                 // Call trigger
                 $result=$this->call_trigger('CONTACT_MODIFY',$user);
-                if ($result < 0) { $error++; }            
+                if ($result < 0) { $error++; }
                 // End call triggers
 			}
 
@@ -374,7 +374,7 @@ class Contact extends CommonObject
 			$soc = new Societe($this->db);
 			$soc->fetch($this->socid);
 
-			$info[$conf->global->LDAP_CONTACT_FIELD_COMPANY] = $soc->nom;
+			$info[$conf->global->LDAP_CONTACT_FIELD_COMPANY] = $soc->name;
 			if ($soc->client == 1)      $info["businessCategory"] = "Customers";
 			if ($soc->client == 2)      $info["businessCategory"] = "Prospects";
 			if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
@@ -774,7 +774,7 @@ class Contact extends CommonObject
 		{
             // Call trigger
             $result=$this->call_trigger('CONTACT_DELETE',$user);
-            if ($result < 0) { $error++; }            
+            if ($result < 0) { $error++; }
             // End call triggers
 		}
 
@@ -1060,7 +1060,7 @@ class Contact extends CommonObject
 		{
             // Call trigger
             $result=$this->call_trigger('CONTACT_ENABLEDISABLE',$user);
-            if ($result < 0) { $error++; }            
+            if ($result < 0) { $error++; }
             // End call triggers
 		}
 
diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php
index e78c298c541c446c12798b349025b0840a1b40e3..77abf31ac89649f52ae36a02a86081fabbef4ff2 100644
--- a/htdocs/contact/vcard.php
+++ b/htdocs/contact/vcard.php
@@ -75,7 +75,7 @@ if ($company->id)
 	if (! $contact->zip)        $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
 	if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
 	// Si contact lie a un tiers non de type "particulier"
-	if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom);
+	if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->name);
 }
 
 // Personal informations
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 400899993aeeea0cac7f125829dbad467be84215..02a580174c3288f24e4bad1d47c1dc994e92a7a3 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -227,7 +227,7 @@ print "</table><br>";
 if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
 {
 	$sql  = "SELECT c.rowid as ref, c.rowid,";
-	$sql.= " s.nom, s.rowid as socid";
+	$sql.= " s.nom as name, s.rowid as socid";
 	$sql .= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 	$sql.= " WHERE s.rowid = c.fk_soc";
@@ -262,7 +262,7 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire)
 				print '</td>';
 				print '<td>';
 				$companystatic->id=$obj->socid;
-				$companystatic->nom=$obj->nom;
+				$companystatic->name=$obj->name;
 				$companystatic->client=1;
 				print $companystatic->getNomUrl(1,'',16);
 				print '</td>';
@@ -298,7 +298,7 @@ $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.d
 $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now)."')",1,0).') as nb_expired,';
 $sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NOT NULL AND cd.date_fin_validite < '".$db->idate($now - $conf->contrat->services->expires->warning_delay)."')",1,0).') as nb_late,';
 $sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
-$sql.= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom, s.rowid as socid";
+$sql.= " c.rowid as cid, c.ref, c.datec, c.tms, c.statut, s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= " ".MAIN_DB_PREFIX."societe_commerciaux as sc,";
 $sql.= " ".MAIN_DB_PREFIX."contrat as c";
@@ -342,7 +342,7 @@ if ($result)
 		print '</td>';
 		print '<td>';
 		$staticcompany->id=$obj->socid;
-		$staticcompany->nom=$obj->nom;
+		$staticcompany->name=$obj->name;
 		print $staticcompany->getNomUrl(1,'',20);
 		print '</td>';
 		print '<td align="center">'.dol_print_date($obj->tms,'dayhour').'</td>';
@@ -369,7 +369,7 @@ print '<br>';
 // Last modified services
 $sql = "SELECT c.ref, c.fk_soc, ";
 $sql.= " cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat, cd.date_fin_validite,";
-$sql.= " s.nom,";
+$sql.= " s.nom as name,";
 $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
 $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -423,7 +423,7 @@ if ($resql)
 		print '</td>';
 		print '<td>';
 		$staticcompany->id=$obj->fk_soc;
-		$staticcompany->nom=$obj->nom;
+		$staticcompany->name=$obj->name;
 		print $staticcompany->getNomUrl(1,'',20);
 		print '</td>';
 		print '<td class="nowrap" align="right"><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
@@ -447,7 +447,7 @@ print '<br>';
 
 // Not activated services
 $sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
-$sql.= " s.nom,";
+$sql.= " s.nom as name,";
 $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
 $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -503,7 +503,7 @@ if ($resql)
         print '</td>';
 		print '<td>';
 		$staticcompany->id=$obj->fk_soc;
-		$staticcompany->nom=$obj->nom;
+		$staticcompany->name=$obj->name;
 		print $staticcompany->getNomUrl(1,'',20);
 		print '</td>';
 		print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
@@ -526,7 +526,7 @@ print '<br>';
 
 // Expired services
 $sql = "SELECT c.ref, c.fk_soc, cd.rowid as cid, cd.statut, cd.label, cd.fk_product, cd.description as note, cd.fk_contrat,";
-$sql.= " s.nom,";
+$sql.= " s.nom as name,";
 $sql.= " p.rowid as pid, p.ref as pref, p.label as plabel, p.fk_product_type as ptype";
 $sql.= " FROM (".MAIN_DB_PREFIX."contrat as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
@@ -583,7 +583,7 @@ if ($resql)
 		print '</td>';
 		print '<td>';
 		$staticcompany->id=$obj->fk_soc;
-		$staticcompany->nom=$obj->nom;
+		$staticcompany->name=$obj->name;
 		print $staticcompany->getNomUrl(1,'',20);
 		print '</td>';
 		print '<td width="16" align="right"><a href="ligne.php?id='.$obj->fk_contrat.'&ligne='.$obj->cid.'">';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 7970e80603c160d1064fccacfa8c77b5b420f0e3..d8e635dacb074e1f03145c0ac02405f2328bf6b3 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -96,9 +96,8 @@ if (!empty($search_ref_customer)) {
 if ($sall) {
     $sql .= natural_search(array('s.nom', 'cd.label', 'cd.description'), $sall);
 }
-$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut,";
-$sql.= " s.nom, s.rowid";
-$sql.= " ORDER BY $sortfield $sortorder";
+$sql.= " GROUP BY c.rowid, c.ref, c.datec, c.date_contrat, c.statut, s.nom, s.rowid";
+$sql.= $db->order($sortfield,$sortorder);
 $sql.= $db->plimit($conf->liste_limit + 1, $offset);
 
 $resql=$db->query($sql);
@@ -157,7 +156,7 @@ if ($resql)
         if ($obj->nb_late) print img_warning($langs->trans("Late"));
         print '</td>';
         print '<td>'.$obj->ref_customer.'</td>';
-        print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+        print '<td><a href="../comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
         //print '<td align="center">'.dol_print_date($obj->datec).'</td>';
         print '<td align="center">'.dol_print_date($db->jdate($obj->date_contrat)).'</td>';
         //print '<td align="center">'.$staticcontrat->LibStatut($obj->statut,3).'</td>';
diff --git a/htdocs/contrat/services.php b/htdocs/contrat/services.php
index 4318d81e9230a3cf0a4abebd220583704e49604b..77fc01554305ed000fd75eb0f55a9e28464abfdd 100644
--- a/htdocs/contrat/services.php
+++ b/htdocs/contrat/services.php
@@ -80,7 +80,7 @@ $form=new Form($db);
 llxHeader();
 
 $sql = "SELECT c.rowid as cid, c.ref, c.statut as cstatut,";
-$sql.= " s.rowid as socid, s.nom,";
+$sql.= " s.rowid as socid, s.nom as name,";
 $sql.= " cd.rowid, cd.description, cd.statut,";
 $sql.= " p.rowid as pid, p.ref as pref, p.label as label, p.fk_product_type as ptype,";
 if (!$user->rights->societe->client->voir && !$socid) $sql .= " sc.fk_soc, sc.fk_user,";
@@ -225,7 +225,7 @@ if ($resql)
 		// Third party
 		print '<td>';
 		$companystatic->id=$obj->socid;
-		$companystatic->nom=$obj->nom;
+		$companystatic->name=$obj->name;
 		$companystatic->client=1;
 		print $companystatic->getNomUrl(1,'customer',28);
 		print '</td>';
diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php
index 8b88b6ff5578ec9e490dde0a543c21ebc120e8be..7d118932ba4705bd3b462fad4a381bbeaed7e33f 100644
--- a/htdocs/core/boxes/box_actions.php
+++ b/htdocs/core/boxes/box_actions.php
@@ -64,7 +64,7 @@ class box_actions extends ModeleBoxes
 		{
 			$sql = "SELECT a.id, a.label, a.datep as dp, a.percent as percentage,";
 			$sql.= " ta.code,";
-			$sql.= " s.nom, s.rowid as socid";
+			$sql.= " s.nom as name, s.rowid as socid";
 			$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm AS ta, ";
 			$sql.= MAIN_DB_PREFIX."actioncomm AS a)";
 			if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON a.fk_soc = sc.fk_soc";
@@ -112,7 +112,7 @@ class box_actions extends ModeleBoxes
                     'url' => ($objp->socid?DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid:''));
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-					'text' => dol_trunc($objp->nom,24),
+					'text' => dol_trunc($objp->name,24),
 					'url' => DOL_URL_ROOT."/societe/soc.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="left" class="nowrap"',
@@ -155,7 +155,7 @@ class box_actions extends ModeleBoxes
 		global $langs, $conf;
 		parent::showBox($this->info_box_head, $this->info_box_contents);
 				if ($conf->global->SHOW_DIALOG_HOMEPAGE)
-		{		
+		{
 			$actioncejour=false;
 			$contents=$this->info_box_contents;
 			$nblines=count($contents);
@@ -170,7 +170,7 @@ class box_actions extends ModeleBoxes
 					if (isset($contents[$i]))
 					{
 						// on affiche que les évènement du jours ou passé
-						// qui ne sont pas à 100% 
+						// qui ne sont pas à 100%
 						$actioncejour=true;
 						$var=!$var;
 						// TR
@@ -193,8 +193,8 @@ class box_actions extends ModeleBoxes
 						print '</tr>';
 					}
 				}
-				print '</table>'; 
-	
+				print '</table>';
+
 			}
 			print '</div>';
 			if ($actioncejour)
diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php
index ae6b6b7ef1547702cbf183389f84641535dcd2f8..9e1706a5e6b107ddc5e68e0ceb65d842f0fa307e 100644
--- a/htdocs/core/boxes/box_clients.php
+++ b/htdocs/core/boxes/box_clients.php
@@ -63,7 +63,7 @@ class box_clients extends ModeleBoxes
 
 		if ($user->rights->societe->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status";
+			$sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
 			$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 			$sql.= " WHERE s.client IN (1, 3)";
@@ -93,7 +93,7 @@ class box_clients extends ModeleBoxes
                     'url' => $url.$objp->socid);
 
 					$this->info_box_contents[$i][1] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => $url.$objp->socid);
 
 					$this->info_box_contents[$i][2] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index f88eaa939ac351452cc2bd4a5e915a1dc576f3eb..a89fca4acc07ade4d6ed7fd19beb4788dca1cf14 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -63,7 +63,7 @@ class box_commandes extends ModeleBoxes
         if ($user->rights->commande->lire)
         {
 
-            $sql = "SELECT s.nom, s.rowid as socid,";
+            $sql = "SELECT s.nom as name, s.rowid as socid,";
             $sql.= " c.ref, c.tms, c.rowid,";
             $sql.= " c.fk_statut, c.facture";
             $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -101,7 +101,7 @@ class box_commandes extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php
index 4297d4de46e4b572fc22607405db4ec2ae886d3d..dc0ff8e5382938f548c37696e47bfad66bcf47a6 100644
--- a/htdocs/core/boxes/box_contracts.php
+++ b/htdocs/core/boxes/box_contracts.php
@@ -60,7 +60,7 @@ class box_contracts extends ModeleBoxes
 
     	if ($user->rights->contrat->lire)
     	{
-    		$sql = "SELECT s.nom, s.rowid as socid,";
+    		$sql = "SELECT s.nom as name, s.rowid as socid,";
     		$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat, c.datec, c.fin_validite, c.date_cloture";
     		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as c";
     		if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -108,7 +108,7 @@ class box_contracts extends ModeleBoxes
     				'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
     				$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-    				'text' => dol_trunc($objp->nom,40),
+    				'text' => dol_trunc($objp->name,40),
     				'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
     				$this->info_box_contents[$i][4] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php
index 92af03f57add6fafce0c7cedd2fdef4bb4f5f99d..ee5326250b30193efda2587ee674e60dbf6fbed2 100644
--- a/htdocs/core/boxes/box_factures.php
+++ b/htdocs/core/boxes/box_factures.php
@@ -66,7 +66,7 @@ class box_factures extends ModeleBoxes
 		{
 			$sql = "SELECT f.rowid as facid, f.facnumber, f.type, f.amount, f.datef as df";
 			$sql.= ", f.paye, f.fk_statut, f.datec, f.tms";
-			$sql.= ", s.nom, s.rowid as socid";
+			$sql.= ", s.nom as name, s.rowid as socid";
 			$sql.= ", f.date_lim_reglement as datelimite";
 			$sql.= " FROM (".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f";
 			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -113,7 +113,7 @@ class box_factures extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'maxlength'=>40,
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php
index 20d2a11bf9c982ab606d867a01b1e5f12a17cbc2..441c9f743fe23d22643488d89953e10ed5fa7500 100644
--- a/htdocs/core/boxes/box_factures_fourn.php
+++ b/htdocs/core/boxes/box_factures_fourn.php
@@ -63,7 +63,7 @@ class box_factures_fourn extends ModeleBoxes
 
 		if ($user->rights->fournisseur->facture->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid,";
+			$sql = "SELECT s.nom as name, s.rowid as socid,";
 			$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.amount,";
 			$sql.= " f.paye, f.fk_statut,";
 			$sql.= ' f.datef as df,';
@@ -115,7 +115,7 @@ class box_factures_fourn extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][5] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php
index dadfe58a27a8da522b56ea78cd4d9f847da114a5..aa217f1c436f79ca558973b7cee6f8d13c52d027 100644
--- a/htdocs/core/boxes/box_factures_fourn_imp.php
+++ b/htdocs/core/boxes/box_factures_fourn_imp.php
@@ -60,7 +60,7 @@ class box_factures_fourn_imp extends ModeleBoxes
 
 		if ($user->rights->fournisseur->facture->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid,";
+			$sql = "SELECT s.nom as name, s.rowid as socid,";
 			$sql.= " f.rowid as facid, f.ref, f.ref_supplier, f.date_lim_reglement as datelimite,";
 			$sql.= " f.amount, f.datef as df,";
 			$sql.= " f.paye, f.fk_statut, f.type";
@@ -111,7 +111,7 @@ class box_factures_fourn_imp extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][5] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php
index 8aab8fa9b1520cb8ec51c883af8ec2cebb05a1dc..e6df1530f8df1cdd311aa66714c061d8d79fce28 100644
--- a/htdocs/core/boxes/box_factures_imp.php
+++ b/htdocs/core/boxes/box_factures_imp.php
@@ -63,7 +63,7 @@ class box_factures_imp extends ModeleBoxes
 
 		if ($user->rights->facture->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid,";
+			$sql = "SELECT s.nom as name, s.rowid as socid,";
 			$sql.= " f.facnumber, f.date_lim_reglement as datelimite,";
 			$sql.= " f.amount, f.datef as df,";
 			$sql.= " f.paye, f.fk_statut, f.rowid as facid";
@@ -110,7 +110,7 @@ class box_factures_imp extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'maxlength'=>44,
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php
index 118a18a007a1532b8af2c70cddf432aeb4f21782..fdebad2f38a2eedd2edb16f71f5fa54d4c72e942 100644
--- a/htdocs/core/boxes/box_ficheinter.php
+++ b/htdocs/core/boxes/box_ficheinter.php
@@ -65,7 +65,7 @@ class box_ficheinter extends ModeleBoxes
 			$sql.= " f.datec,";
 			$sql.= " f.date_valid as datev,";
 			$sql.= " f.tms as datem,";
-			$sql.= " s.nom, s.rowid as socid, s.client";
+			$sql.= " s.nom as name, s.rowid as socid, s.client";
 			$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 			if (! $user->rights->societe->client->voir)
 				$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -109,7 +109,7 @@ class box_ficheinter extends ModeleBoxes
 					'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-					'text' => dol_trunc($objp->nom,40),
+					'text' => dol_trunc($objp->name,40),
 					'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][4] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php
index 3423d8bee638edbbcd7ec14f48da55b435c16ba0..f233221ccaa13be2b4e036678c80e6597a643c6e 100644
--- a/htdocs/core/boxes/box_fournisseurs.php
+++ b/htdocs/core/boxes/box_fournisseurs.php
@@ -62,7 +62,7 @@ class box_fournisseurs extends ModeleBoxes
 
         if ($user->rights->societe->lire)
         {
-            $sql = "SELECT s.nom, s.rowid as socid, s.datec, s.tms, s.status";
+            $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status";
             $sql .= " FROM ".MAIN_DB_PREFIX."societe as s";
             if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
             $sql.= " WHERE s.fournisseur = 1";
@@ -89,7 +89,7 @@ class box_fournisseurs extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][1] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => DOL_URL_ROOT."/fourn/card.php?socid=".$objp->socid);
 
                     $this->info_box_contents[$i][2] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php
index 19c007bb2874b32c8cdd2802ae0e1297b95706b3..b548e90671bbf83fc41fc783549c9568f6f19768 100644
--- a/htdocs/core/boxes/box_propales.php
+++ b/htdocs/core/boxes/box_propales.php
@@ -62,7 +62,7 @@ class box_propales extends ModeleBoxes
 
       if ($user->rights->propale->lire)
       {
-      	$sql = "SELECT s.nom, s.rowid as socid,";
+      	$sql = "SELECT s.nom as name, s.rowid as socid,";
         $sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture";
         $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
         $sql.= ", ".MAIN_DB_PREFIX."propal as p";
@@ -106,7 +106,7 @@ class box_propales extends ModeleBoxes
                 'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 				$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-        		'text' => dol_trunc($objp->nom,40),
+        		'text' => dol_trunc($objp->name,40),
         		'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
         		$this->info_box_contents[$i][4] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php
index 8c1a0afd28870fe1488f0ed65d01a6d20bc2cf2e..dd8682515c7b58902c51489035e449c460d48eec 100644
--- a/htdocs/core/boxes/box_prospect.php
+++ b/htdocs/core/boxes/box_prospect.php
@@ -63,7 +63,7 @@ class box_prospect extends ModeleBoxes
 
 		if ($user->rights->societe->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status";
+			$sql = "SELECT s.nom as name, s.rowid as socid, s.fk_stcomm, s.datec, s.tms, s.status";
 			$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 			if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 			$sql.= " WHERE s.client IN (2, 3)";
@@ -92,7 +92,7 @@ class box_prospect extends ModeleBoxes
 			            'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][1] = array('td' => 'align="left"',
-			            'text' => $objp->nom,
+			            'text' => $objp->name,
 			            'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][2] = array('td' => 'align="right"',
diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php
index d6e525e42d429df92a1219566ff92f456d943801..eb48fc83d2b754e4a8c092ced1ce77d63e826ec1 100644
--- a/htdocs/core/boxes/box_services_contracts.php
+++ b/htdocs/core/boxes/box_services_contracts.php
@@ -62,7 +62,7 @@ class box_services_contracts extends ModeleBoxes
 
 		if ($user->rights->service->lire && $user->rights->contrat->lire)
 		{
-			$sql = "SELECT s.nom, s.rowid as socid,";
+			$sql = "SELECT s.nom as name, s.rowid as socid,";
 			$sql.= " c.rowid,";
 			$sql.= " cd.rowid as cdid, cd.tms as datem, cd.statut,";
 			$sql.= " p.rowid as pid, p.label, p.fk_product_type";
@@ -125,7 +125,7 @@ class box_services_contracts extends ModeleBoxes
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
 					$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'maxlength' => 28,
                     'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php
index 8bfe57492156aec01ee4d08fb415f25da952c2f8..52f3777e2af86df56ce888f7c95002bc572ee0b0 100644
--- a/htdocs/core/boxes/box_services_expired.php
+++ b/htdocs/core/boxes/box_services_expired.php
@@ -63,7 +63,7 @@ class box_services_expired extends ModeleBoxes
     	    // Select contracts with at least one expired service
 			$sql = "SELECT ";
     		$sql.= " c.rowid, c.ref, c.statut as fk_statut, c.date_contrat,";
-			$sql.= " s.nom, s.rowid as socid,";
+			$sql.= " s.nom as name, s.rowid as socid,";
 			$sql.= " MIN(cd.date_fin_validite) as date_line, COUNT(cd.rowid) as nb_services";
     		$sql.= " FROM ".MAIN_DB_PREFIX."contrat as c, ".MAIN_DB_PREFIX."societe s, ".MAIN_DB_PREFIX."contratdet as cd";
             if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -104,7 +104,7 @@ class box_services_expired extends ModeleBoxes
     				'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
     				$this->info_box_contents[$i][3] = array('td' => 'align="left"',
-    				'text' => dol_trunc($objp->nom,40),
+    				'text' => dol_trunc($objp->name,40),
     				'url' => DOL_URL_ROOT."/comm/card.php?socid=".$objp->socid);
 
     				$this->info_box_contents[$i][4] = array('td' => 'align="center"',
diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php
index 0634b1548a836d47e054dbeb6a3a992d615019ff..876b50c849fd954b7d600ff81b87f15f90658c9f 100644
--- a/htdocs/core/boxes/box_supplier_orders.php
+++ b/htdocs/core/boxes/box_supplier_orders.php
@@ -62,7 +62,7 @@ class box_supplier_orders extends ModeleBoxes
 
         if ($user->rights->fournisseur->commande->lire)
         {
-            $sql = "SELECT s.nom, s.rowid as socid,";
+            $sql = "SELECT s.nom as name, s.rowid as socid,";
             $sql.= " c.ref, c.tms, c.rowid,";
             $sql.= " c.fk_statut";
             $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -102,7 +102,7 @@ class box_supplier_orders extends ModeleBoxes
                     'url' => $urls);
 
                     $this->info_box_contents[$i][3] = array('td' => 'align="left"',
-                    'text' => $objp->nom,
+                    'text' => $objp->name,
                     'url' => $urls);
 
                     $this->info_box_contents[$i][4] = array('td' => 'align="right"',
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 33b1d42ca084c8685980e7f1611a5c6a4c4ad8ff..51b9c5eff4677f5fe098b31355e7d68144431da8 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -769,7 +769,7 @@ class Form
         $outarray=array();
 
         // On recherche les societes
-        $sql = "SELECT s.rowid, s.nom, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
+        $sql = "SELECT s.rowid, s.nom as name, s.client, s.fournisseur, s.code_client, s.code_fournisseur";
         $sql.= " FROM ".MAIN_DB_PREFIX ."societe as s";
         if (!$user->rights->societe->client->voir && !$user->societe_id) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
         $sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
@@ -836,11 +836,11 @@ class Form
                     	if (($obj->fournisseur) && (!empty($obj->code_fournisseur))) {
                     		$label .= $obj->code_fournisseur. ' - ';
                     	}
-                    	$label.=' '.$obj->nom;
+                    	$label.=' '.$obj->name;
                     }
                     else
                     {
-                    	$label=$obj->nom;
+                    	$label=$obj->name;
                     }
 
                     if ($showtype)
@@ -996,16 +996,12 @@ class Form
 
         // On recherche les societes
         $sql = "SELECT sp.rowid, sp.lastname, sp.statut, sp.firstname, sp.poste";
-        if ($showsoc > 0) {
-        	$sql.= " , s.nom as company";
-        }
+        if ($showsoc > 0) $sql.= " , s.nom as company";
         $sql.= " FROM ".MAIN_DB_PREFIX ."socpeople as sp";
-        if ($showsoc > 0) {
-        	$sql.= " LEFT OUTER JOIN  ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc ";
-        }
+        if ($showsoc > 0) $sql.= " LEFT OUTER JOIN  ".MAIN_DB_PREFIX ."societe as s ON s.rowid=sp.fk_soc";
         $sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
         if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid;
-        if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0 ";
+        if (! empty($conf->global->CONTACT_HIDE_INACTIVE_IN_COMBOBOX)) $sql.= " AND sp.statut<>0";
         $sql.= " ORDER BY sp.lastname ASC";
 
         dol_syslog(get_class($this)."::select_contacts", LOG_DEBUG);
@@ -1839,7 +1835,7 @@ class Form
 
         $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
         $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.remise_percent, pfp.remise, pfp.unitprice,";
-        $sql.= " s.nom";
+        $sql.= " s.nom as name";
         $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
         if ($socid) $sql.= " AND pfp.fk_soc = ".$socid;
@@ -1951,8 +1947,8 @@ class Form
                     }
                     if (! $socid)
                     {
-                        $opt .= " - ".dol_trunc($objp->nom,8);
-                        $outval.=" - ".dol_trunc($objp->nom,8);
+                        $opt .= " - ".dol_trunc($objp->name,8);
+                        $outval.=" - ".dol_trunc($objp->name,8);
                     }
                 }
                 else
@@ -2007,7 +2003,7 @@ class Form
 
         $sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
         $sql.= " pfp.ref_fourn, pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.quantity, pfp.unitprice,";
-        $sql.= " s.nom";
+        $sql.= " s.nom as name";
         $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as pfp ON p.rowid = pfp.fk_product";
         $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON pfp.fk_soc = s.rowid";
@@ -2044,7 +2040,7 @@ class Form
                     if($num == 1) {
                         $opt .= ' selected="selected"';
                     }
-                    $opt.= '>'.$objp->nom.' - '.$objp->ref_fourn.' - ';
+                    $opt.= '>'.$objp->name.' - '.$objp->ref_fourn.' - ';
 
                     if ($objp->quantity == 1)
                     {
@@ -4433,7 +4429,7 @@ class Form
         $out='';
 
         // On recherche les groupes
-        $sql = "SELECT ug.rowid, ug.nom ";
+        $sql = "SELECT ug.rowid, ug.nom as name";
         if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
         {
             $sql.= ", e.label";
@@ -4478,7 +4474,7 @@ class Form
                     }
                     $out.= '>';
 
-                    $out.= $obj->nom;
+                    $out.= $obj->name;
                     if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1)
                     {
                         $out.= " (".$obj->label.")";
diff --git a/htdocs/core/class/html.formcompany.class.php b/htdocs/core/class/html.formcompany.class.php
index f158a86f5da60b0174b4834f40dcd04c63bde2c9..ef58b6c7322275aa93c97f31cc9b8d212281943a 100644
--- a/htdocs/core/class/html.formcompany.class.php
+++ b/htdocs/core/class/html.formcompany.class.php
@@ -222,7 +222,7 @@ class FormCompany
 		$out='';
 
 		// On recherche les departements/cantons/province active d'une region et pays actif
-		$sql = "SELECT d.rowid, d.code_departement as code , d.nom, d.active, c.label as country, c.code as country_code FROM";
+		$sql = "SELECT d.rowid, d.code_departement as code, d.nom as name, d.active, c.label as country, c.code as country_code FROM";
 		$sql .= " ".MAIN_DB_PREFIX ."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r,".MAIN_DB_PREFIX."c_country as c";
 		$sql .= " WHERE d.fk_region=r.code_region and r.fk_pays=c.rowid";
 		$sql .= " AND d.active = 1 AND r.active = 1 AND c.active = 1";
@@ -270,7 +270,7 @@ class FormCompany
 							$out.= '<option value="'.$obj->rowid.'">';
 						}
 						// Si traduction existe, on l'utilise, sinon on prend le libelle par defaut
-						$out.= $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->nom!='-'?$obj->nom:''));
+						$out.= $obj->code . ' - ' . ($langs->trans($obj->code)!=$obj->code?$langs->trans($obj->code):($obj->name!='-'?$obj->name:''));
 						$out.= '</option>';
 					}
 					$i++;
@@ -292,7 +292,7 @@ class FormCompany
 	 *   Retourne la liste deroulante des regions actives dont le pays est actif
 	 *   La cle de la liste est le code (il peut y avoir plusieurs entree pour
 	 *   un code donnee mais dans ce cas, le champ pays et lang differe).
-	 *   Ainsi les liens avec les regions se font sur une region independemment de son nom.
+	 *   Ainsi les liens avec les regions se font sur une region independemment de son name.
 	 *
 	 *   @param		string		$selected		Preselected value
 	 *   @param		string		$htmlname		Name of HTML select field
@@ -529,20 +529,20 @@ class FormCompany
 		global $conf, $langs;
 
 		// On recherche les societes
-		$sql = "SELECT s.rowid, s.nom FROM";
+		$sql = "SELECT s.rowid, s.nom as name FROM";
 		$sql.= " ".MAIN_DB_PREFIX."societe as s";
 		$sql.= " WHERE s.entity IN (".getEntity('societe', 1).")";
-		if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND rowid = ".$selected;
+		if ($selected && $conf->use_javascript_ajax && ! empty($conf->global->COMPANY_USE_SEARCH_TO_SELECT)) $sql.= " AND s.rowid = ".$selected;
 		else
 		{
 			// For ajax search we limit here. For combo list, we limit later
 			if ($conf->use_javascript_ajax && $conf->global->COMPANY_USE_SEARCH_TO_SELECT
 			&& is_array($limitto) && count($limitto))
 			{
-				$sql.= " AND rowid IN (".join(',',$limitto).")";
+				$sql.= " AND s.rowid IN (".join(',',$limitto).")";
 			}
 		}
-		$sql.= " ORDER BY nom ASC";
+		$sql.= " ORDER BY s.nom ASC";
 
 		$resql = $this->db->query($sql);
 		if ($resql)
@@ -620,7 +620,7 @@ class FormCompany
 				}
 				else
 				{
-					print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->nom.'" '.$htmloption.' />';
+					print '<input type="text" size="30" id="search_'.$htmlname.'" name="search_'.$htmlname.'" value="'.$obj->name.'" '.$htmloption.' />';
 				}
 				print ajax_autocompleter(($socid?$socid:-1),$htmlname,DOL_URL_ROOT.'/societe/ajaxcompanies.php','',$minLength);
 				//print '</td>';
@@ -653,14 +653,14 @@ class FormCompany
 						{
 							print '<option value="'.$obj->rowid.'"';
 							if ($disabled) print ' disabled="disabled"';
-							print ' selected="selected">'.dol_trunc($obj->nom,24).'</option>';
+							print ' selected="selected">'.dol_trunc($obj->name,24).'</option>';
 							$firstCompany = $obj->rowid;
 						}
 						else
 						{
 							print '<option value="'.$obj->rowid.'"';
 							if ($disabled) print ' disabled="disabled"';
-							print '>'.dol_trunc($obj->nom,24).'</option>';
+							print '>'.dol_trunc($obj->name,24).'</option>';
 						}
 						$i ++;
 					}
diff --git a/htdocs/core/class/infobox.class.php b/htdocs/core/class/infobox.class.php
index fdc2d6fbe4f45575b3e690deba26e00c61deab32..52d27f8252389986b5bbb1a7a18ee449cdac1794 100644
--- a/htdocs/core/class/infobox.class.php
+++ b/htdocs/core/class/infobox.class.php
@@ -202,7 +202,8 @@ class InfoBox
 
         $db->begin();
 
-        // Sauve parametre indiquant que le user a une config dediee
+        // Save parameters to say user has a dedicated setup
+        $tab=array();
         $confuserzone='MAIN_BOXES_'.$zone;
         $tab[$confuserzone]=1;
         if (dol_set_user_param($db, $conf, $user, $tab) < 0)
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index d5bd9ae9198138d83a055a97ac847a33a9f62653..f85d1c8f4af617d288b5197aa1cf2d99fbce79ea 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -954,7 +954,7 @@ function dol_meta_create($object)
 		if (is_dir($dir))
 		{
 			$nblignes = count($object->lines);
-			$client = $object->client->nom . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town;
+			$client = $object->client->name . " " . $object->client->address . " " . $object->client->zip . " " . $object->client->town;
 			$meta = "REFERENCE=\"" . $object->ref . "\"
 			DATE=\"" . dol_print_date($object->date,'') . "\"
 			NB_ITEMS=\"" . $nblignes . "\"
diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php
index 38ca67bc9b23a64df9f68b5f24966c117aa9b4af..746755b824c8091e3ab7b01ae1b8e57e846a2671 100644
--- a/htdocs/core/lib/functions2.lib.php
+++ b/htdocs/core/lib/functions2.lib.php
@@ -1143,8 +1143,8 @@ function weight_convert($weight,&$from_unit,$to_unit)
  *
  *	@param	DoliDB	$db         Handler database
  *	@param	Conf	$conf		Object conf
- *	@param	User	$user      Object user
- *	@param	array	$tab        Tableau (cle=>valeur) des parametres a sauvegarder
+ *	@param	User	$user      	Object user
+ *	@param	array	$tab        Array (key=>value) with all parameters to save
  *	@return int         		<0 if KO, >0 if OK
  *
  *	@see		dolibarr_get_const, dolibarr_set_const, dolibarr_del_const
diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php
index ff0587c7612f58bfa63ebb703b8b204486ef47d9..5000e00b345e3334e9fc58ff5b7609107486c250 100644
--- a/htdocs/core/lib/pdf.lib.php
+++ b/htdocs/core/lib/pdf.lib.php
@@ -682,7 +682,7 @@ function pdf_pagefoot(&$pdf,$outputlangs,$paramfreetext,$fromcompany,$marge_bass
 	{
 		// Make substitution
 		$substitutionarray=array(
-			'__FROM_NAME__' => $fromcompany->nom,
+			'__FROM_NAME__' => $fromcompany->name,
 			'__FROM_EMAIL__' => $fromcompany->email,
 			'__TOTAL_TTC__' => $object->total_ttc,
 			'__TOTAL_HT__' => $object->total_ht,
diff --git a/htdocs/core/lib/tax.lib.php b/htdocs/core/lib/tax.lib.php
index 62e46b7b9f73755a5755608547c9294af15dbc68..cc9478f5d6157fff7b8cecec4bba88503517f7de 100644
--- a/htdocs/core/lib/tax.lib.php
+++ b/htdocs/core/lib/tax.lib.php
@@ -124,7 +124,7 @@ function vat_by_thirdparty($db, $y, $date_start, $date_end, $modetax, $direction
         }
         if (! empty($conf->global->MAIN_MODULE_COMPTABILITE))
         {
-            $sql = "SELECT s.rowid as socid, s.nom as nom, s.siren as tva_intra, s.tva_assuj as assuj,";
+            $sql = "SELECT s.rowid as socid, s.nom as name, s.siren as tva_intra, s.tva_assuj as assuj,";
             $sql.= " sum(fd.total_ht) as amount, sum(fd.".$total_tva.") as tva,";
             $sql.= " sum(fd.".$total_localtax1.") as localtax1,";
             $sql.= " sum(fd.".$total_localtax2.") as localtax2";
diff --git a/htdocs/core/modules/barcode/mod_barcode_product_standard.php b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
index 28fa03ee4f3251ef57f9616cf36402ded6f16c60..0bd7a262a9c0c1994ed24f34d555c800425a3e60 100644
--- a/htdocs/core/modules/barcode/mod_barcode_product_standard.php
+++ b/htdocs/core/modules/barcode/mod_barcode_product_standard.php
@@ -33,7 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/barcode/modules_barcode.class.php'
  */
 class mod_barcode_product_standard extends ModeleNumRefBarCode
 {
-	var $nom='Standard';				// Model Name
+	var $name='Standard';				// Model Name
 	var $code_modifiable;				// Editable code
 	var $code_modifiable_invalide;		// Modified code if it is invalid
 	var $code_modifiable_null;			// Modified code if it is null
diff --git a/htdocs/core/modules/barcode/modules_barcode.class.php b/htdocs/core/modules/barcode/modules_barcode.class.php
index 0f87306354a8d09677e9e90ce75e25953052d750..d03302f36b7d0693b47067706fec3790fd162a63 100644
--- a/htdocs/core/modules/barcode/modules_barcode.class.php
+++ b/htdocs/core/modules/barcode/modules_barcode.class.php
@@ -62,7 +62,7 @@ abstract class ModeleNumRefBarCode
         $langs->load("bills");
         return $langs->trans("NoDescription");
     }
-	
+
     /**     Return model name
      *
      *		@param	Translate	$langs		Object langs
@@ -70,10 +70,10 @@ abstract class ModeleNumRefBarCode
      */
     function getNom($langs)
     {
-        return $this->nom;
+        return empty($this->name)?$this->nom:$this->name;
     }
-	
-    /**     Return a numbering example 
+
+    /**     Return a numbering example
      *
      *		@param	Translate	$langs		Object langs
      *      @return string      			Example
@@ -96,7 +96,7 @@ abstract class ModeleNumRefBarCode
         global $langs;
         return $langs->trans("Function_getNextValue_InModuleNotWorking");
     }
-	
+
 	/**     Return version of module
      *
      *      @return     string      Version
@@ -112,7 +112,7 @@ abstract class ModeleNumRefBarCode
         if ($this->version) return $this->version;
         return $langs->trans("NotAvailable");
     }
-	
+
     /**
      *      Return description of module parameters
      *
@@ -128,7 +128,7 @@ abstract class ModeleNumRefBarCode
         $langs->load("admin");
 
         $s='';
-        $s.=$langs->trans("Name").': <b>'.$this->nom.'</b><br>';
+        $s.=$langs->trans("Name").': <b>'.$this->name.'</b><br>';
         $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
         if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
         $s.='<br>';
@@ -171,6 +171,6 @@ abstract class ModeleNumRefBarCode
 
         return $s;
     }
-    
+
 }
 
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index 895ad153fc8c27d99be9a6ae351967f27c479a27..e95d40e0908d9a69ce537f01822fcab5979ce580 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -277,7 +277,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				'__TOTAL_TTC__' => $object->total_ttc,
 				'__TOTAL_HT__' => $object->total_ht,
@@ -483,7 +483,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
 				}
 
 				$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
-				
+
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 
diff --git a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
index 7c2b7e742a5e5a8a44579f331500044c5e17a856..3e7803af70afedafa78c7846d4d604e287e40600 100644
--- a/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_einstein.modules.php
@@ -1233,12 +1233,12 @@ class pdf_einstein extends ModelePDFCommandes
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
index 05dfadac4a7165393052e8fdf746d256cc28cff8..0216bd4163aac9aa16d5c622c92b82c686014d5a 100644
--- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
+++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php
@@ -1190,12 +1190,12 @@ class pdf_proforma extends ModelePDFCommandes
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
index d522a12eef2cd3cdb35213169e2eeb6405b3e9c5..bd4cc3337430d652a0737b1b8973de36d09c97c2 100644
--- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php
+++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php
@@ -586,12 +586,12 @@ class pdf_strato extends ModelePDFContract
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$this->recipient->name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$this->recipient->name=$outputlangs->convToOutputCharset($object->client->nom);
+				$this->recipient->name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index b4325139878bf9bd694c937e24c759325d484be0..aaddbc1d7484bee6016ddb2655c140c817f0e3b0 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -277,7 +277,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				'__TOTAL_TTC__' => $object->total_ttc,
 				'__TOTAL_HT__' => $object->total_ht,
@@ -483,7 +483,7 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
 				}
 
 				$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
-				
+
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 
diff --git a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
index 69286c7980da9249a36891546c8d0e07f4549e29..bdf61e3ea72da8d840cf019a8a35e7fd33a491e9 100644
--- a/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_merou.modules.php
@@ -617,12 +617,12 @@ class pdf_merou extends ModelePdfExpedition
 		{
 			// On peut utiliser le nom de la societe du contact
 			if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-			else $socname = $object->client->nom;
+			else $socname = $object->client->name;
 			$carac_client_name=$outputlangs->convToOutputCharset($socname);
 		}
 		else
 		{
-			$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+			$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 		}
 
 		$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails');
diff --git a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
index bf4b738354a18a144d7cb372eafbd2186ec86e56..ccb4f93a611b37ab0844ca936c66b289761c6313 100644
--- a/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_rouget.modules.php
@@ -631,12 +631,12 @@ class pdf_rouget extends ModelePdfExpedition
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails');
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index 0084df11e72bc59c3a2321524ae8ea5f82195f05..023978d099926e7e8d30876b560a8c44bade3805 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -285,7 +285,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				'__TOTAL_TTC__' => $object->total_ttc,
 				'__TOTAL_HT__' => $object->total_ht,
@@ -440,7 +440,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
 				}
 
 				$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
-				
+
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 
diff --git a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
index 6b337ac4ad3f41d1d4aa9499876b5fbff40d00a2..35a0ff47aa076419863b97ed3b62eef71aa16694 100644
--- a/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
+++ b/htdocs/core/modules/facture/doc/pdf_crabe.modules.php
@@ -182,7 +182,7 @@ class pdf_crabe extends ModelePDFFactures
 			}
 		}
 		if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
-				
+
 		if ($conf->facture->dir_output)
 		{
 			$object->fetch_thirdparty();
@@ -369,7 +369,7 @@ class pdf_crabe extends ModelePDFFactures
 						// $pdf->Image does not increase value return by getY, so we save it manually
 						$posYAfterImage=$curY+$imglinesize['height'];
 					}
-					
+
 					// Description of product line
 					$curX = $this->posxdesc-1;
 
@@ -407,7 +407,7 @@ class pdf_crabe extends ModelePDFFactures
 						$pdf->commitTransaction();
 					}
 					$posYAfterDescription=$pdf->GetY();
-					
+
 					$nexY = $pdf->GetY();
 					$pageposafter=$pdf->getPage();
 					$pdf->setPage($pageposbefore);
@@ -487,7 +487,7 @@ class pdf_crabe extends ModelePDFFactures
 					$this->tva[$vatrate] += $tvaligne;
 
 					if ($posYAfterImage > $posYAfterDescription) $nexY=$posYAfterImage;
-					
+
 					// Add line
 					if (! empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblignes - 1))
 					{
@@ -1241,7 +1241,7 @@ class pdf_crabe extends ModelePDFFactures
 				//$pdf->MultiCell($this->posxtva-$this->posxpicture-1,2, $outputlangs->transnoentities("Photo"),'','C');
 			}
 		}
-		
+
 		if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
 		{
 			$pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
@@ -1479,12 +1479,12 @@ class pdf_crabe extends ModelePDFFactures
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index 7a697817eb3ba77dcd9c751d490430493c2f6536..0d09aa7ce6cde028e7ebbd190780c2e670867501 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -565,12 +565,12 @@ class pdf_soleil extends ModelePDFFicheinter
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
diff --git a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
index bb9f1d155ffd658c326dc4fe24b15622f096648b..7717a43c57504419051fcf0731a3c852609f85c3 100644
--- a/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
+++ b/htdocs/core/modules/livraison/doc/pdf_typhon.modules.php
@@ -825,12 +825,12 @@ class pdf_typhon extends ModelePDFDeliveryOrder
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
diff --git a/htdocs/core/modules/mailings/framboise.modules.php b/htdocs/core/modules/mailings/framboise.modules.php
index d8f88ef766cd83dc443ebb3958291beb38fa0ccf..c647466e79649bdf1710ad11cf3473e7f31442da 100644
--- a/htdocs/core/modules/mailings/framboise.modules.php
+++ b/htdocs/core/modules/mailings/framboise.modules.php
@@ -59,7 +59,7 @@ class mailing_framboise extends MailingTargets
 		global $conf, $langs;
 		$langs->load("members");
 		$langs->load("companies");
-		
+
 		$cibles = array();
 
 		// Select the members from category
@@ -229,10 +229,6 @@ class mailing_framboise extends MailingTargets
 	 */
 	function url($id)
 	{
-		//$companystatic=new Societe($this->db);
-		//$companystatic->id=$id;
-		//$companystatic->nom='';
-		//return $companystatic->getNomUrl(1);	// Url too long
 		return '<a href="'.DOL_URL_ROOT.'/adherents/card.php?rowid='.$id.'">'.img_object('',"user").'</a>';
 	}
 
diff --git a/htdocs/core/modules/mailings/thirdparties.modules.php b/htdocs/core/modules/mailings/thirdparties.modules.php
index 9d7fb16aaaba5deaaebb8f7cee5fd4c3cc239542..df8ec79f9885826c45980f8eb5db674f20b736a6 100644
--- a/htdocs/core/modules/mailings/thirdparties.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties.modules.php
@@ -240,10 +240,6 @@ class mailing_thirdparties extends MailingTargets
 	 */
 	function url($id)
 	{
-		//$companystatic=new Societe($this->db);
-		//$companystatic->id=$id;
-		//$companystatic->nom='';
-		//return $companystatic->getNomUrl(1);	// Url too long
 		return '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$id.'">'.img_object('',"company").'</a>';
 	}
 
diff --git a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
index a907ad0ec3f0ed8a3fb59517abb5655c9bb6a811..5837329a476e5067abe69a763c64678a8249e0c9 100644
--- a/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
+++ b/htdocs/core/modules/mailings/thirdparties_services_expired.modules.php
@@ -40,7 +40,7 @@ class mailing_thirdparties_services_expired extends MailingTargets
     function __construct($db)
     {
     	global $conf;
-    	
+
         $this->db=$db;
 
         $this->arrayofproducts=array();
@@ -233,10 +233,6 @@ class mailing_thirdparties_services_expired extends MailingTargets
      */
     function url($id)
     {
-        //$companystatic=new Societe($this->db);
-        //$companystatic->id=$id;
-        //$companystatic->nom='';
-        //return $companystatic->getNomUrl(1);	// Url too long
         return '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$id.'">'.img_object('',"company").'</a>';
     }
 
diff --git a/htdocs/core/modules/product/mod_codeproduct_elephant.php b/htdocs/core/modules/product/mod_codeproduct_elephant.php
index 37383474c2d01a70b77058e5965358e8919162e8..5a041fd31ce00cd06f988d67e8b1077143d0db1a 100644
--- a/htdocs/core/modules/product/mod_codeproduct_elephant.php
+++ b/htdocs/core/modules/product/mod_codeproduct_elephant.php
@@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/product/modules_product.class.php'
 class mod_codeproduct_elephant extends ModeleProductCode
 {
 	var $nom='Elephant';				// Nom du modele
+	var $name='Elephant';				// Nom du modele
 	var $code_modifiable;				// Code modifiable
 	var $code_modifiable_invalide;		// Code modifiable si il est invalide
 	var $code_modifiable_null;			// Code modifiables si il est null
diff --git a/htdocs/core/modules/product/mod_codeproduct_leopard.php b/htdocs/core/modules/product/mod_codeproduct_leopard.php
index a3df52f682ffcd8acebb2b665a1d9a4080c6e475..3b850e1ba91503beb30c40f56a294f9d49619954 100644
--- a/htdocs/core/modules/product/mod_codeproduct_leopard.php
+++ b/htdocs/core/modules/product/mod_codeproduct_leopard.php
@@ -40,6 +40,7 @@ class mod_codeproduct_leopard extends ModeleProductCode
 	 */
 
 	var $nom='Leopard';					// Nom du modele
+	var $name='Leopard';					// Nom du modele
 	var $code_modifiable;				// Code modifiable
 	var $code_modifiable_invalide;		// Code modifiable si il est invalide
 	var $code_modifiable_null;			// Code modifiables si il est null
diff --git a/htdocs/core/modules/product/modules_product.class.php b/htdocs/core/modules/product/modules_product.class.php
index 66affcf256a0b815735c54cbab205c08bee0aab7..0bfd3f8f03ef5931f829e88ed9432d4725d7d0dd 100644
--- a/htdocs/core/modules/product/modules_product.class.php
+++ b/htdocs/core/modules/product/modules_product.class.php
@@ -46,7 +46,7 @@ abstract class ModeleProductCode
      */
     function getNom($langs)
     {
-        return $this->nom;
+        return empty($this->name)?$this->nom:$this->name;
     }
 
 
@@ -147,7 +147,7 @@ abstract class ModeleProductCode
         $langs->load("admin");
 
         $s='';
-        if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->nom.'</b><br>';
+        if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
         if ($type == -1) $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
         if ($type == 0)  $s.=$langs->trans("ProductCodeDesc").'<br>';
         if ($type == 1)  $s.=$langs->trans("ServiceCodeDesc").'<br>';
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index fc18f1068cebf74dd7940e2f331ec12ce5c4b93a..97e571c29727072b8a57845ca04dd8eb76689a7b 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -339,7 +339,7 @@ class doc_generic_project_odt extends ModelePDFProjects
 		$texte.= '</div><div style="display: inline-block; vertical-align: middle;">';
 		$texte.= '<input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button">';
 		$texte.= '<br></div></div>';
-		
+
 		// Scan directories
 		if (count($listofdir)) $texte.=$langs->trans("NumberOfModelFilesFound").': <b>'.count($listoffiles).'</b>';
 
@@ -452,7 +452,7 @@ class doc_generic_project_odt extends ModelePDFProjects
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				);
 				complete_substitutions_array($substitutionarray, $langs, $object);
@@ -1020,7 +1020,7 @@ class doc_generic_project_odt extends ModelePDFProjects
 				}
 
 				$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
-				
+
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 
diff --git a/htdocs/core/modules/project/mod_project_simple.php b/htdocs/core/modules/project/mod_project_simple.php
index 17ae9f29ddf5646cd0a8e5c7abee50f3e7ac96d2..49e4586d07b5dcf811b32f35788e1d2722ef0eea 100644
--- a/htdocs/core/modules/project/mod_project_simple.php
+++ b/htdocs/core/modules/project/mod_project_simple.php
@@ -35,11 +35,12 @@ class mod_project_simple extends ModeleNumRefProjects
 	var $prefix='PJ';
     var $error='';
 	var $nom = "Simple";
+	var $name = "Simple";
 
 
-    /** 
+    /**
      *  Return description of numbering module
-     * 
+     *
      *  @return     string      Text with description
      */
     function info()
@@ -49,9 +50,9 @@ class mod_project_simple extends ModeleNumRefProjects
     }
 
 
-    /** 
+    /**
      *  Return an example of numbering module values
-     * 
+     *
      * 	@return     string      Example
      */
     function getExample()
@@ -62,7 +63,7 @@ class mod_project_simple extends ModeleNumRefProjects
 
     /**  Test si les numeros deja en vigueur dans la base ne provoquent pas de
      *   de conflits qui empechera cette numerotation de fonctionner.
-     * 
+     *
      *   @return     boolean     false si conflit, true si ok
      */
     function canBeActivated()
@@ -97,7 +98,7 @@ class mod_project_simple extends ModeleNumRefProjects
 
    /**
 	*  Return next value
-	* 
+	*
 	*  @param   Societe	$objsoc		Object third party
 	*  @param   Project	$project	Object project
 	*  @return	string				Value if OK, 0 if KO
@@ -130,7 +131,7 @@ class mod_project_simple extends ModeleNumRefProjects
 
 		//$yymm = strftime("%y%m",time());
 		$yymm = strftime("%y%m",$date);
-		
+
 		if ($max >= (pow(10, 4) - 1)) $num=$max+1;	// If counter > 9999, we do not format on 4 chars, we take number as it is
 		else $num = sprintf("%04s",$max+1);
 
@@ -139,9 +140,9 @@ class mod_project_simple extends ModeleNumRefProjects
     }
 
 
-    /** 
+    /**
      * 	Return next reference not yet used as a reference
-     * 
+     *
      *  @param	Societe	$objsoc     Object third party
      *  @param  Project	$project	Object project
      *  @return string      		Next not used reference
diff --git a/htdocs/core/modules/project/mod_project_universal.php b/htdocs/core/modules/project/mod_project_universal.php
index 5633a61f8ac1e7328d72d7ec6fd35a6d72405c0f..e76ed349b46ca9fff152a6be6420c871d8f5a3c7 100644
--- a/htdocs/core/modules/project/mod_project_universal.php
+++ b/htdocs/core/modules/project/mod_project_universal.php
@@ -33,11 +33,12 @@ class mod_project_universal extends ModeleNumRefProjects
 	var $version='dolibarr';		// 'development', 'experimental', 'dolibarr'
 	var $error = '';
 	var $nom = 'Universal';
+	var $name = 'Universal';
 
 
     /**
      *  Renvoi la description du modele de numerotation
-     * 
+     *
      *  @return     string      Texte descripif
      */
 	function info()
@@ -78,7 +79,7 @@ class mod_project_universal extends ModeleNumRefProjects
 
     /**
      *  Renvoi un exemple de numerotation
-     * 
+     *
      *  @return     string      Example
      */
     function getExample()
@@ -99,7 +100,7 @@ class mod_project_universal extends ModeleNumRefProjects
 
    /**
 	*  Return next value
-	* 
+	*
 	*  @param	Societe		$objsoc		Object third party
 	*  @param   Project		$project	Object project
 	*  @return  string					Value if OK, 0 if KO
@@ -126,9 +127,9 @@ class mod_project_universal extends ModeleNumRefProjects
 	}
 
 
-    /**   
+    /**
      *  Return next reference not yet used as a reference
-     * 
+     *
      *  @param	Societe		$objsoc     Object third party
      *  @param  Project		$project	Object project
      *  @return string      			Next not used reference
diff --git a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
index dd70a49f3e125c5dd1265e2022346a2cb956498e..28b458732abe8f74030091f9b6941de6e84c6696 100644
--- a/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
+++ b/htdocs/core/modules/project/task/doc/doc_generic_task_odt.modules.php
@@ -438,7 +438,7 @@ class doc_generic_task_odt extends ModelePDFTask
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				);
 				complete_substitutions_array($substitutionarray, $langs, $object);
diff --git a/htdocs/core/modules/project/task/mod_task_simple.php b/htdocs/core/modules/project/task/mod_task_simple.php
index eb8928d3b8fb409a175096f45288e2c1f2cd4052..0e7b416d72ee21d92d60c85d85573f2bced8aca3 100644
--- a/htdocs/core/modules/project/task/mod_task_simple.php
+++ b/htdocs/core/modules/project/task/mod_task_simple.php
@@ -35,11 +35,12 @@ class mod_task_simple extends ModeleNumRefTask
 	var $prefix='TK';
     var $error='';
 	var $nom = "Simple";
+	var $name = "Simple";
 
 
-    /** 
+    /**
      *  Return description of numbering module
-     * 
+     *
      *  @return     string      Text with description
      */
     function info()
@@ -49,9 +50,9 @@ class mod_task_simple extends ModeleNumRefTask
     }
 
 
-    /** 
+    /**
      *  Return an example of numbering module values
-     * 
+     *
      * 	@return     string      Example
      */
     function getExample()
@@ -62,7 +63,7 @@ class mod_task_simple extends ModeleNumRefTask
 
     /**  Test si les numeros deja en vigueur dans la base ne provoquent pas de
      *   de conflits qui empechera cette numerotation de fonctionner.
-     * 
+     *
      *   @return     boolean     false si conflit, true si ok
      */
     function canBeActivated()
@@ -98,7 +99,7 @@ class mod_task_simple extends ModeleNumRefTask
 
    /**
 	*  Return next value
-	* 
+	*
 	*  @param   Societe	$objsoc		Object third party
 	*  @param   Task	$task		Object Task
 	*  @return	string				Value if OK, 0 if KO
@@ -130,7 +131,7 @@ class mod_task_simple extends ModeleNumRefTask
 
 		//$yymm = strftime("%y%m",time());
 		$yymm = strftime("%y%m",$date);
-		
+
 		if ($max >= (pow(10, 4) - 1)) $num=$max+1;	// If counter > 9999, we do not format on 4 chars, we take number as it is
 		else $num = sprintf("%04s",$max+1);
 
@@ -139,9 +140,9 @@ class mod_task_simple extends ModeleNumRefTask
     }
 
 
-    /** 
+    /**
      * 	Return next reference not yet used as a reference
-     * 
+     *
      *  @param	Societe	$objsoc     Object third party
      *  @param  Task	$task		Object task
      *  @return string      		Next not used reference
diff --git a/htdocs/core/modules/project/task/mod_task_universal.php b/htdocs/core/modules/project/task/mod_task_universal.php
index 1e99f90411693c507345e582f5c409e09e0bc28c..529814079c1c945c6b3822f7950dac3d028a89da 100644
--- a/htdocs/core/modules/project/task/mod_task_universal.php
+++ b/htdocs/core/modules/project/task/mod_task_universal.php
@@ -33,11 +33,12 @@ class mod_task_universal extends ModeleNumRefTask
 	var $version='dolibarr';		// 'development', 'experimental', 'dolibarr'
 	var $error = '';
 	var $nom = 'Universal';
+	var $name = 'Universal';
 
 
     /**
      *  Renvoi la description du modele de numerotation
-     * 
+     *
      *  @return     string      Texte descripif
      */
 	function info()
@@ -78,7 +79,7 @@ class mod_task_universal extends ModeleNumRefTask
 
     /**
      *  Renvoi un exemple de numerotation
-     * 
+     *
      *  @return     string      Example
      */
     function getExample()
@@ -99,7 +100,7 @@ class mod_task_universal extends ModeleNumRefTask
 
    /**
 	*  Return next value
-	* 
+	*
 	*  @param	Societe		$objsoc		Object third party
 	*  @param   Project		$project	Object project
 	*  @return  string					Value if OK, 0 if KO
@@ -126,9 +127,9 @@ class mod_task_universal extends ModeleNumRefTask
 	}
 
 
-    /**   
+    /**
      *  Return next reference not yet used as a reference
-     * 
+     *
      *  @param	Societe		$objsoc     Object third party
      *  @param  Project		$project	Object project
      *  @return string      			Next not used reference
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index f216d69a0fdb96d716ac164b80fddf693f8d463a..4b662e19564875512a086a43b2ed1058e55ecb5a 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -311,7 +311,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
 
 				// Make substitution
 				$substitutionarray=array(
-				'__FROM_NAME__' => $this->emetteur->nom,
+				'__FROM_NAME__' => $this->emetteur->name,
 				'__FROM_EMAIL__' => $this->emetteur->email,
 				'__TOTAL_TTC__' => $object->total_ttc,
 				'__TOTAL_HT__' => $object->total_ht,
@@ -518,7 +518,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
 				}
 
 				$reshook=$hookmanager->executeHooks('afterODTCreation',$parameters,$this,$action);    // Note that $action and $object may have been modified by some hooks
-				
+
 				if (! empty($conf->global->MAIN_UMASK))
 					@chmod($file, octdec($conf->global->MAIN_UMASK));
 
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 1b042f3a0d6508069916e4db97614969d2cc879f..1cafa394e667bda997de96fe5e5008ca1a9cd220 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -730,7 +730,7 @@ class pdf_azur extends ModelePDFPropales
 				if (! empty($conf->global->FACTURE_CHQ_NUMBER))
 				{
 					$diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?3:$conf->global->PDF_DIFFSIZE_TITLE);
-					
+
 					if ($conf->global->FACTURE_CHQ_NUMBER > 0)
 					{
 						$account = new Account($this->db);
@@ -1328,12 +1328,12 @@ class pdf_azur extends ModelePDFPropales
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $object->client->nom;
+				else $socname = $object->client->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($object->client->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
diff --git a/htdocs/core/modules/societe/mod_codeclient_elephant.php b/htdocs/core/modules/societe/mod_codeclient_elephant.php
index 88b6e65bf0107c618c4a4620ee517359283df418..c24070c2e23e08a9137ac6663576594058bacd67 100644
--- a/htdocs/core/modules/societe/mod_codeclient_elephant.php
+++ b/htdocs/core/modules/societe/mod_codeclient_elephant.php
@@ -30,12 +30,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'
 
 
 /**
- *       \class 		mod_codeclient_elephant
- *       \brief 		Class to manage third party code with elephant rule
+ *	Class to manage third party code with elephant rule
  */
 class mod_codeclient_elephant extends ModeleThirdPartyCode
 {
 	var $nom='Elephant';				// Nom du modele
+	var $name='Elephant';				// Nom du modele
 	var $code_modifiable;				// Code modifiable
 	var $code_modifiable_invalide;		// Code modifiable si il est invalide
 	var $code_modifiable_null;			// Code modifiables si il est null
diff --git a/htdocs/core/modules/societe/mod_codeclient_leopard.php b/htdocs/core/modules/societe/mod_codeclient_leopard.php
index 27155847bf01c9273dd45ec2a6c5346fa4c26b58..94c9c04d2e285dd6792ffc9308528ad24ae7b157 100644
--- a/htdocs/core/modules/societe/mod_codeclient_leopard.php
+++ b/htdocs/core/modules/societe/mod_codeclient_leopard.php
@@ -39,6 +39,7 @@ class mod_codeclient_leopard extends ModeleThirdPartyCode
 	 */
 
 	var $nom='Leopard';					// Nom du modele
+	var $name='Leopard';				// Nom du modele
 	var $code_modifiable;				// Code modifiable
 	var $code_modifiable_invalide;		// Code modifiable si il est invalide
 	var $code_modifiable_null;			// Code modifiables si il est null
diff --git a/htdocs/core/modules/societe/mod_codeclient_monkey.php b/htdocs/core/modules/societe/mod_codeclient_monkey.php
index 4c735930820540d76cc8cd4d70a2a70eefd3d993..88ec1a6e8db3c498838b22cc19e8dc0815dfe10c 100644
--- a/htdocs/core/modules/societe/mod_codeclient_monkey.php
+++ b/htdocs/core/modules/societe/mod_codeclient_monkey.php
@@ -28,12 +28,12 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'
 
 
 /**
- *	\class 		mod_codeclient_monkey
- *	\brief 		Classe permettant la gestion monkey des codes tiers
+ *	Classe permettant la gestion monkey des codes tiers
  */
 class mod_codeclient_monkey extends ModeleThirdPartyCode
 {
 	var $nom='Monkey';					// Nom du modele
+	var $name='Monkey';					// Nom du modele
 	var $code_modifiable;				// Code modifiable
 	var $code_modifiable_invalide;		// Code modifiable si il est invalide
 	var $code_modifiable_null;			// Code modifiables si il est null
@@ -52,6 +52,7 @@ class mod_codeclient_monkey extends ModeleThirdPartyCode
 	function __construct()
 	{
 		$this->nom = "Monkey";
+		$this->name = "Monkey";
 		$this->version = "dolibarr";
 		$this->code_null = 1;
 		$this->code_modifiable = 1;
diff --git a/htdocs/core/modules/societe/mod_codecompta_aquarium.php b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
index 57d8f0c20a6f7bb3b5751b76b0edcc7c9cd82eb6..1efc062ab2cc3c20e99a1038ae5055d240af0e8d 100644
--- a/htdocs/core/modules/societe/mod_codecompta_aquarium.php
+++ b/htdocs/core/modules/societe/mod_codecompta_aquarium.php
@@ -32,7 +32,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'
 class mod_codecompta_aquarium extends ModeleAccountancyCode
 {
 	var $nom='Aquarium';
-    var $version='dolibarr';        // 'development', 'experimental', 'dolibarr'
+	var $name='Aquarium';
+	var $version='dolibarr';        // 'development', 'experimental', 'dolibarr'
 
 	var	$prefixcustomeraccountancycode;
 	var	$prefixsupplieraccountancycode;
@@ -73,7 +74,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
 		$texte.= '<table class="nobordernopadding" width="100%">';
 		$s1= $form->textwithpicto('<input type="text" class="flat" size="4" name="value1" value="'.$conf->global->COMPANY_AQUARIUM_MASK_SUPPLIER.'">',$tooltip,1,1);
 		$s2= $form->textwithpicto('<input type="text" class="flat" size="4" name="value2" value="'.$conf->global->COMPANY_AQUARIUM_MASK_CUSTOMER.'">',$tooltip,1,1);
-		$texte.= '<tr><td>'.$langs->trans("ModuleCompanyCode".$this->nom,$s1,$s2)."<br>\n";
+		$texte.= '<tr><td>'.$langs->trans("ModuleCompanyCode".$this->name,$s1,$s2)."<br>\n";
 		$texte.= '</td>';
 		$texte.= '<td align="left">&nbsp; <input type="submit" class="button" value="'.$langs->trans("Modify").'" name="Button"></td>';
         $texte.= '</tr></table>';
@@ -109,7 +110,7 @@ class mod_codecompta_aquarium extends ModeleAccountancyCode
 		$i = 0;
 		$this->db = $db;
 
-		dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".(! empty($societe->nom)?$societe->nom:''));
+		dol_syslog("mod_codecompta_aquarium::get_code search code for type=".$type." company=".(! empty($societe->name)?$societe->name:''));
 
 		// Regle gestion compte compta
 		$codetouse='';
diff --git a/htdocs/core/modules/societe/mod_codecompta_panicum.php b/htdocs/core/modules/societe/mod_codecompta_panicum.php
index b2240f7a9fc0a0cf43c188ccd9b0e39ff48222e5..15099eb0538f742da96ac6f97c39d5d607ea8817 100644
--- a/htdocs/core/modules/societe/mod_codecompta_panicum.php
+++ b/htdocs/core/modules/societe/mod_codecompta_panicum.php
@@ -26,13 +26,13 @@ require_once DOL_DOCUMENT_ROOT.'/core/modules/societe/modules_societe.class.php'
 
 
 /**
- *      \class 		mod_codecompta_panicum
- *		\brief 		Class to manage accountancy code of thirdparties with Panicum rules
+ *		Class to manage accountancy code of thirdparties with Panicum rules
  */
 class mod_codecompta_panicum extends ModeleAccountancyCode
 {
 	var $nom='Panicum';
-    var $version='dolibarr';        // 'development', 'experimental', 'dolibarr'
+	var $name='Panicum';
+	var $version='dolibarr';        // 'development', 'experimental', 'dolibarr'
 
 
 	/**
@@ -51,7 +51,7 @@ class mod_codecompta_panicum extends ModeleAccountancyCode
 	 */
 	function info($langs)
 	{
-		return $langs->trans("ModuleCompanyCode".$this->nom);
+		return $langs->trans("ModuleCompanyCode".$this->name);
 	}
 
 	/**
diff --git a/htdocs/core/modules/societe/modules_societe.class.php b/htdocs/core/modules/societe/modules_societe.class.php
index 9a117ac8435f5aace0797e369810b402fea404bb..f1fc05d29db45a5bf29ae95b2f7a5d0ade1265cc 100644
--- a/htdocs/core/modules/societe/modules_societe.class.php
+++ b/htdocs/core/modules/societe/modules_societe.class.php
@@ -184,7 +184,7 @@ abstract class ModeleThirdPartyCode
         $langs->load("admin");
 
         $s='';
-        if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->nom.'</b><br>';
+        if ($type == -1) $s.=$langs->trans("Name").': <b>'.$this->getNom($langs).'</b><br>';
         if ($type == -1) $s.=$langs->trans("Version").': <b>'.$this->getVersion().'</b><br>';
         if ($type == 0)  $s.=$langs->trans("CustomerCodeDesc").'<br>';
         if ($type == 1)  $s.=$langs->trans("SupplierCodeDesc").'<br>';
diff --git a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
index 54ae66186df82353e8a4473e4602015ca0a89ed8..5865d431132346c4b4af8e151d99ce9693389f1c 100644
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -1015,12 +1015,12 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
 			{
 				// On peut utiliser le nom de la societe du contact
 				if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
-				else $socname = $mysoc->nom;
+				else $socname = $mysoc->name;
 				$carac_client_name=$outputlangs->convToOutputCharset($socname);
 			}
 			else
 			{
-				$carac_client_name=$outputlangs->convToOutputCharset($mysoc->nom);
+				$carac_client_name=$outputlangs->convToOutputCharset($mysoc->name);
 			}
 
 			$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target');
diff --git a/htdocs/core/triggers/interface_20_all_Logevents.class.php b/htdocs/core/triggers/interface_20_all_Logevents.class.php
index 0770af5452054b45ae00324b317c62a58d45bf06..1b094790195701dbb2884dfdd8000f4177dda7df 100644
--- a/htdocs/core/triggers/interface_20_all_Logevents.class.php
+++ b/htdocs/core/triggers/interface_20_all_Logevents.class.php
@@ -140,24 +140,24 @@ class InterfaceLogevents extends DolibarrTriggers
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
-            $text=$langs->transnoentities("NewGroupCreated",$object->nom);
-            $desc=$langs->transnoentities("NewGroupCreated",$object->nom);
+            $text=$langs->transnoentities("NewGroupCreated",$object->name);
+            $desc=$langs->transnoentities("NewGroupCreated",$object->name);
 		}
         elseif ($action == 'GROUP_MODIFY')
         {
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
-            $text=$langs->transnoentities("GroupModified",$object->nom);
-            $desc=$langs->transnoentities("GroupModified",$object->nom);
+            $text=$langs->transnoentities("GroupModified",$object->name);
+            $desc=$langs->transnoentities("GroupModified",$object->name);
 		}
         elseif ($action == 'GROUP_DELETE')
         {
             dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
             $langs->load("users");
             // Initialisation donnees (date,duree,texte,desc)
-            $text=$langs->transnoentities("GroupDeleted",$object->nom);
-            $desc=$langs->transnoentities("GroupDeleted",$object->nom);
+            $text=$langs->transnoentities("GroupDeleted",$object->name);
+            $desc=$langs->transnoentities("GroupDeleted",$object->name);
 		}
 
 		// If not found
diff --git a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
index 4d2888d8aff5fb102767458cc321c113fcd83db0..43ea3357a7daee54308e8629df22fcbaf14fef1c 100644
--- a/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
+++ b/htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
@@ -79,8 +79,8 @@ class InterfaceActionsAuto extends DolibarrTriggers
             $langs->load("other");
 
 			$object->actiontypecode='AC_OTH_AUTO';
-            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
-            $object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->nom);
+            if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
+            $object->actionmsg=$langs->transnoentities("NewCompanyToDolibarr",$object->name);
             if (! empty($object->prefix)) $object->actionmsg.=" (".$object->prefix.")";
             $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
 
diff --git a/htdocs/ecm/docother.php b/htdocs/ecm/docother.php
index f219e352c64e2780a306623afc0e80a9af6e502f..d1fda6b793a7c8753405689dfb39fdd5e3ca1e2b 100644
--- a/htdocs/ecm/docother.php
+++ b/htdocs/ecm/docother.php
@@ -104,8 +104,6 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
 //$head = societe_prepare_head($societe);
 
 
-//dol_fiche_head($head, 'document', $societe->nom);
-
 
 /*
  * Confirmation de la suppression d'une ligne produit
@@ -113,7 +111,7 @@ print_fiche_titre($langs->trans("ECMAutoOrg"));
 if ($_GET['action'] == 'delete_file')
 {
 	print $form->formconfirm($_SERVER["PHP_SELF"].'?socid='.$socid.'&amp;urlfile='.urldecode($_GET["urlfile"]), $langs->trans('DeleteFile'), $langs->trans('ConfirmDeleteFile'), 'confirm_deletefile');
-	
+
 }
 
 // Construit liste des fichiers
diff --git a/htdocs/expedition/index.php b/htdocs/expedition/index.php
index 188127f0304b224dbb736f1f02bb0ea69174464d..e3cb8305562f49ccdf3bd7ae0ffe0b50ee8d97ac 100644
--- a/htdocs/expedition/index.php
+++ b/htdocs/expedition/index.php
@@ -44,8 +44,6 @@ llxHeader('',$langs->trans("Shipment"),$helpurl);
 print_fiche_titre($langs->trans("SendingsArea"));
 
 
-//print '<table class="notopnoleftnoright" width="100%">';
-//print '<tr><td valign="top" width="30%" class="notopnoleft">';
 print '<div class="fichecenter"><div class="fichethirdleft">';
 
 
@@ -64,7 +62,7 @@ print "</form></table><br>\n";
 $clause = " WHERE ";
 
 $sql = "SELECT e.rowid, e.ref";
-$sql.= ", s.nom, s.rowid as socid";
+$sql.= ", s.nom as name, s.rowid as socid";
 $sql.= ", c.ref as commande_ref, c.rowid as commande_id";
 $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping'";
@@ -101,7 +99,7 @@ if ($resql)
 			print $shipment->getNomUrl(1);
 			print "</td>";
 			print '<td>';
-			print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->nom.'</a>';
+			print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.$obj->name.'</a>';
 			print '</td>';
 			print '<td>';
 			if ($obj->commande_id) print '<a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$obj->commande_id.'">'.$obj->commande_ref.'</a>';
@@ -116,7 +114,7 @@ if ($resql)
 /*
  * Commandes a traiter
  */
-$sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
+$sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -151,7 +149,7 @@ if ($resql)
 			print $orderstatic->getNomUrl(1);
 			print '</td>';
 			print '<td>';
-			$companystatic->nom=$obj->nom;
+			$companystatic->name=$obj->name;
 			$companystatic->id=$obj->socid;
 			print $companystatic->getNomUrl(1,'customer',32);
 			print '</td></tr>';
@@ -169,7 +167,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
 /*
  * Commandes en traitement
  */
-$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.facture as billed, s.nom, s.rowid as socid";
+$sql = "SELECT c.rowid, c.ref, c.fk_statut as status, c.facture as billed, s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."commande as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -202,7 +200,7 @@ if ( $resql )
 			print $orderstatic->getNomUrl(1);
 			print '</td>';
 			print '<td>';
-			$companystatic->nom=$obj->nom;
+			$companystatic->name=$obj->name;
 			$companystatic->id=$obj->socid;
 			print $companystatic->getNomUrl(1,'customer');
 			print '</td>';
@@ -224,7 +222,7 @@ else dol_print_error($db);
  * Last shipments
  */
 $sql = "SELECT e.rowid, e.ref";
-$sql.= ", s.nom, s.rowid as socid";
+$sql.= ", s.nom as name, s.rowid as socid";
 $sql.= ", c.ref as commande_ref, c.rowid as commande_id";
 $sql.= " FROM ".MAIN_DB_PREFIX."expedition as e";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."element_element as el ON e.rowid = el.fk_target AND el.targettype = 'shipping' AND el.sourcetype IN ('commande')";
@@ -255,7 +253,7 @@ if ($resql)
 			$obj = $db->fetch_object($resql);
 			print '<tr '.$bc[$var].'><td width="20%"><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowSending"),"sending").' ';
 			print $obj->ref.'</a></td>';
-			print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+			print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
 			print '<td>';
 			if ($obj->commande_id)
 			{
@@ -274,7 +272,6 @@ if ($resql)
 else dol_print_error($db);
 
 
-//print '</td></tr></table>';
 print '</div></div></div>';
 
 
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 4e1adf7221e3ff1c5e2f68f4362df47f4980b607..4cd622495450167f0aa01b253a205ec78e356961 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -125,7 +125,7 @@ if ($resql)
 	}
 	print_liste_field_titre($langs->trans("Status"),"ship2bill.php","e.fk_statut","",$param,'align="right"',$sortfield,$sortorder);
 	print "</tr>\n";
-	
+
 	// Lignes des champs de filtre
 	print '<tr class="liste_titre">';
 	print '<td class="liste_titre">';
@@ -151,9 +151,9 @@ if ($resql)
 	print '<td class="liste_titre" align="center">';
 	print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
 	print '</td>';
-	
+
 	print "</tr>\n";
-	
+
 	$var=True;
 
 	while ($i < min($num,$limit))
@@ -171,7 +171,7 @@ if ($resql)
 		print '<td>';
 		$companystatic->id=$objp->socid;
 		$companystatic->ref=$objp->socname;
-		$companystatic->nom=$objp->socname;
+		$companystatic->name=$objp->socname;
 		print $companystatic->getNomUrl(1);
 		print '</td>';
 		// Date delivery  planed
diff --git a/htdocs/fichinter/apercu.php b/htdocs/fichinter/apercu.php
index 70d2745ab4cad14fad06510dec684d46764f28f6..4edd52809df7e67a15b6537aa0576f20014badc5 100644
--- a/htdocs/fichinter/apercu.php
+++ b/htdocs/fichinter/apercu.php
@@ -139,7 +139,7 @@ if ($id > 0 || ! empty($ref))
 		// Client
 		print "<tr><td>".$langs->trans("Customer")."</td>";
 		print '<td colspan="2">';
-		print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->nom.'</a>';
+		print '<a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->name.'</a>';
 		print '</td>';
 		print '</tr>';
 
diff --git a/htdocs/fichinter/list.php b/htdocs/fichinter/list.php
index 4dfb8489c9c4c62042008ccd1e0de87615181c20..b3858c5f4aa8969aa581214d5c14167d70356610 100644
--- a/htdocs/fichinter/list.php
+++ b/htdocs/fichinter/list.php
@@ -71,7 +71,7 @@ llxHeader('', $langs->trans("Intervention"));
 $sql = "SELECT";
 $sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,";
 $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
-$sql.= " s.nom, s.rowid as socid, s.client";
+$sql.= " s.nom as name, s.rowid as socid, s.client";
 $sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
 if (! $user->rights->societe->client->voir && empty($socid))
 	$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -160,7 +160,7 @@ if ($result)
 		print $interventionstatic->getNomUrl(1);
 		print "</td>\n";
 		print '<td>';
-		$companystatic->nom=$objp->nom;
+		$companystatic->name=$objp->name;
 		$companystatic->id=$objp->socid;
 		$companystatic->client=$objp->client;
 		print $companystatic->getNomUrl(1,'',44);
diff --git a/htdocs/fourn/ajax/getSupplierPrices.php b/htdocs/fourn/ajax/getSupplierPrices.php
index fc891af53a305c7022e33b273a18ed4637ae3c07..a6695dc694df84ed4efd3df97bd1ade173df57f2 100644
--- a/htdocs/fourn/ajax/getSupplierPrices.php
+++ b/htdocs/fourn/ajax/getSupplierPrices.php
@@ -13,7 +13,6 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
  */
 
 /**
@@ -49,7 +48,7 @@ if (! empty($idprod))
 	$sql = "SELECT p.rowid, p.label, p.ref, p.price, p.duration,";
 	$sql.= " pfp.ref_fourn,";
 	$sql.= " pfp.rowid as idprodfournprice, pfp.price as fprice, pfp.remise_percent, pfp.quantity, pfp.unitprice, pfp.charges, pfp.unitcharges,";
-	$sql.= " s.nom";
+	$sql.= " s.nom as name";
 	$sql.= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price as pfp";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON p.rowid = pfp.fk_product";
 	$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON s.rowid = pfp.fk_soc";
@@ -75,7 +74,7 @@ if (! empty($idprod))
 				$price = $objp->fprice * (1 - $objp->remise_percent / 100);
 				$unitprice = $objp->unitprice * (1 - $objp->remise_percent / 100);
 
-				$title = $objp->nom.' - '.$objp->ref_fourn.' - ';
+				$title = $objp->name.' - '.$objp->ref_fourn.' - ';
 
 				if ($objp->quantity == 1)
 				{
diff --git a/htdocs/fourn/class/fournisseur.class.php b/htdocs/fourn/class/fournisseur.class.php
index 71942a27f9730597dd11acc42056318aa54bdc0f..35620bf91fbed0951523ccf0359851af7b11ea6e 100644
--- a/htdocs/fourn/class/fournisseur.class.php
+++ b/htdocs/fourn/class/fournisseur.class.php
@@ -184,7 +184,7 @@ class Fournisseur extends Societe
 
 		$arr = array();
 
-		$sql = "SELECT s.rowid, s.nom";
+		$sql = "SELECT s.rowid, s.nom as name";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 		if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 		$sql.= " WHERE s.fournisseur = 1";
@@ -196,16 +196,14 @@ class Fournisseur extends Societe
 		if ($resql)
 		{
 			while ($obj=$this->db->fetch_object($resql))
-	  {
-	  	$arr[$obj->rowid] = stripslashes($obj->nom);
-	  }
-
+			{
+				$arr[$obj->rowid] = $obj->name;
+			}
 		}
 		else
 		{
 			dol_print_error($this->db);
-			$this->error=$this->db->error();
-
+			$this->error=$this->db->lasterror();
 		}
 		return $arr;
 	}
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index fd430ba45082e821651e6a169f6f496fd73deea5..0f04ee91eaafa3f2c11ad51e16bbc776409985b2 100644
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -204,7 +204,7 @@ else
 
 if (! empty($conf->fournisseur->enabled))
 {
-    $sql = "SELECT c.rowid, c.ref, s.nom, s.rowid as socid";
+    $sql = "SELECT c.rowid, c.ref, s.nom as name, s.rowid as socid";
     $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
     $sql.= ", ".MAIN_DB_PREFIX."societe as s";
     if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -233,7 +233,7 @@ if (! empty($conf->fournisseur->enabled))
                 print "<tr ".$bc[$var].">";
                 print '<td class="nowrap">';
                 print "<a href=\"card.php?id=".$obj->rowid."\">".img_object($langs->trans("ShowOrder"),"order").' '.$obj->ref."</a></td>";
-                print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td></tr>';
+                print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td></tr>';
                 $i++;
             }
         }
@@ -300,7 +300,7 @@ print '</td><td width="70%" valign="top" class="notopnoleftnoright">';
 */
 $max=5;
 
-$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.tms, s.nom, s.rowid as socid";
+$sql = "SELECT c.rowid, c.ref, c.fk_statut, c.tms, s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -353,7 +353,7 @@ if ($resql)
 
             print '</td>';
 
-            print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->nom.'</a></td>';
+            print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.$obj->name.'</a></td>';
             print '<td>'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
             print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,5).'</td>';
             print '</tr>';
@@ -369,7 +369,7 @@ else dol_print_error($db);
  * Orders to process
 */
 /*
- $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom, s.rowid as socid";
+ $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as name, s.rowid as socid";
 $sql.=" FROM ".MAIN_DB_PREFIX."commande_fournisseur as c";
 $sql.= ", ".MAIN_DB_PREFIX."societe as s";
 if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -421,7 +421,7 @@ print '</td></tr></table>';
 
 print '</td>';
 
-print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->nom,24).'</a></td>';
+print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($obj->name,24).'</a></td>';
 
 print '<td align="right">'.$commandestatic->LibStatut($obj->fk_statut,$obj->facture,5).'</td>';
 
diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php
index 37f2384b4b1eefbf64be53d3a246658ba31aacee..a2aa48351b0526ce15341780d86d2790de6737cc 100644
--- a/htdocs/fourn/commande/list.php
+++ b/htdocs/fourn/commande/list.php
@@ -66,7 +66,7 @@ if ($socid > 0)
 {
 	$fourn = new Fournisseur($db);
 	$fourn->fetch($socid);
-	$title .= ' ('.$fourn->nom.')';
+	$title .= ' ('.$fourn->name.')';
 }
 
 llxHeader('',$title);
@@ -85,7 +85,7 @@ $offset = $conf->liste_limit * $page ;
  * Mode Liste
  */
 
-$sql = "SELECT s.rowid as socid, s.nom, cf.date_commande as dc,";
+$sql = "SELECT s.rowid as socid, s.nom as name, cf.date_commande as dc,";
 $sql.= " cf.rowid,cf.ref, cf.ref_supplier, cf.fk_statut, cf.total_ttc, cf.fk_user_author,cf.date_livraison,";
 $sql.= " u.login";
 $sql.= " FROM (".MAIN_DB_PREFIX."societe as s,";
@@ -216,7 +216,7 @@ if ($resql)
 
 		// Company
 		print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' ';
-		print $obj->nom.'</a></td>'."\n";
+		print $obj->name.'</a></td>'."\n";
 
 		// Author
 		$userstatic->id=$obj->fk_user_author;
diff --git a/htdocs/fourn/facture/impayees.php b/htdocs/fourn/facture/impayees.php
index 4b2c61c02a57d468d5acd4295d1fc36f28c49596..a80cb00f2d33d071dedeb3a12656afb79e8f6e34 100644
--- a/htdocs/fourn/facture/impayees.php
+++ b/htdocs/fourn/facture/impayees.php
@@ -88,7 +88,7 @@ if (! $sortorder) $sortorder="ASC";
 
 if ($user->rights->fournisseur->facture->lire)
 {
-	$sql = "SELECT s.rowid as socid, s.nom,";
+	$sql = "SELECT s.rowid as socid, s.nom as name,";
 	$sql.= " f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc,";
 	$sql.= " f.datef as df, f.date_lim_reglement as datelimite, ";
 	$sql.= " f.paye as paye, f.rowid as facid, f.fk_statut";
@@ -144,7 +144,7 @@ if ($user->rights->fournisseur->facture->lire)
 		$sql .= " AND f.ref_supplier LIKE '%".GETPOST('sf_re')."%'";
 	}
 
-	$sql.= " GROUP BY s.rowid, s.nom, f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.fk_statut, s.rowid, s.nom";
+	$sql.= " GROUP BY s.rowid, s.nom, f.rowid, f.ref, f.ref_supplier, f.total_ht, f.total_ttc, f.datef, f.date_lim_reglement, f.paye, f.fk_statut";
 	if (! $user->rights->societe->client->voir && ! $socid) $sql .= ", sc.fk_soc, sc.fk_user ";
 	$sql.=$db->order($sortfield,$sortorder);
 	if (! in_array("f.ref_supplier",explode(',',$sortfield))) $sql.= ", f.ref_supplier DESC";
@@ -173,7 +173,7 @@ if ($user->rights->fournisseur->facture->lire)
 		if (! empty($late)) $param.='&late='.urlencode($late);
 		$urlsource=str_replace('&amp;','&',$param);
 
-		$titre=($socid?$langs->trans("BillsSuppliersUnpaidForCompany",$soc->nom):$langs->trans("BillsSuppliersUnpaid"));
+		$titre=($socid?$langs->trans("BillsSuppliersUnpaidForCompany",$soc->name):$langs->trans("BillsSuppliersUnpaid"));
 
 		if ($option == 'late') $titre.=' ('.$langs->trans("Late").')';
 	    else $titre.=' ('.$langs->trans("All").')';
@@ -250,7 +250,7 @@ if ($user->rights->fournisseur->facture->lire)
 
 				print '<td>';
 				$companystatic->id=$objp->socid;
-				$companystatic->nom=$objp->nom;
+				$companystatic->name=$objp->name;
 				print $companystatic->getNomUrl(1,'supplier',32);
 				print '</td>';
 
diff --git a/htdocs/fourn/facture/list.php b/htdocs/fourn/facture/list.php
index 673ac3fea6f33f6777e5aac46950f054176a2c93..e490c727a30d04ec7f8df03cf0dafb6a04f135c8 100644
--- a/htdocs/fourn/facture/list.php
+++ b/htdocs/fourn/facture/list.php
@@ -106,7 +106,7 @@ $formfile = new FormFile($db);
 
 llxHeader('',$langs->trans("SuppliersInvoices"),'EN:Suppliers_Invoices|FR:FactureFournisseur|ES:Facturas_de_proveedores');
 
-$sql = "SELECT s.rowid as socid, s.nom, ";
+$sql = "SELECT s.rowid as socid, s.nom as name, ";
 $sql.= " fac.rowid as facid, fac.ref, fac.ref_supplier, fac.datef, fac.date_lim_reglement as date_echeance,";
 $sql.= " fac.total_ht, fac.total_ttc, fac.paye as paye, fac.fk_statut as fk_statut, fac.libelle";
 if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
@@ -202,7 +202,7 @@ if ($resql)
 	if (GETPOST("search_montant_ttc"))  $param.='&search_montant_ttc='.urlencode(GETPOST("search_montant_ttc"));
 	if (GETPOST("filtre") && GETPOST('filtre') != -1) $param.='&filtre='.urlencode(GETPOST("filtre"));
 
-	print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->nom":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
+	print_barre_liste($langs->trans("BillsSuppliers").($socid?" $soc->name.":""),$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords);
 	print '<form method="GET" action="'.$_SERVER["PHP_SELF"].'">';
 	print '<table class="liste" width="100%">';
 	print '<tr class="liste_titre">';
@@ -279,7 +279,7 @@ if ($resql)
 		print '<td>'.dol_trunc($obj->libelle,36).'</td>';
 		print '<td>';
 		$supplierstatic->id=$obj->socid;
-		$supplierstatic->nom=$obj->nom;
+		$supplierstatic->name=$obj->name;
 		print $supplierstatic->getNomUrl(1,'',12);
 		print '<td align="right">'.price($obj->total_ht).'</td>';
 		print '<td align="right">'.price($obj->total_ttc).'</td>';
diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php
index 302570330b73ca88ca24e3095f66b6617df99890..831749b19043f89986bd3b3970c6674120959fca 100644
--- a/htdocs/fourn/facture/paiement.php
+++ b/htdocs/fourn/facture/paiement.php
@@ -249,7 +249,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
     $datefacture=dol_mktime(12, 0, 0, GETPOST('remonth'), GETPOST('reday'), GETPOST('reyear'));
     $dateinvoice=($datefacture==''?(empty($conf->global->MAIN_AUTOFILL_DATE)?-1:''):$datefacture);
 
-    $sql = 'SELECT s.nom, s.rowid as socid,';
+    $sql = 'SELECT s.nom as name, s.rowid as socid,';
     $sql.= ' f.rowid, f.ref, f.ref_supplier, f.amount, f.total_ttc as total';
     if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
     $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'facture_fourn as f';
@@ -274,14 +274,14 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
             print '<input type="hidden" name="facid" value="'.$facid.'">';
             print '<input type="hidden" name="ref_supplier" value="'.$obj->ref_supplier.'">';
             print '<input type="hidden" name="socid" value="'.$obj->socid.'">';
-            print '<input type="hidden" name="societe" value="'.$obj->nom.'">';
+            print '<input type="hidden" name="societe" value="'.$obj->name.'">';
 
             print '<table class="border" width="100%">';
 
             print '<tr class="liste_titre"><td colspan="3">'.$langs->trans('Payment').'</td>';
             print '<tr><td>'.$langs->trans('Company').'</td><td colspan="2">';
             $supplierstatic->id=$obj->socid;
-            $supplierstatic->name=$obj->nom;
+            $supplierstatic->name=$obj->name;
             print $supplierstatic->getNomUrl(1,'supplier');
             print '</td></tr>';
             print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td>';
@@ -460,7 +460,7 @@ if (empty($action))
     $search_company=GETPOST('search_company');
 
     $sql = 'SELECT p.rowid as pid, p.datep as dp, p.amount as pamount, p.num_paiement,';
-    $sql.= ' s.rowid as socid, s.nom,';
+    $sql.= ' s.rowid as socid, s.nom as name,';
     $sql.= ' c.libelle as paiement_type,';
     $sql.= ' ba.rowid as bid, ba.label,';
     if (!$user->rights->societe->client->voir) $sql .= ' sc.fk_soc, sc.fk_user,';
@@ -565,7 +565,7 @@ if (empty($action))
             print '<td class="nowrap" align="center">'.dol_print_date($db->jdate($objp->dp),'day')."</td>\n";
 
             print '<td>';
-            if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->nom,32).'</a>';
+            if ($objp->socid) print '<a href="'.DOL_URL_ROOT.'/societe/soc.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.dol_trunc($objp->name,32).'</a>';
             else print '&nbsp;';
             print '</td>';
 
diff --git a/htdocs/fourn/index.php b/htdocs/fourn/index.php
index f0f825d3ff74c4239db0141279e207722fda64ee..9da282817795d845edc968a2f9497e4fc694a90e 100644
--- a/htdocs/fourn/index.php
+++ b/htdocs/fourn/index.php
@@ -106,8 +106,8 @@ if (! empty($conf->fournisseur->enabled))
 {
 	$langs->load("orders");
 
-	$sql = "SELECT cf.rowid, cf.ref, cf.total_ttc";
-	$sql.= ", s.nom, s.rowid as socid";
+	$sql = "SELECT cf.rowid, cf.ref, cf.total_ttc,";
+	$sql.= " s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
@@ -141,7 +141,7 @@ if (! empty($conf->fournisseur->enabled))
 				print '</td>';
 				print '<td  class="nowrap">';
 				$companystatic->id=$obj->socid;
-				$companystatic->nom=$obj->nom;
+				$companystatic->name=$obj->name;
 				$companystatic->client=0;
 				print $companystatic->getNomUrl(1,'',16);
 				print '</td>';
@@ -164,7 +164,7 @@ if (! empty($conf->fournisseur->enabled))
 if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture->lire)
 {
 	$sql = "SELECT ff.ref_supplier, ff.rowid, ff.total_ttc, ff.type";
-	$sql.= ", s.nom, s.rowid as socid";
+	$sql.= ", s.nom as name, s.rowid as socid";
 	$sql.= " FROM ".MAIN_DB_PREFIX."facture_fourn as ff";
 	$sql.= ", ".MAIN_DB_PREFIX."societe as s";
 	if (!$user->rights->societe->client->voir && !$socid) $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
@@ -199,7 +199,7 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->facture-
 				print '</td>';
 				print '<td class="nowrap">';
 				$companystatic->id=$obj->socid;
-				$companystatic->nom=$obj->nom;
+				$companystatic->name=$obj->name;
 				$companystatic->client=0;
 				print $companystatic->getNomUrl(1,'',16);
 				print '</td>';
@@ -233,7 +233,7 @@ print '</div><div class="fichetwothirdright"><div class="ficheaddleft">';
  * List last modified supliers
  */
 $max=10;
-$sql = "SELECT s.rowid as socid, s.nom, s.town, s.datec, s.tms, s.prefix_comm, s.code_fournisseur, s.code_compta_fournisseur";
+$sql = "SELECT s.rowid as socid, s.nom as name, s.town, s.datec, s.tms, s.prefix_comm, s.code_fournisseur, s.code_compta_fournisseur";
 $sql.= ", st.libelle as stcomm";
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 $sql.= ", ".MAIN_DB_PREFIX."c_stcomm as st";
@@ -267,7 +267,7 @@ if ($resql)
 
 		print "<tr ".$bc[$var].">";
 		print '<td><a href="card.php?socid='.$obj->socid.'">'.img_object($langs->trans("ShowSupplier"),"company").'</a>';
-		print "&nbsp;<a href=\"card.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n";
+		print "&nbsp;<a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n";
 		print '<td align="left">'.$obj->code_fournisseur.'&nbsp;</td>';
 		print '<td align="right">'.dol_print_date($db->jdate($obj->tms),'day').'</td>';
 		print "</tr>\n";
diff --git a/htdocs/fourn/list.php b/htdocs/fourn/list.php
index e3c7effebbfaf8eeefdb712406e0fd929fbece9f..d3f7e55c19976e1723970ceb87cc2fb0b9144e8e 100644
--- a/htdocs/fourn/list.php
+++ b/htdocs/fourn/list.php
@@ -79,7 +79,7 @@ $thirdpartystatic=new Societe($db);
 $help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
 llxHeader('',$langs->trans("ThirdParty"),$help_url);
 
-$sql = "SELECT s.rowid as socid, s.nom, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
+$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
 $sql.= "code_fournisseur, code_compta_fournisseur";
 if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
 $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -199,7 +199,7 @@ if ($resql)
 		$var=!$var;
 
         $thirdpartystatic->id=$obj->socid;
-        $thirdpartystatic->nom=$obj->nom;
+        $thirdpartystatic->name=$obj->name;
         $thirdpartystatic->status=$obj->status;
 
 		print "<tr ".$bc[$var].">";
diff --git a/htdocs/fourn/paiement/card.php b/htdocs/fourn/paiement/card.php
index 684985ed26105e210566732ab4bad6d2b48e21ab..824919400a21f513b2a0db426d37801c36a82908 100644
--- a/htdocs/fourn/paiement/card.php
+++ b/htdocs/fourn/paiement/card.php
@@ -234,7 +234,7 @@ if ($result > 0)
 	 *	Liste des factures
 	 */
 	$allow_delete = 1 ;
-	$sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom, s.rowid as socid';
+	$sql = 'SELECT f.rowid, f.ref, f.ref_supplier, f.total_ttc, pf.amount, f.rowid as facid, f.paye, f.fk_statut, s.nom as name, s.rowid as socid';
 	$sql .= ' FROM '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf,'.MAIN_DB_PREFIX.'facture_fourn as f,'.MAIN_DB_PREFIX.'societe as s';
 	$sql .= ' WHERE pf.fk_facturefourn = f.rowid AND f.fk_soc = s.rowid';
 	$sql .= ' AND pf.fk_paiementfourn = '.$object->id;
@@ -274,7 +274,7 @@ if ($result > 0)
 				// Ref supplier
 				print '<td>'.$objp->ref_supplier."</td>\n";
 				// Third party
-				print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->nom.'</a></td>';
+				print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans('ShowCompany'),'company').' '.$objp->name.'</a></td>';
 				// Expected to pay
 				print '<td align="right">'.price($objp->total_ttc).'</td>';
 				// Status
diff --git a/htdocs/fourn/product/list.php b/htdocs/fourn/product/list.php
index 89c3928f13470aef36d77b819af5a786eb0d0b56..a7ab0d0576fed3f7c1ca7ed1c7919bf12524b1f6 100644
--- a/htdocs/fourn/product/list.php
+++ b/htdocs/fourn/product/list.php
@@ -88,7 +88,7 @@ if ($fourn_id)
 
 $sql = "SELECT p.rowid, p.label, p.ref, p.fk_product_type,";
 $sql.= " ppf.fk_soc, ppf.ref_fourn, ppf.price as price, ppf.quantity as qty, ppf.unitprice,";
-$sql.= " s.rowid as socid, s.nom";
+$sql.= " s.rowid as socid, s.nom as name";
 $sql.= " FROM ".MAIN_DB_PREFIX."product as p";
 if ($catid) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_fournisseur_price as ppf ON p.rowid = ppf.fk_product";
@@ -108,7 +108,7 @@ if ($sref)
 }
 if ($snom)
 {
-	$sql .= natural_search('p.label', $snom);
+	$sql .= natural_search('s.nom', $snom);
 }
 if($catid)
 {
@@ -136,7 +136,7 @@ if ($resql)
 		exit;
 	}
 
-	if (! empty($supplier->id)) $texte = $langs->trans("ListOfSupplierProductForSupplier",$supplier->nom);
+	if (! empty($supplier->id)) $texte = $langs->trans("ListOfSupplierProductForSupplier",$supplier->name);
 	else $texte = $langs->trans("List");
 
 	llxHeader("","",$texte);
@@ -212,7 +212,7 @@ if ($resql)
 
 		print '<td>'.$objp->label.'</td>'."\n";
 
-		$companystatic->nom=$objp->nom;
+		$companystatic->name=$objp->name;
 		$companystatic->id=$objp->socid;
 		print '<td>';
 		if ($companystatic->id > 0) print $companystatic->getNomUrl(1,'supplier');
diff --git a/htdocs/holiday/class/holiday.class.php b/htdocs/holiday/class/holiday.class.php
index 119a4980a78634c190f6195f017bf483c85f94cf..5ff23b45ec02e37d4caa9fa131f078da49fd502f 100644
--- a/htdocs/holiday/class/holiday.class.php
+++ b/htdocs/holiday/class/holiday.class.php
@@ -780,7 +780,7 @@ class Holiday extends CommonObject
         $groupe = $objet->value;
 
         // On liste les groupes de Dolibarr
-        $sql = "SELECT u.rowid, u.nom";
+        $sql = "SELECT u.rowid, u.nom as name";
         $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as u";
         $sql.= " ORDER BY u.rowid";
 
@@ -798,9 +798,9 @@ class Holiday extends CommonObject
             while ($obj = $this->db->fetch_object($result))
             {
                 if($groupe==$obj->rowid) {
-                    $selectGroup.= '<option value="'.$obj->rowid.'" selected="selected">'.$obj->nom.'</option>'."\n";
+                    $selectGroup.= '<option value="'.$obj->rowid.'" selected="selected">'.$obj->name.'</option>'."\n";
                 } else {
-                    $selectGroup.= '<option value="'.$obj->rowid.'">'.$obj->nom.'</option>'."\n";
+                    $selectGroup.= '<option value="'.$obj->rowid.'">'.$obj->name.'</option>'."\n";
                 }
             }
             $selectGroup.= '</select>'."\n";
@@ -820,7 +820,7 @@ class Holiday extends CommonObject
     /**
      *  Met à jour une option du module Holiday Payés
      *
-     *  @param	string	$name       nom du paramètre de configuration
+     *  @param	string	$name       name du paramètre de configuration
      *  @param	string	$value      vrai si mise à jour OK sinon faux
      *  @return boolean				ok or ko
      */
@@ -842,7 +842,7 @@ class Holiday extends CommonObject
     /**
      *  Retourne la valeur d'un paramètre de configuration
      *
-     *  @param	string	$name       nom du paramètre de configuration
+     *  @param	string	$name       name du paramètre de configuration
      *  @return string      		retourne la valeur du paramètre
      */
     function getConfCP($name)
@@ -955,7 +955,7 @@ class Holiday extends CommonObject
     /**
      *	Retourne un checked si vrai
      *
-     *  @param	string	$name       nom du paramètre de configuration
+     *  @param	string	$name       name du paramètre de configuration
      *  @return string      		retourne checked si > 0
      */
     function getCheckOption($name) {
diff --git a/htdocs/livraison/card.php b/htdocs/livraison/card.php
index 7f9c4130284affbaf18592cd49cc4bb97156700a..772ab34c291a67f0bc570e21da706b98d8571626 100644
--- a/htdocs/livraison/card.php
+++ b/htdocs/livraison/card.php
@@ -268,7 +268,7 @@ if ($action == 'create')
 		}
 		print '<table class="border" width="100%">';
 		print '<tr><td width="20%">'.$langs->trans("Customer").'</td>';
-		print '<td width="30%"><b><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->nom.'</a></b></td>';
+		print '<td width="30%"><b><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$soc->id.'">'.$soc->name.'</a></b></td>';
 
 		print '<td width="50%" colspan="2">';
 
diff --git a/htdocs/margin/agentMargins.php b/htdocs/margin/agentMargins.php
index df43f39ff2e8ccf4da8dbbc1f248637c5eaffd79..3dd0fcd0b49d3ed982b988237cdb01726a27f143 100644
--- a/htdocs/margin/agentMargins.php
+++ b/htdocs/margin/agentMargins.php
@@ -106,7 +106,7 @@ print "</table>";
 print '</form>';
 
 $sql = "SELECT";
-if ($agentid > 0) $sql.= " s.rowid as socid, s.nom, s.code_client, s.client,";
+if ($agentid > 0) $sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
 $sql.= " u.rowid as agent, u.login, u.lastname, u.firstname,";
 $sql.= " sum(d.total_ht) as selling_price,";
 $sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
@@ -201,7 +201,7 @@ if ($result)
 			print "<tr ".$bc[$var].">";
 			if ($agentid > 0) {
 				$companystatic->id=$objp->socid;
-				$companystatic->nom=$objp->nom;
+				$companystatic->name=$objp->name;
 				$companystatic->client=$objp->client;
 				print "<td>".$companystatic->getNomUrl(1,'customer')."</td>\n";
 			}
diff --git a/htdocs/margin/customerMargins.php b/htdocs/margin/customerMargins.php
index c0f7e41b97e6afbc21cc565483e86ac2976f2a87..fbc947a7cc9d093bdc2fc0af7ccc0a45e4ef2636 100644
--- a/htdocs/margin/customerMargins.php
+++ b/htdocs/margin/customerMargins.php
@@ -161,7 +161,7 @@ print "</table>";
 print '</form>';
 
 $sql = "SELECT";
-$sql.= " s.rowid as socid, s.nom, s.code_client, s.client,";
+$sql.= " s.rowid as socid, s.nom as name, s.code_client, s.client,";
 if ($client) $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht, f.datef, f.paye, f.fk_statut as statut,";
 $sql.= " sum(d.total_ht) as selling_price,";
 $sql.= " sum(".$db->ifsql('d.total_ht <=0','d.qty * d.buy_price_ht * -1','d.qty * d.buy_price_ht').") as buying_price,";
@@ -258,7 +258,7 @@ if ($result)
 		  	}
 		  	else {
 				$companystatic->id=$objp->socid;
-				$companystatic->nom=$objp->nom;
+				$companystatic->name=$objp->name;
 				$companystatic->client=$objp->client;
 		   		print "<td>".$companystatic->getNomUrl(1,'customer')."</td>\n";
 		  	}
diff --git a/htdocs/margin/tabs/productMargins.php b/htdocs/margin/tabs/productMargins.php
index 0e6734c0916cf11bd13e4497c64bf133c34f8186..46cf4245b60c00a4505ab14d61474b6f6a194afa 100644
--- a/htdocs/margin/tabs/productMargins.php
+++ b/htdocs/margin/tabs/productMargins.php
@@ -129,7 +129,7 @@ if ($id > 0 || ! empty($ref))
 
 
         if ($user->rights->facture->lire) {
-            $sql = "SELECT s.nom, s.rowid as socid, s.code_client,";
+            $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client,";
             $sql.= " f.rowid as facid, f.facnumber, f.total as total_ht,";
             $sql.= " f.datef, f.paye, f.fk_statut as statut,";
             if (!$user->rights->societe->client->voir && !$socid) $sql.= " sc.fk_soc, sc.fk_user,";
@@ -206,7 +206,7 @@ if ($id > 0 || ! empty($ref))
                         $invoicestatic->ref=$objp->facnumber;
                         print $invoicestatic->getNomUrl(1);
                         print "</td>\n";
-                        print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+                        print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
                         print "<td>".$objp->code_client."</td>\n";
 					print "<td align=\"center\">";
 					print dol_print_date($db->jdate($objp->datef),'day')."</td>";
diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php
index c1ceb4faa8ea89b687c697fa3b97748ad846e3e1..bcc1146c71440e9f18e18e060fc820ab43d3960a 100644
--- a/htdocs/opensurvey/class/opensurveysondage.class.php
+++ b/htdocs/opensurvey/class/opensurveysondage.class.php
@@ -392,7 +392,7 @@ class Opensurveysondage extends CommonObject
 	function fetch_lines()
 	{
 		$ret=array();
-		$sql = "SELECT id_users, nom, reponses FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
+		$sql = "SELECT id_users, nom as name, reponses FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
 		$sql.= " WHERE id_sondage = '".$this->db->escape($this->id_sondage)."'";
 		$resql=$this->db->query($sql);
 
@@ -403,7 +403,7 @@ class Opensurveysondage extends CommonObject
 			while ($i < $num)
 			{
 				$obj=$this->db->fetch_object($resql);
-				$tmp=array('id_users'=>$obj->id_users, 'nom'=>$obj->nom, 'reponses'=>$obj->reponses);
+				$tmp=array('id_users'=>$obj->id_users, 'nom'=>$obj->name, 'reponses'=>$obj->reponses);
 
 				$ret[]=$tmp;
 				$i++;
diff --git a/htdocs/opensurvey/exportcsv.php b/htdocs/opensurvey/exportcsv.php
index fec8174a7efb7c95f241804cf07a0222bdee78e0..7096ae7ad99745048d98d50678a2d7dc37849198 100644
--- a/htdocs/opensurvey/exportcsv.php
+++ b/htdocs/opensurvey/exportcsv.php
@@ -82,7 +82,7 @@ if (strpos($object->sujet,'@') !== false)
 }
 
 
-$sql ='SELECT nom, reponses';
+$sql ='SELECT nom as name, reponses';
 $sql.=' FROM '.MAIN_DB_PREFIX."opensurvey_user_studs";
 $sql.=" WHERE id_sondage='" . $db->escape($numsondage) . "'";
 $sql.=" ORDER BY id_users";
@@ -95,8 +95,8 @@ if ($resql)
 	{
 		$obj=$db->fetch_object($resql);
 
-		// Le nom de l'utilisateur
-		$nombase=str_replace("°","'",$obj->nom);
+		// Le name de l'utilisateur
+		$nombase=str_replace("°","'",$obj->name);
 		$input.=$nombase.';';
 
 		//affichage des resultats
diff --git a/htdocs/opensurvey/public/studs.php b/htdocs/opensurvey/public/studs.php
index 9b9f2e9ef8cd7ca70f5675fe5ded20700c03bdc9..1b39391b67c6a26a52352cd889c29014f8d70cc4 100644
--- a/htdocs/opensurvey/public/studs.php
+++ b/htdocs/opensurvey/public/studs.php
@@ -113,7 +113,9 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x"))		// bout
 		$nom=substr(GETPOST("nom"),0,64);
 
 		// Check if vote already exists
-		$sql = 'SELECT id_users, nom FROM '.MAIN_DB_PREFIX."opensurvey_user_studs WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users";
+		$sql = 'SELECT id_users, nom as name';
+		$sql.= ' FROM '.MAIN_DB_PREFIX."opensurvey_user_studs';
+		$sql.= ' WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."' ORDER BY id_users";
 		$resql = $db->query($sql);
 		$num_rows = $db->num_rows($resql);
 		if ($num_rows > 0)
@@ -389,7 +391,7 @@ else
 $sumfor = array();
 $sumagainst = array();
 $compteur = 0;
-$sql ="SELECT id_users, nom, id_sondage, reponses";
+$sql ="SELECT id_users, nom as name, id_sondage, reponses";
 $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
 $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'";
 $resql=$db->query($sql);
@@ -406,7 +408,7 @@ while ($compteur < $num)
 	$ensemblereponses = $obj->reponses;
 
 	// ligne d'un usager pré-authentifié
-	$mod_ok = (in_array($obj->nom, $listofvoters));
+	$mod_ok = (in_array($obj->name, $listofvoters));
 
 	if (!$mod_ok && !$object->allow_spy) {
 		$compteur++;
@@ -416,7 +418,7 @@ while ($compteur < $num)
 	print '<tr>'."\n";
 
 	// Name
-	print '<td class="nom">'.dol_htmlentities($obj->nom).'</td>'."\n";
+	print '<td class="nom">'.dol_htmlentities($obj->name).'</td>'."\n";
 
 	// si la ligne n'est pas a changer, on affiche les données
 	if (! $testligneamodifier)
diff --git a/htdocs/opensurvey/results.php b/htdocs/opensurvey/results.php
index 3bfd3209343d12209c10cc8a3032987f742c7b80..226bc0c0465c9ce315250bcfbf06ed7609c677a1 100644
--- a/htdocs/opensurvey/results.php
+++ b/htdocs/opensurvey/results.php
@@ -83,7 +83,7 @@ if (GETPOST("boutonp") || GETPOST("boutonp.x") || GETPOST("boutonp_x"))		// bout
 		$nom=substr(GETPOST("nom"),0,64);
 
 		// Check if vote already exists
-		$sql = 'SELECT id_users, nom';
+		$sql = 'SELECT id_users, nom as name';
 		$sql.= ' FROM '.MAIN_DB_PREFIX.'opensurvey_user_studs';
 		$sql.= " WHERE id_sondage='".$db->escape($numsondage)."' AND nom = '".$db->escape($nom)."'";
 		$sql.= ' ORDER BY id_users';
@@ -283,7 +283,7 @@ for ($i = 0; $i < $nblignes; $i++)
 
 		// Loop on each answer
 		$compteur = 0;
-		$sql ="SELECT id_users, nom, id_sondage, reponses";
+		$sql ="SELECT id_users, nom as name, id_sondage, reponses";
 		$sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
 		$sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'";
 		$resql=$db->query($sql);
@@ -341,7 +341,7 @@ for ($i = 0; $i < $nbcolonnes; $i++)
 
 		// Clean current answer to remove deleted columns
 		$compteur = 0;
-		$sql ="SELECT id_users, nom, id_sondage, reponses";
+		$sql ="SELECT id_users, nom as name, id_sondage, reponses";
 		$sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
 		$sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'";
 		dol_syslog('sql='.$sql);
@@ -756,7 +756,7 @@ else
 $sumfor = array();
 $sumagainst = array();
 $compteur = 0;
-$sql ="SELECT id_users, nom, id_sondage, reponses";
+$sql ="SELECT id_users, nom as name, id_sondage, reponses";
 $sql.=" FROM ".MAIN_DB_PREFIX."opensurvey_user_studs";
 $sql.=" WHERE id_sondage = '".$db->escape($numsondage)."'";
 dol_syslog('sql='.$sql);
@@ -780,7 +780,7 @@ while ($compteur < $num)
 	}
 
 	// Name
-	print '</td><td class="nom">'.dol_htmlentities($obj->nom).'</td>'."\n";
+	print '</td><td class="nom">'.dol_htmlentities($obj->name).'</td>'."\n";
 
 	// si la ligne n'est pas a changer, on affiche les données
 	if (! $testligneamodifier)
diff --git a/htdocs/paybox/lib/paybox.lib.php b/htdocs/paybox/lib/paybox.lib.php
index 09bacc3764ff62e120ce97fb81462d788c19decb..78c500c75513a761c88ca5939b2be1ed8a52fc2a 100644
--- a/htdocs/paybox/lib/paybox.lib.php
+++ b/htdocs/paybox/lib/paybox.lib.php
@@ -281,7 +281,7 @@ function html_print_paybox_footer($fromcompany,$langs)
 
 	print '<br><br><hr>'."\n";
 	print '<center><font style="font-size: 10px;">'."\n";
-	print $fromcompany->nom.'<br>';
+	print $fromcompany->name.'<br>';
 	print $line1.'<br>';
 	print $line2;
 	print '</font></center>'."\n";
diff --git a/htdocs/paypal/lib/paypal.lib.php b/htdocs/paypal/lib/paypal.lib.php
index cc678fce01175301b4d1a641d80c0d60065e273f..c1440d80245f42a617f7f21b502c2662979a15d2 100644
--- a/htdocs/paypal/lib/paypal.lib.php
+++ b/htdocs/paypal/lib/paypal.lib.php
@@ -154,7 +154,7 @@ function html_print_paypal_footer($fromcompany,$langs)
 
 	print '<br><br><hr>'."\n";
 	print '<center><font style="font-size: 10px;">'."\n";
-	print $fromcompany->nom.'<br>';
+	print $fromcompany->name.'<br>';
 	print $line1.'<br>';
 	print $line2;
 	print '</font></center>'."\n";
diff --git a/htdocs/product/admin/product.php b/htdocs/product/admin/product.php
index e79ffcf13c68ece79b1a09002d3ef6ad66593144..7ecc390516d427cd01190ca202661dd17d80a54b 100644
--- a/htdocs/product/admin/product.php
+++ b/htdocs/product/admin/product.php
@@ -48,7 +48,7 @@ $select_pricing_rules=array(
 'PRODUIT_MULTIPRICES'=>$langs->trans('MultiPricesAbility'),		// Several prices according to a customer level
 'PRODUIT_CUSTOMER_PRICES'=>$langs->trans('PriceByCustomer')		// Different price for each customer
 );
-if ($conf->global->MAIN_FEATURES_LEVEL==2) 
+if ($conf->global->MAIN_FEATURES_LEVEL==2)
 {
 	$select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY'] = $langs->trans('PriceByQuantity');
 	$select_pricing_rules['PRODUIT_CUSTOMER_PRICES_BY_QTY&PRODUIT_MULTIPRICES'] = $langs->trans('MultiPricesAbility') . '+' . $langs->trans('PriceByQuantity');
@@ -125,7 +125,7 @@ if ($action == 'pricingrule')
 			else
 			{
 				$multirule=explode('&',$princingrules);
-				foreach($multirule as $rulesselected) 
+				foreach($multirule as $rulesselected)
 				{
 					$res = dolibarr_set_const($db, $rulesselected, 1, 'chaine', 0, '', $conf->entity);
 				}
@@ -137,8 +137,8 @@ if ($action == 'pricingrule')
 				$res = dolibarr_set_const($db, $rule, 0, 'chaine', 0, '', $conf->entity);
 			}
 		}
-		
-	}	
+
+	}
 }
 else if ($action == 'sousproduits')
 {
@@ -262,7 +262,7 @@ foreach ($dirproduct as $dirroot)
 
     			$var = !$var;
     			print '<tr '.$bc[$var].'>'."\n";
-    			print '<td width="140">'.$modCodeProduct->nom.'</td>'."\n";
+    			print '<td width="140">'.$modCodeProduct->name.'</td>'."\n";
     			print '<td>'.$modCodeProduct->info($langs).'</td>'."\n";
     			print '<td class="nowrap">'.$modCodeProduct->getExample($langs).'</td>'."\n";
 
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index bf96d63459e3abf8a83d0f05a66c057e78d5b6d6..472b9ce4a4549bac4817402cb870cf55937d1a52 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -118,7 +118,7 @@ if ($id > 0 || ! empty($ref))
 		print '</div>';
 
 
-		$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,";
+		$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, c.rowid, c.total_ht as total_ht, c.ref,";
 		$sql.= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.qty";
 		if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -168,7 +168,7 @@ if ($id > 0 || ! empty($ref))
 					print '<td><a href="'.DOL_URL_ROOT.'/commande/card.php?id='.$objp->commandeid.'">'.img_object($langs->trans("ShowOrder"),"order").' ';
 					print $objp->ref;
 					print "</a></td>\n";
-					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
 					print "<td>".$objp->code_client."</td>\n";
 					print "<td align=\"center\">";
 					print dol_print_date($db->jdate($objp->date_commande))."</td>";
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 93c880695d322b488bec7226a0277ebd0737945b..73de0374ebe61c353f954bedc51e1cf0dc4d378b 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -110,7 +110,7 @@ if ($id > 0 || ! empty($ref))
 		print "</table>";
 		print '</div>';
 
-		$sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
+		$sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,";
 		$sql.= " c.rowid, c.total_ht as total_ht, c.ref,";
 		$sql.= " c.date_commande, c.fk_statut as statut, c.rowid as commandeid, d.qty";
 		if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
@@ -164,7 +164,7 @@ if ($id > 0 || ! empty($ref))
 					print "<tr ".$bc[$var].">";
 					print '<td>'.$commandestatic->getNomUrl(1)."</td>\n";
 					print "</a></td>\n";
-					print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+					print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
 					print "<td>".$objp->code_client."</td>\n";
 					print '<td align="center">'.dol_print_date($db->jdate($objp->date_commande))."</td>";
 					print "<td align=\"center\">".$objp->qty."</td>\n";
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index 6c73d0183faa837faaf3feaf1b99479734b25487..189ead2eaa2736bf8344fd367002e3a7fb616f44 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -124,7 +124,7 @@ if ($id > 0 || ! empty($ref))
 		$sql.= ' sum('.$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite <= '".$db->idate($now)."')",1,0).') as nb_late,';
 		$sql.= ' sum('.$db->ifsql("cd.statut=5",1,0).') as nb_closed,';
 		$sql.= " c.rowid as rowid, c.date_contrat, c.statut as statut,";
-		$sql.= " s.nom, s.rowid as socid, s.code_client";
+		$sql.= " s.nom as name, s.rowid as socid, s.code_client";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 		if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
 		$sql.= ", ".MAIN_DB_PREFIX."contrat as c";
@@ -174,7 +174,7 @@ if ($id > 0 || ! empty($ref))
 					print '<td><a href="'.DOL_URL_ROOT.'/contrat/card.php?id='.$objp->rowid.'">'.img_object($langs->trans("ShowContract"),"contract").' ';
 					print $objp->rowid;
 					print "</a></td>\n";
-					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
 					print "<td>".$objp->code_client."</td>\n";
 					print "<td align=\"center\">";
 					print dol_print_date($db->jdate($objp->date_contrat))."</td>";
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 1959d53035e44da0cfeb30bdac98645da2228b1a..39768262f1080d3c98dd5cf556847511ab66f2ab 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -123,7 +123,7 @@ if ($id > 0 || ! empty($ref))
 
 
         if ($user->rights->facture->lire) {
-            $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client,";
+            $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client,";
             $sql.= " f.facnumber, f.total as total_ht,";
             $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty";
             if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
@@ -171,7 +171,7 @@ if ($id > 0 || ! empty($ref))
                         $invoicestatic->ref=$objp->facnumber;
                         print $invoicestatic->getNomUrl(1);
                         print "</td>\n";
-                        print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+                        print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
                         print "<td>".$objp->code_client."</td>\n";
                         print '<td align="center">';
                         print dol_print_date($db->jdate($objp->datef),'day')."</td>";
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index 1b07ce3d1ba593d2ef984577effed79bee9d1453..d8e30bdae6ae34253bc76cfa060b2bb77a299eb4 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -122,7 +122,7 @@ if ($id > 0 || ! empty($ref))
         print '</div>';
 
 
-        $sql = "SELECT distinct s.nom, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,";
+        $sql = "SELECT distinct s.nom as name, s.rowid as socid, s.code_client, f.ref, f.total_ht as total_ht,";
         $sql.= " f.datef, f.paye, f.fk_statut as statut, f.rowid as facid, d.qty";
         if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
         $sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -172,7 +172,7 @@ if ($id > 0 || ! empty($ref))
                     $supplierinvoicestatic->ref=$objp->facnumber;
 					print $supplierinvoicestatic->getNomUrl(1);
                     print "</td>\n";
-                    print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+                    print '<td><a href="'.DOL_URL_ROOT.'/fourn/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
                     print "<td>".$objp->code_client."</td>\n";
                     print "<td align=\"center\">";
                     print dol_print_date($db->jdate($objp->datef))."</td>";
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index 3368efa2b565a852c3dc7e76d231c523491c92b6..566961d9c5f37b0329356833e6dda524542844c8 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -113,7 +113,7 @@ if ($id > 0 || ! empty($ref))
 		print '</div>';
 
 
-		$sql = "SELECT DISTINCT s.nom, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,";
+		$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, p.rowid as propalid, p.ref, p.total_ht as amount,";
 		$sql.= "p.datep, p.fk_statut as statut, d.qty";
 		if (!$user->rights->societe->client->voir && !$socid) $sql.= ", sc.fk_soc, sc.fk_user ";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@@ -161,7 +161,7 @@ if ($id > 0 || ! empty($ref))
 					print '<td><a href="'.DOL_URL_ROOT.'/comm/propal.php?id='.$objp->propalid.'">'.img_object($langs->trans("ShowPropal"),"propal").' ';
 					print $objp->ref;
 					print '</a></td>'."\n";
-					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->nom,44).'</a></td>';
+					print '<td><a href="'.DOL_URL_ROOT.'/comm/card.php?socid='.$objp->socid.'">'.img_object($langs->trans("ShowCompany"),"company").' '.dol_trunc($objp->name,44).'</a></td>';
 					print '<td align="center">';
 					print dol_print_date($db->jdate($objp->datep))."</td>";
 					print "<td align=\"center\">".$objp->qty."</td>\n";
diff --git a/htdocs/product/stock/replenishorders.php b/htdocs/product/stock/replenishorders.php
index 07aa68a7a980eabaf4d04c0d330496ea9f0db205..71fe1407a2d48297c232d7407141fb0d406616c9 100644
--- a/htdocs/product/stock/replenishorders.php
+++ b/htdocs/product/stock/replenishorders.php
@@ -77,7 +77,7 @@ if (!$sortfield) $sortfield = 'cf.date_creation';
 
 $offset = $conf->liste_limit * $page ;
 
-$sql = 'SELECT s.rowid as socid, s.nom, cf.date_creation as dc,';
+$sql = 'SELECT s.rowid as socid, s.nom as name, cf.date_creation as dc,';
 $sql.= ' cf.rowid, cf.ref, cf.fk_statut, cf.total_ttc, cf.fk_user_author,';
 $sql.= ' u.login';
 $sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s, '.MAIN_DB_PREFIX.'commande_fournisseur as cf';
@@ -273,7 +273,7 @@ if ($resql)
             print '<td>'.
                  '<a href="' . $href .'">'.
                  img_object($langs->trans('ShowCompany'), 'company'). ' '.
-                 $obj->nom . '</a></td>';
+                 $obj->name . '</a></td>';
 
             // Author
             $userstatic->id = $obj->fk_user_author;
diff --git a/htdocs/projet/admin/project.php b/htdocs/projet/admin/project.php
index bf9951129ad88224e15e10819a21ecb4f61d8183..915d4ef69ef8feb2c64464ac49268235ed212ab3 100644
--- a/htdocs/projet/admin/project.php
+++ b/htdocs/projet/admin/project.php
@@ -349,7 +349,7 @@ foreach ($dirmodels as $reldir)
 					if ($module->isEnabled())
 					{
 						$var=!$var;
-						print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
+						print '<tr '.$bc[$var].'><td>'.$module->name."</td><td>\n";
 						print $module->info();
 						print '</td>';
 
@@ -450,7 +450,7 @@ foreach ($dirmodels as $reldir)
 					if ($module->isEnabled())
 					{
 						$var=!$var;
-						print '<tr '.$bc[$var].'><td>'.$module->nom."</td><td>\n";
+						print '<tr '.$bc[$var].'><td>'.$module->name."</td><td>\n";
 						print $module->info();
 						print '</td>';
 
diff --git a/htdocs/projet/index.php b/htdocs/projet/index.php
index 7e324841af2fa41d3602111a6ff945e94e840f1f..d9fb4b4dce93660274bd86363221db737c7d5a68 100644
--- a/htdocs/projet/index.php
+++ b/htdocs/projet/index.php
@@ -103,7 +103,7 @@ print_liste_field_titre($langs->trans("NbOfProjects"),"","","","",'align="right"
 print "</tr>\n";
 
 $sql = "SELECT count(p.rowid) as nb";
-$sql.= ", s.nom, s.rowid as socid";
+$sql.= ", s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
 $sql.= " WHERE p.entity = ".$conf->entity;
@@ -127,7 +127,7 @@ if ( $resql )
 		if ($obj->socid)
 		{
 			$socstatic->id=$obj->socid;
-			$socstatic->nom=$obj->nom;
+			$socstatic->name=$obj->name;
 			print $socstatic->getNomUrl(1);
 		}
 		else
diff --git a/htdocs/projet/list.php b/htdocs/projet/list.php
index 2a427558eb43b9255c0827b6e0d0e5ccd75c26f9..b4260e8ea91a57c015edb19023fbb25daea6ab70 100644
--- a/htdocs/projet/list.php
+++ b/htdocs/projet/list.php
@@ -39,7 +39,7 @@ if ($socid > 0)
 {
 	$soc = new Societe($db);
 	$soc->fetch($socid);
-	$title .= ' (<a href="list.php">'.$soc->nom.'</a>)';
+	$title .= ' (<a href="list.php">'.$soc->name.'</a>)';
 }
 if (!$user->rights->projet->lire) accessforbidden();
 
@@ -78,7 +78,7 @@ $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user,($mine?$min
 
 $sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, p.public, p.fk_user_creat";
 $sql.= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end";
-$sql.= ", s.nom, s.rowid as socid";
+$sql.= ", s.nom as name, s.rowid as socid";
 $sql.= " FROM ".MAIN_DB_PREFIX."projet as p";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on p.fk_soc = s.rowid";
 $sql.= " WHERE p.entity = ".$conf->entity;
@@ -181,7 +181,7 @@ if ($resql)
 			if ($objp->socid)
 			{
 				$socstatic->id=$objp->socid;
-				$socstatic->nom=$objp->nom;
+				$socstatic->name=$objp->name;
 				print $socstatic->getNomUrl(1);
 			}
 			else
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index b1680d2803ec99f5cad582bd1f259f058fe69c67..f17a9d9f298d7c0790e6055ca5b55e5434c656e2 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -84,7 +84,7 @@ if ($action == 'updateoptions')
 		    setEventMessage($langs->trans("Error"), 'errors');
 		}
 	}
-	
+
 	if (GETPOST('CONTACT_USE_SEARCH_TO_SELECT'))
 	{
 		$contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT','alpha');
@@ -344,7 +344,7 @@ foreach ($dirsociete as $dirroot)
 
     			$var = !$var;
     			print '<tr '.$bc[$var].'>'."\n";
-    			print '<td width="140">'.$modCodeTiers->nom.'</td>'."\n";
+    			print '<td width="140">'.$modCodeTiers->name.'</td>'."\n";
     			print '<td>'.$modCodeTiers->info($langs).'</td>'."\n";
     			print '<td class="nowrap">'.$modCodeTiers->getExample($langs).'</td>'."\n";
 
@@ -420,7 +420,7 @@ foreach ($dirsociete as $dirroot)
     			$var = !$var;
 
     			print '<tr '.$bc[$var].'>';
-    			print '<td>'.$modCodeCompta->nom."</td><td>\n";
+    			print '<td>'.$modCodeCompta->name."</td><td>\n";
     			print $modCodeCompta->info($langs);
     			print '</td>';
     			print '<td class="nowrap">'.$modCodeCompta->getExample($langs)."</td>\n";
@@ -569,7 +569,7 @@ foreach ($dirsociete as $dirroot)
 					}
 					$htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
 					$htmltooltip.='<br>'.$langs->trans("WatermarkOnDraft").': '.yn((! empty($module->option_draft_watermark)?$module->option_draft_watermark:''), 1, 1);
-					
+
 					print '<td align="center" class="nowrap">';
 					print $form->textwithpicto('',$htmltooltip,1,0);
 					print '</td>';
@@ -632,19 +632,19 @@ while ($i < $nbofloop)
 	if ($profid[$i][1]!='-')
 	{
 		$var = !$var;
-	
+
 		print '<tr '.$bc[$var].'>';
 		print '<td>'.$profid[$i][0]."</td><td>\n";
 		print $profid[$i][1];
 		print '</td>';
-	
+
 		$idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE';
 		$idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY';
 		$idprof_invoice_mandatory ='SOCIETE_IDPROF'.($i+1).'_INVOICE_MANDATORY';
 		$verif=(empty($conf->global->$idprof_unique)?false:true);
 		$mandatory=(empty($conf->global->$idprof_mandatory)?false:true);
 		$invoice_mandatory=(empty($conf->global->$idprof_invoice_mandatory)?false:true);
-	
+
 		if ($verif)
 		{
 			print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
@@ -657,7 +657,7 @@ while ($i < $nbofloop)
 			print img_picto($langs->trans("Disabled"),'switch_off');
 			print '</a></td>';
 		}
-		
+
 		if ($mandatory)
 		{
 			print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
@@ -670,7 +670,7 @@ while ($i < $nbofloop)
 			print img_picto($langs->trans("Disabled"),'switch_off');
 			print '</a></td>';
 		}
-		
+
 		if ($invoice_mandatory)
 		{
 			print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidinvoicemandatory&value='.($i+1).'&status=0">';
@@ -683,7 +683,7 @@ while ($i < $nbofloop)
 			print img_picto($langs->trans("Disabled"),'switch_off');
 			print '</a></td>';
 		}
-		
+
 		print "</tr>\n";
 	}
 	$i++;
diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php
index 63f5214b319fd735bb33cfd92b3a8dfd3bd842c7..b94262bbb527b8e5896787162bf0f3a03296d124 100644
--- a/htdocs/societe/canvas/actions_card_common.class.php
+++ b/htdocs/societe/canvas/actions_card_common.class.php
@@ -305,7 +305,7 @@ abstract class ActionsCardCommon
 
             if ($result >= 0)
             {
-                header("Location: ".DOL_URL_ROOT."/societe/societe.php?delsoc=".$this->object->nom."");
+                header("Location: ".DOL_URL_ROOT."/societe/societe.php?delsoc=".$this->object->name."");
                 exit;
             }
             else
diff --git a/htdocs/societe/class/address.class.php b/htdocs/societe/class/address.class.php
index ec16128fb8a87bbb95f986a571a1555b3ee018a8..f08a4a2455cf42efe6311e476712a6bfaed97004 100644
--- a/htdocs/societe/class/address.class.php
+++ b/htdocs/societe/class/address.class.php
@@ -112,7 +112,7 @@ class Address
 				if ($this->db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS')
 				{
 
-					$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->nom);
+					$this->error=$langs->trans("ErrorCompanyNameAlreadyExists",$this->name);
 				}
 
 				$this->db->rollback();
@@ -176,7 +176,7 @@ class Address
 		$this->fax			= preg_replace("/\./","",$this->fax);
 		$this->note			= trim($this->note);
 
-		$result = $this->verify();		// Verifie que nom et label obligatoire
+		$result = $this->verify();		// Verifie que name et label obligatoire
 
 		if ($result >= 0)
 		{
@@ -236,7 +236,7 @@ class Address
 	{
 		global $langs, $conf;
 
-		$sql = 'SELECT rowid, nom, client, fournisseur';
+		$sql = 'SELECT rowid, nom as name, client, fournisseur';
 		$sql .= ' FROM '.MAIN_DB_PREFIX.'societe';
 		$sql .= ' WHERE rowid = '.$socid;
 
@@ -247,7 +247,7 @@ class Address
 			{
 				$obj = $this->db->fetch_object($resqlsoc);
 
-				$this->socname 		= $obj->nom;
+				$this->socname 		= $obj->name;
 				$this->socid		= $obj->rowid;
 				$this->id			= $obj->rowid;
 				$this->client		= $obj->client;
@@ -440,7 +440,7 @@ class Address
 	 */
 	function info($id)
 	{
-		$sql = "SELECT s.rowid, s.nom, datec as date_creation, tms as date_modification,";
+		$sql = "SELECT s.rowid, s.nom as name, datec as date_creation, tms as date_modification,";
 		$sql.= " fk_user_creat, fk_user_modif";
 		$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
 		$sql.= " WHERE s.rowid = ".$id;
@@ -465,7 +465,7 @@ class Address
 					$muser->fetch($obj->fk_user_modif);
 					$this->user_modification = $muser;
 				}
-				$this->ref			     = $obj->nom;
+				$this->ref			     = $obj->name;
 				$this->date_creation     = $this->db->jdate($obj->date_creation);
 				$this->date_modification = $this->db->jdate($obj->date_modification);
 			}
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index e446d5a9e7609f9520464fc912ef2e0ed524b5c5..6d80189c7beaedd1b2354e781ab1c9e6b5f90742 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -624,7 +624,7 @@ class Societe extends CommonObject
         // Clean parameters
         $this->id			= $id;
         $this->name			= $this->name?trim($this->name):trim($this->nom);
-        $this->nom			= trim($this->nom);		// TODO obsolete
+        $this->nom			= $this->name;	// For backward compatibility
         $this->ref_ext		= trim($this->ref_ext);
         $this->address		= $this->address?trim($this->address):trim($this->address);
         $this->zip			= $this->zip?trim($this->zip):trim($this->zip);
diff --git a/htdocs/societe/notify/index.php b/htdocs/societe/notify/index.php
index 1832e7851ea42bfbe2e798bce61f4bea89bae954..a1042087fafaf24ba22779a2ecf35b0d2d60cbf6 100644
--- a/htdocs/societe/notify/index.php
+++ b/htdocs/societe/notify/index.php
@@ -51,13 +51,12 @@ $pagenext = $page + 1;
 
 
 /*
- * Mode Liste
- *
+ * View
  */
 
 llxHeader();
 
-$sql = "SELECT s.nom, s.rowid as socid, c.lastname, c.firstname, a.label, n.rowid";
+$sql = "SELECT s.nom as name, s.rowid as socid, c.lastname, c.firstname, a.label, n.rowid";
 $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c,";
 $sql.= " ".MAIN_DB_PREFIX."c_action_trigger as a,";
 $sql.= " ".MAIN_DB_PREFIX."notify_def as n,";
@@ -94,7 +93,7 @@ if ($result)
 		$var=!$var;
 
 		print "<tr ".$bc[$var].">";
-		print "<td><a href=\"card.php?socid=".$obj->socid."\">".$obj->nom."</a></td>\n";
+		print "<td><a href=\"card.php?socid=".$obj->socid."\">".$obj->name."</a></td>\n";
 		print "<td>".dolGetFirstLastname($obj->firstname, $obj->lastname)."</td>\n";
 		print "<td>".$obj->titre."</td>\n";
 		print "</tr>\n";
diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php
index 3b6be065879630c3ed7fe72811103b44a2cebd42..e096f8fc470a947edddc0606aedb26699b6482f8 100644
--- a/htdocs/user/class/usergroup.class.php
+++ b/htdocs/user/class/usergroup.class.php
@@ -5,7 +5,7 @@
  * Copyright (C) 2012	   Florian Henry		<florian.henry@open-concept.pro>
  * Copyright (C) 2014	   Juanjo Menent		<jmenent@2byte.es>
  * Copyright (C) 2014	   Alexis Algoud		<alexis@atm-consulting.fr>
- * 
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 3 of the License, or
@@ -41,6 +41,7 @@ class UserGroup extends CommonObject
 	var $id;			// Group id
 	var $entity;		// Entity of group
 	var $nom;			// Name of group
+	var $name;			// Name of group	// deprecated
 	var $globalgroup;	// Global group
 	var $note;			// Note on group
 	var $datec;			// Creation date of group
@@ -69,7 +70,7 @@ class UserGroup extends CommonObject
 	 *	Charge un objet group avec toutes ces caracteristiques (excpet ->members array)
 	 *
 	 *	@param      int		$id			id du groupe a charger
-	 *	@param      string	$groupname	nom du groupe a charger
+	 *	@param      string	$groupname	name du groupe a charger
 	 *	@return		int					<0 if KO, >0 if OK
 	 */
 	function fetch($id='', $groupname='')
@@ -99,7 +100,7 @@ class UserGroup extends CommonObject
 				$this->ref = $obj->rowid;
 				$this->entity = $obj->entity;
 				$this->name = $obj->name;
-				$this->nom = $obj->name; //Deprecated
+				$this->nom = $obj->name; // Deprecated
 				$this->note = $obj->note;
 				$this->datec = $obj->datec;
 				$this->datem = $obj->datem;
@@ -113,8 +114,8 @@ class UserGroup extends CommonObject
 				$extrafields=new ExtraFields($this->db);
 				$extralabels=$extrafields->fetch_name_optionals_label($this->table_element,true);
 				$this->fetch_optionals($this->id,$extralabels);
-			
-		
+
+
 				// Sav current LDAP Current DN
 				//$this->ldap_dn = $this->_load_ldap_dn($this->_load_ldap_info(),0);
 			}
@@ -626,8 +627,8 @@ class UserGroup extends CommonObject
                 if ($result < 0) { $error++; $this->db->rollback(); return -1; }
                 // End call triggers
 			}
-			
-			
+
+
 			// Actions on extra fields (by external module or standard code)
 			$hookmanager->initHooks(array('groupdao'));
 			$parameters=array();
@@ -644,10 +645,10 @@ class UserGroup extends CommonObject
 				}
 			}
 			else if ($reshook < 0) $error++;
-			
+
 			if ($error > 0) { $error++; $this->db->rollback(); return -1; }
 			else $this->db->commit();
-			
+
 			return $this->id;
 		}
 		else
@@ -679,7 +680,7 @@ class UserGroup extends CommonObject
 		$this->db->begin();
 
 		$sql = "UPDATE ".MAIN_DB_PREFIX."usergroup SET ";
-		$sql.= " nom = '" . $this->db->escape($this->nom) . "'";
+		$sql.= " nom = '" . $this->db->escape($this->name) . "'";
 		$sql.= ", entity = " . $this->db->escape($entity);
 		$sql.= ", note = '" . $this->db->escape($this->note) . "'";
 		$sql.= " WHERE rowid = " . $this->id;
@@ -695,7 +696,7 @@ class UserGroup extends CommonObject
                 if ($result < 0) { $error++; }
                 // End call triggers
 			}
-			
+
 			// Actions on extra fields (by external module or standard code)
 			$hookmanager->initHooks(array('groupdao'));
 			$parameters=array();
@@ -712,7 +713,7 @@ class UserGroup extends CommonObject
 				}
 			}
 			else if ($reshook < 0) $error++;
-			
+
 			if (! $error)
 			{
 			    $this->db->commit();
@@ -767,8 +768,8 @@ class UserGroup extends CommonObject
 		$info["objectclass"]=explode(',',$conf->global->LDAP_GROUP_OBJECT_CLASS);
 
 		// Champs
-		if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->nom;
-		//if ($this->nom && ! empty($conf->global->LDAP_GROUP_FIELD_NAME)) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->nom;
+		if ($this->name && ! empty($conf->global->LDAP_GROUP_FIELD_FULLNAME)) $info[$conf->global->LDAP_GROUP_FIELD_FULLNAME] = $this->name;
+		//if ($this->name && ! empty($conf->global->LDAP_GROUP_FIELD_NAME)) $info[$conf->global->LDAP_GROUP_FIELD_NAME] = $this->name;
 		if ($this->note && ! empty($conf->global->LDAP_GROUP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION] = $this->note;
 		if (! empty($conf->global->LDAP_GROUP_FIELD_GROUPMEMBERS))
 		{
@@ -805,7 +806,7 @@ class UserGroup extends CommonObject
 		$this->ref = 'SPECIMEN';
 		$this->specimen=1;
 
-		$this->nom='DOLIBARR GROUP SPECIMEN';
+		$this->name='DOLIBARR GROUP SPECIMEN';
 		$this->note='This is a note';
 		$this->datec=time();
 		$this->datem=time();
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 4bf4cb35ad98a95ed17163b7de5d0bde97aa02ce..a1930f7c027eac8362a01d32892df51d03e1b3ea 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -95,12 +95,13 @@ if ($action == 'add')
             setEventMessage($langs->trans("NameNotDefined"), 'errors');
             $action="create";       // Go back to create page
         } else {
-			$object->nom	= trim($_POST["nom"]);
+			$object->nom	= trim($_POST["nom"]);	// For backward compatibility
+			$object->name	= trim($_POST["nom"]);
 			$object->note	= trim($_POST["note"]);
 
 			// Fill array 'array_options' with data from add form
       		$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
-			
+
       		if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode)) $object->entity = 0;
 			else $object->entity = $_POST["entity"];
 
@@ -120,7 +121,7 @@ if ($action == 'add')
                 $db->rollback();
 
                 $langs->load("errors");
-                setEventMessage($langs->trans("ErrorGroupAlreadyExists",$object->nom), 'errors');
+                setEventMessage($langs->trans("ErrorGroupAlreadyExists",$object->name), 'errors');
                 $action="create";       // Go back to create page
             }
         }
@@ -176,7 +177,8 @@ if ($action == 'update')
 
         $object->oldcopy=dol_clone($object);
 
-		$object->nom	= trim($_POST["group"]);
+		$object->name	= trim($_POST["group"]);
+		$object->nom	= $this->name;			// For backward compatibility
 		$object->note	= dol_htmlcleanlastbr($_POST["note"]);
 
 		// Fill array 'array_options' with data from add form
@@ -251,7 +253,7 @@ if ($action == 'create')
     $doleditor=new DolEditor('note','','',240,'dolibarr_notes','',false,true,$conf->global->FCKEDITOR_ENABLE_SOCIETE,ROWS_8,90);
     $doleditor->Create();
     print "</td></tr>\n";
-    
+
 	// Other attributes
     $parameters=array('object' => $object, 'colspan' => ' colspan="2"');
     $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);    // Note that $action and $object may have been modified by hook
@@ -259,7 +261,7 @@ if ($action == 'create')
     {
     	print $object->showOptionals($extrafields,'edit');
     }
-    
+
     print "</table>\n";
 
     print '<center><br><input class="button" value="'.$langs->trans("CreateGroup").'" type="submit"></center>';
@@ -331,7 +333,7 @@ else
 			print '<tr><td width="25%" valign="top">'.$langs->trans("Note").'</td>';
 			print '<td class="valeur">'.dol_htmlentitiesbr($object->note).'&nbsp;</td>';
 			print "</tr>\n";
-					
+
 			// Other attributes
             $parameters=array('colspan' => ' colspan="2"');
             $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action);    // Note that $action and $object may have been modified by hook
@@ -339,7 +341,7 @@ else
             {
             	print $object->showOptionals($extrafields);
             }
-			
+
 			print "</table>\n";
 
 			print '</div>';
@@ -531,7 +533,7 @@ else
             {
             	print $object->showOptionals($extrafields,'edit');
             }
-			
+
             print "</table>\n";
 
             print '<center><br><input class="button" value="'.$langs->trans("Save").'" type="submit"></center>';
diff --git a/htdocs/user/group/index.php b/htdocs/user/group/index.php
index 547a89d3451201f1cb886a189361e816bbd29075..00af5b0e6d24744569aa7dd4eb9dda91e5c88d6a 100644
--- a/htdocs/user/group/index.php
+++ b/htdocs/user/group/index.php
@@ -57,7 +57,7 @@ llxHeader();
 
 print_fiche_titre($langs->trans("ListOfGroups"));
 
-$sql = "SELECT g.rowid, g.nom, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb";
+$sql = "SELECT g.rowid, g.nom as name, g.entity, g.datec, COUNT(DISTINCT ugu.fk_user) as nb";
 $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_usergroup = g.rowid";
 if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
@@ -101,7 +101,7 @@ if ($resql)
         $var=!$var;
 
         print "<tr ".$bc[$var].">";
-        print '<td><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.'</a>';
+        print '<td><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->name.'</a>';
         if (! $obj->entity)
         {
         	print img_picto($langs->trans("GlobalGroup"),'redstar');
diff --git a/htdocs/user/group/ldap.php b/htdocs/user/group/ldap.php
index c3e147620c2389df14c63ca98cabe5bdb2f2e271..eaee979e802fa3f6c75cc0e995b681da030ba027 100644
--- a/htdocs/user/group/ldap.php
+++ b/htdocs/user/group/ldap.php
@@ -104,7 +104,7 @@ print '</tr>';
 
 // Name
 print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
-print '<td width="75%" class="valeur">'.$fgroup->nom;
+print '<td width="75%" class="valeur">'.$fgroup->name;
 if (!$fgroup->entity)
 {
 	print img_picto($langs->trans("GlobalGroup"),'redstar');
diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php
index 5c52fa80a50f8225ebe2e2ccac211ea24e3e4157..a910753c643decd1c30209c63f12282303aae08a 100644
--- a/htdocs/user/group/perms.php
+++ b/htdocs/user/group/perms.php
@@ -199,7 +199,7 @@ if ($id)
 
     // Nom
     print '<tr><td width="25%" valign="top">'.$langs->trans("Name").'</td>';
-    print '<td colspan="2">'.$fgroup->nom.'';
+    print '<td colspan="2">'.$fgroup->name.'';
     if (! $fgroup->entity)
     {
         print img_picto($langs->trans("GlobalGroup"),'redstar');
diff --git a/htdocs/user/home.php b/htdocs/user/home.php
index c888dcdf63298c46cac9f4f67dda43d0ba5f55e3..c9b3693f1ac510c25cac66b96b03dd08c081c4a0 100644
--- a/htdocs/user/home.php
+++ b/htdocs/user/home.php
@@ -200,7 +200,7 @@ if ($canreadperms)
 {
 	$max=5;
 
-	$sql = "SELECT g.rowid, g.nom, g.note, g.entity, g.datec";
+	$sql = "SELECT g.rowid, g.nom as name, g.note, g.entity, g.datec";
 	$sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
 	if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && ($conf->multicompany->transverse_mode || ($user->admin && ! $user->entity)))
 	{
@@ -230,7 +230,7 @@ if ($canreadperms)
 			$var=!$var;
 
 			print "<tr ".$bc[$var].">";
-			print '<td><a href="'.DOL_URL_ROOT.'/user/group/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->nom.'</a>';
+			print '<td><a href="'.DOL_URL_ROOT.'/user/group/card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowGroup"),"group").' '.$obj->name.'</a>';
 			if (! $obj->entity)
 			{
 				print img_picto($langs->trans("GlobalGroup"),'redstar');
diff --git a/htdocs/user/index.php b/htdocs/user/index.php
index 30b0c9b3a8e2f8e382a1ce19ad446480dea125d0..ac1ebc9e1c57ef129b3939b615d34cc87d4692a1 100644
--- a/htdocs/user/index.php
+++ b/htdocs/user/index.php
@@ -73,7 +73,7 @@ $sql.= " u.tms as datem,";
 $sql.= " u.datelastlogin,";
 $sql.= " u.ldap_sid, u.statut, u.entity,";
 $sql.= " u2.login as login2, u2.firstname as firstname2, u2.lastname as lastname2,";
-$sql.= " s.nom, s.canvas";
+$sql.= " s.nom as name, s.canvas";
 $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
 $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u2 ON u.fk_user = u2.rowid";
@@ -161,7 +161,7 @@ if ($result)
         if ($obj->fk_societe)
         {
             $companystatic->id=$obj->fk_societe;
-            $companystatic->nom=$obj->nom;
+            $companystatic->name=$obj->name;
             $companystatic->canvas=$obj->canvas;
             print $companystatic->getNomUrl(1);
         }
diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php
index c6bed990c1475c74cca494d8db0dd372f00f1a96..93406276eadeb474da27911d04a3f37d3e7c6ed4 100755
--- a/scripts/user/sync_groups_ldap2dolibarr.php
+++ b/scripts/user/sync_groups_ldap2dolibarr.php
@@ -136,19 +136,20 @@ if ($result >= 0)
 		{
 			$group = new UserGroup($db);
 			$group->fetch('', $ldapgroup[$conf->global->LDAP_KEY_GROUPS]);
-			$group->nom = $ldapgroup[$conf->global->LDAP_GROUP_FIELD_FULLNAME];
+			$group->name = $ldapgroup[$conf->global->LDAP_GROUP_FIELD_FULLNAME];
+			$group->nom = $group->name;		// For backward compatibility
 			$group->note = $ldapgroup[$conf->global->LDAP_GROUP_FIELD_DESCRIPTION];
 			$group->entity = $conf->entity;
 
 			//print_r($ldapgroup);
 
 			if($group->id > 0) { // Group update
-				print $langs->transnoentities("GroupUpdate").' # '.$key.': name='.$group->nom;
+				print $langs->transnoentities("GroupUpdate").' # '.$key.': name='.$group->name;
 				$res=$group->update();
 
 				if ($res > 0)
 				{
-					print ' --> Updated group id='.$group->id.' name='.$group->nom;
+					print ' --> Updated group id='.$group->id.' name='.$group->name;
 				}
 				else
 				{
@@ -157,12 +158,12 @@ if ($result >= 0)
 				}
 				print "\n";
 			} else { // Group creation
-				print $langs->transnoentities("GroupCreate").' # '.$key.': name='.$group->nom;
+				print $langs->transnoentities("GroupCreate").' # '.$key.': name='.$group->name;
 				$res=$group->create();
 
 				if ($res > 0)
 				{
-					print ' --> Created group id='.$group->id.' name='.$group->nom;
+					print ' --> Created group id='.$group->id.' name='.$group->name;
 				}
 				else
 				{
diff --git a/test/phpunit/AdherentTest.php b/test/phpunit/AdherentTest.php
index f9db37ab79e3d9f8c2835ca5e8dc252e9317e05c..b43b9d230b3c06354afae26fde0053306416696b 100644
--- a/test/phpunit/AdherentTest.php
+++ b/test/phpunit/AdherentTest.php
@@ -530,7 +530,33 @@ class AdherentTest extends PHPUnit_Framework_TestCase
 		print __METHOD__." id=".$localobject->id." result=".$result."\n";
 		$this->assertLessThan($result, 0);
 
-		return $result;
+		return $localobject;
     }
 
+
+    /**
+     * testAdherentTypeDelete
+     *
+     * @param   Adherent    $localobject    Member instance
+     * @return void
+     *
+     * @depends	testAdherentDelete
+     * The depends says test is run only if previous is ok
+     */
+    public function testAdherentTypeDelete($localobject)
+    {
+    	global $conf,$user,$langs,$db;
+		$conf=$this->savconf;
+		$user=$this->savuser;
+		$langs=$this->savlangs;
+		$db=$this->savdb;
+
+		$localobjectat=new AdherentType($this->savdb);
+     	$result=$localobjectat->fetch($localobject->typeid);
+     	$result=$localobjectat->delete();
+     	print __METHOD__." result=".$result."\n";
+    	$this->assertLessThan($result, 0);
+
+    	return $localobject->id;
+    }
 }