public $_componentTable;
- public $_customSearchID;
-
/**
* Build all the data structures needed to build the form.
*
$this->preventAjaxSubmit();
//special case for custom search, directly give option to download csv file
- $this->_customSearchID = $this->get('customSearchID');
+ $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;
$isStandalone = $formName == 'CRM_Export_StateMachine_Standalone';
// get the submitted values based on search
- if ($this->_customSearchID) {
- $values = $this->get('formValues');
- $this->assign('exportCustomSearchField', TRUE);
- }
- elseif ($this->_action == CRM_Core_Action::ADVANCED) {
+ if ($this->_action == CRM_Core_Action::ADVANCED) {
$values = $this->controller->exportValues('Advanced');
}
elseif ($this->_action == CRM_Core_Action::PROFILE) {
$exportOptions = $mergeOptions = $postalMailing = array();
$exportOptions[] = $this->createElement('radio',
NULL, NULL,
- ts('Export %1 fields', array(1 => empty($this->_customSearchID) ? 'PRIMARY' : 'custom search')),
+ ts('Export PRIMARY fields'),
self::EXPORT_ALL,
array('onClick' => 'showMappingOption( );')
);
}
if ($exportOption == self::EXPORT_ALL) {
- if ($this->_customSearchID) {
- CRM_Export_BAO_Export::exportCustom($this->get('customSearchClass'),
- $this->get('formValues'),
- $this->get(CRM_Utils_Sort::SORT_ORDER)
- );
- }
- else {
- CRM_Export_BAO_Export::exportComponents($this->_selectAll,
- $this->_componentIds,
- (array) $this->get('queryParams'),
- $this->get(CRM_Utils_Sort::SORT_ORDER),
- NULL,
- $this->get('returnProperties'),
- $this->_exportMode,
- $this->_componentClause,
- $this->_componentTable,
- $mergeSameAddress,
- $mergeSameHousehold,
- $exportParams,
- $this->get('queryOperator')
- );
- }
+ CRM_Export_BAO_Export::exportComponents($this->_selectAll,
+ $this->_componentIds,
+ (array) $this->get('queryParams'),
+ $this->get(CRM_Utils_Sort::SORT_ORDER),
+ NULL,
+ $this->get('returnProperties'),
+ $this->_exportMode,
+ $this->_componentClause,
+ $this->_componentTable,
+ $mergeSameAddress,
+ $mergeSameHousehold,
+ $exportParams,
+ $this->get('queryOperator')
+ );
}
//reset map page