diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index bc3c0d537606b7202de6876497f91fdd498a593f..e072807a6ca5ec8befd1ab80baabf749d33e74df 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -251,19 +251,19 @@ if (! empty($categ[$categidx]))
 if ($conf->global->MAIN_FEATURES_LEVEL >= 1)
 {
 	$form = new Form($db);
-	$categidx='expdev';
+	$categidx='expdev';
     $head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
-    $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);
-    $head[$h][2] = 'expdev';
-    $h++;
+    $head[$h][1] = $form->textwithpicto($langs->trans("ModuleFamilyExperimental"), $langs->trans('DoNotUseInProduction'), 1, 'warning', '', 0, 3);
+    $head[$h][2] = 'expdev';
+    $h++;
 }
 
-$categidx='marketplace';
-$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
-$head[$h][1] = $langs->trans("ModulesMarketPlaces");
-$head[$h][2] = 'marketplace';
-$h++;
-
+$categidx='marketplace';
+$head[$h][0] = DOL_URL_ROOT."/admin/modules.php?mode=".$categidx;
+$head[$h][1] = $langs->trans("ModulesMarketPlaces");
+$head[$h][2] = 'marketplace';
+$h++;
+
 
 dol_fiche_head($head, $mode, $langs->trans("Modules"));
 
diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index b46d47c57dae680547109b08eefee4658acb667c..7ba7a2412fb5f76ae4689cf72c6e36d870cbccbb 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -516,7 +516,7 @@ if ($conf->propal->enabled && $user->rights->propal->lire)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
-				$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print "</td>";
diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php
index 831970d2e1452aba9fdf8f1dbd99a6ce31c5cacb..b341e8a9c11e71183c99c8a71b6b43cc0ad10799 100644
--- a/htdocs/comm/propal/index.php
+++ b/htdocs/comm/propal/index.php
@@ -257,7 +257,7 @@ if ($resql)
 			$filename=dol_sanitizeFileName($obj->ref);
 			$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 			$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-			$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+			print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
 			print '</td></tr></table>';
 
 			print '</td>';
@@ -334,7 +334,7 @@ if (! empty($conf->propal->enabled) && $user->rights->propale->lire)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->propalid;
-				$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print "</td>";
@@ -418,7 +418,7 @@ if ($conf->propal->enabled)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
@@ -490,7 +490,7 @@ if ($conf->propal->enabled)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($propalstatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 7092e8dc1800be00176d189a965271afe987e053..8603f0a7394a38472ea5db1aa9d63bdb4255a1be 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -320,8 +320,7 @@ if ($result)
 		$filename=dol_sanitizeFileName($objp->ref);
 		$filedir=$conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
 		$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid;
-		//$formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1);
-		print $formfile->getDocumentsLink('propal', $filename, $filedir);
+		print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
 		print '</td></tr></table>';
 
 		if ($objp->client == 1)
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index 71a863b6e07de70dab9d8d45736bdf9d8f792b3f..091701aeeaca1d35f02c62187cdd06eee79d724e 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -3140,7 +3140,7 @@ class OrderLine
 			$sql.= " , total_ht=".price2num($this->total_ht)."";
 			$sql.= " , total_tva=".price2num($this->total_tva)."";
 			$sql.= " , total_ttc=".price2num($this->total_ttc)."";
-			$sql.= " , total_localtax1=".price2num($this->total_localtax1);
+			$sql.= " , total_localtax1=".price2num($this->total_localtax1);
 			$sql.= " , total_localtax2=".price2num($this->total_localtax2);
 		}
 		$sql.= " , fk_product_fournisseur_price=".(! empty($this->fk_fournprice)?$this->fk_fournprice:"null");
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 0c7a40d2ac879b2f0d011cf487a64cde17928ed2..7b5e3391330d8756f6ebe5b131e7ae63f6ef3c25 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -262,7 +262,7 @@ if ($resql)
 			$filename=dol_sanitizeFileName($obj->ref);
 			$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 			$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-			$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+			print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
 			print '</td></tr></table>';
 
 			print '</td>';
@@ -331,7 +331,7 @@ if ($conf->commande->enabled)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
@@ -402,7 +402,7 @@ if ($conf->commande->enabled)
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
diff --git a/htdocs/commande/liste.php b/htdocs/commande/liste.php
index 08c68939903af033d006dd7b9a9c839a065cf345..641d13f864383adab644229068ab2bd6050d6191 100644
--- a/htdocs/commande/liste.php
+++ b/htdocs/commande/liste.php
@@ -308,7 +308,7 @@ if ($resql)
 		$filename=dol_sanitizeFileName($objp->ref);
 		$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
 		$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
