Differential D8191 Diff 18534 src/applications/project/controller/PhabricatorProjectBoardController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/controller/PhabricatorProjectBoardController.php
Show All 13 Lines | final class PhabricatorProjectBoardController | ||||
} | } | ||||
public function processRequest() { | public function processRequest() { | ||||
$request = $this->getRequest(); | $request = $this->getRequest(); | ||||
$viewer = $request->getUser(); | $viewer = $request->getUser(); | ||||
$project = id(new PhabricatorProjectQuery()) | $project = id(new PhabricatorProjectQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
->needImages(true) | |||||
->withIDs(array($this->id)) | ->withIDs(array($this->id)) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$project) { | if (!$project) { | ||||
return new Aphront404Response(); | return new Aphront404Response(); | ||||
} | } | ||||
$columns = id(new PhabricatorProjectColumnQuery()) | $columns = id(new PhabricatorProjectColumnQuery()) | ||||
->setViewer($viewer) | ->setViewer($viewer) | ||||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | $can_edit = PhabricatorPolicyFilter::hasCapability( | ||||
$viewer, | $viewer, | ||||
$project, | $project, | ||||
PhabricatorPolicyCapability::CAN_EDIT); | PhabricatorPolicyCapability::CAN_EDIT); | ||||
$actions = id(new PhabricatorActionListView()) | $actions = id(new PhabricatorActionListView()) | ||||
->setUser($viewer) | ->setUser($viewer) | ||||
->addAction( | ->addAction( | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setName(pht('Add Column/Milestone/Sprint')) | ->setName(pht('Add Column')) | ||||
->setHref($this->getApplicationURI('board/'.$this->id.'/edit/')) | ->setHref($this->getApplicationURI('board/'.$this->id.'/edit/')) | ||||
->setIcon('create') | ->setIcon('create') | ||||
->setDisabled(!$can_edit) | ->setDisabled(!$can_edit) | ||||
->setWorkflow(!$can_edit)); | ->setWorkflow(!$can_edit)); | ||||
$plist = id(new PHUIPropertyListView()); | $plist = id(new PHUIPropertyListView()); | ||||
// TODO: Need this to get actions to render. | // TODO: Need this to get actions to render. | ||||
$plist->addProperty(pht('Ignore'), pht('This Property')); | $plist->addProperty( | ||||
pht('Project Boards'), | |||||
phutil_tag( | |||||
'em', | |||||
array(), | |||||
pht( | |||||
'This feature is beta, but should mostly work.'))); | |||||
$plist->setActionList($actions); | $plist->setActionList($actions); | ||||
$header = id(new PHUIObjectBoxView()) | $header = id(new PHUIHeaderView()) | ||||
->setHeaderText($project->getName()) | ->setHeader($project->getName()) | ||||
->setUser($viewer) | |||||
->setImage($project->getProfileImageURI()) | |||||
->setPolicyObject($project); | |||||
$box = id(new PHUIObjectBoxView()) | |||||
->setHeader($header) | |||||
->addPropertyList($plist); | ->addPropertyList($plist); | ||||
$board_box = id(new PHUIBoxView()) | $board_box = id(new PHUIBoxView()) | ||||
->appendChild($board) | ->appendChild($board) | ||||
->addMargin(PHUI::MARGIN_LARGE); | ->addMargin(PHUI::MARGIN_LARGE); | ||||
return $this->buildApplicationPage( | return $this->buildApplicationPage( | ||||
array( | array( | ||||
$crumbs, | $crumbs, | ||||
$header, | $box, | ||||
$board_box, | $board_box, | ||||
), | ), | ||||
array( | array( | ||||
'title' => pht('%s Board', $project->getName()), | 'title' => pht('%s Board', $project->getName()), | ||||
'device' => true, | 'device' => true, | ||||
)); | )); | ||||
} | } | ||||
Show All 33 Lines |