Fixed bug #12615: Dependencies in sysext 'version' and 'workspaces'
authorOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:15:49 +0000 (11:15 +0000)
committerOliver Hader <oliver.hader@typo3.org>
Thu, 17 Feb 2011 11:15:49 +0000 (11:15 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/version/trunk@4118 743128fe-103e-dd11-99c4-001b210b3e58

typo3/sysext/version/ChangeLog
typo3/sysext/version/cm1/index.php
typo3/sysext/version/ext_tables.php
typo3/sysext/version/tca.php

index 4c2d148..a4be972 100644 (file)
@@ -1,3 +1,7 @@
+2011-02-17  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Fixed bug #12615: Dependencies in sysext 'version' and 'workspaces'
+
 2011-01-26  Tolleiv Nietsch <typo3@tolleiv.de>
 
        * Reapplied #17284: Formprotection persistToken method is called too often, causing unnecessary DB-load - included in 4.5.0 (Thanks to Helmut Hummel / Ernesto Baschny)
index 7b687cb..a31e761 100755 (executable)
@@ -167,8 +167,8 @@ class tx_version_cm1 extends t3lib_SCbase {
                        $this->MOD_MENU['display'][-1] = $GLOBALS['LANG']->getLL('defaultDraft');
                }
 
-                       // Add workspaces:
-               if ($GLOBALS['BE_USER']->workspace===0) {       // Spend time on this only in online workspace because it might take time:
+                       // Add workspaces (only if the live workspace is currently active):
+               if (t3lib_extMgm::isLoaded('workspaces') && $GLOBALS['BE_USER']->workspace ===0 ) {
                        $workspaces = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('uid,title,adminusers,members,reviewers','sys_workspace','pid=0'.t3lib_BEfunc::deleteClause('sys_workspace'),'','title');
                        foreach($workspaces as $rec)    {
                                if ($GLOBALS['BE_USER']->checkWorkspace($rec))  {
index a6b1596..b2a19bb 100755 (executable)
@@ -1,5 +1,7 @@
 <?php
-if (!defined ('TYPO3_MODE'))   die ('Access denied.');
+if (!defined ('TYPO3_MODE')) {
+       die ('Access denied.');
+}
 
 if (TYPO3_MODE=='BE')  {
        $GLOBALS['TBE_MODULES_EXT']['xMOD_alt_clickmenu']['extendCMclasses'][]=array(
@@ -11,30 +13,4 @@ if (TYPO3_MODE=='BE')        {
                t3lib_extMgm::addModule('web', 'txversionM1', '', t3lib_extMgm::extPath($_EXTKEY) . 'cm1/');
        }
 }
-
-
-
-
-/**
- * Table "sys_workspace":
- */
-$TCA['sys_workspace'] = array(
-       'ctrl' => array(
-               'label' => 'title',
-               'tstamp' => 'tstamp',
-               'title' => 'LLL:EXT:lang/locallang_tca.php:sys_workspace',
-               'adminOnly' => 1,
-               'rootLevel' => 1,
-               'delete' => 'deleted',
-               'iconfile' => 'sys_workspace.png',
-               'typeicon_classes' => array(
-                       'default' => 'mimetypes-x-sys_workspace'
-               ),
-               'dynamicConfigFile' => t3lib_extMgm::extPath($_EXTKEY) . 'tca.php',
-               'versioningWS_alwaysAllowLiveEdit' => true,
-               'dividers2tabs' => true
-       )
-);
-
-
-?>
+?>
\ No newline at end of file
index 45eef65..e69de29 100644 (file)
@@ -1,227 +0,0 @@
-<?php
-/**
- * System workspaces - Defines the offline workspaces available to users in TYPO3.
- */
-$TCA['sys_workspace'] = array(
-       'ctrl' => $TCA['sys_workspace']['ctrl'],
-       'columns' => array(
-               'title' => array(
-                       'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.title',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '20',
-                               'max' => '30',
-                               'eval' => 'required,trim,unique'
-                       )
-               ),
-               'description' => array(
-                       'label' => 'LLL:EXT:lang/locallang_general.xml:LGL.description',
-                       'config' => array(
-                               'type' => 'text',
-                               'rows' => 5,
-                               'cols' => 30
-                       )
-               ),
-               'adminusers' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.adminusers',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users,be_groups',
-                               'prepend_tname' => 1,
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1',
-                               'wizards' => array(
-                                       'suggest' => array(
-                                               'type' => 'suggest',
-                                       )
-                               )
-                       )
-               ),
-               'members' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.members',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users,be_groups',
-                               'prepend_tname' => 1,
-                               'size' => '3',
-                               'maxitems' => '100',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1',
-                               'wizards' => array(
-                                       'suggest' => array(
-                                               'type' => 'suggest',
-                                       )
-                               )
-                       )
-               ),
-               'reviewers' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.reviewers',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                               'allowed' => 'be_users,be_groups',
-                               'prepend_tname' => 1,
-                               'size' => '3',
-                               'maxitems' => '100',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1',
-                               'wizards' => array(
-                                       'suggest' => array(
-                                               'type' => 'suggest',
-                                       )
-                               )
-                       )
-               ),
-               'db_mountpoints' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:db_mountpoints',
-                       'config' => array(
-                               'type' => 'group',
-                               'internal_type' => 'db',
-                                       'allowed' => 'pages',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'show_thumbs' => '1',
-                               'wizards' => array(
-                                       'suggest' => array(
-                                               'type' => 'suggest',
-                                       )
-                               )
-                       )
-               ),
-               'file_mountpoints' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:file_mountpoints',
-                       'config' => array(
-                               'type' => 'select',
-                               'foreign_table' => 'sys_filemounts',
-                               'foreign_table_where' => ' AND sys_filemounts.pid=0 ORDER BY sys_filemounts.title',
-                               'size' => '3',
-                               'maxitems' => '10',
-                               'autoSizeMax' => 10,
-                               'renderMode' => $GLOBALS['TYPO3_CONF_VARS']['BE']['accessListRenderMode'],
-                               'iconsInOptionTags' => 1,
-                       )
-               ),
-               'publish_time' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.publish_time',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '8',
-                               'max' => '20',
-                               'eval' => 'datetime',
-                               'default' => '0',
-                               'checkbox' => '0'
-                       )
-               ),
-               'unpublish_time' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.unpublish_time',
-                       'config' => array(
-                               'type' => 'input',
-                               'size' => '8',
-                               'max' => '20',
-                               'eval' => 'datetime',
-                               'checkbox' => '0',
-                               'default' => '0',
-                               'range' => array(
-                                       'upper' => mktime(0,0,0,12,31,2020),
-                               )
-                       )
-               ),
-               'freeze' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.freeze',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'live_edit' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.live_edit',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'review_stage_edit' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.review_stage_edit',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'disable_autocreate' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.disable_autocreate',
-                       'config' => array(
-                               'type' => 'check',
-                               'default' => '0'
-                       )
-               ),
-               'swap_modes' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.swap_modes',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(
-                                       array('', 0),
-                                       array('Swap-Into-Workspace on Auto-publish', 1),
-                                       array('Disable Swap-Into-Workspace', 2)
-                               ),
-                       )
-               ),
-               'publish_access' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.publish_access',
-                       'config' => array(
-                               'type' => 'check',
-                               'items' => array(
-                                       array('Publish only content in publish stage', 0),
-                                       array('Only workspace owner can publish', 0),
-                               ),
-                       )
-               ),
-               'stagechg_notification' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.stagechg_notification',
-                       'config' => array(
-                               'type' => 'select',
-                               'items' => array(
-                                       array('', 0),
-                                       array('Notify users on next stage only', 1),
-                                       array('Notify all users on any change', 10)
-                               ),
-                       )
-               ),
-       ),
-       'types' => array(
-               '0' => array('showitem' => 'title,description,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.users,adminusers,members,reviewers,stagechg_notification,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.mountpoints,db_mountpoints,file_mountpoints,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.publishing,publish_time,unpublish_time,
-                       --div--;LLL:EXT:lang/locallang_tca.xml:sys_filemounts.tabs.other,freeze,live_edit,review_stage_edit,disable_autocreate,swap_modes,publish_access'
-               )
-       )
-);
-
-// if other versioning options than element versions are active, 
-// the TCA column needs to be added as well
-if (isset($GLOBALS['TYPO3_CONF_VARS']['BE']['elementVersioningOnly'])
-       && !$GLOBALS['TYPO3_CONF_VARS']['BE']['elementVersioningOnly']) {
-       $additionalWorkspaceTcaColumn = array(
-               'vtypes' => array(
-                       'label' => 'LLL:EXT:lang/locallang_tca.xml:sys_workspace.vtypes',
-                       'config' => array(
-                               'type' => 'check',
-                               'items' => array(
-                                       array('Element', 0),
-                                       array('Page',    0),
-                                       array('Branch',  0)
-                               )
-                       )
-               )
-       );
-       t3lib_extMgm::addTCAcolumns('sys_workspace', $additionalWorkspaceTcaColumn, FALSE);
-       t3lib_extMgm::addToAllTCAtypes('sys_workspace', 'vtypes', '', 'after:swap_modes');
-}
-
-
-?>
\ No newline at end of file