forked from Wavyzz/dolibarr
Convert sode to send member info email into new generic email template
system.
This commit is contained in:
@@ -238,6 +238,7 @@ if (empty($reshook))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
if ($action == 'confirm_sendinfo' && $confirm == 'yes')
|
if ($action == 'confirm_sendinfo' && $confirm == 'yes')
|
||||||
{
|
{
|
||||||
if ($object->email)
|
if ($object->email)
|
||||||
@@ -250,7 +251,7 @@ if (empty($reshook))
|
|||||||
$langs->load("mails");
|
$langs->load("mails");
|
||||||
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
|
setEventMessages($langs->trans("MailSuccessfulySent", $from, $object->email), null, 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
|
if ($action == 'update' && ! $cancel && $user->rights->adherent->creer)
|
||||||
{
|
{
|
||||||
@@ -1363,10 +1364,10 @@ else
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Confirm send card by mail
|
// Confirm send card by mail
|
||||||
if ($action == 'sendinfo')
|
/*if ($action == 'sendinfo')
|
||||||
{
|
{
|
||||||
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
|
print $form->formconfirm("card.php?rowid=".$id,$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail",$object->email),"confirm_sendinfo",'',0,1);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Confirm terminate
|
// Confirm terminate
|
||||||
if ($action == 'resign')
|
if ($action == 'resign')
|
||||||
@@ -1616,6 +1617,7 @@ else
|
|||||||
|
|
||||||
// Send card by email
|
// Send card by email
|
||||||
// TODO Remove this to replace with a template
|
// TODO Remove this to replace with a template
|
||||||
|
/*
|
||||||
if ($user->rights->adherent->creer)
|
if ($user->rights->adherent->creer)
|
||||||
{
|
{
|
||||||
if ($object->statut >= 1)
|
if ($object->statut >= 1)
|
||||||
@@ -1631,7 +1633,7 @@ else
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
print '<div class="inline-block divButAction"><font class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans("SendCardByMail")."</font></div>";
|
||||||
}
|
}*/
|
||||||
|
|
||||||
// Modify
|
// Modify
|
||||||
if ($user->rights->adherent->creer)
|
if ($user->rights->adherent->creer)
|
||||||
@@ -1790,11 +1792,10 @@ else
|
|||||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||||
|
|
||||||
// List of actions on element
|
// List of actions on element
|
||||||
/* Already in tab Agenda/Events
|
|
||||||
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php';
|
||||||
$formactions = new FormActions($db);
|
$formactions = new FormActions($db);
|
||||||
$somethingshown = $formactions->showactions($object, 'member', $socid, 1);
|
$somethingshown = $formactions->showactions($object, 'member', $socid, 1, 'listactions', 10);
|
||||||
*/
|
|
||||||
print '</div></div></div>';
|
print '</div></div></div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -213,51 +213,23 @@ class Adherent extends CommonObject
|
|||||||
|
|
||||||
// Substitutions
|
// Substitutions
|
||||||
$substitutionarray=array(
|
$substitutionarray=array(
|
||||||
'__DOL_MAIN_URL_ROOT__'=>DOL_MAIN_URL_ROOT,
|
'__CIVILITY__'=>$this->getCivilityLabel(),
|
||||||
'__ID__'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
||||||
'__CIVILITY__'=>$this->getCivilityLabel(),
|
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
||||||
'__FIRSTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
||||||
'__LASTNAME__'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
||||||
'__FULLNAME__'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
||||||
'__COMPANY__'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
||||||
'__ADDRESS__'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
'__TOWN__'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
||||||
'__ZIP__'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
||||||
'__TOWN_'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
||||||
'__COUNTRY__'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
||||||
'__EMAIL__'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
||||||
'__BIRTH__'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
||||||
'__PHOTO__'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
||||||
'__LOGIN__'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
'__PHONE__'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
||||||
'__PASSWORD__'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
'__PHONEPRO__'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
||||||
// For backward compatibility
|
'__PHONEMOBILE__'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
||||||
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
|
|
||||||
'%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
|
|
||||||
'%CIVILITY%'=>$this->getCivilityLabel(),
|
|
||||||
'%FIRSTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
|
||||||
'%LASTNAME%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
|
||||||
'%FULLNAME%'=>$msgishtml?dol_htmlentitiesbr($this->getFullName($langs)):$this->getFullName($langs),
|
|
||||||
'%COMPANY%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
|
||||||
'%ADDRESS%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
|
|
||||||
'%ZIP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
|
||||||
'%TOWN%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
|
||||||
'%COUNTRY%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
|
||||||
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
|
|
||||||
'%BIRTH%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
|
|
||||||
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
|
|
||||||
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
|
|
||||||
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass,
|
|
||||||
'%TYPE%'=>$msgishtml?dol_htmlentitiesbr($this->type):$this->type,
|
|
||||||
'%PHONE_PRO%'=>$msgishtml?dol_htmlentitiesbr($this->phone):$this->phone,
|
|
||||||
'%PHONE_PERSO%'=>$msgishtml?dol_htmlentitiesbr($this->phone_perso):$this->phone_perso,
|
|
||||||
'%PHONE_MOBILE%'=>$msgishtml?dol_htmlentitiesbr($this->phone_mobile):$this->phone_mobile,
|
|
||||||
// For backward compatibility
|
|
||||||
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
|
|
||||||
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
|
|
||||||
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
|
|
||||||
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
|
|
||||||
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
|
|
||||||
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
|
|
||||||
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
complete_substitutions_array($substitutionarray, $langs, $this);
|
complete_substitutions_array($substitutionarray, $langs, $this);
|
||||||
|
|||||||
@@ -360,6 +360,12 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO
|
|||||||
$subject=make_substitutions($subject, $substitutionarray);
|
$subject=make_substitutions($subject, $substitutionarray);
|
||||||
$message=make_substitutions($message, $substitutionarray);
|
$message=make_substitutions($message, $substitutionarray);
|
||||||
|
|
||||||
|
if (method_exists($object, 'makeSubstitution'))
|
||||||
|
{
|
||||||
|
$subject = $object->makeSubstitution($subject);
|
||||||
|
$message = $object->makeSubstitution($message);
|
||||||
|
}
|
||||||
|
|
||||||
// Send mail (substitutionarray must be done just before this)
|
// Send mail (substitutionarray must be done just before this)
|
||||||
if (empty($sendcontext)) $sendcontext = 'standard';
|
if (empty($sendcontext)) $sendcontext = 'standard';
|
||||||
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
|
$mailfile = new CMailFile($subject,$sendto,$from,$message,$filepath,$mimetype,$filename,$sendtocc,$sendtobcc,$deliveryreceipt,-1,'','',$trackid,'', $sendcontext);
|
||||||
|
|||||||
@@ -150,14 +150,14 @@ class FormActions
|
|||||||
/**
|
/**
|
||||||
* Show list of actions for element
|
* Show list of actions for element
|
||||||
*
|
*
|
||||||
* @param Object $object Object
|
* @param Object $object Object
|
||||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||||
* @param int $socid socid of user
|
* @param int $socid Socid of user
|
||||||
* @param int $forceshowtitle Show title even if there is no actions to show
|
* @param int $forceshowtitle Show title even if there is no actions to show
|
||||||
* @param string $morecss More css on table
|
* @param string $morecss More css on table
|
||||||
* @param int $max Max number of record
|
* @param int $max Max number of record
|
||||||
* @param string $moreparambacktopage More param for the backtopage
|
* @param string $moreparambacktopage More param for the backtopage
|
||||||
* @return int <0 if KO, >=0 if OK
|
* @return int <0 if KO, >=0 if OK
|
||||||
*/
|
*/
|
||||||
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
|
function showactions($object, $typeelement, $socid=0, $forceshowtitle=0, $morecss='listactions', $max=0, $moreparambacktopage='')
|
||||||
{
|
{
|
||||||
@@ -175,17 +175,18 @@ class FormActions
|
|||||||
$num = count($listofactions);
|
$num = count($listofactions);
|
||||||
if ($num || $forceshowtitle)
|
if ($num || $forceshowtitle)
|
||||||
{
|
{
|
||||||
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
if ($typeelement == 'invoice') $title=$langs->trans('ActionsOnBill');
|
||||||
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
elseif ($typeelement == 'invoice_supplier' || $typeelement == 'supplier_invoice') $title=$langs->trans('ActionsOnBill');
|
||||||
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
elseif ($typeelement == 'propal') $title=$langs->trans('ActionsOnPropal');
|
||||||
elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment');
|
elseif ($typeelement == 'supplier_payment') $title=$langs->trans('ActionsOnSupplierPayment');
|
||||||
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
|
elseif ($typeelement == 'supplier_proposal') $title=$langs->trans('ActionsOnSupplierProposal');
|
||||||
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
elseif ($typeelement == 'order') $title=$langs->trans('ActionsOnOrder');
|
||||||
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
elseif ($typeelement == 'order_supplier' || $typeelement == 'supplier_order') $title=$langs->trans('ActionsOnOrder');
|
||||||
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
elseif ($typeelement == 'shipping') $title=$langs->trans('ActionsOnShipping');
|
||||||
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
elseif ($typeelement == 'fichinter') $title=$langs->trans('ActionsOnFicheInter');
|
||||||
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
elseif ($typeelement == 'project') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||||
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
elseif ($typeelement == 'task') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||||
|
elseif ($typeelement == 'member') $title=$langs->trans('LatestLinkedEvents', $max?$max:'');
|
||||||
else $title=$langs->trans("Actions");
|
else $title=$langs->trans("Actions");
|
||||||
|
|
||||||
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
|
$urlbacktopage=$_SERVER['PHP_SELF'].'?id='.$object->id.($moreparambacktopage?'&'.$moreparambacktopage:'');
|
||||||
|
|||||||
@@ -339,16 +339,25 @@ class FormMail extends Form
|
|||||||
$modelmail_array=array();
|
$modelmail_array=array();
|
||||||
foreach($this->lines_model as $line)
|
foreach($this->lines_model as $line)
|
||||||
{
|
{
|
||||||
$modelmail_array[$line->id]=$line->label;
|
$langs->trans("members");
|
||||||
|
if (preg_match('/\((.*)\)/', $line->label, $reg))
|
||||||
|
{
|
||||||
|
$modelmail_array[$line->id]=$langs->trans($reg[1]); // langs->trans when label is __(xxx)__
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$modelmail_array[$line->id]=$line->label;
|
||||||
|
}
|
||||||
if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')';
|
if ($line->lang) $modelmail_array[$line->id].=' ('.$line->lang.')';
|
||||||
if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private");
|
if ($line->private) $modelmail_array[$line->id].=' - '.$langs->trans("Private");
|
||||||
//if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' ';
|
//if ($line->fk_user != $user->id) $modelmail_array[$line->id].=' - '.$langs->trans("By").' ';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Zone to select its email template
|
// Zone to select email template
|
||||||
if (count($modelmail_array)>0)
|
if (count($modelmail_array)>0)
|
||||||
{
|
{
|
||||||
|
// If list of template is filled
|
||||||
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||||
$out.= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
$out.= '<span class="opacitymedium">'.$langs->trans('SelectMailModel').':</span> '.$this->selectarray('modelmailselected', $modelmail_array, 0, 1, 0, 0, '', 0, 0, 0, '', 'minwidth100');
|
||||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
||||||
@@ -363,6 +372,7 @@ class FormMail extends Form
|
|||||||
'invoice_supplier_send','thirdparty','contract','all'
|
'invoice_supplier_send','thirdparty','contract','all'
|
||||||
)))
|
)))
|
||||||
{
|
{
|
||||||
|
// If list of template is empty
|
||||||
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
$out.= '<div class="center" style="padding: 0px 0 12px 0">'."\n";
|
||||||
$out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
|
$out.= $langs->trans('SelectMailModel').': <select name="modelmailselected" disabled="disabled"><option value="none">'.$langs->trans("NoTemplateDefined").'</option></select>'; // Do not put 'disabled' on 'option' tag, it is already on 'select' and it makes chrome crazy.
|
||||||
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
if ($user->admin) $out.= info_admin($langs->trans("YouCanChangeValuesForThisListFrom", $langs->transnoentitiesnoconv('Setup').' - '.$langs->transnoentitiesnoconv('EMails')),1);
|
||||||
@@ -1020,7 +1030,7 @@ class FormMail extends Form
|
|||||||
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
$sql = "SELECT rowid, label, topic, content, content_lines, lang, fk_user, private, position";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
$sql.= " FROM ".MAIN_DB_PREFIX.'c_email_templates';
|
||||||
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
$sql.= " WHERE type_template IN ('".$this->db->escape($type_template)."', 'all')";
|
||||||
$sql.= " AND entity IN (".getEntity('c_email_templates', 0).")";
|
$sql.= " AND entity IN (".getEntity('c_email_templates', 1).")";
|
||||||
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
$sql.= " AND (private = 0 OR fk_user = ".$user->id.")"; // See all public templates or templates I own.
|
||||||
if ($active >= 0) $sql.=" AND active = ".$active;
|
if ($active >= 0) $sql.=" AND active = ".$active;
|
||||||
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
//if (is_object($outputlangs)) $sql.= " AND (lang = '".$outputlangs->defaultlang."' OR lang IS NULL OR lang = '')"; // Return all languages
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ function getEntity($element, $shared=1)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
$out='';
|
$out='';
|
||||||
$addzero = array('user', 'usergroup', 'email_template', 'default_values');
|
$addzero = array('user', 'usergroup', 'c_email_templates', 'email_template', 'default_values');
|
||||||
if (in_array($element, $addzero)) $out.= '0,';
|
if (in_array($element, $addzero)) $out.= '0,';
|
||||||
$out.= $conf->entity;
|
$out.= $conf->entity;
|
||||||
return $out;
|
return $out;
|
||||||
@@ -5240,6 +5240,10 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
|||||||
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
|
$substitutionarray['__THIRDPARTY_ID__'] = '__THIRDPARTY_ID__';
|
||||||
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
|
$substitutionarray['__THIRDPARTY_NAME__'] = '__THIRDPARTY_NAME__';
|
||||||
|
|
||||||
|
$substitutionarray['__MEMBER_CIVILITY__'] = '__MEMBER_CIVILITY__';
|
||||||
|
$substitutionarray['__MEMBER_FIRSTNAME__'] = '__MEMBER_FIRSTNAME__';
|
||||||
|
$substitutionarray['__MEMBER_LASTNAME__'] = '__MEMBER_LASTNAME__';
|
||||||
|
|
||||||
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
$substitutionarray['__PROJECT_ID__'] = '__PROJECT_ID__';
|
||||||
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
$substitutionarray['__PROJECT_REF__'] = '__PROJECT_REF__';
|
||||||
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_REF__';
|
$substitutionarray['__PROJECT_NAME__'] = '__PROJECT_REF__';
|
||||||
@@ -5263,6 +5267,27 @@ function getCommonSubstitutionArray($outputlangs, $onlykey=0, $exclude=null, $ob
|
|||||||
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : ''));
|
$substitutionarray['__REFCLIENT__'] = (isset($object->ref_client) ? $object->ref_client : (isset($object->ref_customer) ? $object->ref_customer : ''));
|
||||||
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : '');
|
$substitutionarray['__REFSUPPLIER__'] = (isset($object->ref_supplier) ? $object->ref_supplier : '');
|
||||||
|
|
||||||
|
// TODO USe this ?
|
||||||
|
$msgishtml = 0;
|
||||||
|
|
||||||
|
if (method_exists($object, 'getCivilityLabel')) $substitutionarray['__MEMBER_CIVILITY__'] = $object->getCivilityLabel();
|
||||||
|
$substitutionarray['__MEMBER_FIRSTNAME__']=$msgishtml?dol_htmlentitiesbr($object->firstname):$object->firstname;
|
||||||
|
$substitutionarray['__MEMBER_LASTNAME__']=$msgishtml?dol_htmlentitiesbr($object->lastname):$object->lastname;
|
||||||
|
if (method_exists($object, 'getFullName')) $substitutionarray['__MEMBER_FULLNAME__']=$msgishtml?dol_htmlentitiesbr($object->getFullName($langs)):$object->getFullName($langs);
|
||||||
|
$substitutionarray['__MEMBER_COMPANY__']=$msgishtml?dol_htmlentitiesbr($object->societe):$object->societe;
|
||||||
|
$substitutionarray['__MEMBER_ADDRESS__']=$msgishtml?dol_htmlentitiesbr($object->address):$object->address;
|
||||||
|
$substitutionarray['__MEMBER_ZIP__']=$msgishtml?dol_htmlentitiesbr($object->zip):$object->zip;
|
||||||
|
$substitutionarray['__MEMBER_TOWN__']=$msgishtml?dol_htmlentitiesbr($object->town):$object->town;
|
||||||
|
$substitutionarray['__MEMBER_COUNTRY__']=$msgishtml?dol_htmlentitiesbr($object->country):$object->country;
|
||||||
|
$substitutionarray['__MEMBER_EMAIL__']=$msgishtml?dol_htmlentitiesbr($object->email):$object->email;
|
||||||
|
$substitutionarray['__MEMBER_BIRTH__']=$msgishtml?dol_htmlentitiesbr($birthday):$birthday;
|
||||||
|
$substitutionarray['__MEMBER_PHOTO__']=$msgishtml?dol_htmlentitiesbr($object->photo):$object->photo;
|
||||||
|
$substitutionarray['__MEMBER_LOGIN__']=$msgishtml?dol_htmlentitiesbr($object->login):$object->login;
|
||||||
|
$substitutionarray['__MEMBER_PASSWORD__']=$msgishtml?dol_htmlentitiesbr($object->pass):$object->pass;
|
||||||
|
$substitutionarray['__MEMBER_PHONE__']=$msgishtml?dol_htmlentitiesbr($object->phone):$object->phone;
|
||||||
|
$substitutionarray['__MEMBER_PHONEPRO__']=$msgishtml?dol_htmlentitiesbr($object->phone_perso):$object->phone_perso;
|
||||||
|
$substitutionarray['__MEMBER_PHONEMOBILE__']=$msgishtml?dol_htmlentitiesbr($object->phone_mobile):$object->phone_mobile;
|
||||||
|
|
||||||
if (is_object($object->thirdparty) && $object->thirdparty->id > 0)
|
if (is_object($object->thirdparty) && $object->thirdparty->id > 0)
|
||||||
{
|
{
|
||||||
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
|
$substitutionarray['__THIRDPARTY_ID__'] = (is_object($object->thirdparty)?$object->thirdparty->id:'');
|
||||||
|
|||||||
@@ -149,27 +149,6 @@ if ($action == 'presend')
|
|||||||
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
$substitutionarray['__PERSONALIZED__'] = ''; // deprecated
|
||||||
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
$substitutionarray['__CONTACTCIVNAME__'] = '';
|
||||||
|
|
||||||
// Choose one contact for the __CONTACTCIVNAME__ TODO Really not reliable.
|
|
||||||
/*
|
|
||||||
$custcontact = '';
|
|
||||||
$contactarr = array();
|
|
||||||
$contactarr = $object->liste_contact(-1, 'external');
|
|
||||||
if (is_array($contactarr) && count($contactarr) > 0)
|
|
||||||
{
|
|
||||||
foreach ($contactarr as $contact)
|
|
||||||
{
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (! empty($custcontact)) {
|
|
||||||
$formmail->substit['__CONTACTCIVNAME__'] = $custcontact;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$parameters = array(
|
$parameters = array(
|
||||||
'mode' => 'formemail'
|
'mode' => 'formemail'
|
||||||
);
|
);
|
||||||
|
|||||||
23
htdocs/install/mysql/data/llx_c_email_templates.sql
Normal file
23
htdocs/install/mysql/data/llx_c_email_templates.sql
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
-- Copyright (C) 2017 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
|
--
|
||||||
|
-- This program is free software; you can redistribute it and/or modify
|
||||||
|
-- it under the terms of the GNU General Public License as published by
|
||||||
|
-- the Free Software Foundation; either version 3 of the License, or
|
||||||
|
-- (at your option) any later version.
|
||||||
|
--
|
||||||
|
-- This program is distributed in the hope that it will be useful,
|
||||||
|
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
-- GNU General Public License for more details.
|
||||||
|
--
|
||||||
|
-- You should have received a copy of the GNU General Public License
|
||||||
|
-- along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
--
|
||||||
|
--
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Ne pas placer de commentaire en fin de ligne, ce fichier est parsé lors
|
||||||
|
-- de l'install et tous les sigles '--' sont supprimés.
|
||||||
|
--
|
||||||
|
|
||||||
|
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__<br />\n__(ID)__ : __ID__<br />\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br />\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br />\n__(Lastname)__ : __MEMBER_LASTNAME__<br />\n__(Fullname)__ : __MEMBER_FULLNAME__<br />\n__(Company)__ : __MEMBER_COMPANY__<br />\n__(Address)__ : __MEMBER_ADDRESS__<br />\n__(Zip)__ : __MEMBER_ZIP__<br />\n__(Town)__ : __MEMBER_TOWN__<br />\n__(Country)__ : __MEMBER_COUNTRY__<br />\n__(Email)__ : __MEMBER_EMAIL__<br />\n__(Birthday)__ : __MEMBER_BIRTH__<br />\n__(Photo)__ : __MEMBER_PHOTO__<br />\n__(Login)__ : __MEMBER_LOGIN__<br />\n__(Password)__ : __MEMBER_PASSWORD__<br />\n__(Phone)__ : __MEMBER_PHONE__<br />\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br />\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null);
|
||||||
@@ -66,6 +66,8 @@ ALTER TABLE llx_contrat MODIFY COLUMN ref_ext varchar(50);
|
|||||||
|
|
||||||
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
UPDATE llx_c_email_templates SET position = 0 WHERE position IS NULL;
|
||||||
|
|
||||||
|
INSERT INTO llx_c_email_templates (entity,module,type_template,lang,private,fk_user,datec,label,position,active,topic,content,content_lines) VALUES (0,null,'member',null,0,null,null,'(SendAnEMailToMember)',1,1,'__(CardContent)__','__(ThisIsContentOfYourCard)__<br />\n__(ID)__ : __ID__<br />\n__(Civiliyty)__ : __MEMBER_CIVILITY__<br />\n__(Firstname)__ : __MEMBER_FIRSTNAME__<br />\n__(Lastname)__ : __MEMBER_LASTNAME__<br />\n__(Fullname)__ : __MEMBER_FULLNAME__<br />\n__(Company)__ : __MEMBER_COMPANY__<br />\n__(Address)__ : __MEMBER_ADDRESS__<br />\n__(Zip)__ : __MEMBER_ZIP__<br />\n__(Town)__ : __MEMBER_TOWN__<br />\n__(Country)__ : __MEMBER_COUNTRY__<br />\n__(Email)__ : __MEMBER_EMAIL__<br />\n__(Birthday)__ : __MEMBER_BIRTH__<br />\n__(Photo)__ : __MEMBER_PHOTO__<br />\n__(Login)__ : __MEMBER_LOGIN__<br />\n__(Password)__ : __MEMBER_PASSWORD__<br />\n__(Phone)__ : __MEMBER_PHONE__<br />\n__(PhonePerso)__ : __MEMBER_PHONEPRO__<br />\n__(PhoneMobile)__ : __MEMBER_PHONEMOBILE__',null);
|
||||||
|
|
||||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);
|
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 1, 'VENTES', 'Income of products/services', 'Exemple: 7xxxxx', 0, 0, '', '10', 1, 1);
|
||||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1);
|
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 2, 'DEPENSES', 'Expenses of products/services', 'Exemple: 6xxxxx', 0, 0, '', '20', 1, 1);
|
||||||
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'PROFIT', 'Balance', '', 0, 1, 'VENTES+DEPENSES', '30', 1, 1);
|
INSERT INTO llx_c_accounting_category (rowid, code, label, range_account, sens, category_type, formula, position, fk_country, active) VALUES ( 3, 'PROFIT', 'Balance', '', 0, 1, 'VENTES+DEPENSES', '30', 1, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user