Commit 15b2eaf9 authored by FoucherAurelie's avatar FoucherAurelie
Browse files

add count for updated

parent 4b68d1b9
3 merge requests!74add count for updated,!64v1.6,!63v1.6 - beta 1
Pipeline #30377 passed with stages
in 14 seconds
Showing with 16 additions and 1 deletion
+16 -1
......@@ -200,10 +200,23 @@ function civicrm_api3_education_nationale_populate($params) {
'external_identifier' => $external_identifier,
];
$contact= $existing_contacts_identifiers[$legacy_external_identifier];
civicrm_api4('Contact', 'update', ['values' => [
$civi_update = civicrm_api4('Contact', 'update', ['values' => [
'id' => $contact['id'],
'external_identifier' => $external_identifier,
]]);
if ($civi_update['is_error'] == 1) {
$EducationalInstitutions[] = [
'status' => 'error',
'id' => $contact['id'],
'external_identifier' => $external_identifier,
];
} else {
$EducationalInstitutions[] = [
'status' => 'updated',
'id' => $contact['id'],
'external_identifier' => $external_identifier,
];
}
continue;
}
}
......
......@@ -72,6 +72,7 @@ try {
.addClass('crm-flex-box')
.append('<div>' + education_nationale.i18n.imported_rows.replace('%s', counts['create']) + '</div>')
.append(counts['exists'] ? '<div class="has-exists">' + education_nationale.i18n.existing_rows.replace('%s', counts['exists']) + '</div>' : '<div>')
.append(counts['updated'] ? '<div class="has-updated">' + education_nationale.i18n.updated_rows.replace('%s', counts['updated']) + '</div>' : '<div>')
.append(counts['error'] ? '<div class="has-errors">' + education_nationale.i18n.error_rows.replace('%s', counts['error']) + '</div>' : '<div>')
.append(errors.length ? CRM.$('<details class="list-errors">').append('<summary>Errors</summary>').append(errors) : '<div>')
;
......
......@@ -4,6 +4,7 @@ var education_nationale = education_nationale||{};
education_nationale.i18n = {
error_rows: "{/literal}{ts domain='connecteur_api_education_nationale_france'}%s rows in error{/ts}{literal}",
existing_rows: "{/literal}{ts domain='connecteur_api_education_nationale_france'}%s rows already exisiting{/ts}{literal}",
updated_rows: "{/literal}{ts domain='connecteur_api_education_nationale_france'}%s rows updated{/ts}{literal}",
imported_rows: "{/literal}{ts domain='connecteur_api_education_nationale_france'}%s rows imported{/ts}{literal}",
search_by_name: "{/literal}{ts domain='connecteur_api_education_nationale_france'}Search institution. Example : Picasso 93{/ts}{literal}"
};
......
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