Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-03-31 14:22:18 +02:00
commit ea7e4c6f8a

View File

@ -182,54 +182,56 @@ class Adherent extends CommonObject
* @param string $text Text to make substitution to * @param string $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->lastname."\n"; $infos.= $langs->transnoentities("id").": ".$this->id."\n";
$infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n"; $infos.= $langs->transnoentities("Lastname").": ".$this->lastname."\n";
$infos.= $langs->transnoentities("Company").": ".$this->societe."\n"; $infos.= $langs->transnoentities("Firstname").": ".$this->firstname."\n";
$infos.= $langs->transnoentities("Address").": ".$this->address."\n"; $infos.= $langs->transnoentities("Company").": ".$this->societe."\n";
$infos.= $langs->transnoentities("Zip").": ".$this->zip."\n"; $infos.= $langs->transnoentities("Address").": ".$this->address."\n";
$infos.= $langs->transnoentities("Town").": ".$this->town."\n"; $infos.= $langs->transnoentities("Zip").": ".$this->zip."\n";
$infos.= $langs->transnoentities("Country").": ".$this->country."\n"; $infos.= $langs->transnoentities("Town").": ".$this->town."\n";
$infos.= $langs->transnoentities("EMail").": ".$this->email."\n"; $infos.= $langs->transnoentities("Country").": ".$this->country."\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
$substitutionarray=array( // Substitutions
'%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT, $substitutionarray=array(
'%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos, '%DOL_MAIN_URL_ROOT%'=>DOL_MAIN_URL_ROOT,
'%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1), '%ID%'=>$msgishtml?dol_htmlentitiesbr($this->id):$this->id,
'%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname, '%INFOS%'=>$msgishtml?dol_htmlentitiesbr($infos):$infos,
'%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname, '%CIVILITE%'=>$this->getCivilityLabel($msgishtml?0:1),
'%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe, '%PRENOM%'=>$msgishtml?dol_htmlentitiesbr($this->firstname):$this->firstname,
'%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address, '%NOM%'=>$msgishtml?dol_htmlentitiesbr($this->lastname):$this->lastname,
'%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip, '%SOCIETE%'=>$msgishtml?dol_htmlentitiesbr($this->societe):$this->societe,
'%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town, '%ADRESSE%'=>$msgishtml?dol_htmlentitiesbr($this->address):$this->address,
'%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country, '%CP%'=>$msgishtml?dol_htmlentitiesbr($this->zip):$this->zip,
'%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email, '%VILLE%'=>$msgishtml?dol_htmlentitiesbr($this->town):$this->town,
'%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday, '%PAYS%'=>$msgishtml?dol_htmlentitiesbr($this->country):$this->country,
'%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo, '%EMAIL%'=>$msgishtml?dol_htmlentitiesbr($this->email):$this->email,
'%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login, '%NAISS%'=>$msgishtml?dol_htmlentitiesbr($birthday):$birthday,
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass '%PHOTO%'=>$msgishtml?dol_htmlentitiesbr($this->photo):$this->photo,
); '%LOGIN%'=>$msgishtml?dol_htmlentitiesbr($this->login):$this->login,
'%PASSWORD%'=>$msgishtml?dol_htmlentitiesbr($this->pass):$this->pass
complete_substitutions_array($substitutionarray, $langs); );
return make_substitutions($text,$substitutionarray); complete_substitutions_array($substitutionarray, $langs);
}
return make_substitutions($text,$substitutionarray);
}
/** /**