-		$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+		print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
 		print '</td></tr></table>';
 
 		print '</td>';
diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php
index c0ef16db6fb590c5bef5e4d451ae8302ad0a2ab4..ec94022d853261a600c03dd7d42bb53de1f7b906 100755
--- a/htdocs/commande/orderstoinvoice.php
+++ b/htdocs/commande/orderstoinvoice.php
@@ -469,10 +469,10 @@ if ($action == 'create')
 	while ($i < $n)
 	{
 		print '<input type="hidden" name="orders_to_invoice[]" value="'.$orders_id[$i].'">';
-	
+
 		$i++;
 	}
-	
+
 	print "</table>\n";
 	// Button "Create Draft"
 	print '<br><center><input type="submit" class="button" name="bouton" value="'.$langs->trans('CreateDraft').'"></center>';
@@ -496,7 +496,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 	});
 	</script>
 	<?php
-	
+
 	$sql = 'SELECT s.nom, s.rowid as socid, s.client, c.rowid, c.ref, c.total_ht, c.ref_client,';
 	$sql.= ' c.date_valid, c.date_commande, c.date_livraison, c.fk_statut, c.facture as facturee';
 	$sql.= ' FROM '.MAIN_DB_PREFIX.'societe as s';
@@ -535,18 +535,18 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 	{
 		$sql.= " AND (c.ref LIKE '%".$db->escape($sall)."%' OR c.note LIKE '%".$db->escape($sall)."%')";
 	}
-	
+
 	//Date filter
 	if ($date_start && $date_end) $sql.= " AND c.date_commande >= '".$db->idate($date_start)."' AND c.date_commande <= '".$db->idate($date_end)."'";
 	if ($date_starty && $date_endy) $sql.= " AND c.date_livraison >= '".$db->idate($date_starty)."' AND c.date_livraison <= '".$db->idate($date_endy)."'";
-	
+
 	if (!empty($sref_client))
 	{
 		$sql.= ' AND c.ref_client LIKE \'%'.$db->escape($sref_client).'%\'';
 	}
 	$sql.= ' ORDER BY '.$sortfield.' '.$sortorder;
 	$resql = $db->query($sql);
-	
+
 	if ($resql)
 	{
 		if ($socid)
@@ -569,7 +569,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 		print '<h3>';
 		$companystatic->id=$socid;
 		$companystatic->nom=$soc->nom;
-	
+
 		print $companystatic->getNomUrl(1,'customer');
 		print '</h3>';
 		print '<table class="noborder" width="100%">';
@@ -581,7 +581,7 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 		print_liste_field_titre($langs->trans('Status'),'','','','','align="right"');
 		print_liste_field_titre($langs->trans('GenerateBill'),'','','','','align="center"');
 		print '</tr>';
-	
+
 		// Lignes des champs de filtre
 		print '<form method="get" action="orderstoinvoice.php">';
 		print '<input type="hidden" name="socid" value="'.$socid.'">';
@@ -593,88 +593,88 @@ if (($action != 'create' && $action != 'add') || ! empty($mesgs))
 		//print '<td class="liste_titre">';
 		print '<td class="liste_titre" align="left">';
 		print '<input class="flat" type="text" size="10" name="sref_client" value="'.$sref_client.'">';
-	
+
 		//DATE ORDER
 		print '<td class="liste_titre" align="center">';
 		print $period;
 		print '</td>';
-	
+
 		//DATE DELIVERY
 		print '<td class="liste_titre" align="center">';
 		print $periodely;
 		print '</td>';
-	
+
 		//SEARCH BUTTON
 		print '</td><td align="right" class="liste_titre">';
 		print '<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png"  value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
-	
+
 		//ALL/NONE
 		print '<td class="liste_titre" align="center">';
 		if ($conf->use_javascript_ajax) print '<a href="#" id="checkall">'.$langs->trans("All").'</a> / <a href="#" id="checknone">'.$langs->trans("None").'</a>';
 		print '</td>';
-	
+
 		print '</td></tr>';
 		print '</form>';
-	
+
 		print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
 		$var=True;
 		$generic_commande = new Commande($db);
-	
+
 		while ($i < $num)
 		{
 			$objp = $db->fetch_object($resql);
 			$var=!$var;
 			print '<tr '.$bc[$var].'>';
 			print '<td nowrap="nowrap">';
-	
+
 			$generic_commande->id=$objp->rowid;
 			$generic_commande->ref=$objp->ref;
-	
+
 			print '<table class="nobordernopadding"><tr class="nocellnopadd">';
 			print '<td class="nobordernopadding" nowrap="nowrap">';
 			print $generic_commande->getNomUrl(1,$objp->fk_statut);
 			print '</td>';
-	
+
 			print '<td width="20" class="nobordernopadding" nowrap="nowrap">';
 			if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && $db->jdate($objp->date_valid) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning");
 			print '</td>';
-	
+
 			print '<td width="16" align="right" class="nobordernopadding">';
 			$filename=dol_sanitizeFileName($objp->ref);
 			$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref);
 			$urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->rowid;
-			$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+			print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir);
 			print '</td></tr></table>';
 			print '</td>';
