There is all sorts of handling for 'conflict' - but a conflict return code is never
generated
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
// Get the mapping name displayed if the mappingId is set.
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser_Activity';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser_Activity';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
'downloadErrorRecordsUrl',
- 'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
];
$this->setStatusUrl();
public function postProcess() {
$fileName = $this->controller->exportValue('DataSource', 'uploadFile');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
$mapper = $this->controller->exportValue('MapField', 'mapper');
$this->set('errorFile', $errorFile);
$urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Activity_Import_Parser_Activity';
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Activity_Import_Parser_Activity';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Activity_Import_Parser_Activity';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$this->set('totalRowCount', $totalRowCount);
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$duplicateRowCount = $this->get('duplicateRowCount');
$onDuplicate = $this->get('onDuplicate');
$mismatchCount = $this->get('unMatchCount');
// Only subtract dupes from successful import if we're skipping.
$this->set('validRowCount', $totalRowCount - $invalidRowCount -
- $conflictRowCount - $duplicateRowCount - $mismatchCount
+ $duplicateRowCount - $mismatchCount
);
}
$this->assign('dupeActionString', $dupeActionString);
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
- 'downloadConflictRecordsUrl',
'downloadErrorRecordsUrl',
'duplicateRowCount',
'downloadDuplicateRecordsUrl',
$this->_lineCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_fileSize = number_format(filesize($fileName) / 1024.0, 2);
$this->_errors[] = $values;
}
- if ($returnCode & self::CONFLICT) {
- $this->_conflictCount++;
- $recordNumber = $this->_lineCount;
- if ($this->_haveColumnHeader) {
- $recordNumber--;
- }
- array_unshift($values, $recordNumber);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode & self::DUPLICATE) {
$this->_duplicateCount++;
$recordNumber = $this->_lineCount;
$this->_errorFileName = self::errorFileName(self::ERROR);
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
- if ($this->_conflictCount) {
- $headers = array_merge(
- [ts('Line Number'), ts('Reason')],
- $customHeaders
- );
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
+
if ($this->_duplicateCount) {
$headers = array_merge(
[ts('Line Number'), ts('View Activity History URL')],
$store->set('totalRowCount', $this->_totalCount);
$store->set('validRowCount', $this->_validCount);
$store->set('invalidRowCount', $this->_invalidRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
if ($this->_invalidRowCount) {
$store->set('errorsFileName', $this->_errorFileName);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
+
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
* @throws \CRM_Core_Exception
*/
public function preProcess() {
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
$columnNames = $this->get('columnNames');
$this->_disableUSPS = $this->get('disableUSPS');
$this->assign('validRowCount', $this->getRowCount(CRM_Import_Parser::VALID));
$this->assign('totalRowCount', $this->getRowCount([]));
- // @todo conflict rows are still being output in the parser & not updating the temp table - fix
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser_Contact';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser_Contact';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$importJobParams = array(
'doGeocodeAddress' => $this->controller->exportValue('DataSource', 'doGeocodeAddress'),
'invalidRowCount' => $this->get('invalidRowCount'),
- 'conflictRowCount' => $this->get('conflictRowCount'),
'onDuplicate' => $this->get('onDuplicate'),
'dedupe' => $this->getSubmittedValue('dedupe_rule_id'),
'newGroupName' => $this->controller->exportValue($this->_name, 'newGroupName'),
$this->set('errorFile', $errorFile);
- // @todo - these should use the new url but are not reliably updating the table yet.
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contact_Import_Parser_Contact';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
-
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contact_Import_Parser_Contact';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$totalRowCount += $relatedCount;
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$duplicateRowCount = $this->get('duplicateRowCount');
$onDuplicate = $this->get('onDuplicate');
$mismatchCount = $this->get('unMatchCount');
}
//now we also create relative contact in update and fill mode
$this->set('validRowCount', $totalRowCount - $invalidRowCount -
- $conflictRowCount - $duplicateRowCount - $mismatchCount
+ $duplicateRowCount - $mismatchCount
);
$this->assign('dupeActionString', $dupeActionString);
$properties = [
- 'conflictRowCount',
- 'downloadConflictRecordsUrl',
'downloadErrorRecordsUrl',
'duplicateRowCount',
'downloadDuplicateRecordsUrl',
protected $_doGeocodeAddress;
protected $_invalidRowCount;
- protected $_conflictRowCount;
protected $_onDuplicate;
protected $_dedupe;
protected $_newGroupName;
$this->_rowCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_unparsedAddresses = [];
$this->_tableName = $tableName = $this->getUserJob()['metadata']['DataSource']['table_name'];
$this->_errors[] = $values;
}
- if ($returnCode & self::CONFLICT) {
- $this->_conflictCount++;
- array_unshift($values, $this->_rowCount);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode & self::NO_MATCH) {
$this->_unMatchCount++;
array_unshift($values, $this->_rowCount);
}
}
- if ($this->_conflictCount) {
- $headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ], $customHeaders);
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
if ($this->_unMatchCount) {
$headers = array_merge([
ts('Line Number'),
$store->set('totalRowCount', $this->_totalCount);
$store->set('validRowCount', $this->_validCount);
$store->set('invalidRowCount', $this->_invalidRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
$store->set('unMatchCount', $this->_unMatchCount);
switch ($this->_contactType) {
$store->set('contactType', CRM_Import_Parser::CONTACT_ORGANIZATION);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
$softCreditFields = $this->get('softCreditFields');
$mapperSoftCreditType = $this->get('mapperSoftCreditType');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
//get the mapping name displayed if the mappingId is set
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser_Contribution';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser_Contribution';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
'downloadErrorRecordsUrl',
- 'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
];
$this->setStatusUrl();
public function postProcess() {
$fileName = $this->controller->exportValue('DataSource', 'uploadFile');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
$mapperSoftCreditType = $this->get('mapperSoftCreditType');
$this->set('errorFile', $errorFile);
$urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser_Contribution';
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Contribute_Import_Parser_Contribution';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Contribute_Import_Parser_Contribution';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$this->set('downloadPledgePaymentErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$validPledgePaymentRowCount = $this->get('validPledgePaymentRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$duplicateRowCount = $this->get('duplicateRowCount');
$onDuplicate = $this->get('onDuplicate');
$mismatchCount = $this->get('unMatchCount');
/* only subtract dupes from successful import if we're skipping */
$this->set('validRowCount', $totalRowCount - $invalidRowCount -
- $conflictRowCount - $duplicateRowCount - $mismatchCount - $invalidSoftCreditRowCount - $invalidPledgePaymentRowCount
+ $duplicateRowCount - $mismatchCount - $invalidSoftCreditRowCount - $invalidPledgePaymentRowCount
);
}
$this->assign('dupeActionString', $dupeActionString);
'invalidRowCount',
'validSoftCreditRowCount',
'invalidSoftCreditRowCount',
- 'conflictRowCount',
- 'downloadConflictRecordsUrl',
'downloadErrorRecordsUrl',
'duplicateRowCount',
'downloadDuplicateRecordsUrl',
$this->_lineCount = $this->_validSoftCreditRowCount = $this->_validPledgePaymentRowCount = 0;
$this->_invalidRowCount = $this->_validCount = $this->_invalidSoftCreditRowCount = $this->_invalidPledgePaymentRowCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_pledgePaymentErrors = [];
$this->_softCreditErrors = [];
if ($statusID) {
$this->_softCreditErrors[] = $values;
}
- if ($returnCode == self::CONFLICT) {
- $this->_conflictCount++;
- $recordNumber = $this->_lineCount;
- if ($this->_haveColumnHeader) {
- $recordNumber--;
- }
- array_unshift($values, $recordNumber);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode == self::DUPLICATE) {
$this->_duplicateCount++;
$recordNumber = $this->_lineCount;
self::exportCSV($this->_softCreditErrorsFileName, $headers, $this->_softCreditErrors);
}
- if ($this->_conflictCount) {
- $headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ], $customHeaders);
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
if ($this->_duplicateCount) {
$headers = array_merge([
ts('Line Number'),
$store->set('validSoftCreditRowCount', $this->_validSoftCreditRowCount);
$store->set('invalidPledgePaymentRowCount', $this->_invalidPledgePaymentRowCount);
$store->set('validPledgePaymentRowCount', $this->_validPledgePaymentRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
switch ($this->_contactType) {
case 'Individual':
if ($this->_invalidRowCount) {
$store->set('errorsFileName', $this->_errorFileName);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
$entity = $this->get('_entity');
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . $this->_importParserUrl;
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . $this->_importParserUrl;
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
'downloadErrorRecordsUrl',
- 'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
];
public function postProcess() {
$fileName = $this->getSubmittedValue('uploadFile');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
$entity = $this->get('_entity');
$this->set('errorFile', $errorFile);
$urlParams = 'type=' . CRM_Import_Parser::ERROR . $this->_importParserUrl;
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . $this->_importParserUrl;
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . $this->_importParserUrl;
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$this->_lineCount = $this->_warningCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_fileSize = number_format(filesize($fileName) / 1024.0, 2);
$this->_errors[] = $values;
}
- if ($returnCode & self::CONFLICT) {
- $this->_conflictCount++;
- $recordNumber = $this->_lineCount;
- if ($this->_haveColumnHeader) {
- $recordNumber--;
- }
- array_unshift($values, $recordNumber);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode & self::DUPLICATE) {
$this->_duplicateCount++;
$recordNumber = $this->_lineCount;
$this->_errorFileName = self::errorFileName(self::ERROR);
CRM_Contact_Import_Parser_Contact::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
- if ($this->_conflictCount) {
- $headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ], $customHeaders);
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- CRM_Contact_Import_Parser_Contact::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
+
if ($this->_duplicateCount) {
$headers = array_merge([
ts('Line Number'),
$store->set('totalRowCount', $this->_totalCount);
$store->set('validRowCount', $this->_validCount);
$store->set('invalidRowCount', $this->_invalidRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
switch ($this->_contactType) {
case 'Individual':
if ($this->_invalidRowCount) {
$store->set('errorsFileName', $this->_errorFileName);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
+
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
//get the mapping name displayed if the mappingId is set
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser_Participant';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser_Participant';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
'downloadErrorRecordsUrl',
- 'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
];
$fileName = $this->controller->exportValue('DataSource', 'uploadFile');
$separator = $this->controller->exportValue('DataSource', 'fieldSeparator');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
$mapper = $this->controller->exportValue('MapField', 'mapper');
$this->set('errorFile', $errorFile);
$urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Event_Import_Parser_Participant';
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Event_Import_Parser_Participant';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Event_Import_Parser_Participant';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$this->set('totalRowCount', $totalRowCount);
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$duplicateRowCount = $this->get('duplicateRowCount');
$onDuplicate = $this->get('onDuplicate');
$mismatchCount = $this->get('unMatchCount');
/* only subtract dupes from successful import if we're skipping */
$this->set('validRowCount', $totalRowCount - $invalidRowCount -
- $conflictRowCount - $duplicateRowCount - $mismatchCount
+ $duplicateRowCount - $mismatchCount
);
}
$this->assign('dupeActionString', $dupeActionString);
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
- 'downloadConflictRecordsUrl',
'downloadErrorRecordsUrl',
'duplicateRowCount',
'downloadDuplicateRecordsUrl',
$this->_lineCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_fileSize = number_format(filesize($fileName) / 1024.0, 2);
$this->_errors[] = $values;
}
- if ($returnCode & self::CONFLICT) {
- $this->_conflictCount++;
- $recordNumber = $this->_lineCount;
- if ($this->_haveColumnHeader) {
- $recordNumber--;
- }
- array_unshift($values, $recordNumber);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode & self::DUPLICATE) {
$this->_duplicateCount++;
$recordNumber = $this->_lineCount;
$this->_errorFileName = self::errorFileName(self::ERROR);
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
- if ($this->_conflictCount) {
- $headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ], $customHeaders);
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
if ($this->_duplicateCount) {
$headers = array_merge([
ts('Line Number'),
$store->set('totalRowCount', $this->_totalCount);
$store->set('validRowCount', $this->_validCount);
$store->set('invalidRowCount', $this->_invalidRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
switch ($this->_contactType) {
case 'Individual':
if ($this->_invalidRowCount) {
$store->set('errorsFileName', $this->_errorFileName);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
* @return array|int
* One or more of the statues available - e.g
* CRM_Import_Parser::VALID
- * or [CRM_Import_Parser::ERROR, CRM_Import_Parser::CONFLICT]
+ * or [CRM_Import_Parser::ERROR, CRM_Import_Parser::VALID]
*
* @throws \CRM_Core_Exception
* @throws \API_Exception
*/
protected $_errors;
- /**
- * Total number of conflict lines
- * @var int
- */
- protected $_conflictCount;
-
- /**
- * Array of conflict lines
- * @var array
- */
- protected $_conflicts;
-
/**
* Total number of duplicate (from database) lines
* @var int
*/
protected $_errorFileName;
- /**
- * Filename of conflict data
- *
- * @var string
- */
- protected $_conflictFileName;
-
/**
* Filename of duplicate data
*
$fileName .= '.errors';
break;
- case self::CONFLICT:
- $fileName .= '.conflicts';
- break;
-
case self::DUPLICATE:
$fileName .= '.duplicates';
break;
$fileName = 'Import_Errors.csv';
break;
- case self::CONFLICT:
- $fileName = 'Import_Conflicts.csv';
- break;
-
case self::DUPLICATE:
$fileName = 'Import_Duplicates.csv';
break;
$dataValues = $this->get('dataValues');
$mapper = $this->get('mapper');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$mismatchCount = $this->get('unMatchCount');
//get the mapping name displayed if the mappingId is set
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
- if ($conflictRowCount) {
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser_Membership';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- }
-
if ($mismatchCount) {
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser_Membership';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
'downloadErrorRecordsUrl',
- 'downloadConflictRecordsUrl',
'downloadMismatchRecordsUrl',
];
$this->setStatusUrl();
public function postProcess() {
$fileName = $this->getSubmittedValue('uploadFile');
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$onDuplicate = $this->get('onDuplicate');
$mapper = $this->controller->exportValue('MapField', 'mapper');
$this->set('errorFile', $errorFile);
$urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Member_Import_Parser_Membership';
$this->set('downloadErrorRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
- $urlParams = 'type=' . CRM_Import_Parser::CONFLICT . '&parser=CRM_Member_Import_Parser_Membership';
- $this->set('downloadConflictRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
$urlParams = 'type=' . CRM_Import_Parser::NO_MATCH . '&parser=CRM_Member_Import_Parser_Membership';
$this->set('downloadMismatchRecordsUrl', CRM_Utils_System::url('civicrm/export', $urlParams));
}
$this->set('totalRowCount', $totalRowCount);
$invalidRowCount = $this->get('invalidRowCount');
- $conflictRowCount = $this->get('conflictRowCount');
$duplicateRowCount = $this->get('duplicateRowCount');
$onDuplicate = $this->get('onDuplicate');
$mismatchCount = $this->get('unMatchCount');
/* only subtract dupes from successful import if we're skipping */
$this->set('validRowCount', $totalRowCount - $invalidRowCount -
- $conflictRowCount - $duplicateRowCount - $mismatchCount
+ $duplicateRowCount - $mismatchCount
);
}
$this->assign('dupeActionString', $dupeActionString);
'totalRowCount',
'validRowCount',
'invalidRowCount',
- 'conflictRowCount',
- 'downloadConflictRecordsUrl',
'downloadErrorRecordsUrl',
'duplicateRowCount',
'downloadDuplicateRecordsUrl',
$this->_lineCount = 0;
$this->_invalidRowCount = $this->_validCount = 0;
- $this->_totalCount = $this->_conflictCount = 0;
+ $this->_totalCount = 0;
$this->_errors = [];
$this->_warnings = [];
- $this->_conflicts = [];
$this->_fileSize = number_format(filesize($fileName) / 1024.0, 2);
$this->_errors[] = $values;
}
- if ($returnCode & self::CONFLICT) {
- $this->_conflictCount++;
- $recordNumber = $this->_lineCount;
- array_unshift($values, $recordNumber);
- $this->_conflicts[] = $values;
- }
-
if ($returnCode & self::DUPLICATE) {
$this->_duplicateCount++;
$recordNumber = $this->_lineCount;
self::exportCSV($this->_errorFileName, $headers, $this->_errors);
}
- if ($this->_conflictCount) {
- $headers = array_merge([
- ts('Line Number'),
- ts('Reason'),
- ], $customHeaders);
- $this->_conflictFileName = self::errorFileName(self::CONFLICT);
- self::exportCSV($this->_conflictFileName, $headers, $this->_conflicts);
- }
if ($this->_duplicateCount) {
$headers = array_merge([
ts('Line Number'),
$store->set('totalRowCount', $this->_totalCount);
$store->set('validRowCount', $this->_validCount);
$store->set('invalidRowCount', $this->_invalidRowCount);
- $store->set('conflictRowCount', $this->_conflictCount);
switch ($this->_contactType) {
case 'Individual':
if ($this->_invalidRowCount) {
$store->set('errorsFileName', $this->_errorFileName);
}
- if ($this->_conflictCount) {
- $store->set('conflictsFileName', $this->_conflictFileName);
- }
if (isset($this->_rows) && !empty($this->_rows)) {
$store->set('dataValues', $this->_rows);
}
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting transaction ids within this data file. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Conflicts</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts}
- </p>
- {/if}
-
-
<p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows{/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction ids within this file. These rows will be skipped (not imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
<tr><td class="label crm-grid-cell">{ts}Valid Rows{/ts}</td>
<td class="data">{$validRowCount}</td>
<td class="explanation">{ts}Total rows to be imported.{/ts}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts count=$conflictRowCount plural='CiviCRM has detected %count records with conflicting transaction IDs within this data file or relative to existing activity records. These records have not been imported.'}CiviCRM has detected one record with conflicting transaction ID within this data file or relative to existing activity records. This record have not been imported.{/ts}
- </p>
- <p class="error">
- {ts 1=$downloadConflictRecordsUrl}You can <a href='%1'>Download Conflicts</a>. You may then review these records to determine if they are actually conflicts, and correct the transaction IDs for those that are not.{/ts}
- </p>
- {/if}
-
{if $duplicateRowCount}
<p {if $dupeError}class="error"{/if}>
{ts count=$duplicateRowCount plural='CiviCRM has detected %count records which are duplicates of existing CiviCRM activity records.'}CiviCRM has detected one record which is a duplicate of existing CiviCRM activity record.{/ts} {$dupeActionString}
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows (skipped){/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction IDs (NOT imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
{if $duplicateRowCount}
<tr class="error"><td class="label crm-grid-cell">{ts}Duplicate Rows{/ts}</td>
<td class="data">{$duplicateRowCount}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting email addresses within this data file. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Conflicts</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts}
- </p>
- {/if}
-
<p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts count=$conflictRowCount plural='CiviCRM has detected %count records with conflicting email addresses within this data file or relative to existing contact records. These records have not been imported.'}CiviCRM has detected one record with conflicting email addresses within this data file or relative to existing contact records. This record has not been imported.{/ts} {ts}CiviCRM does not allow multiple contact records to have the same primary email address.{/ts}
- </p>
- <p class="error">
- {ts 1=$downloadConflictRecordsUrl}You can <a href='%1'>Download Conflicts</a>. You may then review these records to determine if they are actually conflicts, and correct the email addresses for those that are not.{/ts}
- </p>
- {/if}
-
{if $duplicateRowCount}
<p {if $dupeError}class="error"{/if}>
{ts count=$duplicateRowCount plural='CiviCRM has detected %count records which are duplicates of existing CiviCRM contact records.'}CiviCRM has detected one record which is a duplicate of existing CiviCRM contact record.{/ts} {$dupeActionString}
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows (skipped){/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting email addresses (NOT imported).{/ts}
- {if $conflictRowCount}
- <div class="action-link"><a href="{$downloadConflictRecordsUrl}"><i class="crm-i fa-download" aria-hidden="true"></i> {ts}Download Conflicts{/ts}</a></div>
- {/if}
- </td>
- </tr>
- {/if}
-
{if $duplicateRowCount && $dupeError}
<tr class="error"><td class="label crm-grid-cell">{ts}Duplicate Rows{/ts}</td>
<td class="data">{$duplicateRowCount}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting transaction ids within this data file. If you continue, these records will be skipped. You can download a file with just these problem records: <a href='%2'>Download Conflicts</a>. If you wish, you can then correct them in the original import file, cancel this import and begin again at step 1.{/ts}
- </p>
- {/if}
-
-
<p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows{/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction ids within this file. These rows will be skipped (not imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
<tr><td class="label crm-grid-cell">{ts}Valid Rows{/ts}</td>
<td class="data">{$validRowCount}</td>
<td class="explanation">{ts}Total rows to be imported.{/ts}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts count=$conflictRowCount plural='CiviCRM has detected %count records with conflicting transaction IDs within this data file or relative to existing contribution records. These records have not been imported.'}CiviCRM has detected one record with conflicting transaction ID within this data file or relative to existing contribution records. This record has not been imported.{/ts}
- </p>
- <p class="error">
- {ts 1=$downloadConflictRecordsUrl}You can <a href="%1">Download Conflicts</a>. You may then review these records to determine if they are actually conflicts, and correct the transaction IDs for those that are not.{/ts}
- </p>
- {/if}
-
{if $duplicateRowCount}
<p {if $dupeError}class="error"{/if}>
{ts count=$duplicateRowCount plural='CiviCRM has detected %count records which are duplicates of existing CiviCRM contribution records.'}CiviCRM has detected one record which is a duplicate of existing CiviCRM contribution record.{/ts} {$dupeActionString}
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows (skipped){/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction IDs (NOT imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
{if $duplicateRowCount}
<tr class="error"><td class="label crm-grid-cell">{ts}Duplicate Rows{/ts}</td>
<td class="data">{$duplicateRowCount}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting participant IDs within this data file. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Conflicts</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts}
- </p>
- {/if}
-
-
<p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
</div>
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows{/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting participant IDs within this file. These rows will be skipped (not imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
<tr><td class="label crm-grid-cell">{ts}Valid Rows{/ts}</td>
<td class="data">{$validRowCount}</td>
<td class="explanation">{ts}Total rows to be imported.{/ts}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts count=$conflictRowCount plural='CiviCRM has detected %count records with conflicting participant IDs within this data file or relative to existing participant records. These records have not been imported.'}CiviCRM has detected one record with conflicting participant ID within this data file or relative to existing participant records. This record has not been imported.{/ts}
- </p>
- <p class="error">
- {ts 1=$downloadConflictRecordsUrl}You can <a href="%1">Download Conflicts</a>. You may then review these records to determine if they are actually conflicts, and correct the participant IDs for those that are not.{/ts}
- </p>
- {/if}
-
{if $duplicateRowCount}
<p {if $dupeError}class="error"{/if}>
{ts count=$duplicateRowCount plural='CiviCRM has detected %count records which are duplicates of existing CiviCRM participant records.'}CiviCRM has detected one record which is a duplicate of existing CiviCRM participant record.{/ts} {$dupeActionString}
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows (skipped){/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting participant IDs (NOT imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
{if $duplicateRowCount}
<tr class="error"><td class="label crm-grid-cell">{ts}Duplicate Rows{/ts}</td>
<td class="data">{$duplicateRowCount}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts 1=$conflictRowCount 2=$downloadConflictRecordsUrl}CiviCRM has detected %1 records with conflicting transaction ids within this data file. If you continue, these records will be skipped. OR, you can download a file with just these problem records - <a href='%2'>Download Conflicts</a>. Then correct them in the original import file, cancel this import and begin again at step 1.{/ts}
- </p>
- {/if}
-
-
<p>{ts}Click 'Import Now' if you are ready to proceed.{/ts}</p>
</div>
<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows{/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction ids within this file. These rows will be skipped (not imported).{/ts}
- {if $conflictRowCount}
- <div class="action-link"><a href="{$downloadConflictRecordsUrl}"><i class="crm-i fa-download" aria-hidden="true"></i> {ts}Download Conflicts{/ts}</a></div>
- {/if}
- </td>
- </tr>
- {/if}
-
<tr><td class="label crm-grid-cell">{ts}Valid Rows{/ts}</td>
<td class="data">{$validRowCount}</td>
<td class="explanation">{ts}Total rows to be imported.{/ts}</td>
</p>
{/if}
- {if $conflictRowCount}
- <p class="error">
- {ts count=$conflictRowCount plural='CiviCRM has detected %count records with conflicting transaction IDs within this data file or relative to existing membership records. These records have not been imported.'}CiviCRM has detected one record with conflicting transaction ID within this data file or relative to existing membership records. This record has not been imported.{/ts}
- </p>
- <p class="error">
- {ts 1=$downloadConflictRecordsUrl}You can <a href="%1">Download Conflicts</a>. You may then review these records to determine if they are actually conflicts, and correct the transaction IDs for those that are not.{/ts}
- </p>
- {/if}
-
{if $duplicateRowCount}
<p {if $dupeError}class="error"{/if}>
{ts count=$duplicateRowCount plural='CiviCRM has detected %count records which are duplicates of existing CiviCRM membership records.'}CiviCRM has detected one record which is a duplicate of existing CiviCRM membership record.{/ts} {$dupeActionString}
</tr>
{/if}
- {if $conflictRowCount}
- <tr class="error"><td class="label crm-grid-cell">{ts}Conflicting Rows (skipped){/ts}</td>
- <td class="data">{$conflictRowCount}</td>
- <td class="explanation">{ts}Rows with conflicting transaction IDs (NOT imported).{/ts}
- {if $conflictRowCount}
- <p><a href="{$downloadConflictRecordsUrl}">{ts}Download Conflicts{/ts}</a></p>
- {/if}
- </td>
- </tr>
- {/if}
-
{if $duplicateRowCount}
<tr class="error"><td class="label crm-grid-cell">{ts}Duplicate Rows{/ts}</td>
<td class="data">{$duplicateRowCount}</td>