mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 05:31:42 +00:00
move display of form into own function
This commit is contained in:
parent
42d7d7c096
commit
0be0f90881
|
@ -80,6 +80,7 @@ if($view) {
|
||||||
$view->setParam('folder', $folder);
|
$view->setParam('folder', $folder);
|
||||||
$view->setParam('document', $document);
|
$view->setParam('document', $document);
|
||||||
$view->setParam('version', $content);
|
$view->setParam('version', $content);
|
||||||
|
$view->setParam('reviewid', (int) $_GET['reviewid']);
|
||||||
$view->setParam('accessobject', $accessop);
|
$view->setParam('accessobject', $accessop);
|
||||||
$view($_GET);
|
$view($_GET);
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -13,11 +13,6 @@
|
||||||
* @version Release: @package_version@
|
* @version Release: @package_version@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* Include parent class
|
|
||||||
*/
|
|
||||||
//require_once("class.Bootstrap.php");
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class which outputs the html page for ApproveDocument view
|
* Class which outputs the html page for ApproveDocument view
|
||||||
*
|
*
|
||||||
|
@ -31,7 +26,7 @@
|
||||||
*/
|
*/
|
||||||
class SeedDMS_View_ApproveDocument extends SeedDMS_Theme_Style {
|
class SeedDMS_View_ApproveDocument extends SeedDMS_Theme_Style {
|
||||||
|
|
||||||
function js() { /* {{{ */
|
public function js() { /* {{{ */
|
||||||
header('Content-Type: application/javascript; charset=UTF-8');
|
header('Content-Type: application/javascript; charset=UTF-8');
|
||||||
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
|
parent::jsTranslations(array('js_form_error', 'js_form_errors'));
|
||||||
?>
|
?>
|
||||||
|
@ -69,48 +64,10 @@ $(document).ready(function() {
|
||||||
$this->printFileChooserJs();
|
$this->printFileChooserJs();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
protected function showForm($approvalStatus) { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
|
||||||
$user = $this->params['user'];
|
|
||||||
$folder = $this->params['folder'];
|
|
||||||
$document = $this->params['document'];
|
$document = $this->params['document'];
|
||||||
$content = $this->params['version'];
|
$content = $this->params['version'];
|
||||||
$approveid = $this->params['approveid'];
|
|
||||||
|
|
||||||
$approvals = $content->getApprovalStatus();
|
|
||||||
foreach($approvals as $approval) {
|
|
||||||
if($approval['approveID'] == $approveid) {
|
|
||||||
$approvalStatus = $approval;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
|
||||||
$this->globalNavigation($folder);
|
|
||||||
$this->contentStart();
|
|
||||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
|
||||||
$this->contentHeading(getMLText("add_approval"));
|
|
||||||
|
|
||||||
// Display the Approval form.
|
|
||||||
$approvaltype = ($approvalStatus['type'] == 0) ? 'ind' : 'grp';
|
$approvaltype = ($approvalStatus['type'] == 0) ? 'ind' : 'grp';
|
||||||
if($approvalStatus["status"]!=0) {
|
|
||||||
|
|
||||||
print "<table class=\"table table-condensed table-sm\"><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>";
|
|
||||||
printApprovalStatusText($approvalStatus["status"]);
|
|
||||||
print "</td>";
|
|
||||||
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
|
|
||||||
$indUser = $dms->getUser($approvalStatus["userID"]);
|
|
||||||
print "<td>".$approvalStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
|
||||||
print "</tr></tbody></table><br>\n";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form class="form-horizontal" method="post" action="../op/op.ApproveDocument.php" id="form<?= $approvaltype ?>" name="form<?= $approvaltype ?>" enctype="multipart/form-data">
|
<form class="form-horizontal" method="post" action="../op/op.ApproveDocument.php" id="form<?= $approvaltype ?>" name="form<?= $approvaltype ?>" enctype="multipart/form-data">
|
||||||
<?php echo createHiddenFieldWithKey('approvedocument'); ?>
|
<?php echo createHiddenFieldWithKey('approvedocument'); ?>
|
||||||
|
@ -155,6 +112,50 @@ $(document).ready(function() {
|
||||||
<input type='hidden' name='version' value='<?php echo $content->getVersion(); ?>'/>
|
<input type='hidden' name='version' value='<?php echo $content->getVersion(); ?>'/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
public function show() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$folder = $this->params['folder'];
|
||||||
|
$document = $this->params['document'];
|
||||||
|
$content = $this->params['version'];
|
||||||
|
$approveid = $this->params['approveid'];
|
||||||
|
|
||||||
|
$approvals = $content->getApprovalStatus();
|
||||||
|
foreach($approvals as $approval) {
|
||||||
|
if($approval['approveID'] == $approveid) {
|
||||||
|
$approvalStatus = $approval;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
||||||
|
|
||||||
|
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||||
|
$this->globalNavigation($folder);
|
||||||
|
$this->contentStart();
|
||||||
|
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||||
|
$this->contentHeading(getMLText("add_approval"));
|
||||||
|
|
||||||
|
// Display the Approval form.
|
||||||
|
if($approvalStatus["status"]!=0) {
|
||||||
|
|
||||||
|
print "<table class=\"table table-condensed table-sm\"><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>";
|
||||||
|
printApprovalStatusText($approvalStatus["status"]);
|
||||||
|
print "</td>";
|
||||||
|
print "<td>".htmlspecialchars($approvalStatus["comment"])."</td>";
|
||||||
|
$indUser = $dms->getUser($approvalStatus["userID"]);
|
||||||
|
print "<td>".$approvalStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||||
|
print "</tr></tbody></table><br>\n";
|
||||||
|
}
|
||||||
|
$this->showForm($approvalStatus);
|
||||||
$this->contentEnd();
|
$this->contentEnd();
|
||||||
$this->htmlEndPage();
|
$this->htmlEndPage();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
|
@ -69,47 +69,10 @@ $(document).ready(function() {
|
||||||
$this->printFileChooserJs();
|
$this->printFileChooserJs();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
function show() { /* {{{ */
|
protected function showForm($reviewStatus) { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
|
||||||
$user = $this->params['user'];
|
|
||||||
$folder = $this->params['folder'];
|
|
||||||
$document = $this->params['document'];
|
$document = $this->params['document'];
|
||||||
$content = $this->params['version'];
|
$content = $this->params['version'];
|
||||||
|
|
||||||
$reviews = $content->getReviewStatus();
|
|
||||||
foreach($reviews as $review) {
|
|
||||||
if($review['reviewID'] == $_GET['reviewid']) {
|
|
||||||
$reviewStatus = $review;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
|
||||||
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
|
||||||
|
|
||||||
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
|
||||||
$this->globalNavigation($folder);
|
|
||||||
$this->contentStart();
|
|
||||||
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
|
||||||
$this->contentHeading(getMLText("submit_review"));
|
|
||||||
|
|
||||||
// Display the Review form.
|
|
||||||
$reviewtype = ($reviewStatus['type'] == 0) ? 'ind' : 'grp';
|
$reviewtype = ($reviewStatus['type'] == 0) ? 'ind' : 'grp';
|
||||||
if($reviewStatus["status"]!=0) {
|
|
||||||
|
|
||||||
print "<table class=\"table table-condensed table-sm\"><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>";
|
|
||||||
printReviewStatusText($reviewStatus["status"]);
|
|
||||||
print "</td>";
|
|
||||||
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
|
|
||||||
$indUser = $dms->getUser($reviewStatus["userID"]);
|
|
||||||
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
|
||||||
print "</tr></tbody></table><br>\n";
|
|
||||||
}
|
|
||||||
?>
|
?>
|
||||||
<form class="form-horizontal" method="post" action="../op/op.ReviewDocument.php" id="form<?= $reviewtype ?>" name="form<?= $reviewtype ?>" enctype="multipart/form-data">
|
<form class="form-horizontal" method="post" action="../op/op.ReviewDocument.php" id="form<?= $reviewtype ?>" name="form<?= $reviewtype ?>" enctype="multipart/form-data">
|
||||||
<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
|
<?php echo createHiddenFieldWithKey('reviewdocument'); ?>
|
||||||
|
@ -154,6 +117,50 @@ $(document).ready(function() {
|
||||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||||
</form>
|
</form>
|
||||||
<?php
|
<?php
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
public function show() { /* {{{ */
|
||||||
|
$dms = $this->params['dms'];
|
||||||
|
$user = $this->params['user'];
|
||||||
|
$folder = $this->params['folder'];
|
||||||
|
$document = $this->params['document'];
|
||||||
|
$content = $this->params['version'];
|
||||||
|
$reviewid = $this->params['reviewid'];
|
||||||
|
|
||||||
|
$reviews = $content->getReviewStatus();
|
||||||
|
foreach($reviews as $review) {
|
||||||
|
if($review['reviewID'] == $reviewid) {
|
||||||
|
$reviewStatus = $review;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/vendors/jquery-validation/jquery.validate.js"></script>'."\n", 'js');
|
||||||
|
$this->htmlAddHeader('<script type="text/javascript" src="../views/'.$this->theme.'/styles/validation-default.js"></script>'."\n", 'js');
|
||||||
|
|
||||||
|
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
||||||
|
$this->globalNavigation($folder);
|
||||||
|
$this->contentStart();
|
||||||
|
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
||||||
|
$this->contentHeading(getMLText("submit_review"));
|
||||||
|
|
||||||
|
// Display the Review form.
|
||||||
|
if($reviewStatus["status"]!=0) {
|
||||||
|
|
||||||
|
print "<table class=\"table table-condensed table-sm\"><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>";
|
||||||
|
printReviewStatusText($reviewStatus["status"]);
|
||||||
|
print "</td>";
|
||||||
|
print "<td>".htmlspecialchars($reviewStatus["comment"])."</td>";
|
||||||
|
$indUser = $dms->getUser($reviewStatus["userID"]);
|
||||||
|
print "<td>".$reviewStatus["date"]." - ". htmlspecialchars($indUser->getFullname()) ."</td>";
|
||||||
|
print "</tr></tbody></table><br>\n";
|
||||||
|
}
|
||||||
|
$this->showForm($reviewStatus);
|
||||||
$this->contentEnd();
|
$this->contentEnd();
|
||||||
$this->htmlEndPage();
|
$this->htmlEndPage();
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user