add method sendToAllReceiptMail()

This commit is contained in:
Uwe Steinmann 2025-01-25 12:40:58 +01:00
parent ceddf4d5bf
commit 1033fee1b3

View File

@ -1471,6 +1471,35 @@ class SeedDMS_NotificationService {
$this->toGroup($user, $recipient, $subject, $message, $params, SeedDMS_NotificationService::RECV_RECIPIENT);
} /* }}} */
/**
* Send a request receipt notification to all recipients of the document content
*
* This method can be called when the status of a document content changes
* to 'released'. The recipients haven't been informed when the
* document content was created but not immediatly released.
*/
public function sendToAllReceiptMail($content, $user) { /* {{{ */
$dms = $content->getDMS();
$receiptStatus = $content->getReceiptStatus();
if (!empty($receiptStatus)) {
foreach ($receiptStatus as $r) {
if($r['status'] == 0) {
switch ($r["type"]) {
case 0: // Recipient is an individual.
if($recipient = $dms->getUser($r["required"]))
$this->sendAddReceiptMail($content, $user, $recipient);
break;
case 1: // Recipient is a group.
if($recipient = $dms->getGroup($r["required"]))
$this->sendAddReceiptMail($content, $user, $recipient);
break;
}
}
}
}
} /* }}} */
public function sendChangedDocumentOwnerMail($document, $user, $oldowner) { /* {{{ */
if($oldowner->getID() != $document->getOwner()->getID()) {
$notifyList = $document->getNotifyList();