Fix: Missing name
This commit is contained in:
parent
cb37a8475a
commit
f3a966a313
@ -154,7 +154,7 @@ if ($resql)
|
||||
if ($obj->fk_user)
|
||||
{
|
||||
$userstatic->id=$obj->fk_user;
|
||||
$userstatic->nom=$obj->login;
|
||||
$userstatic->lastname=$obj->login;
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
else
|
||||
|
||||
@ -152,7 +152,7 @@ if ($_socid > 0)
|
||||
print '<td>'.dol_print_date($db->jdate($obj->dc),"dayhour").'</td>';
|
||||
print '<td>'.$obj->price_level.' </td>';
|
||||
$userstatic->id=$obj->uid;
|
||||
$userstatic->nom=$obj->login;
|
||||
$userstatic->lastname=$obj->login;
|
||||
print '<td align="right">'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
$i++;
|
||||
|
||||
@ -322,14 +322,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -313,14 +313,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -308,14 +308,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -604,8 +604,8 @@ if ($conf->deplacement->enabled && $user->rights->deplacement->lire)
|
||||
$deplacementstatic->ref=$objp->rowid;
|
||||
$deplacementstatic->id=$objp->rowid;
|
||||
$userstatic->id=$objp->uid;
|
||||
$userstatic->nom=$objp->name;
|
||||
$userstatic->prenom=$objp->firstname;
|
||||
$userstatic->lastname=$objp->name;
|
||||
$userstatic->firstname=$objp->firstname;
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>';
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
|
||||
@ -913,6 +913,9 @@ class Contact extends CommonObject
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -925,15 +928,15 @@ class Contact extends CommonObject
|
||||
|
||||
if ($nameorder)
|
||||
{
|
||||
if ($this->firstname) $ret.=$this->firstname;
|
||||
if ($this->firstname && $this->name) $ret.=' ';
|
||||
if ($this->name) $ret.=$this->name;
|
||||
$ret.=$this->firstname;
|
||||
if ($this->firstname && $this->lastname) $ret.=' ';
|
||||
$ret.=$this->lastname;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->name) $ret.=$this->name;
|
||||
if ($this->firstname && $this->name) $ret.=' ';
|
||||
if ($this->firstname) $ret.=$this->firstname;
|
||||
$ret.=$this->lastname;
|
||||
if ($this->firstname && $this->lastname) $ret.=' ';
|
||||
$ret.=$this->firstname;
|
||||
}
|
||||
return trim($ret);
|
||||
}
|
||||
|
||||
@ -308,14 +308,14 @@ if ($id > 0)
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ class FormActions
|
||||
|
||||
/**
|
||||
* Show list of actions for element
|
||||
*
|
||||
*
|
||||
* @param Object $object Object
|
||||
* @param string $typeelement 'invoice','propal','order','invoice_supplier','order_supplier','fichinter'
|
||||
* @param int $socid socid of user
|
||||
@ -146,8 +146,8 @@ class FormActions
|
||||
print '<td title="'.dol_escape_htmltag($action->label).'">'.dol_trunc($action->label,32).'</td>';
|
||||
$userstatic = new User($this->db);
|
||||
$userstatic->id = $action->author->id;
|
||||
$userstatic->prenom = $action->author->firstname;
|
||||
$userstatic->nom = $action->author->lastname;
|
||||
$userstatic->firstname = $action->author->firstname;
|
||||
$userstatic->lastname = $action->author->lastname;
|
||||
print '<td>'.$userstatic->getNomUrl(1).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@ -160,7 +160,7 @@ class FormActions
|
||||
|
||||
/**
|
||||
* Output list of type of event
|
||||
*
|
||||
*
|
||||
* @param string $selected Type pre-selectionne
|
||||
* @param string $htmlname Nom champ formulaire
|
||||
* @return void
|
||||
|
||||
@ -739,7 +739,7 @@ if (empty($action) || $action == 'file_manager' || preg_match('/refresh/i',$acti
|
||||
// Info
|
||||
print '<td align="center">';
|
||||
$userstatic->id=$val['fk_user_c'];
|
||||
$userstatic->nom=$val['login_c'];
|
||||
$userstatic->lastname=$val['login_c'];
|
||||
$htmltooltip='<b>'.$langs->trans("ECMSection").'</b>: '.$val['label'].'<br>';
|
||||
$htmltooltip='<b>'.$langs->trans("Type").'</b>: '.$langs->trans("ECMSectionManual").'<br>';
|
||||
$htmltooltip.='<b>'.$langs->trans("ECMCreationUser").'</b>: '.$userstatic->getNomUrl(1).'<br>';
|
||||
|
||||
@ -298,14 +298,14 @@ if ($id > 0)
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ dol_htmloutput_mesg($mesg);
|
||||
if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$langs->trans("OrderCard");
|
||||
|
||||
|
||||
if ($object->fetch($id, $ref) > 0)
|
||||
{
|
||||
$soc = new Societe($db);
|
||||
@ -303,14 +303,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -223,8 +223,8 @@ if ($resql)
|
||||
print "<tr $bc[$var]>";
|
||||
print '<td>';
|
||||
$userstatic->id=$obj->rowid;
|
||||
$userstatic->nom=$obj->name;
|
||||
$userstatic->prenom=$obj->firstname;
|
||||
$userstatic->lastname=$obj->name;
|
||||
$userstatic->firstname=$obj->firstname;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print '</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
@ -299,14 +299,14 @@ if ($id > 0)
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -321,7 +321,7 @@ if ($resql)
|
||||
// Author
|
||||
print '<td>';
|
||||
$userstatic->id=$objp->fk_user_author;
|
||||
$userstatic->nom=$objp->login;
|
||||
$userstatic->lastname=$objp->login;
|
||||
print $userstatic->getNomUrl(1);
|
||||
print "</td>\n";
|
||||
// Value
|
||||
|
||||
@ -245,7 +245,7 @@ if ($id > 0 || ! empty($ref))
|
||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||
|
||||
$var=!$var;
|
||||
print "<tr $bc[$var]>";
|
||||
print "<tr ".$bc[$var].">";
|
||||
|
||||
print '<td nowrap="nowrap">';
|
||||
print img_object('','contact').' '.$langs->trans("ThirdPartyContacts");
|
||||
@ -327,14 +327,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['nom'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['nom'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -328,14 +328,14 @@ if ($id > 0 || ! empty($ref))
|
||||
if ($tab[$i]['source']=='internal')
|
||||
{
|
||||
$userstatic->id=$tab[$i]['id'];
|
||||
$userstatic->nom=$tab[$i]['nom'];
|
||||
$userstatic->prenom=$tab[$i]['firstname'];
|
||||
$userstatic->lastname=$tab[$i]['lastname'];
|
||||
$userstatic->firstname=$tab[$i]['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
}
|
||||
if ($tab[$i]['source']=='external')
|
||||
{
|
||||
$contactstatic->id=$tab[$i]['id'];
|
||||
$contactstatic->name=$tab[$i]['nom'];
|
||||
$contactstatic->lastname=$tab[$i]['lastname'];
|
||||
$contactstatic->firstname=$tab[$i]['firstname'];
|
||||
print $contactstatic->getNomUrl(1);
|
||||
}
|
||||
|
||||
@ -603,8 +603,8 @@ abstract class ActionsCardCommon
|
||||
foreach($listsalesrepresentatives as $val)
|
||||
{
|
||||
$userstatic->id=$val['id'];
|
||||
$userstatic->nom=$val['name'];
|
||||
$userstatic->prenom=$val['firstname'];
|
||||
$userstatic->lastname=$val['name'];
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
$this->tpl['sales_representatives'].= $userstatic->getNomUrl(1);
|
||||
$i++;
|
||||
if ($i < $nbofsalesrepresentative) $this->tpl['sales_representatives'].= ', ';
|
||||
|
||||
@ -1802,8 +1802,8 @@ else
|
||||
foreach($listsalesrepresentatives as $val)
|
||||
{
|
||||
$userstatic->id=$val['id'];
|
||||
$userstatic->nom=$val['name'];
|
||||
$userstatic->prenom=$val['firstname'];
|
||||
$userstatic->lastname=$val['name'];
|
||||
$userstatic->firstname=$val['firstname'];
|
||||
print $userstatic->getNomUrl(1);
|
||||
$i++;
|
||||
if ($i < $nbofsalesrepresentative) print ', ';
|
||||
|
||||
@ -1717,6 +1717,9 @@ class User extends CommonObject
|
||||
{
|
||||
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)
|
||||
{
|
||||
@ -1729,15 +1732,15 @@ class User extends CommonObject
|
||||
|
||||
if ($nameorder)
|
||||
{
|
||||
if ($this->firstname) $ret.=$this->firstname;
|
||||
$ret.=$this->firstname;
|
||||
if ($this->firstname && $this->lastname) $ret.=' ';
|
||||
if ($this->lastname) $ret.=$this->lastname;
|
||||
$ret.=$this->lastname;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($this->lastname) $ret.=$this->lastname;
|
||||
$ret.=$this->lastname;
|
||||
if ($this->firstname && $this->lastname) $ret.=' ';
|
||||
if ($this->firstname) $ret.=$this->firstname;
|
||||
$ret.=$this->firstname;
|
||||
}
|
||||
|
||||
return trim($ret);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user