From 1e47df9ab25322d1277ee4456f0b229561b419f1 Mon Sep 17 00:00:00 2001 From: mdtrooper Date: Fri, 19 Dec 2014 18:39:18 +0100 Subject: [PATCH] Starting the OS type treeview. --- pandora_console/include/ajax/tree.ajax.php | 1 + pandora_console/include/class/Tree.class.php | 3 +++ pandora_console/include/functions_os.php | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/pandora_console/include/ajax/tree.ajax.php b/pandora_console/include/ajax/tree.ajax.php index d140715e00..766fc657ab 100644 --- a/pandora_console/include/ajax/tree.ajax.php +++ b/pandora_console/include/ajax/tree.ajax.php @@ -22,6 +22,7 @@ if (is_ajax ()) { require_once($config['homedir'] . "/include/class/Tree.class.php"); require_once($config['homedir'] . "/include/functions_reporting.php"); + require_once($config['homedir'] . "/include/functions_os.php"); $getChildren = (bool)get_parameter('getChildren', 0); $getGroupStatus = (bool)get_parameter('getGroupStatus', 0); diff --git a/pandora_console/include/class/Tree.class.php b/pandora_console/include/class/Tree.class.php index bb4fe80175..59031ce99a 100644 --- a/pandora_console/include/class/Tree.class.php +++ b/pandora_console/include/class/Tree.class.php @@ -63,6 +63,9 @@ class Tree { } public function getDataOS() { + $list_os = os_get_os(); + + html_debug_print($list_os); } private function getRecursiveGroup($parent, $limit = null) { diff --git a/pandora_console/include/functions_os.php b/pandora_console/include/functions_os.php index a54848ce45..8862b87db7 100755 --- a/pandora_console/include/functions_os.php +++ b/pandora_console/include/functions_os.php @@ -66,4 +66,12 @@ function os_get_name($id_os) { return db_get_value ('name', 'tconfig_os', 'id_os', (int) $id_os); } + +function os_get_os() { + $op_systems = db_get_all_rows_in_table('tconfig_os'); + if (empty($op_systems)) + $op_systems = array(); + + return $op_systems; +} ?>