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 "';
-
-
-}
-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 "