Commit 47805b2a authored by Thomas Löffler's avatar Thomas Löffler

Merge branch '257-add-transfer-user-to-ldap-button-in-fe_user-list' into 'develop'

Resolve "Add transfer user to LDAP button in fe_user List"

Closes #257

See merge request !121
parents 5571bc95 94555003
Pipeline #6304 failed with stages
in 17 seconds
<?php
namespace T3o\T3omy\Hooks;
/***************************************************************
* Copyright notice
*
* (c) 2018 in2code.de and the following authors:
* Stefan Busemann
*
* 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 3 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.
*
* 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!
***************************************************************/
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Extbase\SignalSlot\Dispatcher;
use TYPO3\CMS\Recordlist\RecordList\RecordListHookInterface;
/**
* Class RecordListWorkflowButton
*/
class RecordListWorkflowFeUsers implements RecordListHookInterface
{
/**
* @var IconFactory
*/
protected $iconFactory;
/**
* RecordListWorkflowButton constructor.
*/
public function __construct()
{
$this->iconFactory = GeneralUtility::makeInstance(IconFactory::class);
$this->signalSlotDispatcher = GeneralUtility::makeInstance(Dispatcher::class);
}
/**
* @param string $table
* @param array $row
* @param array $cells
* @param object $parentObject
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function makeClip($table, $row, $cells, &$parentObject)
{
return $cells;
}
/**
* @param string $table
* @param array $row
* @param array $cells
* @param object $parentObject
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function makeControl($table, $row, $cells, &$parentObject)
{
if ($table === 'fe_users') {
$buttons = [];
$buttons['workflow'] = $this->getWorkflowButton($row);
$cells['primary'] = $buttons + $cells['primary'];
}
return $cells;
}
/**
* @return string
*/
protected function getWorkflowButton($row)
{
$urlParameters = [
'web_list' => [
'uid' => $row['uid'],
'table' => 'feusers',
'command' => 'LDAP',
],
'id' => $row['pid']
];
$href = BackendUtility::getModuleUrl('web_list', $urlParameters);
$class = 'btn btn-default';
return '<a class="' . $class . '" href="' . $href . '">'
. 'Transfer to LDAP'
. '</a>';
}
/**
* @param string $table
* @param array $currentIdList
* @param array $headerColumns
* @param object $parentObject
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function renderListHeader($table, $currentIdList, $headerColumns, &$parentObject)
{
return $headerColumns;
}
/**
* @param string $table
* @param array $currentIdList
* @param array $cells
* @param object $parentObject
*
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function renderListHeaderActions($table, $currentIdList, $cells, &$parentObject)
{
return $cells;
}
}
......@@ -97,6 +97,7 @@ class RecordListWorkflowOldUsers implements RecordListHookInterface
'web_list' => [
'uid' => $row['uid'],
'table' => 'old_users',
'command' => 'recoverOldUser'
],
];
......
......@@ -29,5 +29,5 @@ $EM_CONF[$_EXTKEY] = [
'author' => 'Stefan Busemann',
'author_email' => 'stefan.busemann@typo3.org',
'author_company' => 'typo3',
'version' => '1.0.0',
'version' => '1.1.0',
];
......@@ -26,6 +26,7 @@ $iconRegistry->registerIcon(
);
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'][1505827875] = T3o\T3omy\Hooks\RecordListWorkflowOldUsers::class;
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/class.db_list_extra.inc']['actions'][1505828875] = T3o\T3omy\Hooks\RecordListWorkflowFeUsers::class;
/**
* Disable non needed fields in tt_content
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment