From 01661fd337a1b8dbacbe13b3afc911de41b099a4 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 15 Mar 2013 18:35:21 +0100 Subject: [PATCH] send notification mail --- op/op.RewindWorkflow.php | 19 ++++++++++++++++--- op/op.RunSubWorkflow.php | 19 +++++++++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/op/op.RewindWorkflow.php b/op/op.RewindWorkflow.php index 00b0b9f29..d840ea9ae 100644 --- a/op/op.RewindWorkflow.php +++ b/op/op.RewindWorkflow.php @@ -61,18 +61,31 @@ if (!is_object($workflow)) { if($version->rewindWorkflow()) { if ($notifier) { $nl = $document->getNotifyList(); + $folder = $document->getFolder(); +/* $subject = "###SITENAME###: ".$document->getName()." - ".getMLText("rewind_workflow_email"); $message = getMLText("rewind_workflow_email")."\r\n"; $message .= getMLText("document").": ".$document->getName()."\r\n". getMLText("workflow").": ".$workflow->getName()."\r\n". getMLText("user").": ".$user->getFullName()." <". $user->getEmail() ."> "; - +*/ + $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'] = "http".((isset($_SERVER['HTTPS']) && (strcmp($_SERVER['HTTPS'],'off')!=0)) ? "s" : "")."://".$_SERVER['HTTP_HOST'].$settings->_httpRoot."out/out.ViewDocument.php?documentid=".$document->getID(); // Send notification to subscribers. - $notifier->toList($user, $nl["users"], $subject, $message); + $notifier->toList($user, $nl["users"], $subject, $message, $params); foreach ($nl["groups"] as $grp) { - $notifier->toGroup($user, $grp, $subject, $message); + $notifier->toGroup($user, $grp, $subject, $message, $params); } } } diff --git a/op/op.RunSubWorkflow.php b/op/op.RunSubWorkflow.php index 76027ccb0..e3c7cfaa7 100644 --- a/op/op.RunSubWorkflow.php +++ b/op/op.RunSubWorkflow.php @@ -67,7 +67,9 @@ if($version->getWorkflowState()->getID() != $subworkflow->getInitState()->getID( if($version->runSubWorkflow($subworkflow)) { if ($notifier) { $nl = $document->getNotifyList(); + $folder = $document->getFolder(); +/* $subject = "###SITENAME###: ".$document->getName()." - ".getMLText("run_subworkflow_email"); $message = getMLText("run_subwork_email")."\r\n"; $message .= @@ -75,11 +77,24 @@ if($version->runSubWorkflow($subworkflow)) { getMLText("workflow").": ".$subworkflow->getName()."\r\n". getMLText("current_state").": ".$version->getWorkflowState()->getName()."\r\n". getMLText("user").": ".$user->getFullName()." <". $user->getEmail() ."> "; +*/ + $subject = "run_subworkflow_email_subject"; + $message = "run_subworkflow_email_body"; + $params = array(); + $params['name'] = $document->getName(); + $params['version'] = $version->getVersion(); + $params['workflow'] = $workflow->getName(); + $params['subworkflow'] = $subworkflow->getName(); + $params['folder_path'] = $folder->getFolderPathPlain(); + $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(); // Send notification to subscribers. - $notifier->toList($user, $nl["users"], $subject, $message); + $notifier->toList($user, $nl["users"], $subject, $message, $params); foreach ($nl["groups"] as $grp) { - $notifier->toGroup($user, $grp, $subject, $message); + $notifier->toGroup($user, $grp, $subject, $message, $params); } } }