Fix encoding with select2

This commit is contained in:
Laurent Destailleur 2017-11-03 16:29:23 +01:00
parent a346a1a5e9
commit c479efa480
3 changed files with 12 additions and 8 deletions

View File

@ -224,6 +224,8 @@ if ($object->fetch($id) >= 0)
dol_fiche_end();
print '<br>';
$allowaddtarget=($object->statut == 0);

View File

@ -116,12 +116,13 @@ if ($action == 'presend')
}
$formmail->withfrom = 1;
// Fill list of recipient with email inside <>.
$liste = array();
if ($object->element == 'expensereport')
{
$fuser = new User($db);
$fuser->fetch($object->fk_user_author);
$liste['thirdparty'] = $fuser->getFullName($langs)." &lt;".$fuser->email."&gt;";
$liste['thirdparty'] = $fuser->getFullName($langs)." <".$fuser->email.">";
}
elseif ($object->element == 'societe')
{
@ -131,7 +132,7 @@ if ($action == 'presend')
}
elseif ($object->element == 'user' || $object->element == 'member')
{
$liste['thirdparty'] = $object->getFullName($langs)." &lt;".$object->email."&gt;";
$liste['thirdparty'] = $object->getFullName($langs)." <".$object->email.">";
}
else
{

View File

@ -2087,7 +2087,7 @@ class Societe extends CommonObject
if ($this->email && $addthirdparty)
{
if (empty($this->name)) $this->name=$this->nom;
$contact_emails['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." &lt;".$this->email."&gt;";
$contact_emails['thirdparty']=$langs->transnoentitiesnoconv("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->email.">";
}
//var_dump($contact_emails)
return $contact_emails;
@ -2108,7 +2108,7 @@ class Societe extends CommonObject
{
if (empty($this->name)) $this->name=$this->nom;
// TODO: Tester si tel non deja present dans tableau contact
$contact_phone['thirdparty']=$langs->trans("ThirdParty").': '.dol_trunc($this->name,16)." &lt;".$this->phone."&gt;";
$contact_phone['thirdparty']=$langs->transnoentitiesnoconv("ThirdParty").': '.dol_trunc($this->name,16)." <".$this->phone.">";
}
return $contact_phone;
}
@ -2118,7 +2118,7 @@ class Societe extends CommonObject
*
* @param string $mode 'email' or 'mobile'
* @param int $hidedisabled 1=Hide contact if disabled
* @return array Array of contacts emails or mobile array(id=>'Name <email>')
* @return array Array of contacts emails or mobile. Example: array(id=>'Name <email>')
*/
function contact_property_array($mode='email', $hidedisabled=0)
{
@ -2140,7 +2140,8 @@ class Societe extends CommonObject
$sepa="("; $sepb=")";
if ($mode == 'email')
{
$sepa="&lt;"; $sepb="&gt;";
//$sepa="&lt;"; $sepb="&gt;";
$sepa="<"; $sepb=">";
}
$i = 0;
while ($i < $nump)
@ -2155,8 +2156,8 @@ class Societe extends CommonObject
{
if (empty($property))
{
if ($mode == 'email') $property=$langs->trans("NoEMail");
else if ($mode == 'mobile') $property=$langs->trans("NoMobilePhone");
if ($mode == 'email') $property=$langs->transnoentitiesnoconv("NoEMail");
else if ($mode == 'mobile') $property=$langs->transnoentitiesnoconv("NoMobilePhone");
}
if (!empty($obj->poste))