X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FImport%2FForm%2FSummary.php;h=72c8be2f2744c619c6229ceb1ceff86613774648;hb=32e6b5b4d57e503a1a0bf952a0d7288c66d32e36;hp=e12cbb4fa1b484632e064e5e8a33e8876a095350;hpb=d5d00cdaa8c39337033351dc8364217d0cf3cdb8;p=civicrm-core.git diff --git a/CRM/Import/Form/Summary.php b/CRM/Import/Form/Summary.php index e12cbb4fa1..72c8be2f27 100644 --- a/CRM/Import/Form/Summary.php +++ b/CRM/Import/Form/Summary.php @@ -21,7 +21,16 @@ * TODO: CRM-11254 - if preProcess and postProcess functions can be reconciled between the 5 child classes, * those classes can be removed entirely and this class will not need to be abstract */ -abstract class CRM_Import_Form_Summary extends CRM_Core_Form { +abstract class CRM_Import_Form_Summary extends CRM_Import_Forms { + + /** + * Set variables up before form is built. + * + * @return void + */ + public function preProcess() { + $this->assignOutputURLs(); + } /** * Build the form object. @@ -45,4 +54,17 @@ abstract class CRM_Import_Form_Summary extends CRM_Core_Form { return ts('Summary'); } + protected function assignOutputURLs(): void { + $this->assign('totalRowCount', $this->getRowCount()); + $this->assign('validRowCount', $this->getRowCount(CRM_Import_Parser::VALID) + $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); + $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)); + $this->assign('unparsedAddressCount', $this->getRowCount(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); + $this->assign('downloadDuplicateRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::DUPLICATE)); + $this->assign('downloadErrorRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::ERROR)); + $this->assign('downloadMismatchRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::NO_MATCH)); + $this->assign('downloadAddressRecordsUrl', $this->getDownloadURL(CRM_Import_Parser::UNPARSED_ADDRESS_WARNING)); + } + }