From d1bf374dacbfed605252b0c6b52722248badf9e9 Mon Sep 17 00:00:00 2001 From: guruevi Date: Fri, 10 Apr 2009 14:03:24 +0000 Subject: [PATCH] 2009-04-10 Evi Vanoost * include/functions_db.php: get_group_agents fixed search * operation/agentes/estado_agente.php: Small style changes and bugfixes git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@1607 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_db.php | 12 ++++++------ .../operation/agentes/estado_agente.php | 15 ++++++--------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 36569ef543..f7e26aef4a 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2009-04-10 Evi Vanoost + + * include/functions_db.php: get_group_agents fixed search + + * operation/agentes/estado_agente.php: Small style changes and bugfixes + 2009-04-09 Evi Vanoost * include/functions_reporting.php: Added get_agent_module_info which gives diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index d39ce07daa..e259541571 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -336,25 +336,25 @@ function get_group_agents ($id_group = 0, $search = false, $case = "lower") { return array (); } - $search = sprintf ('WHERE id_grupo IN (%s)', implode (",", $id_group)); + $search_sql = sprintf ('WHERE id_grupo IN (%s)', implode (",", $id_group)); if ($search === true) { //No added search. Show both disabled and non-disabled } elseif (is_array ($search)) { if (isset ($search["disabled"])) { - $search .= ' AND disabled = '.($search["disabled"] ? 1 : 0); //Bool, no cleanup necessary + $search_sql .= ' AND disabled = '.($search["disabled"] ? 1 : 0); //Bool, no cleanup necessary } else { - $search .= ' AND disabled = 0'; + $search_sql .= ' AND disabled = 0'; } if (isset ($search["string"])) { $string = safe_input ($search["string"]); - $search .= ' (nombre LIKE "'.$string.'" OR comentarios LIKE "'.$string.'" OR direccion LIKE "'.$string.'"'; + $search_sql .= ' AND (nombre LIKE "'.$string.'" OR comentarios LIKE "'.$string.'" OR direccion LIKE "'.$string.'")'; } } else { - $search .= ' AND disabled = 0'; + $search_sql .= ' AND disabled = 0'; } - $sql = sprintf ("SELECT id_agente, nombre FROM tagente %s ORDER BY nombre", $search); + $sql = sprintf ("SELECT id_agente, nombre FROM tagente %s ORDER BY nombre", $search_sql); $result = get_db_all_rows_sql ($sql); if ($result === false) diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php index 17283b0f14..fdb856c392 100644 --- a/pandora_console/operation/agentes/estado_agente.php +++ b/pandora_console/operation/agentes/estado_agente.php @@ -63,26 +63,23 @@ if (isset($_POST["ag_group"])){ echo '
'; } -echo ''; -echo ''; - -echo '
'.__('Group').''; +echo ''; +echo '
'.__('Group').': '; $groups = get_user_groups (); print_select ($groups, 'ag_group', $ag_group, 'this.form.submit()', '', ''); -echo ''; +echo ''; -echo __('Free text for search').' (*)'; -echo ''; +echo __('Free text for search').' (*): '; print_input_text ("search", $search, '', 15); -echo ''; +echo ''; print_submit_button (__('Search'), "srcbutton", '', array ("class" => "sub")); -echo "
"; +echo '
 
'; if ($search != ""){ $search_sql = array ("string" => '%'.$search.'%');