浏览代码

Debug v17

Laurent Destailleur 2 年之前
父节点
当前提交
fd62d2df87
共有 1 个文件被更改,包括 8 次插入10 次删除
  1. 8 10
      htdocs/core/class/html.formmailing.class.php

+ 8 - 10
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);
 	}
 }