Skip to content
Snippets Groups Projects
Commit 22e9d09a authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[BUGIFX] Field labels not shown in workspaces history

Field labels are not shown if opening the history of an
element in the workspace module.

Resolves: #59546
Releases: 6.2
Change-Id: I3f522957dad8e36046b508dde658496f1cec6008
Reviewed-on: https://review.typo3.org/30713
Reviewed-by: Wouter Wolters
Reviewed-by: Alexander Opitz
Tested-by: Alexander Opitz
Reviewed-by: Tymoteusz Motylewski
Tested-by: Tymoteusz Motylewski
Reviewed-by: Oliver Hader
Tested-by: Oliver Hader
parent 7c8b73d7
Branches
Tags
No related merge requests found
......@@ -89,7 +89,7 @@ class HistoryService implements \TYPO3\CMS\Core\SingletonInterface {
if (!empty($entry['action'])) {
$differences = $entry['action'];
} else {
$differences = implode('<br/>', $this->getDifferences($entry));
$differences = $this->getDifferences($entry);
}
return array(
'datetime' => htmlspecialchars(BackendUtility::datetime($entry['tstamp'])),
......@@ -117,7 +117,12 @@ class HistoryService implements \TYPO3\CMS\Core\SingletonInterface {
BackendUtility::getProcessedValue($tableName, $field, $entry['oldRecord'][$field], 0, TRUE),
BackendUtility::getProcessedValue($tableName, $field, $entry['newRecord'][$field], 0, TRUE)
);
$differences[] = nl2br($fieldDifferences);
if (!empty($fieldDifferences)) {
$differences[] = array(
'label' => $this->getLanguageService()->sl((string)BackendUtility::getItemLabel($tableName, $field)),
'html' => nl2br(trim($fieldDifferences)),
);
}
}
}
}
......@@ -168,4 +173,11 @@ class HistoryService implements \TYPO3\CMS\Core\SingletonInterface {
return $this->differencesObject;
}
/**
* @return \TYPO3\CMS\Lang\LanguageService
*/
protected function getLanguageService() {
return $GLOBALS['LANG'];
}
}
......@@ -172,7 +172,23 @@ TYPO3.Workspaces.Helpers = {
columns: [
{ width: 30, id: 'datetime', header: 'Date' },
{ width: 20, id: 'user', header: 'User', dataIndex: 'user' },
{ id: 'differences', header: 'Differences', dataIndex: 'differences' }
{
id: 'differences',
header: 'Differences',
dataIndex: 'differences',
renderer: function(value, metaData, record, rowIndex, colIndex, store) {
if (typeof value === 'string') {
return value;
} else {
var template = new Ext.XTemplate(
'<tpl for=".">',
'<div style="display: block; padding: 3px 0;"><strong>{label}</strong> {html}</div>',
'</tpl>'
);
return template.apply(value);
}
}
}
]
})
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment