mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
9526f6e138
commit
e08fc1e0e5
@ -65,9 +65,10 @@ class MemberTableField extends ComplexTableField {
|
||||
}
|
||||
|
||||
$sourceClass = $this->stat('data_class');
|
||||
$SNG_member = singleton($this->stat('data_class'));
|
||||
|
||||
foreach(self::$addedPermissions as $permission) {
|
||||
array_push( $this->permissions, $permission );
|
||||
array_push($this->permissions, $permission);
|
||||
}
|
||||
|
||||
$fieldList = array(
|
||||
@ -75,12 +76,14 @@ class MemberTableField extends ComplexTableField {
|
||||
"Surname" => _t('MemberTableField.SURNAME', 'Surname'),
|
||||
"Email" => _t('MemberTableField.EMAIL', 'Email')
|
||||
);
|
||||
|
||||
$memberDbFields = $SNG_member->db();
|
||||
$csvFieldList = array();
|
||||
|
||||
$csvFieldList = $fieldList;
|
||||
foreach(self::$addedCsvFields as $key => $value) {
|
||||
$csvFieldList[$key] = $value;
|
||||
foreach($memberDbFields as $field => $dbFieldType) {
|
||||
$csvFieldList[$field] = $field;
|
||||
}
|
||||
|
||||
|
||||
foreach(self::$addedFields as $key => $value) {
|
||||
$fieldList[$key] = $value;
|
||||
}
|
||||
@ -100,8 +103,6 @@ class MemberTableField extends ComplexTableField {
|
||||
|
||||
Requirements::javascript(CMS_DIR . '/javascript/MemberTableField.js');
|
||||
Requirements::javascript(CMS_DIR . "/javascript/MemberTableField_popup.js");
|
||||
|
||||
$SNG_member = singleton($this->stat('data_class'));
|
||||
|
||||
// search
|
||||
$SQL_search = isset($_REQUEST['MemberSearch']) ? Convert::raw2sql($_REQUEST['MemberSearch']) : null;
|
||||
@ -119,8 +120,8 @@ class MemberTableField extends ComplexTableField {
|
||||
$this->sourceFilter[] = "`GroupID`='{$_REQUEST['ctf'][$this->Name()]['GroupID']}'";
|
||||
}
|
||||
|
||||
$this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID`=`Member`.`ID`";
|
||||
$this->setFieldListCsv( $csvFieldList );
|
||||
$this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID` = `Member`.`ID`";
|
||||
$this->setFieldListCsv($csvFieldList);
|
||||
}
|
||||
|
||||
function sourceID() {
|
||||
|
Loading…
Reference in New Issue
Block a user