mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 20:51:30 +00:00
move send of notification mail in Notification class, do not inform approvers and reviewers anymore
This commit is contained in:
parent
897f6ce64b
commit
f24badd9ce
|
@ -384,16 +384,41 @@ class SeedDMS_NotificationService {
|
||||||
$this->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
$this->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
foreach ($nl["groups"] as $grp) {
|
foreach ($nl["groups"] as $grp) {
|
||||||
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
|
// if user is not owner and owner not already in list of notifiers, then
|
||||||
|
// send notification to owner
|
||||||
|
if($user->getID() != $document->getOwner()->getID() &&
|
||||||
|
false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This notification is sent when a document version is deleted.
|
* This notification is sent when a document version is deleted.
|
||||||
* Keep in mind that $document refers to a document which has just been
|
* Keep in mind that $version refers to a version which has just been
|
||||||
* deleted from the database, but all the data needed is still in the
|
* deleted from the database, but all the data needed is still in the
|
||||||
* object.
|
* object.
|
||||||
*/
|
*/
|
||||||
public function sendDeleteDocumentVersionMail($document, $user) { /* {{{ */
|
public function sendDeleteDocumentVersionMail($document, $version, $user) { /* {{{ */
|
||||||
|
$nl = $document->getNotifyList();
|
||||||
|
$subject = "version_deleted_email_subject";
|
||||||
|
$message = "version_deleted_email_body";
|
||||||
|
$params = array();
|
||||||
|
$params['name'] = $document->getName();
|
||||||
|
$params['version'] = $version->getVersion();
|
||||||
|
$params['folder_path'] = $document->getFolder()->getFolderPathPlain();
|
||||||
|
$params['username'] = $user->getFullName();
|
||||||
|
$params['sitename'] = $this->settings->_siteName;
|
||||||
|
$params['http_root'] = $this->settings->_httpRoot;
|
||||||
|
$params['url'] = getBaseUrl().$this->settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||||
|
$this->toList($user, $nl["users"], $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
|
foreach ($nl["groups"] as $grp) {
|
||||||
|
$this->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
|
}
|
||||||
|
// if user is not owner and owner not already in list of notifiers, then
|
||||||
|
// send notification to owner
|
||||||
|
if($user->getID() != $document->getOwner()->getID() &&
|
||||||
|
false === SeedDMS_Core_DMS::inList($document->getOwner(), $nl['users']))
|
||||||
|
$this->toIndividual($user, $document->getOwner(), $subject, $message, $params, SeedDMS_NotificationService::RECV_OWNER);
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -142,13 +142,14 @@ else {
|
||||||
if($hit = $lucenesearch->getDocument($document->getID())) {
|
if($hit = $lucenesearch->getDocument($document->getID())) {
|
||||||
$index->delete($hit->id);
|
$index->delete($hit->id);
|
||||||
}
|
}
|
||||||
$version = $document->getLatestContent();
|
|
||||||
$index->addDocument($fulltextservice->IndexedDocument($document));
|
$index->addDocument($fulltextservice->IndexedDocument($document));
|
||||||
$index->commit();
|
$index->commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notify affected users.
|
// Notify affected users.
|
||||||
if ($notifier){
|
if ($notifier){
|
||||||
|
$notifier->sendDeleteDocumentVersionMail($document, $version, $user);
|
||||||
|
/*
|
||||||
$nl=$document->getNotifyList();
|
$nl=$document->getNotifyList();
|
||||||
$userrecipientsR = array();
|
$userrecipientsR = array();
|
||||||
foreach ($emailUserListR as $eID) {
|
foreach ($emailUserListR as $eID) {
|
||||||
|
@ -195,6 +196,7 @@ else {
|
||||||
foreach ($nl["groups"] as $grp) {
|
foreach ($nl["groups"] as $grp) {
|
||||||
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
$notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user