Skip to content
Snippets Groups Projects
Commit 21d1b71e authored by Guillaume Heurtier's avatar Guillaume Heurtier
Browse files

FIX #17934 TIME 0:45 fix town format

parent f39e461f
No related branches found
No related tags found
No related merge requests found
{
"config": {
"lang": "fr",
"applicationName": "Maarch Courrier 21.03",
"cookieTime": 10080,
"timezone": "Europe/Paris",
"maarchDirectory": "/var/www/html/MaarchCourrier/",
"customID": "MaarchCourrier",
"maarchUrl": "http://192.168.43.137/MaarchCourrier/",
"lockAdvancedPrivileges": true
},
"database": [
{
"server": "localhost",
"port": "5432",
"type": "POSTGRESQL",
"name": "MaarchCourrier",
"user": "maarch",
"password": "maarch"
}
],
"signatureBook": {
"userWS": "superadmin",
"passwordWS": "superadmin",
"validatedStatus": "EENV",
"validatedStatusOnlyVisa": "EENV",
"refusedStatus": "REJ_SIGN",
"validatedStatusAnnot": "COU",
"refusedStatusAnnot": "RET"
},
"exportSeda": {
"sae": "MaarchRM",
"token": "phdF9WkJuTKkDuPXoqDZuCFEQT7En7YqsVROsdD1HoNZV7jD5+XyCtKbhx0Chb4s3skokalo0wEn48DE3M4kGrAceH0/XFbyLZVRoVOO+Y/wxyRdE1QJleI8yijEfGut",
"urlSAEService": "https://demo-ap.maarchrm.cooom",
"senderOrgRegNumber": "org_987654321_DGS_SA",
"accessRuleCode": "AR039",
"certificateSSL": "",
"userAgent": "service",
"statusReplyReceived": "REPLY_SEDA",
"statusReplyRejected": "REPLY_SEDA",
"statusMailToPurge": "REPLY_SEDA",
"externalSAE": {
"retentionRules": [
{
"id": "id1",
"label": "label1"
},
{
"id":"id2",
"label":"label2"
}
],
"archiveEntities": [
{
"id": "id1",
"label": "label1"
}
],
"archivalAgreements": [
{
"id": "id1",
"label": "label1"
}
]
},
"M2M": {
"gec": "maarch_courrier"
}
}
}
\ No newline at end of file
......@@ -1009,7 +1009,8 @@ class AutoCompleteController
$postcodes = array_map(function ($postcode) {
return [
'town' => $postcode['libelleAcheminement'],
'town' => $postcode['nomCommune'],
'label' => $postcode['libelleAcheminement'],
'postcode' => $postcode['codePostal']
];
}, $postcodes);
......@@ -1017,6 +1018,7 @@ class AutoCompleteController
$searchTowns = [];
if (!empty($queryParams['town'])) {
$searchTowns = strtoupper(TextFormatModel::normalize(['string' => $queryParams['town']]));
$searchTowns = trim(str_replace('-', ' ', $searchTowns));
$searchTowns = explode(' ', $searchTowns);
}
$searchPostcode = null;
......@@ -1026,7 +1028,7 @@ class AutoCompleteController
$postcodes = array_values(array_filter($postcodes, function ($code) use ($searchPostcode, $searchTowns) {
$townFound = !empty($searchTowns);
foreach ($searchTowns as $searchTown) {
if (strpos($code['town'], $searchTown) === false) {
if (strpos($code['label'], $searchTown) === false) {
$townFound = false;
break;
}
......
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