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()
|
function checkIndForm()
|
||||||
{
|
{
|
||||||
msg = new Array();
|
msg = new Array();
|
||||||
if (document.form1.revisionStatus.value == "") msg.push("<?php printMLText("js_no_revision_status");?>");
|
if (document.formind.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.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||||
if (msg != "") {
|
if (msg != "") {
|
||||||
noty({
|
noty({
|
||||||
text: msg.join('<br />'),
|
text: msg.join('<br />'),
|
||||||
|
@ -55,10 +55,10 @@ function checkIndForm()
|
||||||
}
|
}
|
||||||
function checkGrpForm()
|
function checkGrpForm()
|
||||||
{
|
{
|
||||||
msg = "";
|
msg = new Array();
|
||||||
if (document.form2.revisionGroup.value == "") msg += "<?php printMLText("js_no_revision_group");?>\n";
|
if (document.formgrp.revisionGroup.value == "") msg.push("<?php printMLText("js_no_revision_group");?>");
|
||||||
if (document.form2.revisionSatus.value == "") msg += "<?php printMLText("js_no_revision_status");?>\n";
|
if (document.formgrp.revisionSatus.value == "") msg.push("<?php printMLText("js_no_revision_status");?>");
|
||||||
if (document.form2.comment.value == "") msg += "<?php printMLText("js_no_comment");?>\n";
|
if (document.formgrp.comment.value == "") msg.push("<?php printMLText("js_no_comment");?>");
|
||||||
if (msg != "")
|
if (msg != "")
|
||||||
{
|
{
|
||||||
noty({
|
noty({
|
||||||
|
@ -75,11 +75,11 @@ function checkGrpForm()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('body').on('submit', '#form1', function(ev){
|
$('body').on('submit', '#formind', function(ev){
|
||||||
if(checkIndForm()) return;
|
if(checkIndForm()) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
$('body').on('submit', '#form2', function(ev){
|
$('body').on('submit', '#formgrp', function(ev){
|
||||||
if(checkGrpForm()) return;
|
if(checkGrpForm()) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
@ -111,108 +111,56 @@ $(document).ready(function() {
|
||||||
$this->contentContainerStart();
|
$this->contentContainerStart();
|
||||||
|
|
||||||
// Display the Revision form.
|
// Display the Revision form.
|
||||||
if ($revisionStatus['type'] == 0) {
|
$revisiontype = ($revisionStatus['type'] == 0) ? 'ind' : 'grp';
|
||||||
if($revisionStatus["status"]!=0) {
|
if($revisionStatus["status"]!=0) {
|
||||||
|
|
||||||
print "<table class=\"folderView\"><thead><tr>";
|
print "<table class=\"folderView\"><thead><tr>";
|
||||||
print "<th>".getMLText("status")."</th>";
|
print "<th>".getMLText("status")."</th>";
|
||||||
print "<th>".getMLText("comment")."</th>";
|
print "<th>".getMLText("comment")."</th>";
|
||||||
print "<th>".getMLText("last_update")."</th>";
|
print "<th>".getMLText("last_update")."</th>";
|
||||||
print "</tr></thead><tbody><tr>";
|
print "</tr></thead><tbody><tr>";
|
||||||
print "<td>";
|
print "<td>";
|
||||||
printRevisionStatusText($revisionStatus["status"]);
|
printRevisionStatusText($revisionStatus["status"]);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
print "<td>".htmlspecialchars($revisionStatus["comment"])."</td>";
|
print "<td>".htmlspecialchars($revisionStatus["comment"])."</td>";
|
||||||
$indUser = $dms->getUser($revisionStatus["userID"]);
|
$indUser = $dms->getUser($revisionStatus["userID"]);
|
||||||
print "<td>".$revisionStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
print "<td>".$revisionStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||||
print "</tr></tbody></table><br>\n";
|
print "</tr></tbody></table><br>\n";
|
||||||
}
|
|
||||||
?>
|
|
||||||
<form method="post" action="../op/op.ReviseDocument.php" id="form1" name="form1">
|
|
||||||
<?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='indRevision' 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='revisionGroup' value='<?php echo $revisionStatus['required']; ?>'/>
|
|
||||||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
|
||||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
|
||||||
</form>
|
|
||||||
<?php
|
|
||||||
}
|
}
|
||||||
|
?>
|
||||||
|
<form method="post" action="../op/op.ReviseDocument.php" id="form<?= $revisiontype ?>" name="form<?= $revisiontype ?>">
|
||||||
|
<?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'] != -1) { ?>
|
||||||
|
<option value='-1'><?php printMLText("status_needs_correction")?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td></td>
|
||||||
|
<td><input type='submit' class="btn" name='<?= $revisiontype ?>Revision' value='<?php printMLText("submit_revision")?>'/></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<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->contentContainerEnd();
|
||||||
$this->contentEnd();
|
$this->contentEnd();
|
||||||
$this->htmlEndPage();
|
$this->htmlEndPage();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user