[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dolibarr-dev] Patch inversion noms et prénoms contact client sur PDF
From: |
Raphaël Bertrand (Résultic) |
Subject: |
[Dolibarr-dev] Patch inversion noms et prénoms contact client sur PDF |
Date: |
Thu, 12 Jun 2008 15:17:10 +0200 |
User-agent: |
Thunderbird 2.0.0.14 (Windows/20080421) |
Sur documents PDF générés par einstein, crabe et azur.
Ajoute paramètre nameorder à la méthode getFullName de la classe
contact, qui vaut 0 par défaut et inverse les noms et prénoms si vaut 1
ou un équivalent de true
--
*Raphaël Bertrand*
Résultic - Management & Informatique
Siège : 11 rue Tronchet - 69006 LYON
Bureaux : 11 pl Maréchal Lyautey - 69006 LYON
Fixe. 08 74 77 00 70
Fax. 08 25 24 85 02
E-Mail : address@hidden
Index: contact.class.php
===================================================================
RCS file: /sources/dolibarr/dolibarr/htdocs/contact.class.php,v
retrieving revision 1.127
diff -u -r1.127 contact.class.php
--- contact.class.php 16 May 2008 02:17:17 -0000 1.127
+++ contact.class.php 12 Jun 2008 13:14:34 -0000
@@ -4,6 +4,7 @@
* Copyright (C) 2004-2008 Laurent Destailleur <address@hidden>
* Copyright (C) 2005 Regis Houssin <address@hidden>
* Copyright (C) 2007 Franky Van Liedekerke <address@hidden>
+ * Copyright (C) 2008 Raphael Bertrand (Resultic) <address@hidden>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -746,7 +747,7 @@
* \param option 0=No option,
1=Add civility
* \return string String with
full name
*/
- function getFullName($langs,$option=0)
+ function getFullName($langs,$option=0,$nameorder=0)
{
$ret='';
if ($option && $this->civilite_id)
@@ -754,8 +755,17 @@
if
($langs->transnoentities("Civility".$this->civilite_id)!="Civility".$this->civilite_id)
$ret.=$langs->transnoentities("Civility".$this->civilite_id).' ';
else $ret.=$this->civilite_id.' ';
}
- if ($this->name) $ret.=$this->name.' ';
- if ($this->firstname) $ret.=$this->firstname.' ';
+
+ if ($nameorder)
+ {
+ if ($this->firstname) $ret.=$this->firstname.' ';
+ if ($this->name) $ret.=$this->name.' ';
+ }
+ else
+ {
+ if ($this->name) $ret.=$this->name.' ';
+ if ($this->firstname) $ret.=$this->firstname.' ';
+ }
return trim($ret);
}
Index: includes/modules/commande/pdf_einstein.modules.php
===================================================================
RCS file:
/sources/dolibarr/dolibarr/htdocs/includes/modules/commande/pdf_einstein.modules.php,v
retrieving revision 1.56
diff -u -r1.56 pdf_einstein.modules.php
--- includes/modules/commande/pdf_einstein.modules.php 11 Jun 2008 01:57:51
-0000 1.56
+++ includes/modules/commande/pdf_einstein.modules.php 12 Jun 2008 12:51:40
-0000
@@ -916,7 +916,7 @@
$pdf->MultiCell(96,4,
$object->client->nom, 0, 'L');
// Nom client
- $carac_client =
"\n".$object->contact->getFullName($outputlangs,1);
+ $carac_client =
"\n".$object->contact->getFullName($outputlangs,1,1);
// Caractéristiques client
$carac_client.="\n".$object->contact->adresse;
@@ -941,7 +941,7 @@
// 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);
+ $carac_client .=
"\n".$object->contact->getFullName($outputlangs,1,1);
}
}
Index: includes/modules/facture/pdf_crabe.modules.php
===================================================================
RCS file:
/sources/dolibarr/dolibarr/htdocs/includes/modules/facture/pdf_crabe.modules.php,v
retrieving revision 1.165
diff -u -r1.165 pdf_crabe.modules.php
--- includes/modules/facture/pdf_crabe.modules.php 11 Jun 2008 01:56:35
-0000 1.165
+++ includes/modules/facture/pdf_crabe.modules.php 12 Jun 2008 12:50:41
-0000
@@ -1109,7 +1109,7 @@
$pdf->MultiCell(96,4, $object->client->nom, 0,
'L');
// Nom client
- $carac_client =
"\n".$object->contact->getFullName($outputlangs,1);
+ $carac_client =
"\n".$object->contact->getFullName($outputlangs,1,1);
// Caractéristiques client
$carac_client.="\n".$object->contact->adresse;
@@ -1135,7 +1135,7 @@
// 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);
+ $carac_client .=
"\n".$object->contact->getFullName($outputlangs,1,1);
}
}
Index: includes/modules/propale/pdf_propale_azur.modules.php
===================================================================
RCS file:
/sources/dolibarr/dolibarr/htdocs/includes/modules/propale/pdf_propale_azur.modules.php,v
retrieving revision 1.114
diff -u -r1.114 pdf_propale_azur.modules.php
--- includes/modules/propale/pdf_propale_azur.modules.php 11 Jun 2008
01:56:34 -0000 1.114
+++ includes/modules/propale/pdf_propale_azur.modules.php 12 Jun 2008
12:55:42 -0000
@@ -942,7 +942,7 @@
$pdf->MultiCell(96,4, $object->client->nom, 0,
'L');
// Nom client
- $carac_client =
"\n".$object->contact->getFullName($outputlangs,1);
+ $carac_client =
"\n".$object->contact->getFullName($outputlangs,1,1);
// Caractéristiques client
$carac_client.="\n".$object->contact->adresse;
@@ -968,7 +968,7 @@
// 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);
+ $carac_client .=
"\n".$object->contact->getFullName($outputlangs,1,1);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dolibarr-dev] Patch inversion noms et prénoms contact client sur PDF,
Raphaël Bertrand (Résultic) <=