send notification on submit of reception

This commit is contained in:
Uwe Steinmann 2021-08-27 09:55:08 +02:00
parent 6fbfe15baf
commit 4f3a7f6512

View File

@ -94,6 +94,29 @@ if(!$controller->run()) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText($controller->getErrorMsg()));
}
if ($_POST["receiptType"] == "ind" || $_POST["receiptType"] == "grp") {
if($notifier) {
$nl=$document->getNotifyList();
$subject = "receipt_submit_email_subject";
$message = "receipt_submit_email_body";
$params = array();
$params['name'] = $document->getName();
$params['version'] = $version;
$params['folder_path'] = $folder->getFolderPathPlain();
$params['status'] = getReceiptStatusText($_POST["receiptStatus"]);
$params['comment'] = strip_tags($_POST['comment']);
$params['username'] = $user->getFullName();
$params['url'] = getBaseUrl().$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
$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->toIndividual($user, $content->getUser(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
}
}
header("Location:../out/out.ViewDocument.php?documentid=".$documentid."&currenttab=recipients");
?>