1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Modernize Maniphest

Summary: Updates (some) of Maniphest for modern methods. Didn't convert Reports (probably need a setNavigation call added).

Test Plan: View List, edit task, new task, view reports.

Reviewers: epriestley

Reviewed By: epriestley

Subscribers: Korvin

Differential Revision: https://secure.phabricator.com/D14597
This commit is contained in:
Chad Little 2015-11-28 17:49:56 -08:00
parent f6c98a55a4
commit b9fcaadce8
3 changed files with 32 additions and 31 deletions

View file

@ -6,21 +6,17 @@ abstract class ManiphestController extends PhabricatorController {
return $this->buildSideNavView(true)->getMenu(); return $this->buildSideNavView(true)->getMenu();
} }
public function buildSideNavView($for_app = false) { public function buildSideNavView() {
$user = $this->getRequest()->getUser(); $viewer = $this->getViewer();
$nav = new AphrontSideNavFilterView(); $nav = new AphrontSideNavFilterView();
$nav->setBaseURI(new PhutilURI($this->getApplicationURI())); $nav->setBaseURI(new PhutilURI($this->getApplicationURI()));
if ($for_app) {
$nav->addFilter('task/create/', pht('Create Task'));
}
id(new ManiphestTaskSearchEngine()) id(new ManiphestTaskSearchEngine())
->setViewer($user) ->setViewer($viewer)
->addNavigationItems($nav->getMenu()); ->addNavigationItems($nav->getMenu());
if ($user->isLoggedIn()) { if ($viewer->isLoggedIn()) {
// For now, don't give logged-out users access to reports. // For now, don't give logged-out users access to reports.
$nav->addLabel(pht('Reports')); $nav->addLabel(pht('Reports'));
$nav->addFilter('report', pht('Reports')); $nav->addFilter('report', pht('Reports'));

View file

@ -349,19 +349,23 @@ final class ManiphestTaskDetailController extends ManiphestController {
$object_box->addPropertyList($description); $object_box->addPropertyList($description);
} }
return $this->buildApplicationPage( $title = 'T'.$task->getID().' '.$task->getTitle();
array(
$crumbs, return $this->newPage()
$info_view, ->setTitle($title)
$object_box, ->setCrumbs($crumbs)
$timeline, ->setPageObjectPHIDs(
$comment_box, array(
$preview_panel, $task->getPHID(),
), ))
array( ->appendChild(
'title' => 'T'.$task->getID().' '.$task->getTitle(), array(
'pageObjects' => array($task->getPHID()), $info_view,
)); $object_box,
$timeline,
$comment_box,
$preview_panel,
));
} }
private function buildHeaderView(ManiphestTask $task) { private function buildHeaderView(ManiphestTask $task) {

View file

@ -741,16 +741,17 @@ final class ManiphestTaskEditController extends ManiphestController {
$crumbs->addTextCrumb($header_name); $crumbs->addTextCrumb($header_name);
return $this->buildApplicationPage( $title = $header_name;
array(
$crumbs, return $this->newPage()
$form_box, ->setTitle($title)
$preview, ->setCrumbs($crumbs)
), ->setPageObjectPHIDs($page_objects)
array( ->appendChild(
'title' => $header_name, array(
'pageObjects' => $page_objects, $form_box,
)); $preview,
));
} }
} }