- check for equal states and missing user/group

This commit is contained in:
steinm 2013-02-05 09:23:57 +00:00
parent 275ecc04a2
commit 66b23748d2

View File

@ -58,6 +58,10 @@ if (!is_object($nextstate)) {
UI::exitError(getMLText("workflow_title"),getMLText("invalid_workflow_state_id"));
}
if($state->getID() == $nextstate->getID()) {
UI::exitError(getMLText("workflow_title"),getMLText("equal_transition_states"));
}
if (!isset($_POST["action"]) || !is_numeric($_POST["action"])) {
UI::exitError(getMLText("workflow_title"),getMLText("invalid_workflow_action_id"));
}
@ -80,6 +84,10 @@ if (isset($_POST["groups"]) && is_array($_POST["groups"])) {
}
}
if(!$users && !$groups) {
UI::exitError(getMLText("workflow_title"),getMLText("missing_transition_user_group"));
}
if($transition = $workflow->addTransition($state, $action, $nextstate, $users, $groups)) {
}