Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2685762
D25066.1734704336.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
4 KB
Referenced Files
None
Subscribers
None
D25066.1734704336.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,16 +45,27 @@
$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();
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());
@@ -74,44 +85,89 @@
}
$xactions = array();
+ $xactions_milestone = array();
$type_name = PhabricatorProjectColumnNameTransaction::TRANSACTIONTYPE;
$type_limit = PhabricatorProjectColumnLimitTransaction::TRANSACTIONTYPE;
- if (!$column->getProxy()) {
+ if ($is_column) {
$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
$xactions[] = id(new PhabricatorProjectColumnTransaction())
->setTransactionType($type_limit)
->setNewValue($v_limit);
+ $saved_everything = false;
+
try {
$editor = id(new PhabricatorProjectColumnTransactionEditor())
->setActor($viewer)
->setContinueOnNoEffect(true)
->setContentSourceFromRequest($request)
->applyTransactions($column, $xactions);
- return id(new AphrontRedirectResponse())->setURI($view_uri);
+ $saved_everything = true;
} catch (PhabricatorApplicationTransactionValidationException $ex) {
$e_name = $ex->getShortMessage($type_name);
$e_limit = $ex->getShortMessage($type_limit);
$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);
+ }
+
}
$form = id(new AphrontFormView())
->setUser($request->getUser());
- if (!$column->getProxy()) {
+ if ($is_column) {
+ // Project Column name field
$form->appendChild(
id(new AphrontFormTextControl())
->setValue($v_name)
->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
1018734
Default Alt Text
D25066.1734704336.diff (4 KB)
Attached To
Mode
D25066: Workboard: Milestone Name easily editable (instead of surfing 3 pages)
Attached
Detach File
Event Timeline
Log In to Comment