diff --git a/code/MemberTableField.php b/code/MemberTableField.php index 6b937ccd..46da36fb 100755 --- a/code/MemberTableField.php +++ b/code/MemberTableField.php @@ -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() {