Qual: Uniformize code

This commit is contained in:
Laurent Destailleur 2012-01-30 10:22:50 +01:00
parent 2a90f17717
commit 52b522e087
24 changed files with 106 additions and 255 deletions

View File

@ -156,7 +156,7 @@ if ($action == 'setsocid')
$thirdparty=new Societe($db); $thirdparty=new Societe($db);
$thirdparty->fetch(GETPOST("socid")); $thirdparty->fetch(GETPOST("socid"));
$error++; $error++;
$mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>'; $mesg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
} }
} }
@ -949,7 +949,7 @@ if ($rowid)
print '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter'); print '<tr class="bankswitchclass2 fieldrequireddyn"><td>'.$langs->trans('CheckTransmitter');
print ' <em>('.$langs->trans("ChequeMaker").')</em>'; print ' <em>('.$langs->trans("ChequeMaker").')</em>';
print '</td>'; print '</td>';
print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->nom:$_POST['chqemetteur']).'"></td></tr>'; print '<td><input id="fieldchqemetteur" name="chqemetteur" size="32" type="text" value="'.(empty($_POST['chqemetteur'])?$facture->client->name:$_POST['chqemetteur']).'"></td></tr>';
print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank'); print '<tr class="bankswitchclass2"><td>'.$langs->trans('Bank');
print ' <em>('.$langs->trans("ChequeBank").')</em>'; print ' <em>('.$langs->trans("ChequeBank").')</em>';

View File

@ -57,7 +57,7 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
$arrayofmembers=array(); $arrayofmembers=array();
// requete en prenant que les adherents a jour de cotisation // 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.= " d.adresse, d.cp, d.ville, d.naiss, d.email, d.photo,";
$sql.= " t.libelle as type,"; $sql.= " t.libelle as type,";
$sql.= " p.libelle as pays"; $sql.= " p.libelle as pays";
@ -81,8 +81,8 @@ if ((! empty($foruserid) || ! empty($foruserlogin) || ! empty($mode)) && ! $mesg
// List of values to scan for a replacement // List of values to scan for a replacement
$substitutionarray = array ( $substitutionarray = array (
'%PRENOM%'=>$objp->prenom, '%PRENOM%'=>$objp->firstname,
'%NOM%'=>$objp->nom, '%NOM%'=>$objp->lastname,
'%LOGIN%'=>$objp->login, '%LOGIN%'=>$objp->login,
'%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/", '%SERVEUR%'=>"http://".$_SERVER["SERVER_NAME"]."/",
'%SOCIETE%'=>$objp->societe, '%SOCIETE%'=>$objp->societe,

View File

@ -509,8 +509,10 @@ class Adherent extends CommonObject
if ($result >= 0) if ($result >= 0)
{ {
$luser->civilite_id=$this->civilite_id; $luser->civilite_id=$this->civilite_id;
$luser->prenom=$this->prenom; $luser->firstname=$this->firstname;
$luser->nom=$this->nom; $luser->lastname=$this->lastname;
$luser->prenom=$this->firstname; // deprecated
$luser->nom=$this->lastname; // deprecated
$luser->login=$this->user_login; $luser->login=$this->user_login;
$luser->pass=$this->pass; $luser->pass=$this->pass;
$luser->societe_id=$this->societe; $luser->societe_id=$this->societe;
@ -1000,19 +1002,19 @@ class Adherent extends CommonObject
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->civilite_id = $obj->civilite; $this->civilite_id = $obj->civilite;
$this->prenom = $obj->firstname; $this->prenom = $obj->firstname; // deprecated
$this->firstname = $obj->firstname; $this->firstname = $obj->firstname;
$this->nom = $obj->lastname; $this->nom = $obj->lastname; // deprecated
$this->lastname = $obj->lastname; $this->lastname = $obj->lastname;
$this->login = $obj->login; $this->login = $obj->login;
$this->pass = $obj->pass; $this->pass = $obj->pass;
$this->societe = $obj->societe; $this->societe = $obj->societe;
$this->fk_soc = $obj->fk_soc; $this->fk_soc = $obj->fk_soc;
$this->adresse = $obj->address; // TODO deprecated $this->adresse = $obj->address; // deprecated
$this->address = $obj->address; $this->address = $obj->address;
$this->cp = $obj->zip; // TODO deprecated $this->cp = $obj->zip; // deprecated
$this->zip = $obj->zip; $this->zip = $obj->zip;
$this->ville = $obj->town; // TODO deprecated $this->ville = $obj->town; // deprecated
$this->town = $obj->town; $this->town = $obj->town;
$this->state_id = $obj->fk_departement; $this->state_id = $obj->fk_departement;
@ -1427,7 +1429,7 @@ class Adherent extends CommonObject
{ {
$mdpass=dol_hash($this->pass); $mdpass=dol_hash($this->pass);
$htpass=crypt($this->pass,makesalt()); $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); $mydb=getDoliDBInstance('mysql',ADHERENT_SPIP_SERVEUR,ADHERENT_SPIP_USER,ADHERENT_SPIP_PASS,ADHERENT_SPIP_DB,ADHERENT_SPIP_PORT);
@ -1683,12 +1685,16 @@ class Adherent extends CommonObject
* @param Translate $langs Language object for translation of civility * @param Translate $langs Language object for translation of civility
* @param int $option 0=No option, 1=Add civility * @param int $option 0=No option, 1=Add civility
* @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname * @param int $nameorder -1=Auto, 0=Lastname+Firstname, 1=Firstname+Lastname
* @param int $maxlen Maximum length
* @return string String with full name * @return string String with full name
*/ */
function getFullName($langs,$option=0,$nameorder=-1) function getFullName($langs,$option=0,$nameorder=-1,$maxlen=0)
{ {
global $conf; 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=''; $ret='';
if ($option && $this->civilite_id) if ($option && $this->civilite_id)
{ {
@ -1701,17 +1707,17 @@ class Adherent extends CommonObject
if ($nameorder) if ($nameorder)
{ {
if ($this->prenom) $ret.=$this->prenom; $ret.=$this->firstname;
if ($this->prenom && $this->nom) $ret.=' '; if ($this->firstname && $this->lastname) $ret.=' ';
if ($this->nom) $ret.=$this->nom; $ret.=$this->lastname;
} }
else else
{ {
if ($this->nom) $ret.=$this->nom; $ret.=$this->lastname;
if ($this->prenom && $this->nom) $ret.=' '; if ($this->firstname && $this->lastname) $ret.=' ';
if ($this->prenom) $ret.=$this->prenom; $ret.=$this->firstname;
} }
return trim($ret); return dol_trunc($ret,$maxlen);
} }
@ -1983,8 +1989,8 @@ class Adherent extends CommonObject
$this->id=0; $this->id=0;
$this->specimen=1; $this->specimen=1;
$this->civilite_id = 0; $this->civilite_id = 0;
$this->nom = 'DOLIBARR'; $this->lastname = 'DOLIBARR';
$this->prenom = 'SPECIMEN'; $this->firstname = 'SPECIMEN';
$this->login='dolibspec'; $this->login='dolibspec';
$this->pass='dolibspec'; $this->pass='dolibspec';
$this->societe = 'Societe ABC'; $this->societe = 'Societe ABC';

View File

@ -64,7 +64,7 @@ llxHeader('',$langs->trans("ListOfSubscriptions"),'EN:Module_Foundations|FR:Modu
if ($msg) print $msg.'<br>'; if ($msg) print $msg.'<br>';
// Liste des cotisations // 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.rowid as crowid, c.cotisation,";
$sql.= " c.dateadh,"; $sql.= " c.dateadh,";
$sql.= " c.datef,"; $sql.= " c.datef,";
@ -123,7 +123,9 @@ if ($result)
$cotisation->ref=$objp->crowid; $cotisation->ref=$objp->crowid;
$cotisation->id=$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->id=$objp->rowid;
$adherent->login=$objp->login; $adherent->login=$objp->login;

View File

@ -172,11 +172,11 @@ if ($id > 0)
print '</tr>'; print '</tr>';
// Nom // Nom
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->nom.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$member->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Prenom // Prenom
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->prenom.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$member->firstname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Status // Status

View File

@ -137,7 +137,7 @@ if ($_POST['action'] == 'setsocid')
$thirdparty=new Societe($db); $thirdparty=new Societe($db);
$thirdparty->fetch($_POST["socid"]); $thirdparty->fetch($_POST["socid"]);
$error++; $error++;
$errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->nom).'</div>'; $errmsg='<div class="error">'.$langs->trans("ErrorMemberIsAlreadyLinkedToThisThirdParty",$othermember->getFullName($langs),$othermember->login,$thirdparty->name).'</div>';
} }
} }
@ -223,8 +223,10 @@ if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->adhe
// Change values // Change values
$object->civilite_id = trim($_POST["civilite_id"]); $object->civilite_id = trim($_POST["civilite_id"]);
$object->prenom = trim($_POST["prenom"]); $object->prenom = trim($_POST["prenom"]); // deprecated
$object->nom = trim($_POST["nom"]); $object->nom = trim($_POST["nom"]); // deprecated
$object->firstname = trim($_POST["prenom"]);
$object->lastname = trim($_POST["nom"]);
$object->login = trim($_POST["login"]); $object->login = trim($_POST["login"]);
$object->pass = trim($_POST["pass"]); $object->pass = trim($_POST["pass"]);
@ -380,8 +382,10 @@ if ($_POST["action"] == 'add' && $user->rights->adherent->creer)
$socid=$_POST["socid"]; $socid=$_POST["socid"];
$object->civilite_id = $civilite_id; $object->civilite_id = $civilite_id;
$object->prenom = $prenom; $object->prenom = $prenom; // deprecated
$object->nom = $nom; $object->nom = $nom; // deprecated
$object->firstname = $prenom;
$object->lastname = $nom;
$object->societe = $societe; $object->societe = $societe;
$object->adresse = $address; // deprecated $object->adresse = $address; // deprecated
$object->address = $address; $object->address = $address;
@ -692,11 +696,11 @@ if ($action == 'create')
print '</tr>'; print '</tr>';
// Lastname // Lastname
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->nom).'" size="40"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'" size="40"></td>';
print '</tr>'; print '</tr>';
// Firstname // Firstname
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->prenom).'"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
print '</tr>'; print '</tr>';
// Password // Password
@ -923,11 +927,11 @@ if ($action == 'edit')
print '</tr>'; print '</tr>';
// Name // Name
print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->nom).'"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Lastname").'</span></td><td><input type="text" name="nom" size="40" value="'.(isset($_POST["nom"])?$_POST["nom"]:$object->lastname).'"></td>';
print '</tr>'; print '</tr>';
// Firstname // Firstname
print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->prenom).'"></td>'; print '<tr><td><span class="fieldrequired">'.$langs->trans("Firstname").'</td><td><input type="text" name="prenom" size="40" value="'.(isset($_POST["prenom"])?$_POST["prenom"]:$object->firstname).'"></td>';
print '</tr>'; print '</tr>';
// Password // Password
@ -1074,9 +1078,9 @@ if ($rowid && $action != 'edit')
{ {
// Full firstname and name separated with a dot : firstname.name // Full firstname and name separated with a dot : firstname.name
include_once(DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'); 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 // Create a form array
$formquestion=array( $formquestion=array(
@ -1246,11 +1250,11 @@ if ($rowid && $action != 'edit')
print '</tr>'; print '</tr>';
// Name // Name
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->nom.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$object->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Firstname // Firstname
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->prenom.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur">'.$object->firstname.'&nbsp;</td></tr>';
// Password // Password
if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED)) if (empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED))

View File

@ -203,7 +203,7 @@ $var=true;
*/ */
$max=5; $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.= " a.tms as datem, datefin as date_end_subscription,";
$sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation"; $sql.= " ta.rowid as typeid, ta.libelle, ta.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta"; $sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as ta";
@ -229,8 +229,8 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
$staticmember->id=$obj->rowid; $staticmember->id=$obj->rowid;
$staticmember->nom=$obj->nom; $staticmember->lastname=$obj->lastname;
$staticmember->prenom=$obj->prenom; $staticmember->firstname=$obj->firstname;
$staticmember->ref=$staticmember->getFullName($langs); $staticmember->ref=$staticmember->getFullName($langs);
$statictype->id=$obj->typeid; $statictype->id=$obj->typeid;
$statictype->libelle=$obj->libelle; $statictype->libelle=$obj->libelle;
@ -283,8 +283,8 @@ if ($resql)
$subscriptionstatic->id=$obj->cid; $subscriptionstatic->id=$obj->cid;
$subscriptionstatic->ref=$obj->cid; $subscriptionstatic->ref=$obj->cid;
$staticmember->id=$obj->rowid; $staticmember->id=$obj->rowid;
$staticmember->nom=$obj->nom; $staticmember->lastname=$obj->lastname;
$staticmember->prenom=$obj->prenom; $staticmember->firstname=$obj->firstname;
$staticmember->ref=$staticmember->getFullName($langs); $staticmember->ref=$staticmember->getFullName($langs);
print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>'; print '<td>'.$subscriptionstatic->getNomUrl(1).'</td>';
print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>'; print '<td>'.$staticmember->getNomUrl(1,24,'subscription').'</td>';

View File

@ -109,11 +109,11 @@ print $form->showrefnav($adh,'id');
print '</td></tr>'; print '</td></tr>';
// Nom // Nom
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->nom.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur">'.$adh->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Prenom // Prenom
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->prenom.'&nbsp;</td>'; print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td class="valeur">'.$adh->firstname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Login // Login

View File

@ -79,7 +79,7 @@ llxHeader('',$langs->trans("Member"),'EN:Module_Foundations|FR:Module_Adh&eacute
$now=dol_now(); $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.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation"; $sql.= " t.libelle as type, t.cotisation";
@ -258,8 +258,8 @@ if ($resql)
// Nom // Nom
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
$memberstatic->nom=$objp->nom; $memberstatic->lastname=$objp->lastname;
$memberstatic->prenom=$objp->prenom; $memberstatic->firstname=$objp->firstname;
if ($objp->societe != '') if ($objp->societe != '')
{ {
print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n"; print "<td><a href=\"fiche.php?rowid=$objp->rowid\">".img_object($langs->trans("ShowMember"),"user").' '.dol_trunc($memberstatic->getFullName($langs))." / ".dol_trunc($objp->societe,12)."</a></td>\n";

View File

@ -120,11 +120,11 @@ if ($id)
print '</tr>'; print '</tr>';
// Lastname // Lastname
print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$adh->nom.'&nbsp;</td>'; print '<tr><td>'.$langs->trans("Lastname").'</td><td class="valeur" colspan="3">'.$adh->lastname.'&nbsp;</td>';
print '</tr>'; print '</tr>';
// Firstname // Firstname
print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$adh->prenom.'&nbsp;</td></tr>'; print '<tr><td>'.$langs->trans("Firstname").'</td><td class="valeur" colspan="3">'.$adh->firstname.'&nbsp;</td></tr>';
// Status // Status
print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut(4).'</td></tr>'; print '<tr><td>'.$langs->trans("Status").'</td><td class="valeur">'.$adh->getLibStatut(4).'</td></tr>';

View File

@ -338,7 +338,7 @@ if ($rowid > 0)
$membertypestatic=new AdherentType($db); $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.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,"; $sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation"; $sql.= " t.libelle as type, t.cotisation";
@ -486,17 +486,19 @@ if ($rowid > 0)
$datefin=$db->jdate($objp->datefin); $datefin=$db->jdate($objp->datefin);
$adh=new Adherent($db); $adh=new Adherent($db);
$adh->lastname=$objp->lastname;
$adh->firstname=$objp->firstname;
// Nom // Nom
$var=!$var; $var=!$var;
print '<tr '.$bc[$var].'>'; print '<tr '.$bc[$var].'>';
if ($objp->societe != '') if ($objp->societe != '')
{ {
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom,12).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n"; print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,20).' / '.dol_trunc($objp->societe,12).'</a></td>'."\n";
} }
else else
{ {
print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$objp->prenom.' '.dol_trunc($objp->nom).'</a></td>'."\n"; print '<td><a href="fiche.php?rowid='.$objp->rowid.'">'.img_object($langs->trans("ShowMember"),"user").' '.$adh->getFullName($langs,0,-1,32).'</a></td>'."\n";
} }
// Login // Login
@ -627,7 +629,7 @@ if ($rowid > 0)
print "</td></tr>"; print "</td></tr>";
print '</table>'; print '</table>';
print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; &nbsp;'; print '<center><input type="submit" class="button" value="'.$langs->trans("Save").'"> &nbsp; &nbsp;';
print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>'; print '<input type="submit" name="button" class="button" value="'.$langs->trans("Cancel").'"></center>';

View File

@ -40,7 +40,7 @@ if (empty($phone))
exit; 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.= " LEFT JOIN ".MAIN_DB_PREFIX."socpeople as sp ON sp.fk_soc = s.rowid";
$sql.= " WHERE s.entity=".$conf->entity; $sql.= " WHERE s.entity=".$conf->entity;
$sql.= " AND (s.tel='".$db->escape($phone)."'"; $sql.= " AND (s.tel='".$db->escape($phone)."'";
@ -53,10 +53,10 @@ dol_syslog('cidlookup search information with phone '.$phone, LOG_DEBUG);
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {
$row = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
if ($row) if ($obj)
{ {
$found = $row->nom; $found = $obj->name;
} }
$db->free($resql); $db->free($resql);
} }

View File

@ -230,7 +230,6 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
{ {
$fuser=new User($db); $fuser=new User($db);
$fuser->fetch($bookmark->fk_user); $fuser->fetch($bookmark->fk_user);
//$fuser->nom=$fuser->login; $fuser->prenom='';
print $fuser->getNomUrl(1); print $fuser->getNomUrl(1);
} }
else else

View File

@ -127,7 +127,7 @@ if ($resql)
require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php"); require_once(DOL_DOCUMENT_ROOT."/societe/class/societe.class.php");
$societe=new Societe($db); $societe=new Societe($db);
$societe->fetch($obj->rowid); $societe->fetch($obj->rowid);
$obj->title=$societe->nom; $obj->title=$societe->name;
} }
$title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title; $title=img_object($langs->trans("ShowCompany"),"company").' '.$obj->title;
} }

