mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 07:04:57 +00:00
improve log line
This commit is contained in:
parent
c8ac0bacad
commit
d6aa0e4f60
|
@ -116,8 +116,6 @@ if(!$controller()) {
|
|||
}
|
||||
}
|
||||
|
||||
add_log_line("?documentid=".$_POST['documentid']."&version=".$_POST['version']."&approvalType=".$_POST['approvalType']."&approvalStatus=".$_POST['approvalStatus']);
|
||||
add_log_line("?documentid=".$documentid."&version=".$version."&approvalType=".$_POST['approvalType']."&approvalStatus=".$_POST['approvalStatus']);
|
||||
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid."¤ttab=revapp");
|
||||
|
||||
?>
|
||||
|
|
|
@ -121,128 +121,6 @@ if(!$controller()) {
|
|||
}
|
||||
}
|
||||
|
||||
if(0) {
|
||||
if ($_POST["reviewType"] == "ind") {
|
||||
|
||||
$comment = $_POST["comment"];
|
||||
if($_FILES["reviewfile"]["tmp_name"])
|
||||
$file = $_FILES["reviewfile"]["tmp_name"];
|
||||
else
|
||||
$file = '';
|
||||
$reviewLogID = $latestContent->setReviewByInd($user, $user, $_POST["reviewStatus"], $comment, $file);
|
||||
if($reviewLogID === false || 0 > $reviewLogID) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed"));
|
||||
}
|
||||
else {
|
||||
// Send an email notification to the document updater.
|
||||
if($notifier) {
|
||||
$reviewlog = $latestContent->getReviewLog();
|
||||
$notifier->sendSubmittedReviewMail($latestContent, $user, $reviewlog ? $reviewlog[0] : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if ($_POST["reviewType"] == "grp") {
|
||||
$comment = $_POST["comment"];
|
||||
$group = $dms->getGroup($_POST['reviewGroup']);
|
||||
if($_FILES["reviewfile"]["tmp_name"])
|
||||
$file = $_FILES["reviewfile"]["tmp_name"];
|
||||
else
|
||||
$file = '';
|
||||
$reviewLogID = $latestContent->setReviewByGrp($group, $user, $_POST["reviewStatus"], $comment, $file);
|
||||
if($reviewLogID === false || 0 > $reviewLogID) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("review_update_failed"));
|
||||
}
|
||||
else {
|
||||
// Send an email notification to the document updater.
|
||||
if($notifier) {
|
||||
$reviewlog = $latestContent->getReviewLog();
|
||||
$notifier->sendSubmittedReviewMail($latestContent, $user, $reviewlog ? $reviewlog[0] : false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Check to see if the overall status for the document version needs to be
|
||||
// updated.
|
||||
//
|
||||
|
||||
if(0) {
|
||||
$overallStatus = $content->getStatus();
|
||||
if ($_POST["reviewStatus"]==-1){
|
||||
if($content->setStatus(S_REJECTED,$comment,$user)) {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
|
||||
}
|
||||
}
|
||||
|
||||
}else{
|
||||
|
||||
$docReviewStatus = $content->getReviewStatus();
|
||||
if (is_bool($docReviewStatus) && !$docReviewStatus) {
|
||||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("cannot_retrieve_review_snapshot"));
|
||||
}
|
||||
$reviewCT = 0;
|
||||
$reviewTotal = 0;
|
||||
foreach ($docReviewStatus as $drstat) {
|
||||
if ($drstat["status"] == 1) {
|
||||
$reviewCT++;
|
||||
}
|
||||
if ($drstat["status"] != -2) {
|
||||
$reviewTotal++;
|
||||
}
|
||||
}
|
||||
// If all reviews have been received and there are no rejections, retrieve a
|
||||
// count of the approvals required for this document.
|
||||
if ($reviewCT == $reviewTotal) {
|
||||
$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 $dastat) {
|
||||
if ($dastat["status"] == 1) {
|
||||
$approvalCT++;
|
||||
}
|
||||
if ($dastat["status"] != -2) {
|
||||
$approvalTotal++;
|
||||
}
|
||||
}
|
||||
// If the approvals received is less than the approvals total, then
|
||||
// change status to pending approval.
|
||||
if ($approvalCT<$approvalTotal) {
|
||||
$newStatus=S_DRAFT_APP;
|
||||
}
|
||||
else {
|
||||
// Otherwise, 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"]);
|
||||
|
||||
// Notify approvers, if necessary.
|
||||
if ($newStatus == S_DRAFT_APP) {
|
||||
$requestUser = $document->getOwner();
|
||||
$notifier->sendApprovalRequestMail($content, $user);
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['reviewDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['reviewDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postReviewDocument')) {
|
||||
$hookObj->postReviewDocument(null, $content, $newStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
add_log_line("documentid=".$documentid."&version=".$version."&reviewType=".$_POST['reviewType']."&reviewStatus=".$_POST['reviewStatus']);
|
||||
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid."¤ttab=revapp");
|
||||
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user