2
0
forked from Wavyzz/dolibarr

Revert "NEW enable free emails input with select2"

This commit is contained in:
Laurent Destailleur
2020-05-25 22:56:29 +02:00
committed by GitHub
parent 26eab1f285
commit d169162ef1
5 changed files with 19 additions and 54 deletions

View File

@@ -630,7 +630,7 @@ class FormMail extends Form
if (!empty($this->withto) || is_array($this->withto))
{
$out .= '<tr><td class="fieldrequired">';
if ($this->withtofree) $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseFreeEmailsForRecipients"));
if ($this->withtofree) $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
else $out .= $langs->trans("MailTo");
$out .= '</td><td>';
if ($this->withtoreadonly)
@@ -669,9 +669,15 @@ class FormMail extends Form
}
else
{
// The free input of email
if (!empty($this->withtofree))
{
$out .= '<input class="minwidth200" id="sendto" name="sendto" value="'.(($this->withtofree && !is_numeric($this->withtofree)) ? $this->withtofree : (!is_array($this->withto) && !is_numeric($this->withto) ? (isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto) : "")).'" />';
}
// The select combo
if (!empty($this->withto) && is_array($this->withto))
{
if (!empty($this->withtofree)) $out .= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withto;
foreach ($tmparray as $key => $val)
@@ -683,7 +689,7 @@ class FormMail extends Form
{
$withtoselected = array_keys($tmparray);
}
$out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', 0, '', '', 'email', '', -1, !empty($this->withtofree)?1:0);
$out .= $form->multiselectarray("receiver", $tmparray, $withtoselected, null, null, 'inline-block minwidth500', null, "");
}
}
$out .= "</td></tr>\n";
@@ -730,7 +736,7 @@ class FormMail extends Form
if (!empty($this->withtocc) || is_array($this->withtocc))
{
$out .= '<tr><td>';
$out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseFreeEmailsForRecipients"));
$out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients"));
$out .= '</td><td>';
if ($this->withtoccreadonly)
{
@@ -738,8 +744,10 @@ class FormMail extends Form
}
else
{
$out .= '<input class="minwidth200" id="sendtocc" name="sendtocc" value="'.(GETPOST("sendtocc", "alpha") ? GETPOST("sendtocc", "alpha") : ((!is_array($this->withtocc) && !is_numeric($this->withtocc)) ? $this->withtocc : '')).'" />';
if (!empty($this->withtocc) && is_array($this->withtocc))
{
$out .= " ".$langs->trans("and")."/".$langs->trans("or")." ";
// multiselect array convert html entities into options tags, even if we dont want this, so we encode them a second time
$tmparray = $this->withtocc;
foreach ($tmparray as $key => $val)
@@ -747,7 +755,7 @@ class FormMail extends Form
$tmparray[$key] = dol_htmlentities($tmparray[$key], null, 'UTF-8', true);
}
$withtoccselected = GETPOST("receivercc"); // Array of selected value
$out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', 0, '', '', 'email', '', -1, !empty($this->withtofree)?1:0);
$out .= $form->multiselectarray("receivercc", $tmparray, $withtoccselected, null, null, 'inline-block minwidth500', null, "");
}
}
$out .= "</td></tr>\n";