FIX Default value on form to send email

This commit is contained in:
Laurent Destailleur 2019-05-02 15:34:29 +02:00
parent 79754eb326
commit 8d7f24a6d9
2 changed files with 3 additions and 3 deletions

View File

@ -711,7 +711,7 @@ class FormMail extends Form
}
else
{
$out.= '<input class="minwidth200" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />';
$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")." ";
@ -762,7 +762,7 @@ class FormMail extends Form
}
else
{
$out.= '<input class="minwidth200" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />';
$out.= '<input class="minwidth200" id="sendtoccc" name="sendtoccc" value="'.(GETPOST("sendtoccc", "alpha") ? GETPOST("sendtoccc", "alpha") : ((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc)) ? $this->withtoccc : '')).'" />';
if (! empty($this->withtoccc) && is_array($this->withtoccc))
{
$out.= " ".$langs->trans("and")."/".$langs->trans("or")." ";

View File

@ -349,7 +349,7 @@ function GETPOST($paramname, $check='none', $method=0, $filter=null, $options=nu
}
if (! empty($conf->global->MAIN_ENABLE_DEFAULT_VALUES))
{
if (! empty($_GET['action']) && $_GET['action'] == 'create' && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
if (! empty($_GET['action']) && (preg_match('/^create/', $_GET['action']) || preg_match('/^presend/', $_GET['action'])) && ! isset($_GET[$paramname]) && ! isset($_POST[$paramname]))
{
// Now search in setup to overwrite default values
if (! empty($user->default_values)) // $user->default_values defined from menu 'Setup - Default values'