NEW : Contact substitutions keys
This commit is contained in:
parent
170a668b2b
commit
de8fd3d12c
@ -173,18 +173,28 @@ if ($action == 'presend')
|
|||||||
$contactarr = $object->liste_contact(- 1, 'external');
|
$contactarr = $object->liste_contact(- 1, 'external');
|
||||||
|
|
||||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
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) {
|
foreach ($contactarr as $contact) {
|
||||||
if (in_array($contact['code'], array('BILLING'))) {
|
switch($contact['code']) {
|
||||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
case 'BILLING':
|
||||||
|
$contactstatic->fetch($contact['id']);
|
||||||
$contactstatic = new Contact($db);
|
$substitutionarray['__CONTACT_NAME_BILLING__'] = $contactstatic->getFullName($langs, 1);
|
||||||
$contactstatic->fetch($contact['id']);
|
break;
|
||||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
case 'CUSTOMER':
|
||||||
}
|
$contactstatic->fetch($contact['id']);
|
||||||
}
|
$substitutionarray['__CONTACT_NAME_CUSTOMER__'] = $contactstatic->getFullName($langs, 1);
|
||||||
|
break;
|
||||||
if (! empty($custcontact)) {
|
case 'SHIPPING':
|
||||||
$substitutionarray['__CONTACTCIVNAME__'] = $custcontact;
|
$contactstatic->fetch($contact['id']);
|
||||||
|
$substitutionarray['__CONTACT_NAME_SHIPPING__'] = $contactstatic->getFullName($langs, 1);
|
||||||
|
break;
|
||||||
|
case 'SERVICE':
|
||||||
|
$contactstatic->fetch($contact['id']);
|
||||||
|
$substitutionarray['__CONTACT_NAME_SERVICE__'] = $contactstatic->getFullName($langs, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user