Add admin UI/Backend to delete Services

This commit is contained in:
2011-12-21 18:54:49 +00:00
parent 0c7b6d8d7a
commit 7f31fb5f81
5 changed files with 344 additions and 35 deletions

View File

@@ -28,6 +28,26 @@ if ($request->exists('do')) {
);
} break;
case 'delete-service': {
$service_id = $request->get('id', 'Sihnon_Exception_InvalidParameters');
try {
$service = StatusBoard_Service::fromId($service_id);
$service->delete();
$messages[] = array(
'severity' => 'success',
'content' => 'The Service was deleted successfully.',
);
} catch (Sihnon_Exception_ResultCountMismatch $e) {
$messages[] = array(
'severity' => 'error',
'content' => 'The Service was not deleted as the object requested could not be found.',
);
}
} break;
default: {
$messages[] = array(