From 25799f0bbbd50d80f363bbc8b72630a1f51e962a Mon Sep 17 00:00:00 2001 From: ramonn Date: Mon, 3 Dec 2012 17:58:15 +0000 Subject: [PATCH] 2012-12-03 Ramon Novoa * include/functions_treeview.php: Fixed id decoding under the metaconsole. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7223 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 5 ++++ .../include/functions_treeview.php | 26 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index a9bfdeca97..e75c65842d 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2012-12-03 Ramon Novoa + + * include/functions_treeview.php: Fixed id decoding under the + metaconsole. + 2012-12-03 Juan Manuel Ramon * pandoradb_data.sql diff --git a/pandora_console/include/functions_treeview.php b/pandora_console/include/functions_treeview.php index 7975244ce9..d76c0ea667 100755 --- a/pandora_console/include/functions_treeview.php +++ b/pandora_console/include/functions_treeview.php @@ -263,7 +263,7 @@ function treeview_printTree($type) { // Convert the id to hexadecimal, since it will be used as a div id if (defined ('METACONSOLE')) { $id = unpack ('H*', $item['_id_']); - $id = $hex_id[1]; + $id = $id[1]; } else { $id = $item['_id_']; } @@ -773,6 +773,13 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel //Extract all rows of data for each type switch ($type) { case 'group': + if (defined ('METACONSOLE')) { + $id = groups_get_id (pack ('H*', $id)); + if ($id == '') { + return false; + } + } + $sql = agents_get_agents(array ( 'order' => 'nombre COLLATE utf8_general_ci ASC', 'id_grupo' => $id, @@ -783,14 +790,6 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel 'AR', false, true); - - if (defined ('METACONSOLE')) { - $id = groups_get_id (pack ('H*', $id)); - if ($id == '') { - return false; - } - } - break; case 'os': @@ -888,17 +887,16 @@ function treeview_getFirstBranchSQL ($type, $id, $avariableGroupsIds, $statusSel ', $name); break; case 'tag': + $id = tags_get_id (pack ('H*', $id)); + if ($id === false) { + return false; + } $sql = "SELECT tagente.* FROM tagente, tagente_modulo, ttag_module WHERE tagente.id_agente = tagente_modulo.id_agente AND tagente_modulo.id_agente_modulo = ttag_module.id_agente_modulo AND ttag_module.id_tag = " . $id; - $id = tags_get_id (pack ('H*', $id)); - if ($id === false) { - return false; - } - break; }