Skip to content

Commit

Permalink
adjusted the user list screen to actually use the username instead of…
Browse files Browse the repository at this point in the history
… the contact name

resolves: http://bugs.web2project.net/view.php?id=1415
  • Loading branch information
caseysoftware committed Nov 28, 2013
1 parent a91c78b commit 1963439
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion classes/w2p/Output/HTMLHelper.class.php
Expand Up @@ -140,7 +140,7 @@ public function createCell($fieldName, $value, $custom = array()) {
$obj = new CContact();
$obj->findContactByUserid($this->tableRowData['user_id']);
$link = '?m=users&a=view&user_id='.$this->tableRowData['user_id'];
$cell = '<a href="'.$link.'">'.$obj->contact_display_name.'</a>';
$cell = '<a href="'.$link.'">'.$obj->user_username.'</a>';
break;
//END: object-based linkings

Expand Down
5 changes: 3 additions & 2 deletions modules/contacts/contacts.class.php
Expand Up @@ -519,12 +519,13 @@ public static function getContactByUsername($username)
public function findContactByUserid($userId)
{
$q = $this->_query;
$q->addTable('users');
$q->addQuery('con.*, contact_display_name as contact_name');
$q->addTable('users', 'u');
$q->addQuery('u.*, con.*, contact_display_name as contact_name');
$q->addJoin('contacts', 'con', 'contact_id = user_contact', 'inner');
$q->addWhere('user_id = ' . (int) $userId);
$result = $q->loadHash();

$this->user_username = '';
$this->bind($result);

return $this;
Expand Down

0 comments on commit 1963439

Please sign in to comment.