Skip to content

Commit

Permalink
Fix: Missing name
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jan 29, 2012
1 parent cb37a84 commit f3a966a
Show file tree
Hide file tree
Showing 20 changed files with 61 additions and 55 deletions.
2 changes: 1 addition & 1 deletion htdocs/bookmarks/liste.php
Expand Up @@ -154,7 +154,7 @@
if ($obj->fk_user)
{
$userstatic->id=$obj->fk_user;
$userstatic->nom=$obj->login;
$userstatic->lastname=$obj->login;
print $userstatic->getNomUrl(1);
}
else
Expand Down
2 changes: 1 addition & 1 deletion htdocs/comm/multiprix.php
Expand Up @@ -152,7 +152,7 @@
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++;
Expand Down
6 changes: 3 additions & 3 deletions htdocs/comm/propal/contact.php
Expand Up @@ -322,14 +322,14 @@
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);
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/commande/contact.php
Expand Up @@ -313,14 +313,14 @@
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);
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/compta/facture/contact.php
Expand Up @@ -308,14 +308,14 @@
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);
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/compta/index.php
Expand Up @@ -604,8 +604,8 @@
$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>';
Expand Down
15 changes: 9 additions & 6 deletions htdocs/contact/class/contact.class.php
Expand Up @@ -913,6 +913,9 @@ function getFullName($langs,$option=0,$nameorder=-1)
{
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)
{
Expand All @@ -925,15 +928,15 @@ function getFullName($langs,$option=0,$nameorder=-1)

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);
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/contrat/contact.php
Expand Up @@ -308,14 +308,14 @@
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);
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/core/class/html.formactions.class.php
Expand Up @@ -101,7 +101,7 @@ function form_select_status_action($formname,$selected,$canedit=1,$htmlname='com

/**
* 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
Expand Down Expand Up @@ -146,8 +146,8 @@ function showactions($object,$typeelement,$socid=0)
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>';
}
Expand All @@ -160,7 +160,7 @@ function showactions($object,$typeelement,$socid=0)

/**
* Output list of type of event
*
*
* @param string $selected Type pre-selectionne
* @param string $htmlname Nom champ formulaire
* @return void
Expand Down
2 changes: 1 addition & 1 deletion htdocs/ecm/index.php
Expand Up @@ -739,7 +739,7 @@
// 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>';
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fichinter/contact.php
Expand Up @@ -298,14 +298,14 @@
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);
}
Expand Down
8 changes: 4 additions & 4 deletions htdocs/fourn/commande/contact.php
Expand Up @@ -130,7 +130,7 @@
if ($id > 0 || ! empty($ref))
{
$langs->trans("OrderCard");

if ($object->fetch($id, $ref) > 0)
{
$soc = new Societe($db);
Expand Down Expand Up @@ -303,14 +303,14 @@
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);
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/fourn/commande/index.php
Expand Up @@ -223,8 +223,8 @@
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";
Expand Down
6 changes: 3 additions & 3 deletions htdocs/fourn/facture/contact.php
Expand Up @@ -299,14 +299,14 @@
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);
}
Expand Down
2 changes: 1 addition & 1 deletion htdocs/product/stock/mouvement.php
Expand Up @@ -321,7 +321,7 @@
// 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
Expand Down
8 changes: 4 additions & 4 deletions htdocs/projet/contact.php
Expand Up @@ -245,7 +245,7 @@
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");
Expand Down Expand Up @@ -327,14 +327,14 @@
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);
}
Expand Down
6 changes: 3 additions & 3 deletions htdocs/projet/tasks/contact.php
Expand Up @@ -328,14 +328,14 @@
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);
}
Expand Down
4 changes: 2 additions & 2 deletions htdocs/societe/canvas/actions_card_common.class.php
Expand Up @@ -603,8 +603,8 @@ function assign_values(&$action, $id=0, $ref='')
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'].= ', ';
Expand Down
4 changes: 2 additions & 2 deletions htdocs/societe/soc.php
Expand Up @@ -1802,8 +1802,8 @@
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 ', ';
Expand Down
11 changes: 7 additions & 4 deletions htdocs/user/class/user.class.php
Expand Up @@ -1717,6 +1717,9 @@ function getFullName($langs,$option=0,$nameorder=-1)
{
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)
{
Expand All @@ -1729,15 +1732,15 @@ function getFullName($langs,$option=0,$nameorder=-1)

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);
Expand Down

0 comments on commit f3a966a

Please sign in to comment.