More workspace stuff for beta.
[Packages/TYPO3.CMS.git] / typo3 / mod / user / ws / index.php
index de42b46..8be9725 100755 (executable)
  *  849:     function displayWorkspaceOverview_commandLinksSub($table,$rec,$origId)
  *  897:     function displayWorkspaceOverview_setInPageArray(&$pArray,$rlArr,$table,$row)
  *  928:     function subElements($uid,$treeLevel,$origId=0)
- * 1030:     function subElements_getNonPageRecords($tN, $uid, &$recList)
- * 1060:     function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)
- * 1129:     function markupNewOriginals()
- * 1151:     function createDiffView($table, $diff_1_record, $diff_2_record)
+ * 1031:     function subElements_getNonPageRecords($tN, $uid, &$recList)
+ * 1061:     function subElements_renderItem(&$tCell,$tN,$uid,$rec,$origId,$iconMode,$HTMLdata)
+ * 1130:     function markupNewOriginals()
+ * 1152:     function createDiffView($table, $diff_1_record, $diff_2_record)
  *
  *              SECTION: Module content: Workspace list
- * 1283:     function moduleContent_workspaceList()
+ * 1284:     function moduleContent_workspaceList()
  *
  *              SECTION: Helper functions
- * 1331:     function formatVerId($verId)
- * 1341:     function formatWorkspace($wsid)
- * 1368:     function formatCount($count)
- * 1395:     function versionsInOtherWS($table,$uid)
- * 1425:     function showStageChangeLog($table,$id,$stageCommands)
+ * 1332:     function formatVerId($verId)
+ * 1342:     function formatWorkspace($wsid)
+ * 1369:     function formatCount($count)
+ * 1396:     function versionsInOtherWS($table,$uid)
+ * 1426:     function showStageChangeLog($table,$id,$stageCommands)
  *
  *              SECTION: Processing
- * 1484:     function publishAction()
+ * 1485:     function publishAction()
  *
  * TOTAL FUNCTIONS: 25
  * (This index is automatically created/updated by the extension "extdeveval")
@@ -126,6 +126,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
        var $pageModule = '';
        var $publishAccess = FALSE;
        var $be_user_Array = array();
+       var $stageIndex = array();
 
 
        /*********************************
@@ -153,10 +154,10 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                0 => 'All',
                        ),
                        'display' => array(
-                               0 => '[ONLINE]',
-                               -98 => 'Workspaces',
+                               0 => '[Live workspace]',
+                               -98 => 'Draft Workspaces',
                                -99 => 'All',
-                               -1 => '[Offline]'
+                               -1 => '[Default Draft]'
                        ),
                        'diff' => array(
                                0 => 'No diff.',
@@ -461,8 +462,8 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $tableRows[] = '
                        <tr class="bgColor5 tableheader">
                                <td nowrap="nowrap" width="100">Pagetree:</td>
-                               <td nowrap="nowrap" colspan="2">Online Version:</td>
-                               <td nowrap="nowrap" colspan="2">Offline Versions:</td>
+                               <td nowrap="nowrap" colspan="2">Live Version:</td>
+                               <td nowrap="nowrap" colspan="2">Draft Versions:</td>
                                <td nowrap="nowrap">Stage:</td>
                                <td nowrap="nowrap">Publish:</td>
                                <td>Lifecycle:</td>
@@ -474,7 +475,6 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
 
                $table = '<table border="0" cellpadding="0" cellspacing="1" class="lrPadding workspace-overview">'.implode('',$tableRows).'</table>';
 
-
                return $table.$this->markupNewOriginals();
        }
 
@@ -616,7 +616,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                                                        $multipleWarning = (!$mainCell && $GLOBALS['BE_USER']->workspace!==0? '<br/>'.$this->doc->icons(3).'<b>Multiple versions in same workspace!</b>' : '');
                                                                        $verWarning = $warnAboutVersions || ($warnAboutVersions_nonPages && $GLOBALS['TCA'][$table]['ctrl']['versioning_followPages'])? '<br/>'.$this->doc->icons(3).'<b>Version inside version!</b>' : '';
                                                                        $verElement = $icon.
-                                                                               '<a href="'.htmlspecialchars('index.php?details='.rawurlencode($table.':'.$rec_off['uid'])).'">'.
+                                                                               '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.($table==='pages'?$rec_on['uid']:$rec_on['pid']).'&details='.rawurlencode($table.':'.$rec_off['uid']).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
                                                                                t3lib_BEfunc::getRecordTitle($table,$rec_off,TRUE).
                                                                                '</a>'.
                                                                                $versionsInOtherWSWarning.
@@ -762,8 +762,11 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                        '<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
                                        '<img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/up.gif','width="14" height="14"').' alt="" align="top" title="'.htmlspecialchars($titleAttrib).'" />'.
                                        '</a>';
+
+                               $this->stageIndex[$sId][$table][] = $rec_off['uid'];
                        }
                }
+
                return $actionLinks;
        }
 
@@ -932,7 +935,8 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        return '<br/>
                                        <img'.t3lib_iconWorks::skinImg($this->doc->backPath,'gfx/ol/joinbottom.gif','width="18" height="16"').' align="top" alt="" title="" />'.
                                        ($origId ?
-                                               '<a href="index.php?details='.$uid.'"><span class="typo3-dimmed"><em>[Sub elements, click for details]</em><span></a>' :
+                                               '<a href="'.htmlspecialchars($this->doc->backPath.t3lib_extMgm::extRelPath('version').'cm1/index.php?id='.$uid.'&details='.rawurlencode('pages:'.$uid).'&returnUrl='.rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))).'">'.
+                                               '<span class="typo3-dimmed"><em>[Sub elements, click for details]</em><span></a>' :
                                                '<span class="typo3-dimmed"><em>[Sub elements]</em><span>');
                } else {        // For an offline workspace, show sub elements:
 
@@ -1113,7 +1117,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                                                                        t3lib_iconWorks::getIconImage($tN, $rec, $this->doc->backPath,'') : '').
                                                                t3lib_BEfunc::getRecordTitle($tN, $rec, TRUE).
                                                        '</td>
-                                                       <td>'.
+                                                       <td class="cmdCell">'.
                                                                $this->displayWorkspaceOverview_commandLinksSub($tN,$rec,$origId).
                                                        '</td>'.($origId ? '<td class="diffCell">'.
                                                                $diffCode.
@@ -1344,7 +1348,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                if (!isset($this->formatWorkspace_cache[$wsid]))        {
                        switch($wsid)   {
                                case -1:
-                                       $this->formatWorkspace_cache[$wsid] = '[Offline]';
+                                       $this->formatWorkspace_cache[$wsid] = '[Draft]';
                                break;
                                case 0:
                                        $this->formatWorkspace_cache[$wsid] = '';       // Does not output anything for ONLINE because it might confuse people to think that the elemnet IS online which is not the case - only that it exists as an offline version in the online workspace...
@@ -1426,7 +1430,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
                        'log_data,tstamp,userid',
                        'sys_log',
-                       'action=6
+                       'action=6 and details_nr=30
                                AND tablename='.$GLOBALS['TYPO3_DB']->fullQuoteStr($table,'sys_log').'
                                AND recuid='.intval($id)
                );