2
0
forked from Wavyzz/dolibarr

Fix: add member ID in substitution method

This commit is contained in:
Regis Houssin
2012-03-31 16:12:48 +08:00
parent a56e1a0e97
commit fcf45c978d

View File

@@ -173,54 +173,56 @@ class Adherent extends CommonObject
* @param text Text to make substitution to * @param text Text to make substitution to
* @return string Value of input text string with substitutions done * @return string Value of input text string with substitutions done
*/ */
function makeSubstitution($text) function makeSubstitution($text)
{ {
global $langs; global $langs;
$birthday = dol_print_date($this->naiss,'day'); $birthday = dol_print_date($this->naiss,'day');
$msgishtml = 0; $msgishtml = 0;
if (dol_textishtml($text,1)) $msgishtml = 1; if (dol_textishtml($text,1)) $msgishtml = 1;
$infos=''; $infos='';
if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n"; if ($this->civilite_id) $infos.= $langs->transnoentities("UserTitle").": ".$this->getCivilityLabel(1)."\n";
$infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->nom."\n";
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->prenom."\n";
$infos.= $langs->transnoentities("Address").": ".$this->adresse."\n"; $infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
$infos.= $langs->transnoentities("Zip").": ".$this->cp."\n"; $infos.= $langs->transnoentities("Address").": ".$this->adresse."\n";
$infos.= $langs->transnoentities("Town").": ".$this->ville."\n"; $infos.= $langs->transnoentities("Zip").": ".$this->cp."\n";
$infos.= $langs->transnoentities("Country").": ".$this->pays."\n"; $infos.= $langs->transnoentities("Town").": ".$this->ville."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; $infos.= $langs->transnoentities("Country").": ".$this->pays."\n";
$infos.= $langs->transnoentities("Login").": ".$this->login."\n"; $infos.= $langs->transnoentities("EMail").": ".$this->email."\n";
$infos.= $langs->transnoentities("Password").": ".$this->pass."\n"; $infos.= $langs->transnoentities("Login").": ".$this->login."\n";
$infos.= $langs->transnoentities("Birthday").": ".$birthday."\n"; $infos.= $langs->transnoentities("Password").": ".$this->pass."\n";
$infos.= $langs->transnoentities("Photo").": ".$this->photo."\n"; $infos.= $langs->transnoentities("Birthday").": ".$birthday."\n";
$infos.= $langs->transnoentities("Public").": ".yn($this->public); $infos.= $langs->transnoentities("Photo").": ".$this->photo."\n";
$infos.= $langs->transnoentities("Public").": ".yn($this->public);
// Substitutions // Substitutions
$substitutionarray=array( $substitutionarray=array(
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1), '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom, '%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom, '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->prenom):$this->prenom,
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->nom):$this->nom,
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp, '%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->adresse):$this->adresse,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville, '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->cp):$this->cp,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays, '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->ville):$this->ville,
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->pays):$this->pays,
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, '%NAISS%'=>$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,
); '%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
);
complete_substitutions_array($substitutionarray, $langs); complete_substitutions_array($substitutionarray, $langs);
return make_substitutions($text,$substitutionarray); return make_substitutions($text,$substitutionarray);
} }
/** /**