Project

General

Profile

Bug #20887 » 11722.diff

Administrator Admin, 2009-08-14 17:08

View differences:

t3lib/class.t3lib_befunc.php (Arbeitskopie)
* @param boolean If set, deleted-flagged versions are included! (Only for clean-up script!)
* @return array Array of versions of table/uid
*/
public static function selectVersionsOfRecord($table, $uid, $fields = '*', $workspace = 0, $includeDeletedRecords = FALSE) {
public static function selectVersionsOfRecord($table, $uid, $fields = '*', $workspace = 0, $includeDeletedRecords = FALSE, $row = NULL) {
global $TCA;
if ($TCA[$table] && $TCA[$table]['ctrl']['versioningWS']) {
......
$realPid = 0;
$outputRows = array();
// Select UID version:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$fields,
$table,
'uid='.intval($uid).
($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)),
'',
't3ver_id DESC'
);
// Add rows to output array:
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
if (is_array($row) && !$includeDeletedRecords) {
$row['_CURRENT_VERSION'] = TRUE;
$realPid = $row['pid'];
$outputRows[] = $row;
} else {
// Select UID version:
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
$fields,
$table,
'uid='.intval($uid).
($includeDeletedRecords ? '' : t3lib_BEfunc::deleteClause($table)),
'',
't3ver_id DESC'
);
// Add rows to output array:
while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$row['_CURRENT_VERSION'] = TRUE;
$realPid = $row['pid'];
$outputRows[] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
// Select all offline versions of record:
......
);
// Add rows to output array:
while($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res))) {
$outputRows[] = $row;
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
// Set real-pid:
foreach($outputRows as $idx => $oRow) {
foreach ($outputRows as $idx => $oRow) {
$outputRows[$idx]['_REAL_PID'] = $realPid;
}
typo3/class.db_list_extra.inc (Arbeitskopie)
// Versioning:
if (t3lib_extMgm::isLoaded('version')) {
$vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace);
$vers = t3lib_BEfunc::selectVersionsOfRecord($table, $row['uid'], 'uid', $GLOBALS['BE_USER']->workspace, FALSE, $row);
if (is_array($vers)) { // If table can be versionized.
if (count($vers)>1) {
$class = 'typo3-ctrl-versioning-multipleVersions';
(1-1/2)