Merge branch '17.0' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur
2023-01-26 02:32:08 +01:00
23 changed files with 235 additions and 145 deletions

View File

@@ -21,7 +21,6 @@
*/
class FormSetup
{
/**
* @var DoliDB Database handler.
*/
@@ -1082,16 +1081,18 @@ class FormSetupItem
}
}
} elseif (preg_match('/emailtemplate:/', $this->type)) {
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formmail.class.php';
$formmail = new FormMail($this->db);
if ($this->fieldValue > 0) {
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);
if (is_numeric($template) && $template < 0) {
$this->setErrors($formmail->errors);
$template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
if (is_numeric($template) && $template < 0) {
$this->setErrors($formmail->errors);
}
$out.= $this->langs->trans($template->label);
}
$out.= $this->langs->trans($template->label);
} elseif (preg_match('/category:/', $this->type)) {
require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
$c = new Categorie($this->db);
@@ -1117,6 +1118,7 @@ class FormSetupItem
}
} elseif ($this->type == 'product') {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
$product = new Product($this->db);
$resprod = $product->fetch($this->fieldValue);
if ($resprod > 0) {