View File

@ -37,11 +37,11 @@ class BoutiqueClient
/** /**
* Constructor * Constructor
* *
* @param DoliDB $DB Database handler * @param DoliDB $db Database handler
*/ */
function BoutiqueClient($DB) function BoutiqueClient($db)
{ {
$this->db = $DB; $this->db = $db;
} }
/** /**

View File

@ -33,12 +33,7 @@ include_once(DOL_DOCUMENT_ROOT.'/boutique/client/class/boutiqueclient.class.php'
* Actions * Actions
*/ */
if ($action == 'update' && !$cancel) // None
{
$client = new BoutiqueClient($dbosc);
$client->nom = $nom;
$client->update($id, $user);
}

View File

@ -1,152 +0,0 @@
<?php
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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 <http://www.gnu.org/licenses/>.
*/
/**
* \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 "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print '<div class="titre">Nouvel Editeur</div><br>';
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>";
print '<td>Nom</td><td><input name="nom" size="40" value=""></td></tr>';
print '<tr><td>&nbsp;</td><td><input type="submit" value="Cr<43>er"></td></tr>';
print '</table>';
print '</form>';
}
else
{
if ($id)
{
$editeur = new Editeur($dbosc);
$result = $editeur->fetch($id);
if ( $result )
{
if ($action == 'edit')
{
print '<div class="titre">Edition de la fiche Editeur : '.$editeur->titre.'</div><br>';
print "<form action=\"fiche.php?id=$id\" method=\"post\">\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>";
print '<td width="20%">Nom</td><td><input name="nom" size="40" value="'.$editeur->nom.'"></td>';
print '<tr><td colspan="2" align="center"><input type="submit" value="'.$langs->trans("Save").'">&nbsp;<input type="submit" value="'.$langs->trans("Cancel").'" name="cancel"></td></tr>';
print '</form>';
print '</table><hr>';
}
print '<div class="titre">Fiche Editeur : '.$editeur->titre.'</div><br>';
print '<table border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<tr>";
print '<td width="20%">Nom</td><td width="30%">'.$editeur->nom.'</td></tr>';
print "</table>";
}
else
{
print "Fetch failed";
}
}
else
{
print "Error";
}
}
/* ************************************************************************** */
/* */
/* Barre d'action */
/* */
/* ************************************************************************** */
print '<div class="tabsAction">';
if ($action != 'create')
{
print '<a class="butAction" href="fiche.php?action=edit&id='.$id.'">'.$langs->trans("Modify").'</a>';
}
print '</div>';
$dbosc->close();
llxFooter();
?>

