[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%'))";
}
- [Noalyss-commit] [noalyss] 07/119: prevent divide by zero in formula, (continued)
- [Noalyss-commit] [noalyss] 07/119: prevent divide by zero in formula, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 09/119: compatibility PHP74 : join() : glue before piece, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 06/119: reconcilaction : possibility to select only one operation, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 13/119: Bug 1834 : order POST over GET, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 05/119: Bug : syntax error, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 04/119: Bug : use ilike instead of tilde, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 02/119: Bug : correct search remove ~, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 08/119: remove extract, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 03/119: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 01/119: Fix warning with empty array, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 10/119: Fix bug : cannot use % when searching NEW : space can be used now,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 14/119: doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 11/119: Improve use of the security, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 17/119: javascript : add function to concat 2 json objects, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 18/119: javascript: remove hardcoding of dialog box for manage_table, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 30/119: Bug 1834 : duplicate , cannot confirm an duplicated operation because the $_GET is taken in priority, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 29/119: Remove debug info, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 37/119: javascript: remove hardcoding of dialog box for manage_table, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 52/119: NEW Security : add tag, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 22/119: ManageTable : you can set the style of the dialog box, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 23/119: Rewriting of Predefined Operation. You can add new Predefined Operation, Dany De Bontridder, 2020/10/26