From 9b6cc3a9d063d760b43df4a103048fa1215c8200 Mon Sep 17 00:00:00 2001 From: conradverm Date: Tue, 23 Oct 2007 23:39:18 +0000 Subject: [PATCH] KTS-673 "The search algorithm needs some work" Updated. refactor boolean --- search2/search/fields/IsCheckedOutField.inc.php | 17 +---------------- search2/search/fields/IsImmutableField.inc.php | 17 +---------------- 2 files changed, 2 insertions(+), 32 deletions(-) diff --git a/search2/search/fields/IsCheckedOutField.inc.php b/search2/search/fields/IsCheckedOutField.inc.php index 09be3e1..9a79b38 100755 --- a/search2/search/fields/IsCheckedOutField.inc.php +++ b/search2/search/fields/IsCheckedOutField.inc.php @@ -11,22 +11,7 @@ class IsCheckedOutField extends DBFieldExpr public function modifyValue($value) { - if (is_numeric($value)) - { - $value = ($value+0)?1:0; - } - else - { - switch(strtolower($value)) - { - case 'true': - case 'yes': - $value=1; - break; - default: - $value=0; - } - } + $value = KTUtil::anyToBool($value, false)?1:0; return $value; } diff --git a/search2/search/fields/IsImmutableField.inc.php b/search2/search/fields/IsImmutableField.inc.php index 30488e3..c605c8b 100755 --- a/search2/search/fields/IsImmutableField.inc.php +++ b/search2/search/fields/IsImmutableField.inc.php @@ -11,22 +11,7 @@ class IsImmutableField extends DBFieldExpr public function modifyValue($value) { - if (is_numeric($value)) - { - $value = ($value+0)?1:0; - } - else - { - switch(strtolower($value)) - { - case 'true': - case 'yes': - $value=1; - break; - default: - $value=0; - } - } + $value = KTUtil::anyToBool($value, false)?1:0; return $value; } -- libgit2 0.21.4