2011-07-19 Sergio Martin <sergio.martin@artica.es>
* include/functions_networkmap.php include/functions_visual_map.php include/functions_agents.php: Fixed more errors when no agents for bug 3371316 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@4587 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
13d4cd30b3
commit
700d6996dd
|
@ -1,3 +1,10 @@
|
|||
2011-07-19 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_networkmap.php
|
||||
include/functions_visual_map.php
|
||||
include/functions_agents.php: Fixed more errors when
|
||||
no agents for bug 3371316
|
||||
|
||||
2011-07-19 Sergio Martin <sergio.martin@artica.es>
|
||||
|
||||
* include/functions_html.php: Fixed check when no
|
||||
|
|
|
@ -910,6 +910,11 @@ function agents_get_modules ($id_agent = null, $details = false, $filter = false
|
|||
if ($id_agent === null) {
|
||||
//Extract the agents of group user.
|
||||
$groups = users_get_groups(false, 'AR', false);
|
||||
|
||||
if(empty($groups)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$id_groups = array_keys($groups);
|
||||
|
||||
$sql = "SELECT id_agente FROM tagente WHERE id_grupo IN (" . implode(',', $id_groups) . ")";
|
||||
|
@ -925,6 +930,11 @@ function agents_get_modules ($id_agent = null, $details = false, $filter = false
|
|||
$id_agent = safe_int ($id_agent, 1);
|
||||
|
||||
$userGroups = users_get_groups($config['id_user'], 'AR', false);
|
||||
|
||||
if(empty($userGroups)) {
|
||||
return array();
|
||||
}
|
||||
|
||||
$id_userGroups = array_keys($userGroups);
|
||||
|
||||
$where = " WHERE (
|
||||
|
|
|
@ -176,6 +176,9 @@ function networkmap_generate_dot_groups ($pandora_name, $group = 0, $simple = 0,
|
|||
}
|
||||
else {
|
||||
$groups = db_get_all_rows_in_table ('tgrupo');
|
||||
if($groups === false) {
|
||||
$groups = array();
|
||||
}
|
||||
}
|
||||
|
||||
// Open Graph
|
||||
|
|
|
@ -1019,14 +1019,22 @@ function visual_map_get_user_layouts ($id_user = 0, $only_names = false, $filter
|
|||
$filter = array ();
|
||||
|
||||
$where = db_format_array_where_clause_sql ($filter);
|
||||
if ($where != '') {
|
||||
$where .= ' AND ';
|
||||
}
|
||||
|
||||
if ($returnAllGroup)
|
||||
$groups = users_get_groups ($id_user);
|
||||
else
|
||||
$groups = users_get_groups ($id_user, 'IR', false);
|
||||
$where .= sprintf ('id_group IN (%s)', implode (",", array_keys ($groups)));
|
||||
|
||||
if(!empty($groups)) {
|
||||
if ($where != '') {
|
||||
$where .= ' AND ';
|
||||
}
|
||||
$where .= sprintf ('id_group IN (%s)', implode (",", array_keys ($groups)));
|
||||
}
|
||||
|
||||
if($where == '') {
|
||||
$where = array();
|
||||
}
|
||||
|
||||
$layouts = db_get_all_rows_filter ('tlayout', $where);
|
||||
|
||||
|
|
Loading…
Reference in New Issue