_columns4ExportCsv) { $this->_columns4ExportCsv = array('added' => 'Submitted'); $fields = array_keys(Qs_Array::excludeKey($this->_getDataObj()->getTableMeta(), 'id', 'added', 'changed')); unset($fields[array_search('idReason', $fields)]); unset($fields[array_search('reasonTitle', $fields)]); unset($fields[array_search('idFoundUs', $fields)]); unset($fields[array_search('foundUsTitle', $fields)]); foreach ($fields as $field) { $this->_columns4ExportCsv[$field] = ucfirst(preg_replace('/([a-z])([A-Z])/', '$1 $2', $field)); } if ($this->getConfig('contactReasonEnabled', true)) { Qs_Array::insertAfterAssoc( $this->_columns4ExportCsv, 'phone', 'reasonTitle', 'Reason for Contact' ); } if ($this->getConfig('foundUsEnabled', true)) { Qs_Array::insertAfterAssoc( $this->_columns4ExportCsv, 'reasonTitle', 'foundUsTitle', 'Hear about us?' ); } $this->_columns4ExportCsv['email'] = 'Email Address'; $this->_columns4ExportCsv['phone'] = 'Phone Number'; } return $this->_columns4ExportCsv; } protected function _getListOptions() { $options = parent::_getListOptions(); $options['hasReason'] = $this->getConfig('contactReasonEnabled', false); $options['hasFoundUs'] = $this->getConfig('foundUsEnabled', false); return $options; } protected function _getFilterFields() { if (null === $this->_filterFields) { parent::_getFilterFields(); if ($this->_getDataObj()->hasReason()) { Qs_Array::insertAfterAssoc($this->_filterFields, 'phone', 'reason', 'Reason for Contact'); Qs_Array::insertAfterAssoc($this->_filterFields, 'reason', 'foundUs', 'Hear about us?'); } $this->_filterFields['email'] = 'Email Address'; $this->_filterFields['phone'] = 'Phone Number'; } return $this->_filterFields; } }