diff --git a/rest/index.php b/rest/index.php index dd266712c36959a3eb4bc5366522b6bccdcf9fda..1766b097b240a0470bb3153dc3ee0560fd72995d 100755 --- a/rest/index.php +++ b/rest/index.php @@ -131,6 +131,7 @@ $app->put('/configurations/{service}', \Configuration\controllers\ConfigurationC $app->get('/contacts', \Contact\controllers\ContactController::class . ':get'); $app->post('/contacts', \Contact\controllers\ContactController::class . ':create'); $app->get('/contacts/{id}', \Contact\controllers\ContactController::class . ':getById'); +$app->put('/contacts/export', \Contact\controllers\ContactController::class . ':exportContacts'); $app->put('/contacts/{id}', \Contact\controllers\ContactController::class . ':update'); $app->delete('/contacts/{id}', \Contact\controllers\ContactController::class . ':delete'); $app->put('/contacts/{id}/activation', \Contact\controllers\ContactController::class . ':updateActivation'); @@ -138,7 +139,6 @@ $app->get('/formattedContacts/{id}/types/{type}', \Contact\controllers\ContactCo $app->get('/ban/availableDepartments', \Contact\controllers\ContactController::class . ':getAvailableDepartments'); $app->get('/duplicatedContacts', \Contact\controllers\ContactController::class . ':getDuplicatedContacts'); $app->put('/contacts/{id}/merge', \Contact\controllers\ContactController::class . ':mergeContacts'); -$app->post('/contacts/export', \Contact\controllers\ContactController::class . ':exportContacts'); //ContactsCustomFields $app->get('/contactsCustomFields', \Contact\controllers\ContactCustomFieldController::class . ':get'); diff --git a/src/app/contact/controllers/ContactController.php b/src/app/contact/controllers/ContactController.php index da0d909dbd2e5db01b883da1cf6ef10e3f2f35f0..c16f6af15eba44d7e02b60d2dc06ebc163fa20c4 100755 --- a/src/app/contact/controllers/ContactController.php +++ b/src/app/contact/controllers/ContactController.php @@ -1174,12 +1174,15 @@ class ContactController foreach ($contacts as $contact) { foreach ($contact as $field => $value) { - if (strpos($field, 'contactCustomField_') !== false) { + if (strpos($field, 'contact_custom_field_') !== false) { $decoded = json_decode($value, true); if (is_array($decoded)) { $contact[$field] = implode("\n", $decoded); } } + if (Validator::boolType()->validate($value)) { + $contact[$field] = $value ? 'TRUE' : 'FALSE'; + } } if (!empty($contact['creator_label'])) { $contact['creator_label'] = UserModel::getLabelledUserById(['id' => $contact['creator_label']]); diff --git a/src/frontend/app/administration/contact/list/export/contact-export.component.ts b/src/frontend/app/administration/contact/list/export/contact-export.component.ts index b977ec8dfb58dcdb39d7c4406c0b0b4d272ed3e6..2ee3db11d3fafdc5106c3bd8c4bef4364a91df2b 100644 --- a/src/frontend/app/administration/contact/list/export/contact-export.component.ts +++ b/src/frontend/app/administration/contact/list/export/contact-export.component.ts @@ -138,7 +138,7 @@ export class ContactExportComponent implements OnInit { exportData() { this.localStorage.save(`exportContactFields_${this.headerService.user.id}`, JSON.stringify(this.exportModel)); this.loadingExport = true; - this.http.post('../rest/contacts/export', this.exportModel, { responseType: 'blob' }).pipe( + this.http.put('../rest/contacts/export', this.exportModel, { responseType: 'blob' }).pipe( tap((data: any) => { if (data.type !== 'text/html') { const downloadLink = document.createElement('a');