From ae170344a8d653911c97f3c4e83ac560574c34bc Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 24 Nov 2022 15:34:11 +1300 Subject: [PATCH] Fix Import summary to differentiate between 'valid' and 'imported' --- CRM/Contact/Import/Form/Summary.php | 4 +++- CRM/Import/DataSource.php | 1 + templates/CRM/Contact/Import/Form/Summary.tpl | 21 +++++++++++++------ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/CRM/Contact/Import/Form/Summary.php b/CRM/Contact/Import/Form/Summary.php index 45c8dcfd3c..2b606fc9de 100644 --- a/CRM/Contact/Import/Form/Summary.php +++ b/CRM/Contact/Import/Form/Summary.php @@ -63,7 +63,8 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Forms { $this->assign('outputUnavailable', FALSE); try { $this->assign('totalRowCount', $this->getRowCount()); - $this->assign('validRowCount', $this->getRowCount(CRM_Import_Parser::VALID) + $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); + $this->assign('unprocessedRowCount', $this->getRowCount() - $this->getRowCount('imported') - $this->getRowCount(CRM_Import_Parser::ERROR) - $this->getRowCount(CRM_Import_Parser::DUPLICATE)); + $this->assign('importedRowCount', $this->getRowCount('imported')); $this->assign('invalidRowCount', $this->getRowCount(CRM_Import_Parser::ERROR)); $this->assign('duplicateRowCount', $this->getRowCount(CRM_Import_Parser::DUPLICATE)); $this->assign('unMatchCount', $this->getRowCount(CRM_Import_Parser::NO_MATCH)); @@ -100,6 +101,7 @@ class CRM_Contact_Import_Form_Summary extends CRM_Import_Forms { } $this->assign('dupeActionString', $dupeActionString); } + // @todo - remove this - it is never thrown. catch (CRM_Import_Exception_ImportTableUnavailable $e) { $this->assign('outputUnavailable', TRUE); } diff --git a/CRM/Import/DataSource.php b/CRM/Import/DataSource.php index cf0d1dd0b6..ff671282d2 100644 --- a/CRM/Import/DataSource.php +++ b/CRM/Import/DataSource.php @@ -639,6 +639,7 @@ abstract class CRM_Import_DataSource { CRM_Contribute_Import_Parser_Contribution::PLEDGE_PAYMENT_ERROR => ['pledge_payment_error'], 'new' => ['new', 'valid'], 'valid' => ['valid'], + 'imported' => ['imported', 'soft_credit_imported', 'pledge_payment_imported', 'warning_unparsed_address'], ]; } diff --git a/templates/CRM/Contact/Import/Form/Summary.tpl b/templates/CRM/Contact/Import/Form/Summary.tpl index 9c57dfa77f..626e079c55 100644 --- a/templates/CRM/Contact/Import/Form/Summary.tpl +++ b/templates/CRM/Contact/Import/Form/Summary.tpl @@ -14,11 +14,14 @@ {* WizardHeader.tpl provides visual display of steps thru the wizard as well as title for current step *} {include file="CRM/common/WizardHeader.tpl"} -
-

- {ts}Import has completed successfully.{/ts} - {if $outputUnavailable}{ts}Detailed information is no longer available.{/ts}{else}{ts}The information below summarizes the results.{/ts}{/if} -

+
+

+ {if $unprocessedRowCount} + {ts}The import is still processing.{/ts} + {else} + {ts}Import has completed successfully.{/ts} + {/if} +

{if $unMatchCount}

@@ -61,6 +64,12 @@ {$totalRowCount} {ts}Total number of rows in the imported data.{/ts} + {if $unprocessedRowCount} + {ts}Rows Still processing{/ts} + {$unprocessedRowCount} + {ts}Rows still being processed.{/ts} + + {/if} {if $invalidRowCount} {ts}Invalid Rows (skipped){/ts} @@ -91,7 +100,7 @@ {ts}Total Rows Imported{/ts} - {$validRowCount} + {$importedRowCount} {ts}Total number of primary records created or modified during the import.{/ts} {foreach from=$trackingSummary item="summaryRow"} -- 2.25.1