From 937a35e1b8615aef59cbf62aa8f0d1d8551f7fd7 Mon Sep 17 00:00:00 2001 From: Marc Michalsky forumZFD Date: Mon, 2 Nov 2020 17:47:16 +0100 Subject: [PATCH] code formatting and smaller errors --- CRM/TwingleCampaign/BAO/CampaignType.php | 6 +++--- CRM/TwingleCampaign/BAO/CustomField.php | 4 ++-- CRM/TwingleCampaign/BAO/CustomGroup.php | 12 ++++++------ CRM/TwingleCampaign/BAO/TwingleEvent.php | 4 ++-- CRM/TwingleCampaign/BAO/TwingleProject.php | 4 ---- CRM/TwingleCampaign/resources/campaigns.json | 4 ++-- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/CRM/TwingleCampaign/BAO/CampaignType.php b/CRM/TwingleCampaign/BAO/CampaignType.php index 36f6ed3..3ac6d83 100644 --- a/CRM/TwingleCampaign/BAO/CampaignType.php +++ b/CRM/TwingleCampaign/BAO/CampaignType.php @@ -137,7 +137,7 @@ class CampaignType { ); if ($this->results['is_error'] == 0) { - \Civi::log()->info("Twingle Extension has deleted campaign type.\n + \Civi::log()->info("TwingleCampaign Extension has deleted campaign type.\n label: $this->label\n name: $this->name" ); @@ -148,12 +148,12 @@ class CampaignType { } else { if ($this->label) { - \Civi::log()->error("Twingle Extension could not delete campaign type + \Civi::log()->error("TwingleCampaign Extension could not delete campaign type \"$this->label\": $this->results['error_message']" ); } else { - \Civi::log()->error("Twingle Extension could not delete campaign type: + \Civi::log()->error("TwingleCampaign Extension could not delete campaign type: $this->results['error_message']"); } } diff --git a/CRM/TwingleCampaign/BAO/CustomField.php b/CRM/TwingleCampaign/BAO/CustomField.php index ebc5868..7ca88be 100644 --- a/CRM/TwingleCampaign/BAO/CustomField.php +++ b/CRM/TwingleCampaign/BAO/CustomField.php @@ -235,13 +235,13 @@ class CustomField { else { if ($this->label && $this->custom_group_id) { \Civi::log() - ->error("Twingle Extension could not delete custom field + ->error("TwingleCampaign Extension could not delete custom field \"$this->label\" for group \"$this->custom_group_id\": $this->result['error_message']"); } else { \Civi::log() - ->error("Twingle Extension could not delete custom field: + ->error("TwingleCampaign Extension could not delete custom field: $this->result['error_message']"); } } diff --git a/CRM/TwingleCampaign/BAO/CustomGroup.php b/CRM/TwingleCampaign/BAO/CustomGroup.php index 91c7529..4473f6a 100644 --- a/CRM/TwingleCampaign/BAO/CustomGroup.php +++ b/CRM/TwingleCampaign/BAO/CustomGroup.php @@ -49,7 +49,7 @@ class CustomGroup { $this->id = $this->results['id']; if ($this->results['is_error'] == 0) { - \Civi::log()->info("Twingle Extension has created a new custom group. + \Civi::log()->info("TwingleCampaign Extension has created a new custom group. title: $this->title name: $this->name extends: $this->extends @@ -59,12 +59,12 @@ class CustomGroup { } else { if ($this->title) { - \Civi::log()->error("Twingle Extension could not create new custom group + \Civi::log()->error("TwingleCampaign Extension could not create new custom group for \"$this->title\": $this->results['error_message']" ); } else { - \Civi::log()->error("Twingle Extension could not create new + \Civi::log()->error("TwingleCampaign Extension could not create new custom group: $this->results['error_message']"); } } @@ -134,7 +134,7 @@ class CustomGroup { ); if ($this->results['is_error'] == 0) { - \Civi::log()->info("Twingle Extension has deleted custom group. + \Civi::log()->info("TwingleCampaign Extension has deleted custom group. title: $this->title name: $this->name extends: $this->extends @@ -147,12 +147,12 @@ class CustomGroup { } else { if ($this->title) { - \Civi::log()->error("Twingle Extension could not delete custom group + \Civi::log()->error("TwingleCampaign Extension could not delete custom group \"$this->title\": $this->results['error_message']" ); } else { - \Civi::log()->error("Twingle Extension could not delete custom group: + \Civi::log()->error("TwingleCampaign Extension could not delete custom group: $this->results['error_message']"); } } diff --git a/CRM/TwingleCampaign/BAO/TwingleEvent.php b/CRM/TwingleCampaign/BAO/TwingleEvent.php index 24c8c4f..9664c29 100644 --- a/CRM/TwingleCampaign/BAO/TwingleEvent.php +++ b/CRM/TwingleCampaign/BAO/TwingleEvent.php @@ -33,7 +33,7 @@ class TwingleEvent extends Campaign { $this->className = (new \ReflectionClass($this))->getShortName(); $this->prefix = 'twingle_event_'; - + $this->values['campaign_type_id'] = 'twingle_event'; // Add value for campaign type $event['campaign_type_id'] = 'twingle_event'; @@ -53,7 +53,7 @@ class TwingleEvent extends Campaign { * If TRUE, don't do any changes * * @return array|null - * Returns a response array that contains title, id, event_id, project_ + * Returns a response array that contains title, id, event_id, project_id * and status or NULL if $values is not an array * * @throws CiviCRM_API3_Exception diff --git a/CRM/TwingleCampaign/BAO/TwingleProject.php b/CRM/TwingleCampaign/BAO/TwingleProject.php index 9b2d315..fa9c97f 100644 --- a/CRM/TwingleCampaign/BAO/TwingleProject.php +++ b/CRM/TwingleCampaign/BAO/TwingleProject.php @@ -33,11 +33,7 @@ class TwingleProject extends Campaign { $this->className = (new \ReflectionClass($this))->getShortName(); $this->prefix = 'twingle_project_'; - - // Add value for campaign type $this->values['campaign_type_id'] = 'twingle_project'; - - // Get custom field name for project_id $this->id_custom_field = Cache::getInstance() ->getCustomFieldMapping()['twingle_project_id']; diff --git a/CRM/TwingleCampaign/resources/campaigns.json b/CRM/TwingleCampaign/resources/campaigns.json index 588b9c4..cbfa4af 100644 --- a/CRM/TwingleCampaign/resources/campaigns.json +++ b/CRM/TwingleCampaign/resources/campaigns.json @@ -323,7 +323,7 @@ "data_type": "String", "html_type": "Text", "text_length": 128, - "is_active": 0, + "is_active": 1, "is_view": 1, "weight": 6 }, @@ -336,7 +336,7 @@ "data_type": "String", "html_type": "Text", "text_length": 10, - "is_active": 0, + "is_active": 1, "is_view": 1, "weight": 6 },