本文整理汇总了PHP中CRM_Contact_Form_Task::preprocess方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_Form_Task::preprocess方法的具体用法?PHP CRM_Contact_Form_Task::preprocess怎么用?PHP CRM_Contact_Form_Task::preprocess使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_Form_Task
的用法示例。
在下文中一共展示了CRM_Contact_Form_Task::preprocess方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preProcess
/**
* Build all the data structures needed to build the form.
*
* @return void
*/
public function preProcess()
{
parent::preprocess();
// set print view, so that print templates are called
$this->controller->setPrint(1);
$this->assign('id', $this->get('id'));
$this->assign('pageTitle', ts('CiviCRM Contact Listing'));
$params = $this->get('queryParams');
if (!empty($this->_contactIds)) {
//using _contactIds field for creating params for query so that multiple selections on multiple pages
//can be printed.
foreach ($this->_contactIds as $contactId) {
$params[] = array(CRM_Core_Form::CB_PREFIX . $contactId, '=', 1, 0, 0);
}
}
// create the selector, controller and run - store results in session
$fv = $this->get('formValues');
$returnProperties = $this->get('returnProperties');
$sortID = NULL;
if ($this->get(CRM_Utils_Sort::SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID), $this->get(CRM_Utils_Sort::SORT_DIRECTION));
}
$includeContactIds = FALSE;
if ($fv['radio_ts'] == 'ts_sel') {
$includeContactIds = TRUE;
}
$selectorName = $this->controller->selectorName();
require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php';
$returnP = isset($returnPropeties) ? $returnPropeties : "";
$customSearchClass = $this->get('customSearchClass');
$selector = new $selectorName($customSearchClass, $fv, $params, $returnP, $this->_action, $includeContactIds);
$controller = new CRM_Core_Selector_Controller($selector, NULL, $sortID, CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::SCREEN);
$controller->setEmbedded(TRUE);
$controller->run();
}
示例2: preProcess
/**
* build all the data structures needed to build the form
*
* @return void
* @access public
*/
function preProcess()
{
parent::preprocess();
// set print view, so that print templates are called
$this->controller->setPrint(1);
$this->assign('id', $this->get('id'));
$this->assign('pageTitle', ts('CiviCRM Contact Listing'));
// create the selector, controller and run - store results in session
$fv = $this->get('formValues');
$params = $this->get('queryParams');
$returnProperties = $this->get('returnProperties');
$sortID = null;
if ($this->get(CRM_Utils_Sort::SORT_ID)) {
$sortID = CRM_Utils_Sort::sortIDValue($this->get(CRM_Utils_Sort::SORT_ID), $this->get(CRM_Utils_Sort::SORT_DIRECTION));
}
$includeContactIds = false;
if ($fv['radio_ts'] == 'ts_sel') {
$includeContactIds = true;
}
$selectorName = $this->controller->selectorName();
require_once str_replace('_', DIRECTORY_SEPARATOR, $selectorName) . '.php';
$returnP = isset($returnPropeties) ? $returnPropeties : "";
$customSearchClass = $this->get('customSearchClass');
eval('$selector = new ' . $selectorName . '( $customSearchClass,
$fv,
$params,
$returnP,
$this->_action,
$includeContactIds );');
$controller = new CRM_Core_Selector_Controller($selector, null, $sortID, CRM_Core_Action::VIEW, $this, CRM_Core_Selector_Controller::SCREEN);
$controller->setEmbedded(true);
$controller->run();
}
示例3: 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');
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::preprocess();');
$values = $this->controller->exportValues('Search');
} else {
$values = $this->controller->exportValues('Basic');
}
}
}
}
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::preprocess();
} else {
$this->assign('taskName', "Export {$componentName['1']}");
eval('$componentTasks = CRM_' . $componentName[1] . '_Task::tasks();');
$taskName = $componentTasks[$this->_task];
}
$this->assign('totalSelectedRecords', count($this->_componentIds));
$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);
}