Commit 06281288 authored by ErikHommel's avatar ErikHommel

fixes from local testing

parent fb93e0dd
......@@ -135,7 +135,7 @@ class CRM_Aivlbasicsignup_BasicSignupConfig {
])['values'];
foreach ($foundOptionGroups as $foundOptionGroup) {
$property = $this->getPropertyFromName($foundOptionGroup['name']) . 'OptionGroupId';
$this->$property = $foundOptionGroup['id'];
$this->$property = (int) $foundOptionGroup['id'];
}
}
catch (CiviCRM_API3_Exception $ex) {
......@@ -175,14 +175,13 @@ class CRM_Aivlbasicsignup_BasicSignupConfig {
*/
private function setAivlContactId() {
try {
$this->_aivlContactId = (int) civicrm_api3('Contact', 'getvalue', [
'return' => "id",
'contact_type' => "Organization",
'legal_name' => ['IN' => ["Amnesty International Vlaanderen VZW", "Amnesty International vzw"]],
$this->_aivlContactId = (int) civicrm_api3('Domain', 'getvalue', [
'return' => "contact_id",
'options' => ['limit' => 1],
]);
}
catch (CiviCRM_API3_Exception $ex) {
Civi::log()->error(E::ts('Could not find an organization with legal name Amnesty International Vlaanderen VZW in ') . __METHOD__);
Civi::log()->error(E::ts('Could not find an the contact ID linked to the domain in ') . __METHOD__);
}
}
......
......@@ -5,14 +5,14 @@
"is_reserved": 1,
"data_type": "String",
"option_values": {
"aivl_writer_signup": {
"name": "aivl_writer_signup",
"briefschrijver": {
"name": "briefschrijver",
"label": "Briefschrijver",
"is_active": 1,
"is_reserved": 0
},
"aivl_member_confirm": {
"name": "aivl_member_confirm",
"lidmaatschapbevestiging": {
"name": "lidmaatschapbevestiging",
"label": "Lidmaatschapbevestiging",
"is_active": 1,
"is_reserved": 0
......
......@@ -120,7 +120,13 @@ class CRM_Aivlbasicsignup_Form_BasicSignupSetting extends CRM_Core_Form {
// check if there is an an assignee value
$assigneeParts = explode('aivl_assignee_id_', $valueId);
if (isset($assigneeParts[1])) {
$assignees[$assigneeParts[1]] = $value;
// if the activity check is off, the related assignee should be empty too
if ($activities[$assigneeParts[1]] == "0") {
$assignees[$assigneeParts[1]] = "0";
}
else {
$assignees[$assigneeParts[1]] = $value;
}
}
}
// save settings
......
Markdown is supported
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