2 namespace TYPO3\CMS\Saltedpasswords\Task;
45 public function getAdditionalFields(array &$taskInfo, $task, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject)
48 if (!isset($taskInfo[
'scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'])) {
50 if ($parentObject->CMD ===
'edit') {
51 $taskInfo[
'scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'] = $task->getCanDeactivateSelf();
54 if (!isset($taskInfo[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords'])) {
56 if ($parentObject->CMD ===
'edit') {
57 $taskInfo[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords'] = $task->getNumberOfRecords();
61 $fieldName =
'tx_scheduler[scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf]';
62 $fieldId =
'task_saltedpasswordsBulkUpdateCanDeactivateSelf';
63 $fieldValue =
'IsChecked';
64 $fieldChecked = (bool)$taskInfo[
'scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'];
65 $fieldHtml =
'<div class="checkbox"><label><input type="checkbox"' .
' name="' . $fieldName .
'"' .
' id="' . $fieldId .
'"' .
' value="' . $fieldValue .
'"' . ($fieldChecked ?
' checked="checked"' :
'') .
'></label></div>';
66 $additionalFields[$fieldId] = array(
68 'label' =>
'LLL:EXT:saltedpasswords/Resources/Private/Language/locallang.xlf:ext.saltedpasswords.tasks.bulkupdate.label.canDeactivateSelf',
69 'cshKey' =>
'_txsaltedpasswords',
70 'cshLabel' => $fieldId
73 $fieldName =
'tx_scheduler[scheduler_saltedpasswordsBulkUpdateNumberOfRecords]';
74 $fieldId =
'task_saltedpasswordsBulkUpdateNumberOfRecords';
75 $fieldValue = (int)$taskInfo[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords'];
76 $fieldHtml =
'<input type="text" class="form-control" name="' . $fieldName .
'" id="' . $fieldId .
'" value="' . htmlspecialchars($fieldValue) .
'">';
77 $additionalFields[$fieldId] = array(
79 'label' =>
'LLL:EXT:saltedpasswords/Resources/Private/Language/locallang.xlf:ext.saltedpasswords.tasks.bulkupdate.label.numberOfRecords',
80 'cshKey' =>
'_txsaltedpasswords',
81 'cshLabel' => $fieldId
83 return $additionalFields;
93 public function validateAdditionalFields(array &$submittedData, \TYPO3\CMS\Scheduler\Controller\SchedulerModuleController $parentObject)
98 if (!is_numeric($submittedData[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords']) || (
int)$submittedData[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords'] < 0) {
100 $parentObject->addMessage(
$GLOBALS[
'LANG']->sL(
'LLL:EXT:saltedpasswords/Resources/Private/Language/locallang.xlf:ext.saltedpasswords.tasks.bulkupdate.invalidNumberOfRecords'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
114 if (isset($submittedData[
'scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf']) && $submittedData[
'scheduler_saltedpasswordsBulkUpdateCanDeactivateSelf'] ===
'IsChecked') {
115 $task->setCanDeactivateSelf(
true);
117 $task->setCanDeactivateSelf(
false);
119 $task->setNumberOfRecords((
int)$submittedData[
'scheduler_saltedpasswordsBulkUpdateNumberOfRecords']);