mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR Fixed undefined variable error in TableListField->generateExportFileData()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@70257 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
af4637ae61
commit
9c4552efa3
@ -910,22 +910,18 @@ JS
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* the function is to generate string that will be used as
|
|
||||||
* the content of exported file
|
|
||||||
*/
|
|
||||||
|
|
||||||
function generateExportFileData(&$numColumns, &$numRows) {
|
function generateExportFileData(&$numColumns, &$numRows) {
|
||||||
$separator = $this->csvSeparator;
|
$separator = $this->csvSeparator;
|
||||||
$csvColumns = ($this->fieldListCsv) ? $this->fieldListCsv : $this->fieldList;
|
$csvColumns = ($this->fieldListCsv) ? $this->fieldListCsv : $this->fieldList;
|
||||||
$fileData = "";
|
$fileData = '';
|
||||||
|
$columnData = array();
|
||||||
|
$fieldItems = new DataObjectSet();
|
||||||
|
|
||||||
if($this->csvHasHeader) {
|
if($this->csvHasHeader) {
|
||||||
$fileData .= "\"" . implode("\"{$separator}\"", array_values($csvColumns)) . "\"";
|
$fileData .= "\"" . implode("\"{$separator}\"", array_values($csvColumns)) . "\"";
|
||||||
$fileData .= "\n";
|
$fileData .= "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// get data
|
|
||||||
if(isset($this->customSourceItems)) {
|
if(isset($this->customSourceItems)) {
|
||||||
$items = $this->customSourceItems;
|
$items = $this->customSourceItems;
|
||||||
} else {
|
} else {
|
||||||
@ -936,7 +932,6 @@ JS
|
|||||||
$items = $dataobject->buildDataObjectSet($records, 'DataObjectSet');
|
$items = $dataobject->buildDataObjectSet($records, 'DataObjectSet');
|
||||||
}
|
}
|
||||||
|
|
||||||
$fieldItems = new DataObjectSet();
|
|
||||||
if($items && $items->count()) foreach($items as $item) {
|
if($items && $items->count()) foreach($items as $item) {
|
||||||
// create a TableListField_Item to support resolving of
|
// create a TableListField_Item to support resolving of
|
||||||
// relation-fields in dot notation via TableListField_Item->Fields()
|
// relation-fields in dot notation via TableListField_Item->Fields()
|
||||||
@ -949,10 +944,8 @@ JS
|
|||||||
|
|
||||||
if($fieldItems) {
|
if($fieldItems) {
|
||||||
foreach($fieldItems as $fieldItem) {
|
foreach($fieldItems as $fieldItem) {
|
||||||
$columnData = array();
|
|
||||||
$fields = $fieldItem->Fields();
|
$fields = $fieldItem->Fields();
|
||||||
foreach($fields as $field) {
|
if($fields) foreach($fields as $field) {
|
||||||
|
|
||||||
$value = $field->Value;
|
$value = $field->Value;
|
||||||
|
|
||||||
// TODO This should be replaced with casting
|
// TODO This should be replaced with casting
|
||||||
|
Loading…
Reference in New Issue
Block a user