Debug v17

This commit is contained in:
Laurent Destailleur 2022-12-16 16:01:06 +01:00
parent c13fefa09c
commit fd62d2df87

View File

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