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