Project

General

Profile

Bug #23741 ยป ws_placeholders.patch

Administrator Admin, 2010-10-15 17:45

View differences:

t3lib/class.t3lib_befunc.php (Arbeitskopie)
/**
* Will return where clause de-selecting new(/deleted)-versions from other workspaces.
* If in live-workspace, don't show MOVE-TO-PLACEHOLDERS if versioningWS is 2 (allows moving)
*
* @param string Table name
* @return string Where clause if applicable.
*/
public static function versioningPlaceholderClause($table) {
if ($GLOBALS['BE_USER']->workspace!==0 && $GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
return ' AND ('.$table.'.t3ver_state<=0 OR '.$table.'.t3ver_wsid='.intval($GLOBALS['BE_USER']->workspace).')';
if ($GLOBALS['TCA'][$table] && $GLOBALS['TCA'][$table]['ctrl']['versioningWS']) {
$currentWorkspace = intval($GLOBALS['BE_USER']->workspace);
if ($currentWorkspace !== 0) {
// show only the items of the current workspace
// if in any workspace other than live
return ' AND (' . $table . '.t3ver_state <= 0 OR ' . $table . '.t3ver_wsid = ' . $currentWorkspace . ')';
} elseif ($GLOBALS['TCA'][$table]['ctrl']['versioningWS'] == 2) {
// if in live workspace, don't show MOVE-TO-PLACEHOLDERS
// but only if if versioning of this table allows moving (versioningWS=2)
return ' AND (' . $table . '.t3ver_state != 3)';
}
}
}
    (1-1/1)