+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
* $Id$
*
*/
protected $_mappingId;
/**
- * Build the form object
+ * Build the form object.
*
* @return void
*/
public function preProcess() {
$this->_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() {
),
array(
'type' => 'done',
+ 'icon' => 'close',
'name' => ts('Done'),
),
)
}
/**
- * Global validation rules for the form
+ * Global validation rules for the form.
*
* @param array $fields
* Posted values of the form.
}
/**
- * Process the uploaded file
+ * Process the uploaded file.
*
* @return void
*/