‪TYPO3CMS  11.5
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 null getStageRecord ($stageid)
 
array getNextStage ($stageId)
 
array getNextStages (array &$nextStageArray, $stageId)
 
bool array getPrevStage ($stageId)
 
array getPrevStages (array &$prevStageArray, $stageId)
 
array getResponsibleBeUser ($stageRecord, $selectDefaultUserField=false)
 
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( )
 

Private Attributes

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

Detailed Description

Stages service

Definition at line 31 of file StagesService.php.

Member Function Documentation

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

References 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 123 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 335 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 557 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 75 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 396 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 534 of file StagesService.php.

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

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 422 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().

◆ getStageRecord()

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

Gets a particular stage record.

Parameters
int$stageid
Returns
‪array|null

Definition at line 283 of file StagesService.php.

◆ getStagesForWS()

◆ getStagesForWSUser()

◆ getStageTitle()

◆ 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 608 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 586 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 645 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)

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,...")

Parameters
string$backendUserGroupList
Returns
‪array

Definition at line 451 of file StagesService.php.

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

Referenced by TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getDefaultRecipients(), TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\getMembers(), TYPO3\CMS\Workspaces\Domain\Record\WorkspaceRecord\getOwners(), and TYPO3\CMS\Workspaces\Domain\Record\StageRecord\getResponsiblePersons().

Member Data Documentation

◆ $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 44 of file StagesService.php.

◆ $recordService

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

◆ $workspaceStageAllowedCache

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

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