- do not allow to set workflow if none exists

This commit is contained in:
steinm 2013-01-24 16:52:40 +00:00
parent 12ce5e4926
commit 438ce97371

View File

@ -62,6 +62,10 @@ function showWorkflow(selectObj) {
</script> </script>
<div class="row-fluid"> <div class="row-fluid">
<div class="span4"> <div class="span4">
<?php
$workflows = $dms->getAllWorkflows();
if($workflows) {
?>
<form action="../op/op.SetWorkflow.php" method="post" name="form1"> <form action="../op/op.SetWorkflow.php" method="post" name="form1">
<?php echo createHiddenFieldWithKey('setworkflow'); ?> <?php echo createHiddenFieldWithKey('setworkflow'); ?>
<input type="hidden" name="documentid" value="<?php print $document->getID(); ?>"> <input type="hidden" name="documentid" value="<?php print $document->getID(); ?>">
@ -74,8 +78,6 @@ function showWorkflow(selectObj) {
</td> </td>
<td> <td>
<?php <?php
$workflows = $dms->getAllWorkflows();
if($workflows) {
echo "<select onchange=\"showWorkflow(this)\" class=\"_chzn-select-deselect\" name=\"workflow\" data-placeholder=\"".getMLText('select_workflow')."\">"; echo "<select onchange=\"showWorkflow(this)\" class=\"_chzn-select-deselect\" name=\"workflow\" data-placeholder=\"".getMLText('select_workflow')."\">";
$mandatoryworkflow = $user->getMandatoryWorkflow(); $mandatoryworkflow = $user->getMandatoryWorkflow();
$workflows=$dms->getAllWorkflows(); $workflows=$dms->getAllWorkflows();
@ -86,7 +88,6 @@ function showWorkflow(selectObj) {
print ">". htmlspecialchars($workflow->getName())."</option>"; print ">". htmlspecialchars($workflow->getName())."</option>";
} }
echo "</select>"; echo "</select>";
}
?> ?>
</td> </td>
</tr> </tr>
@ -96,6 +97,14 @@ function showWorkflow(selectObj) {
<td><input type="submit" class="btn" value="<?php printMLText("set_workflow");?>"></td> <td><input type="submit" class="btn" value="<?php printMLText("set_workflow");?>"></td>
</tr> </tr>
</table> </table>
</form>
<?php
} else {
?>
<p><?php printMLText('no_workflow_available'); ?></p>
<?php
}
?>
</div> </div>
<div id="workflowgraph" class="span8" style="display: none;"> <div id="workflowgraph" class="span8" style="display: none;">
<iframe src="" width="100%" height="500" style="border: 1px solid #AAA;"></iframe> <iframe src="" width="100%" height="500" style="border: 1px solid #AAA;"></iframe>