ENHANCEMENT Export to CSV data of MemberTableField gets all fields on the member from the db array, instead of just FirstName, Surname and Email

MINOR Code formatting fix

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@70783 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sean Harvey 2009-01-27 02:33:37 +00:00 committed by Sam Minnee
parent 9526f6e138
commit e08fc1e0e5

View File

@ -65,6 +65,7 @@ class MemberTableField extends ComplexTableField {
} }
$sourceClass = $this->stat('data_class'); $sourceClass = $this->stat('data_class');
$SNG_member = singleton($this->stat('data_class'));
foreach(self::$addedPermissions as $permission) { foreach(self::$addedPermissions as $permission) {
array_push($this->permissions, $permission); array_push($this->permissions, $permission);
@ -76,9 +77,11 @@ class MemberTableField extends ComplexTableField {
"Email" => _t('MemberTableField.EMAIL', 'Email') "Email" => _t('MemberTableField.EMAIL', 'Email')
); );
$csvFieldList = $fieldList; $memberDbFields = $SNG_member->db();
foreach(self::$addedCsvFields as $key => $value) { $csvFieldList = array();
$csvFieldList[$key] = $value;
foreach($memberDbFields as $field => $dbFieldType) {
$csvFieldList[$field] = $field;
} }
foreach(self::$addedFields as $key => $value) { foreach(self::$addedFields as $key => $value) {
@ -101,8 +104,6 @@ class MemberTableField extends ComplexTableField {
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js'); Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js"); Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
$SNG_member = singleton($this->stat('data_class'));
// search // search
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null; $SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
if(!empty($_REQUEST['MemberSearch'])) { if(!empty($_REQUEST['MemberSearch'])) {