Fix not init counters final - #1454

This commit is contained in:
enriquecd 2018-04-05 16:11:24 +02:00
parent 87ed7f9cf7
commit fa82f45d7d

View File

@ -1174,6 +1174,23 @@ class Tree {
$data = db_process_sql($sql); $data = db_process_sql($sql);
if (empty($data)) if (empty($data))
return array(); return array();
foreach ($data[0] as $key => $value) {
if($key != 'total_count' && strpos($key, 'count')){
$zero_counter += $value;
}
}
if(!$zero_counter){
$data[0]['total_count'] = 0;
}
else{
$data[0]['total_count'] = $zero_counter;
}
// [26/10/2017] It seems the module hierarchy should be only available into the tree by group // [26/10/2017] It seems the module hierarchy should be only available into the tree by group
if ($this->rootType == 'group' && $this->type == 'agent') { if ($this->rootType == 'group' && $this->type == 'agent') {
@ -2312,6 +2329,16 @@ class Tree {
} }
if(!$this->filter['show_not_init_agents']){
foreach ($items as $key => $value) {
if($items[$key]['total_count'] == $items[$key]['notinit_count']){
unset($items[$key]);
}
}
}
$this->processAgents($items); $this->processAgents($items);
$processed_items = $items; $processed_items = $items;
} }