noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 10/119: Fix bug : cannot use % when searching


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 10/119: Fix bug : cannot use % when searching NEW : space can be used now
Date: Mon, 26 Oct 2020 18:27:02 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 03ad5cd3fd76fb7f6a5830855c15cc0ca36cec90
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Thu Aug 27 20:31:23 2020 +0200

    Fix bug : cannot use % when searching
    NEW : space can be used now
---
 html/js/card.js               | 2 ++
 include/ajax/ajax_card.php    | 8 +++++---
 include/class/fiche.class.php | 3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/html/js/card.js b/html/js/card.js
index 8c7b918..6212658 100644
--- a/html/js/card.js
+++ b/html/js/card.js
@@ -274,7 +274,9 @@ function search_get_card(obj)
     } else {
         queryString+="&accvis=0";
     }
+    queryString=encodeURI(queryString);
     $('asearch').innerHTML=loading();
+    
     var action=new Ajax.Request ( 'ajax_misc.php',
                                   {
                                   method:'get',
diff --git a/include/ajax/ajax_card.php b/include/ajax/ajax_card.php
index 9b61631..74a3d5b 100644
--- a/include/ajax/ajax_card.php
+++ b/include/ajax/ajax_card.php
@@ -441,7 +441,7 @@ case 'fs':
        $r.='</span>';
     $r.=dossier::hidden().HtmlInput::hidden('op','fs');
     $array=array();
-    foreach 
(array('accvis','query','inp','jrn','label','typecard','price','tvaid') as $i)
+    foreach (array('accvis','inp','jrn','label','typecard','price','tvaid') as 
$i)
     {
         if  (isset(${$i}) )
         {
@@ -449,6 +449,7 @@ case 'fs':
             $sql_array[$i]=${$i};
         }
     }
+    $sql_array["query"]=$query;
     /* what is the type of the ledger */
     $type="GL";
     if (isset($jrn) && $jrn > 1)
@@ -462,12 +463,13 @@ case 'fs':
 
     if ( strpos($sql," in ()") != 0)
     {
-            $html=Icon_Action::close('search_card');
-             $html.='<div> '.h2info(_('Recherche de fiche')).'</div>';
+            $html="";
+             $html.=HtmlInput::title_box(_('Recherche de fiche'), 
'search_card');
              $html.='<h3 class="notice">';
              $html.=_("Aucune catégorie de fiche ne correspond à".
             " votre demande, le journal pourrait n'avoir accès à aucune 
fiche");
              $html.='</h3>';
+             $html.=HtmlInput::button_close("search_card");
              break;
     }
      /* We limit the search to MAX_SEARCH_CARD records */
diff --git a/include/class/fiche.class.php b/include/class/fiche.class.php
index 876351e..565612c 100644
--- a/include/class/fiche.class.php
+++ b/include/class/fiche.class.php
@@ -2131,8 +2131,9 @@ class Fiche
         {
             $query=sql_string($query);
 
-            if (strlen(trim($query))>1)
+            if (strlen(trim($query))>0)
             {
+                $query=str_replace(" ", "%", $query);
                 $filter_query=$and."(vw_name ilike '%$query%' or quick_code 
ilike ('%$query%') "
                         ." or vw_description ilike '%$query%' or tva_num ilike 
'%$query%' or accounting like upper('$query%'))";
             }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]