Add autocompletion in textarea for user mentions
This commit is contained in:
@@ -43,6 +43,25 @@ class ProjectPermission extends Base
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all usernames (fetch users from groups)
|
||||
*
|
||||
* @access public
|
||||
* @param integer $project_id
|
||||
* @param string $input
|
||||
* @return array
|
||||
*/
|
||||
public function findUsernames($project_id, $input)
|
||||
{
|
||||
$userMembers = $this->projectUserRoleFilter->create()->filterByProjectId($project_id)->startWithUsername($input)->findAll('username');
|
||||
$groupMembers = $this->projectGroupRoleFilter->create()->filterByProjectId($project_id)->startWithUsername($input)->findAll('username');
|
||||
$members = array_unique(array_merge($userMembers, $groupMembers));
|
||||
|
||||
sort($members);
|
||||
|
||||
return $members;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return true if everybody is allowed for the project
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user