Merge pull request #627 from creative-commoners/pulls/4.2/submissions-export-fields

FIX submissions export values
This commit is contained in:
Robbie Averill 2017-06-27 16:08:47 +12:00 committed by GitHub
commit eb1fb03e28
2 changed files with 7 additions and 2 deletions

View File

@ -55,7 +55,7 @@ class SubmittedFileField extends SubmittedFormField
{
if ($file = $this->UploadedFile()) {
if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) {
return $this->UploadedFile()->URL;
return $this->UploadedFile()->AbsoluteLink();
}
}
}

View File

@ -65,9 +65,14 @@ class SubmittedForm extends DataObject
$self->Values()->sort('Created', 'ASC')
);
$exportColumns = array(
'Title' => 'Title',
'ExportValue' => 'Value'
);
$config = new GridFieldConfig();
$config->addComponent(new GridFieldDataColumns());
$config->addComponent(new GridFieldExportButton());
$config->addComponent(new GridFieldExportButton('after', $exportColumns));
$config->addComponent(new GridFieldPrintButton());
$values->setConfig($config);