FIX : Set contactCivName substitution key
This commit is contained in:
parent
aeb5f5e4f3
commit
170a668b2b
@ -167,6 +167,27 @@ 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) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if (in_array($contact['code'], array('BILLING'))) {
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (! empty($custcontact)) {
|
||||
$substitutionarray['__CONTACTCIVNAME__'] = $custcontact;
|
||||
}
|
||||
}
|
||||
|
||||
// Tableau des substitutions
|
||||
$formmail->substit = $substitutionarray;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user