‪TYPO3CMS  10.4
TYPO3\CMS\Workspaces\Service\StagesService Class Reference
Inheritance diagram for TYPO3\CMS\Workspaces\Service\StagesService:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

int getWorkspaceId ()
 
array getPreviousStageForElementCollection ( $workspaceItems, array $byTableName=['tt_content', 'pages'])
 
array getNextStageForElementCollection ( $workspaceItems, array $byTableName=['tt_content', 'pages'])
 
array getStagesForWS ()
 
array getStagesForWSUser ()
 
string getStageTitle ($ver_stage)
 
array getStageRecord ($stageid)
 
array getNextStage ($stageId)
 
array getNextStages (array &$nextStageArray, $stageId)
 
bool array getPrevStage ($stageId)
 
array getPrevStages (array &$prevStageArray, $stageId)
 
array getResponsibleBeUser ($stageRecord, $selectDefaultUserField=false)
 
string getResponsibleUser ($stageRespValue)
 
array resolveBackendUserIds ($backendUserGroupList)
 
array getBackendUsers ($backendUserList)
 
array getPreselectedRecipients (StageRecord $stageRecord)
 
string getPropertyOfCurrentWorkspaceStage ($stageId, $property)
 
array getPositionOfCurrentStage ($stageId)
 
bool isPrevStageAllowedForUser ($stageId)
 
bool isNextStageAllowedForUser ($stageId)
 
bool isValid ($stageId)
 
RecordService getRecordService ()
 

Public Attributes

const TABLE_STAGE = 'sys_workspace_stage'
 
const STAGE_PUBLISH_EXECUTE_ID = -20
 
const STAGE_PUBLISH_ID = -10
 
const STAGE_EDIT_ID = 0
 

Protected Member Functions

array prepareStagesArray (array $stageRecords)
 
WorkspaceRecord getWorkspaceRecord ()
 
bool isStageAllowedForUser ($stageId)
 
BackendUserAuthentication getBackendUser ()
 
LanguageService null getLanguageService ()
 

Protected Attributes

RecordService $recordService
 
array $workspaceStageCache = array( )
 
array $workspaceStageAllowedCache = array( )
 
array $fetchGroupsCache = array( )
 
array $userGroups = array( )
 

Private Member Functions

array fetchGroups ($grList, $idList='')
 
 fetchGroupsFromDB (array $groups)
 
array fetchGroupsRecursive ($grList, $idList='')
 

Private Attributes

string $pathToLocallang = 'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf'
 

Detailed Description

Stages service

Definition at line 32 of file StagesService.php.

Member Function Documentation

◆ fetchGroups()

array TYPO3\CMS\Workspaces\Service\StagesService::fetchGroups (   $grList,
  $idList = '' 
)
private

◆ fetchGroupsFromDB()

TYPO3\CMS\Workspaces\Service\StagesService::fetchGroupsFromDB ( array  $groups)
private
Parameters
array$groups

Definition at line 573 of file StagesService.php.

Referenced by TYPO3\CMS\Workspaces\Service\StagesService\fetchGroupsRecursive().

◆ fetchGroupsRecursive()

array TYPO3\CMS\Workspaces\Service\StagesService::fetchGroupsRecursive (   $grList,
  $idList = '' 
)
private

◆ getBackendUser()

BackendUserAuthentication TYPO3\CMS\Workspaces\Service\StagesService::getBackendUser ( )
protected

◆ getBackendUsers()

array TYPO3\CMS\Workspaces\Service\StagesService::getBackendUsers (   $backendUserList)

Gets backend user records from a given list of ids.

Parameters
string$backendUserList
Returns
‪array

Definition at line 509 of file StagesService.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields(), TYPO3\CMS\Backend\Utility\BackendUtility\getUserNames(), and TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

Referenced by TYPO3\CMS\Workspaces\Service\StagesService\getResponsibleBeUser().

