mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
send mail when workflow starts
This commit is contained in:
parent
558be76dae
commit
28f0d7e1cb
|
@ -69,6 +69,35 @@ if (!$version->setWorkflow($workflow, $user)){
|
|||
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));
|
||||
}
|
||||
|
||||
if ($notifier) {
|
||||
$nl = $document->getNotifyList();
|
||||
$folder = $document->getFolder();
|
||||
|
||||
if($settings->_enableNotificationWorkflow) {
|
||||
$subject = "request_workflow_action_email_subject";
|
||||
$message = "request_workflow_action_email_body";
|
||||
$params = array();
|
||||
$params['name'] = $document->getName();
|
||||
$params['version'] = $version->getVersion();
|
||||
$params['workflow'] = $workflow->getName();
|
||||
$params['folder_path'] = $folder->getFolderPathPlain();
|
||||
$params['current_state'] = $workflow->getInitState()->getName();
|
||||
$params['username'] = $user->getFullName();
|
||||
$params['sitename'] = $settings->_siteName;
|
||||
$params['http_root'] = $settings->_httpRoot;
|
||||
$params['url'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID();
|
||||
|
||||
foreach($workflow->getNextTransitions($workflow->getInitState()) as $ntransition) {
|
||||
foreach($ntransition->getUsers() as $tuser) {
|
||||
$notifier->toIndividual($user, $tuser->getUser(), $subject, $message, $params);
|
||||
}
|
||||
foreach($ntransition->getGroups() as $tuser) {
|
||||
$notifier->toGroup($user, $tuser->getGroup(), $subject, $message, $params);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
add_log_line("?documentid=".$documentid);
|
||||
|
||||
header("Location:../out/out.ViewDocument.php?documentid=".$documentid);
|
||||
|
|
Loading…
Reference in New Issue
Block a user