* @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 WorkspaceMgr 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_WorkflowGraph extends SeedDMS_Bootstrap_Style { function printGraph() { /* {{{ */ $transitions = $this->workflow->getTransitions(); if($transitions) { foreach($transitions as $transition) { $action = $transition->getAction(); $maxtime = $transition->getMaxTime(); $state = $transition->getState(); $nextstate = $transition->getNextState(); if(1 || !isset($this->actions[$action->getID()])) { $color = "#4B4"; $iscurtransition = $this->curtransition && $transition->getID() == $this->curtransition->getID(); if($iscurtransition) { $color = "#D00"; } else { if($this->wkflog) { foreach($this->wkflog as $entry) { if($entry->getTransition()->getID() == $transition->getID()) { $color = "#DDD"; break; } } } } $this->actions[$action->getID()] = $action->getID(); $transusers = $transition->getUsers(); $unames = array(); foreach($transusers as $transuser) { $unames[] = $transuser->getUser()->getFullName(); } echo "ggg.addNode(\"A".$transition->getID()."-".$action->getID()."\", { render: render_action, maxtime: \"".str_replace('"', "\\\"", implode(", ", $unames))."\", label : \"".str_replace('"', "\\\"", $action->getName())."\", color: '".$color."' });\n"; } if(!isset($this->states[$state->getID()])) { $this->states[$state->getID()] = $state; $initstate = ''; if($state == $this->workflow->getInitState()) $initstate = " (START)"; echo "ggg.addNode(\"S".$state->getID()."\", { label : \"".str_replace('"', "\\\"", $state->getName()." ".$initstate)."\" });\n"; } if(!isset($this->states[$nextstate->getID()])) { $this->states[$state->getID()] = $nextstate; echo "ggg.addNode(\"S".$nextstate->getID()."\", { label : \"".str_replace('"', "\\\"", $nextstate->getName())."\" });\n"; } } foreach($transitions as $transition) { if(!in_array($transition->getID(), $this->seentrans)) { $state = $transition->getState(); $nextstate = $transition->getNextState(); $action = $transition->getAction(); $iscurtransition = $this->curtransition && $transition->getID() == $this->curtransition->getID(); echo "ggg.addEdge(\"S".$state->getID()."\",\"A".$transition->getID()."-".$action->getID()."\", { ".($iscurtransition ? "stroke: '#D00', 'stroke-width': '2px'" : "")." });\n"; echo "ggg.addEdge(\"A".$transition->getID()."-".$action->getID()."\",\"S".$nextstate->getID()."\", { ".($iscurtransition ? "stroke: '#D00', 'stroke-width': '2px'" : "")." });\n"; $this->seentrans[] = $transition->getID(); } } } } /* }}} */ function show() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; $this->workflow = $this->params['workflow']; $this->curtransition = $this->params['transition']; $document = $this->params['document']; if($document) { $latestContent = $document->getLatestContent(); $this->wkflog = $latestContent->getWorkflowLog(); } else { $this->wkflog = array(); } $this->htmlAddHeader( ''."\n". ''."\n". ''."\n". ''."\n"); $this->htmlStartPage(getMLText("admin_tools")); // $this->contentContainerStart(); ?>
contentContainerEnd(); echo "\n\n"; } /* }}} */ } ?>