X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FExport%2FForm%2FMap.php;h=76a1310a00d58d7ec60c5c0aacf985908f4f76f1;hb=7ec3896b33d5959237c9d408cc7aad86b2dbae23;hp=66544bf10d7da47bb9fc653a4716658187d5a0f2;hpb=55039e98512c204e7919bd586b9e99ab176e51ea;p=civicrm-core.git diff --git a/CRM/Export/Form/Map.php b/CRM/Export/Form/Map.php index 66544bf10d..76a1310a00 100644 --- a/CRM/Export/Form/Map.php +++ b/CRM/Export/Form/Map.php @@ -1,9 +1,9 @@ _exportColumnCount = $this->get('exportColumnCount'); + $this->_mappingId = $this->get('mappingId'); + if (!$this->_exportColumnCount) { - $this->_exportColumnCount = 10; + // Set default from saved mapping + if ($this->_mappingId) { + $mapping = new CRM_Core_DAO_MappingField(); + $mapping->mapping_id = $this->_mappingId; + $this->_exportColumnCount = $mapping->count(); + } + else { + $this->_exportColumnCount = 10; + } } else { - $this->_exportColumnCount = $this->_exportColumnCount + 10; + $this->_exportColumnCount += 10; } - - $this->_mappingId = $this->get('mappingId'); } public function buildQuickForm() { @@ -92,15 +96,16 @@ class CRM_Export_Form_Map extends CRM_Core_Form { $this->addButtons(array( array( 'type' => 'back', - 'name' => ts('<< Previous'), + 'name' => ts('Previous'), ), array( 'type' => 'next', - 'name' => ts('Export >>'), + 'name' => ts('Export'), 'spacing' => '          ', ), array( 'type' => 'done', + 'icon' => 'close', 'name' => ts('Done'), ), ) @@ -108,18 +113,18 @@ class CRM_Export_Form_Map extends CRM_Core_Form { } /** - * Global validation rules for the form + * Global validation rules for the form. * - * @param array $fields posted values of the form + * @param array $fields + * Posted values of the form. * * @param $values * @param int $mappingTypeId * - * @return array list of errors to be posted back to the form - * @static - * @access public + * @return array + * list of errors to be posted back to the form */ - static function formRule($fields, $values, $mappingTypeId) { + public static function formRule($fields, $values, $mappingTypeId) { $errors = array(); if (!empty($fields['saveMapping']) && !empty($fields['_qf_Map_next'])) { @@ -147,10 +152,9 @@ class CRM_Export_Form_Map extends CRM_Core_Form { } /** - * Process the uploaded file + * Process the uploaded file. * * @return void - * @access public */ public function postProcess() { $params = $this->controller->exportValues($this->_name); @@ -250,10 +254,9 @@ class CRM_Export_Form_Map extends CRM_Core_Form { * Return a descriptive name for the page, used in wizard header * * @return string - * @access public */ public function getTitle() { return ts('Select Fields to Export'); } -} +}