Commit 0a4bebc3 authored by Christian Kuhn's avatar Christian Kuhn Committed by Anja Leichsenring
Browse files

[TASK] Extract "taskcenter" and "sys_action" to TER/composer

This is the last round of planned extension extractions
from the main core repository.

Both the extensions 'taskcenter' and its add-on extension
'sys_action' did not receive much love over the years. They
are rarely used and their approach is clumsy to say the least.

They are both dropped from main core repository with core v10
now. A fresh approach for a cool new dashboard is in the works
already that may eventually find its way into the core later.

The patch removes both extensions with have been released as
'taskcenter' and 'sys_action' to TER and as
'friendsoftypo3/taskcenter' and 'friendsoftypo3/sys_action'
to composer.

Extension 'impexp' registered a task for the taskcenter which
is now within 'taskcenter' directly.

Resolves: #87499
Releases: master
Change-Id: I86e0292f13247bbd1f2060214f4f6d8e2aefe6c0
Reviewed-on: https://review.typo3.org/59502


Tested-by: default avatarTYPO3com <noreply@typo3.com>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring's avatarAnja Leichsenring <aleichsenring@ab-softlab.de>
parent 4417dc89
......@@ -352,10 +352,6 @@ module.exports = function (grunt) {
dest: '<%= paths.sysext %>setup/Resources/Public/Icons/module-setup.svg',
src: '<%= paths.t3icons %>module/module-setup.svg'
},
{
dest: '<%= paths.sysext %>taskcenter/Resources/Public/Icons/module-taskcenter.svg',
src: '<%= paths.t3icons %>module/module-taskcenter.svg'
},
{
dest: '<%= paths.sysext %>tstemplate/Resources/Public/Icons/module-tstemplate.svg',
src: '<%= paths.t3icons %>module/module-tstemplate.svg'
......
......@@ -88,18 +88,10 @@
"../typo3/sysext/scheduler/Resources/Public/JavaScript/*",
"../typo3/sysext/scheduler/Resources/Private/TypeScript/*"
],
"TYPO3/CMS/SysAction/*": [
"../typo3/sysext/sys_action/Resources/Public/JavaScript/*",
"../typo3/sysext/sys_action/Resources/Private/TypeScript/*"
],
"TYPO3/CMS/T3editor/*": [
"../typo3/sysext/t3editor/Resources/Public/JavaScript/*",
"../typo3/sysext/t3editor/Resources/Private/TypeScript/*"
],
"TYPO3/CMS/Taskcenter/*": [
"../typo3/sysext/taskcenter/Resources/Public/JavaScript/*",
"../typo3/sysext/taskcenter/Resources/Private/TypeScript/*"
],
"TYPO3/CMS/Tstemplate/*": [
"../typo3/sysext/tstemplate/Resources/Public/JavaScript/*",
"../typo3/sysext/tstemplate/Resources/Private/TypeScript/*"
......
......@@ -145,10 +145,8 @@
"typo3/cms-scheduler": "self.version",
"typo3/cms-seo": "self.version",
"typo3/cms-setup": "self.version",
"typo3/cms-sys-action": "self.version",
"typo3/cms-sys-note": "self.version",
"typo3/cms-t3editor": "self.version",
"typo3/cms-taskcenter": "self.version",
"typo3/cms-tstemplate": "self.version",
"typo3/cms-viewpage": "self.version",
"typo3/cms-workspaces": "self.version"
......@@ -184,10 +182,8 @@
"TYPO3\\CMS\\Scheduler\\": "typo3/sysext/scheduler/Classes/",
"TYPO3\\CMS\\Seo\\": "typo3/sysext/seo/Classes/",
"TYPO3\\CMS\\Setup\\": "typo3/sysext/setup/Classes/",
"TYPO3\\CMS\\SysAction\\": "typo3/sysext/sys_action/Classes/",
"TYPO3\\CMS\\SysNote\\": "typo3/sysext/sys_note/Classes/",
"TYPO3\\CMS\\T3editor\\": "typo3/sysext/t3editor/Classes/",
"TYPO3\\CMS\\Taskcenter\\": "typo3/sysext/taskcenter/Classes/",
"TYPO3\\CMS\\Tstemplate\\": "typo3/sysext/tstemplate/Classes/",
"TYPO3\\CMS\\Viewpage\\": "typo3/sysext/viewpage/Classes/",
"TYPO3\\CMS\\Workspaces\\": "typo3/sysext/workspaces/Classes/"
......@@ -226,7 +222,6 @@
"TYPO3\\CMS\\Scheduler\\Tests\\": "typo3/sysext/scheduler/Tests/",
"TYPO3\\CMS\\Seo\\Tests\\": "typo3/sysext/seo/Tests/",
"TYPO3\\CMS\\Setup\\Tests\\": "typo3/sysext/setup/Tests/",
"TYPO3\\CMS\\SysAction\\Tests\\": "typo3/sysext/sys_action/Tests/",
"TYPO3\\CMS\\SysNote\\Tests\\": "typo3/sysext/sys_note/Tests/",
"TYPO3\\CMS\\Workspaces\\Tests\\": "typo3/sysext/workspaces/Tests/",
"TYPO3\\CMS\\Recycler\\Tests\\": "typo3/sysext/recycler/Tests/",
......
......@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "407b2339e5d199266689061eda7ac8a4",
"content-hash": "0ccb2f77366c2d29e6984218945f7a69",
"packages": [
{
"name": "cogpowered/finediff",
......
......@@ -1361,6 +1361,7 @@ The following features have been removed:
users need their password being manually recovered or reset.
* Extension :php:`rsaauth` has been dropped from core
* Extension :php:`feedit` has been dropped from core
* The extension :php:`taskcenter` and its add-on extension :php:`sys_action` have been dropped from core
* Translation :php:`locallang` references :php:`EXT:lang` to removed extension "lang" do not work any longer
......
<?php
namespace TYPO3\CMS\Impexp\Task;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Database\ConnectionPool;
use TYPO3\CMS\Core\Messaging\FlashMessage;
use TYPO3\CMS\Core\Messaging\FlashMessageService;
use TYPO3\CMS\Core\Resource\Exception;
use TYPO3\CMS\Core\Type\Bitmask\Permission;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Taskcenter\Controller\TaskModuleController;
use TYPO3\CMS\Taskcenter\TaskInterface;
/**
* This class provides a textarea to save personal notes
* @internal this is a internal TYPO3 Backend implementation and solely used for EXT:impexp and not part of TYPO3's Core API.
*/
class ImportExportTask implements TaskInterface
{
/**
* Back-reference to the calling reports module
*
* @var TaskModuleController $taskObject
*/
protected $taskObject;
/**
* URL to task module
*
* @var string
*/
protected $moduleUrl;
/**
* Constructor
*
* @param TaskModuleController $taskObject
*/
public function __construct(TaskModuleController $taskObject)
{
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
$this->moduleUrl = (string)$uriBuilder->buildUriFromRoute('user_task');
$this->taskObject = $taskObject;
$this->getLanguageService()->includeLLFile('EXT:impexp/Resources/Private/Language/locallang_csh.xlf');
}
/**
* This method renders the report
*
* @return string The status report as HTML
*/
public function getTask()
{
return $this->main();
}
/**
* Render an optional additional information for the 1st view in taskcenter.
* Empty for this task
*
* @return string Overview as HTML
*/
public function getOverview()
{
return '';
}
/**
* Main Task center module
*
* @return string HTML content.
*/
public function main()
{
$content = '';
$id = (int)GeneralUtility::_GP('display');
/** @var \TYPO3\CMS\Backend\Routing\UriBuilder $uriBuilder */
$uriBuilder = GeneralUtility::makeInstance(\TYPO3\CMS\Backend\Routing\UriBuilder::class);
// If a preset is found, it is rendered using an iframe
if ($id > 0) {
$url = (string)$uriBuilder->buildUriFromRoute(
'xMOD_tximpexp',
[
'tx_impexp[action]' => 'export',
'preset[load]' => 1,
'preset[select]' => $id,
'returnUrl' => $this->moduleUrl
]
);
\TYPO3\CMS\Core\Utility\HttpUtility::redirect($url);
} else {
// Header
$lang = $this->getLanguageService();
$content .= $this->taskObject->description($lang->getLL('.alttitle'), $lang->getLL('.description'));
$clause = $this->getBackendUser()->getPagePermsClause(Permission::PAGE_SHOW);
$usernames = BackendUtility::getUserNames();
// Create preset links:
$presets = $this->getPresets();
// If any presets found
if (is_array($presets) && !empty($presets)) {
$lines = [];
foreach ($presets as $key => $presetCfg) {
$configuration = unserialize($presetCfg['preset_data'], ['allowed_classes' => false]);
$title = strlen($presetCfg['title']) ? $presetCfg['title'] : '[' . $presetCfg['uid'] . ']';
$icon = 'EXT:impexp/Resources/Public/Images/export.gif';
$description = [];
// Is public?
if ($presetCfg['public']) {
$description[] = $lang->getLL('task.public') . ': ' . $lang->sL('LLL:EXT:core/Resources/Private/Language/locallang_common.xlf:yes');
}
// Owner
$description[] = $lang->getLL('task.owner') . ': '
. (
$presetCfg['user_uid'] === $GLOBALS['BE_USER']->user['uid']
? $lang->getLL('task.own')
: '[' . htmlspecialchars($usernames[$presetCfg['user_uid']]['username']) . ']'
);
// Page & path
if ($configuration['pagetree']['id']) {
$description[] = $lang->getLL('task.page') . ': ' . $configuration['pagetree']['id'];
$description[] = $lang->getLL('task.path') . ': ' . htmlspecialchars(
BackendUtility::getRecordPath($configuration['pagetree']['id'], $clause, 20)
);
} else {
$description[] = $lang->getLL('single-record');
}
// Meta information
if ($configuration['meta']['title'] || $configuration['meta']['description'] || $configuration['meta']['notes']) {
$metaInformation = '';
if ($configuration['meta']['title']) {
$metaInformation .= '<strong>' . htmlspecialchars($configuration['meta']['title']) . '</strong><br />';
}
if ($configuration['meta']['description']) {
$metaInformation .= htmlspecialchars($configuration['meta']['description']);
}
if ($configuration['meta']['notes']) {
$metaInformation .= '<br /><br />
<strong>' . $lang->getLL('notes') . ': </strong>
<em>' . htmlspecialchars($configuration['meta']['notes']) . '</em>';
}
$description[] = '<br />' . $metaInformation;
}
// Collect all preset information
$lines[$key] = [
'uid' => 'impexp' . $key,
'icon' => $icon,
'title' => $title,
'descriptionHtml' => implode('<br />', $description),
'link' => (string)$uriBuilder->buildUriFromRoute('user_task') . '&SET[function]=impexp.TYPO3\\CMS\\Impexp\\Task\\ImportExportTask&display=' . $presetCfg['uid']
];
}
// Render preset list
$content .= $this->taskObject->renderListMenu($lines);
} else {
// No presets found
$flashMessage = GeneralUtility::makeInstance(
FlashMessage::class,
$lang->getLL('no-presets'),
$lang->getLL('.alttitle'),
FlashMessage::NOTICE
);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageService $flashMessageService */
$flashMessageService = GeneralUtility::makeInstance(FlashMessageService::class);
/** @var \TYPO3\CMS\Core\Messaging\FlashMessageQueue $defaultFlashMessageQueue */
$defaultFlashMessageQueue = $flashMessageService->getMessageQueueByIdentifier();
$defaultFlashMessageQueue->enqueue($flashMessage);
}
}
return $content;
}
/**
* Select presets for this user
*
* @return array|bool Array of preset records
*/
protected function getPresets()
{
$queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
->getQueryBuilderForTable('tx_impexp_presets');
return $queryBuilder->select('*')
->from('tx_impexp_presets')
->where(
$queryBuilder->expr()->orX(
$queryBuilder->expr()->gt(
'public',
$queryBuilder->createNamedParameter(0, \PDO::PARAM_INT)
),
$queryBuilder->expr()->eq(
'user_uid',
$queryBuilder->createNamedParameter($this->getBackendUser()->user['uid'], \PDO::PARAM_INT)
)
)
)
->orderBy('item_uid', 'DESC')
->addOrderBy('title')
->execute()
->fetchAll();
}
/**
* Returns a \TYPO3\CMS\Core\Resource\Folder object for saving export files
* to the server and is also used for uploading import files.
*
* @throws \InvalidArgumentException
* @return \TYPO3\CMS\Core\Resource\Folder|null
*/
protected function getDefaultImportExportFolder()
{
$defaultImportExportFolder = null;
$defaultTemporaryFolder = $this->getBackendUser()->getDefaultUploadTemporaryFolder();
if ($defaultTemporaryFolder !== null) {
$importExportFolderName = 'importexport';
$createFolder = !$defaultTemporaryFolder->hasFolder($importExportFolderName);
if ($createFolder === true) {
try {
$defaultImportExportFolder = $defaultTemporaryFolder->createFolder($importExportFolderName);
} catch (Exception $folderAccessException) {
}
} else {
$defaultImportExportFolder = $defaultTemporaryFolder->getSubfolder($importExportFolderName);
}
}
return $defaultImportExportFolder;
}
/**
* @return \TYPO3\CMS\Core\Authentication\BackendUserAuthentication
*/
protected function getBackendUser()
{
return $GLOBALS['BE_USER'];
}
/**
* @return mixed
*/
protected function getLanguageService()
{
return $GLOBALS['LANG'];
}
}
......@@ -216,8 +216,7 @@ To save a preset, simply enter a title in the title box and press "Save". This w
To delete old presets, simply select it and press "Delete".
The checkbox "Public" can be set if you want to share your preset with other users of the system. Otherwise they are personal to you.
In the Taskcenter you can see a list of your presets and jump directly to them.</source>
</source>
</trans-unit>
<trans-unit id="_presets.image" xml:space="preserve">
<source>EXT:impexp/Resources/Public/Images/cshimages/impexp_misc1.png,
......@@ -225,8 +224,7 @@ EXT:impexp/Resources/Public/Images/cshimages/impexp_misc2.png</source>
<note from="developer">This string contains an internal text, which must not be changed. Just copy the original text into the translation field. For more information have a look at the Tutorial.</note>
</trans-unit>
<trans-unit id="presets.image_descr" xml:space="preserve">
<source>The preset selector in the export interface.
Presets from the task center.</source>
<source>The preset selector in the export interface.</source>
</trans-unit>
<trans-unit id="metadata.alttitle">
<source>Meta data setting</source>
......@@ -371,39 +369,6 @@ Before importing make sure you change any editable soft references that are show
<trans-unit id="upload.details">
<source>Notice that there are usually limits set by the server (PHP) to the size of uploaded files. If hit, upload fails and an error message is shown.</source>
</trans-unit>
<trans-unit id="task.title">
<source>Preset title</source>
</trans-unit>
<trans-unit id="task.icon">
<source>Icon</source>
</trans-unit>
<trans-unit id="task.public">
<source>Public</source>
</trans-unit>
<trans-unit id="task.owner">
<source>Owner</source>
</trans-unit>
<trans-unit id="task.page">
<source>Page</source>
</trans-unit>
<trans-unit id="task.path">
<source>Path</source>
</trans-unit>
<trans-unit id="task.meta">
<source>Meta data</source>
</trans-unit>
<trans-unit id="task.own">
<source>Own</source>
</trans-unit>
<trans-unit id="notes">
<source>Notes</source>
</trans-unit>
<trans-unit id="single-record">
<source>Single record</source>
</trans-unit>
<trans-unit id="no-presets">
<source>No presets found!</source>
</trans-unit>
</body>
</file>
</xliff>
......@@ -2,9 +2,4 @@
defined('TYPO3_MODE') or die();
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/backend.php']['constructPostProcess'][] = \TYPO3\CMS\Impexp\Hook\BackendControllerHook::class . '->addJavaScript';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['taskcenter']['impexp'][\TYPO3\CMS\Impexp\Task\ImportExportTask::class] = [
'title' => 'LLL:EXT:impexp/Resources/Private/Language/locallang_csh.xlf:.alttitle',
'description' => 'LLL:EXT:impexp/Resources/Private/Language/locallang_csh.xlf:.description',
'icon' => 'EXT:impexp/Resources/Public/Images/export.gif'
];
$GLOBALS['TYPO3_CONF_VARS']['BE']['ContextMenu']['ItemProviders'][1486418735] = \TYPO3\CMS\Impexp\ContextMenu\ItemProvider::class;
<?php
namespace TYPO3\CMS\Install\Updates;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* Installs and downloads EXT:sys_action if requested
* @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
*/
class SysActionExtractionUpdate extends AbstractDownloadExtensionUpdate
{
/**
* @var \TYPO3\CMS\Install\Updates\ExtensionModel
*/
protected $extension;
/**
* @var \TYPO3\CMS\Install\Updates\Confirmation
*/
protected $confirmation;
public function __construct()
{
$this->extension = new ExtensionModel(
'sys_action',
'Deprecated sys_action extension',
'10.0.0',
'friendsoftypo3/sys-action',
'Allows running configured admin tasks in the taskcenter'
);
$this->confirmation = new Confirmation(
'Are you sure?',
'This extension has not been used very often and is only useful if properly configured and in combination with the "taskcenter" extension. ' . $this->extension->getDescription(),
false
);
}
/**
* Return a confirmation message instance
*
* @return \TYPO3\CMS\Install\Updates\Confirmation
*/
public function getConfirmation(): Confirmation
{
return $this->confirmation;
}
/**
* Return the identifier for this wizard
* This should be the same string as used in the ext_localconf class registration
*
* @return string
*/
public function getIdentifier(): string
{
return 'sysActionExtension';
}
/**
* Return the speaking name of this wizard
*
* @return string
*/
public function getTitle(): string
{
return 'Install extension "sys_action" from TER';
}
/**
* Return the description for this wizard
*
* @return string
*/
public function getDescription(): string
{
return 'The extension "sys_action" adds functionality to make certain Backend admin tasks'
. ' available for non-admin users. Extension "taskcenter" must be loaded to use this upgrade wizard.';
}
/**
* Is an update necessary?
* Is used to determine whether a wizard needs to be run.
*
* @return bool
*/
public function updateNecessary(): bool
{
return !ExtensionManagementUtility::isLoaded('sys_action');
}
/**
* Returns an array of class names of Prerequisite classes
* This way a wizard can define dependencies like "database up-to-date" or
* "reference index updated"
*
* @return string[]
*/
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class
];
}
}
<?php
namespace TYPO3\CMS\Install\Updates;
/*
* This file is part of the TYPO3 CMS project.
*
* It is free software; you can redistribute it and/or modify it under
* the terms of the GNU General Public License, either version 2
* of the License, or any later version.
*
* For the full copyright and license information, please read the
* LICENSE.txt file that was distributed with this source code.
*
* The TYPO3 project - inspiring people to share!
*/
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
/**
* Installs and downloads EXT:taskcenter if requested
* @internal This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
*/
class TaskcenterExtractionUpdate extends AbstractDownloadExtensionUpdate
{
/**
* @var \TYPO3\CMS\Install\Updates\ExtensionModel
*/
protected $extension;
/**
* @var \TYPO3\CMS\Install\Updates\Confirmation
*/
protected $confirmation;
public function __construct()
{
$this->extension = new ExtensionModel(
'taskcenter',
'Deprecated taskcenter extension',
'10.0.0',
'friendsoftypo3/taskcenter',
'Contains a framework to show and execute registered tasks.'
);
$this->confirmation = new Confirmation(
'Are you sure?',
'This extension has not been used very often and is only useful together with other extensions like sys_action. ' . $this->extension->getDescription(),
false
);
}
/**
* Return a confirmation message instance
*
* @return \TYPO3\CMS\Install\Updates\Confirmation
*/
public function getConfirmation(): Confirmation
{
return $this->confirmation;
}