1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-01-09 22:31:03 +01:00

Allow "Description" and "Assigned To" to be prefilled in Maniphest's create task interface

Summary:
Ref T3320. Request from Dropbox. You can currently prefill "title" and some other stuff (including most of the fields by using templates) but there's no way to prefill description and assigned to right now.

  - Allow "Description" to be prefilled with a string ("description=...").
  - Allow "Assigned To" to be prefilled with a user rather than a PHID ("assign=username").

Test Plan:
Hit `/maniphest/task/create/?assign=epriestley&description=derpderp&title=blarpblarp` locally and got prefills.

{F45259}

Reviewers: chad, deuresti

Reviewed By: chad

CC: aran, euresti

Maniphest Tasks: T3320

Differential Revision: https://secure.phabricator.com/D6132
This commit is contained in:
epriestley 2013-06-05 10:45:07 -07:00
parent f1bf27959f
commit 3567f1a1df

View file

@ -38,6 +38,18 @@ final class ManiphestTaskEditController extends ManiphestController {
if ($default_projects) { if ($default_projects) {
$task->setProjectPHIDs(explode(';', $default_projects)); $task->setProjectPHIDs(explode(';', $default_projects));
} }
$task->setDescription($request->getStr('description'));
$assign = $request->getStr('assign');
if (strlen($assign)) {
$assign_user = id(new PhabricatorUser())->loadOneWhere(
'username = %s',
$assign);
if ($assign_user) {
$task->setOwnerPHID($assign_user->getPHID());
}
}
} }
$file_phids = $request->getArr('files', array()); $file_phids = $request->getArr('files', array());