2015-01-12 10:04:01 -08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class PhabricatorProjectViewController
|
|
|
|
extends PhabricatorProjectController {
|
|
|
|
|
|
|
|
public function shouldAllowPublic() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handleRequest(AphrontRequest $request) {
|
|
|
|
$request = $this->getRequest();
|
2015-08-08 10:34:55 -07:00
|
|
|
$viewer = $request->getViewer();
|
2015-01-12 10:04:01 -08:00
|
|
|
|
2015-12-27 02:04:37 -08:00
|
|
|
$response = $this->loadProject();
|
|
|
|
if ($response) {
|
|
|
|
return $response;
|
2015-01-12 10:04:01 -08:00
|
|
|
}
|
2015-12-27 02:04:37 -08:00
|
|
|
$project = $this->getProject();
|
2015-01-12 10:04:01 -08:00
|
|
|
|
|
|
|
$columns = id(new PhabricatorProjectColumnQuery())
|
2015-08-08 10:34:55 -07:00
|
|
|
->setViewer($viewer)
|
2015-01-12 10:04:01 -08:00
|
|
|
->withProjectPHIDs(array($project->getPHID()))
|
|
|
|
->execute();
|
|
|
|
if ($columns) {
|
|
|
|
$controller = 'board';
|
|
|
|
} else {
|
|
|
|
$controller = 'profile';
|
|
|
|
}
|
|
|
|
|
|
|
|
switch ($controller) {
|
|
|
|
case 'board':
|
|
|
|
$controller_object = new PhabricatorProjectBoardViewController();
|
|
|
|
break;
|
|
|
|
case 'profile':
|
|
|
|
default:
|
|
|
|
$controller_object = new PhabricatorProjectProfileController();
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return $this->delegateToController($controller_object);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|