mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-05 09:08:09 +01:00
Merge pull request #9099 from ATM-Nicolas/7.0
NEW Set contactCivName substitution key
This commit is contained in:
@@ -193,6 +193,21 @@ if ($action == 'presend')
|
||||
);
|
||||
complete_substitutions_array($substitutionarray, $outputlangs, $object, $parameters);
|
||||
|
||||
// Find the good contact adress
|
||||
$custcontact = '';
|
||||
$contactarr = array();
|
||||
$contactarr = $object->liste_contact(- 1, 'external');
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
$contactstatic = new Contact($db);
|
||||
|
||||
foreach ($contactarr as $contact) {
|
||||
$contactstatic->fetch($contact['id']);
|
||||
$substitutionarray['__CONTACT_NAME_'.$contact['code'].'__'] = $contactstatic->getFullName($langs, 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Tableau des substitutions
|
||||
$formmail->substit = $substitutionarray;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user