FIX #yogosha21416

This commit is contained in:
Laurent Destailleur
2024-03-14 23:39:16 +01:00
parent d8e1bf8844
commit fd4fa05313

View File

@@ -1,10 +1,10 @@
<?php
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Pierre Chéné <pierre.chene44@gmail.com>
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
/* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2018 Pierre Chéné <pierre.chene44@gmail.com>
* Copyright (C) 2019 Cedric Ancelin <icedo.anc@gmail.com>
* Copyright (C) 2020-2024 Frédéric France <frederic.france@free.fr>
* Copyright (C) 2023 Alexandre Janniaux <alexandre.janniaux@gmail.com>
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -49,7 +49,7 @@ class Thirdparties extends DolibarrApi
*/
public function __construct()
{
global $db, $conf;
global $db;
$this->db = $db;
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
@@ -258,7 +258,7 @@ class Thirdparties extends DolibarrApi
continue;
}
$this->company->$field = $value;
$this->company->$field = $this->_checkValForAPI($field, $value, $this->company);
}
if ($this->company->create(DolibarrApiAccess::$user) < 0) {
@@ -303,7 +303,7 @@ class Thirdparties extends DolibarrApi
continue;
}
$this->company->$field = $value;
$this->company->$field = $this->_checkValForAPI($field, $value, $this->company);
}
if (isModEnabled('mailing') && !empty($this->company->email) && isset($this->company->no_email)) {