mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
set splash messages, inform users only once
This commit is contained in:
parent
2d8e8a606c
commit
e6cc38cb22
|
@ -116,9 +116,13 @@ if($version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
|
|||
$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();
|
||||
|
||||
$usersinformed = array();
|
||||
foreach($workflow->getNextTransitions($transition->getNextState()) as $ntransition) {
|
||||
foreach($ntransition->getUsers() as $tuser) {
|
||||
$notifier->toIndividual($user, $tuser->getUser(), $subject, $message, $params);
|
||||
if(!in_array($tuser->getUser()->getID(), $usersinformed)) {
|
||||
$usersinformed[] = $tuser->getUser()->getID();
|
||||
$notifier->toIndividual($user, $tuser->getUser(), $subject, $message, $params);
|
||||
}
|
||||
}
|
||||
foreach($ntransition->getGroups() as $tuser) {
|
||||
$notifier->toGroup($user, $tuser->getGroup(), $subject, $message, $params);
|
||||
|
@ -127,6 +131,8 @@ if($version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
|
|||
}
|
||||
}
|
||||
|
||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_trigger_workflow')));
|
||||
|
||||
if(isset($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'])) {
|
||||
foreach($GLOBALS['SEEDDMS_HOOKS']['triggerWorkflowTransition'] as $hookObj) {
|
||||
if (method_exists($hookObj, 'postTriggerWorkflowTransition')) {
|
||||
|
@ -134,6 +140,8 @@ if($version->triggerWorkflowTransition($user, $transition, $_POST["comment"])) {
|
|||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_trigger_workflow')));
|
||||
}
|
||||
|
||||
add_log_line("?documentid=".$documentid."&version".$version_num);
|
||||
|
|
Loading…
Reference in New Issue
Block a user