fix indenting which broke in last merge

This commit is contained in:
Uwe Steinmann 2018-02-08 14:30:33 +01:00
parent fe8e6f5a24
commit 7c98ede3fd

View File

@ -56,12 +56,12 @@ class SeedDMS_Core_Workflow { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow constructor. * SeedDMS_Core_Workflow constructor.
* @param int $id * @param int $id
* @param string $name * @param string $name
* @param SeedDMS_Core_Workflow_State $initstate * @param SeedDMS_Core_Workflow_State $initstate
*/ */
function __construct($id, $name, $initstate) { /* {{{ */ function __construct($id, $name, $initstate) { /* {{{ */
$this->_id = $id; $this->_id = $id;
$this->_name = $name; $this->_name = $name;
@ -70,28 +70,28 @@ class SeedDMS_Core_Workflow { /* {{{ */
$this->_dms = null; $this->_dms = null;
} /* }}} */ } /* }}} */
/** /**
* @param SeedDMS_Core_DMS $dms * @param SeedDMS_Core_DMS $dms
*/ */
function setDMS($dms) { /* {{{ */ function setDMS($dms) { /* {{{ */
$this->_dms = $dms; $this->_dms = $dms;
} /* }}} */ } /* }}} */
/** /**
* @return int * @return int
*/ */
function getID() { return $this->_id; } function getID() { return $this->_id; }
/** /**
* @return string * @return string
*/ */
function getName() { return $this->_name; } function getName() { return $this->_name; }
/** /**
* @param $newName * @param $newName
* @return bool * @return bool
*/ */
function setName($newName) { /* {{{ */ function setName($newName) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflows` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflows` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id;
@ -103,16 +103,16 @@ class SeedDMS_Core_Workflow { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return SeedDMS_Core_Workflow_State * @return SeedDMS_Core_Workflow_State
*/ */
function getInitState() { return $this->_initstate; } function getInitState() { return $this->_initstate; }
/** /**
* @param SeedDMS_Core_Workflow_State $state * @param SeedDMS_Core_Workflow_State $state
* @return bool * @return bool
*/ */
function setInitState($state) { /* {{{ */ function setInitState($state) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflows` SET `initstate` = ".$state->getID()." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflows` SET `initstate` = ".$state->getID()." WHERE `id` = " . $this->_id;
@ -124,10 +124,10 @@ class SeedDMS_Core_Workflow { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return SeedDMS_Core_Workflow_Transition[]|bool * @return SeedDMS_Core_Workflow_Transition[]|bool
*/ */
function getTransitions() { /* {{{ */ function getTransitions() { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
if($this->_transitions) if($this->_transitions)
@ -150,12 +150,12 @@ class SeedDMS_Core_Workflow { /* {{{ */
return $this->_transitions; return $this->_transitions;
} /* }}} */ } /* }}} */
/** /**
* @return array * @return array
*/ */
function getStates() { /* {{{ */ function getStates() { /* {{{ */
/** @noinspection PhpUnusedLocalVariableInspection */ /** @noinspection PhpUnusedLocalVariableInspection */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
if(!$this->_transitions) if(!$this->_transitions)
$this->getTransitions(); $this->getTransitions();
@ -171,15 +171,15 @@ class SeedDMS_Core_Workflow { /* {{{ */
return $states; return $states;
} /* }}} */ } /* }}} */
/** /**
* Get the transition by its id * Get the transition by its id
* *
* @param integer $id id of transition * @param integer $id id of transition
* @return bool|SeedDMS_Core_Workflow_Transition * @return bool|SeedDMS_Core_Workflow_Transition
*/ */
function getTransition($id) { /* {{{ */ function getTransition($id) { /* {{{ */
/** @noinspection PhpUnusedLocalVariableInspection */ /** @noinspection PhpUnusedLocalVariableInspection */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
if(!$this->_transitions) if(!$this->_transitions)
$this->getTransitions(); $this->getTransitions();
@ -190,12 +190,12 @@ class SeedDMS_Core_Workflow { /* {{{ */
return false; return false;
} /* }}} */ } /* }}} */
/** /**
* Get the transitions that can be triggered while being in the given state * Get the transitions that can be triggered while being in the given state
* *
* @param SeedDMS_Core_Workflow_State $state current workflow state * @param SeedDMS_Core_Workflow_State $state current workflow state
* @return SeedDMS_Core_Workflow_Transition[]|bool * @return SeedDMS_Core_Workflow_Transition[]|bool
*/ */
function getNextTransitions($state) { /* {{{ */ function getNextTransitions($state) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
@ -214,12 +214,12 @@ class SeedDMS_Core_Workflow { /* {{{ */
return $wkftransitions; return $wkftransitions;
} /* }}} */ } /* }}} */
/** /**
* Get the transitions that lead to the given state * Get the transitions that lead to the given state
* *
* @param SeedDMS_Core_Workflow_State $state current workflow state * @param SeedDMS_Core_Workflow_State $state current workflow state
* @return SeedDMS_Core_Workflow_Transition[]|bool * @return SeedDMS_Core_Workflow_Transition[]|bool
*/ */
function getPreviousTransitions($state) { /* {{{ */ function getPreviousTransitions($state) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
@ -238,13 +238,13 @@ class SeedDMS_Core_Workflow { /* {{{ */
return $wkftransitions; return $wkftransitions;
} /* }}} */ } /* }}} */
/** /**
* Get all transitions from one state into another state * Get all transitions from one state into another state
* *
* @param SeedDMS_Core_Workflow_State $state state to start from * @param SeedDMS_Core_Workflow_State $state state to start from
* @param SeedDMS_Core_Workflow_State $nextstate state after transition * @param SeedDMS_Core_Workflow_State $nextstate state after transition
* @return SeedDMS_Core_Workflow_Transition[]|bool * @return SeedDMS_Core_Workflow_Transition[]|bool
*/ */
function getTransitionsByStates($state, $nextstate) { /* {{{ */ function getTransitionsByStates($state, $nextstate) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
@ -335,11 +335,11 @@ class SeedDMS_Core_Workflow { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @param SeedDMS_Core_Workflow_State[] $laststates * @param SeedDMS_Core_Workflow_State[] $laststates
* @return SeedDMS_Core_Workflow_State[]|bool * @return SeedDMS_Core_Workflow_State[]|bool
*/ */
private function penetrate($laststates) { private function penetrate($laststates) {
$state = end($laststates); $state = end($laststates);
$transitions = $this->getNextTransitions($state); $transitions = $this->getNextTransitions($state);
foreach($transitions as $transition) { foreach($transitions as $transition) {
@ -361,8 +361,8 @@ class SeedDMS_Core_Workflow { /* {{{ */
* @return boolean list of states if workflow contains cycles, otherwise false * @return boolean list of states if workflow contains cycles, otherwise false
*/ */
function checkForCycles() { /* {{{ */ function checkForCycles() { /* {{{ */
/** @noinspection PhpUnusedLocalVariableInspection */ /** @noinspection PhpUnusedLocalVariableInspection */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$initstate = $this->getInitState(); $initstate = $this->getInitState();
@ -462,15 +462,15 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_State constructor. * SeedDMS_Core_Workflow_State constructor.
* @param $id * @param $id
* @param $name * @param $name
* @param $maxtime * @param $maxtime
* @param $precondfunc * @param $precondfunc
* @param $documentstatus * @param $documentstatus
*/ */
function __construct($id, $name, $maxtime, $precondfunc, $documentstatus) { function __construct($id, $name, $maxtime, $precondfunc, $documentstatus) {
$this->_id = $id; $this->_id = $id;
$this->_name = $name; $this->_name = $name;
$this->_maxtime = $maxtime; $this->_maxtime = $maxtime;
@ -479,28 +479,28 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
$this->_dms = null; $this->_dms = null;
} }
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { function setDMS($dms) {
$this->_dms = $dms; $this->_dms = $dms;
} }
/** /**
* @return int * @return int
*/ */
function getID() { return $this->_id; } function getID() { return $this->_id; }
/** /**
* @return string * @return string
*/ */
function getName() { return $this->_name; } function getName() { return $this->_name; }
/** /**
* @param string $newName * @param string $newName
* @return bool * @return bool
*/ */
function setName($newName) { /* {{{ */ function setName($newName) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowStates` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowStates` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id;
@ -512,16 +512,16 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return int maximum * @return int maximum
*/ */
function getMaxTime() { return $this->_maxtime; } function getMaxTime() { return $this->_maxtime; }
/** /**
* @param $maxtime * @param $maxtime
* @return bool * @return bool
*/ */
function setMaxTime($maxtime) { /* {{{ */ function setMaxTime($maxtime) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowStates` SET `maxtime` = ".intval($maxtime)." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowStates` SET `maxtime` = ".intval($maxtime)." WHERE `id` = " . $this->_id;
@ -533,16 +533,16 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return int maximum * @return int maximum
*/ */
function getPreCondFunc() { return $this->_precondfunc; } function getPreCondFunc() { return $this->_precondfunc; }
/** /**
* @param $precondfunc * @param $precondfunc
* @return bool * @return bool
*/ */
function setPreCondFunc($precondfunc) { /* {{{ */ function setPreCondFunc($precondfunc) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowStates` SET `precondfunc` = ".$db->qstr($precondfunc)." WHERE id = " . $this->_id; $queryStr = "UPDATE `tblWorkflowStates` SET `precondfunc` = ".$db->qstr($precondfunc)." WHERE id = " . $this->_id;
@ -550,8 +550,8 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
if (!$res) if (!$res)
return false; return false;
/** @noinspection PhpUndefinedVariableInspection */ /** @noinspection PhpUndefinedVariableInspection */
$this->_maxtime = $maxtime; /* @todo fix me */ $this->_maxtime = $maxtime; /* @todo fix me */
return true; return true;
} /* }}} */ } /* }}} */
@ -565,11 +565,11 @@ class SeedDMS_Core_Workflow_State { /* {{{ */
*/ */
function getDocumentStatus() { return $this->_documentstatus; } function getDocumentStatus() { return $this->_documentstatus; }
/** /**
* @param $docstatus * @param $docstatus
* @return bool * @return bool
*/ */
function setDocumentStatus($docstatus) { /* {{{ */ function setDocumentStatus($docstatus) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowStates` SET `documentstatus` = ".intval($docstatus)." WHERE id = " . $this->_id; $queryStr = "UPDATE `tblWorkflowStates` SET `documentstatus` = ".intval($docstatus)." WHERE id = " . $this->_id;
@ -678,39 +678,39 @@ class SeedDMS_Core_Workflow_Action { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_Action constructor. * SeedDMS_Core_Workflow_Action constructor.
* @param $id * @param $id
* @param $name * @param $name
*/ */
function __construct($id, $name) { function __construct($id, $name) {
$this->_id = $id; $this->_id = $id;
$this->_name = $name; $this->_name = $name;
$this->_dms = null; $this->_dms = null;
} }
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { function setDMS($dms) {
$this->_dms = $dms; $this->_dms = $dms;
} }
/** /**
* @return int * @return int
*/ */
function getID() { return $this->_id; } function getID() { return $this->_id; }
/** /**
* @return string name * @return string name
*/ */
function getName() { return $this->_name; } function getName() { return $this->_name; }
/** /**
* @param $newName * @param $newName
* @return bool * @return bool
*/ */
function setName($newName) { /* {{{ */ function setName($newName) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowActions` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowActions` SET `name` = ".$db->qstr($newName)." WHERE `id` = " . $this->_id;
@ -861,16 +861,16 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_Transition constructor. * SeedDMS_Core_Workflow_Transition constructor.
* @param $id * @param $id
* @param $workflow * @param $workflow
* @param $state * @param $state
* @param $action * @param $action
* @param $nextstate * @param $nextstate
* @param $maxtime * @param $maxtime
*/ */
function __construct($id, $workflow, $state, $action, $nextstate, $maxtime) { function __construct($id, $workflow, $state, $action, $nextstate, $maxtime) {
$this->_id = $id; $this->_id = $id;
$this->_workflow = $workflow; $this->_workflow = $workflow;
$this->_state = $state; $this->_state = $state;
@ -880,28 +880,28 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
$this->_dms = null; $this->_dms = null;
} }
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { function setDMS($dms) {
$this->_dms = $dms; $this->_dms = $dms;
} }
/** /**
* @return int * @return int
*/ */
function getID() { return $this->_id; } function getID() { return $this->_id; }
/** /**
* @return SeedDMS_Core_Workflow * @return SeedDMS_Core_Workflow
*/ */
function getWorkflow() { return $this->_workflow; } function getWorkflow() { return $this->_workflow; }
/** /**
* @param SeedDMS_Core_Workflow $newWorkflow * @param SeedDMS_Core_Workflow $newWorkflow
* @return bool * @return bool
*/ */
function setWorkflow($newWorkflow) { /* {{{ */ function setWorkflow($newWorkflow) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowTransitions` SET `workflow` = ".$newWorkflow->getID()." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowTransitions` SET `workflow` = ".$newWorkflow->getID()." WHERE `id` = " . $this->_id;
@ -914,16 +914,16 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
} /* }}} */ } /* }}} */
/** /**
* @return SeedDMS_Core_Workflow_State * @return SeedDMS_Core_Workflow_State
*/ */
function getState() { return $this->_state; } function getState() { return $this->_state; }
/** /**
* @param SeedDMS_Core_Workflow_State $newState * @param SeedDMS_Core_Workflow_State $newState
* @return bool * @return bool
*/ */
function setState($newState) { /* {{{ */ function setState($newState) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowTransitions` SET `state` = ".$newState->getID()." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowTransitions` SET `state` = ".$newState->getID()." WHERE `id` = " . $this->_id;
@ -935,16 +935,16 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return SeedDMS_Core_Workflow_State * @return SeedDMS_Core_Workflow_State
*/ */
function getNextState() { return $this->_nextstate; } function getNextState() { return $this->_nextstate; }
/** /**
* @param SeedDMS_Core_Workflow_State $newNextState * @param SeedDMS_Core_Workflow_State $newNextState
* @return bool * @return bool
*/ */
function setNextState($newNextState) { /* {{{ */ function setNextState($newNextState) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowTransitions` SET `nextstate` = ".$newNextState->getID()." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowTransitions` SET `nextstate` = ".$newNextState->getID()." WHERE `id` = " . $this->_id;
@ -956,16 +956,16 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return SeedDMS_Core_Workflow_Action * @return SeedDMS_Core_Workflow_Action
*/ */
function getAction() { return $this->_action; } function getAction() { return $this->_action; }
/** /**
* @param SeedDMS_Core_Workflow_Action $newAction * @param SeedDMS_Core_Workflow_Action $newAction
* @return bool * @return bool
*/ */
function setAction($newAction) { /* {{{ */ function setAction($newAction) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowTransitions` SET `action` = ".$newAction->getID()." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowTransitions` SET `action` = ".$newAction->getID()." WHERE `id` = " . $this->_id;
@ -977,16 +977,16 @@ class SeedDMS_Core_Workflow_Transition { /* {{{ */
return true; return true;
} /* }}} */ } /* }}} */
/** /**
* @return int * @return int
*/ */
function getMaxTime() { return $this->_maxtime; } function getMaxTime() { return $this->_maxtime; }
/** /**
* @param $maxtime * @param $maxtime
* @return bool * @return bool
*/ */
function setMaxTime($maxtime) { /* {{{ */ function setMaxTime($maxtime) { /* {{{ */
$db = $this->_dms->getDB(); $db = $this->_dms->getDB();
$queryStr = "UPDATE `tblWorkflowTransitions` SET `maxtime` = ".intval($maxtime)." WHERE `id` = " . $this->_id; $queryStr = "UPDATE `tblWorkflowTransitions` SET `maxtime` = ".intval($maxtime)." WHERE `id` = " . $this->_id;
@ -1117,22 +1117,22 @@ class SeedDMS_Core_Workflow_Transition_User { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_Transition_User constructor. * SeedDMS_Core_Workflow_Transition_User constructor.
* @param $id * @param $id
* @param $transition * @param $transition
* @param $user * @param $user
*/ */
function __construct($id, $transition, $user) { function __construct($id, $transition, $user) {
$this->_id = $id; $this->_id = $id;
$this->_transition = $transition; $this->_transition = $transition;
$this->_user = $user; $this->_user = $user;
} }
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { /* {{{ */ function setDMS($dms) { /* {{{ */
$this->_dms = $dms; $this->_dms = $dms;
} /* }}} */ } /* }}} */
@ -1200,24 +1200,24 @@ class SeedDMS_Core_Workflow_Transition_Group { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_Transition_Group constructor. * SeedDMS_Core_Workflow_Transition_Group constructor.
* @param $id * @param $id
* @param $transition * @param $transition
* @param $group * @param $group
* @param $numOfUsers * @param $numOfUsers
*/ */
function __construct($id, $transition, $group, $numOfUsers) { /* {{{ */ function __construct($id, $transition, $group, $numOfUsers) { /* {{{ */
$this->_id = $id; $this->_id = $id;
$this->_transition = $transition; $this->_transition = $transition;
$this->_group = $group; $this->_group = $group;
$this->_numOfUsers = $numOfUsers; $this->_numOfUsers = $numOfUsers;
} /* }}} */ } /* }}} */
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { /* {{{ */ function setDMS($dms) { /* {{{ */
$this->_dms = $dms; $this->_dms = $dms;
} /* }}} */ } /* }}} */
@ -1323,18 +1323,18 @@ class SeedDMS_Core_Workflow_Log { /* {{{ */
*/ */
var $_dms; var $_dms;
/** /**
* SeedDMS_Core_Workflow_Log constructor. * SeedDMS_Core_Workflow_Log constructor.
* @param $id * @param $id
* @param $document * @param $document
* @param $version * @param $version
* @param $workflow * @param $workflow
* @param $user * @param $user
* @param $transition * @param $transition
* @param $date * @param $date
* @param $comment * @param $comment
*/ */
function __construct($id, $document, $version, $workflow, $user, $transition, $date, $comment) { function __construct($id, $document, $version, $workflow, $user, $transition, $date, $comment) {
$this->_id = $id; $this->_id = $id;
$this->_document = $document; $this->_document = $document;
$this->_version = $version; $this->_version = $version;
@ -1346,45 +1346,45 @@ class SeedDMS_Core_Workflow_Log { /* {{{ */
$this->_dms = null; $this->_dms = null;
} }
/** /**
* @param $dms * @param $dms
*/ */
function setDMS($dms) { /* {{{ */ function setDMS($dms) { /* {{{ */
$this->_dms = $dms; $this->_dms = $dms;
} /* }}} */ } /* }}} */
/** /**
* @return object * @return object
*/ */
function getTransition() { /* {{{ */ function getTransition() { /* {{{ */
return $this->_transition; return $this->_transition;
} /* }}} */ } /* }}} */
/** /**
* @return object * @return object
*/ */
function getWorkflow() { /* {{{ */ function getWorkflow() { /* {{{ */
return $this->_workflow; return $this->_workflow;
} /* }}} */ } /* }}} */
/** /**
* @return object * @return object
*/ */
function getUser() { /* {{{ */ function getUser() { /* {{{ */
return $this->_user; return $this->_user;
} /* }}} */ } /* }}} */
/** /**
* @return string * @return string
*/ */
function getComment() { /* {{{ */ function getComment() { /* {{{ */
return $this->_comment; return $this->_comment;
} /* }}} */ } /* }}} */
/** /**
* @return string * @return string
*/ */
function getDate() { /* {{{ */ function getDate() { /* {{{ */
return $this->_date; return $this->_date;
} /* }}} */ } /* }}} */