本文整理汇总了PHP中CRM_Core_BAO_CustomValueTable::postprocess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomValueTable::postprocess方法的具体用法?PHP CRM_Core_BAO_CustomValueTable::postprocess怎么用?PHP CRM_Core_BAO_CustomValueTable::postprocess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_CustomValueTable
的用法示例。
在下文中一共展示了CRM_Core_BAO_CustomValueTable::postprocess方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Function to process the form
*
* @access public
* @return void
*/
public function postProcess()
{
$params = $this->controller->exportValues($this->_name);
//Check the contact provided in Application form is existing or new
$profileContactType = CRM_Core_BAO_UFGroup::getContactType($this->_profileID);
$dedupeParams = CRM_Dedupe_Finder::formatParams($params, $profileContactType);
$dedupeParams['check_permission'] = FALSE;
$ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, $profileContactType);
$applicantID = $this->_contactID;
if (count($ids) && !$applicantID) {
$applicantID = CRM_Utils_Array::value(0, $ids);
}
$applicantID = CRM_Contact_BAO_Contact::createProfileContact($params, CRM_Core_DAO::$_nullArray, $applicantID, NULL, $this->_profileID);
if ($applicantID) {
$params['start_date'] = date("YmdHis");
$dao = new CRM_HRRecruitment_DAO_HRVacancyStage();
$dao->vacancy_id = $this->_id;
$dao->find();
while ($dao->fetch()) {
$params['case_status_id'] = $dao->case_status_id;
break;
}
//Create case of type Application against creator applicant and assignee as Vacancy creator
$caseTypes = array_flip(CRM_Case_PseudoConstant::caseType('name', TRUE, 'AND filter = 1'));
$cases = CRM_Case_BAO_Case::retrieveCaseIdsByContactId($applicantID, FALSE, 'Application');
foreach ($cases as $case) {
$oldAppl = CRM_HRRecruitment_BAO_HRVacancy::getVacancyIDByCase($case);
if ($oldAppl == $this->_id) {
$params['id'] = $case;
break;
}
}
$params['case_type_id'] = $caseTypes['Application'];
$caseObj = CRM_Case_BAO_Case::create($params);
if (empty($params['id'])) {
$contactParams = array('case_id' => $caseObj->id, 'contact_id' => $applicantID);
CRM_Case_BAO_Case::addCaseToContact($contactParams);
$xmlProcessor = new CRM_Case_XMLProcessor_Process();
$xmlProcessorParams = array('clientID' => $applicantID, 'creatorID' => $this->_creatorID, 'standardTimeline' => 1, 'activityTypeName' => 'Open Case', 'caseID' => $caseObj->id, 'activity_date_time' => $params['start_date']);
$xmlProcessor->run('Application', $xmlProcessorParams);
}
//process Custom data
CRM_Core_BAO_CustomValueTable::postprocess($params, CRM_Core_DAO::$_nullArray, 'civicrm_case', $caseObj->id, 'Case');
//Process case to vacancy one-to-one mapping in custom table 'application_case'
$cgID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', 'application_case', 'id', 'name');
$result = civicrm_api3('CustomField', 'get', array('custom_group_id' => $cgID, 'name' => 'vacancy_id'));
civicrm_api3('custom_value', 'create', array("custom_{$result['id']}" => $this->_id, 'entity_id' => $caseObj->id));
}
if ($this->controller->getButtonName('submit') == "_qf_Application_upload") {
CRM_Core_Session::setStatus(ts("Application has been successfully submitted."));
CRM_Core_Session::singleton()->pushUserContext(CRM_Utils_System::url('civicrm/vacancy/publiclisting', 'reset=1'));
}
}