diff --git a/ChangeLog b/ChangeLog index 95b1b7a37ef07c22cb3acf1af2ec83ac08b515c7..93d994e27275ca037ac0cff7d074c494de9c905f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -37,7 +37,8 @@ For users: - New: Can now send supplier order by mail. - New: task #10076 : Show content of message in notification module. - New: Bank name available on invoice. -- New: IBAN value is called IFSC if country is India +- New: IBAN value is called IFSC if country is India. +- New: Add option to choose firstname-name or name-firstname. - Fix: Debug experimental module widthrawal. - Fix: Format number was wrong for ar_AR language. - Fix: Can change password if has only permission change password. diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 54b696cfdc5aef008ccc0e32d2bdbe058ba6ee7f..cbf1b75afb8a7883238e6b55bdc2847b4f3b9c11 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1214,7 +1214,7 @@ class Adherent extends CommonObject $insertid=$acct->addline($dateop, $operation, $label, $montant, $num_chq, '', $user, $emetteur_nom, $emetteur_banque); if ($insertid > 0) { - $inserturlid=$acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $this->getFullname(), 'member'); + $inserturlid=$acct->add_url_line($insertid, $this->id, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $this->getFullname($langs), 'member'); if ($inserturlid > 0) { // Met a jour la table cotisation @@ -1709,12 +1709,18 @@ class Adherent extends CommonObject } /** - * \brief Retourne le nom complet de l'adherent - * \return string Nom complet + * \brief Return full name of member + * \return string Full name */ - function getFullname() + function getFullname($outputlangs) { - if ($this->nom && $this->prenom) return $this->nom.' '.$this->prenom; + global $conf; + + if ($this->nom && $this->prenom) + { + if (! empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) return $this->nom.' '.$this->prenom; + else return $this->prenom.' '.$this->nom; + } if ($this->nom) return $this->nom; if ($this->prenom) return $this->prenom; return ''; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index 6d21f15ced0422bd308cb393189d5152c79e5d56..5eb1d713c39ba4f32e3ebf2dfbd68a8b2e21f6cf 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -104,7 +104,7 @@ if ($allowinsertbankafter && $_POST["action"] == '2bank' && $_POST["rowid"] !='' } else { - $inserturlid=$acct->add_url_line($insertid, $adherent->rowid, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $adherent->getFullname(), 'member'); + $inserturlid=$acct->add_url_line($insertid, $adherent->rowid, DOL_URL_ROOT.'/adherents/fiche.php?rowid=', $adherent->getFullname($langs), 'member'); // Met a jour la table cotisation $sql="UPDATE ".MAIN_DB_PREFIX."cotisation"; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 760c4cda5fca9f4fe3d2ec66b6703acc52dc64ad..ed620f276ff38ea0f4c5f1a792f34f814940c03b 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -68,6 +68,7 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_USE_PREVIEW_TABS", $_POST["main_use_preview_tabs"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_START_WEEK", $_POST["MAIN_START_WEEK"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_SHOW_LOGO", $_POST["MAIN_SHOW_LOGO"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", $_POST["MAIN_FIRSTNAME_NAME_POSITION"],'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_THEME", $_POST["main_theme"],'chaine',0,'',$conf->entity); @@ -199,6 +200,15 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit $var=!$var; print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("WeekStartOnDay").'</td><td>'; print $html->select_dayofweek((isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:'1'),'MAIN_START_WEEK',0); + print '</td>'; + print '<td width="20"> </td>'; + print '</tr>'; + + // Firstname/Name + $var=!$var; + print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>'; + $array=array(0=>$langs->trans("Firstname").' '.$langs->trans("Name"),1=>$langs->trans("Name").' '.$langs->trans("Firstname")); + print $html->selectarray('MAIN_FIRSTNAME_NAME_POSITION',$array,(isset($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?$conf->global->MAIN_FIRSTNAME_NAME_POSITION:0)); print '</td>'; print '<td width="20"> </td>'; print '</tr>'; @@ -371,7 +381,16 @@ else // Show print '<td width="20"> </td>'; print '</tr>'; - print '</table><br>'; + // Firstname / Name position + $var=!$var; + print '<tr '.$bc[$var].'><td width="35%">'.$langs->trans("FirstnameNamePosition").'</td><td>'; + if (empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)) { print $langs->trans("Firstname").' '.$langs->trans("Name"); } + else { print $langs->trans("Name").' '.$langs->trans("Firstname"); } + print '</td>'; + print '<td width="20"> </td>'; + print '</tr>'; + + print '</table><br>'; // Themes diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 9cae4ad01752ef2dd53460d800628648493b59af..77143ea66488374e250bd784b8cd91b0309d7733 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -791,7 +791,7 @@ class Contact extends CommonObject * \param nameorder 0=Lastname+Firstname, 1=Firstname+Lastname * \return string String with full name */ - function getFullName($langs,$option=0,$nameorder=0) + function getFullName($langs,$option=0,$nameorder=-1) { $ret=''; if ($option && $this->civilite_id) @@ -800,6 +800,9 @@ class Contact extends CommonObject 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->firstname) $ret.=$this->firstname; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 67f2e4c4326d3d3d4688ffdc117a6f1195c9b32d..c60624cbc4c6a4c36e3e9281f585dec97e45f901 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -271,6 +271,7 @@ ListOfDirectories=List of OpenDocument templates directories ListOfDirectoriesForModelGenODT=List of directories contenaining templates files with OpenDocument format.<br><br>Put here full path of directories.<br>Add a carriage return between eah directory.<br>To add a directory of the GED module, add here <b>DOL_DATA_ROOT/ecm/yourdirectoryname</b>.<br><br>Files in those directories must end with <b>.odt</b>. NumberOfModelFilesFound=Number of ODT templates files found in those directories ExampleOfDirectoriesForModelGen=Examples of syntax:<br>c:\mydir<br>/home/mydir<br>DOL_DATA_ROOT/ecm/ecmdir +FirstnameNamePosition=Position of firstname/name # Modules Module0Name=Users & groups diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 270f8802954741c4e66cadfe2cb0fd9acba1374b..6cc88585599127a0efd2d9405d4e4816f1f135ce 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -273,6 +273,8 @@ NumberOfModelFilesFound=Nombre de fichiers modèles ODT trouvés dans ce(s) rép ExampleOfDirectoriesForModelGen=Exemples de syntaxe:<br>c:\mydir<br>/home/mydir<br>DOL_DATA_ROOT/ecm/ecmdir FollowingSubstitutionKeysCanBeUsed=En plaçant les tags suivant dans le modèle, vous obtiendrez une subsitution avec la valeur personnalisée lors de la génération du document: FullListOnOnlineDocumentation=Liste complète des tags disponibles sur la documentation utilisateur du module Tiers sur le wiki http://wiki.dolibarr.org +FirstnameNamePosition=Ordre affichage prénom/nom + # Modules= undefined Module0Name= Utilisateurs & groupes Module0Desc= Gestion des utilisateurs et groupes diff --git a/htdocs/lib/pdf.lib.php b/htdocs/lib/pdf.lib.php index fb4aaac9770cbcd78e3765e050fab4d28bee08aa..a75d1be9c5b6abbb6e8ef6643e3df8754afe398d 100644 --- a/htdocs/lib/pdf.lib.php +++ b/htdocs/lib/pdf.lib.php @@ -1,5 +1,5 @@ <?php -/* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net> +/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com> * @@ -69,7 +69,7 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target { if ($usecontact) { - $stringaddress.="\n".$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1,1)); + $stringaddress.="\n".$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs,1)); // Recipient properties $stringaddress.="\n".$outputlangs->convToOutputCharset($targetcontact->address); $stringaddress.="\n".$outputlangs->convToOutputCharset($targetcontact->cp) . " " . $outputlangs->convToOutputCharset($targetcontact->ville);