* @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ /** * Include parent class */ //require_once("class.Bootstrap.php"); /** * Class which outputs the html page for Rewindorkflow view * * @category DMS * @package SeedDMS * @author Markus Westphal, Malcolm Cowe, Uwe Steinmann * @copyright Copyright (C) 2002-2005 Markus Westphal, * 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli, * 2010-2012 Uwe Steinmann * @version Release: @package_version@ */ class SeedDMS_View_RewindWorkflow extends SeedDMS_Theme_Style { function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $folder = $this->params['folder']; $accessobject = $this->params['accessobject']; $document = $this->params['document']; $latestContent = $document->getLatestContent(); $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->globalNavigation($folder); $this->contentStart(); $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); $this->contentHeading(getMLText("rewind_workflow")); $currentstate = $latestContent->getWorkflowState(); $wkflogs = $latestContent->getWorkflowLog(); $wkflog = array_shift($wkflogs); $workflow = $latestContent->getWorkflow(); if($currentstate) { $msg = "The document is currently in state: ".$currentstate->getName()."
"; if($wkflog) { foreach($wkflog as $entry) { if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) { $enterdate = $entry->getDate(); $enterts = makeTsFromLongDate($enterdate); } } if(!empty($enterdate)) { $msg .= "The state was entered at ".$enterdate." which was "; $msg .= getReadableDuration((time()-$enterts))." ago.
"; } } $msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec."; } else { $msg = getMLText('workflow_in_unknown_state'); } // Display the Workflow form. $this->rowStart(); $this->columnStart(4); $this->infoMsg($msg); $this->warningMsg(getMLText("rewind_workflow_warning")); ?>
columnEnd(); $this->columnStart(8); ?>
check_view_access('WorkflowGraph')) { ?>
columnEnd(); $this->rowEnd(); if($wkflog) { $this->contentHeading(getMLText("workflow_log")); echo ""; echo ""; foreach($wkflog as $entry) { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } echo "
".getMLText('action')."Start stateEnd state".getMLText('date')."".getMLText('user')."".getMLText('comment')."
".htmlspecialchars(getMLText('action_'.$entry->getTransition()->getAction()->getName()))."".htmlspecialchars($entry->getTransition()->getState()->getName())."".htmlspecialchars($entry->getTransition()->getNextState()->getName())."".$entry->getDate()."".htmlspecialchars($entry->getUser()->getFullname())."".htmlspecialchars($entry->getComment())."
\n"; } $this->contentEnd(); $this->htmlEndPage(); } /* }}} */ } ?>