From 7b845814e9b73d3932adc5c6a9efa2d82f74d905 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 19 Mar 2018 16:18:18 +1300 Subject: [PATCH] Revert "CRM-8140: Not possible to select fields for export when using Custom Searches" This reverts commit ce40afac219b38872fef1d8f052c38d85667db79. --- CRM/Export/Form/Select.php | 54 ++++++++++++---------------- templates/CRM/Export/Form/Select.tpl | 2 +- 2 files changed, 24 insertions(+), 32 deletions(-) diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 593b46ee1f..732391d6dd 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -70,8 +70,6 @@ class CRM_Export_Form_Select extends CRM_Core_Form { public $_componentTable; - public $_customSearchID; - /** * Build all the data structures needed to build the form. * @@ -83,7 +81,13 @@ class CRM_Export_Form_Select extends CRM_Core_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; @@ -95,11 +99,7 @@ class CRM_Export_Form_Select extends CRM_Core_Form { $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) { @@ -231,7 +231,7 @@ FROM {$this->_componentTable} $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( );') ); @@ -396,28 +396,20 @@ FROM {$this->_componentTable} } 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 diff --git a/templates/CRM/Export/Form/Select.tpl b/templates/CRM/Export/Form/Select.tpl index 83089bd259..c84d30be76 100644 --- a/templates/CRM/Export/Form/Select.tpl +++ b/templates/CRM/Export/Form/Select.tpl @@ -28,7 +28,7 @@
-

{ts}Export {if $exportCustomSearchField}custom search{else}PRIMARY{/if} fields provides the most commonly used data values. This includes primary address information, preferred phone and email.{/ts}

+

{ts}Export PRIMARY fields provides the most commonly used data values. This includes primary address information, preferred phone and email.{/ts}

{ts}Click Select fields for export and then Continue to choose a subset of fields for export. This option allows you to export multiple specific locations (Home, Work, etc.) as well as custom data. You can also save your selections as a 'field mapping' so you can use it again later.{/ts}

-- 2.25.1