[BUGFIX] LIVE workspace actions don't work
authorMichael Klapper <klapper@aoemedia.de>
Mon, 20 Jun 2011 15:37:39 +0000 (17:37 +0200)
committerMichael Klapper <klapper@aoemedia.de>
Tue, 28 Jun 2011 10:43:40 +0000 (12:43 +0200)
The solution is simple to hide all the "actions" in live workspace.

Change-Id: I5ae97bc5f7dacb5e6e40749bf40d2a049689a5e1
Resolves: #11535
Releases: 4.6, 4.5

typo3/sysext/workspaces/Classes/Controller/ReviewController.php
typo3/sysext/workspaces/Classes/ExtDirect/ActionHandler.php
typo3/sysext/workspaces/Resources/Public/JavaScript/grid.js
typo3/sysext/workspaces/Resources/Public/JavaScript/toolbar.js
typo3/sysext/workspaces/Resources/Public/JavaScript/workspaces.js

index f0b7a7a..48e30de 100644 (file)
@@ -61,6 +61,7 @@ class Tx_Workspaces_Controller_ReviewController extends Tx_Workspaces_Controller
                                }
                        }
                }
+               $this->pageRenderer->addInlineSetting('Workspaces', 'isLiveWorkspace', ($GLOBALS['BE_USER']->workspace == 0) ? true : false);
                $this->view->assign('performWorkspaceSwitch', $performWorkspaceSwitch);
                $this->view->assign('workspaceList', $wsList);
                $this->view->assign('activeWorkspaceUid', $activeWorkspace);
index 9138532..b9f73f0 100644 (file)
@@ -111,7 +111,6 @@ class tx_Workspaces_ExtDirect_ActionHandler extends tx_Workspaces_ExtDirect_Abst
                return tx_Workspaces_Service_Workspaces::viewSingleRecord($table, $uid);
        }
 
-
        /**
         * Saves the selected columns to be shown to the preferences of the current backend user.
         *
@@ -126,13 +125,13 @@ class tx_Workspaces_ExtDirect_ActionHandler extends tx_Workspaces_ExtDirect_Abst
                                'hidden'   => $column->hidden
                        );
                }
-               $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['columns'] = $data;
+               $GLOBALS['BE_USER']->uc['moduleData']['Workspaces'][$GLOBALS['BE_USER']->workspace]['columns'] = $data;
                $GLOBALS['BE_USER']->writeUC();
        }
 
        public function loadColumnModel() {
-               if(is_array($GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['columns'])) {
-                       return $GLOBALS['BE_USER']->uc['moduleData']['Workspaces']['columns'];
+               if(is_array($GLOBALS['BE_USER']->uc['moduleData']['Workspaces'][$GLOBALS['BE_USER']->workspace]['columns'])) {
+                       return $GLOBALS['BE_USER']->uc['moduleData']['Workspaces'][$GLOBALS['BE_USER']->workspace]['columns'];
                } else {
                        return array();
                }
index fd1cadd..fa89927 100644 (file)
@@ -91,34 +91,64 @@ TYPO3.Workspaces.SelectionModel = new Ext.grid.CheckboxSelectionModel({
 });
 
 TYPO3.Workspaces.WorkspaceGrid = new Ext.grid.GridPanel({
+       initColModel: function() {
+               if (TYPO3.settings.Workspaces.isLiveWorkspace) {
+                       this.colModel = new Ext.grid.ColumnModel({
+                               columns: [
+                                       TYPO3.Workspaces.RowExpander,
+                                       {id: 'uid', dataIndex : 'uid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.uid'), hidden: true, filterable : true },
+                                       {id: 't3ver_oid', dataIndex : 't3ver_oid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.oid'), hidden: true, filterable : true },
+                                       {id: 'workspace_Title', dataIndex : 'workspace_Title', width: 120, sortable: true, header : TYPO3.l10n.localize('column.workspaceName'), hidden: true, filter : {type : 'string'}},
+                                       TYPO3.Workspaces.Configuration.WsPath,
+                                       TYPO3.Workspaces.Configuration.LivePath,
+                                       TYPO3.Workspaces.Configuration.WsTitleWithIcon,
+                                       TYPO3.Workspaces.Configuration.TitleWithIcon,
+                                       TYPO3.Workspaces.Configuration.ChangeDate
+                               ],
+                               listeners: {
+
+                                       columnmoved: function(colModel) {
+                                               TYPO3.Workspaces.Actions.updateColModel(colModel);
+                                       },
+                                       hiddenchange: function(colModel) {
+                                               TYPO3.Workspaces.Actions.updateColModel(colModel);
+                                       }
+                               }
+                       });
+               } else {
+                               this.colModel = new Ext.grid.ColumnModel({
+                               columns: [
+                                       TYPO3.Workspaces.SelectionModel,
+                                       TYPO3.Workspaces.RowExpander,
+                                       {id: 'uid', dataIndex : 'uid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.uid'), hidden: true, filterable : true },
+                                       {id: 't3ver_oid', dataIndex : 't3ver_oid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.oid'), hidden: true, filterable : true },
+                                       {id: 'workspace_Title', dataIndex : 'workspace_Title', width: 120, sortable: true, header : TYPO3.l10n.localize('column.workspaceName'), hidden: true, filter : {type : 'string'}},
+                                       TYPO3.Workspaces.Configuration.WsPath,
+                                       TYPO3.Workspaces.Configuration.LivePath,
+                                       TYPO3.Workspaces.Configuration.WsTitleWithIcon,
+                                       TYPO3.Workspaces.Configuration.SwapButton,
+                                       TYPO3.Workspaces.Configuration.TitleWithIcon,
+                                       TYPO3.Workspaces.Configuration.ChangeDate,
+                                       TYPO3.Workspaces.Configuration.ChangeState,
+                                       TYPO3.Workspaces.Configuration.Stage,
+                                       TYPO3.Workspaces.Configuration.RowButtons
+                               ],
+                               listeners: {
+
+                                       columnmoved: function(colModel) {
+                                               TYPO3.Workspaces.Actions.updateColModel(colModel);
+                                       },
+                                       hiddenchange: function(colModel) {
+                                               TYPO3.Workspaces.Actions.updateColModel(colModel);
+                                       }
+                               }
+                       });
+               }
+
+       },
        border : true,
        store : TYPO3.Workspaces.MainStore,
-       colModel : new Ext.grid.ColumnModel({
-               columns: [
-                       TYPO3.Workspaces.SelectionModel,
-                       TYPO3.Workspaces.RowExpander,
-                       {id: 'uid', dataIndex : 'uid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.uid'), hidden: true, filterable : true },
-                       {id: 't3ver_oid', dataIndex : 't3ver_oid', width: 40, sortable: true, header : TYPO3.l10n.localize('column.oid'), hidden: true, filterable : true },
-                       {id: 'workspace_Title', dataIndex : 'workspace_Title', width: 120, sortable: true, header : TYPO3.l10n.localize('column.workspaceName'), hidden: true, filter : {type : 'string'}},
-                       TYPO3.Workspaces.Configuration.WsPath,
-                       TYPO3.Workspaces.Configuration.LivePath,
-                       TYPO3.Workspaces.Configuration.WsTitleWithIcon,
-                       TYPO3.Workspaces.Configuration.SwapButton,
-                       TYPO3.Workspaces.Configuration.TitleWithIcon,
-                       TYPO3.Workspaces.Configuration.ChangeDate,
-                       TYPO3.Workspaces.Configuration.ChangeState,
-                       TYPO3.Workspaces.Configuration.Stage,
-                       TYPO3.Workspaces.Configuration.RowButtons
-               ],
-               listeners: {
-                       columnmoved: function(colModel) {
-                               TYPO3.Workspaces.Actions.updateColModel(colModel);
-                       },
-                       hiddenchange: function(colModel) {
-                               TYPO3.Workspaces.Actions.updateColModel(colModel);
-                       }
-               }
-       }),
+       colModel : null,
        sm: TYPO3.Workspaces.SelectionModel,
        loadMask : true,
        height: 630,
index b88245b..f3d5259 100644 (file)
@@ -233,9 +233,9 @@ TYPO3.Workspaces.Toolbar.FullTopToolbar = [
 ];
 
 TYPO3.Workspaces.Toolbar.FullBottomBar = [
-       TYPO3.Workspaces.Toolbar.selectStateActionCombo,
-       '-',
-       TYPO3.Workspaces.Toolbar.selectStateMassActionCombo,
+       (TYPO3.settings.Workspaces.isLiveWorkspace == true) ? {hidden: true} : TYPO3.Workspaces.Toolbar.selectStateActionCombo,
+       (TYPO3.settings.Workspaces.isLiveWorkspace == true) ? {hidden: true} : '-',
+       (TYPO3.settings.Workspaces.isLiveWorkspace == true) ? {hidden: true} : TYPO3.Workspaces.Toolbar.selectStateMassActionCombo,
        {xtype: 'tbfill'},
        TYPO3.Workspaces.Toolbar.Pager
 ];
index f222582..668c275 100644 (file)
@@ -32,6 +32,7 @@ TYPO3.Workspaces.App = {
                TYPO3.Workspaces.MainStore.load();
                TYPO3.Workspaces.Toolbar.selectActionStore.load();
                TYPO3.Workspaces.Toolbar.selectMassActionStore.load();
+               TYPO3.Workspaces.WorkspaceGrid.initColModel();
                TYPO3.Workspaces.WorkspaceGrid.render('workspacegrid');
        }
 };