2012-07-19 Miguel de Dios <miguel.dedios@artica.es>

* include/javascript/pandora.js: fixed the doc header for the
	function "agent_autocomplete" that was very wrong, and now in this
	function when call with the id_server_name equal to false, the
	function doesn't save the id_server in hidden input.
	
	* include/functions_agents.php: added function
	"agents_check_agent_exists" that check if any agent exists into the
	DB (of course you can check if exist and it is enabled).
	
	* operation/search_agents.php: fixed the link to manage the agents
	show in the search.




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@6790 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2012-07-19 13:42:51 +00:00
parent 50cd6e1033
commit 08103d5b90
4 changed files with 44 additions and 8 deletions

View File

@ -1,3 +1,17 @@
2012-07-19 Miguel de Dios <miguel.dedios@artica.es>
* include/javascript/pandora.js: fixed the doc header for the
function "agent_autocomplete" that was very wrong, and now in this
function when call with the id_server_name equal to false, the
function doesn't save the id_server in hidden input.
* include/functions_agents.php: added function
"agents_check_agent_exists" that check if any agent exists into the
DB (of course you can check if exist and it is enabled).
* operation/search_agents.php: fixed the link to manage the agents
show in the search.
2012-07-18 Miguel de Dios <miguel.dedios@artica.es>
* extensions/resource_registration.php,

View File

@ -22,6 +22,26 @@
require_once($config['homedir'] . "/include/functions_modules.php");
require_once($config['homedir'] . '/include/functions_users.php');
/**
* Check the agent exists in the DB.
*
* @param int $id_agent The agent id.
* @param boolean $show_disabled Show the agent found althought it is disabled. By default false.
*
* @return boolean The result to check if the agent is in the DB.
*/
function agents_check_agent_exists($id_agent, $show_disabled = true) {
$agent = db_get_value_filter('id_agente', 'tagente',
array('id_agente' => $id_agent, 'disabled' => !$show_disabled));
if (!empty($agent)) {
return true;
}
else {
return false;
}
}
/**
* Creates an agent
*

View File

@ -557,12 +557,12 @@ function agent_module_autocomplete (id_agent_name, id_agent_id, id_agent_module_
* Autocomplete Agent box functions.
*
* This function has all the necesary javascript to use the box with to autocomplete
* an agent name, and store it's id on a hidden field and fill a selector with the
* modules from that agent.
* an agent name, and store it's id on a hidden field and fill a hidden field with
* the server.
*
* @param id_agent_name id of the agent name box
* @param id_server_name id of the hidden field to store the server but if you put false don't save.
* @param id_agent_id id of the hidden field to store the agent id
* @param id_agent_module_selector id of the selector for the modules of the agent.
*/
function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) {
//Check exist the field with id in the var id_agent_name.
@ -606,7 +606,8 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) {
}
//Put the server
if (typeof(id_server_name) != "undefined") {
if (typeof(id_server_name) != "undefined"
|| typeof(id_server_name) != "boolean") {
$(id_server_name).val(server_name);
}
@ -627,7 +628,7 @@ function agent_autocomplete (id_agent_name, id_server_name, id_agent_id ) {
.append(text)
.appendTo(ul);
};
//Force the size of autocomplete
$(".ui-autocomplete").css("max-height", "100px");
$(".ui-autocomplete").css("overflow-y", "auto");

View File

@ -273,12 +273,13 @@ else {
$time_style = '<b><span style="color: #ff0000">'.$time.'</span></b>';
$manage_agent = '';
if (check_acl ($config['id_user'], $agent['id_grupo'], "AW")) {
$manage_agent = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='. $agent["id_agente"] . '">' .
$url_manage = 'index.php?sec=estado&sec2=godmode/agentes/configurar_agente&id_agente='. $agent["id_agente"];
$manage_agent = '<a href="' . $url_manage . '">' .
html_print_image("images/setup.png", true, array("title" => __('Manage'), "alt" => __('Manage'))) . '</a>';
}
array_push($table->data, array(
$cellName,
ui_print_os_icon ($agent["id_os"], false, true),