Commit 34e53d2a authored by Alexandre Goldstein's avatar Alexandre Goldstein
Browse files

Merge branch 'develop' of labs.maarch.org:maarch/maarchRM into develop

parents 22c62b7f a51e2410
Pipeline #6916 canceled with stages
......@@ -144,28 +144,30 @@ class PresentationKernel
switch ($this->request->queryType) {
case 'lql':
// Parse query string
//$queryArguments = \laabs::parseQueryString($this->request->query);
//$this->userMessages = \laabs::parseQueryString($this->request->query);
case 'url':
default:
$queryArguments = $_GET;
$this->userMessage = $_GET;
break;
}
switch ($this->request->contentType) {
case 'url':
$contents = stream_get_contents($this->request->body);
$bodyArguments = \core\Encoding\url::decode($contents);
break;
if (!is_null($this->request->body)) {
switch ($this->request->contentType) {
case 'url':
$contents = stream_get_contents($this->request->body);
$bodyArguments = \core\Encoding\url::decode($contents);
break;
case 'json':
$bodyArguments = (array) \core\Encoding\json::decodeStream($this->request->body);
break;
case 'json':
$bodyArguments = (array) \core\Encoding\json::decodeStream($this->request->body);
break;
default:
$bodyArguments = [$this->request->body];
default:
$bodyArguments = [$this->request->body];
}
$this->userMessage = array_merge($this->userMessage, $bodyArguments);
}
$this->userMessage = array_merge($queryArguments, $bodyArguments);
}
}
......
......@@ -172,7 +172,7 @@ class ServiceKernel extends AbstractKernel
{
switch ($this->request->queryType) {
case 'arg':
$queryArguments = (array) $this->request->query;
$this->userMessage = (array) $this->request->query;
break;
case 'lql':
......@@ -180,39 +180,41 @@ class ServiceKernel extends AbstractKernel
case 'url':
default:
$queryArguments = $_GET;
$this->userMessage = $_GET;
break;
}
$bodyArguments = array();
if (isset($this->inputRouter)) {
if ($this->response->mode == 'http') {
$this->response->setHeader("X-Laabs-Parser", $this->inputRouter->uri . "; type=" . $this->request->contentType);
}
$parser = $this->inputRouter->parser->newInstance();
$bodyArguments = $this->inputRouter->input->parse($parser, $this->request->body);
} else {
switch ($this->request->contentType) {
case 'php':
$bodyArguments = stream_get_contents($this->request->body);
break;
case 'url':
$contents = stream_get_contents($this->request->body);
$bodyArguments = \core\Encoding\url::decode($contents);
break;
case 'json':
$bodyArguments = (array) \core\Encoding\json::decodeStream($this->request->body);
break;
default:
$bodyArguments = [$this->request->body];
if (!is_null($this->request->body)) {
if (isset($this->inputRouter)) {
if ($this->response->mode == 'http') {
$this->response->setHeader("X-Laabs-Parser", $this->inputRouter->uri . "; type=" . $this->request->contentType);
}
$parser = $this->inputRouter->parser->newInstance();
$bodyArguments = $this->inputRouter->input->parse($parser, $this->request->body);
} else {
switch ($this->request->contentType) {
case 'php':
$bodyArguments = stream_get_contents($this->request->body);
break;
case 'url':
$contents = stream_get_contents($this->request->body);
$bodyArguments = \core\Encoding\url::decode($contents);
break;
case 'json':
$bodyArguments = (array) \core\Encoding\json::decodeStream($this->request->body);
break;
default:
$bodyArguments = [$this->request->body];
}
}
$this->userMessage = array_merge($this->userMessage, $bodyArguments);
}
$this->userMessage = array_merge($queryArguments, $bodyArguments);
}
/**
......
......@@ -46,7 +46,7 @@ class HttpRequest
if (isset($this->headers['X-Laabs-Max-Count'])) {
$this->maxCount = $this->headers['X-Laabs-Max-Count'];
}
}
$this->host = $_SERVER['HTTP_HOST'];
......@@ -54,14 +54,18 @@ class HttpRequest
$this->body = fopen('php://temp', 'w+');
$input = fopen('php://input', 'r');
stream_copy_to_stream($input, $this->body);
$length = stream_copy_to_stream($input, $this->body);
rewind($this->body);
if ($length == 0) {
$this->body = null;
}
$this->query = urldecode($_SERVER['QUERY_STRING']);
$this->getQueryType();
switch(\laabs::getHttpMethod()) {
switch (\laabs::getHttpMethod()) {
case 'POST':
$this->method = 'CREATE';
//$this->arguments = array_merge($_POST, $this->arguments);
......@@ -88,7 +92,7 @@ class HttpRequest
break;
}
$this->script = \laabs\basename($_SERVER['SCRIPT_FILENAME']);
$this->script = \laabs\basename($_SERVER['SCRIPT_FILENAME']);
$this->parseUrl();
}
......
......@@ -335,7 +335,7 @@ class serviceAccount
$servicePosition = $this->servicePositionController->getPosition($serviceAccount->accountId);
if (isset($servicePosition->organization)) {
$this->organizationController->deleteServicePosition($orgId, $serviceAccount->accountId);
$this->organizationController->deleteServicePosition($servicePosition->orgId, $serviceAccount->accountId);
}
$this->organizationController->addServicePosition($orgId, $serviceAccount->accountId);
}
......
......@@ -1220,7 +1220,7 @@ msgstr "Lecture des services descendants"
msgid "organization/userPosition/readGetcurrentorgtree"
msgstr "Lecture de la position utilisateur dans l'organisation"
msgid "organization/organization/read_orgId_Changestatus_status_"
msgid "organization/organization/read_orgId_ChangeStatus_status_"
msgstr "Mise à jour du statut d'une activité"
msgid "auth/authentication/createUserlogin"
......
......@@ -63,7 +63,7 @@ msgid "No file uploaded"
msgstr "Aucun fichier versé"
msgid "archivalprofiles"
msgtxt "Profils d'archive"
msgstr "Profils d'archive"
# ---------------------------------------------------------
# Datatable Organization
......@@ -85,19 +85,19 @@ msgid "otherOrgName"
msgstr "Autre nom affiché"
msgid "legalClassification"
msgstr "Classification légale"
msgstr "Forme juridique"
msgid "businessType"
msgstr "Type d'organisation"
msgstr "Nature de l'activité"
msgid "description"
msgstr "Description"
msgid "orgTypeCode"
msgstr "Code type de l'organisation"
msgstr "Type d'organisation"
msgid "taxIdentifier"
msgstr "Identifiant de taxe"
msgstr "Numéro TVA intraco"
msgid "beginDate"
msgstr "Date de début"
......@@ -109,7 +109,7 @@ msgid "parentOrgRegNumber"
msgstr "Identifiant de l'organisation parente"
msgid "ownerOrgRegNumber"
msgstr "Identifiant de l'organisation mère d'appartenance"
msgstr "Identifiant de l'organisation racine"
msgid "isOrgUnit"
msgstr "Est une organisation"
......
......@@ -55,6 +55,9 @@
<dt>Tax identifier</dt>
<dd id="orgInfo_taxIdentifier"></dd>
<dt>Enabled</dt>
<dd id="orgInfo_enabled"></dd>
</dl>
</div>
<?merge adminOrg.not().then('hide') @class ?>
......@@ -121,7 +124,14 @@
$('#orgInfo_displayName').text(organization.displayName);
$('#informationTab').find('dt, dd').css('display', 'none');
$.each(organization, function(key, value) {
if (value !=null) {
if (key === 'enabled' && isOrgUnit === true) {
if (value) {
content = '<i class="fa fa-check"></i>';
} else {
content = '<i class="fa fa-ban"></i>';
}
$('#orgInfo_' + key).css('display', '').html(content).prev().css('display', '');
}else if (value !=null && key !== 'enabled') {
$('#orgInfo_' + key).css('display', '').text(value).prev().css('display', '');
}
});
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment