remove old code, sync with 6.0.x

This commit is contained in:
Uwe Steinmann 2023-06-19 17:20:45 +02:00
parent 7fa51000d5
commit 039473d905
4 changed files with 4 additions and 105 deletions

View File

@ -432,5 +432,4 @@ foreach($file_ary as $file) {
}
header("Location:../out/out.ViewFolder.php?folderid=".$folderid."&showtree=".$_POST["showtree"]);
?>

View File

@ -49,12 +49,12 @@ if (!is_object($document)) {
UI::exitError(getMLText("document_title", array("documentname" => getMLText("invalid_doc_id"))),getMLText("invalid_doc_id"));
}
$folder = $document->getFolder();
if ($document->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
$folder = $document->getFolder();
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
@ -116,107 +116,6 @@ if(!$controller()) {
}
}
if(0) {
if ($_POST["approvalType"] == "ind") {
$comment = $_POST["comment"];
if($_FILES["approvalfile"]["tmp_name"])
$file = $_FILES["approvalfile"]["tmp_name"];
else
$file = '';
$approvalLogID = $latestContent->setApprovalByInd($user, $user, $_POST["approvalStatus"], $comment, $file);
if($approvalLogID === false || 0 > $approvalLogID) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed"));
}
else {
if($notifier) {
// Send notification to subscribers.
$approvelog = $latestContent->getApproveLog();
$notifier->sendSubmittedApprovalMail($latestContent, $user, $approvelog ? $approvelog[0] : false);
}
}
}
else if ($_POST["approvalType"] == "grp") {
$comment = $_POST["comment"];
$group = $dms->getGroup($_POST['approvalGroup']);
if($_FILES["approvalfile"]["tmp_name"])
$file = $_FILES["approvalfile"]["tmp_name"];
else
$file = '';
$approvalLogID = $latestContent->setApprovalByGrp($group, $user, $_POST["approvalStatus"], $comment, $file);
if($approvalLogID === false || 0 > $approvalLogID) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("approval_update_failed"));
}
else {
if($notifier) {
// Send notification to subscribers.
$approvelog = $latestContent->getApproveLog();
$notifier->sendSubmittedApprovalMail($latestContent, $user, $approvelog ? $approvelog[0] : false);
}
}
}
}
//
// Check to see if the overall status for the document version needs to be
// updated.
//
if(0) {
$overallStatus = $content->getStatus();
if ($_POST["approvalStatus"]==-1){
if($content->setStatus(S_REJECTED,$comment,$user)) {
// Send notification to subscribers.
if($notifier) {
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
}
if(isset($GLOBALS['SEEDDMS_HOOKS']['approveDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['approveDocument'] as $hookObj) {
if (method_exists($hookObj, 'postApproveDocument')) {
$hookObj->postApproveDocument(null, $content, S_REJECTED);
}
}
}
}
}else{
$docApprovalStatus = $content->getApprovalStatus();
if (is_bool($docApprovalStatus) && !$docApprovalStatus) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("cannot_retrieve_approval_snapshot"));
}
$approvalCT = 0;
$approvalTotal = 0;
foreach ($docApprovalStatus as $drstat) {
if ($drstat["status"] == 1) {
$approvalCT++;
}
if ($drstat["status"] != -2) {
$approvalTotal++;
}
}
// If all approvals have been received and there are no rejections, retrieve a
// count of the approvals required for this document.
if ($approvalCT == $approvalTotal) {
// Change the status to released.
$newStatus=S_RELEASED;
if($content->setStatus($newStatus, getMLText("automatic_status_update"), $user)) {
// Send notification to subscribers.
if($notifier) {
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
}
if(isset($GLOBALS['SEEDDMS_HOOKS']['approveDocument'])) {
foreach($GLOBALS['SEEDDMS_HOOKS']['approveDocument'] as $hookObj) {
if (method_exists($hookObj, 'postApproveDocument')) {
$hookObj->postApproveDocument(null, $content, S_RELEASED);
}
}
}
}
}
}
}
add_log_line("?documentid=".$_POST['documentid']."&version=".$_POST['version']."&approvalType=".$_POST['approvalType']."&approvalStatus=".$_POST['approvalStatus']);
header("Location:../out/out.ViewDocument.php?documentid=".$documentid."&currenttab=revapp");

View File

@ -65,7 +65,6 @@ if (isset($_GET["version"])) { /* {{{ */
if(!$controller()) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}
} /* }}} */
elseif (isset($_GET["file"])) { /* {{{ */

View File

@ -53,6 +53,8 @@ if ($document->getAccessMode($user) < M_READ) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("access_denied"));
}
$folder = $document->getFolder();
if (!isset($_POST["version"]) || !is_numeric($_POST["version"]) || intval($_POST["version"])<1) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("invalid_version"));
}