Merge branch 'ent-2999-6711-estan-apareciendo-modulos-deshabilitados-en-v728-dentro-de-la-vista-de-modulos-de-un-agente' into 'develop'
Fixed disabled modules on agent view See merge request artica/pandorafms!1921
This commit is contained in:
commit
49f1e79c22
|
@ -539,14 +539,6 @@ if ($list_modules) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($config["dbtype"]) {
|
|
||||||
case "oracle":
|
|
||||||
if (isset($order['field']) && $order['field'] == 'tagente_modulo.nombre') {
|
|
||||||
$order['field'] = 'dbms_lob.substr(tagente_modulo.nombre,4000,1)';
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
|
// Fix: for tag functionality groups have to be all user_groups (propagate ACL funct!)
|
||||||
$groups = users_get_groups($config["id_user"], $access);
|
$groups = users_get_groups($config["id_user"], $access);
|
||||||
|
|
||||||
|
@ -599,8 +591,7 @@ if ($list_modules) {
|
||||||
|
|
||||||
//Count monitors/modules
|
//Count monitors/modules
|
||||||
$order_sql = $order['field'] . " " . $order['order'];
|
$order_sql = $order['field'] . " " . $order['order'];
|
||||||
$sql = "SELECT COUNT(*)
|
$sql_condition = "FROM tagente_modulo
|
||||||
FROM tagente_modulo
|
|
||||||
$tags_join
|
$tags_join
|
||||||
INNER JOIN tagente_estado
|
INNER JOIN tagente_estado
|
||||||
ON tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
ON tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
||||||
|
@ -609,13 +600,14 @@ if ($list_modules) {
|
||||||
WHERE tagente_modulo.id_agente = $id_agente
|
WHERE tagente_modulo.id_agente = $id_agente
|
||||||
AND nombre LIKE '$status_text_monitor_sql'
|
AND nombre LIKE '$status_text_monitor_sql'
|
||||||
AND delete_pending = 0
|
AND delete_pending = 0
|
||||||
|
AND disabled = 0
|
||||||
AND $status_filter_sql
|
AND $status_filter_sql
|
||||||
$tags_sql
|
$tags_sql
|
||||||
AND tagente_estado.estado != $monitor_filter
|
AND tagente_estado.estado != $monitor_filter
|
||||||
GROUP BY tagente_modulo.id_agente_modulo
|
GROUP BY tagente_modulo.id_agente_modulo
|
||||||
";
|
";
|
||||||
|
|
||||||
$count_modules = db_get_all_rows_sql($sql);
|
$count_modules = db_get_all_rows_sql('SELECT COUNT(*)' . $sql_condition);
|
||||||
if (isset($count_modules[0]))
|
if (isset($count_modules[0]))
|
||||||
$count_modules = reset($count_modules[0]);
|
$count_modules = reset($count_modules[0]);
|
||||||
else
|
else
|
||||||
|
@ -623,22 +615,7 @@ if ($list_modules) {
|
||||||
|
|
||||||
//Get monitors/modules
|
//Get monitors/modules
|
||||||
// Get all module from agent
|
// Get all module from agent
|
||||||
$sql = "SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.*
|
$sql_modules_info = 'SELECT tagente_estado.*, tagente_modulo.*, tmodule_group.*' . $sql_condition;
|
||||||
FROM tagente_modulo
|
|
||||||
$tags_join
|
|
||||||
INNER JOIN tagente_estado
|
|
||||||
ON tagente_modulo.id_agente_modulo = tagente_estado.id_agente_modulo
|
|
||||||
LEFT JOIN tmodule_group
|
|
||||||
ON tagente_modulo.id_module_group = tmodule_group.id_mg
|
|
||||||
WHERE tagente_modulo.id_agente = $id_agente
|
|
||||||
AND nombre LIKE '$status_text_monitor_sql'
|
|
||||||
AND delete_pending = 0
|
|
||||||
AND $status_filter_sql
|
|
||||||
$tags_sql
|
|
||||||
AND tagente_estado.estado != $monitor_filter
|
|
||||||
GROUP BY tagente_modulo.id_agente_modulo
|
|
||||||
ORDER BY tmodule_group.name, $order_sql
|
|
||||||
";
|
|
||||||
|
|
||||||
if ($monitors_change_filter) {
|
if ($monitors_change_filter) {
|
||||||
$limit = " LIMIT " . $config['block_size'] . " OFFSET 0";
|
$limit = " LIMIT " . $config['block_size'] . " OFFSET 0";
|
||||||
|
@ -651,10 +628,10 @@ if ($list_modules) {
|
||||||
$paginate_module = $config['paginate_module'];
|
$paginate_module = $config['paginate_module'];
|
||||||
|
|
||||||
if ($paginate_module) {
|
if ($paginate_module) {
|
||||||
$modules = db_get_all_rows_sql ($sql . $limit);
|
$modules = db_get_all_rows_sql ($sql_modules_info . $limit);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$modules = db_get_all_rows_sql ($sql);
|
$modules = db_get_all_rows_sql ($sql_modules_info);
|
||||||
}
|
}
|
||||||
if (empty ($modules)) {
|
if (empty ($modules)) {
|
||||||
$modules = array ();
|
$modules = array ();
|
||||||
|
|
Loading…
Reference in New Issue