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

FEAT #10771 link user to MP

parent 9fef9061
No related branches found
No related tags found
No related merge requests found
...@@ -124,6 +124,16 @@ class AutoCompleteController ...@@ -124,6 +124,16 @@ class AutoCompleteController
return $response->withStatus(400)->withJson(['errors' => 'search is empty']); return $response->withStatus(400)->withJson(['errors' => 'search is empty']);
} }
if (!empty($data['exludeAlreadyConnected'])) {
$usersAlreadyConnected = UserModel::get([
'select' => ['external_id->>\'maarchParapheur\' as external_id'],
'where' => ['external_id->>\'maarchParapheur\' is not null']
]);
$externalId = ['excludeId' => array_column($usersAlreadyConnected, 'external_id')];
$exclude = '&'.http_build_query($externalId);
}
$loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/visa/xml/remoteSignatoryBooks.xml']); $loadedXml = CoreConfigModel::getXmlLoaded(['path' => 'modules/visa/xml/remoteSignatoryBooks.xml']);
if ($loadedXml->signatoryBookEnabled == 'maarchParapheur') { if ($loadedXml->signatoryBookEnabled == 'maarchParapheur') {
...@@ -137,7 +147,7 @@ class AutoCompleteController ...@@ -137,7 +147,7 @@ class AutoCompleteController
} }
$curlResponse = CurlModel::execSimple([ $curlResponse = CurlModel::execSimple([
'url' => rtrim($url, '/') . '/rest/autocomplete/users?search='.$data['search'], 'url' => rtrim($url, '/') . '/rest/autocomplete/users?search='.$data['search'].$exclude,
'basicAuth' => ['user' => $userId, 'password' => $password], 'basicAuth' => ['user' => $userId, 'password' => $password],
'headers' => ['content-type:application/json'], 'headers' => ['content-type:application/json'],
'method' => 'GET' 'method' => 'GET'
......
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