View File

@ -678,7 +678,7 @@ class Societe extends CommonObject
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->name = $obj->name; $this->name = $obj->name;
$this->nom = $obj->name; // TODO obsolete $this->nom = $obj->name; // deprecated
$this->ref_ext = $obj->ref_ext; $this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int; $this->ref_int = $obj->ref_int;
@ -1333,6 +1333,8 @@ class Societe extends CommonObject
{ {
global $conf,$langs; global $conf,$langs;
$name=$this->name?$this->name:$this->nom;
$result=''; $result='';
$lien=$lienfin=''; $lien=$lienfin='';
@ -1365,8 +1367,6 @@ class Societe extends CommonObject
$lien.=(!empty($this->canvas)?'&amp;canvas='.$this->canvas:'').'">'; $lien.=(!empty($this->canvas)?'&amp;canvas='.$this->canvas:'').'">';
$lienfin='</a>'; $lienfin='</a>';
$name=$this->name?$this->name:$this->nom;
if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin); if ($withpicto) $result.=($lien.img_object($langs->trans("ShowCompany").': '.$name,'company').$lienfin);
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin; $result.=$lien.($maxlen?dol_trunc($name,$maxlen):$name).$lienfin;

View File

@ -75,7 +75,7 @@ class UserGroup extends CommonObject
$this->id = $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.= " FROM ".MAIN_DB_PREFIX."usergroup as g";
$sql.= " WHERE g.rowid = ".$this->id; $sql.= " WHERE g.rowid = ".$this->id;
@ -90,7 +90,8 @@ class UserGroup extends CommonObject
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->entity = $obj->entity; $this->entity = $obj->entity;
$this->nom = $obj->nom; $this->nom = $obj->name; // depecated
$this->name = $obj->name;
$this->note = $obj->note; $this->note = $obj->note;
$this->datec = $obj->datec; $this->datec = $obj->datec;
$this->datem = $obj->datem; $this->datem = $obj->datem;
@ -106,7 +107,7 @@ class UserGroup extends CommonObject
else else
{ {
$this->error=$this->db->lasterror(); $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; return -1;
} }
} }

View File

@ -70,7 +70,7 @@ $objPHPExcel->getActiveSheet()->setTitle('Contacts');
//$page->set_column(0,4,18); // A //$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.= " FROM ".MAIN_DB_PREFIX."socpeople as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = c.fk_soc"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = c.fk_soc";
@ -84,27 +84,19 @@ if ($resql)
$i = 0; $i = 0;
$j = 1; $j = 1;
//$page->write_string(0, 0, $langs->trans("ThirdParty"));
$objPHPExcel->getActiveSheet()->SetCellValue('A1', $langs->trans("Firstname")); $objPHPExcel->getActiveSheet()->SetCellValue('A1', $langs->trans("Firstname"));
//$page->write_string(0, 1, $langs->trans("Firstname"));
$objPHPExcel->getActiveSheet()->SetCellValue('B1', $langs->trans("Lastname")); $objPHPExcel->getActiveSheet()->SetCellValue('B1', $langs->trans("Lastname"));
//$page->write_string(0, 2, $langs->trans("Lastname"));
$objPHPExcel->getActiveSheet()->SetCellValue('C1', $langs->trans("Email")); $objPHPExcel->getActiveSheet()->SetCellValue('C1', $langs->trans("Email"));
//$page->write_string(0, 3, $langs->trans("Email"));
$objPHPExcel->getActiveSheet()->SetCellValue('D1', $langs->trans("ThirdPart")); $objPHPExcel->getActiveSheet()->SetCellValue('D1', $langs->trans("ThirdPart"));
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
//$page->write_string($j, 0, $obj->nom);
$objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+2), $obj->firstname); $objPHPExcel->getActiveSheet()->SetCellValue('A'.($i+2), $obj->firstname);
//$page->write_string($j, 1, $obj->firstname); $objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->lastname);
$objPHPExcel->getActiveSheet()->SetCellValue('B'.($i+2), $obj->name);
//$page->write_string($j, 2, $obj->name);
$objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+2), $obj->email); $objPHPExcel->getActiveSheet()->SetCellValue('C'.($i+2), $obj->email);
//$page->write_string($j, 3, $obj->email); $objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->name);
$objPHPExcel->getActiveSheet()->SetCellValue('D'.($i+2), $obj->nom);
$j++; $j++;
$i++; $i++;

View File

@ -93,7 +93,7 @@ $nbok=0; $nbko=0;
// On choisit les mails non deja envoyes pour ce mailing (statut=0) // On choisit les mails non deja envoyes pour ce mailing (statut=0)
// ou envoyes en erreur (statut=-1) // 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 .= " FROM ".MAIN_DB_PREFIX."mailing_cibles as mc";
$sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id; $sql .= " WHERE mc.statut < 1 AND mc.fk_mailing = ".$id;
@ -123,7 +123,7 @@ if ($resql)
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
// sendto en RFC2822 // 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 // Make subtsitutions on topic and body
$other=explode(';',$obj->other); $other=explode(';',$obj->other);
@ -135,8 +135,8 @@ if ($resql)
$substitutionarray=array( $substitutionarray=array(
'__ID__' => $obj->source_id, '__ID__' => $obj->source_id,
'__EMAIL__' => $obj->email, '__EMAIL__' => $obj->email,
'__LASTNAME__' => $obj->nom, '__LASTNAME__' => $obj->lastname,
'__FIRSTNAME__' => $obj->prenom, '__FIRSTNAME__' => $obj->firstname,
'__OTHER1__' => $other1, '__OTHER1__' => $other1,
'__OTHER2__' => $other2, '__OTHER2__' => $other2,
'__OTHER3__' => $other3, '__OTHER3__' => $other3,

View File

@ -47,7 +47,7 @@ require_once (DOL_DOCUMENT_ROOT."/core/class/CMailFile.class.php");
$error = 0; $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 .= " FROM ".MAIN_DB_PREFIX."facture as f";
$sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."societe as s";
$sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql .= " , ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@ -85,7 +85,7 @@ if ($resql)
$total = 0; $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; $total += $obj->total_ttc;
dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email);

View File

@ -181,23 +181,25 @@ if ($result >= 0)
$member = new Adherent($db); $member = new Adherent($db);
// Propriete membre // Propriete membre
$member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; $member->prenom=$ldapuser[$conf->global->LDAP_FIELD_FIRSTNAME]; // deprecated
$member->nom=$ldapuser[$conf->global->LDAP_FIELD_NAME]; $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->login=$ldapuser[$conf->global->LDAP_FIELD_LOGIN];
$member->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD]; $member->pass=$ldapuser[$conf->global->LDAP_FIELD_PASSWORD];
//$member->societe; //$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->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->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->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->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->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->country_code=$countries[$hashlib2rowid[strtolower($member->country)]]['code'];
$member->phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE]; $member->phone=$ldapuser[$conf->global->LDAP_FIELD_PHONE];

View File

@ -82,7 +82,7 @@ if ($resql)
$fgroup->id = $obj->rowid; $fgroup->id = $obj->rowid;
$fgroup->fetch($fgroup->id); $fgroup->fetch($fgroup->id);
print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->nom; print $langs->trans("UpdateGroup")." rowid=".$fgroup->id." ".$fgroup->name;
$oldobject=$fgroup; $oldobject=$fgroup;