mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	allow to upload a file with each review/approval
This commit is contained in:
		
							parent
							
								
									d55346ba0f
								
							
						
					
					
						commit
						d36ba8d906
					
				|  | @ -80,10 +80,21 @@ if (!isset($_POST["approvalStatus"]) || !is_numeric($_POST["approvalStatus"]) || | ||||||
| 	UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_approval_status")); | 	UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_approval_status")); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | if($_FILES["approvalfile"]["tmp_name"]) { | ||||||
|  | 	if (is_uploaded_file($_FILES["approvalfile"]["tmp_name"]) && $_FILES['approvalfile']['error']!=0){ | ||||||
|  | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_failed")); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| if ($_POST["approvalType"] == "ind") { | if ($_POST["approvalType"] == "ind") { | ||||||
| 
 | 
 | ||||||
| 	$comment = $_POST["comment"]; | 	$comment = $_POST["comment"]; | ||||||
| 	if(0 > $latestContent->setApprovalByInd($user, $user, $_POST["approvalStatus"], $comment)) { | 	if($_FILES["approvalfile"]["tmp_name"]) | ||||||
|  | 		$file = $_FILES["approvalfile"]["tmp_name"]; | ||||||
|  | 	else | ||||||
|  | 		$file = ''; | ||||||
|  | 	$approvalLogID = $latestContent->setApprovalByInd($user, $user, $_POST["approvalStatus"], $comment, $file); | ||||||
|  | 	if(0 > $approvalLogID) { | ||||||
| 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed")); | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed")); | ||||||
| 	} | 	} | ||||||
| 	else { | 	else { | ||||||
|  | @ -128,7 +139,12 @@ if ($_POST["approvalType"] == "ind") { | ||||||
| else if ($_POST["approvalType"] == "grp") { | else if ($_POST["approvalType"] == "grp") { | ||||||
| 	$comment = $_POST["comment"]; | 	$comment = $_POST["comment"]; | ||||||
| 	$group = $dms->getGroup($_POST['approvalGroup']); | 	$group = $dms->getGroup($_POST['approvalGroup']); | ||||||
| 	if(0 > $latestContent->setApprovalByGrp($group, $user, $_POST["approvalStatus"], $comment)) { | 	if($_FILES["approvalfile"]["tmp_name"]) | ||||||
|  | 		$file = $_FILES["approvalfile"]["tmp_name"]; | ||||||
|  | 	else | ||||||
|  | 		$file = ''; | ||||||
|  | 	$approvalLogID = $latestContent->setApprovalByGrp($group, $user, $_POST["approvalStatus"], $comment, $file); | ||||||
|  | 	if(0 > $approvalLogID) { | ||||||
| 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed")); | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed")); | ||||||
| 	} | 	} | ||||||
| 	else { | 	else { | ||||||
|  |  | ||||||
|  | @ -76,10 +76,20 @@ if (!isset($_POST["reviewStatus"]) || !is_numeric($_POST["reviewStatus"]) || | ||||||
| 	UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_review_status")); | 	UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_review_status")); | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | if($_FILES["reviewfile"]["tmp_name"]) { | ||||||
|  | 	if (is_uploaded_file($_FILES["reviewfile"]["tmp_name"]) && $_FILES['reviewfile']['error']!=0){ | ||||||
|  | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("uploading_failed")); | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  | 
 | ||||||
| if ($_POST["reviewType"] == "ind") { | if ($_POST["reviewType"] == "ind") { | ||||||
| 
 | 
 | ||||||
| 	$comment = $_POST["comment"]; | 	$comment = $_POST["comment"]; | ||||||
| 	$reviewLogID = $latestContent->setReviewByInd($user, $user, $_POST["reviewStatus"], $comment); | 	if($_FILES["reviewfile"]["tmp_name"]) | ||||||
|  | 		$file = $_FILES["reviewfile"]["tmp_name"]; | ||||||
|  | 	else | ||||||
|  | 		$file = ''; | ||||||
|  | 	$reviewLogID = $latestContent->setReviewByInd($user, $user, $_POST["reviewStatus"], $comment, $file); | ||||||
| 	if(0 > $reviewLogID) { | 	if(0 > $reviewLogID) { | ||||||
| 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed")); | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed")); | ||||||
| 	} | 	} | ||||||
|  | @ -131,7 +141,11 @@ if ($_POST["reviewType"] == "ind") { | ||||||
| else if ($_POST["reviewType"] == "grp") { | else if ($_POST["reviewType"] == "grp") { | ||||||
| 	$comment = $_POST["comment"]; | 	$comment = $_POST["comment"]; | ||||||
| 	$group = $dms->getGroup($_POST['reviewGroup']); | 	$group = $dms->getGroup($_POST['reviewGroup']); | ||||||
| 	$reviewLogID = $latestContent->setReviewByGrp($group, $user, $_POST["reviewStatus"], $comment); | 	if($_FILES["reviewfile"]["tmp_name"]) | ||||||
|  | 		$file = $_FILES["reviewfile"]["tmp_name"]; | ||||||
|  | 	else | ||||||
|  | 		$file = ''; | ||||||
|  | 	$reviewLogID = $latestContent->setReviewByGrp($group, $user, $_POST["reviewStatus"], $comment, $file); | ||||||
| 	if(0 > $reviewLogID) { | 	if(0 > $reviewLogID) { | ||||||
| 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed")); | 		UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed")); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -118,12 +118,21 @@ function checkGrpForm() | ||||||
| 				print "</tr></tbody></table><br>\n"; | 				print "</tr></tbody></table><br>\n"; | ||||||
| 			} | 			} | ||||||
| ?>
 | ?>
 | ||||||
| 	<form method="post" action="../op/op.ApproveDocument.php" name="form1" onsubmit="return checkIndForm();"> | 	<form method="post" action="../op/op.ApproveDocument.php" name="form1" enctype="multipart/form-data" onsubmit="return checkIndForm();"> | ||||||
| 	<?php echo createHiddenFieldWithKey('approvedocument'); ?>
 | 	<?php echo createHiddenFieldWithKey('approvedocument'); ?>
 | ||||||
| 	<table> | 	<table> | ||||||
| 	<tr><td><?php printMLText("comment")?>:</td>
 | 		<tr> | ||||||
| 	<td><textarea name="comment" cols="80" rows="4"></textarea> | 			<td><?php printMLText("comment")?>:</td>
 | ||||||
| 	</td></tr> | 			<td><textarea name="comment" cols="80" rows="4"></textarea></td> | ||||||
|  | 		</tr> | ||||||
|  | 		<tr> | ||||||
|  | 			<td><?php printMLText("approval_file")?>:</td>
 | ||||||
|  | 			<td> | ||||||
|  | <?php | ||||||
|  | 	$this->printFileChooser('approvalfile', false); | ||||||
|  | ?>
 | ||||||
|  | 			</td> | ||||||
|  | 		</tr> | ||||||
| 	<tr><td><?php printMLText("approval_status")?>:</td>
 | 	<tr><td><?php printMLText("approval_status")?>:</td>
 | ||||||
| 	<td><select name="approvalStatus"> | 	<td><select name="approvalStatus"> | ||||||
| <?php if($approvalStatus['status'] != 1) { ?>
 | <?php if($approvalStatus['status'] != 1) { ?>
 | ||||||
|  |  | ||||||
|  | @ -109,13 +109,21 @@ function checkGrpForm() | ||||||
| 				print "</tr></tbody></table><br>"; | 				print "</tr></tbody></table><br>"; | ||||||
| 			} | 			} | ||||||
| ?>
 | ?>
 | ||||||
| 	<form method="post" action="../op/op.ReviewDocument.php" name="form1" onsubmit="return checkIndForm();"> | 	<form method="post" action="../op/op.ReviewDocument.php" name="form1" enctype="multipart/form-data" onsubmit="return checkIndForm();"> | ||||||
| 	<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
 | 	<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
 | ||||||
| 	<table class="table-condensed"> | 	<table class="table-condensed"> | ||||||
| 		<tr> | 		<tr> | ||||||
| 			<td><?php printMLText("comment")?>:</td>
 | 			<td><?php printMLText("comment")?>:</td>
 | ||||||
| 			<td><textarea name="comment" cols="80" rows="4"></textarea></td> | 			<td><textarea name="comment" cols="80" rows="4"></textarea></td> | ||||||
| 		</tr> | 		</tr> | ||||||
|  | 		<tr> | ||||||
|  | 			<td><?php printMLText("review_file")?>:</td>
 | ||||||
|  | 			<td> | ||||||
|  | <?php | ||||||
|  | 	$this->printFileChooser('reviewfile', false); | ||||||
|  | ?>
 | ||||||
|  | 			</td> | ||||||
|  | 		</tr> | ||||||
| 		<tr> | 		<tr> | ||||||
| 			<td><?php printMLText("review_status")?></td>
 | 			<td><?php printMLText("review_status")?></td>
 | ||||||
| 			<td> | 			<td> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann