Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2685761
D25066.1734704334.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
3 KB
Referenced Files
None
Subscribers
None
D25066.1734704334.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D25066: Workboard: Milestone Name easily editable (instead of surfing 3 pages)
Attached
Detach File
Event Timeline
Log In to Comment