Bug #16394 » bug3908.diff
t3lib/class.t3lib_tceforms.php (working copy) | ||
---|---|---|
case 'VERSION':
|
||
switch((string)$parts[1]) {
|
||
case 'IS':
|
||
if (strtolower($parts[2])=='true') {
|
||
$output = intval($row['pid'])==-1 ? TRUE : FALSE;
|
||
} elseif (strtolower($parts[2])=='false') {
|
||
$output = !(intval($row['pid'])==-1) ? TRUE : FALSE;
|
||
$_isNewRecord=(intval($row['uid'])>0) ? false: true;
|
||
//Detection of Version can be done be detecting workspace of the user
|
||
$_isUserInWorkspace=($GLOBALS['BE_USER']->workspace >0)? true: false;
|
||
if (intval($row['pid'])==-1 || intval($row['_ORIG_pid'])==-1) {
|
||
$_isRecordDetectedAsVersion=true;
|
||
}
|
||
else {
|
||
$_isRecordDetectedAsVersion=false;
|
||
}
|
||
//(new records in a workspace are not handled as versionrecord)
|
||
// if its no new version we detect versions like thie: if editor is in workspace: always true | if editor is in Live ws: true if pid ==-1
|
||
$isVersion=($_isUserInWorkspace || $_isRecordDetectedAsVersion) && !$_isNewRecord;
|
||
if (strtolower($parts[2])=='true') {
|
||
$output = $isVersion;
|
||
} elseif (strtolower($parts[2])=='false') {
|
||
$output = !$isVersion;
|
||
}
|
||
break;
|
||
}
|
||
break;
|