mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-18 15:00:59 +00:00
- show warning if workflow has transitions without users or groups
- show warning if init state of workflow isn't a state of a transition
This commit is contained in:
parent
4626f3b994
commit
214f58d507
|
@ -92,7 +92,7 @@ function showWorkflow(selectObj) {
|
||||||
<div class="span4">
|
<div class="span4">
|
||||||
<div class="well">
|
<div class="well">
|
||||||
<?php echo getMLText("selection")?>:
|
<?php echo getMLText("selection")?>:
|
||||||
<select onchange="showWorkflow(this)" id="selector">
|
<select onchange="showWorkflow(this)" id="selector" class="span9">
|
||||||
<option value="-1"><?php echo getMLText("choose_workflow")?>
|
<option value="-1"><?php echo getMLText("choose_workflow")?>
|
||||||
<option value="0"><?php echo getMLText("add_workflow")?>
|
<option value="0"><?php echo getMLText("add_workflow")?>
|
||||||
<?php
|
<?php
|
||||||
|
@ -158,16 +158,24 @@ function showWorkflow(selectObj) {
|
||||||
|
|
||||||
print "<td id=\"keywords".$currWorkflow->getID()."\" style=\"display : none;\">";
|
print "<td id=\"keywords".$currWorkflow->getID()."\" style=\"display : none;\">";
|
||||||
$transitions = $currWorkflow->getTransitions();
|
$transitions = $currWorkflow->getTransitions();
|
||||||
|
$initstate = $currWorkflow->getInitState();
|
||||||
|
$hasinitstate = false;
|
||||||
|
$missesug = false;
|
||||||
if($transitions) {
|
if($transitions) {
|
||||||
foreach($transitions as $transition) {
|
foreach($transitions as $transition) {
|
||||||
$transusers = $transition->getUsers();
|
$transusers = $transition->getUsers();
|
||||||
$transgroups = $transition->getGroups();
|
$transgroups = $transition->getGroups();
|
||||||
if(!$transusers && !$transgroups) {
|
if(!$transusers && !$transgroups) {
|
||||||
$this->errorMsg('One of the transitions has neither a user nor a group!');
|
$missesug = true;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
if($transition->getState()->getID() == $initstate->getID())
|
||||||
|
$hasinitstate = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($missesug)
|
||||||
|
$this->errorMsg('One of the transitions has neither a user nor a group!');
|
||||||
|
if(!$hasinitstate)
|
||||||
|
$this->errorMsg('None of the transitions starts with the initial state of the workflow!');
|
||||||
?>
|
?>
|
||||||
<form action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data" name="form<?php print $currWorkflow->getID();?>" onsubmit="return checkForm('<?php print $currWorkflow->getID();?>');">
|
<form action="../op/op.WorkflowMgr.php" method="post" enctype="multipart/form-data" name="form<?php print $currWorkflow->getID();?>" onsubmit="return checkForm('<?php print $currWorkflow->getID();?>');">
|
||||||
<?php echo createHiddenFieldWithKey('editworkflow'); ?>
|
<?php echo createHiddenFieldWithKey('editworkflow'); ?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user