Add subprojects to a main project.

Summary:
Quite basic subproject attachment.

Test Plan:
Go to some proj
ect and add another as a subproject.
Play around the ui.

Reviewers:	epr
iestley
CC:
This commit is contained in:
Cristian Adamo
2011-07-19 15:50:15 -03:00
parent 87fa97e49a
commit 8cca3079fc
10 changed files with 207 additions and 11 deletions

View File

@@ -38,6 +38,15 @@ class PhabricatorProjectProfileEditController
$profile = new PhabricatorProjectProfile();
}
if ($project->getSubprojectPHIDs()) {
$phids = $project->getSubprojectPHIDs();
$handles = id(new PhabricatorObjectHandleData($phids))
->loadHandles();
$subprojects = mpull($handles, 'getFullName', 'getPHID');
} else {
$subprojects = array();
}
$options = PhabricatorProjectStatus::getStatusMap();
$e_name = true;
@@ -45,6 +54,7 @@ class PhabricatorProjectProfileEditController
if ($request->isFormPost()) {
$project->setName($request->getStr('name'));
$project->setStatus($request->getStr('status'));
$project->setSubprojectPHIDs($request->getArr('set_subprojects'));
$profile->setBlurb($request->getStr('blurb'));
if (!strlen($project->getName())) {
@@ -121,6 +131,12 @@ class PhabricatorProjectProfileEditController
->setLabel('Blurb')
->setName('blurb')
->setValue($profile->getBlurb()))
->appendChild(
id(new AphrontFormTokenizerControl())
->setDatasource('/typeahead/common/projects/')
->setLabel('Subprojects')
->setName('set_subprojects')
->setValue($subprojects))
->appendChild(
id(new AphrontFormFileControl())
->setLabel('Change Image')
@@ -132,7 +148,7 @@ class PhabricatorProjectProfileEditController
$panel = new AphrontPanelView();
$panel->setHeader($header_name);
$panel->setWidth(AphrontPanelView::WIDTH_FORM);
$panel->setWidth(AphrontPanelView::WIDTH_WIDE);
$panel->appendChild($form);
return $this->buildStandardPageResponse(