Fix email template for test

This commit is contained in:
Laurent Destailleur 2018-06-13 17:03:46 +02:00
parent cfa69fe93f
commit 03b6bec8b8
2 changed files with 4 additions and 3 deletions

View File

@ -1046,7 +1046,7 @@ class FormMail extends Form
* This search into table c_email_templates. Used by the get_form function. * This search into table c_email_templates. Used by the get_form function.
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $type_template Get message for type=$type_template, type='all' also included. * @param string $type_template Get message for model/type=$type_template, type='all' also included.
* @param string $user Get template public or limited to this user * @param string $user Get template public or limited to this user
* @param Translate $outputlangs Output lang object * @param Translate $outputlangs Output lang object
* @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found) * @param int $id Id of template to find, or -1 for first found with position 0, or 0 for first found whatever is position (priority order depends on lang provided or not) or -2 for exact match with label (no answer if not found)
@ -1100,7 +1100,8 @@ class FormMail extends Form
} }
else { // If there is no template at all else { // If there is no template at all
$defaultmessage=''; $defaultmessage='';
if ($type_template=='facture_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoice"); } if ($type_template=='body') { $defaultmessage=$this->withbody; } // Special case to use this->withbody as content
elseif ($type_template=='facture_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoice"); }
elseif ($type_template=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } elseif ($type_template=='facture_relance') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendInvoiceReminder"); }
elseif ($type_template=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); } elseif ($type_template=='propal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendProposal"); }
elseif ($type_template=='supplier_proposal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierProposal"); } elseif ($type_template=='supplier_proposal_send') { $defaultmessage=$outputlangs->transnoentities("PredefinedMailContentSendSupplierProposal"); }