Commit 9b6cc3a9d063d760b43df4a103048fa1215c8200
1 parent
4c4e4397
KTS-673
"The search algorithm needs some work" Updated. refactor boolean Committed By: Conrad Vermeulen Reviewed By: Kevin Fourie git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7529 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
2 changed files
with
2 additions
and
32 deletions
search2/search/fields/IsCheckedOutField.inc.php
| ... | ... | @@ -11,22 +11,7 @@ class IsCheckedOutField extends DBFieldExpr |
| 11 | 11 | |
| 12 | 12 | public function modifyValue($value) |
| 13 | 13 | { |
| 14 | - if (is_numeric($value)) | |
| 15 | - { | |
| 16 | - $value = ($value+0)?1:0; | |
| 17 | - } | |
| 18 | - else | |
| 19 | - { | |
| 20 | - switch(strtolower($value)) | |
| 21 | - { | |
| 22 | - case 'true': | |
| 23 | - case 'yes': | |
| 24 | - $value=1; | |
| 25 | - break; | |
| 26 | - default: | |
| 27 | - $value=0; | |
| 28 | - } | |
| 29 | - } | |
| 14 | + $value = KTUtil::anyToBool($value, false)?1:0; | |
| 30 | 15 | return $value; |
| 31 | 16 | } |
| 32 | 17 | ... | ... |
search2/search/fields/IsImmutableField.inc.php
| ... | ... | @@ -11,22 +11,7 @@ class IsImmutableField extends DBFieldExpr |
| 11 | 11 | |
| 12 | 12 | public function modifyValue($value) |
| 13 | 13 | { |
| 14 | - if (is_numeric($value)) | |
| 15 | - { | |
| 16 | - $value = ($value+0)?1:0; | |
| 17 | - } | |
| 18 | - else | |
| 19 | - { | |
| 20 | - switch(strtolower($value)) | |
| 21 | - { | |
| 22 | - case 'true': | |
| 23 | - case 'yes': | |
| 24 | - $value=1; | |
| 25 | - break; | |
| 26 | - default: | |
| 27 | - $value=0; | |
| 28 | - } | |
| 29 | - } | |
| 14 | + $value = KTUtil::anyToBool($value, false)?1:0; | |
| 30 | 15 | return $value; |
| 31 | 16 | } |
| 32 | 17 | ... | ... |