mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
use same form ind and grp revision
This commit is contained in:
parent
d84d4cfcdb
commit
9d7b735ff4
|
@ -37,8 +37,8 @@ class SeedDMS_View_ReviseDocument extends SeedDMS_Bootstrap_Style {
|
|||
function checkIndForm()
|
||||
{
|
||||
msg = new Array();
|
||||
if (document.form1.revisionStatus.value == "") msg.push("<?php printMLText("js_no_revision_status");?>");
|
||||
if (document.form1.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||
if (document.formind.revisionStatus.value == "") msg.push("<?php printMLText("js_no_revision_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.revisionGroup.value == "") msg += "<?php printMLText("js_no_revision_group");?>\n";
|
||||
if (document.form2.revisionSatus.value == "") msg += "<?php printMLText("js_no_revision_status");?>\n";
|
||||
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
||||
msg = new Array();
|
||||
if (document.formgrp.revisionGroup.value == "") msg.push("<?php printMLText("js_no_revision_group");?>");
|
||||
if (document.formgrp.revisionSatus.value == "") msg.push("<?php printMLText("js_no_revision_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();
|
||||
});
|
||||
|
@ -111,7 +111,7 @@ $(document).ready(function() {
|
|||
$this->contentContainerStart();
|
||||
|
||||
// Display the Revision form.
|
||||
if ($revisionStatus['type'] == 0) {
|
||||
$revisiontype = ($revisionStatus['type'] == 0) ? 'ind' : 'grp';
|
||||
if($revisionStatus["status"]!=0) {
|
||||
|
||||
print "<table class=\"folderView\"><thead><tr>";
|
||||
|
@ -128,7 +128,7 @@ $(document).ready(function() {
|
|||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
?>
|
||||
<form method="post" action="../op/op.ReviseDocument.php" id="form1" name="form1">
|
||||
<form method="post" action="../op/op.ReviseDocument.php" id="form<?= $revisiontype ?>" name="form<?= $revisiontype ?>">
|
||||
<?php echo createHiddenFieldWithKey('revisedocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
|
@ -142,77 +142,25 @@ $(document).ready(function() {
|
|||
<?php if($revisionStatus['status'] != 1) { ?>
|
||||
<option value='1'><?php printMLText("status_revised")?></option>
|
||||
<?php } ?>
|
||||
<?php if($revisionStatus['status'] != 6) { ?>
|
||||
<option value='6'><?php printMLText("status_needs_correction")?></option>
|
||||
<?php } ?>
|
||||
<?php if($revisionStatus['status'] != -1) { ?>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
<option value='-1'><?php printMLText("status_needs_correction")?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type='submit' class="btn" name='indRevision' value='<?php printMLText("submit_revision")?>'/></td>
|
||||
<td><input type='submit' class="btn" name='<?= $revisiontype ?>Revision' value='<?php printMLText("submit_revision")?>'/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type='hidden' name='revisionType' value='ind'/>
|
||||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||
</form>
|
||||
<?php
|
||||
} elseif ($revisionStatus['type'] == 1) {
|
||||
if($revisionStatus["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>";
|
||||
printRevisionStatusText($revisionStatus["status"]);
|
||||
print "</td>";
|
||||
print "<td>".htmlspecialchars($revisionStatus["comment"])."</td>";
|
||||
$indUser = $dms->getUser($revisionStatus["userID"]);
|
||||
print "<td>".$revisionStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||
print "</tr></tbody></table><br>\n";
|
||||
}
|
||||
?>
|
||||
<form method="post" action="../op/op.ReviseDocument.php" id="form2" name="form2">
|
||||
<?php echo createHiddenFieldWithKey('revisedocument'); ?>
|
||||
<table class="table-condensed">
|
||||
<tr>
|
||||
<td><?php printMLText("comment")?>:</td>
|
||||
<td><textarea name="comment" cols="80" rows="4"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><?php printMLText("revision_status")?>:</td>
|
||||
<td>
|
||||
<select name="revisionStatus">
|
||||
<?php if($revisionStatus['status'] != 1) { ?>
|
||||
<option value='1'><?php printMLText("status_revised")?></option>
|
||||
<?php } ?>
|
||||
<?php if($revisionStatus['status'] != 6) { ?>
|
||||
<option value='6'><?php printMLText("status_needs_correction")?></option>
|
||||
<?php } ?>
|
||||
<?php if($revisionStatus['status'] != -1) { ?>
|
||||
<option value='-1'><?php printMLText("rejected")?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td></td>
|
||||
<td><input type='submit' class="btn" name='groupRevision' value='<?php printMLText("submit_revision")?>'/></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type='hidden' name='revisionType' value='grp'/>
|
||||
<input type='hidden' name='revisionType' value='<?= $revisiontype ?>'/>
|
||||
<?php if($revisiontype == 'grp'): ?>
|
||||
<input type='hidden' name='revisionGroup' value='<?php echo $revisionStatus['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