2013-05-21 Miguel de Dios <miguel.dedios@artica.es>

* operation/search_main.php, operation/search_agents.getdata.php:
	changed the source code, now it uses the page size to show the
	agents in first page, fixed the list of icons, now show graphs and
	set in correct english this icons. And added a footpage in the list
	of agents to show if it is all or not.
	
	Fixes: #2227
	
	* include/constants.php: erased constants to count agents to show
	in the search.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8175 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-05-21 10:17:51 +00:00
parent e75958bbab
commit 0137d5e2d9
5 changed files with 53 additions and 21 deletions

View File

@ -1,3 +1,16 @@
2013-05-21 Miguel de Dios <miguel.dedios@artica.es>
* operation/search_main.php, operation/search_agents.getdata.php:
changed the source code, now it uses the page size to show the
agents in first page, fixed the list of icons, now show graphs and
set in correct english this icons. And added a footpage in the list
of agents to show if it is all or not.
Fixes: #2227
* include/constants.php: erased constants to count agents to show
in the search.
2013-05-21 Miguel de Dios <miguel.dedios@artica.es>
* operation/agentes/gis_view.php: fixed the title of agent in the

View File

@ -280,7 +280,4 @@ define ('REPORT_EXCEPTION_CONDITION_E', 7);
define ('REPORT_EXCEPTION_CONDITION_NE', 8);
define ('REPORT_EXCEPTION_CONDITION_OK', 3);
define ('REPORT_EXCEPTION_CONDITION_NOT_OK', 4);
/* GLOBAL SEARCH */
define('ITEMS_TO_SHOW_IN_MAIN_TAB', 5);
?>

View File

@ -157,7 +157,8 @@ function modules_change_disabled($id_agent_module, $new_value = 1) {
foreach ($id_agent_module as $id_module) {
// If the module is already disabled/enabled ignore
$current_disabled = db_get_value('disabled', 'tagente_modulo', 'id_agente_modulo', $id_module);
$current_disabled = db_get_value('disabled', 'tagente_modulo',
'id_agente_modulo', $id_module);
if ($current_disabled == $new_value) {
continue;
}
@ -167,15 +168,20 @@ function modules_change_disabled($id_agent_module, $new_value = 1) {
}
if (empty($id_agent_module_changed)) {
$result = false;
return NOERR;
}
else {
$result = db_process_sql_update('tagente_modulo', array('disabled' => (int) $new_value), array('id_agente_modulo' => $id_agent_module_changed));
$result = db_process_sql_update('tagente_modulo',
array('disabled' => (int) $new_value),
array('id_agente_modulo' => $id_agent_module_changed));
}
if ($result) {
// Change the agent flag to update modules count
db_process_sql_update('tagente', array('update_module_count' => 1), array('id_agente' => $id_agent_changed));
db_process_sql_update('tagente',
array('update_module_count' => 1),
array('id_agente' => $id_agent_changed));
return NOERR;
}
else {
@ -303,7 +309,6 @@ function modules_update_agent_module ($id, $values, $onlyNoDeletePending = false
}
$result = @db_process_sql_update ('tagente_modulo', $values, $where);
if (($result === false) || ($result_disable === ERR_GENERIC)) {
return ERR_DB;
}

View File

@ -181,16 +181,23 @@ if ($searchAgents) {
"SELECT t1.id_agente, t1.ultimo_contacto, t1.nombre, t1.id_os, t1.intervalo, t1.id_grupo, t1.disabled";
if ($only_count) {
$limit = " ORDER BY " . $order['field'] . " " . $order['order'] .
" LIMIT " . ITEMS_TO_SHOW_IN_MAIN_TAB . " OFFSET 0";
" LIMIT " . $config["block_size"] . " OFFSET 0";
}
else {
$limit = " ORDER BY " . $order['field'] . " " . $order['order'] .
" LIMIT " . $config['block_size'] . " OFFSET " . get_parameter ('offset',0);
" LIMIT " . $config['block_size'] . " OFFSET " . get_parameter('offset',0);
}
$query = $select . $sql . $limit;
$agents = db_process_sql($query);
if (empty($agents))
$agents = array();
$count_agents_main = 0;
if ($only_count) {
$count_agents_main = count($agents);
}
if ($agents !== false) {
$totalAgents = db_get_value_sql(

View File

@ -47,30 +47,40 @@ $table->style[11] = 'font-weight: bold; text-align: center;';
$table->data[0][0] = html_print_image ("images/agent.png", true, array ("title" => __('Agents found')));
$table->data[0][1] = "<a href='index.php?search_category=agents&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalAgents) . "</a>";
sprintf(__("%s Found"), $totalAgents) . "</a>";
$table->data[0][2] = html_print_image ("images/module.png", true, array ("title" => __('Modules found')));
$table->data[0][3] = "<a href='index.php?search_category=modules&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalModules) . "</a>";
sprintf(__("%s Found"), $totalModules) . "</a>";
$table->data[0][4] = html_print_image ("images/bell.png", true, array ("title" => __('Alerts found')));
$table->data[0][5] = "<a href='index.php?search_category=alerts&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalAlerts) . "</a>";
sprintf(__("%s Found"), $totalAlerts) . "</a>";
$table->data[0][6] = html_print_image ("images/input_user.png", true, array ("title" => __('Users found')));
$table->data[0][7] = "<a href='index.php?search_category=users&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalUsers) . "</a>";
sprintf(__("%s Found"), $totalUsers) . "</a>";
$table->data[0][8] = html_print_image ("images/chart_curve.png", true, array ("title" => __('Graphs found')));
$table->data[0][9] = "<a href='index.php?search_category=graphs&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalGraphs) . "</a>";
$table->data[0][8] = html_print_image ("images/reporting.png", true, array ("title" => __('Reports found')));
$table->data[0][9] = "<a href='index.php?search_category=reports&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalReports) . "</a>";
$table->data[0][10] = html_print_image ("images/visual_console_green.png", true, array ("title" => __('Maps found')));
$table->data[0][11] = "<a href='index.php?search_category=maps&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("Found %s"), $totalMaps) . "</a>";
sprintf(__("%s Found"), $totalGraphs) . "</a>";
$table->data[0][10] = html_print_image ("images/reporting.png", true, array ("title" => __('Reports found')));
$table->data[0][11] = "<a href='index.php?search_category=reports&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("%s Found"), $totalReports) . "</a>";
$table->data[0][12] = html_print_image ("images/visual_console_green.png", true, array ("title" => __('Maps found')));
$table->data[0][13] = "<a href='index.php?search_category=maps&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__("%s Found"), $totalMaps) . "</a>";
html_print_table($table);
if ($searchAgents && $totalAgents > 0) {
echo $list_agents;
if ($count_agents_main < $totalAgents) {
echo "<a href='index.php?search_category=modules&keywords=".$keyword."&head_search_keywords=Search'>" .
sprintf(__('Show %s of %s. View all matches'),
$count_agents_main, $totalAgents) .
"</a>";
}
else {
echo __('Show all agents.');
}
}
echo '</div>';