◆ getLanguageService()

◆ getNextStage()

◆ getNextStageForElementCollection()

array TYPO3\CMS\Workspaces\Service\StagesService::getNextStageForElementCollection (   $workspaceItems,
array  $byTableName = ['tt_content',
'pages']   
)

Retrieve the next stage based on the lowest stage given in the $workspaceItems record array.

Parameters
array$workspaceItems
array$byTableName
Returns
‪array Current and next possible stage.

Definition at line 134 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getNextStage(), TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS(), TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWSUser(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ getNextStages()

array TYPO3\CMS\Workspaces\Service\StagesService::getNextStages ( array &  $nextStageArray,
  $stageId 
)

Recursive function to get all next stages for a record depending on user permissions

Parameters
array$nextStageArray‪Next stages
int$stageId‪Current stage id of the record
Returns
‪array Next stages

Definition at line 340 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getNextStage(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ getPositionOfCurrentStage()

array TYPO3\CMS\Workspaces\Service\StagesService::getPositionOfCurrentStage (   $stageId)

Gets the position of the given workspace in the hole process f.e. 3 means step 3 of 20, by which 1 is edit and 20 is ready to publish

Parameters
int$stageId
Returns
‪array position => 3, count => 20

Definition at line 665 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS(), TYPO3\CMS\Workspaces\Service\StagesService\STAGE_EDIT_ID, and TYPO3\CMS\Workspaces\Service\StagesService\STAGE_PUBLISH_ID.

◆ getPreselectedRecipients()

array TYPO3\CMS\Workspaces\Service\StagesService::getPreselectedRecipients ( StageRecord  $stageRecord)

◆ getPreviousStageForElementCollection()

array TYPO3\CMS\Workspaces\Service\StagesService::getPreviousStageForElementCollection (   $workspaceItems,
array  $byTableName = ['tt_content',
'pages']   
)

Find the highest possible "previous" stage for all $byTableName

Parameters
array$workspaceItems
array$byTableName
Returns
‪array Current and next highest possible stage

Definition at line 86 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getPrevStage(), TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS(), TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWSUser(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ getPrevStage()

bool array TYPO3\CMS\Workspaces\Service\StagesService::getPrevStage (   $stageId)

◆ getPrevStages()

array TYPO3\CMS\Workspaces\Service\StagesService::getPrevStages ( array &  $prevStageArray,
  $stageId 
)

Recursive function to get all prev stages for a record depending on user permissions

Parameters
array$prevStageArray‪Prev stages
int$stageId‪Current stage id of the record
Returns
‪array prev stages

Definition at line 401 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getPrevStage(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ getPropertyOfCurrentWorkspaceStage()

string TYPO3\CMS\Workspaces\Service\StagesService::getPropertyOfCurrentWorkspaceStage (   $stageId,
  $property 
)

Gets a property of a workspaces stage.

Parameters
int$stageId
string$property
Returns
‪string
Exceptions

Definition at line 642 of file StagesService.php.

References TYPO3\CMS\Core\Utility\MathUtility\canBeInterpretedAsInteger(), TYPO3\CMS\Workspaces\Service\StagesService\getLanguageService(), and TYPO3\CMS\Backend\Utility\BackendUtility\getRecord().

Referenced by TYPO3\CMS\Workspaces\Service\StagesService\getStageTitle().

◆ getRecordService()

RecordService TYPO3\CMS\Workspaces\Service\StagesService::getRecordService ( )

◆ getResponsibleBeUser()

array TYPO3\CMS\Workspaces\Service\StagesService::getResponsibleBeUser (   $stageRecord,
  $selectDefaultUserField = false 
)

Gets all backend user records that are considered to be responsible for a particular stage or workspace.

Parameters
StageRecord | int$stageRecord‪Stage
bool$selectDefaultUserField‪If field notification_defaults should be selected instead of responsible users
Returns
‪array be_users with e-mail and name

Definition at line 427 of file StagesService.php.

References TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getAllRecipients(), TYPO3\CMS\Workspaces\Service\StagesService\getBackendUsers(), TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\getStage(), and TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceRecord().

◆ getResponsibleUser()

string TYPO3\CMS\Workspaces\Service\StagesService::getResponsibleUser (   $stageRespValue)

Gets backend user ids from a mixed list of backend users and backend users groups. This is used for notifying persons responsible for a particular stage or workspace.

Parameters
string$stageRespValue‪Responsible_person value from stage record
Returns
‪string List of backend user ids

Definition at line 457 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\resolveBackendUserIds().

◆ getStageRecord()

array TYPO3\CMS\Workspaces\Service\StagesService::getStageRecord (   $stageid)

Gets a particular stage record.

Parameters
int$stageid
Returns
‪array

Definition at line 290 of file StagesService.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\getRecord().

◆ getStagesForWS()

◆ getStagesForWSUser()

◆ getStageTitle()

◆ getWorkspaceId()

int TYPO3\CMS\Workspaces\Service\StagesService::getWorkspaceId ( )

◆ getWorkspaceRecord()

◆ isNextStageAllowedForUser()

bool TYPO3\CMS\Workspaces\Service\StagesService::isNextStageAllowedForUser (   $stageId)

Check if the user has access to the next stage, relative to the given stage

Parameters
int$stageId
Returns
‪bool

Definition at line 716 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getNextStage(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ isPrevStageAllowedForUser()

bool TYPO3\CMS\Workspaces\Service\StagesService::isPrevStageAllowedForUser (   $stageId)

Check if the user has access to the previous stage, relative to the given stage

Parameters
int$stageId
Returns
‪bool

Definition at line 694 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getPrevStage(), and TYPO3\CMS\Workspaces\Service\StagesService\isStageAllowedForUser().

◆ isStageAllowedForUser()

◆ isValid()

bool TYPO3\CMS\Workspaces\Service\StagesService::isValid (   $stageId)

Determines whether a stage Id is valid.

Parameters
int$stageId‪The stage Id to be checked
Returns
‪bool

Definition at line 753 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS().

◆ prepareStagesArray()

array TYPO3\CMS\Workspaces\Service\StagesService::prepareStagesArray ( array  $stageRecords)
protected

◆ resolveBackendUserIds()

array TYPO3\CMS\Workspaces\Service\StagesService::resolveBackendUserIds (   $backendUserGroupList)

Member Data Documentation

◆ $fetchGroupsCache

array TYPO3\CMS\Workspaces\Service\StagesService::$fetchGroupsCache = array( )
protected

Definition at line 63 of file StagesService.php.

◆ $pathToLocallang

string TYPO3\CMS\Workspaces\Service\StagesService::$pathToLocallang = 'LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf'
private

Path to the locallang file

Definition at line 45 of file StagesService.php.

◆ $recordService

RecordService TYPO3\CMS\Workspaces\Service\StagesService::$recordService
protected

◆ $userGroups

array TYPO3\CMS\Workspaces\Service\StagesService::$userGroups = array( )
protected

◆ $workspaceStageAllowedCache

array TYPO3\CMS\Workspaces\Service\StagesService::$workspaceStageAllowedCache = array( )
protected

Definition at line 59 of file StagesService.php.

◆ $workspaceStageCache

array TYPO3\CMS\Workspaces\Service\StagesService::$workspaceStageCache = array( )
protected

Local cache to reduce number of database queries for stages, groups, etc.

Definition at line 55 of file StagesService.php.

◆ STAGE_EDIT_ID

◆ STAGE_PUBLISH_EXECUTE_ID

◆ STAGE_PUBLISH_ID

◆ TABLE_STAGE

const TYPO3\CMS\Workspaces\Service\StagesService::TABLE_STAGE = 'sys_workspace_stage'