Put subprojects and milestones back into the Project UI

Summary: Ref T10010. Restores subprojects and milestones to the UI with a more modern style and more warnings.

Test Plan:
{F1085207}

{F1085208}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10010

Differential Revision: https://secure.phabricator.com/D15152
This commit is contained in:
epriestley
2016-02-01 07:04:19 -08:00
parent 354858e434
commit fc9db6e2a2
11 changed files with 542 additions and 141 deletions

View File

@@ -61,6 +61,15 @@ final class PhabricatorProjectsMembershipIndexEngineExtension
$conn_w = $project->establishConnection('w');
$any_milestone = queryfx_one(
$conn_w,
'SELECT id FROM %T
WHERE parentProjectPHID = %s AND milestoneNumber IS NOT NULL
LIMIT 1',
$project->getTableName(),
$project_phid);
$has_milestones = (bool)$any_milestone;
$project->openTransaction();
// Delete any existing materialized member edges.
@@ -92,6 +101,14 @@ final class PhabricatorProjectsMembershipIndexEngineExtension
(int)$has_subprojects,
$project->getID());
// Update the hasMilestones flag.
queryfx(
$conn_w,
'UPDATE %T SET hasMilestones = %d WHERE id = %d',
$project->getTableName(),
(int)$has_milestones,
$project->getID());
$project->saveTransaction();
}