From 7ebd3a4a0ace51154d0f16a7210ddb3bf35b98de Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Tue, 2 Feb 2021 10:21:02 +0100 Subject: [PATCH] get reviewers, approvers, workflow from controller before sending notifications --- op/op.Ajax.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/op/op.Ajax.php b/op/op.Ajax.php index ca23fad15..4b242fca3 100644 --- a/op/op.Ajax.php +++ b/op/op.Ajax.php @@ -63,6 +63,7 @@ if (isset($_COOKIE["mydms_session"])) { $dms->setRootFolderID($user->getHomeFolder()); } + global $logger; $notifier = new SeedDMS_NotificationService($logger); if(isset($GLOBALS['SEEDDMS_HOOKS']['notification'])) { foreach($GLOBALS['SEEDDMS_HOOKS']['notification'] as $notificationObj) { @@ -835,6 +836,7 @@ switch($command) { $notifier->toGroup($user, $grp, $subject, $message, $params, SeedDMS_NotificationService::RECV_NOTIFICATION); } + $workflow = $controller->getParam('workflow'); if($workflow && $settings->_enableNotificationWorkflow) { $subject = "request_workflow_action_email_subject"; $message = "request_workflow_action_email_body"; @@ -861,6 +863,11 @@ switch($command) { if($settings->_enableNotificationAppRev) { /* Reviewers and approvers will be informed about the new document */ + /* Get reviewers and approvers from controller in case it was + * modified in a hook + */ + $reviewers = $controller->getParam('reviewers'); + $approvers = $controller->getParam('approvers'); if($reviewers['i'] || $reviewers['g']) { $subject = "review_request_email_subject"; $message = "review_request_email_body";