a few small fixes

This commit is contained in:
Marc Michalsky forumZFD 2020-12-10 15:28:45 +01:00
parent 4921345b88
commit 93d4f46df6
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
3 changed files with 5 additions and 9 deletions

View file

@ -56,7 +56,7 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
$this->translateCustomFields($campaign, self::OUT); $this->translateCustomFields($campaign, self::OUT);
// Translate keys and values // Translate keys and values
self::formatValues($campaign, self::OUT); //self::formatValues($campaign, self::OUT);
self::translateKeys($campaign, self::OUT); self::translateKeys($campaign, self::OUT);
} }
@ -171,7 +171,6 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
$result['values'], $result['values'],
self::CIVICRM self::CIVICRM
); );
break;
case $twingle_campaign_type_values['twingle_event']: case $twingle_campaign_type_values['twingle_event']:
return new TwingleEvent( return new TwingleEvent(
$result['values'], $result['values'],
@ -182,7 +181,6 @@ abstract class CRM_TwingleCampaign_BAO_Campaign {
$result['values'], $result['values'],
self::CIVICRM self::CIVICRM
); );
break;
default: default:
return NULL; return NULL;
} }

View file

@ -88,7 +88,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
// ... if not, get embed data and create event // ... if not, get embed data and create event
try { try {
$result = $event->create($user, $is_test); $result = $event->create($is_test);
} catch (Exception $e) { } catch (Exception $e) {
$errorMessage = $e->getMessage(); $errorMessage = $e->getMessage();
@ -149,7 +149,6 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
/** /**
* Create the Event as a campaign in CiviCRM if it does not exist * Create the Event as a campaign in CiviCRM if it does not exist
* *
* @param int $user
* @param bool $is_test * @param bool $is_test
* If true: don't do any changes * If true: don't do any changes
* *
@ -158,7 +157,7 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
* *
* @throws \CiviCRM_API3_Exception * @throws \CiviCRM_API3_Exception
*/ */
public function create(int $user, bool $is_test = FALSE) { public function create(bool $is_test = FALSE) {
// Create campaign only if it does not already exist // Create campaign only if it does not already exist
if (!$is_test) { if (!$is_test) {
@ -203,7 +202,6 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
) { ) {
$result = civicrm_api3('Case', 'create', [ $result = civicrm_api3('Case', 'create', [
'contact_id' => $formattedValues['contact_id'], 'contact_id' => $formattedValues['contact_id'],
'creator_id' => $user,
'case_type_id' => Configuration::get('twinglecampaign_start_case'), 'case_type_id' => Configuration::get('twinglecampaign_start_case'),
'subject' => $formattedValues['title'], 'subject' => $formattedValues['title'],
'start_date' => $formattedValues['created_at'], 'start_date' => $formattedValues['created_at'],

View file

@ -22,7 +22,7 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
// Create campaign types, custom fields and custom groups by the contents // Create campaign types, custom fields and custom groups by the contents
// of the json file "campaigns.json" // of the json file "campaigns.json"
$campaign_info = ExtensionCache::getInstance()->getCampaigns(); $campaign_info = Cache::getInstance()->getCampaigns();
// Create campaign types // Create campaign types
foreach ($campaign_info['campaign_types'] as $campaign_type) { foreach ($campaign_info['campaign_types'] as $campaign_type) {
@ -56,7 +56,7 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
*/ */
public function uninstall() { public function uninstall() {
$campaign_info = ExtensionCache::getInstance()->getCampaigns(); $campaign_info = Cache::getInstance()->getCampaigns();
// Delete campaign types // Delete campaign types
foreach ($campaign_info['campaign_types'] as $campaign_type) { foreach ($campaign_info['campaign_types'] as $campaign_type) {