mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Merge branch '862-search-fields-going-wrong-dev' into 'develop'
Added alias search to general search and case no case sensitive search to agent details search field See merge request !466
This commit is contained in:
commit
70db081222
@ -367,7 +367,8 @@ if ($search != "") {
|
|||||||
if($id != ''){
|
if($id != ''){
|
||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = " AND ( nombre " . $order_collation . "
|
$search_sql = " AND ( nombre " . $order_collation . "
|
||||||
LIKE '%$search%' OR tagente.id_agente = $aux";
|
COLLATE utf8_general_ci LIKE '%$search%' OR alias ".$order_collation." COLLATE utf8_general_ci LIKE '%$search%'
|
||||||
|
OR tagente.id_agente = $aux";
|
||||||
if(count($id)>=2){
|
if(count($id)>=2){
|
||||||
for ($i = 1; $i < count($id); $i++){
|
for ($i = 1; $i < count($id); $i++){
|
||||||
$aux = $id[$i]['id_agent'];
|
$aux = $id[$i]['id_agent'];
|
||||||
@ -377,7 +378,7 @@ if ($search != "") {
|
|||||||
$search_sql .= ")";
|
$search_sql .= ")";
|
||||||
}else{
|
}else{
|
||||||
$search_sql = " AND ( nombre " . $order_collation . "
|
$search_sql = " AND ( nombre " . $order_collation . "
|
||||||
LIKE '%$search%' OR alias ".$order_collation." LIKE '%$search%') ";
|
COLLATE utf8_general_ci LIKE '%$search%' OR alias ".$order_collation." COLLATE utf8_general_ci LIKE '%$search%') ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -428,9 +429,8 @@ if ($strict_user) {
|
|||||||
|
|
||||||
$total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true);
|
$total_agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $count_filter, $fields, false, $strict_user, true);
|
||||||
$total_agents = count($total_agents);
|
$total_agents = count($total_agents);
|
||||||
|
|
||||||
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
$agents = tags_get_all_user_agents (false, $config['id_user'], $acltags, $filter, $fields, false, $strict_user, true);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$total_agents = agents_get_agents(array (
|
$total_agents = agents_get_agents(array (
|
||||||
|
@ -125,6 +125,7 @@ if ($searchAgents) {
|
|||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%cd " . $stringSearchSQL . "%%' OR
|
$search_sql = " t1.nombre COLLATE utf8_general_ci LIKE '%%cd " . $stringSearchSQL . "%%' OR
|
||||||
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
t2.nombre COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||||
|
t1.alias COLLATE utf8_general_ci LIKE '%%" . $stringSearchSQL . "%%' OR
|
||||||
t1.id_agente = $aux";
|
t1.id_agente = $aux";
|
||||||
|
|
||||||
if (count($id) >= 2) {
|
if (count($id) >= 2) {
|
||||||
@ -180,7 +181,7 @@ if ($searchAgents) {
|
|||||||
$query = $select . $sql;
|
$query = $select . $sql;
|
||||||
|
|
||||||
$query .= $limit;
|
$query .= $limit;
|
||||||
|
|
||||||
$agents = db_process_sql($query);
|
$agents = db_process_sql($query);
|
||||||
if (empty($agents))
|
if (empty($agents))
|
||||||
$agents = array();
|
$agents = array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user