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

This commit is contained in:
Laurent Destailleur 2023-01-26 02:16:47 +01:00
commit ba21d9ff83
3 changed files with 13 additions and 11 deletions

View File

@ -1069,16 +1069,18 @@ class FormSetupItem
} elseif ($this->type == 'yesno') {
$out.= ajax_constantonoff($this->confKey);
} 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 ($template<0) {
$this->setErrors($formmail->errors);
$template = $formmail->getEMailTemplate($this->db, $tmp[1], $user, $this->langs, $this->fieldValue);
if ($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);
@ -1103,6 +1105,9 @@ class FormSetupItem
$out.= $this->langs->trans("NorProspectNorCustomer");
}
} elseif ($this->type == 'product') {
if (!class_exists("Product")) {
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
}
$product = new Product($this->db);
$resprod = $product->fetch($this->fieldValue);
if ($resprod > 0) {

View File

@ -2940,7 +2940,7 @@ if ($action == 'create') {
}
if (isset($objectidnext) && $objectidnext > 0) {
$facthatreplace = new FactureFournisseur($db);
$facthatreplace->fetch($facidnext);
$facthatreplace->fetch($objectidnext);
print ' ('.$langs->transnoentities("ReplacedByInvoice", $facthatreplace->getNomUrl(1)).')';
}
if ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE || $object->type == FactureFournisseur::TYPE_DEPOSIT) {

View File

@ -55,9 +55,6 @@ global $langs, $user;
// Libraries
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
require_once '../lib/mymodule.lib.php';
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
//require_once "../class/myclass.class.php";
// Translations