1
|
|
|
<?php |
2
|
|
|
namespace Aoe\AoeDbSequenzer\Form; |
3
|
|
|
|
4
|
|
|
/*************************************************************** |
5
|
|
|
* Copyright notice |
6
|
|
|
* |
7
|
|
|
* (c) 2017 AOE GmbH ([email protected]) |
8
|
|
|
* All rights reserved |
9
|
|
|
* |
10
|
|
|
* This script is part of the TYPO3 project. The TYPO3 project is |
11
|
|
|
* free software; you can redistribute it and/or modify |
12
|
|
|
* it under the terms of the GNU General Public License as published by |
13
|
|
|
* the Free Software Foundation; either version 2 of the License, or |
14
|
|
|
* (at your option) any later version. |
15
|
|
|
* |
16
|
|
|
* The GNU General Public License can be found at |
17
|
|
|
* http://www.gnu.org/copyleft/gpl.html. |
18
|
|
|
* |
19
|
|
|
* This script is distributed in the hope that it will be useful, |
20
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
21
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
22
|
|
|
* GNU General Public License for more details. |
23
|
|
|
* |
24
|
|
|
* This copyright notice MUST APPEAR in all copies of the script! |
25
|
|
|
***************************************************************/ |
26
|
|
|
|
27
|
|
|
use Aoe\AoeDbSequenzer\Service\OverwriteProtectionService; |
28
|
|
|
use TYPO3\CMS\Backend\Form\Element\InputTextElement; |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @package Aoe\AoeDbSequenzer\Form |
32
|
|
|
*/ |
33
|
|
|
class OverwriteTillElement extends AbstractOverwriteElement |
34
|
|
|
{ |
35
|
|
|
/** |
36
|
|
|
* @param array $PA |
37
|
|
|
* @return String |
38
|
|
|
*/ |
39
|
|
|
public function render(array $PA) |
40
|
|
|
{ |
41
|
|
|
$itemFormElValue = ''; |
42
|
|
|
if ($this->hasOverwriteProtection($PA['row']['uid'], $PA['table'])) { |
43
|
|
|
$overwriteProtection = $this->getOverwriteProtection($PA['row']['uid'], $PA['table']); |
44
|
|
|
$itemFormElValue = $overwriteProtection->getProtectedTime(); |
45
|
|
|
} |
46
|
|
|
|
47
|
|
|
$data = [ |
48
|
|
|
'parameterArray' => [ |
49
|
|
|
'itemFormElName' => 'data[' . $PA['table'] . '][' . $PA['row']['uid'] . ']['.OverwriteProtectionService::OVERWRITE_PROTECTION_TILL.']', |
50
|
|
|
'itemFormElValue' => $itemFormElValue, |
51
|
|
|
'fieldName' => OverwriteProtectionService::OVERWRITE_PROTECTION_TILL, |
52
|
|
|
'fieldConf' => [ |
53
|
|
|
'label' => $this->getLanguageService()->sL('LLL:EXT:aoe_dbsequenzer/Resources/Private/Language/locallang_db.xml:protectoverwrite_till'), |
54
|
|
|
'config' => [ |
55
|
|
|
'type' => 'input', |
56
|
|
|
'dbType' => 'datetime', |
57
|
|
|
'eval' => 'datetime', |
58
|
|
|
] |
59
|
|
|
] |
60
|
|
|
] |
61
|
|
|
]; |
62
|
|
|
|
63
|
|
|
$element = new InputTextElement($this->getNodeFactory(), $data); |
64
|
|
|
$resultArray = $element->render(); |
65
|
|
|
return $resultArray['html']; |
66
|
|
|
} |
67
|
|
|
} |
68
|
|
|
|