mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
use one form for ind and grp recipients
This commit is contained in:
parent
83e960fe03
commit
4fa0efa07d
|
@ -37,8 +37,8 @@ class SeedDMS_View_ReceiptDocument extends SeedDMS_Bootstrap_Style {
|
|||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (document.formind.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.formind.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "") {
|
||||
noty({
|
||||
text: msg.join('<br />'),
|
||||
|
@ -55,10 +55,10 @@ function checkIndForm()
|
|||
}
|
||||
function checkGrpForm()
|
||||
{
|
||||
msg = "";
|
||||
if (document.form2.reviewGroup.value == "") msg += "<?php printMLText("js_no_receipt_group");?>\n";
|
||||
if (document.form2.reviewStatus.value == "") msg += "<?php printMLText("js_no_receipt_status");?>\n";
|
||||
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
msg = new Array();
|
||||
if (document.formgrp.reviewGroup.value == "") msg.push("<?php printMLText("js_no_receipt_group");?>");
|
||||
if (document.formgrp.reviewStatus.value == "") msg.push("<?php printMLText("js_no_receipt_status");?>");
|
||||
if (document.formgrp.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (msg != "")
|
||||
{
|
||||
noty({
|
||||
|
@ -75,11 +75,11 @@ function checkGrpForm()
|
|||
return true;
|
||||
}
|
||||
$(document).ready(function() {
|
||||
$('body').on('submit', '#form1', function(ev){
|
||||
$('body').on('submit', '#formind', function(ev){
|
||||
if(checkIndForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
$('body').on('submit', '#form2', function(ev){
|
||||
$('body').on('submit', '#formgrp', function(ev){
|
||||
if(checkGrpForm()) return;
|
||||
event.preventDefault();
|
||||
});
|
||||
|
@ -110,24 +110,24 @@ $(document).ready(function() {
|
|||
$this->contentContainerStart();
|
||||
|
||||
// Display the Receipt form.
|
||||
if ($receiptStatus['type'] == 0) {
|
||||
if($receiptStatus["status"]!=0) {
|
||||
$receipttype = ($receiptStatus['type'] == 0) ? 'ind' : 'grp';
|
||||
if($receiptStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printReceiptStatusText($receiptStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($receiptStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($receiptStatus["userID"]);
|
||||
print "<td>".$receiptStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>";
|
||||
}
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printReceiptStatusText($receiptStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($receiptStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($receiptStatus["userID"]);
|
||||
print "<td>".$receiptStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
?>
|
||||
<form class="form-horizontal" method="post" action="../op/op.ReceiptDocument.php" id="form1" name="form1">
|
||||
<form class="form-horizontal" method="post" action="../op/op.ReceiptDocument.php" id="form<?= $receipttype ?>" name="form<?= $receipttype ?>">
|
||||
<?php echo createHiddenFieldWithKey('receiptdocument'); ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("comment");?>:</label>
|
||||
|
@ -149,64 +149,16 @@ $(document).ready(function() {
|
|||
</div>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<input type='submit' class="btn" name='indReceipt' value='<?php printMLText("submit_receipt")?>'/>
|
||||
<input type='submit' class="btn" name='<?= $receipttype ?>Receipt' value='<?php printMLText("submit_receipt")?>'/>
|
||||
<div>
|
||||
<input type='hidden' name='receiptType' value='ind'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
else if ($receiptStatus['type'] == 1) {
|
||||
|
||||
if($receiptStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
print "<th>".getMLText("status")."</th>";
|
||||
print "<th>".getMLText("comment")."</th>";
|
||||
print "<th>".getMLText("last_update")."</th>";
|
||||
print "</tr></thead><tbody><tr>";
|
||||
print "<td>";
|
||||
printReceiptStatusText($receiptStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($receiptStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($receiptStatus["userID"]);
|
||||
print "<td>".$receiptStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
|
||||
?>
|
||||
<form class="form-horizontal" method="post" action="../op/op.ReceiptDocument.php" id="form2" name="form2">
|
||||
<?php echo createHiddenFieldWithKey('receiptdocument'); ?>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("comment");?>:</label>
|
||||
<div class="controls">
|
||||
<textarea name="comment" cols="80" rows="4"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("receipt_status");?>:</label>
|
||||
<div class="controls">
|
||||
<select name="receiptStatus">
|
||||
<?php if($receiptStatus['status'] != 1) { ?>
|
||||
<option value='1'><?php printMLText("status_receipted")?></option>
|
||||
<?php } ?>
|
||||
<?php if($receiptStatus['status'] != -1) { ?>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<input type='submit' class="btn" name='groupReceipt' value='<?php printMLText("submit_receipt")?>'/>
|
||||
</div>
|
||||
<input type='hidden' name='receiptType' value='grp'/>
|
||||
<input type='hidden' name='receiptType' value='<?= $receipttype ?>'/>
|
||||
<?php if($receipttype == 'grp'): ?>
|
||||
<input type='hidden' name='receiptGroup' value='<?php echo $receiptStatus['required']; ?>'/>
|
||||
<?php endif; ?>
|
||||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||
</form>
|
||||
<?php
|
||||
}
|
||||
$this->contentContainerEnd();
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
|
|
Loading…
Reference in New Issue
Block a user