Skip to content
Snippets Groups Projects
Verified Commit 834767e4 authored by Florian Azizian's avatar Florian Azizian
Browse files

FEAT #76 Administration doctypes

parent c922d777
No related branches found
No related tags found
No related merge requests found
...@@ -260,9 +260,30 @@ $app->put('/notifications/{id}', \Notification\controllers\NotificationControlle ...@@ -260,9 +260,30 @@ $app->put('/notifications/{id}', \Notification\controllers\NotificationControlle
$app->delete('/notifications/{id}', \Notification\controllers\NotificationController::class . ':delete'); $app->delete('/notifications/{id}', \Notification\controllers\NotificationController::class . ':delete');
$app->get('/administration/notifications/new', \Notification\controllers\NotificationController::class . ':initNotification'); $app->get('/administration/notifications/new', \Notification\controllers\NotificationController::class . ':initNotification');
$app->get('/notifications/{id}', \Notification\controllers\NotificationController::class . ':getBySid'); $app->get('/notifications/{id}', \Notification\controllers\NotificationController::class . ':getBySid');
$app->post('/scriptNotification', \Notification\controllers\NotificationScheduleController::class . ':createScriptNotification'); $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 //Reports
$app->get('/reports/groups', \Report\controllers\ReportController::class . ':getGroups'); $app->get('/reports/groups', \Report\controllers\ReportController::class . ':getGroups');
$app->get('/reports/groups/{groupId}', \Report\controllers\ReportController::class . ':getByGroupId'); $app->get('/reports/groups/{groupId}', \Report\controllers\ReportController::class . ':getByGroupId');
......
...@@ -72,27 +72,6 @@ class FirstLevelController ...@@ -72,27 +72,6 @@ class FirstLevelController
return $response->withJson($obj); 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) public function initFirstLevel(Request $request, Response $response)
{ {
$obj['folderType'] = FolderTypeModel::get(['select' => ['foldertype_id', 'foldertype_label']]); $obj['folderType'] = FolderTypeModel::get(['select' => ['foldertype_id', 'foldertype_label']]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment