本文整理汇总了PHP中CRM_Contribute_Form_Task::preProcessCommon方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contribute_Form_Task::preProcessCommon方法的具体用法?PHP CRM_Contribute_Form_Task::preProcessCommon怎么用?PHP CRM_Contribute_Form_Task::preProcessCommon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contribute_Form_Task
的用法示例。
在下文中一共展示了CRM_Contribute_Form_Task::preProcessCommon方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* build all the data structures needed to build the form
*
* @param
* @return void
* @access public
*/
function preProcess()
{
//special case for custom search, directly give option to download csv file
$customSearchID = $this->get('customSearchID');
if ($customSearchID) {
require_once 'CRM/Export/BAO/Export.php';
CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'), $this->get('formValues'), $this->get(CRM_Utils_Sort::SORT_ORDER));
}
$this->_selectAll = false;
$this->_exportMode = self::CONTACT_EXPORT;
// get the submitted values based on search
if ($this->_action == CRM_Core_Action::ADVANCED) {
$values = $this->controller->exportValues('Advanced');
} else {
if ($this->_action == CRM_Core_Action::PROFILE) {
$values = $this->controller->exportValues('Builder');
} else {
if ($this->_action == CRM_Core_Action::COPY) {
$values = $this->controller->exportValues('Custom');
} else {
// we need to determine component export
$stateMachine =& $this->controller->getStateMachine();
$formName = CRM_Utils_System::getClassName($stateMachine);
$componentName = explode('_', $formName);
$components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
if (in_array($componentName[1], $components)) {
eval('$this->_exportMode = self::' . strtoupper($componentName[1]) . '_EXPORT;');
require_once "CRM/{$componentName[1]}/Form/Task.php";
eval('CRM_' . $componentName[1] . '_Form_Task::preProcessCommon( $this, true );');
$values = $this->controller->exportValues('Search');
} else {
$values = $this->controller->exportValues('Basic');
}
}
}
}
$componentMode = $this->get('component_mode');
switch ($componentMode) {
case 2:
require_once "CRM/Contribute/Form/Task.php";
CRM_Contribute_Form_Task::preProcessCommon($this, true);
$this->_exportMode = self::CONTRIBUTE_EXPORT;
$componentName = array('', 'Contribute');
break;
case 3:
require_once "CRM/Event/Form/Task.php";
CRM_Event_Form_Task::preProcessCommon($this, true);
$this->_exportMode = self::EVENT_EXPORT;
$componentName = array('', 'Event');
break;
case 4:
require_once "CRM/Activity/Form/Task.php";
CRM_Activity_Form_Task::preProcessCommon($this, true);
$this->_exportMode = self::ACTIVITY_EXPORT;
$componentName = array('', 'Activity');
break;
}
require_once 'CRM/Contact/Task.php';
$this->_task = $values['task'];
if ($this->_exportMode == self::CONTACT_EXPORT) {
$contactTasks = CRM_Contact_Task::taskTitles();
$taskName = $contactTasks[$this->_task];
require_once "CRM/Contact/Form/Task.php";
CRM_Contact_Form_Task::preProcessCommon($this, true);
} else {
$this->assign('taskName', "Export {$componentName['1']}");
eval('$componentTasks = CRM_' . $componentName[1] . '_Task::tasks();');
$taskName = $componentTasks[$this->_task];
}
if ($this->_componentTable) {
$query = "\nSELECT count(*)\nFROM {$this->_componentTable}\n";
$totalSelectedRecords = CRM_Core_DAO::singleValueQuery($query);
} else {
$totalSelectedRecords = count($this->_componentIds);
}
$this->assign('totalSelectedRecords', $totalSelectedRecords);
$this->assign('taskName', $taskName);
// all records actions = save a search
if ($values['radio_ts'] == 'ts_all' || $this->_task == CRM_Contact_Task::SAVE_SEARCH) {
$this->_selectAll = true;
$this->assign('totalSelectedRecords', $this->get('rowCount'));
}
$this->set('componentIds', $this->_componentIds);
$this->set('selectAll', $this->_selectAll);
$this->set('exportMode', $this->_exportMode);
$this->set('componentClause', $this->_componentClause);
$this->set('componentTable', $this->_componentTable);
}
示例2: preProcess
/**
* Build all the data structures needed to build the form.
*
* @param
*
* @return void
*/
public function preProcess()
{
//special case for custom search, directly give option to download csv file
$customSearchID = $this->get('customSearchID');
if ($customSearchID) {
CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'), $this->get('formValues'), $this->get(CRM_Utils_Sort::SORT_ORDER));
}
$this->_selectAll = FALSE;
$this->_exportMode = self::CONTACT_EXPORT;
$this->_componentIds = array();
$this->_componentClause = NULL;
// get the submitted values based on search
if ($this->_action == CRM_Core_Action::ADVANCED) {
$values = $this->controller->exportValues('Advanced');
} elseif ($this->_action == CRM_Core_Action::PROFILE) {
$values = $this->controller->exportValues('Builder');
} elseif ($this->_action == CRM_Core_Action::COPY) {
$values = $this->controller->exportValues('Custom');
} else {
// we need to determine component export
$stateMachine = $this->controller->getStateMachine();
$formName = CRM_Utils_System::getClassName($stateMachine);
$componentName = explode('_', $formName);
$components = array('Contribute', 'Member', 'Event', 'Pledge', 'Case', 'Grant', 'Activity');
if (in_array($componentName[1], $components)) {
switch ($componentName[1]) {
case 'Contribute':
$this->_exportMode = self::CONTRIBUTE_EXPORT;
break;
case 'Member':
$this->_exportMode = self::MEMBER_EXPORT;
break;
case 'Event':
$this->_exportMode = self::EVENT_EXPORT;
break;
case 'Pledge':
$this->_exportMode = self::PLEDGE_EXPORT;
break;
case 'Case':
$this->_exportMode = self::CASE_EXPORT;
break;
case 'Grant':
$this->_exportMode = self::GRANT_EXPORT;
break;
case 'Activity':
$this->_exportMode = self::ACTIVITY_EXPORT;
break;
}
$className = "CRM_{$componentName[1]}_Form_Task";
$className::preProcessCommon($this, TRUE);
$values = $this->controller->exportValues('Search');
} else {
$values = $this->controller->exportValues('Basic');
}
}
$count = 0;
$this->_matchingContacts = FALSE;
if (CRM_Utils_Array::value('radio_ts', $values) == 'ts_sel') {
foreach ($values as $key => $value) {
if (strstr($key, 'mark_x')) {
$count++;
}
if ($count > 2) {
$this->_matchingContacts = TRUE;
break;
}
}
}
$componentMode = $this->get('component_mode');
switch ($componentMode) {
case 2:
CRM_Contribute_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::CONTRIBUTE_EXPORT;
$componentName = array('', 'Contribute');
break;
case 3:
CRM_Event_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::EVENT_EXPORT;
$componentName = array('', 'Event');
break;
case 4:
CRM_Activity_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::ACTIVITY_EXPORT;
$componentName = array('', 'Activity');
break;
case 5:
CRM_Member_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::MEMBER_EXPORT;
$componentName = array('', 'Member');
break;
case 6:
CRM_Case_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::CASE_EXPORT;
//.........这里部分代码省略.........