New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or
content template.
This commit is contained in:
parent
e77be9e529
commit
1751b58ef8
@ -33,6 +33,7 @@ For users:
|
||||
Differentiate text and img.
|
||||
Use label into quick search form.
|
||||
Use accesskey on form search.
|
||||
- New: Can add __PROJECT_REF__ and __TIHRPARTY_NAME__ into email topic or content template.
|
||||
- Fix: [ bug #1487 ] PAYMENT_DELETE trigger does not intercept trigger action
|
||||
- Fix: [ bug #1470, #1472, #1473] User trigger problem
|
||||
- Fix: [ bug #1489, #1491 ] Intervention trigger problem
|
||||
|
||||
@ -2289,6 +2289,8 @@ if ($action == 'create') {
|
||||
*/
|
||||
if ($action == 'presend')
|
||||
{
|
||||
$object->fetch_projet();
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
@ -2341,7 +2343,7 @@ if ($action == 'create') {
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->trans('SendPropalRef', '__PROPREF__ (__REFCLIENT__)');
|
||||
}
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
@ -2352,6 +2354,8 @@ if ($action == 'create') {
|
||||
$formmail->substit ['__PROPREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -2362,7 +2366,7 @@ if ($action == 'create') {
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_propal_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
|
||||
@ -2431,6 +2431,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
*/
|
||||
if ($action == 'presend')
|
||||
{
|
||||
$object->fetch_projet();
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
@ -2483,7 +2485,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->trans('SendOrderRef', '__ORDERREF__ (__REFCLIENT__)');
|
||||
}
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
@ -2493,6 +2495,8 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
$formmail->substit ['__ORDERREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -2502,7 +2506,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_commande_external_CUSTOMER')) { // TODO Use code and not label
|
||||
$contactstatic = new Contact($db);
|
||||
$contactstatic->fetch($contact ['id']);
|
||||
$custcontact = $contactstatic->getFullName($langs, 1);
|
||||
|
||||
@ -3638,11 +3638,15 @@ if ($action == 'create')
|
||||
$somethingshown = $formactions->showactions($object, 'invoice', $socid);
|
||||
|
||||
print '</div></div></div>';
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Affiche formulaire mail
|
||||
* Action presend (or prerelance)
|
||||
*/
|
||||
|
||||
$object->fetch_projet();
|
||||
|
||||
// By default if $action=='presend'
|
||||
$titreform = 'SendBillByMail';
|
||||
$topicmail = 'SendBillRef';
|
||||
@ -3710,8 +3714,9 @@ if ($action == 'create')
|
||||
if (empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__');
|
||||
} else if (! empty($object->ref_client)) {
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__(__REFCLIENT__)');
|
||||
$formmail->withtopic = $outputlangs->transnoentities($topicmail, '__FACREF__ (__REFCLIENT__)');
|
||||
}
|
||||
|
||||
$formmail->withfile = 2;
|
||||
$formmail->withbody = 1;
|
||||
$formmail->withdeliveryreceipt = 1;
|
||||
@ -3720,6 +3725,8 @@ if ($action == 'create')
|
||||
$formmail->substit ['__FACREF__'] = $object->ref;
|
||||
$formmail->substit ['__SIGNATURE__'] = $user->signature;
|
||||
$formmail->substit ['__REFCLIENT__'] = $object->ref_client;
|
||||
$formmail->substit ['__THIRPARTY_NAME__'] = $object->thirdparty->name;
|
||||
$formmail->substit ['__PROJECT_REF__'] = (is_object($object->projet)?$object->projet->ref:'');
|
||||
$formmail->substit ['__PERSONALIZED__'] = '';
|
||||
$formmail->substit ['__CONTACTCIVNAME__'] = '';
|
||||
|
||||
@ -3730,7 +3737,7 @@ if ($action == 'create')
|
||||
|
||||
if (is_array($contactarr) && count($contactarr) > 0) {
|
||||
foreach ($contactarr as $contact) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) {
|
||||
if ($contact ['libelle'] == $langs->trans('TypeContact_facture_external_BILLING')) { // TODO Use code and not label
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user