-	
+
 			print '<td>'.$objp->ref_client.'</td>';
-	
+
 			// Order date
 			print '<td align="center" nowrap>';
 			print dol_print_date($db->jdate($objp->date_commande),'day');
 			print '</td>';
-	
+
 			//Delivery date
 			print '<td align="center" nowrap>';
 			print dol_print_date($db->jdate($objp->date_livraison),'day');
 			print '</td>';
-	
+
 			// Statut
 			print '<td align="right" nowrap="nowrap">'.$generic_commande->LibStatut($objp->fk_statut,$objp->facturee,5).'</td>';
-	
+
 			// Checkbox
 			print '<td align="center">';
 			print '<input class="flat checkformerge" type="checkbox" name="orders_to_invoice[]" value="'.$objp->rowid.'">';
 			print '</td>' ;
-	
+
 			print '</tr>';
-	
+
 			$total = $total + $objp->price;
 			$subtotal = $subtotal + $objp->price;
 			$i++;
 		}
 		print '</table>';
-	
+
 		/*
 		 * Boutons actions
 		*/
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 3ec0b1576e7300666d16b215c17b0d579cdb3de9..054b2a13760a00f138241ffa40bf6a25b93aeff7 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -3446,7 +3446,7 @@ class FactureLigne
         	$sql.= ",total_ht=".price2num($this->total_ht)."";
         	$sql.= ",total_tva=".price2num($this->total_tva)."";
         	$sql.= ",total_ttc=".price2num($this->total_ttc)."";
-        	$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
+        	$sql.= ",total_localtax1=".price2num($this->total_localtax1)."";
         	$sql.= ",total_localtax2=".price2num($this->total_localtax2)."";
         }
 		$sql.= " , fk_product_fournisseur_price='".$this->fk_fournprice."'";
diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php
index 1f014a65aaf30304c0629de17581f3a321888405..a0173e74fa40029eeec71cfff00ff1af149b90e2 100644
--- a/htdocs/compta/facture/fiche-rec.php
+++ b/htdocs/compta/facture/fiche-rec.php
@@ -301,10 +301,10 @@ if ($action == 'create')
 						$prodprice=$product_static->price;	// price HT
 						print '<td align="right">'.price($prodprice)."</td>\n";
 					}
-					else
-					{
-						print '<td>&nbsp;</td>';
-					}
+					else
+					{
+						print '<td>&nbsp;</td>';
+					}
 				}
 
 				print "</tr>";
diff --git a/htdocs/compta/facture/impayees.php b/htdocs/compta/facture/impayees.php
index 6cd4850ddd89e43be84debe18e4c75d42ede0d64..f81252e39e65cb61a0587017bca73e4fb7b866b9 100644
--- a/htdocs/compta/facture/impayees.php
+++ b/htdocs/compta/facture/impayees.php
@@ -340,7 +340,7 @@ if ($resql)
 			print '<td width="16" align="right" class="nobordernopadding">';
             $filename=dol_sanitizeFileName($objp->facnumber);
 			$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
-			$foundpdf=$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1,$param);
+			print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
             print '</td>';
 
 			print '</tr></table>';
@@ -365,8 +365,10 @@ if ($resql)
 
 			// Checkbox
 			print '<td align="center">';
-			if ($foundpdf) print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
-			else print '&nbsp;';
+			if (! empty($formfile->numoffiles))
+				print '<input id="cb'.$objp->facid.'" class="flat checkformerge" type="checkbox" name="toGenerate[]" value="'.$objp->facnumber.'">';
+			else
+				print '&nbsp;';
 			print '</td>' ;
 
 			print "</tr>\n";
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index 8a19de20180178345b2de9a5eeed4bcb0e170566..9d668723f34588b905c2280a5c4c8eac29a19ef1 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -341,7 +341,7 @@ if ($resql)
             $filename=dol_sanitizeFileName($objp->facnumber);
             $filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($objp->facnumber);
             $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->facid;
