Page MenuHomePhorge

D25066.1734704334.diff
No OneTemporary

D25066.1734704334.diff

diff --git a/src/applications/project/controller/PhabricatorProjectColumnEditController.php b/src/applications/project/controller/PhabricatorProjectColumnEditController.php
--- a/src/applications/project/controller/PhabricatorProjectColumnEditController.php
+++ b/src/applications/project/controller/PhabricatorProjectColumnEditController.php
@@ -45,12 +45,19 @@
$e_name = null;
$e_limit = null;
+ $e_milestone_name = null;
$v_limit = $column->getPointLimit();
$v_name = $column->getName();
$proxy = $column->getProxy();
$is_column = !$proxy;
+ $is_milestone = $proxy && $proxy->isMilestone();
+
+ $v_milestone_name = null;
+ if ($is_milestone) {
+ $v_milestone_name = $proxy->getName();
+ }
$validation_exception = null;
$view_uri = $project->getWorkboardURI();
@@ -58,6 +65,7 @@
if ($request->isFormPost()) {
$v_name = $request->getStr('name');
$v_limit = $request->getStr('limit');
+ $v_milestone_name = $request->getStr('milestone.name');
if ($is_new) {
$column->setProjectPHID($project->getPHID());
@@ -77,6 +85,7 @@
}
$xactions = array();
+ $xactions_milestone = array();
$type_name = PhabricatorProjectColumnNameTransaction::TRANSACTIONTYPE;
$type_limit = PhabricatorProjectColumnLimitTransaction::TRANSACTIONTYPE;
@@ -85,6 +94,14 @@
$xactions[] = id(new PhabricatorProjectColumnTransaction())
->setTransactionType($type_name)
->setNewValue($v_name);
+ } else if ($is_milestone) {
+
+ // Save Milestone name
+ $type_project_name = PhabricatorProjectNameTransaction::TRANSACTIONTYPE;
+
+ $xactions_milestone[] = id(new PhabricatorProjectTransaction())
+ ->setTransactionType($type_project_name)
+ ->setNewValue($v_milestone_name);
}
// Column Points
@@ -107,6 +124,26 @@
$validation_exception = $ex;
}
+ // Eventually save Milestone-related stuff
+ if ($saved_everything && $xactions_milestone) {
+
+ // Be pessimist, again.
+ $saved_everything = false;
+
+ try {
+ $editor_milestone = id(new PhabricatorProjectTransactionEditor())
+ ->setActor($viewer)
+ ->setContinueOnNoEffect(true)
+ ->setContentSourceFromRequest($request)
+ ->applyTransactions($proxy, $xactions_milestone);
+
+ $saved_everything = true;
+ } catch (PhabricatorApplicationTransactionValidationException $ex) {
+ $e_milestone_name = $ex->getShortMessage($type_project_name);
+ $validation_exception = $ex;
+ }
+ }
+
if ($saved_everything) {
return id(new AphrontRedirectResponse())->setURI($view_uri);
}
@@ -124,6 +161,13 @@
->setLabel(pht('Name'))
->setName('name')
->setError($e_name));
+ } else if ($is_milestone) {
+ $form->appendChild(
+ id(new AphrontFormTextControl())
+ ->setValue($v_milestone_name)
+ ->setLabel(pht('Milestone Name'))
+ ->setName('milestone.name')
+ ->setError($e_milestone_name));
}
$form->appendChild(

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 14:18 (21 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1015196
Default Alt Text
D25066.1734704334.diff (3 KB)

Event Timeline