Fix: If showempty is 0 and empty, do not show button.

This commit is contained in:
Laurent Destailleur
2014-06-24 23:43:53 +02:00
parent 54f55cf03e
commit f64f0d6933

View File

@@ -482,7 +482,7 @@ class FormFile
// Language code (if multilang) // Language code (if multilang)
$out.= '<th align="center" class="formdoc liste_titre">'; $out.= '<th align="center" class="formdoc liste_titre">';
if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang) if (($allowgenifempty || (is_array($modellist) && count($modellist) > 0)) && $conf->global->MAIN_MULTILANGS && ! $forcenomultilang && (! empty($modellist) || $showempty))
{ {
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php'; include_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
$formadmin=new FormAdmin($this->db); $formadmin=new FormAdmin($this->db);
@@ -508,6 +508,7 @@ class FormFile
$genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated"));
} }
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton='';
if (empty($modellist) && ! $showempty) $genbutton='';
$out.= $genbutton; $out.= $genbutton;
$out.= '</th>'; $out.= '</th>';