-            $formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
+            print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
             print '</td>';
             print '</tr>';
             print '</table>';
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index bf2c773265b6d221007ca71cd6ec822b01756599..a0ffe2b90358c2d1c80248348e6f1dfe59eef843 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -320,7 +320,7 @@ print '</td>';
 print '<td valign="top" width="70%" class="notopnoleftnoright">';
 
 // Last modified customer invoices
-if ($conf->facture->enabled && $user->rights->facture->lire)
+if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 {
 	$langs->load("boxes");
 	$facstatic=new Facture($db);
@@ -378,7 +378,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 				$filename=dol_sanitizeFileName($obj->facnumber);
 				$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
 				$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
-				$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
@@ -709,7 +709,7 @@ if ($conf->tax->enabled && $user->rights->tax->charges->lire)
 /*
  * Customers orders to be billed
  */
-if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->commande->lire)
+if (! empty($conf->facture->enabled) && ! empty($conf->commande->enabled) && $user->rights->commande->lire)
 {
 	$commandestatic=new Commande($db);
 	$langs->load("orders");
@@ -770,7 +770,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 				$filename=dol_sanitizeFileName($obj->ref);
 				$filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 				$urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-				$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
@@ -813,7 +813,7 @@ if ($conf->facture->enabled && $conf->commande->enabled && $user->rights->comman
 /*
  * Unpaid customers invoices
  */
-if ($conf->facture->enabled && $user->rights->facture->lire)
+if (! empty($conf->facture->enabled) && $user->rights->facture->lire)
 {
 	$facstatic=new Facture($db);
 
@@ -853,7 +853,6 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 			{
 				$obj = $db->fetch_object($resql);
 
-
 				print '<tr '.$bc[$var].'>';
 				print '<td nowrap="nowrap">';
 
@@ -871,7 +870,7 @@ if ($conf->facture->enabled && $user->rights->facture->lire)
 				$filename=dol_sanitizeFileName($obj->facnumber);
 				$filedir=$conf->facture->dir_output . '/' . dol_sanitizeFileName($obj->facnumber);
 				$urlsource=$_SERVER['PHP_SELF'].'?facid='.$obj->rowid;
-				$formfile->show_documents('facture',$filename,$filedir,$urlsource,'','','',1,'',1);
+				print $formfile->getDocumentsLink($facturestatic->element, $filename, $filedir);
 				print '</td></tr></table>';
 
 				print '</td>';
diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php
index 5384c3c44905fb93a56474e65b3013ab5916d76f..35492db4fdcbf9450e6ea8013e26c52aa88d44fc 100644
--- a/htdocs/core/admin_extrafields.inc.php
+++ b/htdocs/core/admin_extrafields.inc.php
@@ -25,9 +25,9 @@ $maxsizestring=255;
 $maxsizeint=10;
 
 $extrasize=GETPOST('size');
-if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
-if (GETPOST('type')=='date')     $extrasize='';
-if (GETPOST('type')=='datetime') $extrasize='';
+if (GETPOST('type')=='double' && strpos($extrasize,',')===false) $extrasize='24,8';
+if (GETPOST('type')=='date')     $extrasize='';
+if (GETPOST('type')=='datetime') $extrasize='';
 
 
 // Add attribute
@@ -38,10 +38,10 @@ if ($action == 'add')
 	    // Check values
 		if (! GETPOST('type'))
 		{
-			$error++;
-			$langs->load("errors");
-			$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
-			$action = 'create';
+			$error++;
+			$langs->load("errors");
+			$mesg=$langs->trans("ErrorFieldRequired",$langs->trans("Type"));
+			$action = 'create';
 		}
 
         if (GETPOST('type')=='varchar' && $extrasize > $maxsizestring)
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d2eb3c0f4afae6742498163932c343953e932263..299df8afdf1d97cc46c871711f1978798dd3ba64 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -369,8 +369,8 @@ class Form
         else $paramfortooltiptd =($extracss?' class="'.$extracss.'"':''); // Attribut to put on td text tag
         $s="";
         if (empty($notabs))	$s.='<table class="nobordernopadding" summary=""><tr>';
-        if ($direction < 0)	$s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
-        if ($text != '')	$s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
+        if ($direction < 0)	$s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
+        if ($text != '')	$s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?'&nbsp;':'').$text.(($direction > 0)?'&nbsp;':'').'</'.$tag.'>';
         if ($direction > 0)	$s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.'</'.$tag.'>';
         if (empty($notabs))	$s.='</tr></table>';
 
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index edef760ec00a9dd5c786f42890687eafec28e2de..b7f3bb0e6b436bc5cd3035357bb4ff8f210bc288 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -199,9 +199,9 @@ class FormFile
 
         global $langs,$bc,$conf;
 
-        // For backward compatibility
-        if (! empty($iconPDF)) {
-        	return $this->getDocumentsLink($modulepart, $filename, $filedir);
+        // For backward compatibility
+        if (! empty($iconPDF)) {
+        	return $this->getDocumentsLink($modulepart, $filename, $filedir);
         }
 
         $forname='builddoc';
@@ -470,15 +470,15 @@ class FormFile
                 if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
                 $out.= '>';
                 $out.= img_mime($file["name"],$langs->trans("File").': '.$file["name"]).' '.dol_trunc($file["name"],$maxfilenamelength);
-                $out.= '</a>'."\n";
+                $out.= '</a>'."\n";
                 $out.= '</td>';
-
+
                 // Show file size
-                $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
+                $size=(! empty($file['size'])?$file['size']:dol_filesize($filedir."/".$file["name"]));
                 $out.= '<td align="right" nowrap="nowrap">'.dol_print_size($size).'</td>';
-
+
                 // Show file date
-                $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
+                $date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
                 $out.= '<td align="right" nowrap="nowrap">'.dol_print_date($date, 'dayhour').'</td>';
 
                 if ($delallowed)
@@ -526,35 +526,39 @@ class FormFile
     	}
 
     	$out='';
-
+
+    	$this->numoffiles=0;
+
     	$file_list=dol_dir_list($filedir, 'files', 0, $filename.'.pdf', '\.meta$|\.png$');
 
-    	// For ajax treatment
+    	// For ajax treatment
     	$out.= '<div id="gen_pdf_'.$filename.'" class="linkobject hideobject">'.img_picto('', 'refresh').'</div>'."\n";
 
     	if (! empty($file_list))
     	{
-    		// Loop on each file found
-    		foreach($file_list as $file)
-    		{
-    			// Define relative path for download link (depends on module)
-    			$relativepath=$file["name"];								// Cas general
-    			if ($filename) $relativepath=$filename."/".$file["name"];	// Cas propal, facture...
-    			// Autre cas
-    			if ($modulepart == 'donation')            {
-    				$relativepath = get_exdir($filename,2).$file["name"];
-    			}
-    			if ($modulepart == 'export')              {
-    				$relativepath = $file["name"];
-    			}
-
-    			// Show file name with link to download
-    			$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
-    			$mime=dol_mimetype($relativepath,'',0);
-    			if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
-    			$out.= '>';
-    			$out.= img_pdf($file["name"],2);
-    			$out.= '</a>'."\n";
+    		// Loop on each file found
+    		foreach($file_list as $file)
+    		{
+    			// Define relative path for download link (depends on module)
+    			$relativepath=$file["name"];								// Cas general
+    			if ($filename) $relativepath=$filename."/".$file["name"];	// Cas propal, facture...
+    			// Autre cas
+    			if ($modulepart == 'donation')            {
+    				$relativepath = get_exdir($filename,2).$file["name"];
+    			}
+    			if ($modulepart == 'export')              {
+    				$relativepath = $file["name"];
+    			}
+
+    			// Show file name with link to download
+    			$out.= '<a href="'.DOL_URL_ROOT . '/document.php?modulepart='.$modulepart.'&amp;file='.urlencode($relativepath).'"';
+    			$mime=dol_mimetype($relativepath,'',0);
+    			if (preg_match('/text/',$mime)) $out.= ' target="_blank"';
+    			$out.= '>';
+    			$out.= img_pdf($file["name"],2);
+    			$out.= '</a>'."\n";
+
+    			$this->numoffiles++;
     		}
     	}
 
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 160970b3aae64032714aa72cdd1624c3c2d50dab..73b8541ac2aa4cc9fc503f77da5010d959dacd83 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -739,12 +739,12 @@ function dol_format_address($object)
 	}
 	else if (in_array($object->country_code,array('GB'))) // UK: title firstname name \n address lines \n town state \n zip \n country
 	{
-		$ret .= ($ret ? "\n" : '' ).$object->town;
-		if ($object->state && in_array($object->country_code,$countriesusingstate))
-		{
-			$ret.=", ".$object->departement;
-		}
-		if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
+		$ret .= ($ret ? "\n" : '' ).$object->town;
+		if ($object->state && in_array($object->country_code,$countriesusingstate))
+		{
+			$ret.=", ".$object->departement;
+		}
+		if ($object->zip) $ret .= ($ret ? "\n" : '' ).$object->zip;
 	}
 	else                                        		// Other: title firstname name \n address lines \n zip town \n country
 	{
diff --git a/htdocs/core/lib/price.lib.php b/htdocs/core/lib/price.lib.php
index 189e02b2cd0e837cc578daa51655e3e376d34e12..78a357cd71bf30675dde08624d35e3463e9e853c 100644
--- a/htdocs/core/lib/price.lib.php
+++ b/htdocs/core/lib/price.lib.php
@@ -56,16 +56,16 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
 	$result=array();
 
 	// TODO Remove this code. Added for backward compatibility. To remove once localtaxX_type is provided by caller.
-	if ($localtax1_type == '?')
-	{
-		if ($mysoc->country_code=='ES') $localtax1_type='1';
-		else $localtax1_type='0';
-	}
-	if ($localtax2_type == '?')
-	{
-		if ($mysoc->country_code=='ES') $localtax2_type='1';
-		else $localtax2_type='0';
-	}
+	if ($localtax1_type == '?')
+	{
+		if ($mysoc->country_code=='ES') $localtax1_type='1';
+		else $localtax1_type='0';
+	}
+	if ($localtax2_type == '?')
+	{
+		if ($mysoc->country_code=='ES') $localtax2_type='1';
+		else $localtax2_type='0';
+	}
 
 	// initialize total (may be HT or TTC depending on price_base_type)
 	$tot_sans_remise = $pu * $qty;
@@ -166,10 +166,10 @@ function calcul_price_total($qty, $pu, $remise_percent_ligne, $txtva, $localtax1
     $apply_tax = false;
     
     //If price is 'TTC' we need to have the totals without VAT for a correct calculation
-    if ($price_base_type=='TTC')
-    {
-    	$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
-    	$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
+    if ($price_base_type=='TTC')
+    {
+    	$tot_sans_remise= price2num($tot_sans_remise / (1 + ($txtva / 100)),'MU');
+    	$tot_avec_remise= price2num($tot_avec_remise / (1 + ($txtva / 100)),'MU');
     }
     
   	switch($localtax1_type) {
diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
index bd09ce8cd173b5b22640c06e16584180a3e15270..906a1a74e379e80aac99622eb48de1513268f9a0 100644
--- a/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_expedition_merou.modules.php
@@ -162,7 +162,7 @@ class pdf_expedition_merou extends ModelePdfExpedition
 				$pagenb=0;
 				$pdf->SetDrawColor(128,128,128);
 
-				$pdf->AliasNbPages();
+				$pdf->AliasNbPages();
 				
 				$pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
 				$pdf->SetSubject($outputlangs->transnoentities("Sending"));
@@ -182,9 +182,9 @@ class pdf_expedition_merou extends ModelePdfExpedition
 				$pdf->SetTextColor(0,0,0);
 
 				$tab_top = 52;
-				$tab_top_newpage = 10;
+				$tab_top_newpage = 10;
 				$tab_height = $this->page_hauteur - $tab_top - $heightforfooter;
-				$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
+				$tab_height_newpage = $this->page_hauteur - $tab_top_newpage - $heightforfooter;
 
 				$pdf->SetFillColor(240,240,240);
 				$pdf->SetTextColor(0,0,0);
@@ -219,13 +219,13 @@ class pdf_expedition_merou extends ModelePdfExpedition
 
 					$pdf->SetFont('','', $default_font_size - 3);
 
-					//Creation des cases a cocher
-					$pdf->Rect(10+3, $curY, 3, 3);
-					$pdf->Rect(20+3, $curY, 3, 3);
-					//Insertion de la reference du produit
-					$pdf->SetXY(30, $curY);
-					$pdf->SetFont('','B', $default_font_size - 3);
-					$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
+					//Creation des cases a cocher
+					$pdf->Rect(10+3, $curY, 3, 3);
+					$pdf->Rect(20+3, $curY, 3, 3);
+					//Insertion de la reference du produit
+					$pdf->SetXY(30, $curY);
+					$pdf->SetFont('','B', $default_font_size - 3);
+					$pdf->MultiCell(24, 3, $outputlangs->convToOutputCharset($object->lines[$i]->ref), 0, 'L', 0);
 						
 					$pdf->SetXY(140, $curY);
 					$pdf->MultiCell(30, 3, $object->lines[$i]->qty_asked, 0, 'C', 0);
@@ -269,16 +269,16 @@ class pdf_expedition_merou extends ModelePdfExpedition
 					}
 				}
 
-				// Show square
-				if ($pagenb == 1)
-				{
-					$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
-					$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
-				}
-				else
-				{
-					$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
-					$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
+				// Show square
+				if ($pagenb == 1)
+				{
+					$this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 0);
+					$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
+				}
+				else
+				{
+					$this->_tableau($pdf, $tab_top_newpage - 1, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 0);
+					$bottomlasttab=$this->page_hauteur - $heightforinfotot + 1;
 				}
 
 				// Pied de page
diff --git a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
index cd4af15d12117b6fc3bf1703714c5fdafe838f33..f30b676cfc05ebadfd88b6cd660c9c90509edc31 100644
--- a/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
+++ b/htdocs/core/modules/expedition/doc/pdf_expedition_rouget.modules.php
@@ -240,10 +240,10 @@ class pdf_expedition_rouget extends ModelePdfExpedition
 					$pdf->setPage($pageposbefore);
 					$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
 
-					// We suppose that a too long description is moved completely on next page
-					if ($pageposafter > $pageposbefore) {
-						$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
-					}
+					// We suppose that a too long description is moved completely on next page
+					if ($pageposafter > $pageposbefore) {
+						$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+					}
 						
 					$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
 
diff --git a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
index e71db402c7ac417698afe153fae4806c31b45a25..653ec0d4344a28cfac22633d5cec126871bf31ab 100644
--- a/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
+++ b/htdocs/core/modules/fichinter/doc/pdf_soleil.modules.php
@@ -243,8 +243,8 @@ class pdf_soleil extends ModelePDFFicheinter
 					{
 						$curY = $nexY;
 
-						$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot);	// The only function to edit the bottom margin of current page to set it.
-						$pageposbefore=$pdf->getPage();
+						$pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot);	// The only function to edit the bottom margin of current page to set it.
+						$pageposbefore=$pdf->getPage();
 						
 						$pdf->SetFont('','B', $default_font_size - 1);
 						$pdf->SetXY($this->marge_gauche, $curY);
@@ -273,16 +273,16 @@ class pdf_soleil extends ModelePDFFicheinter
 
 						$nexY+=2;    // Passe espace entre les lignes
 
-						$pageposafter=$pdf->getPage();
-						$pdf->setPage($pageposbefore);
-						$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
+						$pageposafter=$pdf->getPage();
+						$pdf->setPage($pageposbefore);
+						$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
 						
-						// We suppose that a too long description is moved completely on next page
-						if ($pageposafter > $pageposbefore) {
-							$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+						// We suppose that a too long description is moved completely on next page
+						if ($pageposafter > $pageposbefore) {
+							$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
 						}
 
-						$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
+						$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
 						
 						// Detect if some page were added automatically and output _tableau for past pages
 						while ($pagenb < $pageposafter)
diff --git a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
index 7f5a25550a4f06206fa7d766f80944d24d088945..eebe473fd1e5d741f07f3c6dfc2e7ff3d872c210 100644
--- a/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
+++ b/htdocs/core/modules/livraison/pdf/pdf_typhon.modules.php
@@ -254,9 +254,9 @@ class pdf_typhon extends ModelePDFDeliveryOrder
 					$pdf->setPage($pageposbefore);
 					$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
 
-					// We suppose that a too long description is moved completely on next page
-					if ($pageposafter > $pageposbefore) {
-						$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+					// We suppose that a too long description is moved completely on next page
+					if ($pageposafter > $pageposbefore) {
+						$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
 					}
 
 					$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
diff --git a/htdocs/core/modules/propale/doc/pdf_azur.modules.php b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
index 7cd7d972796948bc0672fe641318046f41549f7f..6213ed5fd3a4f08f688000512da288bc2021a430 100644
--- a/htdocs/core/modules/propale/doc/pdf_azur.modules.php
+++ b/htdocs/core/modules/propale/doc/pdf_azur.modules.php
@@ -36,21 +36,21 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  */
 class pdf_azur extends ModelePDFPropales
 {
-	var $db;
-	var $name;
-	var $description;
-	var $type;
-
-	var $phpmin = array(4,3,0); // Minimum version of PHP required by module
-	var $version = 'dolibarr';
-
-	var $page_largeur;
-	var $page_hauteur;
-	var $format;
-	var $marge_gauche;
-	var	$marge_droite;
-	var	$marge_haute;
-	var	$marge_basse;
+	var $db;
+	var $name;
+	var $description;
+	var $type;
+
+	var $phpmin = array(4,3,0); // Minimum version of PHP required by module
+	var $version = 'dolibarr';
+
+	var $page_largeur;
+	var $page_hauteur;
+	var $format;
+	var $marge_gauche;
+	var	$marge_droite;
+	var	$marge_haute;
+	var	$marge_basse;
 
 	var $emetteur;	// Objet societe qui emet
 
@@ -279,7 +279,7 @@ class pdf_azur extends ModelePDFPropales
 					// We suppose that a too long description is moved completely on next page
 					if ($pageposafter > $pageposbefore) {
 						$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
-					}
+					}
 
 					$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
 
@@ -1057,7 +1057,7 @@ class pdf_azur extends ModelePDFPropales
 			$pdf->SetXY($posx,$posy);
 			$pdf->SetFillColor(230,230,230);
 			$pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
-			$pdf->SetTextColor(0,0,60);
+			$pdf->SetTextColor(0,0,60);
 
 			// Show sender name
 			$pdf->SetXY($posx+2,$posy+3);
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 756d94726e5eaa3bd0bda0484e57a81667e26aab..652082cc57a1584a16909d2463c468e6fca40721 100755
--- a/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
+++ b/htdocs/core/modules/supplier_invoice/pdf/pdf_canelle.modules.php
@@ -273,10 +273,10 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
 					$pdf->setPage($pageposbefore);
 					$pdf->setPageOrientation('', 1, 0);	// The only function to edit the bottom margin of current page to set it.
 
-// We suppose that a too long description is moved completely on next page
-if ($pageposafter > $pageposbefore) {
-	$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
-}
+// We suppose that a too long description is moved completely on next page
+if ($pageposafter > $pageposbefore) {
+	$pdf->setPage($pageposafter); $curY = $tab_top_newpage;
+}
 					
 					$pdf->SetFont('','', $default_font_size - 1);   // On repositionne la police par defaut
 
diff --git a/htdocs/fourn/commande/index.php b/htdocs/fourn/commande/index.php
index 5d31d8317d79e6f00f518924d97b17c31ce8872e..a8281927c2b367b0675527d10d195b579300b987 100755
--- a/htdocs/fourn/commande/index.php
+++ b/htdocs/fourn/commande/index.php
@@ -348,7 +348,7 @@ if ($resql)
             $filename=dol_sanitizeFileName($obj->ref);
             $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
             $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-            $formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+            print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
             print '</td></tr></table>';
 
             print '</td>';
@@ -416,7 +416,7 @@ print '<td width="16" align="right" class="nobordernopadding">';
 $filename=dol_sanitizeFileName($obj->ref);
 $filedir=$conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
 $urlsource=$_SERVER['PHP_SELF'].'?id='.$obj->rowid;
-$formfile->show_documents('commande',$filename,$filedir,$urlsource,'','','',1,'',1);
+print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
 print '</td></tr></table>';
 
 print '</td>';
diff --git a/htdocs/holiday/admin/holiday.php b/htdocs/holiday/admin/holiday.php
index df5fdd523845e1e8b39ba7b2e7a528884bca86aa..b73694e187e1217cbcc2476d7125ad2b21bc9b91 100644
--- a/htdocs/holiday/admin/holiday.php
+++ b/htdocs/holiday/admin/holiday.php
@@ -33,8 +33,8 @@ require_once DOL_DOCUMENT_ROOT. '/user/class/usergroup.class.php';
 
 $action=GETPOST('action');
 
-$langs->load("admin");
-$langs->load("holiday");
+$langs->load("admin");
+$langs->load("holiday");
 
 // Si pas administrateur
 if (! $user->admin) accessforbidden();
diff --git a/htdocs/margin/admin/margin.php b/htdocs/margin/admin/margin.php
index 69d3c574dd0bc0aca85c673cf7c1b3b1afa29a82..f04cda7f072e296fc6a8474e564970ebeac63899 100644
--- a/htdocs/margin/admin/margin.php
+++ b/htdocs/margin/admin/margin.php
@@ -248,7 +248,7 @@ print '</form>';
 
 print '</table>';
 
-dol_fiche_end();
+dol_fiche_end();
 
 print '<br>';
 
diff --git a/htdocs/product/admin/product_extrafields.php b/htdocs/product/admin/product_extrafields.php
index 4d979c9e49322cbf88272052fc9712c4e0a8c89a..67dea9bb7a9a627f9b0eefd5f81ab5203984ca81 100755
--- a/htdocs/product/admin/product_extrafields.php
+++ b/htdocs/product/admin/product_extrafields.php
@@ -37,8 +37,8 @@ $extrafields = new ExtraFields($db);
 $form = new Form($db);
 
 // List of supported format
-$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
-$type2label=array('');
+$tmptype2label=getStaticMember(get_class($extrafields),'type2label');
+$type2label=array('');
 foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val);
 
 $action=GETPOST('action', 'alpha');