Project

General

Profile

Feature #2793 ยป patch-2793.txt

Sonja Schubert, 2009-03-09 14:46

 
### Eclipse Workspace Patch 1.0
#P igeworkspace42
Index: t3lib/class.t3lib_tcemain.php
===================================================================
--- t3lib/class.t3lib_tcemain.php (revision 270)
+++ t3lib/class.t3lib_tcemain.php (working copy)
@@ -4707,7 +4707,25 @@
$record = t3lib_BEfunc::getRecord($table, $id);
$stat = $this->BE_USER->checkWorkspace($record['t3ver_wsid']);
- if (t3lib_div::inList('admin,online,offline,reviewer,owner', $stat['_ACCESS']) || ($stageId<=1 && $stat['_ACCESS']==='member')) {
+ // get current workspace information
+ $wsid = $GLOBALS['BE_USER']->workspace;
+ $workspaceRec = $GLOBALS['BE_USER']->workspaceRec;
+ $changeStageAccess = FALSE;
+
+ if($workspaceRec['use_custom_staging'] == '1' && $stageId !== '10') { // Check if custom staging is activated
+ if($record['t3ver_stage'] !== '0') {
+ $workspaceCurrentStageRec = t3lib_BEfunc::getRecord('sys_workspace_stage', $record['t3ver_stage']-20);
+ if((t3lib_div::inList($workspaceCurrentStageRec['responsible_persons'],$GLOBALS['BE_USER']->user['uid']) && $stat['_ACCESS']==='member') ||
+ ($stat['_ACCESS']==='owner')) { // Only if the user is responsible for the element in the current stage or he is owner he's allowed to change the stage forward or backwards
+ $changeStageAccess = TRUE;
+ }
+ } elseif(($record['t3ver_stage'] === '0') && ($stat['_ACCESS']==='member')) {
+ $changeStageAccess = TRUE;
+ }
+ }
+
+ // check regular staging permissions and check the advanced staging permission
+ if (t3lib_div::inList('admin,online,offline,reviewer,owner', $stat['_ACCESS']) || ($stageId<=1 && $stat['_ACCESS']==='member') || $changeStageAccess) {
// Set stage of record:
$sArray = array();
Index: t3lib/class.t3lib_userauthgroup.php
===================================================================
--- t3lib/class.t3lib_userauthgroup.php (revision 270)
+++ t3lib/class.t3lib_userauthgroup.php (working copy)
@@ -798,11 +798,19 @@
if ($this->workspace>0) {
$stat = $this->checkWorkspaceCurrent();
- $memberStageLimit = $this->workspaceRec['review_stage_edit'] ? 1 : 0;
- if (($stage<=$memberStageLimit && $stat['_ACCESS']==='member') ||
- ($stage<=1 && $stat['_ACCESS']==='reviewer') ||
- ($stat['_ACCESS']==='owner')) {
- return TRUE; // OK for these criteria
+ if($this->workspaceRec['use_custom_staging'] == '1' && $stage !== '0' && $stage !== '10') { // Check if custom staging is activated
+ $workspaceStageRec = t3lib_BEfunc::getRecord('sys_workspace_stage', $stage-20); // Get custom stage record
+ if((t3lib_div::inList($workspaceStageRec['responsible_persons'],$this->user['uid']) && $stat['_ACCESS']==='member') ||
+ ($stat['_ACCESS']==='owner')) {
+ return TRUE; // OK for these criteria
+ }
+ } else {
+ $memberStageLimit = $this->workspaceRec['review_stage_edit'] ? 1 : 0;
+ if (($stage<=$memberStageLimit && $stat['_ACCESS']==='member') ||
+ ($stage<=1 && $stat['_ACCESS']==='reviewer') ||
+ ($stat['_ACCESS']==='owner')) {
+ return TRUE; // OK for these criteria
+ }
}
} else return TRUE; // Always OK for live and draft workspaces.
}
    (1-1/1)