mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-08 20:46:05 +00:00
add and use sendRewindWorkflowMail()
This commit is contained in:
parent
6dac961e9c
commit
a4276a42a9
|
@ -1119,5 +1119,34 @@ class SeedDMS_NotificationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This notification is sent when a workflow is rewinded.
|
||||||
|
*/
|
||||||
|
public function sendRewindWorkflowMail($content, $user) { /* {{{ */
|
||||||
|
$document = $content->getDocument();
|
||||||
|
$folder = $document->getFolder();
|
||||||
|
$workflow = $content->getWorkflow();
|
||||||
|
|
||||||
|
$nl = $document->getNotifyList();
|
||||||
|
$folder = $document->getFolder();
|
||||||
|
|
||||||
|
$subject = "rewind_workflow_email_subject";
|
||||||
|
$message = "rewind_workflow_email_body";
|
||||||
|
$params = array();
|
||||||
|
$params['name'] = $document->getName();
|
||||||
|
$params['version'] = $content->getVersion();
|
||||||
|
$params['workflow'] = $workflow->getName();
|
||||||
|
$params['folder_path'] = $folder->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()."¤ttab=workflow";
|
||||||
|
// Send notification to subscribers.
|
||||||
|
$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);
|
||||||
|
}
|
||||||
|
} /* }}} */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,25 +62,7 @@ if (!is_object($workflow)) {
|
||||||
|
|
||||||
if($version->rewindWorkflow()) {
|
if($version->rewindWorkflow()) {
|
||||||
if ($notifier) {
|
if ($notifier) {
|
||||||
$nl = $document->getNotifyList();
|
$notifier->sendRewindWorkflowMail($version, $user);
|
||||||
$folder = $document->getFolder();
|
|
||||||
|
|
||||||
$subject = "rewind_workflow_email_subject";
|
|
||||||
$message = "rewind_workflow_email_body";
|
|
||||||
$params = array();
|
|
||||||
$params['name'] = $document->getName();
|
|
||||||
$params['version'] = $version->getVersion();
|
|
||||||
$params['workflow'] = $workflow->getName();
|
|
||||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
|
||||||
$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();
|
|
||||||
// Send notification to subscribers.
|
|
||||||
$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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user