Synchronized external repositories of version (tag 4.5.0beta4) and workspaces (tag...
authorBenni Mack <benni.mack@typo3.org>
Wed, 12 Jan 2011 10:44:47 +0000 (10:44 +0000)
committerBenni Mack <benni.mack@typo3.org>
Wed, 12 Jan 2011 10:44:47 +0000 (10:44 +0000)
git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@10037 709f56b5-9817-0410-a4d7-c38de5d9e867

28 files changed:
ChangeLog
typo3/sysext/version/ChangeLog
typo3/sysext/version/Resources/Private/Language/emails.xml [deleted file]
typo3/sysext/version/Resources/Private/Language/locallang_emails.xml [new file with mode: 0644]
typo3/sysext/version/class.t3lib_tcemain_commandmap.php [deleted file]
typo3/sysext/version/class.tx_version_gui.php
typo3/sysext/version/class.tx_version_tcemain.php
typo3/sysext/version/class.tx_version_tcemain_commandmap.php [new file with mode: 0644]
typo3/sysext/version/cm1/index.php
typo3/sysext/version/ext_autoload.php
typo3/sysext/version/ext_emconf.php
typo3/sysext/version/ext_localconf.php
typo3/sysext/version/last_synched_target
typo3/sysext/version/ws/index.php
typo3/sysext/workspaces/ChangeLog
typo3/sysext/workspaces/Classes/Reports/StatusProvider.php [new file with mode: 0644]
typo3/sysext/workspaces/Resources/Private/Layouts/module.html
typo3/sysext/workspaces/Resources/Private/Layouts/nodoc.html
typo3/sysext/workspaces/Resources/Private/Partials/navigation.html
typo3/sysext/workspaces/Resources/Public/Images/workspaces-comments-arrow.gif [new file with mode: 0644]
typo3/sysext/workspaces/Resources/Public/JavaScript/actions.js
typo3/sysext/workspaces/Resources/Public/JavaScript/grid.js
typo3/sysext/workspaces/Resources/Public/JavaScript/workspacemenu.js
typo3/sysext/workspaces/Resources/Public/StyleSheet/module.css
typo3/sysext/workspaces/ext_autoload.php
typo3/sysext/workspaces/ext_emconf.php
typo3/sysext/workspaces/ext_tables.php
typo3/sysext/workspaces/last_synched_target

index d550cc6..7ad9543 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-01-12  Benjamin Mack  <benjamin.mack@typo3.org>
+
+       * Synchronized external repositories of version (tag 4.5.0beta4) and workspaces (tag 4.5.0beta4)
+
 2011-01-12  Oliver Hader  <oliver.hader@typo3.org>
 
        * Cleanup: Fixed last synchronized targets of external SVN repositories
index 510944a..87d68df 100644 (file)
@@ -1,3 +1,26 @@
+2011-01-12  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Follow-up to bug #11832: Label of the anchor is empty
+       * Raised version to 4.5.0beta4
+
+2011-01-09  Tolleiv Nietsch  <typo3@tolleiv.de>
+
+       * Fixed bug #11832: Versioning - t3lib_extMgm::createListViewLink() function no longer available (Thanks to Mark Johnston)
+       * Fixed bug #16786: Generating preview link not working since Update to 4.4.5
+
+2011-01-06  Tolleiv Nietsch  <typo3@tolleiv.de>
+
+       * Fixed bug #11926: Language file Resources/Private/Language/emails.xml can not be translated (Thanks to Christopher).
+
+2011-01-01  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Fixed bug #11833: Sorting order of IRRE records is wrong after publishing
+
+2010-12-28  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Cleanup: Fixed PHPdoc comments, type hints and XCLASS blocks
+       * Cleanup: Renamed command map class file to start with proper extension prefix
+
 2010-12-22  Tolleiv Nietsch  <typo3@tolleiv.de>
 
        * Fixed bug:#11606 Remove "Send to review / pub" from contextmenu
diff --git a/typo3/sysext/version/Resources/Private/Language/emails.xml b/typo3/sysext/version/Resources/Private/Language/emails.xml
deleted file mode 100644 (file)
index f4f49ee..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<T3locallang>
-       <meta type="array">
-               <description>Module labels</description>
-               <type>module</type>
-       </meta>
-       <data type="array">
-               <languageKey index="default" type="array">
-                       <label index="subject">TYPO3 Workspace Note: Stage Change for ###ELEMENT_NAME###</label>
-                       <label index="message">At the TYPO3 site "###SITE_NAME###" (###SITE_URL###)
-in workspace "###WORKSPACE_TITLE###" (###WORKSPACE_UID###)
-the stage has changed for the element(s) "###RECORD_TITLE###" (###ELEMENT_NAME###) at location "###RECORD_PATH###" in the page tree:
-
-=> ###NEXT_STAGE###
-
-User Comment:
-"###COMMENT###"
-
-State was changed by ###USER_FULLNAME### (username: ###USER_USERNAME###)</label>
-               </languageKey>
-       </data>
-</T3locallang>
diff --git a/typo3/sysext/version/Resources/Private/Language/locallang_emails.xml b/typo3/sysext/version/Resources/Private/Language/locallang_emails.xml
new file mode 100644 (file)
index 0000000..f4f49ee
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<T3locallang>
+       <meta type="array">
+               <description>Module labels</description>
+               <type>module</type>
+       </meta>
+       <data type="array">
+               <languageKey index="default" type="array">
+                       <label index="subject">TYPO3 Workspace Note: Stage Change for ###ELEMENT_NAME###</label>
+                       <label index="message">At the TYPO3 site "###SITE_NAME###" (###SITE_URL###)
+in workspace "###WORKSPACE_TITLE###" (###WORKSPACE_UID###)
+the stage has changed for the element(s) "###RECORD_TITLE###" (###ELEMENT_NAME###) at location "###RECORD_PATH###" in the page tree:
+
+=> ###NEXT_STAGE###
+
+User Comment:
+"###COMMENT###"
+
+State was changed by ###USER_FULLNAME### (username: ###USER_USERNAME###)</label>
+               </languageKey>
+       </data>
+</T3locallang>
diff --git a/typo3/sysext/version/class.t3lib_tcemain_commandmap.php b/typo3/sysext/version/class.t3lib_tcemain_commandmap.php
deleted file mode 100644 (file)
index f972a05..0000000
+++ /dev/null
@@ -1,771 +0,0 @@
-<?php
-/***************************************************************
- * Copyright notice
- *
- * (c) 2010 Oliver Hader <oliver@typo3.org>
- * All rights reserved
- *
- * This script is part of the TYPO3 project. The TYPO3 project is
- * free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * The GNU General Public License can be found at
- * http://www.gnu.org/copyleft/gpl.html.
- * A copy is found in the textfile GPL.txt and important notices to the license
- * from the author is found in LICENSE.txt distributed with these scripts.
- *
- *
- * This script is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * This copyright notice MUST APPEAR in all copies of the script!
- ***************************************************************/
-
-/**
- * Handles the t3lib_TCEmain command map and is only used in combination with t3lib_TCEmain.
- */
-class tx_version_tcemain_CommandMap {
-       const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
-       const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
-
-       const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage';
-       const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode';
-       const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
-       const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
-       const KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
-       const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
-       const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
-       const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback';
-       const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
-       const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
-
-       /**
-        * @var tx_version_tcemain
-        */
-       protected $parent;
-
-       /**
-        * @var t3lib_TCEmain
-        */
-       protected $tceMain;
-
-       /**
-        * @var array
-        */
-       protected $commandMap = array();
-
-       /**
-        * @var string
-        */
-       protected $workspacesSwapMode;
-
-       /**
-        * @var string
-        */
-       protected $workspacesChangeStageMode;
-
-       /**
-        * @var boolean
-        */
-       protected $workspacesConsiderReferences;
-
-       /**
-        * @var array
-        */
-       protected $scopes;
-
-       /**
-        * Creates this object.
-        *
-        * @param t3lib_TCEmain $parent
-        * @param array $commandMap
-        */
-       public function __construct(tx_version_tcemain $parent, t3lib_TCEmain $tceMain, array $commandMap) {
-               $this->setParent($parent);
-               $this->setTceMain($tceMain);
-               $this->set($commandMap);
-
-               $this->setWorkspacesSwapMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.swapMode'));
-               $this->setWorkspacesChangeStageMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.changeStageMode'));
-               $this->setWorkspacesConsiderReferences($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.considerReferences'));
-
-               $this->constructScopes();
-       }
-
-       /**
-        * Gets the command map.
-        *
-        * @return array
-        */
-       public function get() {
-               return $this->commandMap;
-       }
-
-       /**
-        * Sets the command map.
-        *
-        * @param array $commandMap
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function set(array $commandMap) {
-               $this->commandMap = $commandMap;
-               return $this;
-       }
-
-       /**
-        * Gets the parent object.
-        *
-        * @return tx_version_tcemain
-        */
-       public function getParent() {
-               return $this->parent;
-       }
-
-       /**
-        * Sets the parent object.
-        *
-        * @param tx_version_tcemain $parent
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function setParent(tx_version_tcemain $parent) {
-               $this->parent = $parent;
-               return $this;
-       }
-
-       /**
-        * Gets the parent object.
-        *
-        * @return t3lib_TCEmain
-        */
-       public function getTceMain() {
-               return $this->tceMain;
-       }
-
-       /**
-        * Sets the parent object.
-        *
-        * @param t3lib_TCEmain $parent
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function setTceMain(t3lib_TCEmain $tceMain) {
-               $this->tceMain = $tceMain;
-               return $this;
-       }
-
-       /**
-        * Sets the workspaces swap mode
-        * (see options.workspaces.swapMode).
-        *
-        * @param string $workspacesSwapMode
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function setWorkspacesSwapMode($workspacesSwapMode) {
-               $this->workspacesSwapMode = (string)$workspacesSwapMode;
-               return $this;
-       }
-
-       /**
-        * Sets the workspaces change stage mode
-        * see options.workspaces.changeStageMode)
-        *
-        * @param string $workspacesChangeStageMode
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function setWorkspacesChangeStageMode($workspacesChangeStageMode) {
-               $this->workspacesChangeStageMode = (string)$workspacesChangeStageMode;
-               return $this;
-       }
-
-       /**
-        * Sets the workspace behaviour to automatically consider references
-        * (see options.workspaces.considerReferences)
-        *
-        * @param boolean $workspacesConsiderReferences
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function setWorkspacesConsiderReferences($workspacesConsiderReferences) {
-               $this->workspacesConsiderReferences = (bool)$workspacesConsiderReferences;
-               return $this;
-       }
-
-       /**
-        * Processes the command map.
-        *
-        * @return tx_version_tcemain_CommandMap
-        */
-       public function process() {
-               $this->resolveWorkspacesSwapDependencies();
-               $this->resolveWorkspacesSetStageDependencies();
-               return $this;
-       }
-
-       /**
-        * Resolves workspaces related dependencies for swapping/publishing of the command map.
-        * Workspaces records that have children or (relative) parents which are versionized
-        * but not published with this request, are removed from the command map. Otherwise
-        * this would produce hanging record sets and lost references.
-        *
-        * @return void
-        */
-       protected function resolveWorkspacesSwapDependencies() {
-               $scope = self::SCOPE_WorkspacesSwap;
-               $dependency = $this->getDependencyUtility($scope);
-
-               foreach ($this->commandMap as $table => $liveIdCollection) {
-                       foreach ($liveIdCollection as $liveId => $commandCollection) {
-                               foreach ($commandCollection as $command => $properties) {
-                                       if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
-                                               if (isset($properties['swapWith']) && t3lib_div::testInt($properties['swapWith'])) {
-                                                       $this->addWorkspacesSwapElements($dependency, $table, $liveId, $properties);
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               $this->applyWorkspacesDependencies($dependency, $scope);
-       }
-
-       /**
-        * Adds workspaces elements for swapping/publishing and takes care of the swapMode.
-        *
-        * @param t3lib_utility_Dependency $dependency
-        * @param string $table
-        * @param iteger $liveId
-        * @param array $properties
-        * @return void
-        */
-       protected function addWorkspacesSwapElements(t3lib_utility_Dependency $dependency, $table, $liveId, array $properties) {
-               $elementList = array();
-
-               // Fetch accordant elements if the swapMode is 'any' or 'pages':
-               if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
-                       $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
-               }
-
-               foreach ($elementList as $elementTable => $elementIdArray) {
-                       foreach ($elementIdArray as $elementIds) {
-                               $dependency->addElement(
-                                       $elementTable, $elementIds[1],
-                                       array('liveId' => $elementIds[0], 'properties' => array_merge($properties, array('swapWith' => $elementIds[1])))
-                               );
-                       }
-               }
-
-               if (count($elementList) === 0) {
-                       $dependency->addElement(
-                               $table, $properties['swapWith'], array('liveId' => $liveId, 'properties' => $properties)
-                       );
-               }
-       }
-
-       /**
-        * Resolves workspaces related dependencies for staging of the command map.
-        * Workspaces records that have children or (relative) parents which are versionized
-        * but not staged with this request, are removed from the command map.
-        *
-        * @return void
-        */
-       protected function resolveWorkspacesSetStageDependencies() {
-               $scope = self::SCOPE_WorkspacesSetStage;
-               $dependency = $this->getDependencyUtility($scope);
-
-               foreach ($this->commandMap as $table => $liveIdCollection) {
-                       foreach ($liveIdCollection as $liveIdList => $commandCollection) {
-                               foreach ($commandCollection as $command => $properties) {
-                                       if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
-                                               if (isset($properties['stageId']) && t3lib_div::testInt($properties['stageId'])) {
-                                                       $this->addWorkspacesSetStageElements($dependency, $table, $liveIdList, $properties);
-                                                       $this->explodeSetStage($table, $liveIdList, $properties);
-                                               }
-                                       }
-                               }
-                       }
-               }
-
-               $this->applyWorkspacesDependencies($dependency, $scope);
-       }
-
-       /**
-        * Adds workspaces elements for staging and takes care of the changeStageMode.
-        *
-        * @param t3lib_utility_Dependency $dependency
-        * @param string $table
-        * @param string $liveIdList
-        * @param array $properties
-        * @return void
-        */
-       protected function addWorkspacesSetStageElements(t3lib_utility_Dependency $dependency, $table, $liveIdList, array $properties) {
-               $liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
-               $elementList = array($table => $liveIds);
-
-               if (t3lib_div::inList('any,pages', $this->workspacesChangeStageMode)) {
-                       if (count($liveIds) === 1) {
-                               $workspaceRecord = t3lib_BEfunc::getRecord($table, $liveIds[0], 't3ver_wsid');
-                               $workspaceId = $workspaceRecord['t3ver_wsid'];
-                       } else {
-                               $workspaceId = $this->tceMain()->BE_USER->workspace;
-                       }
-
-                       if ($table === 'pages') {
-                               // Find all elements from the same ws to change stage
-                               $this->getParent()->findRealPageIds($liveIds);
-                               $this->getParent()->findPageElementsForVersionStageChange($liveIds, $workspaceId, $elementList);
-                       } elseif ($this->workspacesChangeStageMode === 'any') {
-                               // Find page to change stage:
-                               $pageIdList = array();
-                               $this->getParent()->findPageIdsForVersionStateChange($table, $liveIds, $workspaceId, $pageIdList, $elementList);
-                               // Find other elements from the same ws to change stage:
-                               $this->getParent()->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
-                       }
-               }
-
-               foreach ($elementList as $elementTable => $elementIds) {
-                       foreach($elementIds as $elementId) {
-                               $dependency->addElement(
-                                       $elementTable, $elementId,
-                                       array('properties' => $properties)
-                               );
-                       }
-               }
-       }
-
-       /**
-        * Explodes id-lists in the command map for staging actions.
-        *
-        * @throws RuntimeException
-        * @param string $table
-        * @param string $liveIdList
-        * @param array $properties
-        * @return void
-        */
-       protected function explodeSetStage($table, $liveIdList, array $properties) {
-               $extractedCommandMap = array();
-               $liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
-
-               if (count($liveIds) > 1) {
-                       foreach ($liveIds as $liveId) {
-                               if (isset($this->commandMap[$table][$liveId]['version'])) {
-                                       throw new RuntimeException('Command map for [' . $table . '][' . $liveId . '][version] was already set.', 1289391048);
-                               }
-
-                               $extractedCommandMap[$table][$liveId]['version'] = $properties;
-                       }
-
-                       $this->remove($table, $liveIdList, 'version');
-                       $this->mergeToBottom($extractedCommandMap);
-               }
-       }
-
-       /**
-        * Applies the workspaces dependencies and removes incomplete structures or automatically
-        * completes them, depending on the options.workspaces.considerReferences setting
-        *
-        * @param t3lib_utility_Dependency $dependency
-        * @param string $scope
-        * @return void
-        */
-       protected function applyWorkspacesDependencies(t3lib_utility_Dependency $dependency, $scope) {
-               $transformDependentElementsToUseLiveId = $this->getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
-
-               $elementsToBeVersionized = $dependency->getElements();
-               if ($transformDependentElementsToUseLiveId) {
-                       $elementsToBeVersionized = $this->transformDependentElementsToUseLiveId($elementsToBeVersionized);
-               }
-
-               $outerMostParents = $dependency->getOuterMostParents();
-               /** @var $outerMostParent t3lib_utility_Dependency_Element */
-               foreach ($outerMostParents as $outerMostParent) {
-                       $dependentElements = $dependency->getNestedElements($outerMostParent);
-                       if ($transformDependentElementsToUseLiveId) {
-                               $dependentElements = $this->transformDependentElementsToUseLiveId($dependentElements);
-                       }
-
-                       $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersionized);
-
-                       if (count($intersectingElements) > 0) {
-                               // If at least one element intersects but not all, throw away all elements of the depdendent structure:
-                               if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === FALSE) {
-                                       $this->purgeWithErrorMessage($intersectingElements, $scope);
-                               // If everything is fine or references shall be considered automatically:
-                               } else {
-                                       $this->update(current($intersectingElements), $dependentElements, $scope);
-                               }
-                       }
-               }
-       }
-
-       /**
-        * Purges incomplete structures from the command map and triggers an error message.
-        *
-        * @param array $elements
-        * @param string $scope
-        * @return void
-        */
-       protected function purgeWithErrorMessage(array $elements, $scope) {
-               /** @var $dependentElement t3lib_utility_Dependency_Element */
-               foreach ($elements as $element) {
-                       $table = $element->getTable();
-                       $id = $this->processCallback(
-                               $this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback),
-                               array($element)
-                       );
-
-                       $this->remove($table, $id, 'version');
-                       $this->getTceMain()->log(
-                               $table, $id,
-                               5, 0, 1,
-                               $this->getScopeData($scope, self::KEY_ScopeErrorMessage),
-                               $this->getScopeData($scope, self::KEY_ScopeErrorCode),
-                               array(
-                                       t3lib_BEfunc::getRecordTitle($table, t3lib_BEfunc::getRecord($table, $id)),
-                                       $table, $id
-                               )
-                       );
-               }
-       }
-
-       /**
-        * Updates the command map accordant to valid structures and takes care of the correct order.
-        *
-        * @param t3lib_utility_Dependency_Element $intersectingElement
-        * @param array $elements
-        * @param string $scope
-        * @return void
-        */
-       protected function update(t3lib_utility_Dependency_Element $intersectingElement, array $elements, $scope) {
-               $orderedCommandMap = array();
-
-               $commonProperties = $this->processCallback(
-                       $this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback),
-                       array($intersectingElement)
-               );
-
-               /** @var $dependentElement t3lib_utility_Dependency_Element */
-               foreach ($elements as $element) {
-                       $table = $element->getTable();
-                       $id = $this->processCallback(
-                               $this->getScopeData($scope, self::KEY_UpdateGetIdCallback),
-                               array($element)
-                       );
-
-                       $this->remove($table, $id, 'version');
-                       $orderedCommandMap[$table][$id]['version'] = array_merge(
-                               $commonProperties,
-                               $this->processCallback(
-                                       $this->getScopeData($scope, self::KEY_GetElementPropertiesCallback),
-                                       array($element)
-                               )
-                       );
-               }
-
-               // Ensure that ordered command map is on top of the command map:
-               $this->mergeToTop($orderedCommandMap);
-       }
-
-       /**
-        * Merges command map elements to the top of the current command map..
-        *
-        * @param array $commandMap
-        * @return void
-        */
-       protected function mergeToTop(array $commandMap) {
-               $this->commandMap = t3lib_div::array_merge_recursive_overrule($commandMap, $this->commandMap);
-       }
-
-       /**
-        * Merges command map elements to the bottom of the current command map.
-        *
-        * @param array $commandMap
-        * @return void
-        */
-       protected function mergeToBottom(array $commandMap) {
-               $this->commandMap = t3lib_div::array_merge_recursive_overrule($this->commandMap, $commandMap);
-       }
-
-       /**
-        * Removes an element from the command map.
-        *
-        * @param string $table
-        * @param string $id
-        * @param string $command (optional)
-        * @return void
-        */
-       protected function remove($table, $id, $command = NULL) {
-               if (is_string($command)) {
-                       unset($this->commandMap[$table][$id][$command]);
-               } else {
-                       unset($this->commandMap[$table][$id]);
-               }
-       }
-
-       /**
-        * Callback to get the liveId of an dependent element.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return integer
-        */
-       protected function getElementLiveIdCallback(t3lib_utility_Dependency_Element $element) {
-               return $element->getDataValue('liveId');
-       }
-
-       /**
-        * Callback to get the real id of an dependent element.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return integer
-        */
-       protected function getElementIdCallback(t3lib_utility_Dependency_Element $element) {
-               return $element->getId();
-       }
-
-       /**
-        * Callback to get the specific properties of a dependent element for swapping/publishing.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return array
-        */
-       protected function getElementSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
-               return array(
-                       'swapWith' => $element->getId(),
-               );
-       }
-
-       /**
-        * Callback to get common properties of dependent elements for swapping/publishing.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return array
-        */
-       protected function getCommonSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
-               $commonSwapProperties = array();
-
-               $elementProperties = $element->getDataValue('properties');
-               if (isset($elementProperties['action'])) {
-                       $commonSwapProperties['action'] = $elementProperties['action'];
-               }
-               if (isset($elementProperties['swapIntoWS'])) {
-                       $commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
-               }
-
-               return $commonSwapProperties;
-       }
-
-       /**
-        * Callback to get the specific properties of a dependent element for staging.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return array
-        */
-       protected function getElementSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
-               return $this->getCommonSetStagePropertiesCallback($element);
-       }
-
-       /**
-        * Callback to get common properties of dependent elements for staging.
-        *
-        * @param t3lib_utility_Dependency_Element $element
-        * @return array
-        */
-       protected function getCommonSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
-               $commonSetStageProperties = array();
-
-               $elementProperties = $element->getDataValue('properties');
-               if (isset($elementProperties['stageId'])) {
-                       $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
-               }
-               if (isset($elementProperties['comment'])) {
-                       $commonSetStageProperties['comment'] = $elementProperties['comment'];
-               }
-
-               return $commonSetStageProperties;
-       }
-
-
-       /**
-        * Gets an instance of the depency resolver utility.
-        *
-        * @return t3lib_utility_Dependency
-        */
-       protected function getDependencyUtility($scope) {
-
-               /** @var $dependency t3lib_utility_Dependency */
-               $dependency = t3lib_div::makeInstance('t3lib_utility_Dependency');
-               $dependency->setOuterMostParentsRequireReferences(TRUE);
-
-               if ($this->getScopeData($scope, self::KEY_ElementConstructCallback)) {
-                       $dependency->setEventCallback(
-                               t3lib_utility_Dependency_Element::EVENT_Construct,
-                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementConstructCallback))
-                       );
-               }
-               if ($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
-                       $dependency->setEventCallback(
-                               t3lib_utility_Dependency_Element::EVENT_CreateChildReference,
-                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback))
-                       );
-               }
-               if ($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
-                       $dependency->setEventCallback(
-                               t3lib_utility_Dependency_Element::EVENT_CreateParentReference,
-                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback))
-                       );
-               }
-
-               return $dependency;
-       }
-
-       /**
-        * Callback to determine whether a new child reference shall be considered in the dependency resolver utility.
-        *
-        * @param array $callerArguments
-        * @param array $targetArgument
-        * @param t3lib_utility_Dependency_Element $caller
-        * @param string $eventName
-        * @return string Skip response (if required)
-        */
-       public function createNewDependentElementChildReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
-               /** @var $reference t3lib_utility_Dependency_Reference */
-               $reference = $callerArguments['reference'];
-
-               $fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($caller->getTable(), $reference->getField());
-
-               if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getTceMain()->getInlineFieldType($fieldCOnfiguration))) {
-                       return t3lib_utility_Dependency_Element::RESPONSE_Skip;
-               }
-       }
-
-       /**
-        * Callback to determine whether a new parent reference shall be considered in the dependency resolver utility.
-        *
-        * @param array $callerArguments
-        * @param array $targetArgument
-        * @param t3lib_utility_Dependency_Element $caller
-        * @param string $eventName
-        * @return string Skip response (if required)
-        */
-       public function createNewDependentElementParentReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
-               /** @var $reference t3lib_utility_Dependency_Reference */
-               $reference = $callerArguments['reference'];
-
-               $fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($reference->getElement()->getTable(), $reference->getField());
-
-               if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getTceMain()->getInlineFieldType($fieldCOnfiguration))) {
-                       return t3lib_utility_Dependency_Element::RESPONSE_Skip;
-               }
-       }
-
-       /**
-        * Callback to add additional data to new elements created in the dependency resolver utility.
-        *
-        * @param t3lib_utility_Dependency_Element $caller
-        * @param array $callerArguments
-        * @param array $targetArgument
-        * @return void
-        */
-       public function createNewDependentElementCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller) {
-               if ($caller->hasDataValue('liveId') === FALSE) {
-                       $liveId = t3lib_BEfunc::getLiveVersionIdOfRecord($caller->getTable(), $caller->getId());
-                       if (is_null($liveId) === FALSE) {
-                               $caller->setDataValue('liveId', $liveId);
-                       }
-               }
-       }
-
-       /**
-        * Transforms dependent elements to use the liveId as array key.
-        *
-        * @param array $elements Depedent elements, each of type t3lib_utility_Dependency_Element
-        * @return array
-        */
-       protected function transformDependentElementsToUseLiveId(array $elements) {
-               $transformedElements = array();
-
-               /** @var $element t3lib_utility_Dependency_Element */
-               foreach ($elements as $element) {
-                       $elementName = t3lib_utility_Dependency_Element::getIdentifier(
-                               $element->getTable(), $element->getDataValue('liveId')
-                       );
-                       $transformedElements[$elementName] = $element;
-               }
-
-               return $transformedElements;
-       }
-
-       /**
-        * Constructs the scope settings.
-        * Currently the scopes for swapping/publishing and staging are available.
-        *
-        * @return void
-        */
-       protected function constructScopes() {
-               $this->scopes = array(
-                       self::SCOPE_WorkspacesSwap => array(
-                               self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.',
-                               self::KEY_ScopeErrorCode => 1288283630,
-                               self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
-                               self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
-                               self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
-                               self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
-                               self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
-                               self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback',
-                               self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
-                               self::KEY_TransformDependentElementsToUseLiveId => TRUE,
-                       ),
-                       self::SCOPE_WorkspacesSetStage => array(
-                               self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.',
-                               self::KEY_ScopeErrorCode => 1289342524,
-                               self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
-                               self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
-                               self::KEY_ElementConstructCallback => NULL,
-                               self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
-                               self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
-                               self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
-                               self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
-                               self::KEY_TransformDependentElementsToUseLiveId => FALSE,
-                       ),
-               );
-       }
-
-       /**
-        * Gets data for a particular scope.
-        *
-        * @throws RuntimeException
-        * @param string $scope
-        * @param string $key
-        * @return string
-        */
-       protected function getScopeData($scope, $key) {
-               if (!isset($this->scopes[$scope])) {
-                       throw new RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
-               }
-
-               return $this->scopes[$scope][$key];
-       }
-
-       /**
-        * Gets a new callback to be used in the dependency resolver utility.
-        *
-        * @param string $callbackMethod
-        * @param array $targetArguments
-        * @return t3lib_utility_Dependency_Callback
-        */
-       protected function getDependencyCallback($method, array $targetArguments = array()) {
-               return t3lib_div::makeInstance('t3lib_utility_Dependency_Callback', $this, $method, $targetArguments);
-       }
-
-       /**
-        * Processes a local callback inside this object.
-        *
-        * @param string $method
-        * @param array $callbackArguments
-        * @return mixed
-        */
-       protected function processCallback($method, array $callbackArguments) {
-               return call_user_func_array(array($this, $method), $callbackArguments);
-       }
-}
index ab2e8f4..6043658 100644 (file)
@@ -224,4 +224,7 @@ class tx_version_gui {
 
 }
 
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_gui.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_gui.php']);
+}
 ?>
