Use active project filter as default field value when creating new tasks

Summary: See T389. If you're looking at tasks in project X, default new tasks
into project X.
Test Plan:
  - Created a new task without associated projects.
  - Created a new task from a filter view with 1 and 2 projects; defaults were
filled in.
  - Submitted task with invalid title, projects were correctly preserved.

Reviewed By: skrul
Reviewers: skrul, hunterbridges, jungejason, tuomaspelkonen, aran
CC: aran, skrul, epriestley
Differential Revision: 757
This commit is contained in:
epriestley
2011-08-01 13:51:27 -07:00
parent 7baf7c774d
commit 3ceb3d340b
3 changed files with 14 additions and 1 deletions

View File

@@ -47,6 +47,11 @@ class ManiphestTaskEditController extends ManiphestController {
// These allow task creation with defaults.
if (!$request->isFormPost()) {
$task->setTitle($request->getStr('title'));
$default_projects = $request->getStr('projects');
if ($default_projects) {
$task->setProjectPHIDs(explode(';', $default_projects));
}
}
$file_phids = $request->getArr('files', array());