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

Public Member Functions

 getWorkspaceId ()
 
array getPreviousStageForElementCollection (array $workspaceItems, array $byTableName=['tt_content', 'pages'])
 
array getNextStageForElementCollection (array $workspaceItems, array $byTableName=['tt_content', 'pages'])
 
array getAllStagesOfWorkspace ()
 
array getStagesForWSUser ()
 
 getStageTitle (int $stageId)
 
array getNextStage (int $stageId)
 
false array getPrevStage (int $stageId)
 
array getResponsibleBeUser (StageRecord|int $stageRecord, bool $selectDefaultUserField=false)
 
 resolveBackendUserIds (string $backendUserGroupList)
 
 getBackendUsers (array $backendUserIds)
 
 getPreselectedRecipients (StageRecord $stageRecord)
 
 getPropertyOfCurrentWorkspaceStage (int $stageId, string $property)
 
array getPositionOfCurrentStage (int $stageId)
 
 isPrevStageAllowedForUser (int $stageId)
 
 isNextStageAllowedForUser (int $stageId)
 
 isValid (int $stageId)
 
 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

 prepareStagesArray (array $stageRecords)
 
array getNextStages (array &$nextStageArray, int $stageId)
 
array getPrevStages (array &$prevStageArray, int $stageId)
 
 getWorkspaceRecord ()
 
 isStageAllowedForUser (int $stageId)
 
 getBackendUser ()
 
 getLanguageService ()
 

Protected Attributes

RecordService $recordService
 
array $workspaceStageCache = []
 
array $workspaceStageAllowedCache = []
 

Private Attributes

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

Detailed Description

Definition at line 32 of file StagesService.php.

Member Function Documentation

◆ getAllStagesOfWorkspace()

◆ getBackendUser()

◆ getBackendUsers()

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

Gets backend user records from a given list of ids.

Definition at line 435 of file StagesService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\intExplode().

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

◆ getLanguageService()

TYPO3\CMS\Workspaces\Service\StagesService::getLanguageService ( )
protected

◆ getNextStage()

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

◆ getNextStageForElementCollection()

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

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

Returns
‪array Current and next possible stage.

Definition at line 110 of file StagesService.php.

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

◆ getNextStages()

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

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 300 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 ( int  $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

Returns
‪array position => 3, count => 20

Definition at line 482 of file StagesService.php.

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

◆ getPreselectedRecipients()

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

◆ getPreviousStageForElementCollection()

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

◆ getPrevStage()

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

Get next stage in process for given stage id

Parameters
int$stageId‪Id of the stage to fetch the previous one for
Returns
‪false|array The previous stage or false

Definition at line 328 of file StagesService.php.

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

Referenced by TYPO3\CMS\Workspaces\Service\StagesService\getPreviousStageForElementCollection(), TYPO3\CMS\Workspaces\Service\StagesService\getPrevStages(), and TYPO3\CMS\Workspaces\Service\StagesService\isPrevStageAllowedForUser().

◆ getPrevStages()

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

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 354 of file StagesService.php.

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

◆ getPropertyOfCurrentWorkspaceStage()

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

Gets a property of a workspaces stage.

Definition at line 466 of file StagesService.php.

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

◆ getRecordService()

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

◆ getResponsibleBeUser()

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

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

Parameters
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 380 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\getBackendUsers(), and TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceRecord().

◆ getStagesForWSUser()

◆ getStageTitle()

◆ getWorkspaceId()

◆ getWorkspaceRecord()

◆ isNextStageAllowedForUser()

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

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

Definition at line 527 of file StagesService.php.

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

◆ isPrevStageAllowedForUser()

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

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

Definition at line 508 of file StagesService.php.

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

◆ isStageAllowedForUser()

◆ isValid()

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

Determines whether a stageId is valid.

Definition at line 557 of file StagesService.php.

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

◆ prepareStagesArray()

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

◆ resolveBackendUserIds()

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

Resolves backend user ids from a mixed list of backend users and backend user groups (e.g. "be_users_1,be_groups_3,be_users_4,...")

Definition at line 404 of file StagesService.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

Member Data Documentation

◆ $pathToLocallang

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

Definition at line 41 of file StagesService.php.

◆ $recordService

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

◆ $workspaceStageAllowedCache

array TYPO3\CMS\Workspaces\Service\StagesService::$workspaceStageAllowedCache = []
protected

Definition at line 49 of file StagesService.php.

◆ $workspaceStageCache

array TYPO3\CMS\Workspaces\Service\StagesService::$workspaceStageCache = []
protected

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

Definition at line 48 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'