25
edits
(Add Chinese) Tag: 2017 source edit |
m (→For Emails: Précisions sur les variables __UNSUBSCRIBE__ et __CHECK_READ__ spécifiques aux emailings) |
||
| (11 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
<!-- BEGIN interlang links --> | <!-- BEGIN origin interlang links --> | ||
<!-- | <!-- You can edit this section but do NOT remove these comments | ||
Links below | Links below will be automatically replicated on translated pages by PolyglotBot --> | ||
[[fr:Système_de_substitution_de_variables]] | [[fr:Système_de_substitution_de_variables]] | ||
[[zh:变量替换系统]] | [[zh:变量替换系统]] | ||
| Line 95: | Line 94: | ||
|contact@mycompany.com | |contact@mycompany.com | ||
|My company contact email | |My company contact email | ||
| | |||
|- | |||
|__MYCOMPANY_PHONE__ | |||
|0123456789 | |||
|My company phone number | |||
| | |||
|- | |||
|__MYCOMPANY_FAX__ | |||
|0123456789 | |||
|My company fax number | |||
| | | | ||
|- | |- | ||
| Line 238: | Line 247: | ||
|__DATE_YMD__ | |__DATE_YMD__ | ||
|1/1/2020 | |1/1/2020 | ||
| | |Object date | ||
| | | | ||
|- | |- | ||
| Line 252: | Line 261: | ||
|- | |- | ||
|__AMOUNT_TEXT__ | |__AMOUNT_TEXT__ | ||
|One | |One thousand five hundred ... | ||
|Amount in words | |Amount in words | ||
|V13 | |V13 | ||
|- | |- | ||
|__AMOUNT_TEXTCURRENCY__ | |__AMOUNT_TEXTCURRENCY__ | ||
|One | |One thousand five hundred ... | ||
|Amount in words with currency | |Amount in words with currency | ||
|V13 | |V13 | ||
| Line 272: | Line 281: | ||
|- | |- | ||
|__AMOUNT_VAT_TEXT__ | |__AMOUNT_VAT_TEXT__ | ||
|One | |One thousand five hundred ... | ||
|VAT Amount in words | |VAT Amount in words | ||
|V13 | |V13 | ||
|- | |- | ||
|__AMOUNT_VAT_TEXTCURRENCY__ | |__AMOUNT_VAT_TEXTCURRENCY__ | ||
|One | |One thousand five hundred ... | ||
|VAT Amount in words with currency | |VAT Amount in words with currency | ||
|V13 | |V13 | ||
| Line 860: | Line 869: | ||
|Address of the Online Signature for proposal | |Address of the Online Signature for proposal | ||
|15 | |15 | ||
|- | |||
|} | |||
* | |||
==Online Intervention Signature== | |||
* | |||
{| class="wikitable sortable" style="width: 85%;" | |||
|+ | |||
!Variable | |||
!Displayed Value | |||
!Note | |||
!Dolibarr Mini | |||
|- | |||
|__ONLINE_SIGN_FICHINTER_URL__ | |||
|[https://mydoli.com/public/onlinesign http://mydoli.com/public/onlinesign] | |||
|Address of the Online Signature for intervention | |||
| | |||
|- | |- | ||
|} | |} | ||
| Line 889: | Line 918: | ||
|http://mydoli.com/invoice.pdf | |http://mydoli.com/invoice.pdf | ||
|Direct download url of an invoice. This needs that the setup INVOICE_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link. | |Direct download url of an invoice. This needs that the setup INVOICE_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link. | ||
| | |||
|- | |||
|__DIRECTDOWNLOAD_URL_FICHINTER__ | |||
|http://mydoli.com/fichinter.pdf | |||
|Direct download url of an intervention. This needs that the setup FICHINTER_ALLOW_EXTERNAL_DOWNLOAD is set to allow to generate the link. | |||
| | | | ||
|- | |- | ||
| Line 903: | Line 937: | ||
|__URL_INVOICE__ | |__URL_INVOICE__ | ||
|http://mydoli.com/compta/facture/card.php?id=xxx | |http://mydoli.com/compta/facture/card.php?id=xxx | ||
| | | | ||
| | |||
|- | |||
|__URL_FICHINTER__ | |||
| | |||
| | |||
| | | | ||
|} | |} | ||
| Line 1,113: | Line 1,152: | ||
|__CHECK_READ__ | |__CHECK_READ__ | ||
| | | | ||
| | |In emailings, insert a blank image with a callback URL to Dolibarr (/public/emailing/mailing-read.php?tag=) | ||
| | |||
|- | |||
|__UNSUBSCRIBE__ | |||
| | |||
|In emailings, insert a link to allow a recipient to unsubscribe from emailings. If the recipient (third party or contact) unsubscribes, his status will change to "Refuse bulk emailings" | |||
To setup the wording of: | |||
- the mention in your email for unsubscribing: Translation (key : MailUnsubcribe) | |||
- the landing page after unsubscribing: Translation (key: YourMailUnsubcribeOK) | |||
| | | | ||
|} | |} | ||
| Line 1,119: | Line 1,168: | ||
* | * | ||
= | =Substitution variables provide by external module= | ||
Custom substitution variables can be added by external modules. | Custom substitution variables can be added by external modules. | ||
For this, the external module must embed a file called '''mymodule/core/substitutions/functions_mymodules.lib.php''' | For this, the external module must embed a file called '''mymodule/core/substitutions/functions_mymodules.lib.php''' and set the | ||
<code>$this->module_parts['substitutions'] = 1 </code> | |||
into the module descriptor. | |||
=How it work= | |||
The array to define all substitution variables is defined in code by calling the method | |||
<code>$substitutionarray = getCommonSubstitutionArray().</code> | |||
This method receive the $object in parameter, so it can define the content of the substitution array using properties of this object. No database access and no IO are allowed to set the substitution array. | |||
Then the array will be used by calling the make_substitutions() this way: | |||
<code>$textcompleted = make_substitutions($textwithsubtitutionkeys, $substitutionarray)</code> | |||
However, sometimes to value to use is not available into the $object, neither into the environment, and it needs a database access to get the value. | |||
In such a case, the substitution is not done by the getCommonSubstitutionArray(). The getCommonSubstitutionArray() will just add an entry into the array of substitution with the information to explain how to get the value like for this entry: | |||
<code>$substitutionarray['__PROJECT_NAME__@lazyload'] = '/projet/class/project.class.php:Project:fetchAndSetSubstitution:'.$object->id</code> | |||
The substitution will be done by the make_substitutions() and only it is required by calling the method defined (here fetchAndSetSubstitution with the param $object->id of the object Project defined into file /projet/class/project.class.php). | |||
Thus, the heavy database access is done only if required. | |||
edits