mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
use sendChangedDocumentStatusMail()
This commit is contained in:
parent
cd10bcaea3
commit
1d5164c2ab
|
@ -130,29 +130,12 @@ else if ($_POST["reviewType"] == "grp") {
|
|||
// updated.
|
||||
//
|
||||
|
||||
$overallStatus = $content->getStatus();
|
||||
if ($_POST["reviewStatus"]==-1){
|
||||
|
||||
if($content->setStatus(S_REJECTED,$comment,$user)) {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$nl=$document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "document_status_changed_email_subject";
|
||||
$message = "document_status_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getReviewStatusText(S_REJECTED);
|
||||
$params['new_status_code'] = S_REJECTED;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
}
|
||||
// $notifier->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -201,54 +184,19 @@ if ($_POST["reviewStatus"]==-1){
|
|||
if ($content->setStatus($newStatus, getMLText("automatic_status_update"), $user)) {
|
||||
// Send notification to subscribers.
|
||||
if($notifier) {
|
||||
$nl=$document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
$subject = "document_status_changed_email_subject";
|
||||
$message = "document_status_changed_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['status'] = getReviewStatusText($newStatus);
|
||||
$params['new_status_code'] = $newStatus;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$notifier->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
foreach ($nl["groups"] as $grp) {
|
||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||
$notifier->sendChangedDocumentStatusMail($content, $user, $overallStatus["status"]);
|
||||
|
||||
// Notify approvers, if necessary.
|
||||
if ($newStatus == S_DRAFT_APP) {
|
||||
$requestUser = $document->getOwner();
|
||||
$notifier->sendApprovalRequestMail($content, $user);
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: if user os not owner send notification to owner
|
||||
|
||||
// Notify approvers, if necessary.
|
||||
if ($newStatus == S_DRAFT_APP) {
|
||||
$requestUser = $document->getOwner();
|
||||
|
||||
if($notifier) {
|
||||
$subject = "approval_request_email_subject";
|
||||
$message = "approval_request_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['version'] = $version;
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID()."¤ttab=revapp";
|
||||
foreach ($docApprovalStatus as $dastat) {
|
||||
|
||||
if ($dastat["status"] == 0) {
|
||||
if ($dastat["type"] == 0) {
|
||||
|
||||
$approver = $dms->getUser($dastat["required"]);
|
||||
$notifier->toIndividual($document->getOwner(), $approver, $subject, $message, $params, SeedDMS_NotificationService::RECV_APPROVER);
|
||||
} elseif ($dastat["type"] == 1) {
|
||||
|
||||
$group = $dms->getGroup($dastat["required"]);
|
||||
$notifier->toGroup($document->getOwner(), $group, $subject, $message, $params, SeedDMS_NotificationService::RECV_APPROVER);
|
||||
}
|
||||
}
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['reviewDocument'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['reviewDocument'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postReviewDocument')) {
|
||||
$hookObj->postReviewDocument(null, $content, $newStatus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user