mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-01 01:18:22 +01:00
Allow prefilling a task's assignee by his PHID
Summary: Some scripts might find it easier to work with PHIDs instead of user names. Test Plan: Use ?assign=<username> and ?assign=<PHID-USER> with the create task URI. See assignee input being filled correctly. Reviewers: #blessed_reviewers, epriestley Reviewed By: epriestley CC: epriestley, aran, Korvin Differential Revision: https://secure.phabricator.com/D7401
This commit is contained in:
parent
e478706769
commit
203d82083a
1 changed files with 11 additions and 3 deletions
|
@ -100,9 +100,17 @@ final class ManiphestTaskEditController extends ManiphestController {
|
|||
if ($can_edit_assign) {
|
||||
$assign = $request->getStr('assign');
|
||||
if (strlen($assign)) {
|
||||
$assign_user = id(new PhabricatorUser())->loadOneWhere(
|
||||
'username = %s',
|
||||
$assign);
|
||||
$assign_user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($user)
|
||||
->withUsernames(array($assign))
|
||||
->executeOne();
|
||||
if (!$assign_user) {
|
||||
$assign_user = id(new PhabricatorPeopleQuery())
|
||||
->setViewer($user)
|
||||
->withPHIDs(array($assign))
|
||||
->executeOne();
|
||||
}
|
||||
|
||||
if ($assign_user) {
|
||||
$task->setOwnerPHID($assign_user->getPHID());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue