Skip to content

Commit

Permalink
Fixed issue #17869: User list in Survey group permission management i…
Browse files Browse the repository at this point in the history
…s unclear (#2227)

* Fixed issue #17869: User list in Survey group permission management is unclear
Dev: add full_name in parenthesis
Dev: create a getUserDescription to be used elsewhere

* Dev: getDisplayName is better than getUserDescription
  • Loading branch information
Shnoulle committed Apr 25, 2022
1 parent d03521b commit 813de93
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions application/models/User.php
Expand Up @@ -936,4 +936,16 @@ public function setValidationExpiration()

return $this->save();
}

/**
* Get the decription to be used in list
* @return $string
*/
public function getDisplayName()
{
if (empty($this->full_name)) {
return $this->users_name;
}
return sprintf(gt("%s (%s)"), $this->users_name, $this->full_name);
}
}
6 changes: 5 additions & 1 deletion application/views/admin/super/permissions/addUserForm.php
Expand Up @@ -7,7 +7,11 @@
<?php echo CHtml::dropDownList(
'uid',
'',
CHtml::listData($oAddUserList,'uid','users_name'),
CHtml::listData(
$oAddUserList,
'uid',
'DisplayName'
),
array(
'empty' => gT("Please choose..."),
'class'=> 'form-control',
Expand Down

0 comments on commit 813de93

Please sign in to comment.