From: eileen Date: Fri, 18 Sep 2020 03:51:38 +0000 (+1200) Subject: Separate export into separate classe to allow unravelling of component handling X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=e2710fee5aba1d6e3d65392f066d8bb559605e1b;p=civicrm-core.git Separate export into separate classe to allow unravelling of component handling --- diff --git a/CRM/Export/Controller/Standalone.php b/CRM/Export/Controller/Standalone.php index f95f4b8d84..2d3074eebd 100644 --- a/CRM/Export/Controller/Standalone.php +++ b/CRM/Export/Controller/Standalone.php @@ -72,7 +72,7 @@ class CRM_Export_Controller_Standalone extends CRM_Core_Controller { $className = 'CRM_' . $this->getComponent($this->get('entity')) . '_Task'; foreach ($className::tasks() as $taskId => $task) { $taskForm = (array) $task['class']; - if ($taskForm[0] == 'CRM_Export_Form_Select') { + if (strpos($taskForm[0], 'CRM_Export_Form_Select') === 0) { $values['task'] = $taskId; } } diff --git a/CRM/Export/Form/Map.php b/CRM/Export/Form/Map.php index a4f64d533f..9e4e5fbaf1 100644 --- a/CRM/Export/Form/Map.php +++ b/CRM/Export/Form/Map.php @@ -27,6 +27,15 @@ class CRM_Export_Form_Map extends CRM_Core_Form { */ protected $_mappingId; + /** + * Use the form name to create the tpl file name. + * + * @return string + */ + public function getTemplateFileName() { + return 'CRM/Export/Form/Map.tpl'; + } + /** * Build the form object. */ diff --git a/CRM/Export/Form/Select.php b/CRM/Export/Form/Select.php index 3570008e59..041fee844d 100644 --- a/CRM/Export/Form/Select.php +++ b/CRM/Export/Form/Select.php @@ -52,6 +52,15 @@ class CRM_Export_Form_Select extends CRM_Core_Form_Task { public $_componentTable; + /** + * Use the form name to create the tpl file name. + * + * @return string + */ + public function getTemplateFileName() { + return 'CRM/Export/Form/Select.tpl'; + } + /** * Build all the data structures needed to build the form. * diff --git a/CRM/Export/Form/Select/Case.php b/CRM/Export/Form/Select/Case.php index 3fd18998c6..c310aa9a48 100644 --- a/CRM/Export/Form/Select/Case.php +++ b/CRM/Export/Form/Select/Case.php @@ -25,13 +25,4 @@ class CRM_Export_Form_Select_Case extends CRM_Export_Form_Select { */ protected $queryMode = CRM_Contact_BAO_Query::MODE_CASE; - /** - * Use the form name to create the tpl file name. - * - * @return string - */ - public function getTemplateFileName() { - return 'CRM/Export/Form/Select.tpl'; - } - } diff --git a/CRM/Member/Export/Form/Map.php b/CRM/Member/Export/Form/Map.php new file mode 100644 index 0000000000..9456d43e3e --- /dev/null +++ b/CRM/Member/Export/Form/Map.php @@ -0,0 +1,23 @@ + [ 'title' => ts('Export members'), 'class' => [ - 'CRM_Export_Form_Select', - 'CRM_Export_Form_Map', + 'CRM_Member_Export_Form_Select', + 'CRM_Member_Export_Form_Map', ], 'result' => FALSE, ],