Skip to content
Snippets Groups Projects
Verified Commit 6c4940c1 authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

civicrm release-5.52.3

parent c00e7f9e
No related branches found
No related tags found
No related merge requests found
Showing
with 81 additions and 56 deletions
......@@ -2,7 +2,7 @@
/**
* Plugin Name: CiviCRM
* Description: CiviCRM - Growing and Sustaining Relationships
* Version: 5.52.2
* Version: 5.52.3
* Requires at least: 4.9
* Requires PHP: 7.2
* Author: CiviCRM LLC
......@@ -36,7 +36,7 @@ if (!defined('ABSPATH')) {
}
// Set version here: changing it forces Javascript and CSS to reload.
define('CIVICRM_PLUGIN_VERSION', '5.52.2');
define('CIVICRM_PLUGIN_VERSION', '5.52.3');
// Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) {
......
......@@ -306,7 +306,7 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
$paramValues['contact_type'] = $this->getContactType();
}
elseif ($this->isUpdateExisting() &&
(!empty($paramValues['contribution_id']) || !empty($values['trxn_id']) || !empty($paramValues['invoice_id']))
(!empty($paramValues['id']) || !empty($values['trxn_id']) || !empty($paramValues['invoice_id']))
) {
$paramValues['contact_type'] = $this->getContactType();
}
......@@ -329,9 +329,9 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
if ($this->isUpdateExisting()) {
//fix for CRM-2219 - Update Contribution
// onDuplicate == CRM_Import_Parser::DUPLICATE_UPDATE
if (!empty($paramValues['invoice_id']) || !empty($paramValues['trxn_id']) || !empty($paramValues['contribution_id'])) {
if (!empty($paramValues['invoice_id']) || !empty($paramValues['trxn_id']) || !empty($paramValues['id'])) {
$dupeIds = [
'id' => $paramValues['contribution_id'] ?? NULL,
'id' => $paramValues['id'] ?? NULL,
'trxn_id' => $paramValues['trxn_id'] ?? NULL,
'invoice_id' => $paramValues['invoice_id'] ?? NULL,
];
......@@ -684,12 +684,14 @@ class CRM_Contribute_Import_Parser_Contribution extends CRM_Import_Parser {
$params['contribution_contact_id'] = $matchingContactIds[0];
}
}
elseif (!empty($params['contribution_id']) || !empty($params['trxn_id']) || !empty($params['invoice_id'])) {
elseif (!empty($params['id']) || !empty($params['trxn_id']) || !empty($params['invoice_id'])) {
// when update mode check contribution id or trxn id or
// invoice id
// @todo - this check is obsolete. It survives for now
// in order to keep the rc patch small & non-conflicty.
$contactId = new CRM_Contribute_DAO_Contribution();
if (!empty($params['contribution_id'])) {
$contactId->id = $params['contribution_id'];
if (!empty($params['id'])) {
$contactId->id = $params['id'];
}
elseif (!empty($params['trxn_id'])) {
$contactId->trxn_id = $params['trxn_id'];
......
......@@ -43,38 +43,7 @@ abstract class CRM_Import_Form_Preview extends CRM_Import_Forms {
* Build the form object.
*/
public function buildQuickForm() {
// FIXME: This is a hack...
// The tpl contains javascript that starts the import on form submit
// Since our back/cancel buttons are of html type "submit" we have to prevent a form submit event when they are clicked
// Hacking in some onclick js to make them act more like links instead of buttons
$path = CRM_Utils_System::currentPath();
$query = ['_qf_MapField_display' => 'true'];
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String');
if (CRM_Utils_Rule::qfKey($qfKey)) {
$query['qfKey'] = $qfKey;
}
$previousURL = CRM_Utils_System::url($path, $query, FALSE, NULL, FALSE);
$cancelURL = CRM_Utils_System::url($path, 'reset=1', FALSE, NULL, FALSE);
$this->addButtons([
[
'type' => 'back',
'name' => ts('Previous'),
'js' => ['onclick' => "location.href='{$previousURL}'; return false;"],
],
[
'type' => 'next',
'name' => ts('Import Now'),
'spacing' => '          ',
'isDefault' => TRUE,
],
[
'type' => 'cancel',
'name' => ts('Cancel'),
'js' => ['onclick' => "location.href='{$cancelURL}'; return false;"],
],
]);
$this->addButtons($this->getButtons());
}
/**
......@@ -146,4 +115,47 @@ abstract class CRM_Import_Form_Preview extends CRM_Import_Forms {
$runner->runAllViaWeb();
}
/**
* Get the buttons for the form.
*
* @return array|array[]
* @throws \CRM_Core_Exception
*/
private function getButtons(): array {
// FIXME: This is a hack...
// The tpl contains javascript that starts the import on form submit
// Since our back/cancel buttons are of html type "submit" we have to prevent a form submit event when they are clicked
// Hacking in some onclick js to make them act more like links instead of buttons
$path = CRM_Utils_System::currentPath();
$query = ['_qf_MapField_display' => 'true'];
$qfKey = CRM_Utils_Request::retrieve('qfKey', 'String');
if (CRM_Utils_Rule::qfKey($qfKey)) {
$query['qfKey'] = $qfKey;
}
$previousURL = CRM_Utils_System::url($path, $query, FALSE, NULL, FALSE);
$cancelURL = CRM_Utils_System::url($path, 'reset=1', FALSE, NULL, FALSE);
$buttons = [
[
'type' => 'back',
'name' => ts('Previous'),
'js' => ['onclick' => "location.href='{$previousURL}'; return false;"],
],
];
if ($this->hasImportableRows()) {
$buttons[] = [
'type' => 'next',
'name' => ts('Import Now'),
'spacing' => '          ',
'isDefault' => TRUE,
];
}
$buttons[] = [
'type' => 'cancel',
'name' => ts('Cancel'),
'js' => ['onclick' => "location.href='{$cancelURL}'; return false;"],
];
return $buttons;
}
}
......@@ -683,4 +683,15 @@ class CRM_Import_Forms extends CRM_Core_Form {
return ((int) $this->getSubmittedValue('onDuplicate')) === CRM_Import_Parser::DUPLICATE_SKIP;
}
/**
* Are there valid rows to import.
*
* @return bool
*
* @throws \CRM_Core_Exception
*/
protected function hasImportableRows(): bool {
return (bool) $this->getRowCount(['new']);
}
}
......@@ -1301,7 +1301,7 @@ abstract class CRM_Import_Parser implements UserJobInterface {
}
else {
foreach ($required as $field => $label) {
if (empty($params[$field])) {
if (!isset($params[$field]) || $params[$field] === '') {
$missing[$field] = $label;
}
}
......
......@@ -461,7 +461,7 @@ class CRM_Member_Import_Parser_Membership extends CRM_Import_Parser {
* @return string[]
*/
protected function getOddlyMappedMetadataFields(): array {
$uniqueNames = ['membership_id', 'membership_contact_id'];
$uniqueNames = ['membership_id', 'membership_contact_id', 'membership_start_date', 'membership_join_date', 'membership_end_date', 'membership_source', 'member_is_override', 'member_is_test', 'member_is_pay_later', 'member_campaign_id'];
$fields = [];
foreach ($uniqueNames as $name) {
$fields[$this->importableFieldsMetadata[$name]['name']] = $name;
......
<?php
/** @deprecated */
function civicrmVersion( ) {
return array( 'version' => '5.52.2',
return array( 'version' => '5.52.3',
'cms' => 'Wordpress',
'revision' => '' );
}
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>beta</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -12,7 +12,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-01-09</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-02-11</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2022-01-02</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>alpha</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-11-11</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">https://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2021-05-23</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-10-12</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -13,7 +13,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-03</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-10-07</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<tags>
<tag>mgmt:hidden</tag>
</tags>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-27</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<compatibility>
<ver>5.52</ver>
......
......@@ -15,7 +15,7 @@
<url desc="Licensing">http://www.gnu.org/licenses/agpl-3.0.html</url>
</urls>
<releaseDate>2020-08-05</releaseDate>
<version>5.52.2</version>
<version>5.52.3</version>
<develStage>stable</develStage>
<comments>
FlexMailer is an email delivery engine which replaces the internal guts
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment