mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 12:11:19 +00:00
get mandatory workflow from $_POST[workflows]
This commit is contained in:
parent
a935a635c8
commit
a68954725e
|
@ -206,11 +206,19 @@ if($settings->_workflowMode == 'traditional' || $settings->_workflowMode == 'tra
|
|||
}
|
||||
}
|
||||
} elseif($settings->_workflowMode == 'advanced') {
|
||||
if(!$workflow = $user->getMandatoryWorkflow()) {
|
||||
if(!$workflows = $user->getMandatoryWorkflows()) {
|
||||
if(isset($_POST["workflow"]))
|
||||
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
||||
else
|
||||
$workflow = null;
|
||||
} else {
|
||||
/* If there is excactly 1 mandatory workflow, then set no matter what has
|
||||
* been posted in 'workflow', otherwise check if the posted workflow is in the
|
||||
* list of mandatory workflows. If not, then take the first one.
|
||||
*/
|
||||
$workflow = array_shift($workflows);
|
||||
foreach($workflows as $mw)
|
||||
if($mw->getID() == $_POST['workflow']) {$workflow = $mw; break;}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -185,11 +185,19 @@ if ($_FILES['userfile']['error'] == 0) {
|
|||
}
|
||||
}
|
||||
} elseif($settings->_workflowMode == 'advanced') {
|
||||
if(!$workflow = $user->getMandatoryWorkflow()) {
|
||||
if(!$workflows = $user->getMandatoryWorkflows()) {
|
||||
if(isset($_POST["workflow"]))
|
||||
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
||||
else
|
||||
$workflow = null;
|
||||
} else {
|
||||
/* If there is excactly 1 mandatory workflow, then set no matter what has
|
||||
* been posted in 'workflow', otherwise check if the posted workflow is in the
|
||||
* list of mandatory workflows. If not, then take the first one.
|
||||
*/
|
||||
$workflow = array_shift($workflows);
|
||||
foreach($workflows as $mw)
|
||||
if($mw->getID() == $_POST['workflow']) {$workflow = $mw; break;}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user