Commit 67e92386f3bb1fa4d2bc03b2cb89d03baa1c0d6f
1 parent
a9032fec
Validation for a condition (saved search and getIsCondition() == true)
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3969 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
12 additions
and
0 deletions
lib/validation/dispatchervalidation.inc.php
| ... | ... | @@ -140,6 +140,18 @@ class KTDispatcherValidation { |
| 140 | 140 | return $this->validateEntity('Group', $iId, $aOptions); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | + function &validateCondition($iId, $aOptions = null) { | |
| 144 | + require_once(KT_LIB_DIR . '/search/savedsearch.inc.php'); | |
| 145 | + $oSearch = $this->validateEntity('KTSavedSearch', $iId, $aOptions); | |
| 146 | + if ($oSearch->getIsCondition()) { | |
| 147 | + return $oSearch; | |
| 148 | + } | |
| 149 | + $aOptions = KTUTil::meldOptions($aOptions, array( | |
| 150 | + 'message' => "Condition is a saved search, but not a condition", | |
| 151 | + )); | |
| 152 | + $this->handleError($aOptions); | |
| 153 | + } | |
| 154 | + | |
| 143 | 155 | function validateDict($aDict, $aValidation, $aOptions = null) { |
| 144 | 156 | foreach ($aValidation as $k => $aValidatorInfo) { |
| 145 | 157 | $sDictValue = KTUtil::arrayGet($aDict, $k, null); | ... | ... |