<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
/**
* various Contact types
*/
- CONST EXPORT_ALL = 1, EXPORT_SELECTED = 2, EXPORT_MERGE_DO_NOT_MERGE = 0, EXPORT_MERGE_SAME_ADDRESS = 1, EXPORT_MERGE_HOUSEHOLD = 2;
+ CONST
+ EXPORT_ALL = 1,
+ EXPORT_SELECTED = 2,
+ EXPORT_MERGE_DO_NOT_MERGE = 0,
+ EXPORT_MERGE_SAME_ADDRESS = 1,
+ EXPORT_MERGE_HOUSEHOLD = 2;
/**
* export modes
*/
- CONST CONTACT_EXPORT = 1, CONTRIBUTE_EXPORT = 2, MEMBER_EXPORT = 3, EVENT_EXPORT = 4, PLEDGE_EXPORT = 5, CASE_EXPORT = 6, GRANT_EXPORT = 7, ACTIVITY_EXPORT = 8;
+ CONST
+ CONTACT_EXPORT = 1,
+ CONTRIBUTE_EXPORT = 2,
+ MEMBER_EXPORT = 3,
+ EVENT_EXPORT = 4,
+ PLEDGE_EXPORT = 5,
+ CASE_EXPORT = 6,
+ GRANT_EXPORT = 7,
+ ACTIVITY_EXPORT = 8;
/**
* current export mode
}
else {
// we need to determine component export
- $stateMachine = &$this->controller->getStateMachine();
+ $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;');
- eval('CRM_' . $componentName[1] . '_Form_Task::preProcessCommon( $this, true );');
+ 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 {
CRM_Case_Form_Task::preProcessCommon($this, TRUE);
$this->_exportMode = self::CASE_EXPORT;
$componentName = array('', 'Case');
- break;
+ break;
}
$this->_task = $values['task'];
}
else {
$this->assign('taskName', "Export $componentName[1]");
- eval('$componentTasks = CRM_' . $componentName[1] . '_Task::tasks();');
+ $className = "CRM_{$componentName[1]}_Task";
+ $componentTasks = $className::tasks();
$taskName = $componentTasks[$this->_task];
$component = TRUE;
}
* @access public
* @static
*/
- public function formRule($params, $files, $self) {
+ static public function formRule($params, $files, $self) {
$errors = array();
if (CRM_Utils_Array::value('mergeOption', $params) == self::EXPORT_MERGE_SAME_ADDRESS &&