diff --git a/inc/inc.ClassNotificationService.php b/inc/inc.ClassNotificationService.php index 2fd9b22d0..4da8218da 100644 --- a/inc/inc.ClassNotificationService.php +++ b/inc/inc.ClassNotificationService.php @@ -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();