\ No newline at end of file
index 9e1ca89..83c04c3 100644 (file)
  */
 class tx_version_tcemain {
 
-               // For accumulating information about workspace stages raised
-               // on elements so a single mail is sent as notification.
-               // previously called "accumulateForNotifEmail" in tcemain
+       /**
+        * For accumulating information about workspace stages raised
+        * on elements so a single mail is sent as notification.
+        * previously called "accumulateForNotifEmail" in tcemain
+        *
+        * @var array
+        */
        protected $notificationEmailInfo = array();
 
-               // general comment, eg. for staging in workspaces.
+       /**
+        * General comment, eg. for staging in workspaces
+        *
+        * @var string
+        */
        protected $generalComment = '';
 
+       /**
+        * Contains remapped IDs.
+        *
+        * @var array
+        */
+       protected $remappedIds = array();
 
        /****************************
         *****  Cmdmap  Hooks  ******
@@ -64,16 +78,16 @@ class tx_version_tcemain {
        /**
         * hook that is called when no prepared command was found
         * 
-        * @param       $command        the command to be executed
-        * @param       $table  the table of the record
-        * @param       $id     the ID of the record
-        * @param       $value  the value containing the data
-        * @param       $commandIsProcessed     can be set so that other hooks or
+        * @param string $command the command to be executed
+        * @param string $table the table of the record
+        * @param integer $id the ID of the record
+        * @param mixed $value the value containing the data
+        * @param boolean $commandIsProcessed can be set so that other hooks or
         *                              TCEmain knows that the default cmd doesn't have to be called
-        * @param       $tcemainObj     reference to the main tcemain object
+        * @param t3lib_TCEmain $tcemainObj reference to the main tcemain object
         * @return      void
         */
-       public function processCmdmap($command, $table, $id, $value, &$commandIsProcessed, &$tcemainObj) {
+       public function processCmdmap($command, $table, $id, $value, &$commandIsProcessed, t3lib_TCEmain $tcemainObj) {
 
                        // custom command "version"
                if ($command == 'version') {
@@ -125,10 +139,11 @@ class tx_version_tcemain {
        /**
         * hook that is called AFTER all commands of the commandmap was 
         * executed
-        * @param       $tcemainObj     reference to the main tcemain object
+        *
+        * @param t3lib_TCEmain $tcemainObj reference to the main tcemain object
         * @return      void
         */
-       public function processCmdmap_afterFinish(&$tcemainObj) {
+       public function processCmdmap_afterFinish(t3lib_TCEmain $tcemainObj) {
                        // Empty accumulation array:
                foreach ($this->notificationEmailInfo as $notifItem) {
                        $this->notifyStageChange($notifItem['shared'][0], $notifItem['shared'][1], implode(', ', $notifItem['elements']), 0, $notifItem['shared'][2], $tcemainObj, $notifItem['alternativeRecipients']);
@@ -136,16 +151,24 @@ class tx_version_tcemain {
 
                        // Reset notification array
                $this->notificationEmailInfo = array();
+                       // Reset remapped IDs
+               $this->remappedIds = array();
        }
 
 
        /**
         * hook that is called AFTER all commands of the commandmap was 
         * executed
-        * @param       $tcemainObj     reference to the main tcemain object
+        *
+        * @param string $table the table of the record
+        * @param integer $id the ID of the record
+        * @param array $record The accordant database record
+        * @param boolean $recordWasDeleted can be set so that other hooks or
+        *                              TCEmain knows that the default delete action doesn't have to be called
+        * @param t3lib_TCEmain $tcemainObj reference to the main tcemain object
         * @return      void
         */
-       public function processCmdmap_deleteAction($table, $id, $record, &$recordWasDeleted, &$tcemainObj) {
+       public function processCmdmap_deleteAction($table, $id, array $record, &$recordWasDeleted, t3lib_TCEmain $tcemainObj) {
                        // only process the hook if it wasn't processed 
                        // by someone else before
                if (!$recordWasDeleted) {
@@ -210,9 +233,21 @@ class tx_version_tcemain {
        /**
         * hook for t3lib_TCEmain::moveRecord that cares about moving records that
         * are *not* in the live workspace
+        *
+        * @param string $table the table of the record
+        * @param integer $id the ID of the record
+        * @param integer $destPid Position to move to: $destPid: >=0 then it points to
+        *                              a page-id on which to insert the record (as the first element).
+        *                              <0 then it points to a uid from its own table after which to insert it
+        * @param array $propArr Record properties, like header and pid (includes workspace overlay)
+        * @param array $moveRec Record properties, like header and pid (without workspace overlay)
+        * @param integer $resolvedPid The final page ID of the record
+        *                              (workspaces and negative values are resolved)
+        * @param boolean $recordWasMoved can be set so that other hooks or
+        *                              TCEmain knows that the default move action doesn't have to be called
         * @param       $table  the table
         */
-       public function moveRecord($table, $uid, $destPid, $propArr, $moveRec, $resolvedPid, &$recordWasMoved, &$tcemainObj) {
+       public function moveRecord($table, $uid, $destPid, array $propArr, array $moveRec, $resolvedPid, &$recordWasMoved, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                        // Only do something in Draft workspace
@@ -282,16 +317,16 @@ class tx_version_tcemain {
        /**
         * Send an email notification to users in workspace
         *
-        * @param       array           Workspace access array (from t3lib_userauthgroup::checkWorkspace())
-        * @param       integer         New Stage number: 0 = editing, 1= just ready for review, 10 = ready for publication, -1 = rejected!
-        * @param       string          Table name of element (or list of element names if $id is zero)
-        * @param       integer         Record uid of element (if zero, then $table is used as reference to element(s) alone)
-        * @param       string          User comment sent along with action
-        * @param       object          TCEmain object
-        * @param       string          comma separated list of recipients to notificate instead of be_users selected by sys_workspace, list is generated by workspace extension module
-        * @return      void
+        * @param array $stat Workspace access array (from t3lib_userauthgroup::checkWorkspace())
+        * @param integer $stageId New Stage number: 0 = editing, 1= just ready for review, 10 = ready for publication, -1 = rejected!
+        * @param string $table Table name of element (or list of element names if $id is zero)
+        * @param integer $id Record uid of element (if zero, then $table is used as reference to element(s) alone)
+        * @param string $comment User comment sent along with action
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @param string $notificationAlternativeRecipients Comma separated list of recipients to notificate instead of be_users selected by sys_workspace, list is generated by workspace extension module
+        * @return void
         */
-       protected function notifyStageChange($stat, $stageId, $table, $id, $comment, $tcemainObj, $notificationAlternativeRecipients = FALSE) {
+       protected function notifyStageChange(array $stat, $stageId, $table, $id, $comment, t3lib_TCEmain $tcemainObj, $notificationAlternativeRecipients = FALSE) {
                $workspaceRec = t3lib_BEfunc::getRecord('sys_workspace', $stat['uid']);
                        // So, if $id is not set, then $table is taken to be the complete element name!
                $elementName = $id ? $table . ':' . $id : $table;
@@ -539,8 +574,8 @@ class tx_version_tcemain {
         * Return be_users that should be notified on stage change from input list.
         * previously called notifyStageChange_getEmails() in tcemain
         *
-        * @param       string          List of backend users, on the form "be_users_10,be_users_2" or "10,2" in case noTablePrefix is set.
-        * @param       boolean         If set, the input list are integers and not strings.
+        * @param       string          $listOfUsers List of backend users, on the form "be_users_10,be_users_2" or "10,2" in case noTablePrefix is set.
+        * @param       boolean         $noTablePrefix If set, the input list are integers and not strings.
         * @return      array           Array of emails
         */
        protected function getEmailsForStageChangeNotification($listOfUsers, $noTablePrefix = FALSE) {
@@ -571,16 +606,16 @@ class tx_version_tcemain {
        /**
         * Setting stage of record
         *
-        * @param       string          Table name
-        * @param       integer         Record UID
-        * @param       integer         Stage ID to set
-        * @param       string          Comment that goes into log
-        * @param       boolean         Accumulate state changes in memory for compiled notification email?
-        * @param       object          TCEmain object
-        * @param       string          comma separated list of recipients to notificate instead of normal be_users
-        * @return      void
+        * @param string $table Table name
+        * @param integer $integer Record UID
+        * @param integer $stageId Stage ID to set
+        * @param string $comment Comment that goes into log
+        * @param boolean $notificationEmailInfo Accumulate state changes in memory for compiled notification email?
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @param string $notificationAlternativeRecipients comma separated list of recipients to notificate instead of normal be_users
+        * @return void
         */
-       protected function version_setStage($table, $id, $stageId, $comment = '', $notificationEmailInfo = FALSE, $tcemainObj, $notificationAlternativeRecipients = FALSE) {
+       protected function version_setStage($table, $id, $stageId, $comment = '', $notificationEmailInfo = FALSE, t3lib_TCEmain $tcemainObj, $notificationAlternativeRecipients = FALSE) {
                if ($errorCode = $tcemainObj->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
                        $tcemainObj->newlog('Attempt to set stage for record failed: ' . $errorCode, 1);
                } elseif ($tcemainObj->checkRecordUpdateAccess($table, $id)) {
@@ -621,13 +656,14 @@ class tx_version_tcemain {
        /**
         * Creates a new version of a page including content and possible subpages.
         *
-        * @param       integer         Page uid to create new version of.
-        * @param       string          Version label
-        * @param       integer         Indicating "treeLevel" - "page" (0) or "branch" (>=1) ["element" type must call versionizeRecord() directly]
-        * @return      void
+        * @param integer $uid Page uid to create new version of.
+        * @param string $label Version label
+        * @param integer $versionizeTree Indicating "treeLevel" - "page" (0) or "branch" (>=1) ["element" type must call versionizeRecord() directly]
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @return void
         * @see copyPages()
         */
-       protected function versionizePages($uid, $label, $versionizeTree, &$tcemainObj) {
+       protected function versionizePages($uid, $label, $versionizeTree, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                $uid = intval($uid);
@@ -685,13 +721,14 @@ class tx_version_tcemain {
         * Swapping versions of a record
         * Version from archive (future/past, called "swap version") will get the uid of the "t3ver_oid", the official element with uid = "t3ver_oid" will get the new versions old uid. PIDs are swapped also
         *
-        * @param       string          Table name
-        * @param       integer         UID of the online record to swap
-        * @param       integer         UID of the archived version to swap with!
-        * @param       boolean         If set, swaps online into workspace instead of publishing out of workspace.
-        * @return      void
+        * @param string $table Table name
+        * @param integer $id UID of the online record to swap
+        * @param integer $swapWith UID of the archived version to swap with!
+        * @param boolean $swapIntoWS If set, swaps online into workspace instead of publishing out of workspace.
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @return void
         */
-       protected function version_swap($table, $id, $swapWith, $swapIntoWS=0, &$tcemainObj) {
+       protected function version_swap($table, $id, $swapWith, $swapIntoWS=0, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                        // First, check if we may actually edit the online record
@@ -843,6 +880,9 @@ class tx_version_tcemain {
                                                                                }
 
                                                                                if (!count($sqlErrors)) {
+                                                                                               // Register swapped ids for later remapping:
+                                                                                       $this->remappedIds[$table][$id] =$swapWith;
+                                                                                       $this->remappedIds[$table][$swapWith] = $id;
 
                                                                                                // If a moving operation took place...:
                                                                                        if ($movePlhID) {
@@ -945,14 +985,15 @@ class tx_version_tcemain {
        /**
         * Update relations on version/workspace swapping.
         *
-        * @param       string          $table: Record Table
-        * @param       string          $field: Record field
-        * @param       array           $conf: TCA configuration of current field
-        * @param       string          $curVersion: Reference to the current (original) record
-        * @param       string          $swapVersion: Reference to the record (workspace/versionized) to publish in or swap with
-        * @return      void
+        * @param string $table: Record Table
+        * @param string $field: Record field
+        * @param array $conf: TCA configuration of current field
+        * @param array $curVersion: Reference to the current (original) record
+        * @param array $swapVersion: Reference to the record (workspace/versionized) to publish in or swap with
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @return  void
         */
-       protected function version_swap_procBasedOnFieldType($table, $field, $conf, &$curVersion, &$swapVersion, $tcemainObj) {
+       protected function version_swap_procBasedOnFieldType($table, $field, array $conf, array &$curVersion, array &$swapVersion, t3lib_TCEmain $tcemainObj) {
                $inlineType = $tcemainObj->getInlineFieldType($conf);
 
                        // Process pointer fields on normalized database:
@@ -968,8 +1009,24 @@ class tx_version_tcemain {
                        $dbAnalysisSwap->setUpdateReferenceIndex(FALSE);
                        $dbAnalysisSwap->start('', $conf['foreign_table'], '', $swapVersion['uid'], $table, $conf);
                                // Update relations for both (workspace/versioning) sites:
-                       $dbAnalysisCur->writeForeignField($conf, $curVersion['uid'], $swapVersion['uid']);
-                       $dbAnalysisSwap->writeForeignField($conf, $swapVersion['uid'], $curVersion['uid']);
+
+                       if (count($dbAnalysisCur->itemArray)) {
+                               $dbAnalysisCur->writeForeignField($conf, $curVersion['uid'], $swapVersion['uid']);
+                               $tcemainObj->addRemapAction(
+                                       $table, $curVersion['uid'],
+                                       array($this, 'writeRemappedForeignField'),
+                                       array($dbAnalysisCur, $conf, $swapVersion['uid'])
+                               );
+                       }
+
+                       if (count($dbAnalysisSwap->itemArray)) {
+                               $dbAnalysisSwap->writeForeignField($conf, $swapVersion['uid'], $curVersion['uid']);
+                               $tcemainObj->addRemapAction(
+                                       $table, $curVersion['uid'],
+                                       array($this, 'writeRemappedForeignField'),
+                                       array($dbAnalysisSwap, $conf, $curVersion['uid'])
+                               );
+                       }
 
                        $items = array_merge($dbAnalysisCur->itemArray, $dbAnalysisSwap->itemArray);
                        foreach ($items as $item) {
@@ -985,17 +1042,36 @@ class tx_version_tcemain {
                }
        }
 
+       /**
+        * Writes remapped foreign field (IRRE).
+        *
+        * @param t3lib_loadDBGroup $dbAnalysis Instance that holds the sorting order of child records
+        * @param array $configuration The TCA field configuration
+        * @param integer $parentId The uid of the parent record
+        * @return void
+        */
+       public function writeRemappedForeignField(t3lib_loadDBGroup $dbAnalysis, array $configuration, $parentId) {
+               foreach ($dbAnalysis->itemArray as &$item) {
+                       if (isset($this->remappedIds[$item['table']][$item['id']])) {
+                               $item['id'] = $this->remappedIds[$item['table']][$item['id']];
+                       }
+               }
+
+               $dbAnalysis->writeForeignField($configuration, $parentId);
+       }
+
 
 
        /**
         * Release version from this workspace (and into "Live" workspace but as an offline version).
         *
-        * @param       string          Table name
-        * @param       integer         Record UID
-        * @param       boolean         If set, will completely delete element
+        * @param string $table Table name
+        * @param integer $id Record UID
+        * @param boolean $flush If set, will completely delete element
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
         * @return      void
         */
-       protected function version_clearWSID($table, $id, $flush = FALSE, &$tcemainObj) {
+       protected function version_clearWSID($table, $id, $flush = FALSE, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                if ($errorCode = $tcemainObj->BE_USER->workspaceCannotEditOfflineVersion($table, $id)) {
@@ -1042,13 +1118,14 @@ class tx_version_tcemain {
         * Copies all records from tables in $copyTablesArray from page with $old_pid to page with $new_pid
         * Uses raw-copy for the operation (meant for versioning!)
         *
-        * @param       integer         Current page id.
-        * @param       integer         New page id
-        * @param       array           Array of tables from which to copy
-        * @return      void
+        * @param integer $oldPageId Current page id.
+        * @param integer $newPageId New page id
+        * @param array $copyTablesArray Array of tables from which to copy
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @return void
         * @see versionizePages()
         */
-       protected function rawCopyPageContent($oldPageId, $newPageId, $copyTablesArray, &$tcemainObj) {
+       protected function rawCopyPageContent($oldPageId, $newPageId, array $copyTablesArray, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                if ($newPageId) {
@@ -1077,10 +1154,10 @@ class tx_version_tcemain {
        /**
         * Finds all elements for swapping versions in workspace
         *
-        * @param       string  $table  Table name of the original element to swap
-        * @param       int     $id     UID of the original element to swap (online)
-        * @param       int     $offlineId As above but offline
-        * @return      array   Element data. Key is table name, values are array with first element as online UID, second - offline UID
+        * @param  string $table Table name of the original element to swap
+        * @param integer $id UID of the original element to swap (online)
+        * @param integer $offlineId As above but offline
+        * @return array Element data. Key is table name, values are array with first element as online UID, second - offline UID
         */
        protected function findPageElementsForVersionSwap($table, $id, $offlineId) {
                global  $TCA;
@@ -1126,12 +1203,12 @@ class tx_version_tcemain {
        /**
         * Searches for all elements from all tables on the given pages in the same workspace.
         *
-        * @param       array   $pageIdList     List of PIDs to search
-        * @param       int     $workspaceId    Workspace ID
-        * @param       array   $elementList    List of found elements. Key is table name, value is array of element UIDs
-        * @return      void
+        * @param array $pageIdList List of PIDs to search
+        * @param integer $workspaceId Workspace ID
+        * @param array $elementList List of found elements. Key is table name, value is array of element UIDs
+        * @return void
         */
-       protected function findPageElementsForVersionStageChange($pageIdList, $workspaceId, &$elementList) {
+       protected function findPageElementsForVersionStageChange(array $pageIdList, $workspaceId, array &$elementList) {
                global $TCA;
 
                if ($workspaceId != 0) {
@@ -1164,14 +1241,14 @@ class tx_version_tcemain {
        /**
         * Finds page UIDs for the element from table <code>$table</code> with UIDs from <code>$idList</code>
         *
-        * @param       array   $table  Table to search
-        * @param       array   $idList List of records' UIDs
-        * @param       int     $workspaceId    Workspace ID. We need this parameter because user can be in LIVE but he still can publisg DRAFT from ws module!
-        * @param       array   $pageIdList     List of found page UIDs
-        * @param       array   $elementList    List of found element UIDs. Key is table name, value is list of UIDs
-        * @return      void
+        * @param string $table Table to search
+        * @param array $idList List of records' UIDs
+        * @param integer $workspaceId Workspace ID. We need this parameter because user can be in LIVE but he still can publisg DRAFT from ws module!
+        * @param array $pageIdList List of found page UIDs
+        * @param array $elementList List of found element UIDs. Key is table name, value is list of UIDs
+        * @return void
         */
-       protected function findPageIdsForVersionStateChange($table, $idList, $workspaceId, &$pageIdList, &$elementList) {
+       protected function findPageIdsForVersionStateChange($table, array $idList, $workspaceId, array &$pageIdList, array &$elementList) {
                if ($workspaceId != 0) {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('DISTINCT B.pid',
                                $table . ' A,' . $table . ' B',
@@ -1206,7 +1283,7 @@ class tx_version_tcemain {
         * @param       array   $idList List of page UIDs, possibly versioned
         * @return      void
         */
-       protected function findRealPageIds(&$idList) {
+       protected function findRealPageIds(array &$idList) {
                foreach ($idList as $key => $id) {
                        $rec = t3lib_BEfunc::getRecord('pages', $id, 't3ver_oid');
                        if ($rec['t3ver_oid'] > 0) {
@@ -1222,14 +1299,15 @@ class tx_version_tcemain {
         * Moving placeholder: Can be done because the system sees it as a placeholder for NEW elements like t3ver_state=1
         * Moving original: Will either create the placeholder if it doesn't exist or move existing placeholder in workspace.
         *
-        * @param       string          Table name to move
-        * @param       integer         Record uid to move (online record)
-        * @param       integer         Position to move to: $destPid: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
-        * @param       integer         UID of offline version of online record
-        * @return      void
+        * @param string $table Table name to move
+        * @param integer $uid Record uid to move (online record)
+        * @param integer $destPid Position to move to: $destPid: >=0 then it points to a page-id on which to insert the record (as the first element). <0 then it points to a uid from its own table after which to insert it (works if
+        * @param integer $wsUid UID of offline version of online record
+        * @param t3lib_TCEmain $tcemainObj TCEmain object
+        * @return void
         * @see moveRecord()
         */
-       protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, &$tcemainObj) {
+       protected function moveRecord_wsPlaceholders($table, $uid, $destPid, $wsUid, t3lib_TCEmain $tcemainObj) {
                global $TCA;
 
                if ($plh = t3lib_BEfunc::getMovePlaceholder($table, $uid, 'uid')) {
@@ -1302,8 +1380,9 @@ class tx_version_tcemain {
        /**
         * Gets all possible child tables that are used on each parent table as field.
         *
-        * @param string $parentTable
-        * @param array $possibleInlineChildren
+        * @param string $parentTable Name of the parent table
+        * @param array $possibleInlineChildren Collected possible inline children
+        *                              (will be filled automatically during recursive calls)
         * @return array
         */
        protected function getPossibleInlineChildTablesOfParentTable($parentTable, array $possibleInlineChildren = array()) {
@@ -1329,8 +1408,8 @@ class tx_version_tcemain {
        /**
         * Gets an instance of the command map helper.
         *
-        * @param t3lib_TCEmain $tceMain
-        * @param  $commandMap
+        * @param t3lib_TCEmain $tceMain TCEmain object
+        * @param array $commandMap The command map as submitted to t3lib_TCEmain
         * @return tx_version_tcemain_CommandMap
         */
        public function getCommandMap(t3lib_TCEmain $tceMain, array $commandMap) {
@@ -1338,4 +1417,7 @@ class tx_version_tcemain {
        }
 }
 
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain.php']);
+}
 ?>
\ No newline at end of file
diff --git a/typo3/sysext/version/class.tx_version_tcemain_commandmap.php b/typo3/sysext/version/class.tx_version_tcemain_commandmap.php
new file mode 100644 (file)
index 0000000..f485142
--- /dev/null
@@ -0,0 +1,776 @@
+<?php
+/***************************************************************
+ * Copyright notice
+ *
+ * (c) 2010 Oliver Hader <oliver@typo3.org>
+ * All rights reserved
+ *
+ * This script is part of the TYPO3 project. The TYPO3 project is
+ * free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * The GNU General Public License can be found at
+ * http://www.gnu.org/copyleft/gpl.html.
+ * A copy is found in the textfile GPL.txt and important notices to the license
+ * from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ * This script is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * Handles the t3lib_TCEmain command map and is only used in combination with t3lib_TCEmain.
+ */
+class tx_version_tcemain_CommandMap {
+       const SCOPE_WorkspacesSwap = 'SCOPE_WorkspacesSwap';
+       const SCOPE_WorkspacesSetStage = 'SCOPE_WorkspacesSetStage';
+
+       const KEY_ScopeErrorMessage = 'KEY_ScopeErrorMessage';
+       const KEY_ScopeErrorCode = 'KEY_ScopeErrorCode';
+       const KEY_GetElementPropertiesCallback = 'KEY_GetElementPropertiesCallback';
+       const KEY_GetCommonPropertiesCallback = 'KEY_GetCommonPropertiesCallback';
+       const KEY_ElementConstructCallback = 'KEY_EventConstructCallback';
+       const KEY_ElementCreateChildReferenceCallback = 'KEY_ElementCreateChildReferenceCallback';
+       const KEY_ElementCreateParentReferenceCallback = 'KEY_ElementCreateParentReferenceCallback';
+       const KEY_PurgeWithErrorMessageGetIdCallback = 'KEY_PurgeWithErrorMessageGetIdCallback';
+       const KEY_UpdateGetIdCallback = 'KEY_UpdateGetIdCallback';
+       const KEY_TransformDependentElementsToUseLiveId = 'KEY_TransformDependentElementsToUseLiveId';
+
+       /**
+        * @var tx_version_tcemain
+        */
+       protected $parent;
+
+       /**
+        * @var t3lib_TCEmain
+        */
+       protected $tceMain;
+
+       /**
+        * @var array
+        */
+       protected $commandMap = array();
+
+       /**
+        * @var string
+        */
+       protected $workspacesSwapMode;
+
+       /**
+        * @var string
+        */
+       protected $workspacesChangeStageMode;
+
+       /**
+        * @var boolean
+        */
+       protected $workspacesConsiderReferences;
+
+       /**
+        * @var array
+        */
+       protected $scopes;
+
+       /**
+        * Creates this object.
+        *
+        * @param t3lib_TCEmain $parent
+        * @param array $commandMap
+        */
+       public function __construct(tx_version_tcemain $parent, t3lib_TCEmain $tceMain, array $commandMap) {
+               $this->setParent($parent);
+               $this->setTceMain($tceMain);
+               $this->set($commandMap);
+
+               $this->setWorkspacesSwapMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.swapMode'));
+               $this->setWorkspacesChangeStageMode($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.changeStageMode'));
+               $this->setWorkspacesConsiderReferences($this->getTceMain()->BE_USER->getTSConfigVal('options.workspaces.considerReferences'));
+
+               $this->constructScopes();
+       }
+
+       /**
+        * Gets the command map.
+        *
+        * @return array
+        */
+       public function get() {
+               return $this->commandMap;
+       }
+
+       /**
+        * Sets the command map.
+        *
+        * @param array $commandMap
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function set(array $commandMap) {
+               $this->commandMap = $commandMap;
+               return $this;
+       }
+
+       /**
+        * Gets the parent object.
+        *
+        * @return tx_version_tcemain
+        */
+       public function getParent() {
+               return $this->parent;
+       }
+
+       /**
+        * Sets the parent object.
+        *
+        * @param tx_version_tcemain $parent
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function setParent(tx_version_tcemain $parent) {
+               $this->parent = $parent;
+               return $this;
+       }
+
+       /**
+        * Gets the parent object.
+        *
+        * @return t3lib_TCEmain
+        */
+       public function getTceMain() {
+               return $this->tceMain;
+       }
+
+       /**
+        * Sets the parent object.
+        *
+        * @param t3lib_TCEmain $parent
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function setTceMain(t3lib_TCEmain $tceMain) {
+               $this->tceMain = $tceMain;
+               return $this;
+       }
+
+       /**
+        * Sets the workspaces swap mode
+        * (see options.workspaces.swapMode).
+        *
+        * @param string $workspacesSwapMode
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function setWorkspacesSwapMode($workspacesSwapMode) {
+               $this->workspacesSwapMode = (string)$workspacesSwapMode;
+               return $this;
+       }
+
+       /**
+        * Sets the workspaces change stage mode
+        * see options.workspaces.changeStageMode)
+        *
+        * @param string $workspacesChangeStageMode
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function setWorkspacesChangeStageMode($workspacesChangeStageMode) {
+               $this->workspacesChangeStageMode = (string)$workspacesChangeStageMode;
+               return $this;
+       }
+
+       /**
+        * Sets the workspace behaviour to automatically consider references
+        * (see options.workspaces.considerReferences)
+        *
+        * @param boolean $workspacesConsiderReferences
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function setWorkspacesConsiderReferences($workspacesConsiderReferences) {
+               $this->workspacesConsiderReferences = (bool)$workspacesConsiderReferences;
+               return $this;
+       }
+
+       /**
+        * Processes the command map.
+        *
+        * @return tx_version_tcemain_CommandMap
+        */
+       public function process() {
+               $this->resolveWorkspacesSwapDependencies();
+               $this->resolveWorkspacesSetStageDependencies();
+               return $this;
+       }
+
+       /**
+        * Resolves workspaces related dependencies for swapping/publishing of the command map.
+        * Workspaces records that have children or (relative) parents which are versionized
+        * but not published with this request, are removed from the command map. Otherwise
+        * this would produce hanging record sets and lost references.
+        *
+        * @return void
+        */
+       protected function resolveWorkspacesSwapDependencies() {
+               $scope = self::SCOPE_WorkspacesSwap;
+               $dependency = $this->getDependencyUtility($scope);
+
+               foreach ($this->commandMap as $table => $liveIdCollection) {
+                       foreach ($liveIdCollection as $liveId => $commandCollection) {
+                               foreach ($commandCollection as $command => $properties) {
+                                       if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'swap') {
+                                               if (isset($properties['swapWith']) && t3lib_div::testInt($properties['swapWith'])) {
+                                                       $this->addWorkspacesSwapElements($dependency, $table, $liveId, $properties);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               $this->applyWorkspacesDependencies($dependency, $scope);
+       }
+
+       /**
+        * Adds workspaces elements for swapping/publishing and takes care of the swapMode.
+        *
+        * @param t3lib_utility_Dependency $dependency
+        * @param string $table
+        * @param iteger $liveId
+        * @param array $properties
+        * @return void
+        */
+       protected function addWorkspacesSwapElements(t3lib_utility_Dependency $dependency, $table, $liveId, array $properties) {
+               $elementList = array();
+
+               // Fetch accordant elements if the swapMode is 'any' or 'pages':
+               if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages' && $table === 'pages') {
+                       $elementList = $this->getParent()->findPageElementsForVersionSwap($table, $liveId, $properties['swapWith']);
+               }
+
+               foreach ($elementList as $elementTable => $elementIdArray) {
+                       foreach ($elementIdArray as $elementIds) {
+                               $dependency->addElement(
+                                       $elementTable, $elementIds[1],
+                                       array('liveId' => $elementIds[0], 'properties' => array_merge($properties, array('swapWith' => $elementIds[1])))
+                               );
+                       }
+               }
+
+               if (count($elementList) === 0) {
+                       $dependency->addElement(
+                               $table, $properties['swapWith'], array('liveId' => $liveId, 'properties' => $properties)
+                       );
+               }
+       }
+
+       /**
+        * Resolves workspaces related dependencies for staging of the command map.
+        * Workspaces records that have children or (relative) parents which are versionized
+        * but not staged with this request, are removed from the command map.
+        *
+        * @return void
+        */
+       protected function resolveWorkspacesSetStageDependencies() {
+               $scope = self::SCOPE_WorkspacesSetStage;
+               $dependency = $this->getDependencyUtility($scope);
+
+               foreach ($this->commandMap as $table => $liveIdCollection) {
+                       foreach ($liveIdCollection as $liveIdList => $commandCollection) {
+                               foreach ($commandCollection as $command => $properties) {
+                                       if ($command === 'version' && isset($properties['action']) && $properties['action'] === 'setStage') {
+                                               if (isset($properties['stageId']) && t3lib_div::testInt($properties['stageId'])) {
+                                                       $this->addWorkspacesSetStageElements($dependency, $table, $liveIdList, $properties);
+                                                       $this->explodeSetStage($table, $liveIdList, $properties);
+                                               }
+                                       }
+                               }
+                       }
+               }
+
+               $this->applyWorkspacesDependencies($dependency, $scope);
+       }
+
+       /**
+        * Adds workspaces elements for staging and takes care of the changeStageMode.
+        *
+        * @param t3lib_utility_Dependency $dependency
+        * @param string $table
+        * @param string $liveIdList
+        * @param array $properties
+        * @return void
+        */
+       protected function addWorkspacesSetStageElements(t3lib_utility_Dependency $dependency, $table, $liveIdList, array $properties) {
+               $liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
+               $elementList = array($table => $liveIds);
+
+               if (t3lib_div::inList('any,pages', $this->workspacesChangeStageMode)) {
+                       if (count($liveIds) === 1) {
+                               $workspaceRecord = t3lib_BEfunc::getRecord($table, $liveIds[0], 't3ver_wsid');
+                               $workspaceId = $workspaceRecord['t3ver_wsid'];
+                       } else {
+                               $workspaceId = $this->tceMain()->BE_USER->workspace;
+                       }
+
+                       if ($table === 'pages') {
+                               // Find all elements from the same ws to change stage
+                               $this->getParent()->findRealPageIds($liveIds);
+                               $this->getParent()->findPageElementsForVersionStageChange($liveIds, $workspaceId, $elementList);
+                       } elseif ($this->workspacesChangeStageMode === 'any') {
+                               // Find page to change stage:
+                               $pageIdList = array();
+                               $this->getParent()->findPageIdsForVersionStateChange($table, $liveIds, $workspaceId, $pageIdList, $elementList);
+                               // Find other elements from the same ws to change stage:
+                               $this->getParent()->findPageElementsForVersionStageChange($pageIdList, $workspaceId, $elementList);
+                       }
+               }
+
+               foreach ($elementList as $elementTable => $elementIds) {
+                       foreach($elementIds as $elementId) {
+                               $dependency->addElement(
+                                       $elementTable, $elementId,
+                                       array('properties' => $properties)
+                               );
+                       }
+               }
+       }
+
+       /**
+        * Explodes id-lists in the command map for staging actions.
+        *
+        * @throws RuntimeException
+        * @param string $table
+        * @param string $liveIdList
+        * @param array $properties
+        * @return void
+        */
+       protected function explodeSetStage($table, $liveIdList, array $properties) {
+               $extractedCommandMap = array();
+               $liveIds = t3lib_div::trimExplode(',', $liveIdList, TRUE);
+
+               if (count($liveIds) > 1) {
+                       foreach ($liveIds as $liveId) {
+                               if (isset($this->commandMap[$table][$liveId]['version'])) {
+                                       throw new RuntimeException('Command map for [' . $table . '][' . $liveId . '][version] was already set.', 1289391048);
+                               }
+
+                               $extractedCommandMap[$table][$liveId]['version'] = $properties;
+                       }
+
+                       $this->remove($table, $liveIdList, 'version');
+                       $this->mergeToBottom($extractedCommandMap);
+               }
+       }
+
+       /**
+        * Applies the workspaces dependencies and removes incomplete structures or automatically
+        * completes them, depending on the options.workspaces.considerReferences setting
+        *
+        * @param t3lib_utility_Dependency $dependency
+        * @param string $scope
+        * @return void
+        */
+       protected function applyWorkspacesDependencies(t3lib_utility_Dependency $dependency, $scope) {
+               $transformDependentElementsToUseLiveId = $this->getScopeData($scope, self::KEY_TransformDependentElementsToUseLiveId);
+
+               $elementsToBeVersionized = $dependency->getElements();
+               if ($transformDependentElementsToUseLiveId) {
+                       $elementsToBeVersionized = $this->transformDependentElementsToUseLiveId($elementsToBeVersionized);
+               }
+
+               $outerMostParents = $dependency->getOuterMostParents();
+               /** @var $outerMostParent t3lib_utility_Dependency_Element */
+               foreach ($outerMostParents as $outerMostParent) {
+                       $dependentElements = $dependency->getNestedElements($outerMostParent);
+                       if ($transformDependentElementsToUseLiveId) {
+                               $dependentElements = $this->transformDependentElementsToUseLiveId($dependentElements);
+                       }
+
+                       $intersectingElements = array_intersect_key($dependentElements, $elementsToBeVersionized);
+
+                       if (count($intersectingElements) > 0) {
+                               // If at least one element intersects but not all, throw away all elements of the depdendent structure:
+                               if (count($intersectingElements) !== count($dependentElements) && $this->workspacesConsiderReferences === FALSE) {
+                                       $this->purgeWithErrorMessage($intersectingElements, $scope);
+                               // If everything is fine or references shall be considered automatically:
+                               } else {
+                                       $this->update(current($intersectingElements), $dependentElements, $scope);
+                               }
+                       }
+               }
+       }
+
+       /**
+        * Purges incomplete structures from the command map and triggers an error message.
+        *
+        * @param array $elements
+        * @param string $scope
+        * @return void
+        */
+       protected function purgeWithErrorMessage(array $elements, $scope) {
+               /** @var $dependentElement t3lib_utility_Dependency_Element */
+               foreach ($elements as $element) {
+                       $table = $element->getTable();
+                       $id = $this->processCallback(
+                               $this->getScopeData($scope, self::KEY_PurgeWithErrorMessageGetIdCallback),
+                               array($element)
+                       );
+
+                       $this->remove($table, $id, 'version');
+                       $this->getTceMain()->log(
+                               $table, $id,
+                               5, 0, 1,
+                               $this->getScopeData($scope, self::KEY_ScopeErrorMessage),
+                               $this->getScopeData($scope, self::KEY_ScopeErrorCode),
+                               array(
+                                       t3lib_BEfunc::getRecordTitle($table, t3lib_BEfunc::getRecord($table, $id)),
+                                       $table, $id
+                               )
+                       );
+               }
+       }
+
+       /**
+        * Updates the command map accordant to valid structures and takes care of the correct order.
+        *
+        * @param t3lib_utility_Dependency_Element $intersectingElement
+        * @param array $elements
+        * @param string $scope
+        * @return void
+        */
+       protected function update(t3lib_utility_Dependency_Element $intersectingElement, array $elements, $scope) {
+               $orderedCommandMap = array();
+
+               $commonProperties = $this->processCallback(
+                       $this->getScopeData($scope, self::KEY_GetCommonPropertiesCallback),
+                       array($intersectingElement)
+               );
+
+               /** @var $dependentElement t3lib_utility_Dependency_Element */
+               foreach ($elements as $element) {
+                       $table = $element->getTable();
+                       $id = $this->processCallback(
+                               $this->getScopeData($scope, self::KEY_UpdateGetIdCallback),
+                               array($element)
+                       );
+
+                       $this->remove($table, $id, 'version');
+                       $orderedCommandMap[$table][$id]['version'] = array_merge(
+                               $commonProperties,
+                               $this->processCallback(
+                                       $this->getScopeData($scope, self::KEY_GetElementPropertiesCallback),
+                                       array($element)
+                               )
+                       );
+               }
+
+               // Ensure that ordered command map is on top of the command map:
+               $this->mergeToTop($orderedCommandMap);
+       }
+
+       /**
+        * Merges command map elements to the top of the current command map..
+        *
+        * @param array $commandMap
+        * @return void
+        */
+       protected function mergeToTop(array $commandMap) {
+               $this->commandMap = t3lib_div::array_merge_recursive_overrule($commandMap, $this->commandMap);
+       }
+
+       /**
+        * Merges command map elements to the bottom of the current command map.
+        *
+        * @param array $commandMap
+        * @return void
+        */
+       protected function mergeToBottom(array $commandMap) {
+               $this->commandMap = t3lib_div::array_merge_recursive_overrule($this->commandMap, $commandMap);
+       }
+
+       /**
+        * Removes an element from the command map.
+        *
+        * @param string $table
+        * @param string $id
+        * @param string $command (optional)
+        * @return void
+        */
+       protected function remove($table, $id, $command = NULL) {
+               if (is_string($command)) {
+                       unset($this->commandMap[$table][$id][$command]);
+               } else {
+                       unset($this->commandMap[$table][$id]);
+               }
+       }
+
+       /**
+        * Callback to get the liveId of an dependent element.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return integer
+        */
+       protected function getElementLiveIdCallback(t3lib_utility_Dependency_Element $element) {
+               return $element->getDataValue('liveId');
+       }
+
+       /**
+        * Callback to get the real id of an dependent element.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return integer
+        */
+       protected function getElementIdCallback(t3lib_utility_Dependency_Element $element) {
+               return $element->getId();
+       }
+
+       /**
+        * Callback to get the specific properties of a dependent element for swapping/publishing.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return array
+        */
+       protected function getElementSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
+               return array(
+                       'swapWith' => $element->getId(),
+               );
+       }
+
+       /**
+        * Callback to get common properties of dependent elements for swapping/publishing.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return array
+        */
+       protected function getCommonSwapPropertiesCallback(t3lib_utility_Dependency_Element $element) {
+               $commonSwapProperties = array();
+
+               $elementProperties = $element->getDataValue('properties');
+               if (isset($elementProperties['action'])) {
+                       $commonSwapProperties['action'] = $elementProperties['action'];
+               }
+               if (isset($elementProperties['swapIntoWS'])) {
+                       $commonSwapProperties['swapIntoWS'] = $elementProperties['swapIntoWS'];
+               }
+
+               return $commonSwapProperties;
+       }
+
+       /**
+        * Callback to get the specific properties of a dependent element for staging.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return array
+        */
+       protected function getElementSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
+               return $this->getCommonSetStagePropertiesCallback($element);
+       }
+
+       /**
+        * Callback to get common properties of dependent elements for staging.
+        *
+        * @param t3lib_utility_Dependency_Element $element
+        * @return array
+        */
+       protected function getCommonSetStagePropertiesCallback(t3lib_utility_Dependency_Element $element) {
+               $commonSetStageProperties = array();
+
+               $elementProperties = $element->getDataValue('properties');
+               if (isset($elementProperties['stageId'])) {
+                       $commonSetStageProperties['stageId'] = $elementProperties['stageId'];
+               }
+               if (isset($elementProperties['comment'])) {
+                       $commonSetStageProperties['comment'] = $elementProperties['comment'];
+               }
+
+               return $commonSetStageProperties;
+       }
+
+
+       /**
+        * Gets an instance of the depency resolver utility.
+        *
+        * @return t3lib_utility_Dependency
+        */
+       protected function getDependencyUtility($scope) {
+
+               /** @var $dependency t3lib_utility_Dependency */
+               $dependency = t3lib_div::makeInstance('t3lib_utility_Dependency');
+               $dependency->setOuterMostParentsRequireReferences(TRUE);
+
+               if ($this->getScopeData($scope, self::KEY_ElementConstructCallback)) {
+                       $dependency->setEventCallback(
+                               t3lib_utility_Dependency_Element::EVENT_Construct,
+                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementConstructCallback))
+                       );
+               }
+               if ($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback)) {
+                       $dependency->setEventCallback(
+                               t3lib_utility_Dependency_Element::EVENT_CreateChildReference,
+                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateChildReferenceCallback))
+                       );
+               }
+               if ($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback)) {
+                       $dependency->setEventCallback(
+                               t3lib_utility_Dependency_Element::EVENT_CreateParentReference,
+                               $this->getDependencyCallback($this->getScopeData($scope, self::KEY_ElementCreateParentReferenceCallback))
+                       );
+               }
+
+               return $dependency;
+       }
+
+       /**
+        * Callback to determine whether a new child reference shall be considered in the dependency resolver utility.
+        *
+        * @param array $callerArguments
+        * @param array $targetArgument
+        * @param t3lib_utility_Dependency_Element $caller
+        * @param string $eventName
+        * @return string Skip response (if required)
+        */
+       public function createNewDependentElementChildReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
+               /** @var $reference t3lib_utility_Dependency_Reference */
+               $reference = $callerArguments['reference'];
+
+               $fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($caller->getTable(), $reference->getField());
+
+               if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getTceMain()->getInlineFieldType($fieldCOnfiguration))) {
+                       return t3lib_utility_Dependency_Element::RESPONSE_Skip;
+               }
+       }
+
+       /**
+        * Callback to determine whether a new parent reference shall be considered in the dependency resolver utility.
+        *
+        * @param array $callerArguments
+        * @param array $targetArgument
+        * @param t3lib_utility_Dependency_Element $caller
+        * @param string $eventName
+        * @return string Skip response (if required)
+        */
+       public function createNewDependentElementParentReferenceCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller, $eventName) {
+               /** @var $reference t3lib_utility_Dependency_Reference */
+               $reference = $callerArguments['reference'];
+
+               $fieldCOnfiguration = t3lib_BEfunc::getTcaFieldConfiguration($reference->getElement()->getTable(), $reference->getField());
+
+               if (!$fieldCOnfiguration || !t3lib_div::inList('field,list', $this->getTceMain()->getInlineFieldType($fieldCOnfiguration))) {
+                       return t3lib_utility_Dependency_Element::RESPONSE_Skip;
+               }
+       }
+
+       /**
+        * Callback to add additional data to new elements created in the dependency resolver utility.
+        *
+        * @param t3lib_utility_Dependency_Element $caller
+        * @param array $callerArguments
+        * @param array $targetArgument
+        * @return void
+        */
+       public function createNewDependentElementCallback(array $callerArguments, array $targetArgument, t3lib_utility_Dependency_Element $caller) {
+               if ($caller->hasDataValue('liveId') === FALSE) {
+                       $liveId = t3lib_BEfunc::getLiveVersionIdOfRecord($caller->getTable(), $caller->getId());
+                       if (is_null($liveId) === FALSE) {
+                               $caller->setDataValue('liveId', $liveId);
+                       }
+               }
+       }
+
+       /**
+        * Transforms dependent elements to use the liveId as array key.
+        *
+        * @param array $elements Depedent elements, each of type t3lib_utility_Dependency_Element
+        * @return array
+        */
+       protected function transformDependentElementsToUseLiveId(array $elements) {
+               $transformedElements = array();
+
+               /** @var $element t3lib_utility_Dependency_Element */
+               foreach ($elements as $element) {
+                       $elementName = t3lib_utility_Dependency_Element::getIdentifier(
+                               $element->getTable(), $element->getDataValue('liveId')
+                       );
+                       $transformedElements[$elementName] = $element;
+               }
+
+               return $transformedElements;
+       }
+
+       /**
+        * Constructs the scope settings.
+        * Currently the scopes for swapping/publishing and staging are available.
+        *
+        * @return void
+        */
+       protected function constructScopes() {
+               $this->scopes = array(
+                       self::SCOPE_WorkspacesSwap => array(
+                               self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be swapped or published independently, because it is related to other new or modified records.',
+                               self::KEY_ScopeErrorCode => 1288283630,
+                               self::KEY_GetElementPropertiesCallback => 'getElementSwapPropertiesCallback',
+                               self::KEY_GetCommonPropertiesCallback => 'getCommonSwapPropertiesCallback',
+                               self::KEY_ElementConstructCallback => 'createNewDependentElementCallback',
+                               self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
+                               self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
+                               self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementLiveIdCallback',
+                               self::KEY_UpdateGetIdCallback => 'getElementLiveIdCallback',
+                               self::KEY_TransformDependentElementsToUseLiveId => TRUE,
+                       ),
+                       self::SCOPE_WorkspacesSetStage => array(
+                               self::KEY_ScopeErrorMessage => 'Record "%s" (%s:%s) cannot be sent to another stage independently, because it is related to other new or modified records.',
+                               self::KEY_ScopeErrorCode => 1289342524,
+                               self::KEY_GetElementPropertiesCallback => 'getElementSetStagePropertiesCallback',
+                               self::KEY_GetCommonPropertiesCallback => 'getCommonSetStagePropertiesCallback',
+                               self::KEY_ElementConstructCallback => NULL,
+                               self::KEY_ElementCreateChildReferenceCallback => 'createNewDependentElementChildReferenceCallback',
+                               self::KEY_ElementCreateParentReferenceCallback => 'createNewDependentElementParentReferenceCallback',
+                               self::KEY_PurgeWithErrorMessageGetIdCallback => 'getElementIdCallback',
+                               self::KEY_UpdateGetIdCallback => 'getElementIdCallback',
+                               self::KEY_TransformDependentElementsToUseLiveId => FALSE,
+                       ),
+               );
+       }
+
+       /**
+        * Gets data for a particular scope.
+        *
+        * @throws RuntimeException
+        * @param string $scope
+        * @param string $key
+        * @return string
+        */
+       protected function getScopeData($scope, $key) {
+               if (!isset($this->scopes[$scope])) {
+                       throw new RuntimeException('Scope "' . $scope . '" is not defined.', 1289342187);
+               }
+
+               return $this->scopes[$scope][$key];
+       }
+
+       /**
+        * Gets a new callback to be used in the dependency resolver utility.
+        *
+        * @param string $callbackMethod
+        * @param array $targetArguments
+        * @return t3lib_utility_Dependency_Callback
+        */
+       protected function getDependencyCallback($method, array $targetArguments = array()) {
+               return t3lib_div::makeInstance('t3lib_utility_Dependency_Callback', $this, $method, $targetArguments);
+       }
+
+       /**
+        * Processes a local callback inside this object.
+        *
+        * @param string $method
+        * @param array $callbackArguments
+        * @return mixed
+        */
+       protected function processCallback($method, array $callbackArguments) {
+               return call_user_func_array(array($this, $method), $callbackArguments);
+       }
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain_commandmap.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/version/class.tx_version_tcemain_commandmap.php']);
+}
+?>
\ No newline at end of file
index 26c686e..1cb91cc 100755 (executable)
@@ -356,11 +356,14 @@ class tx_version_cm1 extends t3lib_SCbase {
                        }
 
                                // If access to Web>List for user, then link to that module.
-                       $buttons['record_list'] = t3lib_extMgm::createListViewLink(
-                               $this->pageinfo['uid'],
-                               '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI')),
-                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList', TRUE)
-                       );
+                       $buttons['record_list'] = t3lib_BEfunc::getListViewLink(
+                               array(
+                                       'id' => $this->pageinfo['uid'],
+                                       'returnUrl' => t3lib_div::getIndpEnv('REQUEST_URI'),
+                               ),
+                               '',
+                               $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.showList')
+                       );
                }
                return $buttons;
        }
@@ -726,10 +729,10 @@ class tx_version_cm1 extends t3lib_SCbase {
                        $ttlHours = ($ttlHours ? $ttlHours : 24*2);
 
                        if (t3lib_div::_POST('_previewLink_wholeWorkspace'))    {
-                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . 'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'],60*60*$ttlHours,$GLOBALS['BE_USER']->workspace).'&id='.intval($this->id);
+                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . '/index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], 60*60*$ttlHours, $GLOBALS['BE_USER']->workspace) . '&id=' . intval($this->id);
                        } else {
                                $params = 'id='.$this->id.'&ADMCMD_previewWS='.$GLOBALS['BE_USER']->workspace;
-                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) .'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword($params, $GLOBALS['BE_USER']->user['uid'],60*60*$ttlHours);
+                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . '/index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword($params, $GLOBALS['BE_USER']->user['uid'], 60*60*$ttlHours);
                        }
                        $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('previewUrl'), sprintf($GLOBALS['LANG']->getLL('previewInstruction'), $ttlHours) . '<br /><br /><a target="_blank" href="' . htmlspecialchars($previewUrl) . '">' . $previewUrl . '</a>', 0, 1);
                }
index 78a9e62..c305b3e 100644 (file)
@@ -4,7 +4,7 @@
 
 $extensionPath = t3lib_extMgm::extPath('version');
 return array(
-       'tx_version_tcemain_commandmap' => $extensionPath . 'class.t3lib_tcemain_commandmap.php',
+       'tx_version_tcemain_commandmap' => $extensionPath . 'class.tx_version_tcemain_commandmap.php',
        'tx_version_cm1' => $extensionPath . 'cm1/index.php',
        'tx_version_gui' => $extensionPath . 'class.tx_version_gui.php',
        'tx_version_tcemain' => $extensionPath . 'class.tx_version_tcemain.php',
index 0927c58..57bc0c1 100755 (executable)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "version".
 #
-# Auto generated 28-12-2010 15:52
+# Auto generated 12-01-2011 11:33
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -30,8 +30,8 @@ $EM_CONF[$_EXTKEY] = array(
        'clearCacheOnLoad' => 0,
        'lockType' => '',
        'author_company' => '',
-       'version' => '4.5.0',
-       '_md5_values_when_last_written' => 'a:32:{s:9:"ChangeLog";s:4:"ab31";s:34:"class.t3lib_tcemain_commandmap.php";s:4:"fe88";s:24:"class.tx_version_cm1.php";s:4:"b4cd";s:24:"class.tx_version_gui.php";s:4:"a78a";s:28:"class.tx_version_tcemain.php";s:4:"5f4e";s:16:"ext_autoload.php";s:4:"a3bf";s:21:"ext_conf_template.txt";s:4:"84d4";s:12:"ext_icon.gif";s:4:"3ca2";s:17:"ext_localconf.php";s:4:"0798";s:14:"ext_tables.php";s:4:"1196";s:19:"last_synched_target";s:4:"efa0";s:13:"locallang.xml";s:4:"5ec0";s:7:"tca.php";s:4:"15fa";s:37:"Resources/Private/Language/emails.xml";s:4:"efd1";s:12:"cli/conf.php";s:4:"f8ec";s:13:"cm1/clear.gif";s:4:"cc11";s:15:"cm1/cm_icon.gif";s:4:"3ca2";s:12:"cm1/conf.php";s:4:"6ed8";s:13:"cm1/index.php";s:4:"3eb3";s:44:"tasks/class.tx_version_tasks_autopublish.php";s:4:"ace9";s:18:"ws/class.wslib.php";s:4:"549f";s:22:"ws/class.wslib_gui.php";s:4:"0889";s:12:"ws/clear.gif";s:4:"cc11";s:11:"ws/conf.php";s:4:"b2a8";s:12:"ws/index.php";s:4:"7c2f";s:15:"ws/progress.gif";s:4:"35af";s:14:"ws/publish.php";s:4:"3fe4";s:20:"ws/sys_workspace.gif";s:4:"55bc";s:20:"ws/sys_workspace.png";s:4:"db4b";s:21:"ws/workspaceforms.php";s:4:"0e83";s:19:"ws/wsol_preview.php";s:4:"fbab";s:15:"ws/cli/conf.php";s:4:"328d";}',
+       'version' => '4.5.0beta4',
+       '_md5_values_when_last_written' => 'a:31:{s:9:"ChangeLog";s:4:"d57e";s:24:"class.tx_version_cm1.php";s:4:"b4cd";s:24:"class.tx_version_gui.php";s:4:"86d9";s:28:"class.tx_version_tcemain.php";s:4:"27f0";s:39:"class.tx_version_tcemain_commandmap.php";s:4:"3fc3";s:16:"ext_autoload.php";s:4:"3497";s:21:"ext_conf_template.txt";s:4:"84d4";s:12:"ext_icon.gif";s:4:"3ca2";s:17:"ext_localconf.php";s:4:"9812";s:14:"ext_tables.php";s:4:"1196";s:13:"locallang.xml";s:4:"5ec0";s:7:"tca.php";s:4:"15fa";s:47:"Resources/Private/Language/locallang_emails.xml";s:4:"efd1";s:12:"cli/conf.php";s:4:"f8ec";s:13:"cm1/clear.gif";s:4:"cc11";s:15:"cm1/cm_icon.gif";s:4:"3ca2";s:12:"cm1/conf.php";s:4:"6ed8";s:13:"cm1/index.php";s:4:"d53f";s:44:"tasks/class.tx_version_tasks_autopublish.php";s:4:"ace9";s:18:"ws/class.wslib.php";s:4:"549f";s:22:"ws/class.wslib_gui.php";s:4:"e367";s:12:"ws/clear.gif";s:4:"cc11";s:11:"ws/conf.php";s:4:"b2a8";s:12:"ws/index.php";s:4:"e9df";s:15:"ws/progress.gif";s:4:"35af";s:14:"ws/publish.php";s:4:"5761";s:20:"ws/sys_workspace.gif";s:4:"55bc";s:20:"ws/sys_workspace.png";s:4:"db4b";s:21:"ws/workspaceforms.php";s:4:"46bd";s:19:"ws/wsol_preview.php";s:4:"fbab";s:15:"ws/cli/conf.php";s:4:"328d";}',
        'constraints' => array(
                'depends' => array(
                        'typo3' => '4.5.0-0.0.0',
index f23452c..107bf08 100644 (file)
@@ -13,8 +13,8 @@ if (TYPO3_MODE == 'BE') {
 
        // add default notification options to every page
 t3lib_extMgm::addPageTSconfig('
-       tx_version.workspaces.stageNotificationEmail.subject = LLL:EXT:version/Resources/Private/Language/emails.xml:subject
-       tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:version/Resources/Private/Language/emails.xml:message
+       tx_version.workspaces.stageNotificationEmail.subject = LLL:EXT:version/Resources/Private/Language/locallang_emails.xml:subject
+       tx_version.workspaces.stageNotificationEmail.message = LLL:EXT:version/Resources/Private/Language/locallang_emails.xml:message
        # tx_version.workspaces.stageNotificationEmail.additionalHeaders =
 ');
 }
index dbb12cf..3999310 100644 (file)
@@ -1 +1 @@
-https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/version/tags/4.5.0beta3a
+https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/version/tags/4.5.0beta4
index 9f2a710..3adc0d4 100755 (executable)
@@ -465,7 +465,7 @@ class SC_mod_user_ws_index extends t3lib_SCbase {
                        if (t3lib_div::_POST('_previewLink'))   {
                                $ttlHours = intval($GLOBALS['BE_USER']->getTSConfigVal('options.workspaces.previewLinkTTLHours'));
                                $ttlHours = ($ttlHours ? $ttlHours : 24*2);
-                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . 'index.php?ADMCMD_prev='.t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'],60*60*$ttlHours,$GLOBALS['BE_USER']->workspace).'&id='.intval($GLOBALS['BE_USER']->workspaceRec['db_mountpoints']);
+                               $previewUrl = t3lib_BEfunc::getViewDomain($this->id) . '/index.php?ADMCMD_prev=' . t3lib_BEfunc::compilePreviewKeyword('', $GLOBALS['BE_USER']->user['uid'], 60*60*$ttlHours, $GLOBALS['BE_USER']->workspace) . '&id=' . intval($GLOBALS['BE_USER']->workspaceRec['db_mountpoints']);
                                $actionLinks.= '<br />Any user can browse the workspace frontend using this link for the next ' . $ttlHours . ' hours (does not require backend login):<br /><br /><a target="_blank" href="' . htmlspecialchars($previewUrl) . '">' . $previewUrl . '</a>';
                        } else {
                                $actionLinks.= '<input type="submit" name="_previewLink" value="Generate Workspace Preview Link" />';
index ba643bf..0210713 100644 (file)
@@ -1,3 +1,30 @@
+2011-01-12  Oliver Hader  <oliver.hader@typo3.org>
+
+       * Fixed bug: migrateWorkspaces in Install-Tool does not work, if extbase is not intalled
+       * Raised version to 4.5.0beta4
+
+2011-01-09  Tolleiv Nietsch <typo3@tolleiv.de>
+
+       * Fixed bug #11971: Live Tab is linked in Live view
+
+2011-01-06  Tolleiv Nietsch <typo3@tolleiv.de>
+
+       * Fixed bug #11815: WorkspacePreviewLink should be a link
+       * Fixed bug #11029: Workspaces module: Row detail view (Thanks to Lars Zimmermann and Berit Jensen)
+
+2011-01-06  Steffen Kamper  <steffen@typo3.org>
+
+       * Fixed bug #11674: Selection of row deletes checkbox selection
+       * Fixed bug #11647: Switching workspace doesn't refresh new pagetree
+
+2011-01-01  Benjamin Mack  <benni@typo3.org>
+
+       * Fixed bug #3358: make sure only "element" versioning type is supported / used - added status report for Reports module
+
+2010-12-30  Susanne Moog <typo3@susanne-moog.de>
+
+       * Fixed bug #11789: fluid viewhelper renderFlashMessages is deprecated
+
 2010-12-28  Steffen Kamper  <steffen@typo3.org>
 
        * Follow-up to #11635: Removed remaining event listener
diff --git a/typo3/sysext/workspaces/Classes/Reports/StatusProvider.php b/typo3/sysext/workspaces/Classes/Reports/StatusProvider.php
new file mode 100644 (file)
index 0000000..92b40f6
--- /dev/null
@@ -0,0 +1,88 @@
+<?php
+/***************************************************************
+ *  Copyright notice
+ *
+ *  (c) 2010 Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
+ *  All rights reserved
+ *
+ *  This script is part of the TYPO3 project. The TYPO3 project is
+ *  free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  The GNU General Public License can be found at
+ *  http://www.gnu.org/copyleft/gpl.html.
+ *  A copy is found in the textfile GPL.txt and important notices to the license
+ *  from the author is found in LICENSE.txt distributed with these scripts.
+ *
+ *
+ *  This script is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  This copyright notice MUST APPEAR in all copies of the script!
+ ***************************************************************/
+
+/**
+ * a status provider for the reports module to display whether only 
+ * element version is used.
+ * 
+ * @author Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)
+ * @package Workspaces
+ * @subpackage Service
+ */
+class Tx_Workspaces_Reports_StatusProvider implements tx_reports_StatusProvider {
+
+       protected $reportList = 'ElementVersioningOnly';
+
+       /**
+        * Compiles a collection of system status checks as a status report.
+        *
+        * @return      array   List of statuses
+        * @see typo3/sysext/reports/interfaces/tx_reports_StatusProvider::getStatus()
+        */
+       public function getStatus() {
+               $reports = array();
+               $reportMethods = explode(',', $this->reportList);
+
+               foreach ($reportMethods as $reportMethod) {
+                       $reports[$reportMethod] = $this->{'get' . $reportMethod . 'Status'}();
+               }
+
+               return $reports;
+       }
+
+
+       /**
+        * Checks if there are still updates to perform
+        *
+        * @return      tx_reports_reports_status_Status        An tx_reports_reports_status_Status object representing whether the element versioning is in use or not
+        */
+       protected function getElementVersioningOnlyStatus() {
+               $severity = tx_reports_reports_status_Status::OK;
+               $value    = 'Element Versioning is in use.';
+               $message  = 'All Configuration options have been set correctly';
+
+               if (!$GLOBALS['TYPO3_CONF_VARS']['BE']['elementVersioningOnly'] || $GLOBALS['TYPO3_CONF_VARS']['BE']['newPagesVersioningType'] != -1) {
+                       $severity = tx_reports_reports_status_Status::WARNING;
+                       $value    = 'System not configured correctly.';
+                       $message  = 'This TYPO3 installation is configured to use Element versioning. Page and Branch versioning are deprecated since TYPO3 4.4.<br />If you are sure that you don\'t use the Workspaces functionality right now (or if you don\'t have any versionized records right now), you can safely change these options in the Install Tool by setting ["BE"]["newPagesVersioningType"] = -1 and ["BE"]["elementVersioningOnly"] = 1 under "All Configuration".';
+               }
+
+               return t3lib_div::makeInstance('tx_reports_reports_status_Status',
+                       'Workspaces: Ensure that Element Versioning is used.',
+                       $value,
+                       $message,
+                       $severity
+               );
+       }
+
+}
+
+if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Reports/StatusProvider.php'])) {
+       include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['ext/workspaces/Classes/Reports/StatusProvider.php']);
+}
+
+?>
index e810a97..f3aa8d3 100644 (file)
@@ -19,7 +19,7 @@
 <div id="typo3-docbody">
 <div id="typo3-inner-docbody">
 
-       <f:renderFlashMessages renderMode="div" />
+       <f:flashMessages renderMode="div" />
 
        <f:render partial="navigation" arguments="{workspaceList: workspaceList, activeWorkspaceUid: activeWorkspaceUid, showAllWorkspaceTab:showAllWorkspaceTab}" />
        <div class="typo3-dyntabmenu-divs"><f:render section="main" /></div>
index f29e097..d3ebb50 100644 (file)
@@ -3,7 +3,7 @@
        <div id="typo3-docbody">
                <div id="typo3-inner-docbody">
 
-                       <f:renderFlashMessages renderMode="div" />
+                       <f:flashMessages renderMode="div" />
 
                        <f:render section="main"/>
                </div>
index 5e7c32a..d7af392 100644 (file)
@@ -1,10 +1,21 @@
 <ul class="x-tab-strip x-tab-strip-top">
        <f:for each="{workspaceList}" as="workspace" key="uid">
-               <li class="{f:if(condition: '{uid}=={activeWorkspaceUid}', then: 'x-tab-strip-active')} x-tab-strip-closable">
-                       <f:link.action controller="Review" action="index" additionalParams="{workspace:uid}" class="x-tab-right">
-                       <em class="x-tab-left"><span class="x-tab-strip-inner"><span class="x-tab-strip-text">{workspace}</span></span></em>
-                       </f:link.action>
-               </li>
+               <f:if condition="{uid}=={activeWorkspaceUid}">
+                       <f:then>
+                               <li class="x-tab-strip-active x-tab-strip-closable">
+                                       <span class="x-tab-right">
+                                               <em class="x-tab-left"><span class="x-tab-strip-inner"><span class="x-tab-strip-text">{workspace}</span></span></em>
+                                       </span>
+                               </li>
+                       </f:then>
+                       <f:else>
+                               <li class="x-tab-strip-closable">
+                                       <f:link.action controller="Review" action="index" additionalParams="{workspace:uid}" class="x-tab-right">
+                                               <em class="x-tab-left"><span class="x-tab-strip-inner"><span class="x-tab-strip-text">{workspace}</span></span></em>
+                                       </f:link.action>
+                               </li>
+                       </f:else>
+               </f:if>
        </f:for>
        <f:if condition="{showAllWorkspaceTab}">
                <li class="last {f:if(condition: '-98=={activeWorkspaceUid}', then: 'x-tab-strip-active')}">
diff --git a/typo3/sysext/workspaces/Resources/Public/Images/workspaces-comments-arrow.gif b/typo3/sysext/workspaces/Resources/Public/Images/workspaces-comments-arrow.gif
new file mode 100644 (file)
index 0000000..a9cd44c
Binary files /dev/null and b/typo3/sysext/workspaces/Resources/Public/Images/workspaces-comments-arrow.gif differ
index 51c6b72..57200bc 100644 (file)
@@ -85,7 +85,10 @@ TYPO3.Workspaces.Actions = {
        },
        generateWorkspacePreviewLink: function() {
                TYPO3.Workspaces.ExtDirectActions.generateWorkspacePreviewLink(TYPO3.settings.Workspaces.id, function(response) {
-                       top.TYPO3.Dialog.InformationDialog({title: TYPO3.lang.previewLink, msg: response});
+                       top.TYPO3.Dialog.InformationDialog({
+                               title: TYPO3.lang.previewLink,
+                               msg: String.format('<a href="{0}" target="_blank">{0}</a>', response)
+                       });
                });
        },
        swapSingleRecord: function(table, t3ver_oid, orig_uid) {
index 81d0904..0628923 100644 (file)
@@ -53,6 +53,19 @@ Ext.override(Ext.grid.GridView, {
        }
 });
 
+/** override mousedown for grid to select checkbox respecting singleSelect */
+Ext.override(Ext.grid.CheckboxSelectionModel, {
+       handleMouseDown: function(g, rowIndex, e) {
+               e.stopEvent();
+               if (this.isSelected(rowIndex)) {
+                       this.deselectRow(rowIndex);
+               } else {
+                       this.selectRow(rowIndex, true);
+                       this.grid.getView().focusRow(rowIndex);
+               }
+       }
+});
+
 TYPO3.Workspaces.SelectionModel = new Ext.grid.CheckboxSelectionModel({
        singleSelect: false,
        hidden: true,
index 7e5ec41..e8d82d7 100644 (file)
@@ -154,6 +154,7 @@ var WorkspaceMenu = Class.create({
 
                        // when in web module reload, otherwise send the user to the web module
                        if (currentModuleLoaded.startsWith('web_')) {
+                               top.TYPO3.Backend.NavigationContainer.PageTree.refreshTree();
                                top.TYPO3.ModuleMenu.App.reloadFrames();
                        } else {
                                if (TYPO3.configuration.pageModule) {
index fc74261..3bed5ff 100644 (file)
@@ -1,82 +1,74 @@
 
 ul.x-tab-strip.x-tab-strip-top {
-       width:100%;
+       width: 100%;
 }
-
 ul.x-tab-strip.x-tab-strip-top li.last {
-       float:right;
+       float: right;
 }
-
 span.item-state-modified {
-       color:#f78f25;
+       color: #f78f25;
 }
-
 span.item-state-moved {
-       color:#457fb8;
+       color: #457fb8;
 }
-
 span.item-state-new {
-       color:#3c9934;
+       color: #3c9934;
 }
-
 span.item-state-hidden {
-       color:#abaaaa;
+       color: #abaaaa;
 }
 span.item-state-deleted {
-       color:#000;
-       text-decoration:line-through;
+       color: #000000;
+       text-decoration: line-through;
 }
 .legend {
-       margin:5px;
-       height:18px;
-       color:#888;
-}
-.legend dd, .legend dt{
-       display:inline;
-       font-size:11px;
-       line-height:13px;
-       overflow:hidden;
+       margin: 5px;
+       height: 18px;
+       color: #888888;
 }
-.legend dt {
-
+.legend dd, .legend dt {
+       display: inline;
+       font-size: 11px;
+       line-height: 13px;
+       overflow: hidden;
 }
 .legend dd span {
-       display:inline-block;
-       padding:4px;
+       display: inline-block;
+       padding: 4px 4px;
 }
 div.typo3-dyntabmenu-divs {
-       border-top:0px none;
-       padding:5px;
-       padding-bottom:10px;
-       overflow:hidden;
+       border-top: 0px none;
+       padding: 5px 5px;
+       padding-bottom: 10px;
+       overflow: hidden;
 }
-
 .x-toolbar {
        background:none !important;
 }
-
 .x-grid3 {
        background: none !important;
 }
-
+.x-grid3-row-expanded {
+       background-color: #ececec;
+}
+.x-grid3-row-selected {
+       color: #4D4D4D;
+}
 a#goPreviewLinkButton {
-       line-height:18px;
-       color:#fff;
+       line-height: 18px;
+       color: #ffffff;
 }
-
 #typo3-mod-php div.typo3-noDoc {
-       margin:0;
+       margin: 0px 0px;
 }
 #typo3-mod-php div.typo3-noDoc #typo3-docbody {
-       padding:0;
-       top:0;
+       padding: 0px 0px;
+       top: 0px;
 }
-
 .icon-hidden {
-       display:none;
-       visibility:hidden;
+       display: none;
+       visibility: hidden;
 }
-
 div.x-grid3-row img.x-action-col-icon {
        display:none;
 }
@@ -86,43 +78,113 @@ div.x-grid3-row:hover img.x-action-col-icon {
 }
 
 div.t3-workspaces-foldoutWrapper {
-       padding:10px;
-       margin-left:40px;
-       background-color:#FFFFFF;
-       background-image:-moz-linear-gradient(center top , #dedede 0px, #FFFFFF 200px);
-       background-repeat:repeat-x;
+       padding: 10px;
+       margin-left: 40px;
+       background-color: #FFFFFF;
+       background-image: -moz-linear-gradient(center top , #ececec 0px, #f7f7f7 200px);
+       background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0, #ececec), color-stop(0.3, #f7f7f7));
+       background-image: linear-gradient(center top, #ececec 0px, #f7f7f7 200px);
+       background-repeat: repeat-x;
+       color: #606060;
+}
+.x-grid3-row-selected div.t3-workspaces-foldoutWrapper {
+       background-image: -moz-linear-gradient(center top , #dedede 0px, #f7f7f7 200px);
+       background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0, #dedede), color-stop(200px, #f7f7f7));
+       background-image: linear-gradient(center top, #dedede 0px, #f7f7f7 200px);
+       background-repeat: repeat-x;
+}
+div.t3-workspaces-foldoutWrapper table {
+       border-collapse: collapse;
+       width: 100%;
+}
+div.t3-workspaces-foldoutWrapper tr.header {
+       background-color: #B5B5B5;
+       background-image: -moz-linear-gradient(center top , #7f7f7f 10%, #5b5b5b 100%);
+       background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(0.1, #7f7f7f), color-stop(1, #5b5b5b));
+       background-image: linear-gradient(center top, #7f7f7f 10%, #5b5b5b 100%);
+       background-repeat: repeat-x;
+}
+div.t3-workspaces-foldoutWrapper tr.header th {
+       padding: 4px 8px;
+       color: #FFFFFF;
+       line-height: 15px;
+}
+
+.t3-workspaces-foldout-subheaderLeft,
+.t3-workspaces-foldout-subheaderRight {
+       padding: 15px 0 10px 0;
+       margin: 10px;
+}
+.t3-workspaces-foldout-td-contentDiffLeft .t3-workspaces-foldout-contentDiff-container,
+.t3-workspaces-foldout-td-contentDiffRight .t3-workspaces-foldout-contentDiff-container {
+       padding-top: 10px;
+       border-top: 1px solid #cdcdcd;
+}
+.x-grid3-row .t3-workspaces-foldout-td-contentDiffLeft,
+.x-grid3-row .t3-workspaces-foldout-subheaderLeft {
+       padding-right: 10px;
+}
+.x-grid3-row .t3-workspaces-foldout-td-contentDiffRight,
+.x-grid3-row .t3-workspaces-foldout-subheaderRight {
+       padding-left: 10px;
+}
+.x-grid3-row .t3-workspaces-foldout-subheaderLeft .t3-workspaces-foldout-subheader-container {
+       padding-bottom: 10px;
+       border-bottom: 1px solid #cdcdcd;
 }
-
-.t3-workspaces-foldout-subheader {
-       padding:3px;
-       border-bottom:1px solid #cdcdcd;
-       margin:10px;
-}
-
 table.t3-workspaces-foldout-contentDiff  {
-       background-color:#fff;
-       padding:8px;
+       padding: 8px 8px;
+       table-layout: auto;
+       background-color: #ffffff;
 }
 table.t3-workspaces-foldout-contentDiff th {
-       width:80px;
+       padding: 8px 0 8px 8px;
+       width: 80px;
+}
+table.t3-workspaces-foldout-contentDiff td {
+       padding: 8px 8px 8px 0;
+       line-height: 1.3em;
+}
+table.t3-workspaces-foldout-contentDiff .diff-r {
+       text-decoration: line-through;
+}
+div.t3-workspaces-foldoutWrapper td.char_select_profile_stats {
+       padding-right: 10px;
 }
 div.t3-workspaces-comments {
-       background-color:#dedede;
-       padding:10px;
+       background-color: #dedede;
+       padding: 10px 10px 10px 10px;
 }
-
 div.t3-workspaces-comments-singleComment {
-       overflow:hidden;
-       margin-bottom:10px;
+       overflow: hidden;
+       margin-bottom: 10px;
+       position: relative;
+}
+div.t3-workspaces-comments-singleComment:last-child {
+       margin: 0;
 }
 div .t3-workspaces-comments-singleComment-author {
-       width:80px;
-       margin:10px;
-       margin-right:0px;
-       float:left;
+       width: 60px;
+       margin: 10px 0;
+       position: absolute;
+       left: 0px;
+       top: 0px;
+       font-weight: bold;
+       overflow: hidden;
+}
+div .t3-workspaces-comments-singleComment-content-wrapper {
+       background: url(../Images/workspaces-comments-arrow) left 10px no-repeat;
+       margin-left: 70px;
+}
+div .t3-workspaces-comments-singleComment-content-date {
+       font-size: 10px;
 }
 div .t3-workspaces-comments-singleComment-content {
-       background-color:white;
-       padding:10px;
-       float:left;
+       background-color: #ffffff;
+       padding: 10px 10px;
+       margin-left: 10px;
+}
+div .t3-workspaces-comments-singleComment-content-title {
+       padding: 8px 0 8px 0;
+       font-weight: bold;
 }
\ No newline at end of file
index 5703940..77cabb1 100644 (file)
@@ -12,6 +12,7 @@ return array(
        'tx_workspaces_extdirect_massactionhandler' => $extensionPath . 'Classes/ExtDirect/MassActionHandler.php',
        'tx_workspaces_extdirect_server' => $extensionPath . 'Classes/ExtDirect/Server.php',
        'tx_workspaces_extdirect_toolbarmenu' => $extensionPath . 'Classes/ExtDirect/ToolbarMenu.php',
+       'tx_workspaces_reports_statusprovider' => $extensionPath . 'Classes/Reports/StatusProvider.php',
        'tx_workspaces_service_autopublish' => $extensionPath . 'Classes/Service/AutoPublish.php',
        'tx_workspaces_service_autopublishtask' => $extensionPath . 'Classes/Service/AutoPublishTask.php',
        'tx_workspaces_service_befunc' => $extensionPath . 'Classes/Service/Befunc.php',
index 10afa7e..e9e7c0c 100644 (file)
@@ -3,7 +3,7 @@
 ########################################################################
 # Extension Manager/Repository config file for ext "workspaces".
 #
-# Auto generated 28-12-2010 15:53
+# Auto generated 12-01-2011 11:33
 #
 # Manual updates:
 # Only the data in the array - everything else is removed by next
@@ -29,7 +29,7 @@ $EM_CONF[$_EXTKEY] = array(
        'clearCacheOnLoad' => 0,
        'lockType' => '',
        'author_company' => '',
-       'version' => '4.5.0',
+       'version' => '4.5.0beta4',
        'constraints' => array(
                'depends' => array(
                        'typo3' => '4.5.0-0.0.0',
@@ -42,7 +42,7 @@ $EM_CONF[$_EXTKEY] = array(
                'suggests' => array(
                ),
        ),
-       '_md5_values_when_last_written' => 'a:82:{s:9:"ChangeLog";s:4:"1611";s:16:"ext_autoload.php";s:4:"2c39";s:12:"ext_icon.gif";s:4:"55bc";s:17:"ext_localconf.php";s:4:"ef02";s:14:"ext_tables.php";s:4:"f565";s:14:"ext_tables.sql";s:4:"d4ef";s:19:"last_synched_target";s:4:"ef91";s:7:"tca.php";s:4:"6a88";s:61:"Classes/BackendUserInterface/WorkspaceSelectorToolbarItem.php";s:4:"4e87";s:41:"Classes/Controller/AbstractController.php";s:4:"c53f";s:40:"Classes/Controller/PreviewController.php";s:4:"21ff";s:39:"Classes/Controller/ReviewController.php";s:4:"2722";s:37:"Classes/ExtDirect/AbstractHandler.php";s:4:"0d8b";s:35:"Classes/ExtDirect/ActionHandler.php";s:4:"3353";s:39:"Classes/ExtDirect/MassActionHandler.php";s:4:"2722";s:28:"Classes/ExtDirect/Server.php";s:4:"3cf0";s:33:"Classes/ExtDirect/ToolbarMenu.php";s:4:"3b94";s:31:"Classes/Service/AutoPublish.php";s:4:"08fb";s:35:"Classes/Service/AutoPublishTask.php";s:4:"b0a9";s:26:"Classes/Service/Befunc.php";s:4:"de67";s:27:"Classes/Service/Fehooks.php";s:4:"92bd";s:28:"Classes/Service/GridData.php";s:4:"41f7";s:26:"Classes/Service/Stages.php";s:4:"d119";s:27:"Classes/Service/Tcemain.php";s:4:"2b7a";s:30:"Classes/Service/Workspaces.php";s:4:"6ca1";s:40:"Resources/Private/Language/locallang.xml";s:4:"505c";s:56:"Resources/Private/Language/locallang_csh_sysws_stage.xml";s:4:"d2f3";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"57f7";s:44:"Resources/Private/Language/locallang_mod.xml";s:4:"9fc7";s:37:"Resources/Private/Layouts/module.html";s:4:"c493";s:36:"Resources/Private/Layouts/nodoc.html";s:4:"b450";s:36:"Resources/Private/Layouts/popup.html";s:4:"d53b";s:38:"Resources/Private/Partials/legend.html";s:4:"246f";s:42:"Resources/Private/Partials/navigation.html";s:4:"46ae";s:45:"Resources/Private/Templates/Preview/Help.html";s:4:"a77a";s:46:"Resources/Private/Templates/Preview/Index.html";s:4:"ff3a";s:48:"Resources/Private/Templates/Preview/NewPage.html";s:4:"6cbc";s:48:"Resources/Private/Templates/Preview/Preview.html";s:4:"1921";s:49:"Resources/Private/Templates/Review/FullIndex.html";s:4:"478e";s:45:"Resources/Private/Templates/Review/Index.html";s:4:"e64a";s:51:"Resources/Private/Templates/Review/SingleIndex.html";s:4:"7b9d";s:30:"Resources/Public/Images/bg.gif";s:4:"916d";s:38:"Resources/Public/Images/moduleicon.gif";s:4:"55bc";s:37:"Resources/Public/Images/slider-bg.png";s:4:"f5e8";s:40:"Resources/Public/Images/slider-thumb.png";s:4:"86d8";s:38:"Resources/Public/Images/typo3-logo.png";s:4:"284a";s:61:"Resources/Public/Images/version-workspace-sendtonextstage.png";s:4:"46fa";s:61:"Resources/Public/Images/version-workspace-sendtoprevstage.png";s:4:"851d";s:63:"Resources/Public/JavaScript/Ext.ux.plugins.TabStripContainer.js";s:4:"d8f2";s:38:"Resources/Public/JavaScript/actions.js";s:4:"2947";s:40:"Resources/Public/JavaScript/component.js";s:4:"62ac";s:44:"Resources/Public/JavaScript/configuration.js";s:4:"2950";s:35:"Resources/Public/JavaScript/grid.js";s:4:"3af8";s:38:"Resources/Public/JavaScript/helpers.js";s:4:"a391";s:38:"Resources/Public/JavaScript/preview.js";s:4:"0583";s:38:"Resources/Public/JavaScript/toolbar.js";s:4:"a1b7";s:44:"Resources/Public/JavaScript/workspacegrid.js";s:4:"0bb3";s:44:"Resources/Public/JavaScript/workspacemenu.js";s:4:"d3e8";s:41:"Resources/Public/JavaScript/workspaces.js";s:4:"4fef";s:54:"Resources/Public/JavaScript/gridfilters/GridFilters.js";s:4:"4b22";s:59:"Resources/Public/JavaScript/gridfilters/css/GridFilters.css";s:4:"84a8";s:57:"Resources/Public/JavaScript/gridfilters/css/RangeMenu.css";s:4:"745a";s:63:"Resources/Public/JavaScript/gridfilters/filter/BooleanFilter.js";s:4:"3c02";s:60:"Resources/Public/JavaScript/gridfilters/filter/DateFilter.js";s:4:"c80d";s:56:"Resources/Public/JavaScript/gridfilters/filter/Filter.js";s:4:"583f";s:60:"Resources/Public/JavaScript/gridfilters/filter/ListFilter.js";s:4:"9554";s:63:"Resources/Public/JavaScript/gridfilters/filter/NumericFilter.js";s:4:"91a2";s:62:"Resources/Public/JavaScript/gridfilters/filter/StringFilter.js";s:4:"acc8";s:57:"Resources/Public/JavaScript/gridfilters/images/equals.png";s:4:"87b7";s:55:"Resources/Public/JavaScript/gridfilters/images/find.png";s:4:"9f1c";s:63:"Resources/Public/JavaScript/gridfilters/images/greater_than.png";s:4:"746c";s:60:"Resources/Public/JavaScript/gridfilters/images/less_than.png";s:4:"2fb7";s:68:"Resources/Public/JavaScript/gridfilters/images/sort_filtered_asc.gif";s:4:"9e7a";s:69:"Resources/Public/JavaScript/gridfilters/images/sort_filtered_desc.gif";s:4:"6d59";s:56:"Resources/Public/JavaScript/gridfilters/menu/ListMenu.js";s:4:"d14b";s:57:"Resources/Public/JavaScript/gridfilters/menu/RangeMenu.js";s:4:"0bbd";s:38:"Resources/Public/StyleSheet/module.css";s:4:"b609";s:39:"Resources/Public/StyleSheet/preview.css";s:4:"be3b";s:31:"Tests/Service/WorkspaceTest.php";s:4:"edc8";s:41:"Tests/Service/fixtures/dbDefaultPages.xml";s:4:"a86b";s:46:"Tests/Service/fixtures/dbDefaultWorkspaces.xml";s:4:"32a7";s:41:"Tests/Service/fixtures/dbMovedContent.xml";s:4:"dd73";}',
+       '_md5_values_when_last_written' => 'a:83:{s:9:"ChangeLog";s:4:"278b";s:16:"ext_autoload.php";s:4:"678b";s:12:"ext_icon.gif";s:4:"55bc";s:17:"ext_localconf.php";s:4:"ef02";s:14:"ext_tables.php";s:4:"e640";s:14:"ext_tables.sql";s:4:"d4ef";s:7:"tca.php";s:4:"6a88";s:61:"Classes/BackendUserInterface/WorkspaceSelectorToolbarItem.php";s:4:"4e87";s:41:"Classes/Controller/AbstractController.php";s:4:"c53f";s:40:"Classes/Controller/PreviewController.php";s:4:"21ff";s:39:"Classes/Controller/ReviewController.php";s:4:"2722";s:37:"Classes/ExtDirect/AbstractHandler.php";s:4:"0d8b";s:35:"Classes/ExtDirect/ActionHandler.php";s:4:"3353";s:39:"Classes/ExtDirect/MassActionHandler.php";s:4:"2722";s:28:"Classes/ExtDirect/Server.php";s:4:"3cf0";s:33:"Classes/ExtDirect/ToolbarMenu.php";s:4:"3b94";s:34:"Classes/Reports/StatusProvider.php";s:4:"5708";s:31:"Classes/Service/AutoPublish.php";s:4:"08fb";s:35:"Classes/Service/AutoPublishTask.php";s:4:"b0a9";s:26:"Classes/Service/Befunc.php";s:4:"de67";s:27:"Classes/Service/Fehooks.php";s:4:"92bd";s:28:"Classes/Service/GridData.php";s:4:"41f7";s:26:"Classes/Service/Stages.php";s:4:"d119";s:27:"Classes/Service/Tcemain.php";s:4:"2b7a";s:30:"Classes/Service/Workspaces.php";s:4:"6ca1";s:40:"Resources/Private/Language/locallang.xml";s:4:"505c";s:56:"Resources/Private/Language/locallang_csh_sysws_stage.xml";s:4:"d2f3";s:43:"Resources/Private/Language/locallang_db.xml";s:4:"57f7";s:44:"Resources/Private/Language/locallang_mod.xml";s:4:"9fc7";s:37:"Resources/Private/Layouts/module.html";s:4:"bbcf";s:36:"Resources/Private/Layouts/nodoc.html";s:4:"a3ce";s:36:"Resources/Private/Layouts/popup.html";s:4:"d53b";s:38:"Resources/Private/Partials/legend.html";s:4:"246f";s:42:"Resources/Private/Partials/navigation.html";s:4:"b186";s:45:"Resources/Private/Templates/Preview/Help.html";s:4:"a77a";s:46:"Resources/Private/Templates/Preview/Index.html";s:4:"ff3a";s:48:"Resources/Private/Templates/Preview/NewPage.html";s:4:"6cbc";s:48:"Resources/Private/Templates/Preview/Preview.html";s:4:"1921";s:49:"Resources/Private/Templates/Review/FullIndex.html";s:4:"478e";s:45:"Resources/Private/Templates/Review/Index.html";s:4:"e64a";s:51:"Resources/Private/Templates/Review/SingleIndex.html";s:4:"7b9d";s:30:"Resources/Public/Images/bg.gif";s:4:"916d";s:38:"Resources/Public/Images/moduleicon.gif";s:4:"55bc";s:37:"Resources/Public/Images/slider-bg.png";s:4:"f5e8";s:40:"Resources/Public/Images/slider-thumb.png";s:4:"86d8";s:38:"Resources/Public/Images/typo3-logo.png";s:4:"284a";s:61:"Resources/Public/Images/version-workspace-sendtonextstage.png";s:4:"46fa";s:61:"Resources/Public/Images/version-workspace-sendtoprevstage.png";s:4:"851d";s:53:"Resources/Public/Images/workspaces-comments-arrow.gif";s:4:"2423";s:63:"Resources/Public/JavaScript/Ext.ux.plugins.TabStripContainer.js";s:4:"d8f2";s:38:"Resources/Public/JavaScript/actions.js";s:4:"274f";s:40:"Resources/Public/JavaScript/component.js";s:4:"62ac";s:44:"Resources/Public/JavaScript/configuration.js";s:4:"2950";s:35:"Resources/Public/JavaScript/grid.js";s:4:"cbce";s:38:"Resources/Public/JavaScript/helpers.js";s:4:"a391";s:38:"Resources/Public/JavaScript/preview.js";s:4:"0583";s:38:"Resources/Public/JavaScript/toolbar.js";s:4:"a1b7";s:44:"Resources/Public/JavaScript/workspacegrid.js";s:4:"0bb3";s:44:"Resources/Public/JavaScript/workspacemenu.js";s:4:"d47b";s:41:"Resources/Public/JavaScript/workspaces.js";s:4:"4fef";s:54:"Resources/Public/JavaScript/gridfilters/GridFilters.js";s:4:"4b22";s:59:"Resources/Public/JavaScript/gridfilters/css/GridFilters.css";s:4:"84a8";s:57:"Resources/Public/JavaScript/gridfilters/css/RangeMenu.css";s:4:"745a";s:63:"Resources/Public/JavaScript/gridfilters/filter/BooleanFilter.js";s:4:"3c02";s:60:"Resources/Public/JavaScript/gridfilters/filter/DateFilter.js";s:4:"c80d";s:56:"Resources/Public/JavaScript/gridfilters/filter/Filter.js";s:4:"583f";s:60:"Resources/Public/JavaScript/gridfilters/filter/ListFilter.js";s:4:"9554";s:63:"Resources/Public/JavaScript/gridfilters/filter/NumericFilter.js";s:4:"91a2";s:62:"Resources/Public/JavaScript/gridfilters/filter/StringFilter.js";s:4:"acc8";s:57:"Resources/Public/JavaScript/gridfilters/images/equals.png";s:4:"87b7";s:55:"Resources/Public/JavaScript/gridfilters/images/find.png";s:4:"9f1c";s:63:"Resources/Public/JavaScript/gridfilters/images/greater_than.png";s:4:"746c";s:60:"Resources/Public/JavaScript/gridfilters/images/less_than.png";s:4:"2fb7";s:68:"Resources/Public/JavaScript/gridfilters/images/sort_filtered_asc.gif";s:4:"9e7a";s:69:"Resources/Public/JavaScript/gridfilters/images/sort_filtered_desc.gif";s:4:"6d59";s:56:"Resources/Public/JavaScript/gridfilters/menu/ListMenu.js";s:4:"d14b";s:57:"Resources/Public/JavaScript/gridfilters/menu/RangeMenu.js";s:4:"0bbd";s:38:"Resources/Public/StyleSheet/module.css";s:4:"ed43";s:39:"Resources/Public/StyleSheet/preview.css";s:4:"be3b";s:31:"Tests/Service/WorkspaceTest.php";s:4:"edc8";s:41:"Tests/Service/fixtures/dbDefaultPages.xml";s:4:"a86b";s:46:"Tests/Service/fixtures/dbDefaultWorkspaces.xml";s:4:"32a7";s:41:"Tests/Service/fixtures/dbMovedContent.xml";s:4:"dd73";}',
        'suggests' => array(
        ),
 );
index 1940c78..201c798 100644 (file)
@@ -2,8 +2,8 @@
 if (!defined ('TYPO3_MODE')) {
        die ('Access denied.');
 }
-
-if (TYPO3_MODE == 'BE') {
+       // avoid that this block is loaded in the frontend or within the upgrade-wizards 
+if (TYPO3_MODE == 'BE' && PATH_typo3_mod != 'install/') {
        /**
        * Registers a Backend Module
        */
@@ -30,6 +30,11 @@ if (TYPO3_MODE == 'BE') {
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Workspaces.ExtDirectActions'] = t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/ActionHandler.php:tx_Workspaces_ExtDirect_ActionHandler';
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Workspaces.ExtDirectMassActions'] = t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/MassActionHandler.php:tx_Workspaces_ExtDirect_MassActionHandler';
        $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ExtDirect']['TYPO3.Ajax.ExtDirect.ToolbarMenu'] = t3lib_extMgm::extPath($_EXTKEY) . 'Classes/ExtDirect/ToolbarMenu.php:tx_Workspaces_ExtDirect_ToolbarMenu';
+
+               // register the reports statusprovider
+       $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['reports']['tx_reports']['status']['providers']['Configuration'][] = 'Tx_Workspaces_Reports_StatusProvider';
+
+
 }
 
 /**
index 43692f6..c6055bb 100644 (file)
@@ -1 +1 @@
-https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/workspaces/tags/4.5.0beta3b
+https://svn.typo3.org/TYPO3v4/CoreProjects/workspaces/workspaces/tags/4.5.0beta4