TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Workspaces\Service\StagesService Class Reference
Inheritance diagram for TYPO3\CMS\Workspaces\Service\StagesService:
Tx_Workspaces_Service_Stages

Public Member Functions

 getWorkspaceId ()
 
 getPreviousStageForElementCollection ( $workspaceItems, array $byTableName=array('tt_content', 'pages', 'pages_language_overlay'))
 
 getNextStageForElementCollection ( $workspaceItems, array $byTableName=array('tt_content', 'pages', 'pages_language_overlay'))
 
 getStagesForWS ()
 
 getStagesForWSUser ()
 
 checkCustomStagingForWS ()
 
 getStageTitle ($ver_stage)
 
 getStageRecord ($stageid)
 
 getNextStage ($stageId)
 
 getNextStages (array &$nextStageArray, $stageId)
 
 getPrevStage ($stageId)
 
 getPrevStages (array &$prevStageArray, $stageId)
 
 getResponsibleBeUser ($stageId, $selectDefaultUserField=FALSE)
 
 getResponsibleUser ($stageRespValue)
 
 getPropertyOfCurrentWorkspaceStage ($stageId, $property)
 
 getPositionOfCurrentStage ($stageId)
 
 isPrevStageAllowedForUser ($stageId)
 
 isNextStageAllowedForUser ($stageId)
 
 isValid ($stageId)
 
 getNotificationMode ($stageId)
 

Public Attributes

const TABLE_STAGE = 'sys_workspace_stage'
 
const STAGE_PUBLISH_EXECUTE_ID = -20
 
const STAGE_PUBLISH_ID = -10
 
const STAGE_EDIT_ID = 0
 
const MODE_NOTIFY_SOMEONE = 0
 
const MODE_NOTIFY_ALL = 1
 
const MODE_NOTIFY_ALL_STRICT = 2
 

Protected Member Functions

 isStageAllowedForUser ($stageId)
 
 getBackendUser ()
 

Protected Attributes

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

Private Member Functions

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

Private Attributes

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

Detailed Description

Stages service

