Skip to content
Snippets Groups Projects
Commit 3fbeaf53 authored by Christopher Johnson's avatar Christopher Johnson
Browse files

addresses upstream removal of AphrontUsageException

Change-Id: I6c2b274ef14fcf7a4c57c36eaf1df21844d71cbc
parent 38e038bc
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,6 @@ phutil_register_library_map(array(
'BurndownActionMenuEventListener' => 'events/BurndownActionMenuEventListener.php',
'BurndownChartView' => 'view/burndown/BurndownChartView.php',
'BurndownDataDate' => 'util/BurndownDataDate.php',
'BurndownException' => 'exception/BurndownException.php',
'CeleritySprintResources' => 'celerity/CeleritySprintResources.php',
'DateIterator' => 'tests/DateIterator.php',
'EventTableView' => 'view/burndown/EventTableView.php',
......@@ -50,6 +49,7 @@ phutil_register_library_map(array(
'SprintDataViewController' => 'controller/SprintDataViewController.php',
'SprintDefaultViewCapability' => 'capability/SprintDefaultViewCapability.php',
'SprintEndDateField' => 'customfield/SprintEndDateField.php',
'SprintException' => 'exception/SprintException.php',
'SprintGetIsSprintConduitAPIMethod' => 'conduit/SprintGetIsSprintConduitAPIMethod.php',
'SprintGetStartEndDatesConduitAPIMethod' => 'conduit/SprintGetStartEndDatesConduitAPIMethod.php',
'SprintGetTaskProjectHistoryConduitAPIMethod' => 'conduit/SprintGetTaskProjectHistoryConduitAPIMethod.php',
......@@ -91,7 +91,6 @@ phutil_register_library_map(array(
'BurndownActionMenuEventListener' => 'PhabricatorEventListener',
'BurndownChartView' => 'Phobject',
'BurndownDataDate' => 'Phobject',
'BurndownException' => 'AphrontUsageException',
'CeleritySprintResources' => 'CelerityResourcesOnDisk',
'DateIterator' => 'Iterator',
'EventTableView' => 'Phobject',
......@@ -122,6 +121,7 @@ phutil_register_library_map(array(
'SprintDataViewController' => 'SprintController',
'SprintDefaultViewCapability' => 'PhabricatorPolicyCapability',
'SprintEndDateField' => 'SprintProjectCustomField',
'SprintException' => 'AphrontException',
'SprintGetIsSprintConduitAPIMethod' => 'SprintConduitAPIMethod',
'SprintGetStartEndDatesConduitAPIMethod' => 'SprintConduitAPIMethod',
'SprintGetTaskProjectHistoryConduitAPIMethod' => 'SprintConduitAPIMethod',
......
<?php
final class BurndownException extends AphrontUsageException {}
<?php
final class SprintException extends AphrontException {
private $title;
private $isUnlogged;
public function __construct($title, $message, $unlogged = true) {
$this->title = $title;
$this->isUnlogged = $unlogged;
parent::__construct($message);
}
public function getTitle() {
return $this->title;
}
public function getIsUnlogged() {
return $this->isUnlogged;
}
}
......@@ -79,11 +79,13 @@ final class SprintQuery extends SprintDAO {
->needProjectPHIDs(true)
->execute();
if (empty($tasks)) {
$help = pht('To Create a Task, go to the Sprint Board and select the '
$message = pht('The project "'.$this->project->getName().'"'
.' is not set up for Sprint because it has no tasks'
."\n"
.'To Create a Task, go to the Sprint Board and select the '
.'column header menu');
throw new BurndownException("The project \"".$this->project->getName()
."\" is not set up for Sprint because "
."it has no tasks\n", $help);
$ex = new SprintException('No Tasks in Project', $message, true);
throw $ex;
} else {
return $tasks;
}
......@@ -147,9 +149,12 @@ final class SprintQuery extends SprintDAO {
$sprint_phids[] = $value->getObjectPHID();
}
if (empty($sprint_phids)) {
$help = pht('To Create a Sprint, go to /project/create/ and make sure that'
$message = pht('There are no Sprints to show yet'
."\n"
.'To Create a Sprint, go to /project/create/ and make sure that'
.' the "Is Sprint" box has been checked');
throw new BurndownException("There are no Sprints to show yet\n", $help);
$ex = new SprintException('No Sprints', $message, true);
throw $ex;
} else {
return $sprint_phids;
}
......@@ -284,9 +289,12 @@ final class SprintQuery extends SprintDAO {
$columns = msort($columns, 'getSequence');
return $columns;
} else {
$help = pht('To Create a Sprint Board, go to the Project profile page'
$message = pht('There is no Sprint Board yet'
."\n"
.'To Create a Sprint Board, go to the Project profile page'
.' and select the Sprint Board icon from the left side bar');
throw new BurndownException("There is no Sprint Board yet\n", $help);
$ex = new SprintException('No Board', $message);
throw $ex;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment