Enable prefilling of projects and priority fields in Maniphest task creation

Summary:
Projects and priority inputs can be prefilled similar to how title
and description fields work.

Prefilling of projects already worked but used PHIDs instead of
more user friendly name so I changed that too.

Test Plan:
Visit [[/maniphest/task/create/?projects=Maniphest;Easy&priority=100&assign=vrana&title=Hip-hip&description=hooray!|example]]
and see prefilled form fields.

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley

CC: Korvin, epriestley, aran

Differential Revision: https://secure.phabricator.com/D7394
This commit is contained in:
Erik Fercak
2013-10-25 10:16:39 -07:00
committed by epriestley
parent 6a169de967
commit 1fb2f39fc0
2 changed files with 56 additions and 3 deletions

View File

@@ -7,6 +7,7 @@ final class PhabricatorProjectQuery
private $phids;
private $memberPHIDs;
private $slugs;
private $names;
private $status = 'status-any';
const STATUS_ANY = 'status-any';
@@ -43,6 +44,11 @@ final class PhabricatorProjectQuery
return $this;
}
public function withNames(array $names) {
$this->names = $names;
return $this;
}
public function needMembers($need_members) {
$this->needMembers = $need_members;
return $this;
@@ -224,6 +230,13 @@ final class PhabricatorProjectQuery
$this->slugs);
}
if ($this->names) {
$where[] = qsprintf(
$conn_r,
'name IN (%Ls)',
$this->names);
}
$where[] = $this->buildPagingClause($conn_r);
return $this->formatWhereClause($where);