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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user