Merge pull request #23618 from ATM-Consulting/FIX_16.0_fieldvalue_emailtemplate
FIX : Empty FormSetup emailTemplate type IF empty fieldvalue
This commit is contained in:
commit
3aec1289f8
@ -1069,16 +1069,18 @@ class FormSetupItem
|
|||||||
} elseif ($this->type == 'yesno') {
|
} elseif ($this->type == 'yesno') {
|
||||||
$out.= ajax_constantonoff($this->confKey);
|
$out.= ajax_constantonoff($this->confKey);
|
||||||
} elseif (preg_match('/emailtemplate:/', $this->type)) {
|
} elseif (preg_match('/emailtemplate:/', $this->type)) {
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
if ($this->fieldValue > 0) {
|
||||||
$formmail = new FormMail($this->db);
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
|
||||||
|
$formmail = new FormMail($this->db);
|
||||||
|
|
||||||
$tmp = explode(':', $this->type);
|
$tmp = explode(':', $this->type);
|
||||||
|
|
||||||
$template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
|
$template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
|
||||||
if ($template<0) {
|
if ($template<0) {
|
||||||
$this->setErrors($formmail->errors);
|
$this->setErrors($formmail->errors);
|
||||||
|
}
|
||||||
|
$out.= $this->langs->trans($template->label);
|
||||||
}
|
}
|
||||||
$out.= $this->langs->trans($template->label);
|
|
||||||
} elseif (preg_match('/category:/', $this->type)) {
|
} elseif (preg_match('/category:/', $this->type)) {
|
||||||
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
$c = new Categorie($this->db);
|
$c = new Categorie($this->db);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user