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); } }