Fix fieldvalue emailtemplate

This commit is contained in:
GregM 2023-01-18 12:10:58 +01:00
parent af7570a2cd
commit 1d50acb3cf

View File

@ -1069,6 +1069,7 @@ 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)) {
if ($this->fieldValue > 0){
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($this->db); $formmail = new FormMail($this->db);
@ -1079,6 +1080,7 @@ class FormSetupItem
$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);