Remove backend code for adding incidents from site management
This commit is contained in:
@@ -48,31 +48,6 @@ if ($request->exists('do')) {
|
|||||||
|
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case 'add-incident': {
|
|
||||||
$reference = StatusBoard_Main::issetelse($_POST['reference'], 'Sihnon_Exception_InvalidParameters');
|
|
||||||
$description = StatusBoard_Main::issetelse($_POST['description'], 'Sihnon_Exception_InvalidParameters');
|
|
||||||
$status = StatusBoard_Main::issetelse($_POST['status'], 'Sihnon_Exception_InvalidParameters');
|
|
||||||
$start_time = StatusBoard_Main::issetelse($_POST['starttime'], 'Sihnon_Exception_InvalidParameters');
|
|
||||||
$estimated_end_time = StatusBoard_Main::issetelse($_POST['estimatedendtime'], 'Sihnon_Exception_InvalidParameters');
|
|
||||||
|
|
||||||
$start_time = strtotime($start_time);
|
|
||||||
if ($start_time === null) {
|
|
||||||
throw new StatusBoard_Exception_InvalidParameters('starttime');
|
|
||||||
}
|
|
||||||
$estimated_end_time = strtotime($estimated_end_time);
|
|
||||||
if ($estimated_end_time === null) {
|
|
||||||
throw new StatusBoard_Exception_InvalidParameters('estimatedendtime');
|
|
||||||
}
|
|
||||||
|
|
||||||
$incident = $site->newIncident($reference, $description, $status, $start_time, $estimated_end_time);
|
|
||||||
|
|
||||||
$messages[] = array(
|
|
||||||
'severity' => 'success',
|
|
||||||
'content' => 'The incident was created succesfully.',
|
|
||||||
);
|
|
||||||
|
|
||||||
} break;
|
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
$messages[] = array(
|
$messages[] = array(
|
||||||
'severity' => 'warning',
|
'severity' => 'warning',
|
||||||
|
|||||||
Reference in New Issue
Block a user