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:
mdtrooper 2012-11-29 16:14:45 +00:00
parent b1c4db4b9a
commit 7d3afcfb29
4 changed files with 43 additions and 32 deletions

View File

@ -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>
* godmode/menu.php: Changed netflow title.

View File

@ -190,17 +190,12 @@ if ($search_agents_2 && (!defined('METACONSOLE'))) {
elseif ($search_agents_2 && ($config['metaconsole'] == 1) && defined('METACONSOLE')) {
$servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup");
FROM tmetaconsole_setup
WHERE disabled = 0");
if (!isset($servers)) {
return;
}
$data = array();
foreach ($servers as $server) {
if (metaconsole_load_external_db ($server) != NOERR) {
continue;
}
$id_agent = (int) get_parameter ('id_agent');
$string = (string) get_parameter ('q'); /* q is what autocomplete plugin gives */
$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;
$data = array();
foreach ($servers as $server) {
if (metaconsole_load_external_db ($server) != NOERR) {
continue;
}
$agents = agents_get_agents ($filter, array ('id_agente','nombre', 'direccion'));
if ($agents === false)
continue;

View File

@ -436,7 +436,8 @@ function agents_get_agents ($filter = false, $fields = false, $access = 'AR', $o
}
if (!isset($order['field2'])) {
$order = 'ORDER BY '.$order['field'] . ' ' . $order['order'];
} else {
}
else {
$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 ";
}
$sql = sprintf("%s %s", $sql, $limit_sql);
//html_debug_print($sql, true);
if ($return)
return $sql;
else

View File

@ -1761,7 +1761,8 @@ function ui_toggle($code, $name, $title = '', $hidde_default = true, $return = f
// Link to toggle
$output = '';
$output .= '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b>&nbsp;'.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a><br /><br />';
$output .= '<a href="#" id="tgl_ctrl_'.$uniqid.'"><b>'.$name.'</b>&nbsp;'.html_print_image ($original, true, array ("title" => $title, "id" => "image_".$uniqid)).'</a>';
$output .= '<br /><br />';
// Code into a div
$output .= "<div id='tgl_div_".$uniqid."' style='".$style."'>\n";