implemented saving of layout data for workflows

This commit is contained in:
Uwe Steinmann 2016-08-31 11:54:15 +02:00
parent 2418675822
commit 84a65f0f32
2 changed files with 25 additions and 3 deletions

View File

@ -2315,7 +2315,7 @@ class SeedDMS_Core_DMS {
$initstate = $this->getWorkflowState($resArr[0]['initstate']); $initstate = $this->getWorkflowState($resArr[0]['initstate']);
$workflow = new SeedDMS_Core_Workflow($resArr[0]["id"], $resArr[0]["name"], $initstate); $workflow = new SeedDMS_Core_Workflow($resArr[0]["id"], $resArr[0]["name"], $initstate, $resArr[0]["layoutdata"]);
$workflow->setDMS($this); $workflow->setDMS($this);
return $workflow; return $workflow;
@ -2341,7 +2341,7 @@ class SeedDMS_Core_DMS {
$initstate = $this->getWorkflowState($resArr[0]['initstate']); $initstate = $this->getWorkflowState($resArr[0]['initstate']);
$workflow = new SeedDMS_Core_Workflow($resArr[0]["id"], $resArr[0]["name"], $initstate); $workflow = new SeedDMS_Core_Workflow($resArr[0]["id"], $resArr[0]["name"], $initstate, $resArr[0]["layoutdata"]);
$workflow->setDMS($this); $workflow->setDMS($this);
return $workflow; return $workflow;

View File

@ -42,6 +42,13 @@ class SeedDMS_Core_Workflow { /* {{{ */
*/ */
var $_initstate; var $_initstate;
/**
* @var data for rendering graph
*
* @access protected
*/
var $_layoutdata;
/** /**
* @var name of the workflow state * @var name of the workflow state
* *
@ -56,10 +63,11 @@ class SeedDMS_Core_Workflow { /* {{{ */
*/ */
var $_dms; var $_dms;
function __construct($id, $name, $initstate) { /* {{{ */ function __construct($id, $name, $initstate, $layoutdata) { /* {{{ */
$this->_id = $id; $this->_id = $id;
$this->_name = $name; $this->_name = $name;
$this->_initstate = $initstate; $this->_initstate = $initstate;
$this->_layoutdata = $layoutdata;
$this->_transitions = null; $this->_transitions = null;
$this->_dms = null; $this->_dms = null;
} /* }}} */ } /* }}} */
@ -98,6 +106,20 @@ class SeedDMS_Core_Workflow { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
function getLayoutData() { return $this->_layoutdata; }
function setLayoutData($newdata) { /* {{{ */
$db = $this->_dms->getDB();
$queryStr = "UPDATE tblWorkflows SET layoutdata = ".$db->qstr($newdata)." WHERE id = " . $this->_id;
$res = $db->getResult($queryStr);
if (!$res)
return false;
$this->_layoutdata = $newdata;
return true;
} /* }}} */
function getTransitions() { /* {{{ */ function getTransitions() { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();