code formatting and smaller errors

This commit is contained in:
Marc Michalsky forumZFD 2020-11-02 17:47:16 +01:00
parent a81eb0c438
commit 937a35e1b8
Signed by untrusted user who does not match committer: marc.koch
GPG key ID: 12406554CFB028B9
6 changed files with 15 additions and 19 deletions

View file

@ -137,7 +137,7 @@ class CampaignType {
); );
if ($this->results['is_error'] == 0) { 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 label: $this->label\n
name: $this->name" name: $this->name"
); );
@ -148,12 +148,12 @@ class CampaignType {
} }
else { else {
if ($this->label) { 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']" \"$this->label\": $this->results['error_message']"
); );
} }
else { 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']"); $this->results['error_message']");
} }
} }

View file

@ -235,13 +235,13 @@ class CustomField {
else { else {
if ($this->label && $this->custom_group_id) { if ($this->label && $this->custom_group_id) {
\Civi::log() \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->label\" for group \"$this->custom_group_id\":
$this->result['error_message']"); $this->result['error_message']");
} }
else { else {
\Civi::log() \Civi::log()
->error("Twingle Extension could not delete custom field: ->error("TwingleCampaign Extension could not delete custom field:
$this->result['error_message']"); $this->result['error_message']");
} }
} }

View file

@ -49,7 +49,7 @@ class CustomGroup {
$this->id = $this->results['id']; $this->id = $this->results['id'];
if ($this->results['is_error'] == 0) { 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 title: $this->title
name: $this->name name: $this->name
extends: $this->extends extends: $this->extends
@ -59,12 +59,12 @@ class CustomGroup {
} }
else { else {
if ($this->title) { 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']" for \"$this->title\": $this->results['error_message']"
); );
} }
else { 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']"); custom group: $this->results['error_message']");
} }
} }
@ -134,7 +134,7 @@ class CustomGroup {
); );
if ($this->results['is_error'] == 0) { 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 title: $this->title
name: $this->name name: $this->name
extends: $this->extends extends: $this->extends
@ -147,12 +147,12 @@ class CustomGroup {
} }
else { else {
if ($this->title) { 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']" \"$this->title\": $this->results['error_message']"
); );
} }
else { 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']"); $this->results['error_message']");
} }
} }

View file

@ -33,7 +33,7 @@ class TwingleEvent extends Campaign {
$this->className = (new \ReflectionClass($this))->getShortName(); $this->className = (new \ReflectionClass($this))->getShortName();
$this->prefix = 'twingle_event_'; $this->prefix = 'twingle_event_';
$this->values['campaign_type_id'] = 'twingle_event';
// Add value for campaign type // Add value for campaign type
$event['campaign_type_id'] = 'twingle_event'; $event['campaign_type_id'] = 'twingle_event';
@ -53,7 +53,7 @@ class TwingleEvent extends Campaign {
* If TRUE, don't do any changes * If TRUE, don't do any changes
* *
* @return array|null * @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 * and status or NULL if $values is not an array
* *
* @throws CiviCRM_API3_Exception * @throws CiviCRM_API3_Exception

View file

@ -33,11 +33,7 @@ class TwingleProject extends Campaign {
$this->className = (new \ReflectionClass($this))->getShortName(); $this->className = (new \ReflectionClass($this))->getShortName();
$this->prefix = 'twingle_project_'; $this->prefix = 'twingle_project_';
// Add value for campaign type
$this->values['campaign_type_id'] = 'twingle_project'; $this->values['campaign_type_id'] = 'twingle_project';
// Get custom field name for project_id
$this->id_custom_field = Cache::getInstance() $this->id_custom_field = Cache::getInstance()
->getCustomFieldMapping()['twingle_project_id']; ->getCustomFieldMapping()['twingle_project_id'];

View file

@ -323,7 +323,7 @@
"data_type": "String", "data_type": "String",
"html_type": "Text", "html_type": "Text",
"text_length": 128, "text_length": 128,
"is_active": 0, "is_active": 1,
"is_view": 1, "is_view": 1,
"weight": 6 "weight": 6
}, },
@ -336,7 +336,7 @@
"data_type": "String", "data_type": "String",
"html_type": "Text", "html_type": "Text",
"text_length": 10, "text_length": 10,
"is_active": 0, "is_active": 1,
"is_view": 1, "is_view": 1,
"weight": 6 "weight": 6
}, },