diff --git a/htdocs/adherents/card_subscriptions.php b/htdocs/adherents/card_subscriptions.php index 7354912147eb9..7f4f00f823464 100644 --- a/htdocs/adherents/card_subscriptions.php +++ b/htdocs/adherents/card_subscriptions.php @@ -156,7 +156,7 @@ $thirdparty=new Societe($db); $thirdparty->fetch(GETPOST("socid")); $error++; - $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; + $mesg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; } } @@ -949,7 +949,7 @@ print ''.$langs->trans('CheckTransmitter'); print ' ('.$langs->trans("ChequeMaker").')'; print ''; - print ''; + print ''; print ''.$langs->trans('Bank'); print ' ('.$langs->trans("ChequeBank").')'; diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 8b0a051e0b0f8..e0b8fca05e798 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -57,7 +57,7 @@ $arrayofmembers=array(); // requete en prenant que les adherents a jour de cotisation - $sql = "SELECT d.rowid, d.prenom, d.nom, d.login, d.societe, d.datefin,"; + $sql = "SELECT d.rowid, d.prenom as firstname, d.nom as lastname, d.login, d.societe, d.datefin,"; $sql.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,"; $sql.= " t.libelle as type,"; $sql.= " p.libelle as pays"; @@ -81,8 +81,8 @@ // List of values to scan for a replacement $substitutionarray = array ( - '%PRENOM%'=>$objp->prenom, - '%NOM%'=>$objp->nom, + '%PRENOM%'=>$objp->firstname, + '%NOM%'=>$objp->lastname, '%LOGIN%'=>$objp->login, '%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/", '%SOCIETE%'=>$objp->societe, diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 924c08dee2591..e3ef158e436cf 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -509,8 +509,10 @@ function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdp if ($result >= 0) { $luser->civilite_id=$this->civilite_id; - $luser->prenom=$this->prenom; - $luser->nom=$this->nom; + $luser->firstname=$this->firstname; + $luser->lastname=$this->lastname; + $luser->prenom=$this->firstname; // deprecated + $luser->nom=$this->lastname; // deprecated $luser->login=$this->user_login; $luser->pass=$this->pass; $luser->societe_id=$this->societe; @@ -1000,19 +1002,19 @@ function fetch($rowid,$ref='',$fk_soc='') $this->ref = $obj->rowid; $this->id = $obj->rowid; $this->civilite_id = $obj->civilite; - $this->prenom = $obj->firstname; + $this->prenom = $obj->firstname; // deprecated $this->firstname = $obj->firstname; - $this->nom = $obj->lastname; + $this->nom = $obj->lastname; // deprecated $this->lastname = $obj->lastname; $this->login = $obj->login; $this->pass = $obj->pass; $this->societe = $obj->societe; $this->fk_soc = $obj->fk_soc; - $this->adresse = $obj->address; // TODO deprecated + $this->adresse = $obj->address; // deprecated $this->address = $obj->address; - $this->cp = $obj->zip; // TODO deprecated + $this->cp = $obj->zip; // deprecated $this->zip = $obj->zip; - $this->ville = $obj->town; // TODO deprecated + $this->ville = $obj->town; // deprecated $this->town = $obj->town; $this->state_id = $obj->fk_departement; @@ -1427,7 +1429,7 @@ function add_to_spip() { $mdpass=dol_hash($this->pass); $htpass=crypt($this->pass,makesalt()); - $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->prenom." ".$this->nom."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; + $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->firstname." ".$this->lastname."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; $mydb=getDoliDBInstance('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT); @@ -1683,12 +1685,16 @@ function del_to_mailman($listes='') * @param Translate $langs Language object for translation of civility * @param int $option 0=No option, 1=Add civility * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname + * @param int $maxlen Maximum length * @return string String with full name */ - function getFullName($langs,$option=0,$nameorder=-1) + function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0) { global $conf; + if (empty($this->lastname)) $this->lastname=($this->name?$this->name:$this->nom); + if (empty($this->firstname)) $this->firstname=($this->firstname?$this->firstname:$this->prenom); + $ret=''; if ($option && $this->civilite_id) { @@ -1701,17 +1707,17 @@ function getFullName($langs,$option=0,$nameorder=-1) if ($nameorder) { - if ($this->prenom) $ret.=$this->prenom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->nom) $ret.=$this->nom; + $ret.=$this->firstname; + if ($this->firstname && $this->lastname) $ret.=' '; + $ret.=$this->lastname; } else { - if ($this->nom) $ret.=$this->nom; - if ($this->prenom && $this->nom) $ret.=' '; - if ($this->prenom) $ret.=$this->prenom; + $ret.=$this->lastname; + if ($this->firstname && $this->lastname) $ret.=' '; + $ret.=$this->firstname; } - return trim($ret); + return dol_trunc($ret,$maxlen); } @@ -1983,8 +1989,8 @@ function initAsSpecimen() $this->id=0; $this->specimen=1; $this->civilite_id = 0; - $this->nom = 'DOLIBARR'; - $this->prenom = 'SPECIMEN'; + $this->lastname = 'DOLIBARR'; + $this->firstname = 'SPECIMEN'; $this->login='dolibspec'; $this->pass='dolibspec'; $this->societe = 'Societe ABC'; diff --git a/htdocs/adherents/cotisations.php b/htdocs/adherents/cotisations.php index d7ddc80c463e6..ee05be2e5ba01 100644 --- a/htdocs/adherents/cotisations.php +++ b/htdocs/adherents/cotisations.php @@ -64,7 +64,7 @@ if ($msg) print $msg.'
'; // Liste des cotisations -$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe,"; +$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe,"; $sql.= " c.rowid as crowid, c.cotisation,"; $sql.= " c.dateadh,"; $sql.= " c.datef,"; @@ -123,7 +123,9 @@ $cotisation->ref=$objp->crowid; $cotisation->id=$objp->crowid; - $adherent->ref=trim($objp->prenom.' '.$objp->nom); + $adherent->lastname=$objp->lastname; + $adherent->firstname=$objp->firstname; + $adherent->ref=$adherent->getFullName($langs); $adherent->id=$objp->rowid; $adherent->login=$objp->login; diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index b71ba3dd48bb4..2e83fa53e251d 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -172,11 +172,11 @@ print ''; // Nom - print ''.$langs->trans("Lastname").''.$member->nom.' '; + print ''.$langs->trans("Lastname").''.$member->lastname.' '; print ''; // Prenom - print ''.$langs->trans("Firstname").''.$member->prenom.' '; + print ''.$langs->trans("Firstname").''.$member->firstname.' '; print ''; // Status diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index eeb716938caca..950967b4eb4e8 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -137,7 +137,7 @@ $thirdparty=new Societe($db); $thirdparty->fetch($_POST["socid"]); $error++; - $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'
'; + $errmsg='
'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'
'; } } @@ -223,8 +223,10 @@ // Change values $object->civilite_id = trim($_POST["civilite_id"]); - $object->prenom = trim($_POST["prenom"]); - $object->nom = trim($_POST["nom"]); + $object->prenom = trim($_POST["prenom"]); // deprecated + $object->nom = trim($_POST["nom"]); // deprecated + $object->firstname = trim($_POST["prenom"]); + $object->lastname = trim($_POST["nom"]); $object->login = trim($_POST["login"]); $object->pass = trim($_POST["pass"]); @@ -380,8 +382,10 @@ $socid=$_POST["socid"]; $object->civilite_id = $civilite_id; - $object->prenom = $prenom; - $object->nom = $nom; + $object->prenom = $prenom; // deprecated + $object->nom = $nom; // deprecated + $object->firstname = $prenom; + $object->lastname = $nom; $object->societe = $societe; $object->adresse = $address; // deprecated $object->address = $address; @@ -692,11 +696,11 @@ print ''; // Lastname - print ''.$langs->trans("Lastname").'nom).'" size="40">'; + print ''.$langs->trans("Lastname").'lastname).'" size="40">'; print ''; // Firstname - print ''.$langs->trans("Firstname").'prenom).'">'; + print ''.$langs->trans("Firstname").'firstname).'">'; print ''; // Password @@ -923,11 +927,11 @@ print ''; // Name - print ''.$langs->trans("Lastname").'nom).'">'; + print ''.$langs->trans("Lastname").'lastname).'">'; print ''; // Firstname - print ''.$langs->trans("Firstname").'prenom).'">'; + print ''.$langs->trans("Firstname").'firstname).'">'; print ''; // Password @@ -1074,9 +1078,9 @@ { // Full firstname and name separated with a dot : firstname.name include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); - $login=dol_buildlogin($object->nom,$object->prenom); + $login=dol_buildlogin($object->lastname,$object->firstname); } - if (empty($login)) $login=strtolower(substr($object->prenom, 0, 4)) . strtolower(substr($object->nom, 0, 4)); + if (empty($login)) $login=strtolower(substr($object->firstname, 0, 4)) . strtolower(substr($object->lastname, 0, 4)); // Create a form array $formquestion=array( @@ -1246,11 +1250,11 @@ print ''; // Name - print ''.$langs->trans("Lastname").''.$object->nom.' '; + print ''.$langs->trans("Lastname").''.$object->lastname.' '; print ''; // Firstname - print ''.$langs->trans("Firstname").''.$object->prenom.' '; + print ''.$langs->trans("Firstname").''.$object->firstname.' '; // Password if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) diff --git a/htdocs/adherents/index.php b/htdocs/adherents/index.php index 1f04032179aab..dc3d8f3c68967 100644 --- a/htdocs/adherents/index.php +++ b/htdocs/adherents/index.php @@ -203,7 +203,7 @@ */ $max=5; -$sql = "SELECT a.rowid, a.statut, a.nom, a.prenom,"; +$sql = "SELECT a.rowid, a.statut, a.nom as lastname, a.prenom as firstname,"; $sql.= " a.tms as datem, datefin as date_end_subscription,"; $sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; @@ -229,8 +229,8 @@ $obj = $db->fetch_object($resql); print ""; $staticmember->id=$obj->rowid; - $staticmember->nom=$obj->nom; - $staticmember->prenom=$obj->prenom; + $staticmember->lastname=$obj->lastname; + $staticmember->firstname=$obj->firstname; $staticmember->ref=$staticmember->getFullName($langs); $statictype->id=$obj->typeid; $statictype->libelle=$obj->libelle; @@ -283,8 +283,8 @@ $subscriptionstatic->id=$obj->cid; $subscriptionstatic->ref=$obj->cid; $staticmember->id=$obj->rowid; - $staticmember->nom=$obj->nom; - $staticmember->prenom=$obj->prenom; + $staticmember->lastname=$obj->lastname; + $staticmember->firstname=$obj->firstname; $staticmember->ref=$staticmember->getFullName($langs); print ''.$subscriptionstatic->getNomUrl(1).''; print ''.$staticmember->getNomUrl(1,24,'subscription').''; diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php index 39a00c6444e41..5e3456c2cfdb7 100644 --- a/htdocs/adherents/ldap.php +++ b/htdocs/adherents/ldap.php @@ -109,11 +109,11 @@ print ''; // Nom -print ''.$langs->trans("Lastname").''.$adh->nom.' '; +print ''.$langs->trans("Lastname").''.$adh->lastname.' '; print ''; // Prenom -print ''.$langs->trans("Firstname").''.$adh->prenom.' '; +print ''.$langs->trans("Firstname").''.$adh->firstname.' '; print ''; // Login diff --git a/htdocs/adherents/liste.php b/htdocs/adherents/liste.php index 625ab0355b370..a88056930b7af 100644 --- a/htdocs/adherents/liste.php +++ b/htdocs/adherents/liste.php @@ -79,7 +79,7 @@ $now=dol_now(); -$sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, "; +$sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as name, d.societe, "; $sql.= " d.datefin,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " t.libelle as type, t.cotisation"; @@ -258,8 +258,8 @@ // Nom $var=!$var; print ""; - $memberstatic->nom=$objp->nom; - $memberstatic->prenom=$objp->prenom; + $memberstatic->lastname=$objp->lastname; + $memberstatic->firstname=$objp->firstname; if ($objp->societe != '') { print "rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."\n"; diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index a5a285da3417a..7c36b2414aae3 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -120,11 +120,11 @@ print ''; // Lastname - print ''.$langs->trans("Lastname").''.$adh->nom.' '; + print ''.$langs->trans("Lastname").''.$adh->lastname.' '; print ''; // Firstname - print ''.$langs->trans("Firstname").''.$adh->prenom.' '; + print ''.$langs->trans("Firstname").''.$adh->firstname.' '; // Status print ''.$langs->trans("Status").''.$adh->getLibStatut(4).''; diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 470793fe1e526..ea15f11b1ed31 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -338,7 +338,7 @@ $membertypestatic=new AdherentType($db); - $sql = "SELECT d.rowid, d.login, d.prenom, d.nom, d.societe, "; + $sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, "; $sql.= " d.datefin,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " t.libelle as type, t.cotisation"; @@ -486,17 +486,19 @@ $datefin=$db->jdate($objp->datefin); $adh=new Adherent($db); + $adh->lastname=$objp->lastname; + $adh->firstname=$objp->firstname; // Nom $var=!$var; print ''; if ($objp->societe != '') { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom,12).' / '.dol_trunc($objp->societe,12).''."\n"; + print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).''."\n"; } else { - print ''.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom).''."\n"; + print ''.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).''."\n"; } // Login @@ -627,7 +629,7 @@ print ""; print ''; - + print '
   '; print '
'; diff --git a/htdocs/asterisk/cidlookup.php b/htdocs/asterisk/cidlookup.php index bbd5883f28301..4c30cb89eef99 100644 --- a/htdocs/asterisk/cidlookup.php +++ b/htdocs/asterisk/cidlookup.php @@ -40,7 +40,7 @@ exit; } -$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."societe as s"; +$sql = "SELECT nom as name FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid"; $sql.= " WHERE s.entity=".$conf->entity; $sql.= " AND (s.tel='".$db->escape($phone)."'"; @@ -53,10 +53,10 @@ $resql = $db->query($sql); if ($resql) { - $row = $db->fetch_object($resql); - if ($row) + $obj = $db->fetch_object($resql); + if ($obj) { - $found = $row->nom; + $found = $obj->name; } $db->free($resql); } diff --git a/htdocs/bookmarks/fiche.php b/htdocs/bookmarks/fiche.php index 1e9a3cd23bc75..67bd962e747ce 100644 --- a/htdocs/bookmarks/fiche.php +++ b/htdocs/bookmarks/fiche.php @@ -230,7 +230,6 @@ { $fuser=new User($db); $fuser->fetch($bookmark->fk_user); - //$fuser->nom=$fuser->login; $fuser->prenom=''; print $fuser->getNomUrl(1); } else diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index a9664d8dc861a..10bbd015cf67d 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -127,7 +127,7 @@ require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); $societe=new Societe($db); $societe->fetch($obj->rowid); - $obj->title=$societe->nom; + $obj->title=$societe->name; } $title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title; } diff --git a/htdocs/boutique/client/class/boutiqueclient.class.php b/htdocs/boutique/client/class/boutiqueclient.class.php index 837afb5497ce6..a84b81ed6a7e9 100644 --- a/htdocs/boutique/client/class/boutiqueclient.class.php +++ b/htdocs/boutique/client/class/boutiqueclient.class.php @@ -37,11 +37,11 @@ class BoutiqueClient /** * Constructor * - * @param DoliDB $DB Database handler + * @param DoliDB $db Database handler */ - function BoutiqueClient($DB) + function BoutiqueClient($db) { - $this->db = $DB; + $this->db = $db; } /** diff --git a/htdocs/boutique/client/fiche.php b/htdocs/boutique/client/fiche.php index 85e2c8f99b412..bd6428684e490 100644 --- a/htdocs/boutique/client/fiche.php +++ b/htdocs/boutique/client/fiche.php @@ -33,12 +33,7 @@ * Actions */ -if ($action == 'update' && !$cancel) -{ - $client = new BoutiqueClient($dbosc); - $client->nom = $nom; - $client->update($id, $user); -} +// None diff --git a/htdocs/boutique/notification/fiche.php b/htdocs/boutique/notification/fiche.php deleted file mode 100644 index a1071d71ddb5d..0000000000000 --- a/htdocs/boutique/notification/fiche.php +++ /dev/null @@ -1,152 +0,0 @@ - - * Copyright (C) 2004-2006 Laurent Destailleur - * - * 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 - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file htdocs/boutique/notification/fiche.php - * \ingroup boutique - * \brief Page fiche notification OS Commerce - */ - -require("../../main.inc.php"); -require_once(DOL_DOCUMENT_ROOT.'/boutique/osc_master.inc.php'); - - -/* - * View - */ - -llxHeader(); - -if ($action == 'add') { - $editeur = new Editeur($dbosc); - - $editeur->nom = $nom; - - $id = $editeur->create($user); -} - -if ($action == 'addga') { - $editeur = new Editeur($dbosc); - - $editeur->linkga($id, $ga); -} - - -if ($action == 'update' && !$cancel) { - $editeur = new Editeur($dbosc); - - $editeur->nom = $nom; - - $editeur->update($id, $user); -} - -/* - * - * - */ -if ($action == 'create') -{ - - print "
\n"; - print ''; - print ''; - - print '
Nouvel Editeur

'; - - print ''; - print ""; - print ''; - print ''; - print '
Nom
 
'; - print '
'; - - -} -else -{ - if ($id) - { - - $editeur = new Editeur($dbosc); - $result = $editeur->fetch($id); - - if ( $result ) - { - if ($action == 'edit') - { - print '
Edition de la fiche Editeur : '.$editeur->titre.'

'; - - print "
\n"; - print ''; - print ''; - - print ''; - print ""; - print ''; - - - print ''; - - print ''; - - print '
Nom
 

'; - - } - - print '
Fiche Editeur : '.$editeur->titre.'

'; - - print ''; - print ""; - print ''; - print "
Nom'.$editeur->nom.'
"; - - - - } - else - { - print "Fetch failed"; - } - - - } - else - { - print "Error"; - } -} - -/* ************************************************************************** */ -/* */ -/* Barre d'action */ -/* */ -/* ************************************************************************** */ - - -print '
'; -if ($action != 'create') -{ - print ''.$langs->trans("Modify").''; -} -print '
'; - - -$dbosc->close(); - -llxFooter(); -?> diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 95916e0638816..c3512c1b7d1d3 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -678,7 +678,7 @@ function fetch($rowid, $ref='', $ref_ext='', $ref_int='', $idprof1='',$idprof2=' $this->ref = $obj->rowid; $this->name = $obj->name; - $this->nom = $obj->name; // TODO obsolete + $this->nom = $obj->name; // deprecated $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; @@ -1333,6 +1333,8 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0) { global $conf,$langs; + $name=$this->name?$this->name:$this->nom; + $result=''; $lien=$lienfin=''; @@ -1365,8 +1367,6 @@ function getNomUrl($withpicto=0,$option='',$maxlen=0) $lien.=(!empty($this->canvas)?'&canvas='.$this->canvas:'').'">'; $lienfin=''; - $name=$this->name?$this->name:$this->nom; - if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); if ($withpicto && $withpicto != 2) $result.=' '; $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; diff --git a/htdocs/user/class/usergroup.class.php b/htdocs/user/class/usergroup.class.php index a1b95bec331ed..9162dc04e390b 100644 --- a/htdocs/user/class/usergroup.class.php +++ b/htdocs/user/class/usergroup.class.php @@ -75,7 +75,7 @@ function fetch($id) $this->id = $id; - $sql = "SELECT g.rowid, g.entity, g.nom, g.note, g.datec, g.tms as datem"; + $sql = "SELECT g.rowid, g.entity, g.nom as name, g.note, g.datec, g.tms as datem"; $sql.= " FROM ".MAIN_DB_PREFIX."usergroup as g"; $sql.= " WHERE g.rowid = ".$this->id; @@ -90,7 +90,8 @@ function fetch($id) $this->id = $obj->rowid; $this->ref = $obj->rowid; $this->entity = $obj->entity; - $this->nom = $obj->nom; + $this->nom = $obj->name; // depecated + $this->name = $obj->name; $this->note = $obj->note; $this->datec = $obj->datec; $this->datem = $obj->datem; @@ -106,7 +107,7 @@ function fetch($id) else { $this->error=$this->db->lasterror(); - dol_syslog(get_class($this)."::Fetch ".$this->error, LOG_ERR); + dol_syslog(get_class($this)."::fetch ".$this->error, LOG_ERR); return -1; } } diff --git a/scripts/company/export-contacts-xls-example.php b/scripts/company/export-contacts-xls-example.php index 613f4b524957b..bdef2e43d4018 100644 --- a/scripts/company/export-contacts-xls-example.php +++ b/scripts/company/export-contacts-xls-example.php @@ -70,7 +70,7 @@ //$page->set_column(0,4,18); // A -$sql = "SELECT distinct c.name, c.firstname, c.email, s.nom"; +$sql = "SELECT distinct c.name as lastname, c.firstname, c.email, s.nom as name"; $sql.= " FROM ".MAIN_DB_PREFIX."socpeople as c"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = c.fk_soc"; @@ -84,27 +84,19 @@ $i = 0; $j = 1; - //$page->write_string(0, 0, $langs->trans("ThirdParty")); $objPHPExcel->getActiveSheet()->SetCellValue('A1', $langs->trans("Firstname")); - //$page->write_string(0, 1, $langs->trans("Firstname")); $objPHPExcel->getActiveSheet()->SetCellValue('B1', $langs->trans("Lastname")); - //$page->write_string(0, 2, $langs->trans("Lastname")); $objPHPExcel->getActiveSheet()->SetCellValue('C1', $langs->trans("Email")); - //$page->write_string(0, 3, $langs->trans("Email")); $objPHPExcel->getActiveSheet()->SetCellValue('D1', $langs->trans("ThirdPart")); while ($i < $num) { $obj = $db->fetch_object($resql); - //$page->write_string($j, 0, $obj->nom); $objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+2), $obj->firstname); - //$page->write_string($j, 1, $obj->firstname); - $objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->name); - //$page->write_string($j, 2, $obj->name); + $objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->lastname); $objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+2), $obj->email); - //$page->write_string($j, 3, $obj->email); - $objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->nom); + $objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->name); $j++; $i++; diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index 9a456a7376799..aaf966eb3dc25 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -93,7 +93,7 @@ // On choisit les mails non deja envoyes pour ce mailing (statut=0) // ou envoyes en erreur (statut=-1) -$sql = "SELECT mc.rowid, mc.nom, mc.prenom, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type"; +$sql = "SELECT mc.rowid, mc.nom as lastname, mc.prenom as firstname, mc.email, mc.other, mc.source_url, mc.source_id, mc.source_type"; $sql .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc"; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id; @@ -123,7 +123,7 @@ $obj = $db->fetch_object($resql); // sendto en RFC2822 - $sendto = str_replace(',',' ',$obj->prenom." ".$obj->nom) ." <".$obj->email.">"; + $sendto = str_replace(',',' ',$obj->firstname." ".$obj->lastname) ." <".$obj->email.">"; // Make subtsitutions on topic and body $other=explode(';',$obj->other); @@ -135,8 +135,8 @@ $substitutionarray=array( '__ID__' => $obj->source_id, '__EMAIL__' => $obj->email, - '__LASTNAME__' => $obj->nom, - '__FIRSTNAME__' => $obj->prenom, + '__LASTNAME__' => $obj->lastname, + '__FIRSTNAME__' => $obj->firstname, '__OTHER1__' => $other1, '__OTHER2__' => $other2, '__OTHER3__' => $other3, diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index ea7ad07159961..5007e69b5a63e 100644 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -47,7 +47,7 @@ $error = 0; -$sql = "SELECT f.facnumber, f.total_ttc, s.nom, u.name, u.firstname, u.email"; +$sql = "SELECT f.facnumber, f.total_ttc, s.nom as name, u.name, u.firstname, u.email"; $sql .= " FROM ".MAIN_DB_PREFIX."facture as f"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -85,7 +85,7 @@ $total = 0; } - $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->nom."\n"; + $message .= "Facture ".$obj->facnumber." : ".price($obj->total_ttc)." : ".$obj->name."\n"; $total += $obj->total_ttc; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 37a7898527eea..b54d3f1a33ea1 100644 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -181,23 +181,25 @@ $member = new Adherent($db); // Propriete membre - $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; - $member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; + $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; // deprecated + $member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; // deprecated + $member->firstname=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; + $member->lastname=$ldapuser[$conf->global->LDAP_FIELD_NAME]; $member->login=$ldapuser[$conf->global->LDAP_FIELD_LOGIN]; $member->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD]; //$member->societe; - $member->adresse=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; // TODO obsolete + $member->adresse=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; // deprecated $member->address=$ldapuser[$conf->global->LDAP_FIELD_ADDRESS]; - $member->cp=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; // TODO obsolete + $member->cp=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; // deprecated $member->zip=$ldapuser[$conf->global->LDAP_FIELD_ZIP]; - $member->ville=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; // TODO obsolete + $member->ville=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; // deprecated $member->town=$ldapuser[$conf->global->LDAP_FIELD_TOWN]; - $member->pays=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; // TODO obsolete + $member->pays=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; // deprecated $member->country=$ldapuser[$conf->global->LDAP_FIELD_COUNTRY]; - $member->pays_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; // TODO obsolete + $member->pays_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; // deprecated $member->country_id=$countries[$hashlib2rowid[strtolower($member->country)]]['rowid']; - $member->pays_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; // TODO obsolete + $member->pays_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; // deprecated $member->country_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code']; $member->phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE]; diff --git a/scripts/user/sync_groups_dolibarr2ldap.php b/scripts/user/sync_groups_dolibarr2ldap.php index 8eaa50518947b..0deafa514e9ce 100644 --- a/scripts/user/sync_groups_dolibarr2ldap.php +++ b/scripts/user/sync_groups_dolibarr2ldap.php @@ -82,7 +82,7 @@ $fgroup->id = $obj->rowid; $fgroup->fetch($fgroup->id); - print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->nom; + print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->name; $oldobject=$fgroup;