set workflow from mandatory workflow of user

This commit is contained in:
steinm 2013-01-24 09:34:11 +00:00
parent 2124a6c60a
commit 253aafb54a

View File

@ -39,6 +39,7 @@ class LetoDMS_View_UpdateDocument extends LetoDMS_Bootstrap_Style {
$strictformcheck = $this->params['strictformcheck']; $strictformcheck = $this->params['strictformcheck'];
$enablelargefileupload = $this->params['enablelargefileupload']; $enablelargefileupload = $this->params['enablelargefileupload'];
$dropfolderdir = $this->params['dropfolderdir']; $dropfolderdir = $this->params['dropfolderdir'];
$workflowmode = $this->params['workflowmode'];
$documentid = $document->getId(); $documentid = $document->getId();
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName())))); $this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
@ -159,6 +160,7 @@ function checkForm()
<?php <?php
} }
} }
if($workflowmode == 'traditional') {
?> ?>
<tr> <tr>
<td colspan="2"> <td colspan="2">
@ -170,19 +172,6 @@ function checkForm()
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div> <div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
</td> </td>
<td> <td>
<?php
/*
$res=$user->getMandatoryReviewers();
foreach ($docAccess["users"] as $usr) {
if ($usr->getID()==$user->getID()) continue;
$mandatory=false;
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
if ($mandatory) print "<label class=\"checkbox\"><input type='checkbox' checked='checked' disabled='disabled'>". htmlspecialchars($usr->getFullName())."</label>";
else print "<label class=\"checkbox\"><input id='revInd".$usr->getID()."' type='checkbox' name='indReviewers[]' value='". $usr->getID() ."'>". htmlspecialchars($usr->getFullName())."</label>";
}
*/
?>
<select class="chzn-select span9" name="indReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_reviewers'); ?>"> <select class="chzn-select span9" name="indReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_reviewers'); ?>">
<?php <?php
$res=$user->getMandatoryReviewers(); $res=$user->getMandatoryReviewers();
@ -264,6 +253,37 @@ function checkForm()
<tr> <tr>
<td colspan="2"><div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div></td> <td colspan="2"><div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div></td>
</tr> </tr>
<?php
} else {
?>
<tr>
<td>
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
</td>
<td>
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
<?php
$mandatoryworkflow = $user->getMandatoryWorkflow();
$workflows=$dms->getAllWorkflows();
print "<option value=\"\">"."</option>";
foreach ($workflows as $workflow) {
print "<option value=\"".$workflow->getID()."\"";
if($mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID())
echo " selected=\"selected\"";
print ">". htmlspecialchars($workflow->getName())."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<?php $this->warningMsg(getMLText("add_doc_workflow_warning")); ?>
</td>
</tr>
<?php
}
?>
<tr> <tr>
<td></td> <td></td>
<td><input type="submit" class="btn" value="<?php printMLText("update_document")?>"></td> <td><input type="submit" class="btn" value="<?php printMLText("update_document")?>"></td>