Author
Workspaces Team (http://forge.typo3.org/projects/show/typo3v4-workspaces)

Definition at line 24 of file StagesService.php.

Member Function Documentation

◆ checkCustomStagingForWS()

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

Check if given workspace has custom staging activated

Returns
boolean
Deprecated:
since TYPO3 6.2, will be removed two versions later not used anymore in the TYPO3 CMS Core

Definition at line 260 of file StagesService.php.

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

◆ fetchGroups()

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

◆ fetchGroupsFromDB()

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

Definition at line 540 of file StagesService.php.

References $GLOBALS.

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

◆ fetchGroupsRecursive()

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

◆ getBackendUser()

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

Definition at line 753 of file StagesService.php.

References $GLOBALS.

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

◆ getNextStage()

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

◆ getNextStageForElementCollection()

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

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.
Author
Michael Klapper devel.nosp@m.opme.nosp@m.nt@mo.nosp@m.rpho.nosp@m.do.co.nosp@m.m

Definition at line 131 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()

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$nextStageArrayNext stages
integer$stageIdCurrent stage id of the record
Returns
array Next stages

Definition at line 346 of file StagesService.php.

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

◆ getNotificationMode()

TYPO3\CMS\Workspaces\Service\StagesService::getNotificationMode (   $stageId)

Returns the notification mode from stage configuration

Return values: 0 = notify someone / old way / default setting 1 = notify all responsible users (some users checked per default and you're not allowed to uncheck them) 2 = notify all responsible users (all users are checked and nothing can be changed during stage change)

Parameters
integer$stageIdStage id to return the notification mode for
Returns
integer
Exceptions

Definition at line 727 of file StagesService.php.

References $GLOBALS, and TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceId().

◆ getPositionOfCurrentStage()

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
integer$stageId
Returns
array position => 3, count => 20

Definition at line 615 of file StagesService.php.

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

◆ getPreviousStageForElementCollection()

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

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

Parameters
array$workspaceItems
array$byTableName
Returns
array Current and next highest possible stage
Author
Michael Klapper devel.nosp@m.opme.nosp@m.nt@mo.nosp@m.rpho.nosp@m.do.co.nosp@m.m

Definition at line 82 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()

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

Get next stage in process for given stage id

Parameters
integer$stageIdId of the stage to fetch the previous one for
Returns
integer The previous stage Id
Exceptions

Definition at line 377 of file StagesService.php.

References $GLOBALS, and TYPO3\CMS\Workspaces\Service\StagesService\getStagesForWS().

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

◆ getPrevStages()

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$prevStageArrayPrev stages
integer$stageIdCurrent stage id of the record
Returns
array prev stages

Definition at line 406 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 (   $stageId,
  $property 
)

Gets a property of a workspaces stage.

Parameters
integer$stageId
string$property
Returns
string
Exceptions

Definition at line 596 of file StagesService.php.

References $GLOBALS, and $result.

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

◆ getResponsibleBeUser()

TYPO3\CMS\Workspaces\Service\StagesService::getResponsibleBeUser (   $stageId,
  $selectDefaultUserField = FALSE 
)

Get array of all responsilbe be_users for a stage

Parameters
integer$stageIdStage id
boolean$selectDefaultUserFieldIf field notification_defaults should be selected instead of responsible users
Returns
array be_users with e-mail and name

Definition at line 430 of file StagesService.php.

References TYPO3\CMS\Backend\Utility\BackendUtility\BEenableFields(), TYPO3\CMS\Workspaces\Service\StagesService\getPropertyOfCurrentWorkspaceStage(), TYPO3\CMS\Workspaces\Service\StagesService\getResponsibleUser(), TYPO3\CMS\Backend\Utility\BackendUtility\getUserNames(), and TYPO3\CMS\Workspaces\Service\StagesService\getWorkspaceId().

◆ getResponsibleUser()

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

Get uids of all responsilbe persons for a stage

Parameters
string$stageRespValueResponsible_person value from stage record
Returns
string Uid list of responsible be_users

Definition at line 481 of file StagesService.php.

References TYPO3\CMS\Workspaces\Service\StagesService\fetchGroups(), TYPO3\CMS\Backend\Utility\BackendUtility\getUserNames(), TYPO3\CMS\Core\Utility\GeneralUtility\inList(), and TYPO3\CMS\Core\Utility\GeneralUtility\trimExplode().

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

◆ getStageRecord()

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

Gets a particular stage record.

Parameters
integer$stageid
Returns
array

Definition at line 299 of file StagesService.php.

◆ getStagesForWS()

◆ getStagesForWSUser()

◆ getStageTitle()

TYPO3\CMS\Workspaces\Service\StagesService::getStageTitle (   $ver_stage)

Gets the title of a stage.

Parameters
integer$ver_stage
Returns
string

Definition at line 271 of file StagesService.php.

References $GLOBALS, and TYPO3\CMS\Workspaces\Service\StagesService\getPropertyOfCurrentWorkspaceStage().

◆ getWorkspaceId()

◆ isNextStageAllowedForUser()

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

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

Parameters
integer$stageId
Returns
boolean

Definition at line 665 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 (   $stageId)

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

Parameters
integer$stageId
Returns
boolean

Definition at line 643 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 (   $stageId)

Determines whether a stage Id is valid.

Parameters
integer$stageIdThe stage Id to be checked
Returns
boolean

Definition at line 703 of file StagesService.php.

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

Member Data Documentation

◆ $fetchGroupsCache

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

Definition at line 58 of file StagesService.php.

◆ $pathToLocallang

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

Definition at line 41 of file StagesService.php.

◆ $userGroups

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

◆ $workspaceStageAllowedCache

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

Definition at line 53 of file StagesService.php.

◆ $workspaceStageCache

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

Definition at line 48 of file StagesService.php.

◆ MODE_NOTIFY_ALL

const TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL = 1

Definition at line 33 of file StagesService.php.

◆ MODE_NOTIFY_ALL_STRICT

const TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_ALL_STRICT = 2

Definition at line 34 of file StagesService.php.

◆ MODE_NOTIFY_SOMEONE

const TYPO3\CMS\Workspaces\Service\StagesService::MODE_NOTIFY_SOMEONE = 0

Definition at line 32 of file StagesService.php.

◆ STAGE_EDIT_ID

const TYPO3\CMS\Workspaces\Service\StagesService::STAGE_EDIT_ID = 0

Definition at line 31 of file StagesService.php.

◆ STAGE_PUBLISH_EXECUTE_ID

const TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_EXECUTE_ID = -20

Definition at line 28 of file StagesService.php.

◆ STAGE_PUBLISH_ID

const TYPO3\CMS\Workspaces\Service\StagesService::STAGE_PUBLISH_ID = -10

◆ TABLE_STAGE

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

Definition at line 26 of file StagesService.php.