31 'label' =>
'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod_user_ws.xlf:stage_editing'
35 'label' =>
'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:stage_ready_to_publish'
39 'label' =>
'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod_user_ws.xlf:stage_publish'
47 'notification_defaults',
48 'notification_preselection',
49 'allow_notificaton_settings'
72 public static function get($uid, array
$record =
null)
77 $record = static::fetch(
'sys_workspace', $uid);
87 if (!isset($this->owners)) {
98 if (!isset($this->members)) {
109 if (!isset($this->stages)) {
113 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)
114 ->getQueryBuilderForTable(
'sys_workspace_stage');
116 $result = $queryBuilder
118 ->from(
'sys_workspace_stage')
120 $queryBuilder->expr()->eq(
122 $queryBuilder->createNamedParameter($this->getUid(), \PDO::PARAM_INT)
124 $queryBuilder->expr()->eq(
126 $queryBuilder->createNamedParameter(
'sys_workspace', \PDO::PARAM_STR)
132 while (
$record = $result->fetch()) {
149 $stageId = (int)$stageId;
151 if (!isset($this->stages[$stageId])) {
154 return $this->stages[$stageId];
163 $stageId = (int)$stageId;
165 $stageIndex = array_search($stageId, $stageIds);
168 if (empty($stageIndex)) {
172 $previousStageId = $stageIds[$stageIndex - 1];
173 return $this->stages[$previousStageId];
182 $stageId = (int)$stageId;
184 $stageIndex = array_search($stageId, $stageIds);
186 if ($stageIndex ===
false || !isset($stageIds[$stageIndex + 1])) {
190 $nextStageId = $stageIds[$stageIndex + 1];
191 return $this->stages[$nextStageId];
199 $this->stages[$stage->
getUid()] = $stage;
209 $stageId = (int)$stageId;
211 if (!isset($this->internalStages[$stageId])) {
212 throw new \RuntimeException(
'Invalid internal stage "' . $stageId .
'"', 1476048246);
217 'title' => static::getLanguageService()->sL($this->internalStages[$stageId][
'label'])
220 $fieldNamePrefix = $this->internalStages[$stageId][
'name'] .
'_';
221 foreach ($this->internalStageFieldNames as $fieldName) {
222 $record[$fieldName] = $this->record[$fieldNamePrefix . $fieldName];
226 $stage->setInternal(
true);