diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 92dceb77464..a3c1ed0acd9 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -201,13 +201,13 @@ class FormFile
// filedir = $conf->...->dir_ouput."/".get_exdir(id)
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
-
+
// For backward compatibility
if (! empty($iconPDF)) {
return $this->getDocumentsLink($modulepart, $filename, $filedir);
}
$printer = ($user->rights->printipp->read && $conf->printipp->enabled)?true:false;
-
+
$forname='builddoc';
$out='';
$var=true;
@@ -441,15 +441,17 @@ class FormFile
// Button
$out.= '
';
- $out.= '';
+ $genbutton = '';
if ($allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid')
{
- $langs->load("errors");
- $out.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
+ $langs->load("errors");
+ $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
}
+ if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
+ $out.= $genbutton;
$out.= ' | ';
if ($printer) $out.= ' | ';
diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php
index 356001648c3..19da5101422 100644
--- a/htdocs/societe/soc.php
+++ b/htdocs/societe/soc.php
@@ -1793,7 +1793,6 @@ else
}
print ''."\n";
- print '
';
if (empty($conf->global->SOCIETE_DISABLE_BUILDDOC))
{
@@ -1821,6 +1820,8 @@ else
print '
';
}
+ print '
';
+
// Subsidiaries list
$result=show_subsidiaries($conf,$langs,$db,$object);