mirror of
https://github.com/silverstripe/silverstripe-dms
synced 2024-10-22 14:05:56 +02:00
FIX: Ensure Version gridfield has correct field formatting and variables.
This commit is contained in:
parent
eb85a86296
commit
b622547206
@ -820,22 +820,26 @@ class DMSDocument extends DataObject implements DMSDocumentInterface
|
|||||||
new GridFieldDataColumns(),
|
new GridFieldDataColumns(),
|
||||||
new GridFieldPaginator(30)
|
new GridFieldPaginator(30)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$link = $this->owner->Link();
|
||||||
|
$filenameWithoutID = $this->owner->FilenameWithoutID;
|
||||||
|
|
||||||
$versionsGridFieldConfig->getComponentByType('GridFieldDataColumns')
|
$versionsGridFieldConfig->getComponentByType('GridFieldDataColumns')
|
||||||
->setDisplayFields(Config::inst()->get('DMSDocument_versions', 'display_fields'))
|
->setDisplayFields(Config::inst()->get('DMSDocument_versions', 'display_fields'))
|
||||||
->setFieldFormatting(
|
->setFieldFormatting(
|
||||||
array(
|
array(
|
||||||
'FilenameWithoutID' => '<a target="_blank" class="file-url" href="$Link">'
|
'FilenameWithoutID' => "<a target=\"_blank\" class=\"file-url\" href=\"$link\">"
|
||||||
. '$FilenameWithoutID</a>'
|
. "$filenameWithoutID</a>"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$versionsGrid = GridField::create(
|
$versionsGrid = GridField::create(
|
||||||
'Versions',
|
'Versions',
|
||||||
_t('DMSDocument.Versions', 'Versions'),
|
_t('DMSDocument.Versions', 'Versions'),
|
||||||
$this->getVersions(),
|
$this->owner->getVersions(),
|
||||||
$versionsGridFieldConfig
|
$versionsGridFieldConfig
|
||||||
);
|
);
|
||||||
$this->addActionPanelTask('find-versions', 'Versions');
|
$this->owner->addActionPanelTask('find-versions', 'Versions');
|
||||||
}
|
}
|
||||||
|
|
||||||
$embargoValue = 'None';
|
$embargoValue = 'None';
|
||||||
|
Loading…
Reference in New Issue
Block a user