getRowCount(CRM_Import_Parser::VALID); $downloadURL = ''; if ($invalidRowCount) { $urlParams = 'type=' . CRM_Import_Parser::ERROR . '&parser=CRM_Contribute_Import_Parser_Contribution'; $downloadURL = CRM_Utils_System::url('civicrm/export', $urlParams); } $this->setStatusUrl(); $this->assign('downloadErrorRecordsUrl', $downloadURL); } /** * Get the mapped fields as an array of labels. * * e.g * ['First Name', 'Employee Of - First Name', 'Home - Street Address'] * * @return array * @throws \API_Exception * @throws \CRM_Core_Exception */ protected function getMappedFieldLabels(): array { $mapper = []; $parser = $this->getParser(); foreach ($this->getSubmittedValue('mapper') as $columnNumber => $mappedField) { $mapper[$columnNumber] = $parser->getMappedFieldLabel($parser->getMappingFieldFromMapperInput($mappedField, 0, $columnNumber)); } return $mapper; } /** * @return \CRM_Contribute_Import_Parser_Contribution */ protected function getParser(): CRM_Contribute_Import_Parser_Contribution { if (!$this->parser) { $this->parser = new CRM_Contribute_Import_Parser_Contribution(); $this->parser->setUserJobID($this->getUserJobID()); $this->parser->init(); } return $this->parser; } }