From 3567f1a1df99f735b4d7264caa78a7fb7339f581 Mon Sep 17 00:00:00 2001 From: epriestley Date: Wed, 5 Jun 2013 10:45:07 -0700 Subject: [PATCH] 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 --- .../controller/ManiphestTaskEditController.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/applications/maniphest/controller/ManiphestTaskEditController.php b/src/applications/maniphest/controller/ManiphestTaskEditController.php index 57ea3da74f..cba05b3ec6 100644 --- a/src/applications/maniphest/controller/ManiphestTaskEditController.php +++ b/src/applications/maniphest/controller/ManiphestTaskEditController.php @@ -38,6 +38,18 @@ final class ManiphestTaskEditController extends ManiphestController { if ($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());