Fix: encryption of special char of contacts
This commit is contained in:
parent
7ad8b95295
commit
52dfed2d53
@ -742,7 +742,7 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Return full name (name+' '+lastname)
|
* \brief Return full name (name+' '+lastname)
|
||||||
* \param langs Lang for output
|
* \param langs Lang object for output
|
||||||
* \param option 0=No option, 1=Add civility
|
* \param option 0=No option, 1=Add civility
|
||||||
* \param nameorder 0=Lastname+Firstname, 1=Firstname+Lastname
|
* \param nameorder 0=Lastname+Firstname, 1=Firstname+Lastname
|
||||||
* \return string String with full name
|
* \return string String with full name
|
||||||
@ -758,13 +758,15 @@ class Contact extends CommonObject
|
|||||||
|
|
||||||
if ($nameorder)
|
if ($nameorder)
|
||||||
{
|
{
|
||||||
if ($this->firstname) $ret.=$this->firstname.' ';
|
if ($this->firstname) $ret.=$langs->convToOutputCharset($this->firstname);
|
||||||
if ($this->name) $ret.=$this->name.' ';
|
if ($this->firstname && $this->name) $ret.=' ';
|
||||||
|
if ($this->name) $ret.=$langs->convToOutputCharset($this->name);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if ($this->name) $ret.=$this->name.' ';
|
if ($this->name) $ret.=$langs->convToOutputCharset($this->name);
|
||||||
if ($this->firstname) $ret.=$this->firstname.' ';
|
if ($this->firstname && $this->name) $ret.=' ';
|
||||||
|
if ($this->firstname) $ret.=$langs->convToOutputCharset($this->firstname);
|
||||||
}
|
}
|
||||||
return trim($ret);
|
return trim($ret);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -869,11 +869,11 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
||||||
|
|
||||||
// Nom client
|
// Customer name
|
||||||
$carac_client = "\n".$outputlangs->convToOutputCharset($object->contact->getFullName($outputlangs,1,1));
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
// Caract<EFBFBD>ristiques client
|
// Customer properties
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->adresse);
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
//Pays si different de l'emetteur
|
//Pays si different de l'emetteur
|
||||||
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
||||||
@ -883,7 +883,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Nom client
|
// Customer name
|
||||||
$pdf->SetXY(102,$posy+3);
|
$pdf->SetXY(102,$posy+3);
|
||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
||||||
@ -896,7 +896,7 @@ class pdf_einstein extends ModelePDFCommandes
|
|||||||
// On v<>rifie si c'est une soci<63>t<EFBFBD> ou un particulier
|
// On v<>rifie si c'est une soci<63>t<EFBFBD> ou un particulier
|
||||||
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
||||||
{
|
{
|
||||||
$carac_client .= "\n".$outputlangs->convToOutputCharset($object->contact->getFullName($outputlangs,1,1));
|
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1077,6 +1077,7 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
// Cadre client destinataire
|
// Cadre client destinataire
|
||||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||||
|
|
||||||
|
|
||||||
// If BILLING contact defined on invoice, we use it
|
// If BILLING contact defined on invoice, we use it
|
||||||
$usecontact=false;
|
$usecontact=false;
|
||||||
if ($conf->global->FACTURE_USE_BILL_CONTACT_AS_RECIPIENT)
|
if ($conf->global->FACTURE_USE_BILL_CONTACT_AS_RECIPIENT)
|
||||||
@ -1094,21 +1095,15 @@ class pdf_crabe extends ModelePDFFactures
|
|||||||
$pdf->SetXY(102,$posy+3);
|
$pdf->SetXY(102,$posy+3);
|
||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
// On peut utiliser le nom de la societe du contact facturation
|
// On peut utiliser le nom de la societe du contact facturation
|
||||||
if ($conf->global->FACTURE_USE_COMPANY_NAME_OF_BILL_CONTACT)
|
if ($conf->global->FACTURE_USE_COMPANY_NAME_OF_BILL_CONTACT) $socname = $object->contact->socname;
|
||||||
{
|
else $socname = $object->client->nom;
|
||||||
$socname = $object->contact->socname;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$socname = $object->client->nom;
|
|
||||||
}
|
|
||||||
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($socname), 0, 'L');
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($socname), 0, 'L');
|
||||||
|
|
||||||
// Nom client
|
// Customer name
|
||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
// Caracteristiques client
|
// Customer properties
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->adresse);
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
//Pays si different de l'emetteur
|
//Pays si different de l'emetteur
|
||||||
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
||||||
|
|||||||
@ -845,12 +845,12 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
|
|
||||||
$pdf->SetXY($this->marge_gauche+2,$posy+3);
|
$pdf->SetXY($this->marge_gauche+2,$posy+3);
|
||||||
|
|
||||||
// Nom emetteur
|
// Customer name
|
||||||
$pdf->SetTextColor(0,0,60);
|
$pdf->SetTextColor(0,0,60);
|
||||||
$pdf->SetFont('Arial','B',11);
|
$pdf->SetFont('Arial','B',11);
|
||||||
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L');
|
$pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->nom), 0, 'L');
|
||||||
|
|
||||||
// Caracteristiques emetteur
|
// Customer properties
|
||||||
$carac_emetteur = '';
|
$carac_emetteur = '';
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->adresse);
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->adresse);
|
||||||
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->cp).' '.$outputlangs->convToOutputCharset($this->emetteur->ville);
|
$carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->convToOutputCharset($this->emetteur->cp).' '.$outputlangs->convToOutputCharset($this->emetteur->ville);
|
||||||
@ -879,7 +879,9 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
// Cadre client destinataire
|
// Cadre client destinataire
|
||||||
$pdf->rect(100, $posy, 100, $hautcadre);
|
$pdf->rect(100, $posy, 100, $hautcadre);
|
||||||
|
|
||||||
// If BILLING contact defined on invoice, we use it
|
|
||||||
|
// If BILLING contact defined, we use it
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
$usecontact=false;
|
$usecontact=false;
|
||||||
if ($conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT)
|
if ($conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT)
|
||||||
{
|
{
|
||||||
@ -890,7 +892,6 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$result=$object->fetch_contact($arrayidcontact[0]);
|
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($usecontact)
|
if ($usecontact)
|
||||||
{
|
{
|
||||||
// Nom societe
|
// Nom societe
|
||||||
@ -902,7 +903,7 @@ class pdf_propale_azur extends ModelePDFPropales
|
|||||||
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
// Caractéristiques client
|
// Caractéristiques client
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->adresse);
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
//Pays si different de l'emetteur
|
//Pays si different de l'emetteur
|
||||||
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
||||||
|
|||||||
@ -348,6 +348,8 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
|
|
||||||
function _pagehead(&$pdf, $propale, $outputlangs)
|
function _pagehead(&$pdf, $propale, $outputlangs)
|
||||||
{
|
{
|
||||||
|
global $conf,$langs;
|
||||||
|
|
||||||
//Affiche le filigrane brouillon - Print Draft Watermark
|
//Affiche le filigrane brouillon - Print Draft Watermark
|
||||||
if($propale->statut==0 && defined("PROPALE_DRAFT_WATERMARK") )
|
if($propale->statut==0 && defined("PROPALE_DRAFT_WATERMARK") )
|
||||||
{
|
{
|
||||||
@ -394,17 +396,7 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
$pdf->SetTextColor(0,0,200);
|
$pdf->SetTextColor(0,0,200);
|
||||||
$pdf->MultiCell(200, 20, $outputlangs->transnoentities("CommercialProposal"), '' , 'C');
|
$pdf->MultiCell(200, 20, $outputlangs->transnoentities("CommercialProposal"), '' , 'C');
|
||||||
|
|
||||||
/*
|
// Cadre client destinataire
|
||||||
* Adresse Client
|
|
||||||
*/
|
|
||||||
$pdf->SetTextColor(0,0,0);
|
|
||||||
$pdf->SetFont('Arial','B',12);
|
|
||||||
$propale->fetch_client();
|
|
||||||
$pdf->SetXY(102,42);
|
|
||||||
$pdf->MultiCell(96,5, $outputlangs->convToOutputCharset($propale->client->nom));
|
|
||||||
$pdf->SetFont('Arial','B',11);
|
|
||||||
$pdf->SetXY(102,$pdf->GetY());
|
|
||||||
$pdf->MultiCell(96,5, $outputlangs->convToOutputCharset($propale->client->adresse) . "\n" . $outputlangs->convToOutputCharset($propale->client->cp) . " " . $outputlangs->convToOutputCharset($propale->client->ville));
|
|
||||||
$pdf->rect(100, 40, 100, 40);
|
$pdf->rect(100, 40, 100, 40);
|
||||||
|
|
||||||
$pdf->SetTextColor(200,0,0);
|
$pdf->SetTextColor(200,0,0);
|
||||||
@ -417,6 +409,80 @@ class pdf_propale_jaune extends ModelePDFPropales
|
|||||||
$pdf->MultiCell(110, 10, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($propale->ref));
|
$pdf->MultiCell(110, 10, $outputlangs->transnoentities("Ref")." : ".$outputlangs->convToOutputCharset($propale->ref));
|
||||||
$pdf->SetXY(110,90);
|
$pdf->SetXY(110,90);
|
||||||
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dolibarr_print_date($propale->date,'day',false,$outputlangs));
|
$pdf->MultiCell(100, 10, $outputlangs->transnoentities("Date")." : " . dolibarr_print_date($propale->date,'day',false,$outputlangs));
|
||||||
|
|
||||||
|
|
||||||
|
$posy=39;
|
||||||
|
|
||||||
|
$object=$propale;
|
||||||
|
$object->fetch_client();
|
||||||
|
|
||||||
|
|
||||||
|
// If BILLING contact defined, we use it
|
||||||
|
$pdf->SetTextColor(0,0,0);
|
||||||
|
$usecontact=false;
|
||||||
|
if ($conf->global->PROPALE_USE_CUSTOMER_CONTACT_AS_RECIPIENT)
|
||||||
|
{
|
||||||
|
$arrayidcontact=$object->getIdContact('external','CUSTOMER');
|
||||||
|
if (sizeof($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$usecontact=true;
|
||||||
|
$result=$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ($usecontact)
|
||||||
|
{
|
||||||
|
// Nom societe
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
||||||
|
|
||||||
|
// Nom client
|
||||||
|
$carac_client = "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
|
||||||
|
// Caractéristiques client
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->address);
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->contact->cp) . " " . $outputlangs->convToOutputCharset($object->contact->ville)."\n";
|
||||||
|
//Pays si different de l'emetteur
|
||||||
|
if ($this->emetteur->pays_code != $object->contact->pays_code)
|
||||||
|
{
|
||||||
|
$carac_client.=$outputlangs->convToOutputCharset($object->contact->pays)."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Nom client
|
||||||
|
$pdf->SetXY(102,$posy+3);
|
||||||
|
$pdf->SetFont('Arial','B',11);
|
||||||
|
$pdf->MultiCell(96,4, $outputlangs->convToOutputCharset($object->client->nom), 0, 'L');
|
||||||
|
|
||||||
|
// Nom du contact suivi propal si c'est une société
|
||||||
|
$arrayidcontact = $object->getIdContact('external','CUSTOMER');
|
||||||
|
if (sizeof($arrayidcontact) > 0)
|
||||||
|
{
|
||||||
|
$object->fetch_contact($arrayidcontact[0]);
|
||||||
|
// On vérifie si c'est une société ou un particulier
|
||||||
|
if( !preg_match('#'.$object->contact->getFullName($outputlangs,1).'#isU',$object->client->nom) )
|
||||||
|
{
|
||||||
|
$carac_client .= "\n".$object->contact->getFullName($outputlangs,1,1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Caractéristiques client
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->adresse);
|
||||||
|
$carac_client.="\n".$outputlangs->convToOutputCharset($object->client->cp) . " " . $outputlangs->convToOutputCharset($object->client->ville)."\n";
|
||||||
|
|
||||||
|
//Pays si different de l'emetteur
|
||||||
|
if ($this->emetteur->pays_code != $object->client->pays_code)
|
||||||
|
{
|
||||||
|
$carac_client.=$outputlangs->convToOutputCharset($object->client->pays)."\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Numéro TVA intracom
|
||||||
|
if ($object->client->tva_intra) $carac_client.="\n".$outputlangs->transnoentities("VATIntraShort").': '.$object->client->tva_intra;
|
||||||
|
$pdf->SetFont('Arial','',9);
|
||||||
|
$posy=$pdf->GetY()-9; //Auto Y coord readjust for multiline name
|
||||||
|
$pdf->SetXY(102,$posy+6);
|
||||||
|
$pdf->MultiCell(86,4, $carac_client);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -378,10 +378,10 @@ class Translate {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Retourne la version traduite du texte pass<EFBFBD> en param<EFBFBD>tre
|
* \brief Return translated value of a text string
|
||||||
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
* Si il n'y a pas de correspondance pour ce texte, on cherche dans fichier alternatif
|
||||||
* et si toujours pas trouv<EFBFBD>, il est retourn<EFBFBD> tel quel.
|
* et si toujours pas trouve, il est retourne tel quel.
|
||||||
* Les param<EFBFBD>tres de cette m<EFBFBD>thode ne doivent pas contenir de balises HTML.
|
* Parameters of this method must not contains any HTML tags.
|
||||||
* \param key cl<EFBFBD> de chaine a traduire
|
* \param key cl<EFBFBD> de chaine a traduire
|
||||||
* \param param1 chaine de param1
|
* \param param1 chaine de param1
|
||||||
* \param param2 chaine de param1
|
* \param param2 chaine de param1
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user