From f64f0d6933755776cdea8004b10ecec5dd5fd17c Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 24 Jun 2014 23:43:53 +0200 Subject: [PATCH] Fix: If showempty is 0 and empty, do not show button. --- htdocs/core/class/html.formfile.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php index d139f235fd9..9ce484e5d43 100644 --- a/htdocs/core/class/html.formfile.class.php +++ b/htdocs/core/class/html.formfile.class.php @@ -482,7 +482,7 @@ class FormFile // Language code (if multilang) $out.= ''; - 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'; $formadmin=new FormAdmin($this->db); @@ -508,6 +508,7 @@ class FormFile $genbutton.= ' '.img_warning($langs->transnoentitiesnoconv("WarningNoDocumentModelActivated")); } if (! $allowgenifempty && ! is_array($modellist) && empty($modellist) && empty($conf->dol_no_mouse_hover) && $modulepart != 'unpaid') $genbutton=''; + if (empty($modellist) && ! $showempty) $genbutton=''; $out.= $genbutton; $out.= '';