Skip to content
Snippets Groups Projects
Verified Commit ab9c7170 authored by Damien's avatar Damien
Browse files

FEAT #13253 TIME 0:40 Get message exchanges init

parent a3ea97c6
No related branches found
No related tags found
No related merge requests found
...@@ -312,9 +312,6 @@ $app->get('/roles', \Entity\controllers\ListTemplateController::class . ':getRol ...@@ -312,9 +312,6 @@ $app->get('/roles', \Entity\controllers\ListTemplateController::class . ':getRol
$app->get('/availableCircuits', \Entity\controllers\ListTemplateController::class . ':getAvailableCircuits'); $app->get('/availableCircuits', \Entity\controllers\ListTemplateController::class . ':getAvailableCircuits');
$app->put('/circuits/{type}', \Entity\controllers\ListInstanceController::class . ':updateCircuits'); $app->put('/circuits/{type}', \Entity\controllers\ListInstanceController::class . ':updateCircuits');
//MessageExchanges
$app->get('/messageExchanges/{id}', \MessageExchange\controllers\MessageExchangeController::class . ':getById');
//Notes //Notes
$app->post('/notes', \Note\controllers\NoteController::class . ':create'); $app->post('/notes', \Note\controllers\NoteController::class . ':create');
$app->get('/notes/{id}', \Note\controllers\NoteController::class . ':getById'); $app->get('/notes/{id}', \Note\controllers\NoteController::class . ':getById');
...@@ -538,10 +535,13 @@ $app->get('/administration/notifications/new', \Notification\controllers\Notific ...@@ -538,10 +535,13 @@ $app->get('/administration/notifications/new', \Notification\controllers\Notific
$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');
//External MessageExchanges
$app->get('/messageExchanges/{id}', \MessageExchange\controllers\MessageExchangeController::class . ':getById');
$app->post('/saveNumericPackage', \MessageExchange\controllers\ReceiveMessageExchangeController::class . ':saveMessageExchange'); $app->post('/saveNumericPackage', \MessageExchange\controllers\ReceiveMessageExchangeController::class . ':saveMessageExchange');
$app->post('/saveMessageExchangeReturn', \MessageExchange\controllers\ReceiveMessageExchangeController::class . ':saveMessageExchangeReturn'); $app->post('/saveMessageExchangeReturn', \MessageExchange\controllers\ReceiveMessageExchangeController::class . ':saveMessageExchangeReturn');
$app->post('/saveMessageExchangeReview', \MessageExchange\controllers\MessageExchangeReviewController::class . ':saveMessageExchangeReview'); $app->post('/saveMessageExchangeReview', \MessageExchange\controllers\MessageExchangeReviewController::class . ':saveMessageExchangeReview');
$app->post('/resources/{resId}/messageExchange', \MessageExchange\controllers\SendMessageExchangeController::class . ':createMessageExchange'); $app->post('/resources/{resId}/messageExchange', \MessageExchange\controllers\SendMessageExchangeController::class . ':createMessageExchange');
$app->get('/messageExchangesInitialization', \MessageExchange\controllers\SendMessageExchangeController::class . ':getInitialization');
//ExternalSignatoryBooks //ExternalSignatoryBooks
$app->get('/maarchParapheur/user/{id}/picture', \ExternalSignatoryBook\controllers\MaarchParapheurController::class . ':getUserPicture'); $app->get('/maarchParapheur/user/{id}/picture', \ExternalSignatoryBook\controllers\MaarchParapheurController::class . ':getUserPicture');
......
...@@ -351,7 +351,7 @@ class EmailController ...@@ -351,7 +351,7 @@ class EmailController
return $response->withJson(['emails' => $availableEmails]); return $response->withJson(['emails' => $availableEmails]);
} }
public static function getInitializationByResId(Request $request, Response $response, array $args) public function getInitializationByResId(Request $request, Response $response, array $args)
{ {
if (!Validator::intVal()->validate($args['resId']) || !ResController::hasRightByResId(['resId' => [$args['resId']], 'userId' => $GLOBALS['id']])) { if (!Validator::intVal()->validate($args['resId']) || !ResController::hasRightByResId(['resId' => [$args['resId']], 'userId' => $GLOBALS['id']])) {
return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']); return $response->withStatus(403)->withJson(['errors' => 'Document out of perimeter']);
......
...@@ -22,7 +22,6 @@ use Entity\models\EntityModel; ...@@ -22,7 +22,6 @@ use Entity\models\EntityModel;
use ExportSeda\controllers\SendMessageController; use ExportSeda\controllers\SendMessageController;
use Group\controllers\PrivilegeController; use Group\controllers\PrivilegeController;
use History\controllers\HistoryController; use History\controllers\HistoryController;
use MessageExchange\controllers\ReceiveMessageExchangeController;
use MessageExchange\models\MessageExchangeModel; use MessageExchange\models\MessageExchangeModel;
use Note\models\NoteModel; use Note\models\NoteModel;
use Resource\controllers\ResController; use Resource\controllers\ResController;
...@@ -36,6 +35,25 @@ use Slim\Http\Response; ...@@ -36,6 +35,25 @@ use Slim\Http\Response;
class SendMessageExchangeController class SendMessageExchangeController
{ {
public function getInitialization(Request $request, Response $response)
{
$rawEntities = EntityModel::getWithUserEntities([
'select' => ['entities.entity_label', 'entities.business_id'],
'where' => ['users_entities.user_id = ?', 'business_id is not null', 'business_id != ?'],
'data' => [$GLOBALS['userId'], '']
]);
$entities = [];
foreach ($rawEntities as $key => $entity) {
$entities[] = [
'label' => $entity['entity_label'],
'm2m' => $entity['business_id']
];
}
return $response->withJson(['entities' => $entities]);
}
public static function saveMessageExchange($aArgs = []) public static function saveMessageExchange($aArgs = [])
{ {
$dataObject = $aArgs['dataObject']; $dataObject = $aArgs['dataObject'];
......
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