From fd62d2df87e7b095e75bdab63322bd0b35b41362 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 16 Dec 2022 16:01:06 +0100 Subject: [PATCH] Debug v17 --- htdocs/core/class/html.formmailing.class.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/htdocs/core/class/html.formmailing.class.php b/htdocs/core/class/html.formmailing.class.php index 9c74cb1203a..7ae13608e6a 100644 --- a/htdocs/core/class/html.formmailing.class.php +++ b/htdocs/core/class/html.formmailing.class.php @@ -32,18 +32,19 @@ class FormMailing extends Form */ public $errors = array(); + /** * Output a select with destinaries status * - * @param string $selectedid The selected id - * @param string $htmlname Name of controm - * @param integer $show_empty Show empty option - * @return string HTML select + * @param string $selectedid The selected id + * @param string $htmlname Name of controm + * @param integer $show_empty Show empty option + * @return string HTML select */ public function selectDestinariesStatus($selectedid = '', $htmlname = 'dest_status', $show_empty = 0) { - global $langs; + $langs->load("mails"); require_once DOL_DOCUMENT_ROOT.'/comm/mailing/class/mailing.class.php'; @@ -51,12 +52,9 @@ class FormMailing extends Form $options = array(); - if ($show_empty) { - $options[-2] = ''; // Note -1 is used for error - } - $options = $options + $mailing->statut_dest; - return Form::selectarray($htmlname, $options, $selectedid, 0, 0, 0, '', 1); + // Note -1 is used for error, so we use -2 for tempty value + return Form::selectarray($htmlname, $options, $selectedid, ($show_empty ? -2 : 0), 0, 0, '', 1); } }