bugfix in case creation
This commit is contained in:
parent
8a61ae940e
commit
9404851285
1 changed files with 8 additions and 5 deletions
|
@ -51,9 +51,10 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
|
||||||
|
|
||||||
// check for existence
|
// check for existence
|
||||||
$result = civicrm_api3('Case', 'get', [
|
$result = civicrm_api3('Case', 'get', [
|
||||||
'contact_id' => $this->formattedValues['contact_id'],
|
'contact_id' => $this->formattedValues['contact'],
|
||||||
'case_type_id' => Configuration::get('twinglecampaign_start_case'),
|
'case_type_id' => Configuration::get('twinglecampaign_start_case'),
|
||||||
'subject' => $this->formattedValues['title'] . ' | Event-ID: ' . $formattedValues['id'],
|
'subject' => $this->formattedValues['title'] . ' | Event-ID: ' .
|
||||||
|
$this->formattedValues['id'],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Open a case
|
// Open a case
|
||||||
|
@ -62,10 +63,11 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
|
||||||
$result['count'] == 0
|
$result['count'] == 0
|
||||||
) {
|
) {
|
||||||
$result = civicrm_api3('Case', 'create', [
|
$result = civicrm_api3('Case', 'create', [
|
||||||
'contact_id' => $this->formattedValues['contact_id'],
|
'contact_id' => $this->formattedValues['contact'],
|
||||||
'case_type_id' => Configuration::get('twinglecampaign_start_case'),
|
'case_type_id' => Configuration::get('twinglecampaign_start_case'),
|
||||||
'subject' => $formattedValues['title'] . ' | Event-ID: ' . $formattedValues['id'],
|
'subject' => $this->formattedValues['title'] . ' | Event-ID: ' .
|
||||||
'start_date' => $formattedValues['created_at'],
|
$this->formattedValues['id'],
|
||||||
|
'start_date' => $this->formattedValues['created_at'],
|
||||||
'status_id' => "Open",
|
'status_id' => "Open",
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -75,6 +77,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue