2012-11-29 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/agent.php: optimiced the ajax hook "search_agents_2" for the metaconsoles. *include/functions_ui.php, include/functions_agents.php: cleaned source code style. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7205 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
b1c4db4b9a
commit
7d3afcfb29
|
@ -1,3 +1,11 @@
|
||||||
|
2012-11-29 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/ajax/agent.php: optimiced the ajax hook "search_agents_2"
|
||||||
|
for the metaconsoles.
|
||||||
|
|
||||||
|
*include/functions_ui.php, include/functions_agents.php: cleaned
|
||||||
|
source code style.
|
||||||
|
|
||||||
2012-11-29 Vanessa Gil <vanessa.gil@artica.es>
|
2012-11-29 Vanessa Gil <vanessa.gil@artica.es>
|
||||||
|
|
||||||
* godmode/menu.php: Changed netflow title.
|
* godmode/menu.php: Changed netflow title.
|
||||||
|
|
|
@ -190,17 +190,12 @@ if ($search_agents_2 && (!defined('METACONSOLE'))) {
|
||||||
elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOLE')) {
|
elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOLE')) {
|
||||||
|
|
||||||
$servers = db_get_all_rows_sql ("SELECT *
|
$servers = db_get_all_rows_sql ("SELECT *
|
||||||
FROM tmetaconsole_setup");
|
FROM tmetaconsole_setup
|
||||||
|
WHERE disabled = 0");
|
||||||
if (!isset($servers)) {
|
if (!isset($servers)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$data = array();
|
|
||||||
foreach ($servers as $server) {
|
|
||||||
if (metaconsole_load_external_db ($server) != NOERR) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
$id_agent = (int) get_parameter ('id_agent');
|
$id_agent = (int) get_parameter ('id_agent');
|
||||||
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
|
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
|
||||||
$id_group = (int) get_parameter('id_group');
|
$id_group = (int) get_parameter('id_group');
|
||||||
|
@ -226,6 +221,12 @@ elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOL
|
||||||
|
|
||||||
$filter['id_grupo'] = $id_group;
|
$filter['id_grupo'] = $id_group;
|
||||||
|
|
||||||
|
$data = array();
|
||||||
|
foreach ($servers as $server) {
|
||||||
|
if (metaconsole_load_external_db ($server) != NOERR) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
$agents = agents_get_agents ($filter, array ('id_agente','nombre', 'direccion'));
|
$agents = agents_get_agents ($filter, array ('id_agente','nombre', 'direccion'));
|
||||||
if ($agents === false)
|
if ($agents === false)
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -436,7 +436,8 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
||||||
}
|
}
|
||||||
if (!isset($order['field2'])) {
|
if (!isset($order['field2'])) {
|
||||||
$order = 'ORDER BY '.$order['field'] . ' ' . $order['order'];
|
$order = 'ORDER BY '.$order['field'] . ' ' . $order['order'];
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
$order = 'ORDER BY '.$order['field'] . ' ' . $order['order'] . ', ' . $order['field2'];
|
$order = 'ORDER BY '.$order['field'] . ' ' . $order['order'] . ', ' . $order['field2'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -474,7 +475,7 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
|
||||||
$limit_sql = " LIMIT $offset, $limit ";
|
$limit_sql = " LIMIT $offset, $limit ";
|
||||||
}
|
}
|
||||||
$sql = sprintf("%s %s", $sql, $limit_sql);
|
$sql = sprintf("%s %s", $sql, $limit_sql);
|
||||||
|
//html_debug_print($sql, true);
|
||||||
if ($return)
|
if ($return)
|
||||||
return $sql;
|
return $sql;
|
||||||
else
|
else
|
||||||
|
|
|
@ -1761,7 +1761,8 @@ function ui_toggle($code, $name, $title = '', $hidde_default = true, $return = f
|
||||||
|
|
||||||
// Link to toggle
|
// Link to toggle
|
||||||
$output = '';
|
$output = '';
|
||||||
$output .= '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b> '.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a><br /><br />';
|
$output .= '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b> '.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a>';
|
||||||
|
$output .= '<br /><br />';
|
||||||
|
|
||||||
// Code into a div
|
// Code into a div
|
||||||
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";
|
||||||
|
|
Loading…
Reference in New Issue