Beispiel #1
0
    /**
     * Links to stage change of a version
     *
     * @param	string		Table name
     * @param	array		Offline record (version)
     * @return	string		HTML content, mainly link tags and images.
     */
    function displayWorkspaceOverview_stageCmd($table, &$rec_off)
    {
        #debug($rec_off['t3ver_stage']);
        switch ((int) $rec_off['t3ver_stage']) {
            case 0:
                $sId = 1;
                $sLabel = $GLOBALS['LANG']->getLL('editing');
                $color = '#666666';
                $label = $GLOBALS['LANG']->getLL('commentForReviewer');
                $titleAttrib = $GLOBALS['LANG']->getLL('sendToReview');
                break;
            case 1:
                $sId = 10;
                $sLabel = $GLOBALS['LANG']->getLL('review');
                $color = '#6666cc';
                $label = $GLOBALS['LANG']->getLL('commentForPublisher');
                $titleAttrib = $GLOBALS['LANG']->getLL('approveForPublishing');
                break;
            case 10:
                $sLabel = $GLOBALS['LANG']->getLL('publish');
                $color = '#66cc66';
                break;
            case -1:
                $sLabel = $this->doc->icons(2) . $GLOBALS['LANG']->getLL('rejected');
                $sId = 0;
                $color = '#ff0000';
                $label = $GLOBALS['LANG']->getLL('comment');
                $titleAttrib = $GLOBALS['LANG']->getLL('resetStage');
                break;
            default:
                $sLabel = $GLOBALS['LANG']->getLL('undefined');
                $sId = 0;
                $color = '';
                break;
        }
        #debug($sId);
        $raiseOk = !$GLOBALS['BE_USER']->workspaceCannotEditOfflineVersion($table, $rec_off);
        if ($raiseOk && $rec_off['t3ver_stage'] != -1) {
            $onClick = 'var commentTxt=window.prompt("' . $GLOBALS['LANG']->getLL('rejectExplain') . '","");
							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) . '" title="' . $GLOBALS['LANG']->getLL('reject', TRUE) . '">' . t3lib_iconWorks::getSpriteIcon('actions-move-down') . '</a>';
        } else {
            // Reject:
            $actionLinks .= '<img src="' . $this->doc->backPath . 'gfx/clear.gif" width="14" height="14" alt="" align="top" title="" />';
        }
        $actionLinks .= '<span style="background-color: ' . $color . '; color: white;">' . $sLabel . '</span>';
        // Raise
        if ($raiseOk) {
            $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) . '" title="' . htmlspecialchars($titleAttrib) . '">' . t3lib_iconWorks::getSpriteIcon('actions-move-up') . '</a>';
                $this->stageIndex[$sId][$table][] = $rec_off['uid'];
                $this->recIndex[$table][$rec_off['uid']] = $sId;
            }
        }
        return $actionLinks;
    }