From 7eeef93ea99be580b8ca72637ecf88a89a0ec3ee Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Nana?= <sebastien.nana@maarch.org>
Date: Tue, 10 Nov 2015 10:02:58 +0000
Subject: [PATCH] FIX #3043 selected list on index type

---
 maarch_entreprise/trunk/class/class_types.php | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/maarch_entreprise/trunk/class/class_types.php b/maarch_entreprise/trunk/class/class_types.php
index 80043d49816..9ba1c4127a6 100644
--- a/maarch_entreprise/trunk/class/class_types.php
+++ b/maarch_entreprise/trunk/class/class_types.php
@@ -1267,14 +1267,23 @@ class types extends database
                 if (preg_match('/^doc_/', $fieldName)) {
                     $column = 'doc_' . $column;
                 }
-                // type == 'string'
+                // type == 'string or others'
                 if ($indexes[$j]['column'] == $fieldName
                     || 'doc_' . $indexes[$j]['column'] == $fieldName
                 ) {
+					if ( $indexes[$j]['type'] = float || $indexes[$j]['type'] = integer )
+					{
+						       $jsonTxt .= " '" . $fieldName . "' : ['"
+                             . addslashes(trim($val)) . "'],";
+					$whereRequest .= " (" . $column . ") = ('"
+                                      . $val . "') and ";
+						
+					} else {
                     $jsonTxt .= " '" . $fieldName . "' : ['"
                              . addslashes(trim($val)) . "'],";
 					$whereRequest .= " lower(" . $column . ") like lower('%"
                                       . $this->protect_string_db($val) . "%') and ";
+					}
                     break;
                 } else if (($indexes[$j]['column'] . '_from' == $fieldName
                     || $indexes[$j]['column'] . '_to' == $fieldName
-- 
GitLab