Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2021-12-02 22:10:09 +01:00
commit 050aff4798

View File

@ -77,14 +77,17 @@ if(isset($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'])) {
}
$overallStatus = $version->getStatus();
if($version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
if($ret = $version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
/* $ret is the next state if it was entered otherwise it is just true */
if ($notifier) {
$wkflog = $version->getWorkflowLog($transition);
$notifier->sendTriggerWorkflowTransitionMail($version, $user, $wkflog ? $wkflog[0] : false);
$notifier->sendRequestWorkflowActionMail($version, $user, $transition);
if($overallStatus['status'] != $version->getStatus()['status']) {
$notifier->sendChangedDocumentStatusMail($version, $user, $overallStatus["status"]);
if(is_object($ret)) {
$notifier->sendRequestWorkflowActionMail($version, $user, $transition);
if($overallStatus['status'] != $version->getStatus()['status']) {
$notifier->sendChangedDocumentStatusMail($version, $user, $overallStatus["status"]);
}
}
}