diff --git a/rest/index.php b/rest/index.php index 042de9583f3ae7f037daf13de754c05362855e6b..c2c41da0efb87d1082e79084c349a8d54ba18247 100755 --- a/rest/index.php +++ b/rest/index.php @@ -260,9 +260,30 @@ $app->put('/notifications/{id}', \Notification\controllers\NotificationControlle $app->delete('/notifications/{id}', \Notification\controllers\NotificationController::class . ':delete'); $app->get('/administration/notifications/new', \Notification\controllers\NotificationController::class . ':initNotification'); $app->get('/notifications/{id}', \Notification\controllers\NotificationController::class . ':getBySid'); - $app->post('/scriptNotification', \Notification\controllers\NotificationScheduleController::class . ':createScriptNotification'); +//Doctypes +$app->get('/doctypes', \Doctype\controllers\FirstLevelController::class . ':getTree'); + +$app->post('/doctypes/firstLevel', \Doctype\controllers\FirstLevelController::class . ':create'); +$app->get('/doctypes/firstLevel/{id}', \Doctype\controllers\FirstLevelController::class . ':getById'); +$app->put('/doctypes/firstLevel/{id}', \Doctype\controllers\FirstLevelController::class . ':update'); +$app->delete('/doctypes/firstLevel/{id}', \Doctype\controllers\FirstLevelController::class . ':delete'); +$app->get('/administration/doctypes/firstLevel/new', \Doctype\controllers\FirstLevelController::class . ':initFirstLevel'); + +$app->post('/doctypes/secondLevel', \Doctype\controllers\SecondLevelController::class . ':create'); +$app->get('/doctypes/secondLevel/{id}', \Doctype\controllers\SecondLevelController::class . ':getById'); +$app->put('/doctypes/secondLevel/{id}', \Doctype\controllers\SecondLevelController::class . ':update'); +$app->delete('/doctypes/secondLevel/{id}', \Doctype\controllers\SecondLevelController::class . ':delete'); +$app->get('/administration/doctypes/secondLevel/new', \Doctype\controllers\SecondLevelController::class . ':initSecondLevel'); + +$app->post('/doctypes/types', \Doctype\controllers\DoctypeController::class . ':create'); +$app->get('/doctypes/types/{id}', \Doctype\controllers\DoctypeController::class . ':getById'); +$app->put('/doctypes/types/{id}', \Doctype\controllers\DoctypeController::class . ':update'); +$app->delete('/doctypes/types/{id}', \Doctype\controllers\DoctypeController::class . ':delete'); +$app->delete('/doctypes/types/{id}/redirect', \Doctype\controllers\DoctypeController::class . ':deleteRedirect'); +$app->get('/administration/doctypes/types/new', \Doctype\controllers\DoctypeController::class . ':initDoctype'); + //Reports $app->get('/reports/groups', \Report\controllers\ReportController::class . ':getGroups'); $app->get('/reports/groups/{groupId}', \Report\controllers\ReportController::class . ':getByGroupId'); diff --git a/src/app/doctype/controllers/FirstLevelController.php b/src/app/doctype/controllers/FirstLevelController.php index 740fc5af9b83120959c8056fae97a377d26ee2dd..275f861fbf1038fcfa8fd35b301ecd149faaee89 100644 --- a/src/app/doctype/controllers/FirstLevelController.php +++ b/src/app/doctype/controllers/FirstLevelController.php @@ -72,27 +72,6 @@ class FirstLevelController return $response->withJson($obj); } - public function getDoctypeById(Request $request, Response $response, $aArgs) - { - if (!Validator::intVal()->validate($aArgs['id']) || !Validator::notEmpty()->validate($aArgs['id'])) { - return $response - ->withStatus(500) - ->withJson(['errors' => 'wrong format for id']); - } - - $obj = DoctypeModel::getById(['id' => $aArgs['id']]); - - if (!empty($obj)) { - if ($obj['enabled'] == 'Y') { - $obj['enabled'] = true; - } else { - $obj['enabled'] = false; - } - } - - return $response->withJson($obj); - } - public function initFirstLevel(Request $request, Response $response) { $obj['folderType'] = FolderTypeModel::get(['select' => ['foldertype_id', 'foldertype_label']]);