Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parser class name #2993

Open
wants to merge 2 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions com.civicrm.hrjobroles/CRM/Hrjobroles/Import/Form/DataSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,39 @@ public function postProcess() {
$this->submitFileForMapping('CRM_Hrjobroles_Import_Parser_HrJobRoles');
}


/**
* Common form postProcess.
* @deprecated - just use postProcess.
*
* @param string $parserClassName
* @param string|null $entity
* Entity to set for paraser currently only for custom import
*/
protected function submitFileForMapping($parserClassName, $entity = NULL) {
CRM_Core_Session::singleton()->set('dateTypes', $this->getSubmittedValue('dateFormats'));
$this->processDatasource();

$mapper = [];

$parser = new $parserClassName($mapper);
if ($entity) {
$parser->setEntity($this->get($entity));
}
$parser->setMaxLinesToProcess(100);
$parser->setUserJobID($this->getUserJobID());
$parser->run(
$this->getSubmittedValue('uploadFile'),
$this->getSubmittedValue('fieldSeparator'),
[],
$this->getSubmittedValue('skipColumnHeader'),
CRM_Import_Parser::MODE_MAPFIELD,
$this->getSubmittedValue('contactType')
);

// add all the necessary variables to the form
$parser->set($this);
$this->controller->resetPage('MapField');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class CRM_Hrjobcontract_Import_Form_Previewbaseclass extends CRM_Import_Form_Pre
* manefestations
* @var unknown
*/
protected $_importParserUrl = '&parser=CRM_Event_Import_Parser';
protected $_importParserUrl = '&parser=CRM_Event_Import_Parser_Participant';
/**
* Function to set variables up before form is built
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class CRM_Hrjobcontract_Import_Form_SummaryBaseClass extends CRM_Import_Form_Sum
* manefestations
* @var unknown
*/
protected $_importParserUrl = '&parser=CRM_Event_Import_Parser';
protected $_importParserUrl = '&parser=CRM_Event_Import_Parser_Participant';
/**
* Function to set variables up before form is built
*
Expand Down