37 private $pathToLocallang =
'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf';
46 $this->workspaceService = GeneralUtility::makeInstance(WorkspaceService::class);
59 $massActionsEnabled = (bool)($backendUser->getTSConfig()[
'options.'][
'workspaces.'][
'enableMassActions'] ??
true);
62 $publishAccess = $backendUser->workspacePublishAccess($currentWorkspace);
63 if ($publishAccess && !($backendUser->workspaceRec[
'publish_access'] & 1)) {
64 $actions[] = [
'action' =>
'publish',
'title' => $this->
getLanguageService()->
sL($this->pathToLocallang .
':label_doaction_publish')];
65 if ($backendUser->workspaceSwapAccess()) {
66 $actions[] = [
'action' =>
'swap',
'title' => $this->
getLanguageService()->
sL($this->pathToLocallang .
':label_doaction_swap')];
70 $actions[] = [
'action' =>
'discard',
'title' => $this->
getLanguageService()->
sL($this->pathToLocallang .
':label_doaction_discard')];
74 'total' => count($actions),
95 if ($parameters->init) {
98 $result[
'total'] = $cnt;
103 }
catch (\Exception $e) {
104 $result[
'error'] = $e->getMessage();
124 if ($parameters->init) {
131 }
catch (\Exception $e) {
132 $result[
'error'] = $e->getMessage();
148 $publishData = $this->workspaceService->getCmdArrayForPublishWS($workspace, $swap, 0, $language);
150 foreach ($publishData as $table => $recs) {
151 $recordCount += count($recs);
153 if ($recordCount > 0) {
171 $flushData = $this->workspaceService->getCmdArrayForFlushWS($workspace,
true, 0, $language);
173 foreach ($flushData as $table => $recs) {
174 $recordCount += count($recs);
176 if ($recordCount > 0) {
195 foreach ($processData as $table => $recs) {
196 foreach ($recs as $key => $value) {
198 $limitedCmd[$table][$key] = $value;
199 if ($numRecs == self::MAX_RECORDS_TO_PROCESS) {
203 if ($numRecs == self::MAX_RECORDS_TO_PROCESS) {
212 $dataHandler = GeneralUtility::makeInstance(DataHandler::class);
214 $dataHandler->start([], $limitedCmd);
215 $dataHandler->process_cmdmap();
218 throw new \Exception(implode(
', ',
$errors), 1476048278);
221 foreach ($limitedCmd as $table => $recs) {
222 foreach ($recs as $key => $value) {
224 unset($processData[$table][$key]);
230 return $recordsProcessed;
244 $language = $parameters->language;
256 return $this->workspaceService->getCurrentWorkspace();