Differential D17338 Diff 41708 src/applications/dashboard/controller/PhabricatorDashboardManageController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/dashboard/controller/PhabricatorDashboardManageController.php
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
$timeline = $this->buildTransactionTimeline( | $timeline = $this->buildTransactionTimeline( | ||||
$dashboard, | $dashboard, | ||||
new PhabricatorDashboardTransactionQuery()); | new PhabricatorDashboardTransactionQuery()); | ||||
$timeline->setShouldTerminate(true); | $timeline->setShouldTerminate(true); | ||||
$info_view = null; | $info_view = null; | ||||
if (!$can_edit) { | if (!$can_edit) { | ||||
$no_edit = pht( | $no_edit = pht( | ||||
'You do not have permission to edit this dashboard. If you want to '. | 'You do not have permission to edit this dashboard.'); | ||||
'make changes, make a copy first.'); | |||||
$info_view = id(new PHUIInfoView()) | $info_view = id(new PHUIInfoView()) | ||||
->setSeverity(PHUIInfoView::SEVERITY_NOTICE) | ->setSeverity(PHUIInfoView::SEVERITY_NOTICE) | ||||
->setErrors(array($no_edit)); | ->setErrors(array($no_edit)); | ||||
} | } | ||||
$view = id(new PHUITwoColumnView()) | $view = id(new PHUITwoColumnView()) | ||||
->setHeader($header) | ->setHeader($header) | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | if ($dashboard->isArchived()) { | ||||
id(new PhabricatorActionView()) | id(new PhabricatorActionView()) | ||||
->setName(pht('Archive Dashboard')) | ->setName(pht('Archive Dashboard')) | ||||
->setIcon('fa-ban') | ->setIcon('fa-ban') | ||||
->setHref($this->getApplicationURI("archive/{$id}/")) | ->setHref($this->getApplicationURI("archive/{$id}/")) | ||||
->setDisabled(!$can_edit) | ->setDisabled(!$can_edit) | ||||
->setWorkflow($can_edit)); | ->setWorkflow($can_edit)); | ||||
} | } | ||||
$curtain->addAction( | |||||
id(new PhabricatorActionView()) | |||||
->setName(pht('Copy Dashboard')) | |||||
->setIcon('fa-files-o') | |||||
->setHref($this->getApplicationURI("copy/{$id}/")) | |||||
->setWorkflow(true)); | |||||
return $curtain; | return $curtain; | ||||
} | } | ||||
private function buildPropertyView(PhabricatorDashboard $dashboard) { | private function buildPropertyView(PhabricatorDashboard $dashboard) { | ||||
$viewer = $this->getViewer(); | $viewer = $this->getViewer(); | ||||
$properties = id(new PHUIPropertyListView()) | $properties = id(new PHUIPropertyListView()) | ||||
->setUser($viewer); | ->setUser($viewer); | ||||
Show All 20 Lines |