mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
a list of mandatory workflows can be set
This commit is contained in:
parent
a68954725e
commit
380c916c66
|
@ -94,10 +94,13 @@ if ($action == "adduser") {
|
|||
}
|
||||
else UI::exitError(getMLText("admin_tools"),getMLText("access_denied"));
|
||||
|
||||
if(isset($_POST["workflow"])) {
|
||||
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
||||
if($workflow)
|
||||
$newUser->setMandatoryWorkflow($workflow);
|
||||
if(isset($_POST["workflows"]) && $_POST["workflows"]) {
|
||||
$workflows = array();
|
||||
foreach($_POST["workflows"] as $workflowid)
|
||||
if($tmp = $dms->getWorkflow($workflowid))
|
||||
$workflows[] = $tmp;
|
||||
if($workflows)
|
||||
$newUser->setMandatoryWorkflows($workflows);
|
||||
}
|
||||
|
||||
if (isset($_POST["usrReviewers"])){
|
||||
|
@ -245,13 +248,14 @@ else if ($action == "edituser") {
|
|||
if(!$isDisabled)
|
||||
$editedUser->clearLoginFailures();
|
||||
}
|
||||
if(isset($_POST["workflow"]) && $_POST["workflow"]) {
|
||||
$currworkflow = $editedUser->getMandatoryWorkflow();
|
||||
if (!$currworkflow || ($currworkflow->getID() != $_POST["workflow"])) {
|
||||
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
||||
if($workflow)
|
||||
$editedUser->setMandatoryWorkflow($workflow);
|
||||
if(isset($_POST["workflows"]) && $_POST["workflows"]) {
|
||||
$workflows = array();
|
||||
foreach($_POST["workflows"] as $workflowid) {
|
||||
if($tmp = $dms->getWorkflow($workflowid))
|
||||
$workflows[] = $tmp;
|
||||
}
|
||||
if($workflows)
|
||||
$editedUser->setMandatoryWorkflows($workflows);
|
||||
} else {
|
||||
$editedUser->delMandatoryWorkflow();
|
||||
}
|
||||
|
|
|
@ -374,12 +374,15 @@ $(document).ready( function() {
|
|||
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
||||
</td>
|
||||
<td>
|
||||
<select name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
||||
<select class="chzn-select" name="workflows[]" multiple="multiple" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
||||
<?php
|
||||
print "<option value=\"\">"."</option>";
|
||||
$mandatoryworkflows = $currUser ? $currUser->getMandatoryWorkflows() : array();
|
||||
foreach ($workflows as $workflow) {
|
||||
print "<option value=\"".$workflow->getID()."\"";
|
||||
if($currUser && $currUser->getMandatoryWorkflow() && $currUser->getMandatoryWorkflow()->getID() == $workflow->getID())
|
||||
$checked = false;
|
||||
foreach($mandatoryworkflows as $mw) if($mw->getID() == $workflow->getID()) $checked = true;
|
||||
if($checked)
|
||||
echo " selected=\"selected\"";
|
||||
print ">". htmlspecialchars($workflow->getName())."</option>";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user