1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 22:10: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,18 +349,22 @@ final class ManiphestTaskDetailController extends ManiphestController {
$object_box->addPropertyList($description); $object_box->addPropertyList($description);
} }
return $this->buildApplicationPage( $title = 'T'.$task->getID().' '.$task->getTitle();
return $this->newPage()
->setTitle($title)
->setCrumbs($crumbs)
->setPageObjectPHIDs(
array(
$task->getPHID(),
))
->appendChild(
array( array(
$crumbs,
$info_view, $info_view,
$object_box, $object_box,
$timeline, $timeline,
$comment_box, $comment_box,
$preview_panel, $preview_panel,
),
array(
'title' => 'T'.$task->getID().' '.$task->getTitle(),
'pageObjects' => array($task->getPHID()),
)); ));
} }

View file

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