Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CiviCRM
Connecteur API Education Nationale France
Commits
31f9ba4f
Commit
31f9ba4f
authored
1 year ago
by
FoucherAurelie
Browse files
Options
Download
Email Patches
Plain Diff
api3 for create
parent
15b2eaf9
Pipeline
#30380
passed with stages
in 16 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
api/v3/EducationNationale.php
+9
-9
api/v3/EducationNationale.php
with
9 additions
and
9 deletions
+9
-9
api/v3/EducationNationale.php
+
9
-
9
View file @
31f9ba4f
...
...
@@ -221,7 +221,7 @@ function civicrm_api3_education_nationale_populate($params) {
}
}
$item
=
[
'values'
=>
[
$item
=
[
'contact_type'
=>
"Organization"
,
'contact_sub_type'
=>
"EducationalInstitution"
,
'contact_source'
=>
'API Education Nationale'
,
...
...
@@ -230,7 +230,7 @@ function civicrm_api3_education_nationale_populate($params) {
'is_primary'
=>
1
,
],
'checkPermissions'
=>
FALSE
,
]
];
];
foreach
(
$dataset
[
'datasrc'
]
as
$local_field
=>
$attribute
)
{
if
(
isset
(
$custom_fields
[
$local_field
])){
$local_field
=
$custom_fields
[
$local_field
];
...
...
@@ -238,26 +238,26 @@ function civicrm_api3_education_nationale_populate($params) {
$item
[
$local_field
]
=
$record
->
fields
->
$attribute
;
}
foreach
(
$dataset
[
'addressdatasrc'
]
as
$local_field
=>
$attribute
)
{
$item
[
'
values'
][
'
api.Address.create'
][
$local_field
]
=
isset
(
$record
->
fields
->
$attribute
)
?
$record
->
fields
->
$attribute
:
''
;
$item
[
'api.Address.create'
][
$local_field
]
=
isset
(
$record
->
fields
->
$attribute
)
?
$record
->
fields
->
$attribute
:
''
;
}
if
(
isset
(
$record
->
fields
->
coordonnees
)
&&
!
empty
(
$record
->
fields
->
coordonnees
))
{
$lattitude
=
$record
->
fields
->
coordonnees
[
0
];
$longitude
=
$record
->
fields
->
coordonnees
[
1
];
$item
[
'
values'
][
'
api.Address.create'
][
'geo_code_1'
]
=
$lattitude
;
$item
[
'
values'
][
'
api.Address.create'
][
'geo_code_2'
]
=
$longitude
;
$item
[
'api.Address.create'
][
'geo_code_1'
]
=
$lattitude
;
$item
[
'api.Address.create'
][
'geo_code_2'
]
=
$longitude
;
}
// Post cleanup
if
(
strlen
(
$item
[
'organization_name'
])
>
128
){
$item
[
'
values'
][
'
organization_name'
]
=
substr
(
$item
[
'
values'
][
'
organization_name'
],
0
,
127
)
.
'…'
;
$item
[
'organization_name'
]
=
substr
(
$item
[
'organization_name'
],
0
,
127
)
.
'…'
;
}
if
(
$item
[
'
values'
][
'
organization_name'
]
==
''
){
$item
[
'
values'
][
'
organization_name'
]
=
sprintf
(
E
::
ts
(
'Empty name: %s'
),
$contact
[
'external_identifier'
]);
if
(
$item
[
'organization_name'
]
==
''
){
$item
[
'organization_name'
]
=
sprintf
(
E
::
ts
(
'Empty name: %s'
),
$contact
[
'external_identifier'
]);
}
try
{
$imported
=
civicrm_api
4
(
'Contact'
,
'create'
,
$item
);
$imported
=
civicrm_api
3
(
'Contact'
,
'create'
,
$item
);
}
catch
(
CiviCRM_API3_Exception
$e
){
$EducationalInstitutions
[]
=
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets