getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } $documentid = $_GET["documentid"]; $document = getDocument($documentid); if (!is_object($document)) { UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id")); } $folder = $document->getFolder(); $docPathHTML = getFolderPathHTML($folder, true). " / ".$document->getName().""; if ($document->getAccessMode($user) < M_READ) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); } if (!isset($_GET["version"]) || !is_numeric($_GET["version"]) || intval($_GET["version"])<1) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); } $version = $_GET["version"]; $content = $document->getContentByVersion($version); if (!is_object($content)) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); } // operation is admitted only for last deocument version $latestContent = $document->getLatestContent(); if ($latestContent->getVersion()!=$version) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version")); } // verify if document has expired if ($document->hasExpired()){ UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied")); } // retrieve the approval status for the current user. $approvalStatus = $user->getApprovalStatus($documentid, $version); if (count($approvalStatus["indstatus"]) == 0 && count($approvalStatus["grpstatus"]) == 0) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("no_action")); } $indApprover = true; if (count($approvalStatus["indstatus"])==0){ $indApprover = false; } else if ($approvalStatus["indstatus"][0]["status"]==-2) { $indApprover = false; } $grpApprover=false; foreach ($approvalStatus["grpstatus"] as $grpStatus) { if (($grpStatus["status"]!=-2)&&(isset($grpStatus["status"]))) { $grpApprover=true; } } if (!$indApprover && !$grpApprover) { UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("no_action")); } UI::htmlStartPage(getMLText("document_title", array("documentname" => $document->getName()))); UI::globalNavigation($folder); UI::pageNavigation($docPathHTML, "view_document"); UI::contentHeading(getMLText("submit_approval")); ?> "; print "".getMLText("status").""; print "".getMLText("comment").""; print "".getMLText("last_update").""; print ""; print ""; printApprovalStatusText($approvalStatus["indstatus"][0]["status"]); print ""; print "".$approvalStatus["indstatus"][0]["comment"].""; $indUser = getUser($approvalStatus["indstatus"][0]["userID"]); print "".$approvalStatus["indstatus"][0]["date"]." - ". $indUser->getFullname() .""; print "
\n"; } ?>
:
:
"; print "".getMLText("status").""; print "".getMLText("comment").""; print "".getMLText("last_update").""; print ""; print ""; printApprovalStatusText($approvalStatus["grpstatus"][0]["status"]); print ""; print "".$approvalStatus["grpstatus"][0]["comment"].""; $indUser = getUser($approvalStatus["grpstatus"][0]["userID"]); print "".$approvalStatus["grpstatus"][0]["date"]." - ". $indUser->getFullname() .""; print "
\n"; } $grpSelectBox = ""; foreach ($approvalStatus["grpstatus"] as $grp) { if ($grp["status"]!=-2) { $g=getGroup($grpStatus["required"]); if ($grp["status"] != -2) { $grpSelectBox .= (strlen($grpSelectBox)==0 ? "": ""). ""; } } } if (strlen($grpSelectBox)>0) { ?>
:
:
: