From 29536ecbd80d64724d1113da101f5c4a446a45f7 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 18 Jul 2010 10:39:07 +0000 Subject: [PATCH] Fix: Use correct order of firstname and lastname. --- htdocs/adherents/class/adherent.class.php | 45 ++- htdocs/adherents/fiche.php | 3 +- htdocs/adherents/fiche_subscription.php | 4 +- htdocs/admin/prelevement.php | 2 +- htdocs/comm/propal.php | 2 +- htdocs/commande/fiche.php | 2 +- htdocs/compta/bank/ligne.php | 2 +- .../class/ComptaJournalPaiement.class.php | 4 +- .../export/class/ComptaJournalVente.class.php | 319 +++++++++--------- htdocs/compta/facture.php | 2 +- htdocs/compta/facture/fiche-rec.php | 4 +- .../class/rejet-prelevement.class.php | 10 +- htdocs/compta/prelevement/fiche.php | 2 +- htdocs/contact/class/contact.class.php | 10 +- htdocs/core/class/html.form.class.php | 2 +- htdocs/fourn/commande/fiche.php | 2 +- .../includes/modules/action/rapport.pdf.php | 2 +- .../modules/cheque/pdf/pdf_blochet.class.php | 2 +- .../modules/commande/pdf_edison.modules.php | 2 +- .../modules/commande/pdf_einstein.modules.php | 2 +- .../modules/commande/pdf_quevedo.modules.php | 30 +- .../pdf/pdf_expedition_merou.modules.php | 4 +- .../pdf/pdf_expedition_rouget.modules.php | 2 +- .../modules/facture/pdf_crabe.modules.php | 2 +- .../modules/facture/pdf_lince.modules.php | 30 +- .../modules/facture/pdf_oursin.modules.php | 2 +- .../livraison/pdf/pdf_sirocco.modules.php | 4 +- .../livraison/pdf/pdf_typhon.modules.php | 4 +- .../member/cards/pdf_standard.class.php | 2 +- .../project/pdf/pdf_baleine.modules.php | 2 +- .../propale/pdf_propale_azur.modules.php | 4 +- .../propale/pdf_propale_jaune.modules.php | 4 +- .../propale/pdf_propale_roig.modules.php | 38 +-- .../modules/rapport/pdf_paiement.class.php | 2 +- .../pdf/pdf_muscadet.modules.php | 2 +- .../interface_modAgenda_ActionsAuto.class.php | 8 +- ...ace_modNotification_Notification.class.php | 4 +- htdocs/index.php | 2 +- htdocs/livraison/fiche.php | 2 +- htdocs/main.inc.php | 2 +- ...nterface_modPhenix_Phenixsynchro.class.php | 14 +- htdocs/public/paybox/newpayment.php | 4 +- htdocs/soc.php | 2 +- htdocs/user/class/user.class.php | 58 +++- ...ace_modWebcalendar_Webcalsynchro.class.php | 14 +- .../members/sync_members_dolibarr2ldap.php | 2 +- .../members/sync_members_ldap2dolibarr.php | 3 +- scripts/user/sync_users_dolibarr2ldap.php | 2 +- 48 files changed, 364 insertions(+), 308 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index cbf1b75afb8..11dd53f374d 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -544,8 +544,6 @@ class Adherent extends CommonObject } } - $this->fullname=trim($this->nom.' '.$this->prenom); - if (! $error && ! $notrigger) { $this->use_webcal=($conf->global->PHPWEBCALENDAR_MEMBERSTATUS=='always'?1:0); @@ -973,7 +971,6 @@ class Adherent extends CommonObject $this->civilite_id = $obj->civilite; $this->prenom = $obj->prenom; $this->nom = $obj->nom; - $this->fullname = trim($obj->nom.' '.$obj->prenom); $this->login = $obj->login; $this->pass = $obj->pass; $this->societe = $obj->societe; @@ -1709,23 +1706,42 @@ class Adherent extends CommonObject } /** - * \brief Return full name of member - * \return string Full name + * \brief Return full name (civility+' '+name+' '+lastname) + * \param langs Language object for translation of civility + * \param option 0=No option, 1=Add civility + * \param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * \return string String with full name */ - function getFullname($outputlangs) + function getFullName($langs,$option=0,$nameorder=-1) { global $conf; - if ($this->nom && $this->prenom) + $ret=''; + if ($option && $this->civilite_id) { - if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) return $this->nom.' '.$this->prenom; - else return $this->prenom.' '.$this->nom; + if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; + else $ret.=$this->civilite_id.' '; } - if ($this->nom) return $this->nom; - if ($this->prenom) return $this->prenom; - return ''; + + // If order not defined, we use the setup + if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); + + if ($nameorder) + { + if ($this->prenom) $ret.=$this->prenom; + if ($this->prenom && $this->nom) $ret.=' '; + if ($this->nom) $ret.=$this->nom; + } + else + { + if ($this->nom) $ret.=$this->nom; + if ($this->prenom && $this->nom) $ret.=' '; + if ($this->prenom) $ret.=$this->prenom; + } + return trim($ret); } + /** * \brief Retourne le libelle de civilite du contact * \return string Nom traduit de la civilite @@ -1949,7 +1965,6 @@ class Adherent extends CommonObject $this->civilite_id = 0; $this->nom = 'DOLIBARR'; $this->prenom = 'SPECIMEN'; - $this->fullname=trim($this->nom.' '.$this->prenom); $this->login='dolibspec'; $this->pass='dolibspec'; $this->societe = 'Societe ABC'; @@ -2016,8 +2031,10 @@ class Adherent extends CommonObject // Object classes $info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS); + $this->fullname=$this->getFullName($langs); + // Member - if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; + if ($this->fullname && $conf->global->LDAP_MEMBER_FIELD_FULLNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname; if ($this->nom && $conf->global->LDAP_MEMBER_FIELD_NAME) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->nom; if ($this->prenom && $conf->global->LDAP_MEMBER_FIELD_FIRSTNAME) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->prenom; if ($this->login && $conf->global->LDAP_MEMBER_FIELD_LOGIN) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login; diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index d294737fa6f..d5ab221ce70 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -144,7 +144,7 @@ if ($_POST['action'] == 'setsocid') $thirdparty=new Societe($db); $thirdparty->fetch($_POST["socid"]); $error++; - $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->fullname,$othermember->login,$thirdparty->nom).'
'; + $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; } } @@ -231,7 +231,6 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe $adh->civilite_id = trim($_POST["civilite_id"]); $adh->prenom = trim($_POST["prenom"]); $adh->nom = trim($_POST["nom"]); - $adh->fullname = trim($adh->prenom.' '.$adh->nom); $adh->login = trim($_POST["login"]); $adh->pass = trim($_POST["pass"]); diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index 8931d72a4e2..0cdf2dabce4 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -201,7 +201,7 @@ if ($user->rights->adherent->cotisation->creer && $action == 'edit') print ''.$langs->trans("Ref").''.$subscription->ref.' '; // Member - $adh->ref=$adh->fullname; + $adh->ref=$adh->getFullName($langs); print ''; print ''.$langs->trans("Member").''.$adh->getNomUrl(1,0,'subscription').''; print ''; @@ -313,7 +313,7 @@ if ($rowid && $action != 'edit') print ''; // Member - $adh->ref=$adh->fullname; + $adh->ref=$adh->getFullName($langs); print ''; print ''.$langs->trans("Member").''.$adh->getNomUrl(1,0,'subscription').''; print ''; diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index 4647a9de5ae..5fbc7c8cc6b 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -126,7 +126,7 @@ if ($conf->global->PRELEVEMENT_USER > 0) { $cuser = new User($db); $cuser->fetch($conf->global->PRELEVEMENT_USER); - print $cuser->fullname; + print $cuser->getFullName($langs); } else { diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index e250fbf8ac1..0dba395729b 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1734,7 +1734,7 @@ if ($id > 0 || ! empty($ref)) $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; - $formmail->fromname = $user->fullname; + $formmail->fromname = $user->getFullName($langs); $formmail->frommail = $user->email; $formmail->withfrom=1; $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 3eb1bc3db75..bb02df8db9f 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -2251,7 +2251,7 @@ else $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; - $formmail->fromname = $user->fullname; + $formmail->fromname = $user->getFullName($langs); $formmail->frommail = $user->email; $formmail->withfrom=1; $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; diff --git a/htdocs/compta/bank/ligne.php b/htdocs/compta/bank/ligne.php index 7fa2ef6f42a..a61594342f2 100644 --- a/htdocs/compta/bank/ligne.php +++ b/htdocs/compta/bank/ligne.php @@ -246,7 +246,7 @@ if ($result) $author=new User($db); $author->fetch($objp->fk_user_author); print ''; - print img_object($langs->trans("ShowUser"),'user').' '.$author->fullname.''; + print img_object($langs->trans("ShowUser"),'user').' '.$author->getFullName($langs).''; } else { diff --git a/htdocs/compta/export/class/ComptaJournalPaiement.class.php b/htdocs/compta/export/class/ComptaJournalPaiement.class.php index 4c80cd51bac..d37827ded8a 100644 --- a/htdocs/compta/export/class/ComptaJournalPaiement.class.php +++ b/htdocs/compta/export/class/ComptaJournalPaiement.class.php @@ -44,7 +44,7 @@ class ComptaJournalPaiement function GeneratePdf($user, $dir, $excid, $excref) { - global $conf; + global $conf,$langs; $date = strftime("%Y%m",time()); @@ -67,7 +67,7 @@ class ComptaJournalPaiement $this->pdf->SetTitle("Journal des paiements"); $this->pdf->SetCreator("Dolibarr ".DOL_VERSION); - $this->pdf->SetAuthor($user->fullname); + $this->pdf->SetAuthor($user->getFullName($langs)); $this->pdf->SetMargins(10, 10, 10); $this->pdf->SetAutoPageBreak(1,10); diff --git a/htdocs/compta/export/class/ComptaJournalVente.class.php b/htdocs/compta/export/class/ComptaJournalVente.class.php index 89c22c88f7b..b1e857ffb64 100644 --- a/htdocs/compta/export/class/ComptaJournalVente.class.php +++ b/htdocs/compta/export/class/ComptaJournalVente.class.php @@ -44,222 +44,221 @@ class ComptaJournalVente { function GeneratePdf($user, $dir, $excid, $excref) { + global $conf, $langs; + $date = strftime("%Y%m",time()); $file = $dir . "JournalVente".$excref . ".pdf"; if (file_exists($dir)) { - $pdf = new ComptaJournalPdf('P','mm','A4'); - $pdf->AliasNbPages(); + $pdf = new ComptaJournalPdf('P','mm','A4'); + $pdf->AliasNbPages(); - $pdf->Open(); - $pdf->AddPage(); + $pdf->Open(); + $pdf->AddPage(); - $this->tab_top = 90; - $this->tab_height = 90; + $this->tab_top = 90; + $this->tab_height = 90; - $pdf->SetTitle("Journal des ventes"); - $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($user->fullname); + $pdf->SetTitle("Journal des ventes"); + $pdf->SetCreator("Dolibarr ".DOL_VERSION); + $pdf->SetAuthor($user->getFullName($langs)); - $pdf->SetMargins(10, 10, 10); - $pdf->SetAutoPageBreak(1,10); + $pdf->SetMargins(10, 10, 10); + $pdf->SetAutoPageBreak(1,10); - /* - * - */ + /* + * + */ - $pdf->SetFillColor(220,220,220); + $pdf->SetFillColor(220,220,220); - $pdf->SetFont('Arial','', 9); + $pdf->SetFont('Arial','', 9); - $pdf->SetXY (10, 10 ); - $nexY = $pdf->GetY(); + $pdf->SetXY (10, 10 ); + $nexY = $pdf->GetY(); - $sql = "SELECT f.rowid as facid, f.facnumber, f.datef as dp"; - $sql .= " , f.total_ttc as amount, f.tva"; - $sql .= " , s.nom, s.code_compta"; - $sql .= " , l.price, l.tva_tx"; - $sql .= " , c.numero, f.increment"; - $sql .= " , l.rowid as lrowid"; + $sql = "SELECT f.rowid as facid, f.facnumber, f.datef as dp"; + $sql .= " , f.total_ttc as amount, f.tva"; + $sql .= " , s.nom, s.code_compta"; + $sql .= " , l.price, l.tva_tx"; + $sql .= " , c.numero, f.increment"; + $sql .= " , l.rowid as lrowid"; - $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; - $sql .= " , ".MAIN_DB_PREFIX."facture as f"; - $sql .= " , ".MAIN_DB_PREFIX."societe as s"; - $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; + $sql .= " FROM ".MAIN_DB_PREFIX."facturedet as l"; + $sql .= " , ".MAIN_DB_PREFIX."facture as f"; + $sql .= " , ".MAIN_DB_PREFIX."societe as s"; + $sql .= " , ".MAIN_DB_PREFIX."compta_compte_generaux as c"; - $sql .= " WHERE f.rowid = l.fk_facture "; - $sql .= " AND s.rowid = f.fk_soc"; - $sql .= " AND f.fk_statut = 1 "; - $sql .= " AND l.fk_code_ventilation <> 0 "; - $sql .= " AND l.fk_export_compta <> 0"; - $sql .= " AND c.rowid = l.fk_code_ventilation"; + $sql .= " WHERE f.rowid = l.fk_facture "; + $sql .= " AND s.rowid = f.fk_soc"; + $sql .= " AND f.fk_statut = 1 "; + $sql .= " AND l.fk_code_ventilation <> 0 "; + $sql .= " AND l.fk_export_compta <> 0"; + $sql .= " AND c.rowid = l.fk_code_ventilation"; - $sql .= " AND l.fk_export_compta = ".$excid; + $sql .= " AND l.fk_export_compta = ".$excid; - $sql .= " ORDER BY date_format(f.datef,'%Y%m%d') ASC, f.rowid, l.rowid"; + $sql .= " ORDER BY date_format(f.datef,'%Y%m%d') ASC, f.rowid, l.rowid"; - $oldate = ''; - $oldfac = ''; + $oldate = ''; + $oldfac = ''; - $resql = $this->db->query($sql); + $resql = $this->db->query($sql); - if ($resql) - { - $num = $this->db->num_rows($resql); - $i = 0; - $var = True; - $journ = 'VI'; - $hligne = 5; + if ($resql) + { + $num = $this->db->num_rows($resql); + $i = 0; + $var = True; + $journ = 'VI'; + $hligne = 5; - $wc = array(0,14,6,16,16,90,16,12,4,16); + $wc = array(0,14,6,16,16,90,16,12,4,16); - while ($i < $num) - { - $obj = $this->db->fetch_object($resql); + while ($i < $num) + { + $obj = $this->db->fetch_object($resql); - if ($oldate <> strftime("%d%m%Y",$this->db->jdate($obj->dp))) - { + if ($oldate <> strftime("%d%m%Y",$this->db->jdate($obj->dp))) + { - $journal = "Journal $journ du ".strftime('%A, %e %B %G',$this->db->jdate($obj->dp)); - $total_credit = 0 ; - $total_debit = 0 ; - $pdf->SetFont('Arial','B',10); + $journal = "Journal $journ du ".strftime('%A, %e %B %G',$this->db->jdate($obj->dp)); + $total_credit = 0 ; + $total_debit = 0 ; + $pdf->SetFont('Arial','B',10); - $pdf->cell(10,$hligne,"$journal"); - $pdf->ln(); + $pdf->cell(10,$hligne,"$journal"); + $pdf->ln(); - $pdf->SetFont('Arial','',9); + $pdf->SetFont('Arial','',9); - $pdf->cell($wc[1],$hligne,'Date'); - $pdf->cell($wc[2],$hligne,''); - $pdf->cell($wc[3],$hligne,'Compte'); - $pdf->cell($wc[4],$hligne,'Tiers'); - $pdf->cell($wc[5],$hligne,'Libell�'); - $pdf->cell($wc[6],$hligne,'Facture'); - $pdf->cell($wc[7],$hligne,'Montant',0,0,'R'); - $pdf->cell($wc[8],$hligne,''); - $pdf->cell($wc[9],$hligne,'Echeance',0,0,'R'); + $pdf->cell($wc[1],$hligne,'Date'); + $pdf->cell($wc[2],$hligne,''); + $pdf->cell($wc[3],$hligne,'Compte'); + $pdf->cell($wc[4],$hligne,'Tiers'); + $pdf->cell($wc[5],$hligne,'Libell�'); + $pdf->cell($wc[6],$hligne,'Facture'); + $pdf->cell($wc[7],$hligne,'Montant',0,0,'R'); + $pdf->cell($wc[8],$hligne,''); + $pdf->cell($wc[9],$hligne,'Echeance',0,0,'R'); - $pdf->ln(); + $pdf->ln(); - $oldate = strftime("%d%m%Y",$this->db->jdate($obj->dp)); - } + $oldate = strftime("%d%m%Y",$this->db->jdate($obj->dp)); + } - /* - * - */ - $socnom = $obj->nom; - $libelle = "Facture"; - $amount = abs($obj->amount); - $price = abs(price($obj->price)); - $tva = abs($obj->tva); + /* + * + */ + $socnom = $obj->nom; + $libelle = "Facture"; + $amount = abs($obj->amount); + $price = abs(price($obj->price)); + $tva = abs($obj->tva); - $facnumber = $obj->facnumber; - if (strlen(trim($obj->increment)) > 0) - { - $facnumber = $obj->increment; - } + $facnumber = $obj->facnumber; + if (strlen(trim($obj->increment)) > 0) + { + $facnumber = $obj->increment; + } - if (strlen($obj->nom) > 31) - { - $socnom = substr($obj->nom, 0 , 31); - } + if (strlen($obj->nom) > 31) + { + $socnom = substr($obj->nom, 0 , 31); + } - $pdf->SetFont('Arial','',9); + $pdf->SetFont('Arial','',9); - if ($obj->amount >= 0) - { - $d = "D"; - $c = "C"; + if ($obj->amount >= 0) + { + $d = "D"; + $c = "C"; - $credit = ''; - $debit = $amount; - $total_debit = $total_debit + $debit; - $grand_total_debit = $grand_total_debit + $debit; + $credit = ''; + $debit = $amount; + $total_debit = $total_debit + $debit; + $grand_total_debit = $grand_total_debit + $debit; - } - else - { - $d = "C"; - $c = "D"; + } + else + { + $d = "C"; + $c = "D"; - $credit = $amount; - $debit = ''; - $total_credit = $total_credit + $credit; - $grand_total_credit = $grand_total_credit + $credit; - } + $credit = $amount; + $debit = ''; + $total_credit = $total_credit + $credit; + $grand_total_credit = $grand_total_credit + $credit; + } - if ($oldfac <> $obj->facid) - { - $oldfac = $obj->facid; + if ($oldfac <> $obj->facid) + { + $oldfac = $obj->facid; - $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); - $pdf->cell($wc[2],$hligne,'VI'); - $pdf->cell($wc[3],$hligne,'41100000'); - $pdf->cell($wc[4],$hligne,$obj->code_compta); - $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); - $pdf->cell($wc[6],$hligne,$facnumber); - $pdf->cell($wc[7],$hligne,$amount,0,0,'R'); - $pdf->cell($wc[8],$hligne,$d); - $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); - $pdf->ln(); + $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); + $pdf->cell($wc[2],$hligne,'VI'); + $pdf->cell($wc[3],$hligne,'41100000'); + $pdf->cell($wc[4],$hligne,$obj->code_compta); + $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); + $pdf->cell($wc[6],$hligne,$facnumber); + $pdf->cell($wc[7],$hligne,$amount,0,0,'R'); + $pdf->cell($wc[8],$hligne,$d); + $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); + $pdf->ln(); - $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); - $pdf->cell($wc[2],$hligne,'VI'); - $pdf->cell($wc[3],$hligne,'4457119'); - $pdf->cell($wc[4],$hligne,''); - $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); - $pdf->cell($wc[6],$hligne,$facnumber); - $pdf->cell($wc[7],$hligne,$tva,0,0,'R'); - $pdf->cell($wc[8],$hligne,$c); - $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); - $pdf->ln(); - } + $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); + $pdf->cell($wc[2],$hligne,'VI'); + $pdf->cell($wc[3],$hligne,'4457119'); + $pdf->cell($wc[4],$hligne,''); + $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); + $pdf->cell($wc[6],$hligne,$facnumber); + $pdf->cell($wc[7],$hligne,$tva,0,0,'R'); + $pdf->cell($wc[8],$hligne,$c); + $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); + $pdf->ln(); + } - $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); - $pdf->cell($wc[2],$hligne,'VI'); - $pdf->cell($wc[3],$hligne,$obj->numero); - $pdf->cell($wc[4],$hligne,''); - $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); - $pdf->cell($wc[6],$hligne,$facnumber); - $pdf->cell($wc[7],$hligne,$price,0,0,'R'); - $pdf->cell($wc[8],$hligne,$c); - $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); - $pdf->ln(); + $pdf->cell($wc[1],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp))); + $pdf->cell($wc[2],$hligne,'VI'); + $pdf->cell($wc[3],$hligne,$obj->numero); + $pdf->cell($wc[4],$hligne,''); + $pdf->cell($wc[5],$hligne,$socnom .' '.$libelle); + $pdf->cell($wc[6],$hligne,$facnumber); + $pdf->cell($wc[7],$hligne,$price,0,0,'R'); + $pdf->cell($wc[8],$hligne,$c); + $pdf->cell($wc[9],$hligne,strftime('%d%m%y',$this->db->jdate($obj->dp)),0,0,'R'); + $pdf->ln(); - $i++; - } + $i++; + } - /* - * - * - */ + /* + * + * + */ - $pdf->Close(); + $pdf->Close(); - $pdf->Output($file); + $pdf->Output($file); - $result = 0; - } - else - { - $result -1; - } + $result = 0; + } + else + { + $result -1; + } } else { - $result = -2; + $result = -2; } return $result; } - /* - * - * - */ + } ?> diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4e6049253a4..8ac08547243 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3426,7 +3426,7 @@ else $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; - $formmail->fromname = $user->fullname; + $formmail->fromname = $user->getFullName($langs); $formmail->frommail = $user->email; $formmail->withfrom=1; $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; diff --git a/htdocs/compta/facture/fiche-rec.php b/htdocs/compta/facture/fiche-rec.php index 571c1aec5bf..4a4ce263270 100644 --- a/htdocs/compta/facture/fiche-rec.php +++ b/htdocs/compta/facture/fiche-rec.php @@ -133,7 +133,7 @@ if ($_GET["action"] == 'create') print ''; print ''; - print "".$langs->trans("Author")."".$user->fullname.""; + print "".$langs->trans("Author")."".$user->getFullName($langs).""; print "".$langs->trans("PaymentConditions").""; $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$facture->id,$facture->cond_reglement_id,'none'); @@ -357,7 +357,7 @@ else $html->form_conditions_reglement($_SERVER['PHP_SELF'].'?facid='.$fac->id,$fac->cond_reglement_id,'none'); print ""; - print "".$langs->trans("Author")."$author->fullname"; + print "".$langs->trans("Author")."".$author->getFullName($langs).""; if ($fac->remise_percent > 0) { diff --git a/htdocs/compta/prelevement/class/rejet-prelevement.class.php b/htdocs/compta/prelevement/class/rejet-prelevement.class.php index bb8fff507ad..d4311e68f89 100644 --- a/htdocs/compta/prelevement/class/rejet-prelevement.class.php +++ b/htdocs/compta/prelevement/class/rejet-prelevement.class.php @@ -170,10 +170,12 @@ class RejetPrelevement /** * \brief Envoi mail - * + * \param fac Invoice object */ function _send_email($fac) { + global $langs; + $userid = 0; $sql = "SELECT fk_user_demande"; @@ -207,8 +209,8 @@ class RejetPrelevement require_once(DOL_DOCUMENT_ROOT."/lib/CMailFile.class.php"); $subject = "Prelevement rejete"; - $sendto = $emuser->fullname." <".$emuser->email.">"; - $from = $this->user->fullname." <".$this->user->email.">"; + $sendto = $emuser->getFullName($langs)." <".$emuser->email.">"; + $from = $this->user->getFullName($langs)." <".$this->user->email.">"; $msgishtml=0; $arr_file = array(); @@ -217,7 +219,7 @@ class RejetPrelevement $message = "Bonjour,\n"; $message .= "\nLe prelevement de la facture ".$fac->ref." pour le compte de la societe ".$soc->nom." d'un montant de ".price($fac->total_ttc)." a ete rejete par la banque."; - $message .= "\n\n--\n".$this->user->fullname; + $message .= "\n\n--\n".$this->user->getFullName($langs); $mailfile = new CMailFile($subject,$sendto,$from,$message, $arr_file,$arr_mime,$arr_name, diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 01267567c05..98246733baa 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -183,7 +183,7 @@ if ($_GET["id"]) print 'Date Transmission / Par'; print dol_print_date($bon->date_trans,'dayhour'); - print ' par '.$muser->fullname.''; + print ' / '.$muser->getFullName($langs).''; print 'Methode Transmission'; print $bon->methodes_trans[$bon->method_trans]; print ''; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index bc662e32117..89a855db67c 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -263,8 +263,10 @@ class Contact extends CommonObject // Object classes $info["objectclass"]=explode(',',$conf->global->LDAP_CONTACT_OBJECT_CLASS); - // Champs - if ($this->getFullName($langs) && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->getFullName($langs); + $this->fullname=$this->getFullName($langs); + + // Fields + if ($this->fullname && $conf->global->LDAP_CONTACT_FIELD_FULLNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FULLNAME] = $this->fullname; if ($this->name && $conf->global->LDAP_CONTACT_FIELD_NAME) $info[$conf->global->LDAP_CONTACT_FIELD_NAME] = $this->name; if ($this->firstname && $conf->global->LDAP_CONTACT_FIELD_FIRSTNAME) $info[$conf->global->LDAP_CONTACT_FIELD_FIRSTNAME] = $this->firstname; @@ -786,9 +788,9 @@ class Contact extends CommonObject /** * \brief Return full name (civility+' '+name+' '+lastname) - * \param langs Lang object for translation of civility + * \param langs Language object for translation of civility * \param option 0=No option, 1=Add civility - * \param nameorder 0=Lastname+Firstname, 1=Firstname+Lastname + * \param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname * \return string String with full name */ function getFullName($langs,$option=0,$nameorder=-1) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index cf66d5395f3..1cab39093b9 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -2084,7 +2084,7 @@ class Form //print $this->cache_contacts[$selected]; $contact=new Contact($this->db); $contact->fetch($selected); - print $contact->nom.' '.$contact->prenom; + print $contact->getFullName($langs); } else { print " "; } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index b83b3c984c4..6d72ffca03b 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1422,7 +1422,7 @@ if ($id > 0 || ! empty($ref)) $formmail = new FormMail($db); $formmail->fromtype = 'user'; $formmail->fromid = $user->id; - $formmail->fromname = $user->fullname; + $formmail->fromname = $user->getFullName($langs); $formmail->frommail = $user->email; $formmail->withfrom=1; $formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; diff --git a/htdocs/includes/modules/action/rapport.pdf.php b/htdocs/includes/modules/action/rapport.pdf.php index 45ad731bafb..6aec13af053 100644 --- a/htdocs/includes/modules/action/rapport.pdf.php +++ b/htdocs/includes/modules/action/rapport.pdf.php @@ -120,7 +120,7 @@ class CommActionRapport $pdf->SetTitle($outputlangs->convToOutputCharset($this->title)); $pdf->SetSubject($outputlangs->convToOutputCharset($this->subject)); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeywords($outputlangs->convToOutputCharset($this->title." ".$this->subject)); $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right diff --git a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php index 3755bf87ff5..85901551175 100644 --- a/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php +++ b/htdocs/includes/modules/cheque/pdf/pdf_blochet.class.php @@ -135,7 +135,7 @@ class BordereauChequeBlochet extends ModeleChequeReceipts $pdf->SetTitle($outputlangs->transnoentities("CheckReceipt")." ".$number); $pdf->SetSubject($outputlangs->transnoentities("CheckReceipt")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities("CheckReceipt")." ".$number); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/commande/pdf_edison.modules.php b/htdocs/includes/modules/commande/pdf_edison.modules.php index 7820b59b5e7..ee0fed7d9b9 100644 --- a/htdocs/includes/modules/commande/pdf_edison.modules.php +++ b/htdocs/includes/modules/commande/pdf_edison.modules.php @@ -161,7 +161,7 @@ class pdf_edison extends ModelePDFCommandes $pdf->SetTitle($outputlangs->convToOutputCharset($com->ref)); $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/commande/pdf_einstein.modules.php b/htdocs/includes/modules/commande/pdf_einstein.modules.php index 2f8a38679f5..339ad3e3bcf 100644 --- a/htdocs/includes/modules/commande/pdf_einstein.modules.php +++ b/htdocs/includes/modules/commande/pdf_einstein.modules.php @@ -177,7 +177,7 @@ class pdf_einstein extends ModelePDFCommandes $pdf->SetTitle($outputlangs->convToOutputCharset($com->ref)); $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/commande/pdf_quevedo.modules.php b/htdocs/includes/modules/commande/pdf_quevedo.modules.php index 5b7971d1544..a651bda3a15 100755 --- a/htdocs/includes/modules/commande/pdf_quevedo.modules.php +++ b/htdocs/includes/modules/commande/pdf_quevedo.modules.php @@ -56,7 +56,7 @@ class pdf_quevedo extends ModelePDFCommandes $this->db = $db; $this->name = "quevedo"; - $this->description =$langs->trans('PDFQuevedoDescription'); + $this->description =$langs->trans('PDFQuevedoDescription'); // Dimension page pour format A4 $this->type = 'pdf'; @@ -180,7 +180,7 @@ class pdf_quevedo extends ModelePDFCommandes $pdf->SetTitle($outputlangs->convToOutputCharset($com->ref)); $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -279,14 +279,14 @@ class pdf_quevedo extends ModelePDFCommandes // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva $tvaligne=$com->lignes[$i]->total_tva; - + $localtax1ligne=$com->lignes[$i]->total_localtax1; $localtax2ligne=$com->lignes[$i]->total_localtax2; - + $vatrate=(string) $com->lignes[$i]->tva_tx; $localtax1rate=(string) $com->lignes[$i]->localtax1_tx; $localtax2rate=(string) $com->lignes[$i]->localtax2_tx; - + if (($com->lignes[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; $this->tva[$vatrate] += $tvaligne; $this->localtax1[$localtax1rate]+=$localtax1ligne; @@ -613,7 +613,7 @@ class pdf_quevedo extends ModelePDFCommandes $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); } - + // Total LocalTax2 if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax2on' && $object->total_localtax2>0) { @@ -632,10 +632,10 @@ class pdf_quevedo extends ModelePDFCommandes if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -645,22 +645,22 @@ class pdf_quevedo extends ModelePDFCommandes $totalvat =$outputlangs->transnoentities("TotalLT1ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - + //Local tax 2 foreach( $this->localtax2 as $tvakey => $tvaval ) { if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -670,11 +670,11 @@ class pdf_quevedo extends ModelePDFCommandes $totalvat =$outputlangs->transnoentities("TotalLT2ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } - } + } } $useborder=0; diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php index 8301481982a..20a31214a4e 100644 --- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php +++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_merou.modules.php @@ -162,7 +162,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Sending")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Sending")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -454,7 +454,7 @@ Class pdf_expedition_merou extends ModelePdfExpedition $pdf->SetXY($blSocX2,$blSocY+20); $pdf->SetFont('Arial','B',8); $pdf->SetTextColor(0,0,0); - $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($livreur->fullname), '' , 'L'); + $pdf->MultiCell(50, 8, $outputlangs->transnoentities("Deliverer")." ".$outputlangs->convToOutputCharset($livreur->getFullName($outputlangs)), '' , 'L'); /**********************************/ diff --git a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php index b6c75637bb7..ab12a23a7e1 100644 --- a/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php +++ b/htdocs/includes/modules/expedition/pdf/pdf_expedition_rouget.modules.php @@ -290,7 +290,7 @@ Class pdf_expedition_rouget extends ModelePdfExpedition $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Sending")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Sending")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/facture/pdf_crabe.modules.php b/htdocs/includes/modules/facture/pdf_crabe.modules.php index 4ce09d49e37..65c62a561a5 100644 --- a/htdocs/includes/modules/facture/pdf_crabe.modules.php +++ b/htdocs/includes/modules/facture/pdf_crabe.modules.php @@ -182,7 +182,7 @@ class pdf_crabe extends ModelePDFFactures $pdf->SetTitle($outputlangs->convToOutputCharset($fac->ref)); $pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/facture/pdf_lince.modules.php b/htdocs/includes/modules/facture/pdf_lince.modules.php index 4b127811bad..d40d99537a8 100755 --- a/htdocs/includes/modules/facture/pdf_lince.modules.php +++ b/htdocs/includes/modules/facture/pdf_lince.modules.php @@ -185,7 +185,7 @@ class pdf_lince extends ModelePDFFactures $pdf->SetTitle($outputlangs->convToOutputCharset($fac->ref)); $pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -286,16 +286,16 @@ class pdf_lince extends ModelePDFFactures $tvaligne=$fac->lignes[$i]->total_tva; $localtax1ligne=$fac->lignes[$i]->total_localtax1; $localtax2ligne=$fac->lignes[$i]->total_localtax2; - + if ($fac->remise_percent) $tvaligne-=($tvaligne*$fac->remise_percent)/100; if ($fac->remise_percent) $localtax1ligne-=($localtax1ligne*$fac->remise_percent)/100; if ($fac->remise_percent) $localtax2ligne-=($localtax2ligne*$fac->remise_percent)/100; - - + + $vatrate=(string) $fac->lignes[$i]->tva_tx; $localtax1rate=(string) $fac->lignes[$i]->localtax1_tx; $localtax2rate=(string) $fac->lignes[$i]->localtax2_tx; - + if (($fac->lignes[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; $this->tva[$vatrate] += $tvaligne; $this->localtax1[$localtax1rate]+=$localtax1ligne; @@ -763,7 +763,7 @@ class pdf_lince extends ModelePDFFactures $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); } - + // Total LocalTax2 if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax2on' && $object->total_localtax2>0) { @@ -782,10 +782,10 @@ class pdf_lince extends ModelePDFFactures if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -795,22 +795,22 @@ class pdf_lince extends ModelePDFFactures $totalvat =$outputlangs->transnoentities("TotalLT1ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - + //Local tax 2 foreach( $this->localtax2 as $tvakey => $tvaval ) { if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -820,11 +820,11 @@ class pdf_lince extends ModelePDFFactures $totalvat =$outputlangs->transnoentities("TotalLT2ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); - $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); + $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } - } + } } } diff --git a/htdocs/includes/modules/facture/pdf_oursin.modules.php b/htdocs/includes/modules/facture/pdf_oursin.modules.php index 2e73298d807..c37d59d41e1 100644 --- a/htdocs/includes/modules/facture/pdf_oursin.modules.php +++ b/htdocs/includes/modules/facture/pdf_oursin.modules.php @@ -180,7 +180,7 @@ class pdf_oursin extends ModelePDFFactures $pdf->SetTitle($outputlangs->convToOutputCharset($fac->ref)); $pdf->SetSubject($outputlangs->transnoentities("Invoice")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($fac->ref)." ".$outputlangs->transnoentities("Invoice")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php index 8f23bbf8502..2691fa149dc 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_sirocco.modules.php @@ -162,7 +162,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("DeliveryOrder")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -425,7 +425,7 @@ class pdf_sirocco extends ModelePDFDeliveryOrder $pdf->SetFont('Arial','B',9); // Add list of linked orders - // TODO mutualiser + // TODO mutualiser $object->load_object_linked(); if ($conf->commande->enabled) diff --git a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php index 63ba73cebf6..96020de34a9 100644 --- a/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php +++ b/htdocs/includes/modules/livraison/pdf/pdf_typhon.modules.php @@ -184,7 +184,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("DeliveryOrder")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("DeliveryOrder")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -544,7 +544,7 @@ class pdf_typhon extends ModelePDFDeliveryOrder $pdf->SetTextColor(0,0,60); // Add list of linked orders - // TODO mutualiser + // TODO mutualiser $object->load_object_linked(); if ($conf->commande->enabled) diff --git a/htdocs/includes/modules/member/cards/pdf_standard.class.php b/htdocs/includes/modules/member/cards/pdf_standard.class.php index f7922d06cec..b896d04cf7a 100644 --- a/htdocs/includes/modules/member/cards/pdf_standard.class.php +++ b/htdocs/includes/modules/member/cards/pdf_standard.class.php @@ -415,7 +415,7 @@ class pdf_standard { $pdf->SetTitle($outputlangs->transnoentities('MembersCards')); $pdf->SetSubject($outputlangs->transnoentities("MembersCards")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->transnoentities('MembersCards')." ".$outputlangs->transnoentities("Foundation")." ".$outputlangs->convToOutputCharset($mysoc->nom)); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php index 308fdcd7157..ed7e0bbd717 100644 --- a/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php +++ b/htdocs/includes/modules/project/pdf/pdf_baleine.modules.php @@ -164,7 +164,7 @@ class pdf_baleine extends ModelePDFProjects $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Project")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Project")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php index 4f6b8bd5a70..28f0c1eb046 100644 --- a/htdocs/includes/modules/propale/pdf_propale_azur.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_azur.modules.php @@ -177,7 +177,7 @@ class pdf_propale_azur extends ModelePDFPropales $pdf->SetTitle($outputlangs->convToOutputCharset($propale->ref)); $pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($propale->ref)." ".$outputlangs->transnoentities("CommercialProposal")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -856,7 +856,7 @@ class pdf_propale_azur extends ModelePDFPropales if (sizeof($arrayidcontact) > 0) { $object->fetch_user($arrayidcontact[0]); - $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->fullname); + $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)); } $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); diff --git a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php index 2897048cd98..c1205acdce4 100644 --- a/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_jaune.modules.php @@ -153,7 +153,7 @@ class pdf_propale_jaune extends ModelePDFPropales $pdf->SetTitle($outputlangs->convToOutputCharset($propale->ref)); $pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($propale->ref)." ".$outputlangs->transnoentities("CommercialProposal")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -519,7 +519,7 @@ class pdf_propale_jaune extends ModelePDFPropales if (sizeof($arrayidcontact) > 0) { $object->fetch_user($arrayidcontact[0]); - $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->fullname); + $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)); } $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); diff --git a/htdocs/includes/modules/propale/pdf_propale_roig.modules.php b/htdocs/includes/modules/propale/pdf_propale_roig.modules.php index 224fbdbe66a..bd31ab35182 100755 --- a/htdocs/includes/modules/propale/pdf_propale_roig.modules.php +++ b/htdocs/includes/modules/propale/pdf_propale_roig.modules.php @@ -79,7 +79,7 @@ class pdf_propale_roig extends ModelePDFPropales $this->option_draft_watermark = 1; //Support add of a watermark on drafts $this->franchise=!$mysoc->tva_assuj; - + // Recupere emmetteur $this->emetteur=$mysoc; if (! $this->emetteur->pays_code) $this->emetteur->pays_code=substr($langs->defaultlang,-2); // Par defaut, si n'etait pas defini @@ -180,7 +180,7 @@ class pdf_propale_roig extends ModelePDFPropales $pdf->SetTitle($outputlangs->convToOutputCharset($propale->ref)); $pdf->SetSubject($outputlangs->transnoentities("CommercialProposal")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($propale->ref)." ".$outputlangs->transnoentities("CommercialProposal")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); @@ -293,21 +293,21 @@ class pdf_propale_roig extends ModelePDFPropales $tvaligne=$propale->lignes[$i]->total_tva; $localtax1ligne=$propale->lignes[$i]->total_localtax1; $localtax2ligne=$propale->lignes[$i]->total_localtax2; - + if ($propale->remise_percent) $tvaligne-=($tvaligne*$propale->remise_percent)/100; if ($propale->remise_percent) $localtax1ligne-=($localtax1ligne*$propale->remise_percent)/100; if ($propale->remise_percent) $localtax2ligne-=($localtax2ligne*$propale->remise_percent)/100; - + $vatrate=(string) $propale->lignes[$i]->tva_tx; $localtax1rate=(string) $propale->lignes[$i]->localtax1_tx; $localtax2rate=(string) $propale->lignes[$i]->localtax2_tx; - + if (($propale->lignes[$i]->info_bits & 0x01) == 0x01) $vatrate.='*'; - + $this->tva[$vatrate] += $tvaligne; $this->localtax1[$localtax1rate]+=$localtax1ligne; $this->localtax2[$localtax2rate]+=$localtax2ligne; - + $nexY+=2; // Passe espace entre les lignes // Cherche nombre de lignes a venir pour savoir si place suffisante @@ -622,7 +622,7 @@ class pdf_propale_roig extends ModelePDFPropales $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); - + } } @@ -644,7 +644,7 @@ class pdf_propale_roig extends ModelePDFPropales $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1); } - + // Total LocalTax2 if ($conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax2on' && $object->total_localtax2>0) { @@ -663,10 +663,10 @@ class pdf_propale_roig extends ModelePDFPropales if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -676,22 +676,22 @@ class pdf_propale_roig extends ModelePDFPropales $totalvat =$outputlangs->transnoentities("TotalLT1ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); } } - + //Local tax 2 foreach( $this->localtax2 as $tvakey => $tvaval ) { if ($tvakey>0) // On affiche pas taux 0 { //$this->atleastoneratenotnull++; - + $index++; $pdf->SetXY ($col1x, $tab2_top + $tab2_hl * $index); - + $tvacompl=''; if (preg_match('/\*/',$tvakey)) { @@ -701,12 +701,12 @@ class pdf_propale_roig extends ModelePDFPropales $totalvat =$outputlangs->transnoentities("TotalLT2ES").' '; $totalvat.=vatrate($tvakey,1).$tvacompl; $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1); - + $pdf->SetXY ($col2x, $tab2_top + $tab2_hl * $index); $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1); - + } - } + } } } @@ -945,7 +945,7 @@ class pdf_propale_roig extends ModelePDFPropales if (sizeof($arrayidcontact) > 0) { $object->fetch_user($arrayidcontact[0]); - $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->fullname); + $carac_emetteur .= ($carac_emetteur ? "\n" : '' ).$outputlangs->transnoentities("Name").": ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)); } $carac_emetteur .= pdf_build_address($outputlangs,$this->emetteur); diff --git a/htdocs/includes/modules/rapport/pdf_paiement.class.php b/htdocs/includes/modules/rapport/pdf_paiement.class.php index a89c205aecb..e8b33c0cc0d 100644 --- a/htdocs/includes/modules/rapport/pdf_paiement.class.php +++ b/htdocs/includes/modules/rapport/pdf_paiement.class.php @@ -181,7 +181,7 @@ class pdf_paiement $pdf->SetTitle($outputlangs->transnoentities("Payments")); $pdf->SetSubject($outputlangs->transnoentities("Payments")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); //$pdf->SetKeyWords(); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php index 292fe6bf0a5..844109a7b08 100644 --- a/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php +++ b/htdocs/includes/modules/supplier_order/pdf/pdf_muscadet.modules.php @@ -171,7 +171,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders $pdf->SetTitle($outputlangs->convToOutputCharset($com->ref)); $pdf->SetSubject($outputlangs->transnoentities("Order")); $pdf->SetCreator("Dolibarr ".DOL_VERSION); - $pdf->SetAuthor($outputlangs->convToOutputCharset($user->fullname)); + $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($com->ref)." ".$outputlangs->transnoentities("Order")); if ($conf->global->MAIN_DISABLE_PDF_COMPRESSION) $pdf->SetCompression(false); diff --git a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php index ae649f053d8..36cb684463b 100644 --- a/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php +++ b/htdocs/includes/triggers/interface_modAgenda_ActionsAuto.class.php @@ -398,7 +398,7 @@ class InterfaceActionsAuto $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); - $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -417,7 +417,7 @@ class InterfaceActionsAuto $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); - $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $object->actionmsg.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day'); @@ -441,7 +441,7 @@ class InterfaceActionsAuto $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); - $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; @@ -459,7 +459,7 @@ class InterfaceActionsAuto $object->actiontypecode='AC_OTH'; $object->actionmsg2=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $object->actionmsg=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); - $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $object->actionmsg.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $object->actionmsg.="\n".$langs->transnoentities("Type").': '.$object->type; $object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login; diff --git a/htdocs/includes/triggers/interface_modNotification_Notification.class.php b/htdocs/includes/triggers/interface_modNotification_Notification.class.php index 06345d37a7d..0860e3d4177 100644 --- a/htdocs/includes/triggers/interface_modNotification_Notification.class.php +++ b/htdocs/includes/triggers/interface_modNotification_Notification.class.php @@ -172,7 +172,7 @@ class InterfaceNotification $filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf'; if (! file_exists($filepdf)) $filepdf=''; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->fullname); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$object->ref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; $notify = new Notify($this->db); @@ -188,7 +188,7 @@ class InterfaceNotification $filepdf = $conf->fournisseur->dir_output . '/commande/' . $ref . '/' . $ref . '.pdf'; if (! file_exists($filepdf)) $filepdf=''; $mesg = $langs->transnoentitiesnoconv("Hello").",\n\n"; - $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->fullname); + $mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$object->ref,$user->getFullName($langs)); $mesg.= "\n\n".$langs->transnoentitiesnoconv("Sincerely").".\n\n"; $notify = new Notify($this->db); diff --git a/htdocs/index.php b/htdocs/index.php index 16a8c3db751..70ca6cd99e9 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -84,7 +84,7 @@ if (file_exists(DOL_DOCUMENT_ROOT.'/logo.png')) print ''; print ''; print ''; -$userstring=$user->fullname; +$userstring=$user->getFullName($langs); print ''; print ''; print ''; } - print "\n"; + print "\n"; if ($commande->note) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 4bd74bd9d30..00ff94162d3 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -945,7 +945,7 @@ function top_menu($head, $title='', $target='', $disablejs=0, $disablehead=0, $a $logintext.=$menutop->atarget?(' target="'.$menutop->atarget.'"'):''; $logintext.='>'.$user->login.''; $loginhtmltext.=''.$langs->trans("User").''; - $loginhtmltext.='
'.$langs->trans("Name").': '.$user->fullname; + $loginhtmltext.='
'.$langs->trans("Name").': '.$user->getFullName($langs); $loginhtmltext.='
'.$langs->trans("Login").': '.$user->login; $loginhtmltext.='
'.$langs->trans("Administrator").': '.yn($user->admin); $type=($user->societe_id?$langs->trans("External"):$langs->trans("Internal")); diff --git a/htdocs/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php b/htdocs/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php index 697fd0cde57..6318198b7f5 100644 --- a/htdocs/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php +++ b/htdocs/phenix/inc/triggers/interface_modPhenix_Phenixsynchro.class.php @@ -114,7 +114,7 @@ class InterfacePhenixsynchro $langs->load("other"); // Initialisation donnees (date,duree,texte,desc) - if ($object->type_id == 5 && $object->contact->fullname) + if ($object->type_id == 5 && $object->contact->getFullName($langs)) { $libellecal =$langs->transnoentities("TaskRDVWith",$object->contact->getFullName($langs))."\n"; $libellecal.=$object->note; @@ -296,7 +296,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("NewMemberCreated",$object->ref); $this->desc=$langs->transnoentities("NewMemberCreated",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -310,7 +310,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -324,7 +324,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $this->desc.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day'); @@ -340,7 +340,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -354,7 +354,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -368,7 +368,7 @@ class InterfacePhenixsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index 3087205c68a..f41279ba78a 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -566,7 +566,7 @@ if ($_REQUEST["amount"] == 'membersubscription') $amount=$subscription->total_ttc; - $newtag='MID='.$member->id.'.M='.strtr($member->fullname,"-"," "); + $newtag='MID='.$member->id.'.M='.strtr($member->getFullName($langs),"-"," "); if (! empty($_REQUEST["tag"])) { $tag=$_REQUEST["tag"]; $newtag.='.TAG='.$_REQUEST["tag"]; } $newtag=dol_string_unaccent($newtag); @@ -578,7 +578,7 @@ if ($_REQUEST["amount"] == 'membersubscription') // Debitor $var=!$var; print '
'.$langs->trans("Informations").'
'.$langs->trans("User").''.$userstring.'
'.$langs->trans("PreviousConnexion").''; diff --git a/htdocs/livraison/fiche.php b/htdocs/livraison/fiche.php index 25bd122287c..4fafe727a01 100644 --- a/htdocs/livraison/fiche.php +++ b/htdocs/livraison/fiche.php @@ -259,7 +259,7 @@ if ($_GET["action"] == 'create') print '".$langs->trans("Author")."$author->fullname".$langs->trans("Author")."".$author->getFullName($langs)."
'.$langs->trans("Member"); - print ''.$member->fullname.''; + print ''.$member->getFullName($langs).''; // Object $var=!$var; diff --git a/htdocs/soc.php b/htdocs/soc.php index a5d4cabcae2..30a525a086b 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -1449,7 +1449,7 @@ else $result=$adh->fetch('','',$soc->id); if ($result > 0) { - $adh->ref=$adh->fullname; + $adh->ref=$adh->getFullName($langs); print $adh->getNomUrl(1); } else diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index a8d411253c6..4429029eef3 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -169,7 +169,6 @@ class User extends CommonObject $this->nom = $obj->name; $this->prenom = $obj->firstname; - $this->fullname = trim($this->prenom . ' ' . $this->nom); $this->login = $obj->login; $this->pass_indatabase = $obj->pass; $this->pass_indatabase_crypted = $obj->pass_crypted; @@ -973,7 +972,6 @@ class User extends CommonObject // Clean parameters $this->nom = trim($this->nom); $this->prenom = trim($this->prenom); - $this->fullname = $this->prenom." ".$this->nom; $this->login = trim($this->login); $this->pass = trim($this->pass); $this->office_phone = trim($this->office_phone); @@ -1325,7 +1323,7 @@ class User extends CommonObject $url = "http://".$_SERVER["HTTP_HOST"].DOL_URL_ROOT; $mesg.= 'Click here to go to Dolibarr: '.$url."\n\n"; $mesg.= "--\n"; - $mesg.= $user->fullname; // Username that make then sending + $mesg.= $user->getFullName($langs); // Username that make then sending } else { @@ -1464,10 +1462,11 @@ class User extends CommonObject } /** - * \brief Renvoie nom clicable (avec eventuellement le picto) - * \param withpicto Inclut le picto dans le lien - * \param option Sur quoi pointe le lien - * \return string Chaine avec URL + * \brief Return a link to the user card (with optionnaly the picto) + * \param withpicto Include picto in link + * \param option On what the link point to + * \return string String with URL + * \remarks Use this->id,this->nom, this->prenom */ function getNomUrl($withpicto=0,$option='') { @@ -1485,7 +1484,7 @@ class User extends CommonObject } if ($withpicto) $result.=($lien.img_object($langs->trans("ShowUser"),'user').$lienfin.' '); - $result.=$lien.$this->nom.' '.$this->prenom.$lienfin; + $result.=$lien.$this->getFullName($langs).$lienfin; return $result; } @@ -1515,6 +1514,44 @@ class User extends CommonObject return $result; } + /** + * \brief Return full name (civility+' '+name+' '+lastname) + * \param langs Language object for translation of civility + * \param option 0=No option, 1=Add civility + * \param nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * \return string String with full name + */ + function getFullName($langs,$option=0,$nameorder=-1) + { + global $conf; + + $ret=''; + if ($option && $this->civilite_id) + { + if ($langs->transnoentitiesnoconv("Civility".$this->civilite_id)!="Civility".$this->civilite_id) $ret.=$langs->transnoentitiesnoconv("Civility".$this->civilite_id).' '; + else $ret.=$this->civilite_id.' '; + } + + // If order not defined, we use the setup + if ($nameorder < 0) $nameorder=(! $conf->global->MAIN_FIRSTNAME_NAME_POSITION); + + if ($nameorder) + { + if ($this->prenom) $ret.=$this->prenom; + if ($this->prenom && $this->nom) $ret.=' '; + if ($this->nom) $ret.=$this->nom; + } + else + { + if ($this->nom) $ret.=$this->nom; + if ($this->prenom && $this->nom) $ret.=' '; + if ($this->prenom) $ret.=$this->prenom; + } + + return trim($ret); + } + + /** * \brief Retourne le libelle du statut d'un user (actif, inactif) * \param mode 0=libelle long, 1=libelle court, 2=Picto + Libelle court, 3=Picto, 4=Picto + Libelle long @@ -1607,8 +1644,10 @@ class User extends CommonObject // Object classes $info["objectclass"]=explode(',',$conf->global->LDAP_USER_OBJECT_CLASS); + $this->fullname=$this->getFullName($langs); + // Champs - if ($this->fullname && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname; + if ($this->fullname && $conf->global->LDAP_FIELD_FULLNAME) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname; if ($this->nom && $conf->global->LDAP_FIELD_NAME) $info[$conf->global->LDAP_FIELD_NAME] = $this->nom; if ($this->prenom && $conf->global->LDAP_FIELD_FIRSTNAME) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->prenom; if ($this->login && $conf->global->LDAP_FIELD_LOGIN) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login; @@ -1677,7 +1716,6 @@ class User extends CommonObject $this->nom='DOLIBARR'; $this->prenom='SPECIMEN'; - $this->fullname=trim($this->prenom.' '.$this->nom); $this->note='This is a note'; $this->email='email@specimen.com'; $this->office_phone='0999999999'; diff --git a/htdocs/webcalendar/inc/triggers/interface_modWebcalendar_Webcalsynchro.class.php b/htdocs/webcalendar/inc/triggers/interface_modWebcalendar_Webcalsynchro.class.php index b2c7b1938aa..cd4f955ebd4 100644 --- a/htdocs/webcalendar/inc/triggers/interface_modWebcalendar_Webcalsynchro.class.php +++ b/htdocs/webcalendar/inc/triggers/interface_modWebcalendar_Webcalsynchro.class.php @@ -113,7 +113,7 @@ class InterfaceWebcalsynchro $langs->load("other"); // Initialisation donnees (date,duree,texte,desc) - if ($object->type_id == 5 && $object->contact->fullname) + if ($object->type_id == 5 && $object->contact->getFullName($langs)) { $libellecal =$langs->transnoentities("TaskRDVWith",$object->contact->getFullName($langs))."\n"; $libellecal.=$object->note; @@ -273,7 +273,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("NewMemberCreated",$object->ref); $this->desc=$langs->transnoentities("NewMemberCreated",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -287,7 +287,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberValidatedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -301,7 +301,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberSubscriptionAddedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Amount").': '.$object->last_subscription_amount; $this->desc.="\n".$langs->transnoentities("Period").': '.dol_print_date($object->last_subscription_date_start,'day').' - '.dol_print_date($object->last_subscription_date_end,'day'); @@ -317,7 +317,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberModifiedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -331,7 +331,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberResiliatedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } @@ -345,7 +345,7 @@ class InterfaceWebcalsynchro $this->duree=0; $this->texte=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); $this->desc=$langs->transnoentities("MemberDeletedInDolibarr",$object->ref); - $this->desc.="\n".$langs->transnoentities("Member").': '.$object->fullname; + $this->desc.="\n".$langs->transnoentities("Member").': '.$object->getFullName($langs); $this->desc.="\n".$langs->transnoentities("Type").': '.$object->type; $this->desc.="\n".$langs->transnoentities("Author").': '.$user->login; } diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index aa314659871..fd1bad66219 100644 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -121,7 +121,7 @@ if ($resql) exit; } - print $langs->transnoentities("UpdateMember")." rowid=".$member->id." ".$member->fullname; + print $langs->transnoentities("UpdateMember")." rowid=".$member->id." ".$member->getFullName($langs); $oldobject=$member; diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 9989ec3ba7c..2dc0bccd857 100644 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -182,7 +182,6 @@ if ($result >= 0) // Propriete membre $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; $member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; - $member->fullname=($ldapuser[$conf->global->LDAP_FIELD_FULLNAME] ? $ldapuser[$conf->global->LDAP_FIELD_FULLNAME] : trim($member->prenom." ".$member->nom)); $member->login=$ldapuser[$conf->global->LDAP_FIELD_LOGIN]; $member->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD]; @@ -221,7 +220,7 @@ if ($result >= 0) $member->typeid=$typeid; // Creation membre - print $langs->transnoentities("MemberCreate").' # '.$key.': login='.$member->login.', fullname='.$member->fullname; + print $langs->transnoentities("MemberCreate").' # '.$key.': login='.$member->login.', fullname='.$member->getFullName($langs); print ', datec='.$member->datec; $member_id=$member->create($user); if ($member_id > 0) diff --git a/scripts/user/sync_users_dolibarr2ldap.php b/scripts/user/sync_users_dolibarr2ldap.php index cb46df3d6f0..c4459fd3a12 100644 --- a/scripts/user/sync_users_dolibarr2ldap.php +++ b/scripts/user/sync_users_dolibarr2ldap.php @@ -81,7 +81,7 @@ if ($resql) $fuser = new User($db); $fuser->fetch($obj->rowid); - print $langs->trans("UpdateUser")." rowid=".$fuser->id." ".$fuser->fullname; + print $langs->trans("UpdateUser")." rowid=".$fuser->id." ".$fuser->getFullName($langs); $oldobject=$fuser;