‪TYPO3CMS  10.4
StagesService.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of the TYPO3 CMS project.
5  *
6  * It is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU General Public License, either version 2
8  * of the License, or any later version.
9  *
10  * For the full copyright and license information, please read the
11  * LICENSE.txt file that was distributed with this source code.
12  *
13  * The TYPO3 project - inspiring people to share!
14  */
15 
17 
28 
33 {
34  const ‪TABLE_STAGE = 'sys_workspace_stage';
35  // if a record is in the "ready to publish" stage STAGE_PUBLISH_ID the nextStage is STAGE_PUBLISH_EXECUTE_ID, this id wont be saved at any time in db
37  // ready to publish stage
38  const ‪STAGE_PUBLISH_ID = -10;
39  const ‪STAGE_EDIT_ID = 0;
40 
46  private ‪$pathToLocallang = 'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf';
47 
51  protected ‪$recordService;
52 
58  protected ‪$workspaceStageCache = [];
59 
64 
68  protected ‪$fetchGroupsCache = [];
69 
73  protected ‪$userGroups = [];
74 
80  public function ‪getWorkspaceId()
81  {
82  return $this->‪getBackendUser()->workspace;
83  }
84 
93  $workspaceItems,
94  array $byTableName = ['tt_content', 'pages']
95  ) {
96  $currentStage = [];
97  $previousStage = [];
98  $usedStages = [];
99  $found = false;
100  $availableStagesForWS = array_reverse($this->‪getStagesForWS());
101  $availableStagesForWSUser = $this->‪getStagesForWSUser();
102  $byTableName = array_flip($byTableName);
103  foreach ($workspaceItems as $tableName => $items) {
104  if (!array_key_exists($tableName, $byTableName)) {
105  continue;
106  }
107  foreach ($items as $item) {
108  $usedStages[$item['t3ver_stage']] = true;
109  }
110  }
111  foreach ($availableStagesForWS as $stage) {
112  if (isset($usedStages[$stage['uid']])) {
113  $currentStage = $stage;
114  $previousStage = $this->‪getPrevStage($stage['uid']);
115  break;
116  }
117  }
118  foreach ($availableStagesForWSUser as $userWS) {
119  if ($previousStage['uid'] == $userWS['uid']) {
120  $found = true;
121  break;
122  }
123  }
124  if ($found === false || !$this->‪isStageAllowedForUser($currentStage['uid'])) {
125  $previousStage = [];
126  }
127  return [
128  $currentStage,
129  $previousStage
130  ];
131  }
132 
140  public function ‪getNextStageForElementCollection(
141  $workspaceItems,
142  array $byTableName = ['tt_content', 'pages']
143  ) {
144  $currentStage = [];
145  $usedStages = [];
146  $nextStage = [];
147  $availableStagesForWS = $this->‪getStagesForWS();
148  $availableStagesForWSUser = $this->‪getStagesForWSUser();
149  $byTableName = array_flip($byTableName);
150  $found = false;
151  foreach ($workspaceItems as $tableName => $items) {
152  if (!array_key_exists($tableName, $byTableName)) {
153  continue;
154  }
155  foreach ($items as $item) {
156  $usedStages[$item['t3ver_stage']] = true;
157  }
158  }
159  foreach ($availableStagesForWS as $stage) {
160  if (isset($usedStages[$stage['uid']])) {
161  $currentStage = $stage;
162  $nextStage = $this->‪getNextStage($stage['uid']);
163  break;
164  }
165  }
166  foreach ($availableStagesForWSUser as $userWS) {
167  if ($nextStage['uid'] == $userWS['uid']) {
168  $found = true;
169  break;
170  }
171  }
172  if ($found === false || !$this->‪isStageAllowedForUser($currentStage['uid'])) {
173  $nextStage = [];
174  }
175  return [
176  $currentStage,
177  $nextStage
178  ];
179  }
180 
186  public function ‪getStagesForWS()
187  {
188  if (isset($this->workspaceStageCache[$this->‪getWorkspaceId()])) {
189  $stages = $this->workspaceStageCache[$this->‪getWorkspaceId()];
190  } elseif ($this->‪getWorkspaceId() === 0) {
191  $stages = [];
192  } else {
193  $stages = $this->‪prepareStagesArray($this->‪getWorkspaceRecord()->getStages());
194  $this->workspaceStageCache[$this->‪getWorkspaceId()] = $stages;
195  }
196  return $stages;
197  }
198 
204  public function ‪getStagesForWSUser()
205  {
206  if ($this->‪getBackendUser()->isAdmin()) {
207  return $this->‪getStagesForWS();
208  }
209 
211  $allowedStages = [];
212  $stageRecords = $this->‪getWorkspaceRecord()->‪getStages();
213 
214  // Only use stages that are allowed for current backend user
215  foreach ($stageRecords as $stageRecord) {
216  if ($stageRecord->isAllowed()) {
217  $allowedStages[$stageRecord->getUid()] = $stageRecord;
218  }
219  }
220 
221  // Add previous and next stages (even if they are not allowed!)
222  foreach ($allowedStages as $allowedStage) {
223  $previousStage = $allowedStage->‪getPrevious();
224  $nextStage = $allowedStage->‪getNext();
225  if ($previousStage !== null && !isset($allowedStages[$previousStage->getUid()])) {
226  $allowedStages[$previousStage->getUid()] = $previousStage;
227  }
228  if ($nextStage !== null && !isset($allowedStages[$nextStage->getUid()])) {
229  $allowedStages[$nextStage->getUid()] = $nextStage;
230  }
231  }
232 
233  uasort($allowedStages, function (‪StageRecord $first, ‪StageRecord $second) {
234  return $first->‪determineOrder($second);
235  });
236  return $this->‪prepareStagesArray($allowedStages);
237  }
238 
245  protected function ‪prepareStagesArray(array $stageRecords)
246  {
247  $stagesArray = [];
248  foreach ($stageRecords as $stageRecord) {
249  $stage = [
250  'uid' => $stageRecord->getUid(),
251  'label' => $stageRecord->getTitle(),
252  ];
253  if (!$stageRecord->isExecuteStage()) {
254  $stage['title'] = $this->‪getLanguageService()->‪sL($this->pathToLocallang . ':actionSendToStage') . ' "' . $stageRecord->getTitle() . '"';
255  } else {
256  $stage['title'] = $this->‪getLanguageService()->‪sL($this->pathToLocallang . ':publish_execute_action_option');
257  }
258  $stagesArray[] = $stage;
259  }
260  return $stagesArray;
261  }
262 
269  public function ‪getStageTitle($ver_stage)
270  {
271  switch ($ver_stage) {
273  $stageTitle = $this->‪getLanguageService()->‪sL('LLL:EXT:workspaces/Resources/Private/Language/locallang_mod_user_ws.xlf:stage_publish');
274  break;
276  $stageTitle = $this->‪getLanguageService()->‪sL('LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:stage_ready_to_publish');
277  break;
279  $stageTitle = $this->‪getLanguageService()->‪sL('LLL:EXT:workspaces/Resources/Private/Language/locallang_mod_user_ws.xlf:stage_editing');
280  break;
281  default:
282  $stageTitle = $this->‪getPropertyOfCurrentWorkspaceStage($ver_stage, 'title');
283  if ($stageTitle == null) {
284  $stageTitle = $this->‪getLanguageService()->‪sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.getStageTitle.stageNotFound');
285  }
286  }
287  return $stageTitle;
288  }
289 
296  public function ‪getStageRecord($stageid)
297  {
298  return ‪BackendUtility::getRecord('sys_workspace_stage', $stageid);
299  }
300 
308  public function ‪getNextStage($stageId)
309  {
311  throw new \InvalidArgumentException(
312  $this->‪getLanguageService()->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'),
313  1291109987
314  );
315  }
316  $nextStage = false;
317  $workspaceStageRecs = $this->‪getStagesForWS();
318  if (is_array($workspaceStageRecs) && !empty($workspaceStageRecs)) {
319  reset($workspaceStageRecs);
320  while (key($workspaceStageRecs) !== null) {
321  $workspaceStageRec = current($workspaceStageRecs);
322  if ($workspaceStageRec['uid'] == $stageId) {
323  $nextStage = next($workspaceStageRecs);
324  break;
325  }
326  next($workspaceStageRecs);
327  }
328  }
329  if ($nextStage === false) {
330  $nextStage[] = [
331  'uid' => ‪self::STAGE_EDIT_ID,
332  'title' => $this->‪getLanguageService()->‪sL($this->pathToLocallang . ':actionSendToStage') . ' "'
333  . $this->‪getLanguageService()->‪sL('LLL:EXT:workspaces/Resources/Private/Language/locallang_mod_user_ws.xlf:stage_editing') . '"'
334  ];
335  }
336  return $nextStage;
337  }
338 
346  public function ‪getNextStages(array &$nextStageArray, $stageId)
347  {
348  // Current stage is "Ready to publish" - there is no next stage
349  if ($stageId == self::STAGE_PUBLISH_ID) {
350  return $nextStageArray;
351  }
352  $nextStageRecord = $this->‪getNextStage($stageId);
353  if (empty($nextStageRecord) || !is_array($nextStageRecord)) {
354  // There is no next stage
355  return $nextStageArray;
356  }
357  // Check if the user has the permission to for the current stage
358  // If this next stage record is the first next stage after the current the user
359  // has always the needed permission
360  if ($this->‪isStageAllowedForUser($stageId)) {
361  $nextStageArray[] = $nextStageRecord;
362  return $this->‪getNextStages($nextStageArray, $nextStageRecord['uid']);
363  }
364  // He hasn't - return given next stage array
365  return $nextStageArray;
366  }
367 
375  public function ‪getPrevStage($stageId)
376  {
378  throw new \InvalidArgumentException(
379  $this->‪getLanguageService()->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'),
380  1476048351
381  );
382  }
383  $prevStage = false;
384  $workspaceStageRecs = $this->‪getStagesForWS();
385  if (is_array($workspaceStageRecs) && !empty($workspaceStageRecs)) {
386  end($workspaceStageRecs);
387  while (key($workspaceStageRecs) !== null) {
388  $workspaceStageRec = current($workspaceStageRecs);
389  if ($workspaceStageRec['uid'] == $stageId) {
390  $prevStage = prev($workspaceStageRecs);
391  break;
392  }
393  prev($workspaceStageRecs);
394  }
395  }
396 
397  return $prevStage;
398  }
399 
407  public function ‪getPrevStages(array &$prevStageArray, $stageId)
408  {
409  // Current stage is "Editing" - there is no prev stage
410  if ($stageId != self::STAGE_EDIT_ID) {
411  $prevStageRecord = $this->‪getPrevStage($stageId);
412  if (!empty($prevStageRecord) && is_array($prevStageRecord)) {
413  // Check if the user has the permission to switch to that stage
414  // If this prev stage record is the first previous stage before the current
415  // the user has always the needed permission
416  if ($this->‪isStageAllowedForUser($stageId)) {
417  $prevStageArray[] = $prevStageRecord;
418  $prevStageArray = $this->‪getPrevStages($prevStageArray, $prevStageRecord['uid']);
419  }
420  }
421  }
422  return $prevStageArray;
423  }
424 
433  public function ‪getResponsibleBeUser($stageRecord, $selectDefaultUserField = false)
434  {
435  if (!$stageRecord instanceof StageRecord) {
436  $stageRecord = $this->‪getWorkspaceRecord()->‪getStage($stageRecord);
437  }
438 
439  $recipientArray = [];
440 
441  if (!$selectDefaultUserField) {
442  $backendUserIds = $stageRecord->‪getAllRecipients();
443  } else {
444  $backendUserIds = $stageRecord->getDefaultRecipients();
445  }
446 
447  $userList = implode(',', $backendUserIds);
448  $userRecords = $this->‪getBackendUsers($userList);
449  foreach ($userRecords as $userUid => $userRecord) {
450  $recipientArray[$userUid] = $userRecord;
451  }
452  return $recipientArray;
453  }
454 
463  public function ‪getResponsibleUser($stageRespValue)
464  {
465  return implode(',', $this->‪resolveBackendUserIds($stageRespValue));
466  }
467 
475  public function ‪resolveBackendUserIds($backendUserGroupList)
476  {
477  $elements = ‪GeneralUtility::trimExplode(',', $backendUserGroupList, true);
478  $backendUserIds = [];
479  $backendGroupIds = [];
480 
481  foreach ($elements as $element) {
482  if (strpos($element, 'be_users_') === 0) {
483  // Current value is a uid of a be_user record
484  $backendUserIds[] = str_replace('be_users_', '', $element);
485  } elseif (strpos($element, 'be_groups_') === 0) {
486  $backendGroupIds[] = str_replace('be_groups_', '', $element);
487  } elseif ((int)$element) {
488  $backendUserIds[] = (int)$element;
489  }
490  }
491 
492  if (!empty($backendGroupIds)) {
493  $allBeUserArray = ‪BackendUtility::getUserNames();
494  $backendGroupList = implode(',', $backendGroupIds);
495  $this->userGroups = [];
496  $backendGroups = $this->‪fetchGroups($backendGroupList);
497  foreach ($backendGroups as $backendGroup) {
498  foreach ($allBeUserArray as $backendUserId => $backendUser) {
499  if (GeneralUtility::inList($backendUser['usergroup_cached_list'], $backendGroup['uid'])) {
500  $backendUserIds[] = $backendUserId;
501  }
502  }
503  }
504  }
505 
506  return array_unique($backendUserIds);
507  }
508 
515  public function ‪getBackendUsers($backendUserList)
516  {
517  if (empty($backendUserList)) {
518  return [];
519  }
520 
521  $backendUserList = implode(',', ‪GeneralUtility::intExplode(',', $backendUserList));
522  $backendUsers = ‪BackendUtility::getUserNames(
523  'username, uid, email, realName, lang, uc',
524  'AND uid IN (' . $backendUserList . ')' . ‪BackendUtility::BEenableFields('be_users')
525  );
526 
527  if (empty($backendUsers)) {
528  $backendUsers = [];
529  }
530  return $backendUsers;
531  }
532 
537  public function ‪getPreselectedRecipients(‪StageRecord $stageRecord)
538  {
539  if ($stageRecord->‪areEditorsPreselected()) {
540  return array_merge(
541  $stageRecord->‪getPreselectedRecipients(),
542  $this->getRecordService()->getCreateUserIds()
543  );
544  }
545  return $stageRecord->‪getPreselectedRecipients();
546  }
547 
551  protected function ‪getWorkspaceRecord()
552  {
554  }
555 
561  private function ‪fetchGroups($grList, $idList = '')
562  {
563  $cacheKey = md5($grList . $idList);
564  if (isset($this->fetchGroupsCache[$cacheKey])) {
565  return $this->fetchGroupsCache[$cacheKey];
566  }
567  if ($idList === '') {
568  // we're at the beginning of the recursion and therefore we need to reset the userGroups member
569  $this->userGroups = [];
570  }
571  $groupList = $this->‪fetchGroupsRecursive($grList);
572  $this->fetchGroupsCache[$cacheKey] = $groupList;
573  return $groupList;
574  }
575 
579  private function ‪fetchGroupsFromDB(array $groups)
580  {
581  // The userGroups array is filled
582  $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable('be_groups');
583 
584  $result = $queryBuilder
585  ->select('*')
586  ->from('be_groups')
587  ->where(
588  $queryBuilder->expr()->in(
589  'uid',
590  $queryBuilder->createNamedParameter($groups, Connection::PARAM_INT_ARRAY)
591  )
592  )
593  ->execute();
594 
595  while ($row = $result->fetch()) {
596  $this->userGroups[$row['uid']] = $row;
597  }
598  }
599 
607  private function ‪fetchGroupsRecursive($grList, $idList = '')
608  {
609  $requiredGroups = ‪GeneralUtility::intExplode(',', $grList, true);
610  $existingGroups = array_keys($this->userGroups);
611  $missingGroups = array_diff($requiredGroups, $existingGroups);
612  if (!empty($missingGroups)) {
613  $this->‪fetchGroupsFromDB($missingGroups);
614  }
615  // Traversing records in the correct order
616  foreach ($requiredGroups as $uid) {
617  // traversing list
618  // Get row:
619  $row = $this->userGroups[$uid];
620  if (is_array($row) && !GeneralUtility::inList($idList, (string)$uid)) {
621  // Must be an array and $uid should not be in the idList, because then it is somewhere previously in the grouplist
622  // If the localconf.php option isset the user of the sub- sub- groups will also be used
623  if (‪$GLOBALS['TYPO3_CONF_VARS']['BE']['customStageShowRecipientRecursive'] == 1) {
624  // Include sub groups
625  if (trim($row['subgroup'])) {
626  // Make integer list
627  $theList = implode(',', ‪GeneralUtility::intExplode(',', $row['subgroup']));
628  // Get the subgroups
629  $subGroups = $this->‪fetchGroups($theList, $idList . ',' . $uid);
630  // Merge the subgroups to the already existing userGroups array
631  $subUid = key($subGroups);
632  $this->userGroups[$subUid] = $subGroups[$subUid];
633  }
634  }
635  }
636  }
637  return ‪$this->userGroups;
638  }
639 
648  public function ‪getPropertyOfCurrentWorkspaceStage($stageId, $property)
649  {
650  $result = null;
652  throw new \InvalidArgumentException(
653  $this->‪getLanguageService()->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:error.stageId.integer'),
654  1476048371
655  );
656  }
657  $workspaceStage = ‪BackendUtility::getRecord(self::TABLE_STAGE, $stageId);
658  if (is_array($workspaceStage) && isset($workspaceStage[$property])) {
659  $result = $workspaceStage[$property];
660  }
661  return $result;
662  }
663 
671  public function ‪getPositionOfCurrentStage($stageId)
672  {
673  $stagesOfWS = $this->‪getStagesForWS();
674  $countOfStages = count($stagesOfWS);
675  switch ($stageId) {
677  $position = $countOfStages;
678  break;
680  $position = 1;
681  break;
682  default:
683  $position = 1;
684  foreach ($stagesOfWS as $key => $stageInfoArray) {
685  $position++;
686  if ($stageId == $stageInfoArray['uid']) {
687  break;
688  }
689  }
690  }
691  return ['position' => $position, 'count' => $countOfStages];
692  }
693 
700  public function ‪isPrevStageAllowedForUser($stageId)
701  {
702  $isAllowed = false;
703  try {
704  $prevStage = $this->‪getPrevStage($stageId);
705  // if there's no prev-stage the stageIds match,
706  // otherwise we've to check if the user is permitted to use the stage
707  if (!empty($prevStage) && $prevStage['uid'] != $stageId) {
708  // if the current stage is allowed for the user, the user is also allowed to send to prev
709  $isAllowed = $this->‪isStageAllowedForUser($stageId);
710  }
711  } catch (\Exception $e) {
712  }
713  return $isAllowed;
714  }
715 
722  public function ‪isNextStageAllowedForUser($stageId)
723  {
724  $isAllowed = false;
725  try {
726  $nextStage = $this->‪getNextStage($stageId);
727  // if there's no next-stage the stageIds match,
728  // otherwise we've to check if the user is permitted to use the stage
729  if (!empty($nextStage) && $nextStage['uid'] != $stageId) {
730  // if the current stage is allowed for the user, the user is also allowed to send to next
731  $isAllowed = $this->‪isStageAllowedForUser($stageId);
732  }
733  } catch (\Exception $e) {
734  }
735  return $isAllowed;
736  }
737 
742  protected function ‪isStageAllowedForUser($stageId)
743  {
744  $cacheKey = $this->‪getWorkspaceId() . '_' . $stageId;
745  if (isset($this->workspaceStageAllowedCache[$cacheKey])) {
746  return $this->workspaceStageAllowedCache[$cacheKey];
747  }
748  $isAllowed = $this->‪getBackendUser()->‪workspaceCheckStageForCurrent($stageId);
749  $this->workspaceStageAllowedCache[$cacheKey] = $isAllowed;
750  return $isAllowed;
751  }
752 
759  public function ‪isValid($stageId)
760  {
761  $isValid = false;
762  $stages = $this->‪getStagesForWS();
763  foreach ($stages as $stage) {
764  if ($stage['uid'] == $stageId) {
765  $isValid = true;
766  break;
767  }
768  }
769  return $isValid;
770  }
771 
775  public function ‪getRecordService()
776  {
777  if (!isset($this->recordService)) {
778  $this->recordService = GeneralUtility::makeInstance(RecordService::class);
779  }
781  }
782 
786  protected function ‪getBackendUser()
787  {
788  return ‪$GLOBALS['BE_USER'];
789  }
790 
794  protected function ‪getLanguageService(): ?‪LanguageService
795  {
796  return ‪$GLOBALS['LANG'] ?? null;
797  }
798 }
‪TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceId
‪int getWorkspaceId()
Definition: StagesService.php:74
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\areEditorsPreselected
‪bool areEditorsPreselected()
Definition: StageRecord.php:251
‪TYPO3\CMS\Workspaces\Service\StagesService\isPrevStageAllowedForUser
‪bool isPrevStageAllowedForUser($stageId)
Definition: StagesService.php:694
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\determineOrder
‪int determineOrder(StageRecord $stageRecord)
Definition: StageRecord.php:114
‪TYPO3\CMS\Workspaces\Service\StagesService\getPropertyOfCurrentWorkspaceStage
‪string getPropertyOfCurrentWorkspaceStage($stageId, $property)
Definition: StagesService.php:642
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getAllRecipients
‪array getAllRecipients()
Definition: StageRecord.php:316
‪TYPO3\CMS\Workspaces\Service\StagesService\getNextStage
‪array getNextStage($stageId)
Definition: StagesService.php:302
‪TYPO3\CMS\Workspaces\Service\StagesService\fetchGroupsRecursive
‪array fetchGroupsRecursive($grList, $idList='')
Definition: StagesService.php:601
‪TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger
‪static bool canBeInterpretedAsInteger($var)
Definition: MathUtility.php:74
‪TYPO3\CMS\Workspaces\Service\StagesService\getBackendUsers
‪array getBackendUsers($backendUserList)
Definition: StagesService.php:509
‪TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser
‪bool isStageAllowedForUser($stageId)
Definition: StagesService.php:736
‪TYPO3\CMS\Workspaces\Service\StagesService\$workspaceStageAllowedCache
‪array $workspaceStageAllowedCache
Definition: StagesService.php:59
‪TYPO3\CMS\Workspaces\Service
Definition: AdditionalColumnService.php:16
‪TYPO3\CMS\Workspaces\Service\StagesService\getResponsibleBeUser
‪array getResponsibleBeUser($stageRecord, $selectDefaultUserField=false)
Definition: StagesService.php:427
‪TYPO3\CMS\Workspaces\Service\StagesService\getNextStageForElementCollection
‪array getNextStageForElementCollection( $workspaceItems, array $byTableName=['tt_content', 'pages'])
Definition: StagesService.php:134
‪TYPO3\CMS\Workspaces\Service\StagesService\getNextStages
‪array getNextStages(array &$nextStageArray, $stageId)
Definition: StagesService.php:340
‪TYPO3\CMS\Workspaces\Service\StagesService\getResponsibleUser
‪string getResponsibleUser($stageRespValue)
Definition: StagesService.php:457
‪TYPO3\CMS\Workspaces\Service\StagesService\getStageTitle
‪string getStageTitle($ver_stage)
Definition: StagesService.php:263
‪TYPO3\CMS\Workspaces\Service\StagesService\getPositionOfCurrentStage
‪array getPositionOfCurrentStage($stageId)
Definition: StagesService.php:665
‪TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord
Definition: WorkspaceRecord.php:26
‪TYPO3\CMS\Backend\Utility\BackendUtility\getUserNames
‪static array getUserNames($fields='username, usergroup, usergroup_cached_list, uid', $where='')
Definition: BackendUtility.php:818
‪TYPO3\CMS\Core\Localization\LanguageService\sL
‪string sL($input)
Definition: LanguageService.php:194
‪TYPO3\CMS\Workspaces\Service\StagesService\STAGE_PUBLISH_EXECUTE_ID
‪const STAGE_PUBLISH_EXECUTE_ID
Definition: StagesService.php:36
‪TYPO3\CMS\Workspaces\Service\StagesService\$fetchGroupsCache
‪array $fetchGroupsCache
Definition: StagesService.php:63
‪TYPO3\CMS\Workspaces\Service\StagesService\getPreselectedRecipients
‪array getPreselectedRecipients(StageRecord $stageRecord)
Definition: StagesService.php:531
‪TYPO3\CMS\Workspaces\Service\StagesService\isValid
‪bool isValid($stageId)
Definition: StagesService.php:753
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getPreselectedRecipients
‪int[] getPreselectedRecipients()
Definition: StageRecord.php:340
‪TYPO3\CMS\Workspaces\Service\StagesService\STAGE_PUBLISH_ID
‪const STAGE_PUBLISH_ID
Definition: StagesService.php:38
‪TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceRecord
‪WorkspaceRecord getWorkspaceRecord()
Definition: StagesService.php:545
‪TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWSUser
‪array getStagesForWSUser()
Definition: StagesService.php:198
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord
Definition: StageRecord.php:24
‪TYPO3\CMS\Workspaces\Service\StagesService\isNextStageAllowedForUser
‪bool isNextStageAllowedForUser($stageId)
Definition: StagesService.php:716
‪TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS
‪array getStagesForWS()
Definition: StagesService.php:180
‪TYPO3\CMS\Workspaces\Service\StagesService\getBackendUser
‪BackendUserAuthentication getBackendUser()
Definition: StagesService.php:780
‪TYPO3\CMS\Workspaces\Service\StagesService\getPrevStage
‪bool array getPrevStage($stageId)
Definition: StagesService.php:369
‪TYPO3\CMS\Workspaces\Service\StagesService\$recordService
‪RecordService $recordService
Definition: StagesService.php:49
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication
Definition: BackendUserAuthentication.php:62
‪TYPO3\CMS\Workspaces\Service\StagesService\$pathToLocallang
‪string $pathToLocallang
Definition: StagesService.php:45
‪TYPO3\CMS\Workspaces\Service\StagesService\$userGroups
‪array $userGroups
Definition: StagesService.php:67
‪TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields
‪static string BEenableFields($table, $inv=false)
Definition: BackendUtility.php:225
‪TYPO3\CMS\Backend\Utility\BackendUtility
Definition: BackendUtility.php:75
‪TYPO3\CMS\Workspaces\Service\StagesService\getRecordService
‪RecordService getRecordService()
Definition: StagesService.php:769
‪TYPO3\CMS\Backend\Utility\BackendUtility\getRecord
‪static array null getRecord($table, $uid, $fields=' *', $where='', $useDeleteClause=true)
Definition: BackendUtility.php:95
‪TYPO3\CMS\Workspaces\Service\StagesService\STAGE_EDIT_ID
‪const STAGE_EDIT_ID
Definition: StagesService.php:39
‪TYPO3\CMS\Workspaces\Service\StagesService
Definition: StagesService.php:33
‪TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode
‪static string[] trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:1059
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getNext
‪StageRecord null getNext()
Definition: StageRecord.php:105
‪TYPO3\CMS\Workspaces\Service\StagesService\getStageRecord
‪array getStageRecord($stageid)
Definition: StagesService.php:290
‪TYPO3\CMS\Core\Database\Connection
Definition: Connection.php:36
‪TYPO3\CMS\Workspaces\Service\StagesService\$workspaceStageCache
‪array $workspaceStageCache
Definition: StagesService.php:55
‪TYPO3\CMS\Workspaces\Service\StagesService\prepareStagesArray
‪array prepareStagesArray(array $stageRecords)
Definition: StagesService.php:239
‪TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\getStages
‪StageRecord[] getStages()
Definition: WorkspaceRecord.php:106
‪TYPO3\CMS\Core\SingletonInterface
Definition: SingletonInterface.php:23
‪$GLOBALS
‪$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['adminpanel']['modules']
Definition: ext_localconf.php:5
‪TYPO3\CMS\Workspaces\Service\StagesService\fetchGroupsFromDB
‪fetchGroupsFromDB(array $groups)
Definition: StagesService.php:573
‪TYPO3\CMS\Core\Utility\GeneralUtility\intExplode
‪static int[] intExplode($delimiter, $string, $removeEmptyValues=false, $limit=0)
Definition: GeneralUtility.php:988
‪TYPO3\CMS\Core\Utility\MathUtility
Definition: MathUtility.php:22
‪TYPO3\CMS\Core\Localization\LanguageService
Definition: LanguageService.php:42
‪TYPO3\CMS\Core\Database\ConnectionPool
Definition: ConnectionPool.php:46
‪TYPO3\CMS\Workspaces\Service\StagesService\getPrevStages
‪array getPrevStages(array &$prevStageArray, $stageId)
Definition: StagesService.php:401
‪TYPO3\CMS\Workspaces\Service\StagesService\resolveBackendUserIds
‪array resolveBackendUserIds($backendUserGroupList)
Definition: StagesService.php:469
‪TYPO3\CMS\Workspaces\Service\StagesService\getPreviousStageForElementCollection
‪array getPreviousStageForElementCollection( $workspaceItems, array $byTableName=['tt_content', 'pages'])
Definition: StagesService.php:86
‪TYPO3\CMS\Core\Utility\GeneralUtility
Definition: GeneralUtility.php:46
‪TYPO3\CMS\Workspaces\Service\StagesService\TABLE_STAGE
‪const TABLE_STAGE
Definition: StagesService.php:34
‪TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getPrevious
‪StageRecord null getPrevious()
Definition: StageRecord.php:97
‪TYPO3\CMS\Core\Authentication\BackendUserAuthentication\workspaceCheckStageForCurrent
‪bool workspaceCheckStageForCurrent($stage)
Definition: BackendUserAuthentication.php:1097
‪TYPO3\CMS\Workspaces\Service\RecordService
Definition: RecordService.php:28
‪TYPO3\CMS\Workspaces\Service\StagesService\fetchGroups
‪array fetchGroups($grList, $idList='')
Definition: StagesService.php:555
‪TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\get
‪static WorkspaceRecord get($uid, array $record=null)
Definition: WorkspaceRecord.php:69
‪TYPO3\CMS\Workspaces\Service\StagesService\getLanguageService
‪LanguageService null getLanguageService()
Definition: StagesService.php:788
‪TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\getStage
‪StageRecord null getStage($stageId)
Definition: WorkspaceRecord.php:146