Merge pull request #23711 from totten/master-queue-status
[civicrm-core.git] / CRM / Import / Form / Summary.php
index b27af617eea1d085e0965d99ccd891438a6e9a09..72c8be2f2744c619c6229ceb1ceff86613774648 100644 (file)
  */
 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_Import_Forms {
     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));
+  }
+
 }