diff --git a/views/bootstrap/class.WorkflowMgr.php b/views/bootstrap/class.WorkflowMgr.php index aab63f1b1..2dbd4e0fd 100644 --- a/views/bootstrap/class.WorkflowMgr.php +++ b/views/bootstrap/class.WorkflowMgr.php @@ -90,35 +90,42 @@ $(document).ready(function() { $transitions = $workflow->getTransitions(); $initstate = $workflow->getInitState(); $hasinitstate = true; + $hasreleased = true; + $hasrejected = true; $missesug = false; if($transitions) { $hasinitstate = false; + $hasreleased = false; + $hasrejected = false; foreach($transitions as $transition) { $transusers = $transition->getUsers(); $transgroups = $transition->getGroups(); if(!$transusers && !$transgroups) { $missesug = true; } + if($transition->getNextState()->getDocumentStatus() == S_RELEASED) + $hasreleased = true; + if($transition->getNextState()->getDocumentStatus() == S_REJECTED) + $hasrejected = true; if($transition->getState()->getID() == $initstate->getID()) $hasinitstate = true; } } if($missesug) - $this->errorMsg('One of the transitions has neither a user nor a group!'); + $this->errorMsg(getMLText('workflow_transition_without_user_group')); if(!$hasinitstate) - $this->errorMsg('None of the transitions starts with the initial state of the workflow!'); + $this->errorMsg(getMLText('workflow_no_initial_state')); + if(!$hasreleased) + $this->errorMsg(getMLText('workflow_no_doc_released_state')); + if(!$hasrejected) + $this->errorMsg(getMLText('workflow_no_doc_rejected_state')); - if($workflow->isUsed()) { -?> -
- - -isUsed()) { + $this->infoMsg(getMLText('workflow_in_use')); + } } ?> +