mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
FIX use the correct method for CSV exports and include the full file path
This commit is contained in:
parent
e86306c7bf
commit
1e1b596739
@ -55,7 +55,7 @@ class SubmittedFileField extends SubmittedFormField
|
|||||||
{
|
{
|
||||||
if ($file = $this->UploadedFile()) {
|
if ($file = $this->UploadedFile()) {
|
||||||
if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) {
|
if (trim($file->getFilename(), '/') != trim(ASSETS_DIR, '/')) {
|
||||||
return $this->UploadedFile()->URL;
|
return $this->UploadedFile()->AbsoluteLink();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,9 +65,14 @@ class SubmittedForm extends DataObject
|
|||||||
$self->Values()->sort('Created', 'ASC')
|
$self->Values()->sort('Created', 'ASC')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$exportColumns = array(
|
||||||
|
'Title' => 'Title',
|
||||||
|
'ExportValue' => 'Value'
|
||||||
|
);
|
||||||
|
|
||||||
$config = new GridFieldConfig();
|
$config = new GridFieldConfig();
|
||||||
$config->addComponent(new GridFieldDataColumns());
|
$config->addComponent(new GridFieldDataColumns());
|
||||||
$config->addComponent(new GridFieldExportButton());
|
$config->addComponent(new GridFieldExportButton('after', $exportColumns));
|
||||||
$config->addComponent(new GridFieldPrintButton());
|
$config->addComponent(new GridFieldPrintButton());
|
||||||
$values->setConfig($config);
|
$values->setConfig($config);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user