Commit 7ed477c4f0a9d8f8cacec868391bbf26a44653ba
1 parent
72949a16
If a workflow transition has a guard condition, ensure it is fulfilled
before offering it as a transition available from this workflow state. git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3971 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
0 deletions
lib/workflow/workflowutil.inc.php
| ... | ... | @@ -7,6 +7,7 @@ require_once(KT_LIB_DIR . '/workflow/workflowtransition.inc.php'); |
| 7 | 7 | require_once(KT_LIB_DIR . '/permissions/permissionutil.inc.php'); |
| 8 | 8 | require_once(KT_LIB_DIR . '/groups/GroupUtil.php'); |
| 9 | 9 | require_once(KT_LIB_DIR . '/documentmanagement/DocumentTransaction.inc'); |
| 10 | +require_once(KT_LIB_DIR . '/search/searchutil.inc.php'); | |
| 10 | 11 | |
| 11 | 12 | class KTWorkflowUtil { |
| 12 | 13 | // {{{ saveTransitionsFrom |
| ... | ... | @@ -337,6 +338,13 @@ class KTWorkflowUtil { |
| 337 | 338 | continue; |
| 338 | 339 | } |
| 339 | 340 | } |
| 341 | + | |
| 342 | + $iConditionId = $oTransition->getGuardConditionId(); | |
| 343 | + if ($iConditionId) { | |
| 344 | + if (!KTSearchUtil::testConditionOnDocument($iConditionId, $oDocument)) { | |
| 345 | + continue; | |
| 346 | + } | |
| 347 | + } | |
| 340 | 348 | $aEnabledTransitions[] = $oTransition; |
| 341 | 349 | } |
| 342 | 350 | return $aEnabledTransitions; | ... | ... |