mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-07 17:42:53 +01:00
Add hidden option SUPPLIER_PROPOSAL_AUTOADD_USER_CONTACT (#33524)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
@@ -1542,6 +1542,13 @@ class SupplierProposal extends CommonObject
|
||||
$this->datev = $now;
|
||||
$this->date_validation = $now;
|
||||
|
||||
if (getDolGlobalString('SUPPLIER_PROPOSAL_AUTOADD_USER_CONTACT')) {
|
||||
$result = $this->add_contact($user->id, 'SALESREPFOLL', 'internal', 1);
|
||||
if ($result < 0 && $result != -2) { // -2 means already exists
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
|
||||
$this->db->commit();
|
||||
return 1;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user