2 namespace TYPO3\CMS\Workspaces\Domain\Record;
30 'label' =>
'LLL:EXT:lang/locallang_mod_user_ws.xlf:stage_editing'
34 'label' =>
'LLL:EXT:workspaces/Resources/Private/Language/locallang_mod.xlf:stage_ready_to_publish'
38 'label' =>
'LLL:EXT:lang/locallang_mod_user_ws.xlf:stage_publish'
46 'notification_defaults',
47 'notification_preselection',
48 'allow_notificaton_settings'
71 public static function get($uid, array
$record = null)
76 $record = static::fetch(
'sys_workspace', $uid);
86 if (!isset($this->owners)) {
87 $this->owners = $this->
getStagesService()->resolveBackendUserIds($this->record[
'adminusers']);
97 if (!isset($this->members)) {
98 $this->members = $this->
getStagesService()->resolveBackendUserIds($this->record[
'members']);
108 if (!isset($this->stages)) {
109 $this->stages = array();
112 $records = self::getDatabaseConnection()->exec_SELECTgetRows(
113 '*',
'sys_workspace_stage',
114 'deleted=0 AND parentid=' . $this->
getUid() .
' AND parenttable='
115 . self::getDatabaseConnection()->fullQuoteStr(
'sys_workspace',
'sys_workspace_stage'),
118 if (!empty($records)) {
119 foreach ($records as
$record) {
137 $stageId = (int)$stageId;
139 if (!isset($this->stages[$stageId])) {
142 return $this->stages[$stageId];
151 $stageId = (int)$stageId;
152 $stageIds = array_keys($this->
getStages());
153 $stageIndex = array_search($stageId, $stageIds);
156 if (empty($stageIndex)) {
160 $previousStageId = $stageIds[$stageIndex - 1];
161 return $this->stages[$previousStageId];
170 $stageId = (int)$stageId;
171 $stageIds = array_keys($this->
getStages());
172 $stageIndex = array_search($stageId, $stageIds);
174 if ($stageIndex ===
false || !isset($stageIds[$stageIndex + 1])) {
178 $nextStageId = $stageIds[$stageIndex + 1];
179 return $this->stages[$nextStageId];
187 $this->stages[$stage->
getUid()] = $stage;
197 $stageId = (int)$stageId;
199 if (!isset($this->internalStages[$stageId])) {
200 throw new \RuntimeException(
'Invalid internal stage "' . $stageId .
'"');
205 'title' => static::getLanguageService()->sL($this->internalStages[$stageId][
'label'])
208 $fieldNamePrefix = $this->internalStages[$stageId][
'name'] .
'_';
209 foreach ($this->internalStageFieldNames as $fieldName) {
210 $record[$fieldName] = $this->record[$fieldNamePrefix . $fieldName];
214 $stage->setInternal(
true);