Project

General

Profile

Feature #2797 ยป patch-2797.txt

Sonja Schubert, 2009-03-09 15:15

 
### Eclipse Workspace Patch 1.0
#P igeworkspace42
Index: typo3/sysext/version/cm1/index.php
===================================================================
--- typo3/sysext/version/cm1/index.php (revision 270)
+++ typo3/sysext/version/cm1/index.php (working copy)
@@ -88,6 +88,7 @@
require_once(PATH_t3lib.'class.t3lib_diff.php');
require_once(PATH_typo3.'mod/user/ws/class.wslib.php');
+require_once(PATH_typo3.'mod/user/ws/class.wsstagelib.php');
require_once(PATH_t3lib.'class.t3lib_pagetree.php');
require_once(PATH_t3lib.'class.t3lib_tcemain.php');
@@ -1193,6 +1194,8 @@
* @return string HTML code.
*/
function showStageChangeLog($table,$id,$stageCommands) {
+ global $LANG;
+
$rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows(
'log_data,tstamp,userid',
'sys_log',
@@ -1220,7 +1223,17 @@
$text = 'reset to "Editing"';
break;
default:
- $text = '[undefined]';
+ // Initialize workspace stage object
+ $wsstagelibObj = t3lib_div::makeInstance('wsstagelib');
+ // Check if custom staging is activated in workspace configuration
+ if($wsstagelibObj->checkCustomStagingForWS($this->workspaceId)) {
+ $workspaceStageRec = t3lib_BEfunc::getRecord('sys_workspace_stage',$data['stage']-20);
+ if($workspaceStageRec) {
+ $text = 'sent the element to "'.$workspaceStageRec['title'].'"';
+ }
+ } else {
+ $text = $LANG->getLL('stage_undefined');
+ }
break;
}
$text = t3lib_BEfunc::dateTime($dat['tstamp']).': "'.$username.'" '.$text;
@@ -1583,7 +1596,13 @@
* @return string HTML content, mainly link tags and images.
*/
function displayWorkspaceOverview_stageCmd($table,&$rec_off) {
-#debug($rec_off['t3ver_stage']);
+ #debug($rec_off['t3ver_stage']);
+ global $LANG;
+ $this->workspaceId = (!is_null($wsid) ? $wsid : $GLOBALS['BE_USER']->workspace);
+
+ // Initialize workspace stage object
+ $wsstagelibObj = t3lib_div::makeInstance('wsstagelib');
+
switch((int)$rec_off['t3ver_stage']) {
case 0:
$sId = 1;
@@ -1614,6 +1633,20 @@
$sLabel = 'Undefined';
$sId = 0;
$color = '';
+
+ // Check if custom staging is activated in workspace configuration
+ if($wsstagelibObj->checkCustomStagingForWS($this->workspaceId)) {
+ $workspaceStageRec = t3lib_BEfunc::getRecord('sys_workspace_stage',$rec_off['t3ver_stage']-20);
+ if($workspaceStageRec) {
+ $sLabel = $workspaceStageRec['title'];
+ // Next custom stage
+ $nextStage = $wsstagelibObj->getNextStage($this->workspaceId,$rec_off['t3ver_stage']);
+ // ID of next stage
+ $sId = $nextStage['uid'];
+ $color = '#999999';
+ $titleAttrib = $LANG->getLL('label_sendToNextStage');
+ }
+ }
break;
}
#debug($sId);
@@ -1621,12 +1654,21 @@
$raiseOk = !$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table,$rec_off);
if ($raiseOk && $rec_off['t3ver_stage']!=-1) {
- $onClick = 'var commentTxt=window.prompt("Please explain why you reject:","");
+ // Check if custom staging is activated in workspace configuration
+ if($wsstagelibObj->checkCustomStagingForWS($rec_off['t3ver_wsid'])) {
+ // Reject id for custom stage reject is -21 instead of -1
+ $onClick = 'var commentTxt=null;window.location.href="'.
+ $this->doc->backPath.'mod.php?M=user_txversionM2'.
+ '&diffOnly=1&pageId='.t3lib_div::GPvar('id').'&items['.$table.':'.$rec_off['uid'].':'.$rec_off['t3ver_stage'].':'.$rec_off['t3ver_wsid'].']=1";'.
+ ' return false;';
+ } else {
+ $onClick = 'var commentTxt=window.prompt("Please explain why you reject:","");
if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
'&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
'&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]=-1'
).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
' return false;';
+ }
// Reject:
$actionLinks.=
'<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
@@ -1642,12 +1684,19 @@
// Raise
if ($raiseOk) {
- $onClick = 'var commentTxt=window.prompt("'.$label.'","");
+ if($wsstagelibObj->checkCustomStagingForWS($rec_off['t3ver_wsid'])) {
+ $onClick = 'var commentTxt=null;window.location.href="'.
+ $this->doc->backPath.'mod.php?M=user_txversionM2'.
+ '&diffOnly=1&pageId='.t3lib_div::GPvar('id').'&items['.$table.':'.$rec_off['uid'].':'.$rec_off['t3ver_stage'].':'.$rec_off['t3ver_wsid'].']=1";'.
+ ' return false;';
+ } else {
+ $onClick = 'var commentTxt=window.prompt("'.$label.'","");
if (commentTxt!=null) {window.location.href="'.$this->doc->issueCommand(
'&cmd['.$table.']['.$rec_off['uid'].'][version][action]=setStage'.
'&cmd['.$table.']['.$rec_off['uid'].'][version][stageId]='.$sId
).'&cmd['.$table.']['.$rec_off['uid'].'][version][comment]="+escape(commentTxt);}'.
' return false;';
+ }
if ($rec_off['t3ver_stage']!=10) {
$actionLinks.=
'<a href="#" onclick="'.htmlspecialchars($onClick).'">'.
    (1-1/1)