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');
|
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
$fieldList = array(
|
$fieldList = array(
|
||||||
@ -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'])) {
|
||||||
@ -119,8 +120,8 @@ class MemberTableField extends ComplexTableField {
|
|||||||
$this->sourceFilter[] = "`GroupID`='{$_REQUEST['ctf'][$this->Name()]['GroupID']}'";
|
$this->sourceFilter[] = "`GroupID`='{$_REQUEST['ctf'][$this->Name()]['GroupID']}'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID`=`Member`.`ID`";
|
$this->sourceJoin = " INNER JOIN `Group_Members` ON `MemberID` = `Member`.`ID`";
|
||||||
$this->setFieldListCsv( $csvFieldList );
|
$this->setFieldListCsv($csvFieldList);
|
||||||
}
|
}
|
||||||
|
|
||||||
function sourceID() {
|
function sourceID() {
|
||||||
|
Loading…
Reference in New Issue
Block a user