Compare commits
38 commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
012f4901e4 | ||
![]() |
7415fac88d | ||
![]() |
91c70c645a | ||
![]() |
de9cd894b7 | ||
![]() |
711ccd7469 | ||
![]() |
beb9d8f170 | ||
![]() |
65c7e668b3 | ||
![]() |
93c1ab649d | ||
![]() |
ee32f19f31 | ||
![]() |
cbb148b22f | ||
![]() |
9118b622d0 | ||
![]() |
db1ab69138 | ||
![]() |
bcd2b448d2 | ||
![]() |
571a86ea66 | ||
![]() |
dc723ed8aa | ||
![]() |
e5ab52f24b | ||
![]() |
8863bbeed0 | ||
![]() |
c45f275fc3 | ||
![]() |
de19c3991c | ||
![]() |
82b4632d63 | ||
![]() |
2949ab0168 | ||
![]() |
54adee32a9 | ||
![]() |
bfa3ae7e32 | ||
![]() |
a4cda1427b | ||
![]() |
2908e11582 | ||
![]() |
2e2f77d3aa | ||
![]() |
51b19ac68d | ||
![]() |
6476a163fc | ||
![]() |
425de0b6ab | ||
![]() |
975b77eaf2 | ||
![]() |
6a50ea2c16 | ||
![]() |
cb4c11feee | ||
![]() |
2abf1676bd | ||
![]() |
841028a435 | ||
![]() |
0ab5bb1fa9 | ||
![]() |
fbe30b0ce5 | ||
![]() |
3e73ed733b | ||
![]() |
482b8e2d0d |
20 changed files with 304 additions and 200 deletions
|
@ -7,7 +7,8 @@ class CRM_TwingleCampaign_BAO_Configuration {
|
||||||
'twingle_api_key',
|
'twingle_api_key',
|
||||||
'twinglecampaign_xcm_profile',
|
'twinglecampaign_xcm_profile',
|
||||||
'twinglecampaign_default_case',
|
'twinglecampaign_default_case',
|
||||||
'twinglecampaign_soft_credits'
|
'twinglecampaign_soft_credits',
|
||||||
|
'twinglecampaign_matomo_integration'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +28,12 @@ class CRM_TwingleCampaign_BAO_Configuration {
|
||||||
Civi::settings()->set('twinglecampaign_soft_credits', 0);
|
Civi::settings()->set('twinglecampaign_soft_credits', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set twinglecampaign_matomo_integration to '0' if checkbox is unchecked
|
||||||
|
if (!array_key_exists('twinglecampaign_matomo_integration', $settings)) {
|
||||||
|
Civi::settings()->set('twinglecampaign_matomo_integration', 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Civi::settings()->add($settings);
|
Civi::settings()->add($settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,4 +70,4 @@ class CRM_TwingleCampaign_BAO_Configuration {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,10 +62,11 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
* @param bool $upgrade
|
* @param bool $upgrade
|
||||||
* If true: Does not show UF message if custom field already exists
|
* If true: Does not show UF message if custom field already exists
|
||||||
*
|
*
|
||||||
* @returns array Result of custom field creation api call
|
* @returns array|False Result of custom field creation api call. False if
|
||||||
|
* field already existed und wasn't upgraded.
|
||||||
* @throws \CiviCRM_API3_Exception
|
* @throws \CiviCRM_API3_Exception
|
||||||
*/
|
*/
|
||||||
public function create(bool $upgrade = FALSE): ?array {
|
public function create(bool $upgrade = FALSE) {
|
||||||
|
|
||||||
// Check if the field already exists
|
// Check if the field already exists
|
||||||
$field = civicrm_api3(
|
$field = civicrm_api3(
|
||||||
|
@ -129,52 +130,74 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return NULL;
|
$this->id = $field['values'][0]['id'];
|
||||||
|
$this->custom_group_id = $field['values'][0]['custom_group_id'];
|
||||||
|
return $this->upgrade($field['values'][0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing custom field
|
* Upgrade an existing custom field
|
||||||
*
|
*
|
||||||
* @returns array Result of custom field creation api call
|
* @param $attributes
|
||||||
|
* Custom Field data
|
||||||
|
* @returns array|False Result of custom field creation api call, False if
|
||||||
|
* field was not upgraded
|
||||||
*/
|
*/
|
||||||
public function update(): array {
|
private function upgrade($attributes) {
|
||||||
|
$upgrade_necessary = False;
|
||||||
|
|
||||||
try {
|
if (key_exists('option_group_id', $attributes)) {
|
||||||
$this->result = civicrm_api3(
|
$this->addOptions($attributes);
|
||||||
'CustomField',
|
}
|
||||||
'create',
|
|
||||||
$this->getSetAttributes());
|
|
||||||
|
|
||||||
// Log field creation
|
foreach ($this as $var => $value) {
|
||||||
if ($this->result['is_error'] == 0) {
|
// put array items into attributes
|
||||||
Civi::log()->info("$this->extensionName has updated a custom field.
|
if (array_key_exists($var, $attributes) && $attributes[$var] != $value) {
|
||||||
|
$this->$var = $attributes[$var];
|
||||||
|
$upgrade_necessary = True;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($upgrade_necessary) {
|
||||||
|
try {
|
||||||
|
$this->result = civicrm_api3(
|
||||||
|
'CustomField',
|
||||||
|
'create',
|
||||||
|
$this->getSetAttributes());
|
||||||
|
|
||||||
|
// Log field creation
|
||||||
|
if ($this->result['is_error'] == 0) {
|
||||||
|
Civi::log()->info("$this->extensionName has updated a custom field.
|
||||||
label: $this->label
|
label: $this->label
|
||||||
name: $this->name
|
name: $this->name
|
||||||
id: $this->id
|
id: $this->id
|
||||||
group: $this->custom_group_id"
|
group: $this->custom_group_id"
|
||||||
);
|
);
|
||||||
|
return $this->result;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
throw new CiviCRM_API3_Exception($this->result['error_message']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (CiviCRM_API3_Exception $e) {
|
||||||
|
// If the field could not get created: log error
|
||||||
|
$errorMessage = $e->getMessage();
|
||||||
|
if ($this->name && $this->custom_group_id) {
|
||||||
|
Civi::log()
|
||||||
|
->error("$this->extensionName could not create new custom field \"$this->name\" for group \"$this->custom_group_id\": $errorMessage");
|
||||||
|
CRM_Utils_System::setUFMessage(E::ts('Creation of custom field \'%1\' failed. Find more information in the logs.', [1 => $this->name]));
|
||||||
|
}
|
||||||
|
// If there is not enough information: log simple error message
|
||||||
|
else {
|
||||||
|
Civi::log()
|
||||||
|
->error("$this->extensionName could not create new custom field: $errorMessage");
|
||||||
|
CRM_Utils_System::setUFMessage(E::ts("Creation of custom field failed. Find more information in the logs."));
|
||||||
|
}
|
||||||
return $this->result;
|
return $this->result;
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
throw new CiviCRM_API3_Exception($this->result['error_message']);
|
|
||||||
}
|
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
|
||||||
// If the field could not get created: log error
|
|
||||||
$errorMessage = $e->getMessage();
|
|
||||||
if ($this->name && $this->custom_group_id) {
|
|
||||||
Civi::log()
|
|
||||||
->error("$this->extensionName could not create new custom field \"$this->name\" for group \"$this->custom_group_id\": $errorMessage");
|
|
||||||
CRM_Utils_System::setUFMessage(E::ts('Creation of custom field \'%1\' failed. Find more information in the logs.', [1 => $this->name]));
|
|
||||||
}
|
|
||||||
// If there is not enough information: log simple error message
|
|
||||||
else {
|
|
||||||
Civi::log()
|
|
||||||
->error("$this->extensionName could not create new custom field: $errorMessage");
|
|
||||||
CRM_Utils_System::setUFMessage(E::ts("Creation of custom field failed. Find more information in the logs."));
|
|
||||||
}
|
|
||||||
return $this->result;
|
|
||||||
}
|
}
|
||||||
|
return False;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -188,32 +211,42 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
$result = [];
|
$result = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$option_group_id = civicrm_api3(
|
foreach ($this->option_values as $key => $value) {
|
||||||
'CustomField',
|
|
||||||
'getsingle',
|
|
||||||
['id' => $this->id]
|
|
||||||
)['option_group_id'];
|
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
|
||||||
$errorMessage = $e->getMessage();
|
|
||||||
Civi::log()
|
|
||||||
->error("$this->extensionName could not get get option group id for custom field \"$this->name\": $errorMessage");
|
|
||||||
CRM_Utils_System::setUFMessage(
|
|
||||||
E::ts('%1 could not get option group id for custom field \'%2\'. Find more information in the logs.',
|
|
||||||
[1 => $this->extensionName, 2 => $this->name])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
$option_value_exists = civicrm_api3(
|
||||||
foreach ($options as $key => $value) {
|
|
||||||
$result[] = civicrm_api3(
|
|
||||||
'OptionValue',
|
'OptionValue',
|
||||||
'create',
|
'get',
|
||||||
[
|
[
|
||||||
'option_group_id' => $option_group_id,
|
'sequential' => 1,
|
||||||
|
'option_group_id' => $options['option_group_id'],
|
||||||
'value' => $key,
|
'value' => $key,
|
||||||
'label' => $value,
|
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// If the option value does not yet exist, create it
|
||||||
|
if ($option_value_exists['count'] == 0) {
|
||||||
|
$result[] = civicrm_api3(
|
||||||
|
'OptionValue',
|
||||||
|
'create',
|
||||||
|
[
|
||||||
|
'option_group_id' => $options['option_group_id'],
|
||||||
|
'value' => $key,
|
||||||
|
'label' => $value,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
// If the option value already exist, update it
|
||||||
|
else {
|
||||||
|
$result[] = civicrm_api3(
|
||||||
|
'OptionValue',
|
||||||
|
'create',
|
||||||
|
[
|
||||||
|
'id' => $option_value_exists['values'][0]['id'],
|
||||||
|
'label' => $value,
|
||||||
|
'value' => $key,
|
||||||
|
]
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
$errorMessage = $e->getMessage();
|
$errorMessage = $e->getMessage();
|
||||||
|
@ -322,12 +355,12 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
if ($this->label && $this->custom_group_id) {
|
if ($this->label && $this->custom_group_id) {
|
||||||
Civi::log()
|
Civi::log()
|
||||||
->error("$this->extensionName could not delete custom field
|
->error("$this->extensionName 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("$this->extensionName could not delete custom field:
|
->error("$this->extensionName could not delete custom field:
|
||||||
$this->result['error_message']");
|
$this->result['error_message']");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -471,4 +504,4 @@ class CRM_TwingleCampaign_BAO_CustomField {
|
||||||
$this->option_values = $option_values;
|
$this->option_values = $option_values;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ class CRM_TwingleCampaign_BAO_OptionValue {
|
||||||
// If a specific option value is required
|
// If a specific option value is required
|
||||||
try {
|
try {
|
||||||
$option_value = civicrm_api3(
|
$option_value = civicrm_api3(
|
||||||
'CustomValue',
|
'OptionValue',
|
||||||
'get',
|
'get',
|
||||||
[
|
[
|
||||||
'sequential' => 1,
|
'sequential' => 1,
|
||||||
|
|
|
@ -219,13 +219,15 @@ class CRM_TwingleCampaign_BAO_TwingleEvent extends Campaign {
|
||||||
private
|
private
|
||||||
static function matchContact(string $names, string $email): ?int {
|
static function matchContact(string $names, string $email): ?int {
|
||||||
$names = StringOps::split_names($names); // Hopefully just a temporary solution
|
$names = StringOps::split_names($names); // Hopefully just a temporary solution
|
||||||
$firstnames = $names['firstnames'];
|
$firstnames = $names['firstnames'] ?? NULL;
|
||||||
$lastname = $names['lastname'];
|
$lastname = $names['lastname'] ?? NULL;
|
||||||
|
$display_name = $names['display_name'] ?? NULL;
|
||||||
try {
|
try {
|
||||||
$contact = civicrm_api3('Contact', 'getorcreate', [
|
$contact = civicrm_api3('Contact', 'getorcreate', [
|
||||||
'xcm_profile' => Civi::settings()->get('twinglecampaign_xcm_profile'),
|
'xcm_profile' => Civi::settings()->get('twinglecampaign_xcm_profile'),
|
||||||
'first_name' => $firstnames,
|
'first_name' => $firstnames,
|
||||||
'last_name' => $lastname,
|
'last_name' => $lastname,
|
||||||
|
'display_name' => $display_name,
|
||||||
'email' => $email,
|
'email' => $email,
|
||||||
]);
|
]);
|
||||||
return (int) $contact['id'];
|
return (int) $contact['id'];
|
||||||
|
|
|
@ -31,6 +31,15 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
|
||||||
'one_time',
|
'one_time',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// All fields for hex color codes
|
||||||
|
const colorFields = [
|
||||||
|
'design_background_color',
|
||||||
|
'design_primary_color',
|
||||||
|
'design_font_color',
|
||||||
|
'design_button_font_color',
|
||||||
|
'design_button_font_color_light',
|
||||||
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ## TwingleProject constructor
|
* ## TwingleProject constructor
|
||||||
*
|
*
|
||||||
|
@ -143,11 +152,13 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
|
||||||
*/
|
*/
|
||||||
private function strToInt(array &$values) {
|
private function strToInt(array &$values) {
|
||||||
foreach ($values as $key => $value) {
|
foreach ($values as $key => $value) {
|
||||||
if (ctype_digit($value)) {
|
if (!in_array($key, self::colorFields)) {
|
||||||
$values[$key] = intval($value);
|
if (ctype_digit($value)) {
|
||||||
}
|
$values[$key] = intval($value);
|
||||||
elseif (is_array($value)) {
|
}
|
||||||
$this->strToInt($values[$key]);
|
elseif (is_array($value)) {
|
||||||
|
$this->strToInt($values[$key]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -170,15 +181,8 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = parent::create($no_hook);
|
return parent::create($no_hook);
|
||||||
|
|
||||||
// Check if campaign was created successfully
|
|
||||||
if ($result['is_error'] == 0) {
|
|
||||||
return TRUE;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Exception($result['error_message']);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -298,21 +302,18 @@ class CRM_TwingleCampaign_BAO_TwingleProject extends Campaign {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Validate hexadecimal color fields
|
// Validate hexadecimal color fields
|
||||||
$colorFields =
|
foreach (self::colorFields as $colorField) {
|
||||||
[
|
|
||||||
'design_background_color',
|
|
||||||
'design_primary_color',
|
|
||||||
'design_font_color',
|
|
||||||
];
|
|
||||||
foreach ($colorFields as $colorField) {
|
|
||||||
if (
|
if (
|
||||||
!empty($this->values['project_options'][$colorField]) &&
|
(
|
||||||
|
!empty($this->values['project_options'][$colorField]) ||
|
||||||
|
$this->values['project_options'][$colorField] === "0"
|
||||||
|
) &&
|
||||||
(
|
(
|
||||||
!(
|
!(
|
||||||
ctype_xdigit($this->values['project_options'][$colorField]) ||
|
ctype_xdigit($this->values['project_options'][$colorField]) ||
|
||||||
is_integer($this->values['project_options'][$colorField])
|
is_integer($this->values['project_options'][$colorField])
|
||||||
) ||
|
) ||
|
||||||
strlen((string) $this->values['project_options'][$colorField]) > 6
|
strlen((string) $this->values['project_options'][$colorField]) != 6
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$valid = FALSE;
|
$valid = FALSE;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A simple custom exception that indicates a problem with the TwingleCampaign class
|
* A simple custom exception that indicates a problem within the TwingleCampaign class
|
||||||
*/
|
*/
|
||||||
class CRM_TwingleCampaign_Exceptions_TwingleCampaignException extends Exception {
|
class CRM_TwingleCampaign_Exceptions_TwingleCampaignException extends Exception {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,6 +46,13 @@ class CRM_TwingleCampaign_Form_Settings extends CRM_Core_Form {
|
||||||
FALSE
|
FALSE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->addElement(
|
||||||
|
'checkbox',
|
||||||
|
'twinglecampaign_matomo_integration',
|
||||||
|
E::ts('Use Matomo to track user interaction with Twingle forms'),
|
||||||
|
FALSE
|
||||||
|
);
|
||||||
|
|
||||||
$this->addButtons([
|
$this->addButtons([
|
||||||
[
|
[
|
||||||
'type' => 'submit',
|
'type' => 'submit',
|
||||||
|
|
|
@ -20,7 +20,7 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
|
||||||
* changed campaigns will get pulled from Twingle.
|
* changed campaigns will get pulled from Twingle.
|
||||||
* @throws \CiviCRM_API3_Exception
|
* @throws \CiviCRM_API3_Exception
|
||||||
*/
|
*/
|
||||||
public function upgrade_02(): bool {
|
public function upgrade_03(): bool {
|
||||||
|
|
||||||
$campaign_info = require E::path() .
|
$campaign_info = require E::path() .
|
||||||
'/CRM/TwingleCampaign/resources/campaigns.php';
|
'/CRM/TwingleCampaign/resources/campaigns.php';
|
||||||
|
@ -96,7 +96,7 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
|
||||||
[1 => $e->getMessage()]
|
[1 => $e->getMessage()]
|
||||||
),
|
),
|
||||||
E::ts('Scheduled Job'),
|
E::ts('Scheduled Job'),
|
||||||
error
|
'error'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -294,83 +294,4 @@ class CRM_TwingleCampaign_Upgrader extends CRM_TwingleCampaign_Upgrader_Base {
|
||||||
Civi::settings()->revert('twingle_api_key');
|
Civi::settings()->revert('twingle_api_key');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Run a couple simple queries.
|
|
||||||
*
|
|
||||||
* @return TRUE on success
|
|
||||||
* @throws Exception
|
|
||||||
*
|
|
||||||
* public function upgrade_4200() {
|
|
||||||
* $this->ctx->log->info('Applying update 4200');
|
|
||||||
* CRM_Core_DAO::executeQuery('UPDATE foo SET bar = "whiz"');
|
|
||||||
* CRM_Core_DAO::executeQuery('DELETE FROM bang WHERE willy = wonka(2)');
|
|
||||||
* return TRUE;
|
|
||||||
* } // */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Run an external SQL script.
|
|
||||||
*
|
|
||||||
* @return TRUE on success
|
|
||||||
* @throws Exception
|
|
||||||
* public function upgrade_4201() {
|
|
||||||
* $this->ctx->log->info('Applying update 4201');
|
|
||||||
* // this path is relative to the extension base dir
|
|
||||||
* $this->executeSqlFile('sql/upgrade_4201.sql');
|
|
||||||
* return TRUE;
|
|
||||||
* } // */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Run a slow upgrade process by breaking it up into smaller chunk.
|
|
||||||
*
|
|
||||||
* @return TRUE on success
|
|
||||||
* @throws Exception
|
|
||||||
* public function upgrade_4202() {
|
|
||||||
* $this->ctx->log->info('Planning update 4202'); // PEAR Log interface
|
|
||||||
*
|
|
||||||
* $this->addTask(E::ts('Process first step'), 'processPart1', $arg1, $arg2);
|
|
||||||
* $this->addTask(E::ts('Process second step'), 'processPart2', $arg3, $arg4);
|
|
||||||
* $this->addTask(E::ts('Process second step'), 'processPart3', $arg5);
|
|
||||||
* return TRUE;
|
|
||||||
* }
|
|
||||||
* public function processPart1($arg1, $arg2) { sleep(10); return TRUE; }
|
|
||||||
* public function processPart2($arg3, $arg4) { sleep(10); return TRUE; }
|
|
||||||
* public function processPart3($arg5) { sleep(10); return TRUE; }
|
|
||||||
* // */
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Example: Run an upgrade with a query that touches many (potentially
|
|
||||||
* millions) of records by breaking it up into smaller chunks.
|
|
||||||
*
|
|
||||||
* @return TRUE on success
|
|
||||||
* @throws Exception
|
|
||||||
* public function upgrade_4203() {
|
|
||||||
* $this->ctx->log->info('Planning update 4203'); // PEAR Log interface
|
|
||||||
*
|
|
||||||
* $minId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(min(id),0) FROM
|
|
||||||
* civicrm_contribution');
|
|
||||||
* $maxId = CRM_Core_DAO::singleValueQuery('SELECT coalesce(max(id),0) FROM
|
|
||||||
* civicrm_contribution'); for ($startId = $minId; $startId <= $maxId;
|
|
||||||
* $startId += self::BATCH_SIZE) {
|
|
||||||
* $endId = $startId + self::BATCH_SIZE - 1;
|
|
||||||
* $title = E::ts('Upgrade Batch (%1 => %2)', array(
|
|
||||||
* 1 => $startId,
|
|
||||||
* 2 => $endId,
|
|
||||||
* ));
|
|
||||||
* $sql = '
|
|
||||||
* UPDATE civicrm_contribution SET foobar = whiz(wonky()+wanker)
|
|
||||||
* WHERE id BETWEEN %1 and %2
|
|
||||||
* ';
|
|
||||||
* $params = array(
|
|
||||||
* 1 => array($startId, 'Integer'),
|
|
||||||
* 2 => array($endId, 'Integer'),
|
|
||||||
* );
|
|
||||||
* $this->addTask($title, 'executeSql', $sql, $params);
|
|
||||||
* }
|
|
||||||
* return TRUE;
|
|
||||||
* } // */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,8 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
$response_copy = $response;
|
$response_copy = $response;
|
||||||
|
|
||||||
// Create soft credit for contribution
|
// Create soft credit for contribution
|
||||||
if (array_key_exists('contribution', $response['values'])) {
|
if (array_key_exists('contribution', $response)) {
|
||||||
$contribution = array_shift($response_copy['values']['contribution']);
|
$contribution = array_shift($response_copy['contribution']);
|
||||||
if (array_key_exists('campaign_id', $contribution)) {
|
if (array_key_exists('campaign_id', $contribution)) {
|
||||||
try {
|
try {
|
||||||
$twingle_event = civicrm_api3(
|
$twingle_event = civicrm_api3(
|
||||||
|
@ -49,7 +49,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
'getsingle',
|
'getsingle',
|
||||||
['id' => $contribution['campaign_id']]
|
['id' => $contribution['campaign_id']]
|
||||||
);
|
);
|
||||||
$response['values']['soft_credit'] =
|
$response['soft_credit'] =
|
||||||
self::createSoftCredit($contribution, $twingle_event)['values'];
|
self::createSoftCredit($contribution, $twingle_event)['values'];
|
||||||
$event->setResponse($response);
|
$event->setResponse($response);
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
|
@ -58,8 +58,8 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Create soft credit for sepa mandate
|
// Create soft credit for sepa mandate
|
||||||
elseif (array_key_exists('sepa_mandate', $response['values'])) {
|
elseif (array_key_exists('sepa_mandate', $response)) {
|
||||||
$sepa_mandate = array_pop($response_copy['values']['sepa_mandate']);
|
$sepa_mandate = array_pop($response_copy['sepa_mandate']);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$contribution = civicrm_api3(
|
$contribution = civicrm_api3(
|
||||||
|
@ -84,7 +84,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
'getsingle',
|
'getsingle',
|
||||||
['id' => $contribution['contribution_campaign_id']]
|
['id' => $contribution['contribution_campaign_id']]
|
||||||
);
|
);
|
||||||
$response['values']['soft_credit'] =
|
$response['soft_credit'] =
|
||||||
self::createSoftCredit($contribution, $twingle_event)['values'];
|
self::createSoftCredit($contribution, $twingle_event)['values'];
|
||||||
$event->setResponse($response);
|
$event->setResponse($response);
|
||||||
} catch (CiviCRM_API3_Exception $e) {
|
} catch (CiviCRM_API3_Exception $e) {
|
||||||
|
@ -103,12 +103,12 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
* the de.systopia.twingle extension can include the campaign into the
|
* the de.systopia.twingle extension can include the campaign into the
|
||||||
* contribution which it will create.
|
* contribution which it will create.
|
||||||
*
|
*
|
||||||
* @param $apiRequest
|
* @param array $apiRequest
|
||||||
* @param $callsame
|
* @param callable $callsame
|
||||||
*
|
*
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function mapDonation($apiRequest, $callsame) {
|
public static function mapDonation(array $apiRequest, callable $callsame) {
|
||||||
|
|
||||||
if (array_key_exists(
|
if (array_key_exists(
|
||||||
'campaign_id',
|
'campaign_id',
|
||||||
|
@ -129,11 +129,7 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
elseif (array_key_exists(
|
elseif (!empty($apiRequest['params']['custom_fields']['event'])) {
|
||||||
'event',
|
|
||||||
$apiRequest['params']['custom_fields']) &&
|
|
||||||
!empty($apiRequest['params']['custom_fields']['event'])
|
|
||||||
) {
|
|
||||||
try {
|
try {
|
||||||
$targetCampaign = civicrm_api3(
|
$targetCampaign = civicrm_api3(
|
||||||
'TwingleEvent',
|
'TwingleEvent',
|
||||||
|
@ -204,7 +200,9 @@ class CRM_TwingleCampaign_Utils_APIWrapper {
|
||||||
'contribution_id' => $contribution['id'],
|
'contribution_id' => $contribution['id'],
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
throw $e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,6 @@ use CRM_TwingleCampaign_ExtensionUtil as E;
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function getCaseTypes(): array {
|
function getCaseTypes(): array {
|
||||||
$caseTypes = [NULL => E::ts('none')];
|
|
||||||
try {
|
try {
|
||||||
$result = civicrm_api3('CaseType', 'get', [
|
$result = civicrm_api3('CaseType', 'get', [
|
||||||
'sequential' => 1,
|
'sequential' => 1,
|
||||||
|
|
75
CRM/TwingleCampaign/Utils/MatomoSnippet.php
Normal file
75
CRM/TwingleCampaign/Utils/MatomoSnippet.php
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A simple class which helps to generate JavaScript snippets which can be
|
||||||
|
* embedded in a website to track user interaction with Twingle forms via
|
||||||
|
* Matomo.
|
||||||
|
*/
|
||||||
|
class CRM_TwingleCampaign_Utils_MatomoSnippet {
|
||||||
|
|
||||||
|
private static function embed_in_base_function($code) {
|
||||||
|
return implode("\n",[
|
||||||
|
"<!-- matomo -->",
|
||||||
|
"<script>",
|
||||||
|
"window.addEventListener('message', function(event){",
|
||||||
|
"if(event && event.data && event.data.type === 'donationFinished') {",
|
||||||
|
$code,
|
||||||
|
"}",
|
||||||
|
"} , false);",
|
||||||
|
"</script>",
|
||||||
|
"<!-- matomo -->",
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns JavaScript snippet to track events in Matomo.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function get_event_tracker() {
|
||||||
|
$code = "_paq.push(['trackEvent', 'twingle', 'donation', event.data.value.recurringRythm, event.data.value.amount]);";
|
||||||
|
return self::embed_in_base_function($code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns JavaScript snippet to track Matomo goals.
|
||||||
|
*
|
||||||
|
* @param $goal_id
|
||||||
|
* The ID of your Matomo goal.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function get_goal_tracker($goal_id) {
|
||||||
|
$code = "_paq.push(['trackGoal', $goal_id]);";
|
||||||
|
return self::embed_in_base_function($code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns JavaScript snippet to track ecommerce activity in Matomo.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function get_ecommerce_tracker() {
|
||||||
|
$code = implode("\n", [
|
||||||
|
"_paq.push(['addEcommerceItem', event.data.value.rythm, '', event.data.value.target, event.data.value.amount]);",
|
||||||
|
"_paq.push(['trackEcommerceOrder', 'anonymizedData', event.data.value.amount]);",
|
||||||
|
]);
|
||||||
|
return self::embed_in_base_function($code);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Appends the given code to the original code.
|
||||||
|
*
|
||||||
|
* @param $original
|
||||||
|
* The original code.
|
||||||
|
* @param $appendix
|
||||||
|
* The code you want to append to the original code.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
* The combined code after appending the appendix.
|
||||||
|
*/
|
||||||
|
public static function append_code($original, $appendix) {
|
||||||
|
return $original . $appendix;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -49,7 +49,7 @@ class CRM_TwingleCampaign_Utils_StringOperations {
|
||||||
$firstnames = implode(" ", $names);
|
$firstnames = implode(" ", $names);
|
||||||
return ['firstnames' => $firstnames, 'lastname' => $lastname];
|
return ['firstnames' => $firstnames, 'lastname' => $lastname];
|
||||||
}
|
}
|
||||||
return $string;
|
return ['display_name' => $string];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -71,4 +71,4 @@ class CRM_TwingleCampaign_Utils_StringOperations {
|
||||||
public static function startsWith($haystack, $needle): bool {
|
public static function startsWith($haystack, $needle): bool {
|
||||||
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
return substr_compare($haystack, $needle, 0, strlen($needle)) === 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -113,7 +113,9 @@ return [
|
||||||
"option_values" => [
|
"option_values" => [
|
||||||
"default" => E::ts("Default"),
|
"default" => E::ts("Default"),
|
||||||
"event" => E::ts("Events"),
|
"event" => E::ts("Events"),
|
||||||
"membership" => E::ts("Membership")
|
"membership" => E::ts("Membership"),
|
||||||
|
"shop" => E::ts("Shop"),
|
||||||
|
"giftshop" => E::ts("Gift Shop")
|
||||||
],
|
],
|
||||||
"text_length" => 32,
|
"text_length" => 32,
|
||||||
"is_active" => 1,
|
"is_active" => 1,
|
||||||
|
|
|
@ -72,6 +72,8 @@ decrease this interval by changing the configuration of the scheduled job named
|
||||||
Furthermore, the synchronization may get triggered also if a donation for an unknown event arrives via the Twingle API
|
Furthermore, the synchronization may get triggered also if a donation for an unknown event arrives via the Twingle API
|
||||||
extension.
|
extension.
|
||||||
|
|
||||||
|
A CiviCRM site running [not in productive mode](https://docs.civicrm.org/sysadmin/en/latest/misc/staging-production/) will by default not run any scheduled jobs. In that case you can individually enable the TwingleSync job by adding the parameter runInNonProductionEnvironment=TRUE to the job.
|
||||||
|
|
||||||
## Known Issues
|
## Known Issues
|
||||||
|
|
||||||
- The **Campaign Manager** displays a *«Campaign XY has been saved»* message even if the input validation failed and the
|
- The **Campaign Manager** displays a *«Campaign XY has been saved»* message even if the input validation failed and the
|
||||||
|
@ -81,4 +83,4 @@ extension.
|
||||||
|
|
||||||
- [ ] Make the Twingle Event Settings for contact matching, case creation and creation of soft credits an individual
|
- [ ] Make the Twingle Event Settings for contact matching, case creation and creation of soft credits an individual
|
||||||
setting in each project
|
setting in each project
|
||||||
- [ ] Make more payment methods available
|
- [ ] Make more payment methods available
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
use CRM_TwingleCampaign_ExtensionUtil as E;
|
use CRM_TwingleCampaign_ExtensionUtil as E;
|
||||||
use CRM_TwingleCampaign_Utils_ExtensionCache as Cache;
|
use CRM_TwingleCampaign_Utils_ExtensionCache as Cache;
|
||||||
|
use CRM_TwingleCampaign_Utils_MatomoSnippet as MatomoSnippet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TwingleForm.Get API specification (optional)
|
* TwingleForm.Get API specification (optional)
|
||||||
|
@ -14,6 +15,13 @@ use CRM_TwingleCampaign_Utils_ExtensionCache as Cache;
|
||||||
function _civicrm_api3_twingle_form_Get_spec(array &$spec) {
|
function _civicrm_api3_twingle_form_Get_spec(array &$spec) {
|
||||||
$spec['id'] = [
|
$spec['id'] = [
|
||||||
'name' => 'id',
|
'name' => 'id',
|
||||||
|
'title' => E::ts('Campaign ID'),
|
||||||
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
|
'api.required' => 0,
|
||||||
|
'description' => E::ts('The campaign ID'),
|
||||||
|
];
|
||||||
|
$spec['twingle_project_id'] = [
|
||||||
|
'name' => 'twingle_project_id',
|
||||||
'title' => E::ts('TwingleProject ID'),
|
'title' => E::ts('TwingleProject ID'),
|
||||||
'type' => CRM_Utils_Type::T_INT,
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
'api.required' => 0,
|
'api.required' => 0,
|
||||||
|
@ -66,6 +74,13 @@ function civicrm_api3_twingle_form_Get(array $params): array {
|
||||||
// Get custom fields
|
// Get custom fields
|
||||||
$custom_field_mapping = Cache::getInstance()->getCustomFieldMapping();
|
$custom_field_mapping = Cache::getInstance()->getCustomFieldMapping();
|
||||||
|
|
||||||
|
// Replace twingle_project_id key with custom field name
|
||||||
|
if (key_exists('twingle_project_id', $params)) {
|
||||||
|
$params[$custom_field_mapping['twingle_project_id']] =
|
||||||
|
$params['twingle_project_id'];
|
||||||
|
unset($params['twingle_project_id']);
|
||||||
|
}
|
||||||
|
|
||||||
// Replace twingle_project_type key with custom field name
|
// Replace twingle_project_type key with custom field name
|
||||||
if (key_exists('twingle_project_type', $params)) {
|
if (key_exists('twingle_project_type', $params)) {
|
||||||
$params[$custom_field_mapping['twingle_project_type']] =
|
$params[$custom_field_mapping['twingle_project_type']] =
|
||||||
|
@ -96,16 +111,49 @@ function civicrm_api3_twingle_form_Get(array $params): array {
|
||||||
'project_type' => $value[$custom_field_mapping['twingle_project_type']],
|
'project_type' => $value[$custom_field_mapping['twingle_project_type']],
|
||||||
'counter' => $value[$custom_field_mapping['twingle_project_counter']]
|
'counter' => $value[$custom_field_mapping['twingle_project_counter']]
|
||||||
];
|
];
|
||||||
|
$matomo_integration_enabled = Civi::settings()->get('twinglecampaign_matomo_integration', False);
|
||||||
switch ($value[$custom_field_mapping['twingle_project_type']]) {
|
switch ($value[$custom_field_mapping['twingle_project_type']]) {
|
||||||
case 'event':
|
case 'event':
|
||||||
$returnValues[$value['id']]['embed_code'] =
|
if ($matomo_integration_enabled) {
|
||||||
$value[$custom_field_mapping['twingle_project_eventall']];
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
MatomoSnippet::append_code(
|
||||||
|
$value[$custom_field_mapping['twingle_project_eventall']],
|
||||||
|
MatomoSnippet::get_event_tracker()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
$value[$custom_field_mapping['twingle_project_eventall']];
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'shop':
|
||||||
|
if ($matomo_integration_enabled) {
|
||||||
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
MatomoSnippet::append_code(
|
||||||
|
$value[$custom_field_mapping['twingle_project_widget']],
|
||||||
|
MatomoSnippet::get_ecommerce_tracker()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
$value[$custom_field_mapping['twingle_project_widget']];
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$returnValues[$value['id']]['embed_code'] =
|
if ($matomo_integration_enabled) {
|
||||||
$value[$custom_field_mapping['twingle_project_widget']];
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
MatomoSnippet::append_code(
|
||||||
|
$value[$custom_field_mapping['twingle_project_widget']],
|
||||||
|
MatomoSnippet::get_event_tracker()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$returnValues[$value['id']]['embed_code'] =
|
||||||
|
$value[$custom_field_mapping['twingle_project_widget']];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return civicrm_api3_create_success($returnValues, $query, 'TwingleForm', 'Get');
|
return civicrm_api3_create_success($returnValues, $query, 'TwingleForm', 'Get');
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
@ -12,6 +12,13 @@ use CRM_TwingleCampaign_ExtensionUtil as E;
|
||||||
function _civicrm_api3_twingle_form_Getsingle_spec(array &$spec) {
|
function _civicrm_api3_twingle_form_Getsingle_spec(array &$spec) {
|
||||||
$spec['id'] = [
|
$spec['id'] = [
|
||||||
'name' => 'id',
|
'name' => 'id',
|
||||||
|
'title' => E::ts('Campaign ID'),
|
||||||
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
|
'api.required' => 0,
|
||||||
|
'description' => E::ts('The campaign ID'),
|
||||||
|
];
|
||||||
|
$spec['twingle_project_id'] = [
|
||||||
|
'name' => 'twingle_project_id',
|
||||||
'title' => E::ts('TwingleProject ID'),
|
'title' => E::ts('TwingleProject ID'),
|
||||||
'type' => CRM_Utils_Type::T_INT,
|
'type' => CRM_Utils_Type::T_INT,
|
||||||
'api.required' => 0,
|
'api.required' => 0,
|
||||||
|
|
|
@ -176,8 +176,7 @@ function civicrm_api3_twingle_project_Sync(array $params): array {
|
||||||
$projects_from_twingle = $twingleApi->getProject();
|
$projects_from_twingle = $twingleApi->getProject();
|
||||||
|
|
||||||
// Get all TwingleProjects from CiviCRM
|
// Get all TwingleProjects from CiviCRM
|
||||||
$projects_from_civicrm = civicrm_api3('TwingleProject', 'get',
|
$projects_from_civicrm = civicrm_api3('TwingleProject', 'get');
|
||||||
['is_active' => 1,]);
|
|
||||||
|
|
||||||
// If call to TwingleProject.get failed, forward error message
|
// If call to TwingleProject.get failed, forward error message
|
||||||
if ($projects_from_civicrm['is_error'] != 0) {
|
if ($projects_from_civicrm['is_error'] != 0) {
|
||||||
|
@ -194,8 +193,8 @@ function civicrm_api3_twingle_project_Sync(array $params): array {
|
||||||
foreach ($projects_from_civicrm['values'] as $project_from_civicrm) {
|
foreach ($projects_from_civicrm['values'] as $project_from_civicrm) {
|
||||||
if (
|
if (
|
||||||
!in_array($project_from_civicrm['project_id'],
|
!in_array($project_from_civicrm['project_id'],
|
||||||
array_column($projects_from_twingle, 'id')
|
array_column($projects_from_twingle, 'id'),
|
||||||
)) {
|
) && $project_from_civicrm['is_active'] == 1) {
|
||||||
// store campaign id in $id
|
// store campaign id in $id
|
||||||
$id = $project_from_civicrm['id'];
|
$id = $project_from_civicrm['id'];
|
||||||
unset($project_from_civicrm['id']);
|
unset($project_from_civicrm['id']);
|
||||||
|
|
7
info.xml
7
info.xml
|
@ -14,13 +14,12 @@
|
||||||
<url desc="Support">https://lab.civicrm.org/Marc_Michalsky/de-forumzfd-twinglecampaign/-/issues</url>
|
<url desc="Support">https://lab.civicrm.org/Marc_Michalsky/de-forumzfd-twinglecampaign/-/issues</url>
|
||||||
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
|
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
|
||||||
</urls>
|
</urls>
|
||||||
<releaseDate>2021-12-15</releaseDate>
|
<releaseDate>2024-06-15</releaseDate>
|
||||||
<version>1.0</version>
|
<version>1.0.8</version>
|
||||||
<develStage>stable</develStage>
|
<develStage>stable</develStage>
|
||||||
<compatibility>
|
<compatibility>
|
||||||
<ver>5.14.0</ver>
|
<ver>5.74</ver>
|
||||||
</compatibility>
|
</compatibility>
|
||||||
<comments></comments>
|
|
||||||
<requires>
|
<requires>
|
||||||
<ext>de.systopia.xcm</ext>
|
<ext>de.systopia.xcm</ext>
|
||||||
<ext>de.systopia.campaign</ext>
|
<ext>de.systopia.campaign</ext>
|
||||||
|
|
|
@ -26,6 +26,11 @@
|
||||||
<div class="content">{$form.twinglecampaign_soft_credits.html}</div>
|
<div class="content">{$form.twinglecampaign_soft_credits.html}</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="crm-section">
|
||||||
|
<div class="label">{$form.twinglecampaign_matomo_integration.label}</div>
|
||||||
|
<div class="content">{$form.twinglecampaign_matomo_integration.html}</div>
|
||||||
|
<div class="clear"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -411,8 +411,7 @@ function _validateAndSendInput($id, $campaign_type_id): bool {
|
||||||
CRM_Core_Session::setStatus(
|
CRM_Core_Session::setStatus(
|
||||||
$errorMessage,
|
$errorMessage,
|
||||||
E::ts("Input validation failed"),
|
E::ts("Input validation failed"),
|
||||||
error,
|
error
|
||||||
[unique => TRUE]
|
|
||||||
);
|
);
|
||||||
// Validation failed
|
// Validation failed
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue