Differential D25093 Diff 389 src/applications/project/controller/PhabricatorProjectColumnEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectColumnEditController.php
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
} | } | ||||
$e_name = null; | $e_name = null; | ||||
$e_limit = null; | $e_limit = null; | ||||
$v_limit = $column->getPointLimit(); | $v_limit = $column->getPointLimit(); | ||||
$v_name = $column->getName(); | $v_name = $column->getName(); | ||||
$proxy = $column->getProxy(); | |||||
$is_column = !$proxy; | |||||
$validation_exception = null; | $validation_exception = null; | ||||
$view_uri = $project->getWorkboardURI(); | $view_uri = $project->getWorkboardURI(); | ||||
if ($request->isFormPost()) { | if ($request->isFormPost()) { | ||||
$v_name = $request->getStr('name'); | $v_name = $request->getStr('name'); | ||||
$v_limit = $request->getStr('limit'); | $v_limit = $request->getStr('limit'); | ||||
if ($is_new) { | if ($is_new) { | ||||
Show All 13 Lines | if ($request->isFormPost()) { | ||||
$column->setSequence($new_sequence); | $column->setSequence($new_sequence); | ||||
} | } | ||||
$xactions = array(); | $xactions = array(); | ||||
$type_name = PhabricatorProjectColumnNameTransaction::TRANSACTIONTYPE; | $type_name = PhabricatorProjectColumnNameTransaction::TRANSACTIONTYPE; | ||||
$type_limit = PhabricatorProjectColumnLimitTransaction::TRANSACTIONTYPE; | $type_limit = PhabricatorProjectColumnLimitTransaction::TRANSACTIONTYPE; | ||||
if (!$column->getProxy()) { | if ($is_column) { | ||||
valerio.bozzolan: This line has an exact replacement. | |||||
valerio.bozzolanAuthorUnsubmitted Done Inline ActionsNote that this is the exact replacement. valerio.bozzolan: Note that this is the exact replacement. | |||||
$xactions[] = id(new PhabricatorProjectColumnTransaction()) | $xactions[] = id(new PhabricatorProjectColumnTransaction()) | ||||
->setTransactionType($type_name) | ->setTransactionType($type_name) | ||||
->setNewValue($v_name); | ->setNewValue($v_name); | ||||
} | } | ||||
// Column Points | |||||
$xactions[] = id(new PhabricatorProjectColumnTransaction()) | $xactions[] = id(new PhabricatorProjectColumnTransaction()) | ||||
->setTransactionType($type_limit) | ->setTransactionType($type_limit) | ||||
->setNewValue($v_limit); | ->setNewValue($v_limit); | ||||
$saved_everything = false; | |||||
try { | try { | ||||
$editor = id(new PhabricatorProjectColumnTransactionEditor()) | $editor = id(new PhabricatorProjectColumnTransactionEditor()) | ||||
->setActor($viewer) | ->setActor($viewer) | ||||
->setContinueOnNoEffect(true) | ->setContinueOnNoEffect(true) | ||||
->setContentSourceFromRequest($request) | ->setContentSourceFromRequest($request) | ||||
->applyTransactions($column, $xactions); | ->applyTransactions($column, $xactions); | ||||
return id(new AphrontRedirectResponse())->setURI($view_uri); | $saved_everything = true; | ||||
valerio.bozzolanAuthorUnsubmitted Done Inline ActionsThis redirect was moved at line 111. It's the exact replacement. valerio.bozzolan: This redirect was moved at line 111. It's the exact replacement. | |||||
aviveyUnsubmitted Not Done Inline Actionswhy? avivey: why? | |||||
} catch (PhabricatorApplicationTransactionValidationException $ex) { | } catch (PhabricatorApplicationTransactionValidationException $ex) { | ||||
$e_name = $ex->getShortMessage($type_name); | $e_name = $ex->getShortMessage($type_name); | ||||
$e_limit = $ex->getShortMessage($type_limit); | $e_limit = $ex->getShortMessage($type_limit); | ||||
$validation_exception = $ex; | $validation_exception = $ex; | ||||
} | } | ||||
if ($saved_everything) { | |||||
return id(new AphrontRedirectResponse())->setURI($view_uri); | |||||
} | |||||
} | } | ||||
$form = id(new AphrontFormView()) | $form = id(new AphrontFormView()) | ||||
->setUser($request->getUser()); | ->setUser($request->getUser()); | ||||
if (!$column->getProxy()) { | if ($is_column) { | ||||
valerio.bozzolanAuthorUnsubmitted Done Inline ActionsThis line has an exact replacement. valerio.bozzolan: This line has an exact replacement. | |||||
// Project Column name field | |||||
valerio.bozzolanAuthorUnsubmitted Done Inline ActionsNote that this is the exact replacement. valerio.bozzolan: Note that this is the exact replacement. | |||||
$form->appendChild( | $form->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setValue($v_name) | ->setValue($v_name) | ||||
->setLabel(pht('Name')) | ->setLabel(pht('Name')) | ||||
->setName('name') | ->setName('name') | ||||
->setError($e_name)); | ->setError($e_name)); | ||||
} | } | ||||
Show All 27 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0
This line has an exact replacement.