Differential D14304 Diff 34527 src/applications/project/controller/PhabricatorProjectBoardViewController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectBoardViewController.php
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
} | } | ||||
$columns = $column_query->execute(); | $columns = $column_query->execute(); | ||||
$columns = mpull($columns, null, 'getSequence'); | $columns = mpull($columns, null, 'getSequence'); | ||||
// TODO: Expand the checks here if we add the ability | // TODO: Expand the checks here if we add the ability | ||||
// to hide the Backlog column | // to hide the Backlog column | ||||
if (!$columns) { | if (!$columns) { | ||||
if (!$viewer->isLoggedIn()) { | |||||
return $this->noAccessDialog($project); | |||||
} | |||||
switch ($request->getStr('initialize-type')) { | switch ($request->getStr('initialize-type')) { | ||||
case 'backlog-only': | case 'backlog-only': | ||||
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | $unguarded = AphrontWriteGuard::beginScopedUnguardedWrites(); | ||||
$column = PhabricatorProjectColumn::initializeNewColumn($viewer) | $column = PhabricatorProjectColumn::initializeNewColumn($viewer) | ||||
->setSequence(0) | ->setSequence(0) | ||||
->setProperty('isDefault', true) | ->setProperty('isDefault', true) | ||||
->setProjectPHID($project->getPHID()) | ->setProjectPHID($project->getPHID()) | ||||
->save(); | ->save(); | ||||
▲ Show 20 Lines • Show All 630 Lines • ▼ Show 20 Lines | $dialog = id(new AphrontDialogView()) | ||||
->addCancelButton($this->getApplicationURI('view/'.$project->getID().'/')) | ->addCancelButton($this->getApplicationURI('view/'.$project->getID().'/')) | ||||
->appendParagraph($instructions) | ->appendParagraph($instructions) | ||||
->appendChild($new_selector); | ->appendChild($new_selector); | ||||
return id(new AphrontDialogResponse()) | return id(new AphrontDialogResponse()) | ||||
->setDialog($dialog); | ->setDialog($dialog); | ||||
} | } | ||||
private function noAccessDialog(PhabricatorProject $project) { | |||||
$instructions = pht('This workboard has not been setup yet.'); | |||||
$dialog = id(new AphrontDialogView()) | |||||
->setUser($this->getRequest()->getUser()) | |||||
->setTitle(pht('No Workboard')) | |||||
->addCancelButton($this->getApplicationURI('view/'.$project->getID().'/')) | |||||
->appendParagraph($instructions); | |||||
return id(new AphrontDialogResponse()) | |||||
->setDialog($dialog); | |||||
} | |||||
/** | /** | ||||
* Add current state parameters (like order and the visibility of hidden | * Add current state parameters (like order and the visibility of hidden | ||||
* columns) to a URI. | * columns) to a URI. | ||||
* | * | ||||
* This allows actions which toggle or adjust one piece of state to keep | * This allows actions which toggle or adjust one piece of state to keep | ||||
* the rest of the board state persistent. If no URI is provided, this method | * the rest of the board state persistent. If no URI is provided, this method | ||||
* starts with the request URI. | * starts with the request URI. | ||||
Show All 23 Lines |