mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
do not allow to change workflow if it is mandatory
This commit is contained in:
parent
cb60c86e6e
commit
857519033d
|
@ -87,11 +87,6 @@ foreach($attributes_version as $attrdefid=>$attribute) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(isset($_POST["workflow"]))
|
|
||||||
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
|
||||||
else
|
|
||||||
$workflow = null;
|
|
||||||
|
|
||||||
$reqversion = (int)$_POST["reqversion"];
|
$reqversion = (int)$_POST["reqversion"];
|
||||||
if ($reqversion<1) $reqversion=1;
|
if ($reqversion<1) $reqversion=1;
|
||||||
|
|
||||||
|
@ -183,6 +178,14 @@ foreach ($res as $r){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!$workflow = $user->getMandatoryWorkflow()) {
|
||||||
|
if(isset($_POST["workflow"]))
|
||||||
|
$workflow = $dms->getWorkflow($_POST["workflow"]);
|
||||||
|
else
|
||||||
|
$workflow = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if($settings->_dropFolderDir) {
|
if($settings->_dropFolderDir) {
|
||||||
if(isset($_POST["dropfolderfileform1"]) && $_POST["dropfolderfileform1"]) {
|
if(isset($_POST["dropfolderfileform1"]) && $_POST["dropfolderfileform1"]) {
|
||||||
$fullfile = $settings->_dropFolderDir.'/'.$user->getLogin().'/'.$_POST["dropfolderfileform1"];
|
$fullfile = $settings->_dropFolderDir.'/'.$user->getLogin().'/'.$_POST["dropfolderfileform1"];
|
||||||
|
|
|
@ -168,6 +168,8 @@ if ($_FILES['userfile']['error'] == 0) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$workflow = $user->getMandatoryWorkflow();
|
||||||
|
|
||||||
if(isset($_POST["attributes"]) && $_POST["attributes"]) {
|
if(isset($_POST["attributes"]) && $_POST["attributes"]) {
|
||||||
$attributes = $_POST["attributes"];
|
$attributes = $_POST["attributes"];
|
||||||
foreach($attributes as $attrdefid=>$attribute) {
|
foreach($attributes as $attrdefid=>$attribute) {
|
||||||
|
@ -184,7 +186,7 @@ if ($_FILES['userfile']['error'] == 0) {
|
||||||
$attributes = array();
|
$attributes = array();
|
||||||
}
|
}
|
||||||
|
|
||||||
$contentResult=$document->addContent($comment, $user, $userfiletmp, basename($userfilename), $fileType, $userfiletype, $reviewers, $approvers, $version=0, $attributes);
|
$contentResult=$document->addContent($comment, $user, $userfiletmp, basename($userfilename), $fileType, $userfiletype, $reviewers, $approvers, $version=0, $attributes, $workflow);
|
||||||
if (is_bool($contentResult) && !$contentResult) {
|
if (is_bool($contentResult) && !$contentResult) {
|
||||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -215,19 +215,30 @@ function addFiles()
|
||||||
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
|
||||||
<?php
|
<?php
|
||||||
$mandatoryworkflow = $user->getMandatoryWorkflow();
|
$mandatoryworkflow = $user->getMandatoryWorkflow();
|
||||||
$workflows=$dms->getAllWorkflows();
|
if($mandatoryworkflow) {
|
||||||
print "<option value=\"\">"."</option>";
|
?>
|
||||||
foreach ($workflows as $workflow) {
|
<?php echo $mandatoryworkflow->getName(); ?>
|
||||||
print "<option value=\"".$workflow->getID()."\"";
|
<input type="hidden" name="workflow" value="<?php echo $mandatoryworkflow->getID(); ?>">
|
||||||
if($mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID())
|
<?php
|
||||||
echo " selected=\"selected\"";
|
} else {
|
||||||
print ">". htmlspecialchars($workflow->getName())."</option>";
|
?>
|
||||||
}
|
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
||||||
|
<?php
|
||||||
|
$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>
|
</select>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -274,19 +274,30 @@ function checkForm()
|
||||||
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
|
||||||
<?php
|
<?php
|
||||||
$mandatoryworkflow = $user->getMandatoryWorkflow();
|
$mandatoryworkflow = $user->getMandatoryWorkflow();
|
||||||
$workflows=$dms->getAllWorkflows();
|
if($mandatoryworkflow) {
|
||||||
print "<option value=\"\">"."</option>";
|
?>
|
||||||
foreach ($workflows as $workflow) {
|
<?php echo $mandatoryworkflow->getName(); ?>
|
||||||
print "<option value=\"".$workflow->getID()."\"";
|
<input type="hidden" name="workflow" value="<?php echo $mandatoryworkflow->getID(); ?>">
|
||||||
if($mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID())
|
<?php
|
||||||
echo " selected=\"selected\"";
|
} else {
|
||||||
print ">". htmlspecialchars($workflow->getName())."</option>";
|
?>
|
||||||
}
|
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
|
||||||
|
<?php
|
||||||
|
$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>
|
</select>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user