';
if ($check_aw) {
- if ($agent['id_os'] == 100) {
- $cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
- echo '
'.__('Edit').'';
- echo ' | ';
+ if ($agent['id_os'] == CLUSTER_OS_ID) {
+ if (enterprise_installed()) {
+ $cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
+ $agent['id_agente']
+ );
+ $url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
+ $url .= '/operation/cluster/cluster';
+ $url = ui_get_full_url(
+ $url.'&op=update&id='.$cluster->id()
+ );
+ echo '
'.__('Edit').'';
+ }
} else {
echo '
'.__('Alerts').'';
echo ' | ';
- if ($agent['id_os'] == 100) {
- echo '
'.__('View').'';
+ if ($agent['id_os'] == CLUSTER_OS_ID) {
+ if (enterprise_installed()) {
+ $cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
+ $agent['id_agente']
+ );
+ $url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
+ $url .= '/operation/cluster/cluster';
+ $url = ui_get_full_url(
+ $url.'&op=view&id='.$cluster->id()
+ );
+ echo '
'.__('View').'';
+ }
} else {
echo '
';
- if ($agent['id_os'] != 100) {
+ if ($agent['id_os'] == CLUSTER_OS_ID) {
+ if (enterprise_installed()) {
+ $cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
+ $agent['id_agente']
+ );
+ $url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
+ $url .= '/operation/cluster/cluster';
+ $url = ui_get_full_url(
+ $url.'&op=update&id='.$cluster->id()
+ );
+ $go_to_agent .= '';
+ $go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
+ }
+ } else {
$go_to_agent .= '';
$go_to_agent .= html_print_submit_button(__('Go to agent edition'), 'upd_button', false, 'class="sub config"', true);
- } else {
- $cluster = db_get_row_sql('select id from tcluster where id_agent = '.$id_agente);
- $go_to_agent .= '';
- $go_to_agent .= html_print_submit_button(__('Edit cluster'), 'upd_button', false, 'class="sub config"', true);
}
$go_to_agent .= '';
diff --git a/pandora_console/include/lib/Agent.php b/pandora_console/include/lib/Agent.php
index b3b8c5a6cf..b599f6daed 100644
--- a/pandora_console/include/lib/Agent.php
+++ b/pandora_console/include/lib/Agent.php
@@ -88,17 +88,6 @@ class Agent extends Entity
}
- /**
- * Returns current object as array.
- *
- * @return array Of fields.
- */
- public function toArray()
- {
- return $this->fields;
- }
-
-
/**
* Overrides Entity method.
*
diff --git a/pandora_console/include/lib/Entity.php b/pandora_console/include/lib/Entity.php
index a82e47a2cd..3031a1336f 100644
--- a/pandora_console/include/lib/Entity.php
+++ b/pandora_console/include/lib/Entity.php
@@ -131,6 +131,17 @@ abstract class Entity
}
+ /**
+ * Returns current object as array.
+ *
+ * @return array Of fields.
+ */
+ public function toArray()
+ {
+ return $this->fields;
+ }
+
+
/**
* Saves current object definition to database.
*
diff --git a/pandora_console/operation/agentes/estado_agente.php b/pandora_console/operation/agentes/estado_agente.php
index ba51431416..8b974881dd 100644
--- a/pandora_console/operation/agentes/estado_agente.php
+++ b/pandora_console/operation/agentes/estado_agente.php
@@ -791,8 +791,18 @@ foreach ($agents as $agent) {
$data[0] .= '
';
- if ($agent['id_os'] == 100) {
- $data[0] .= '
'.__('View').'';
+ if ($agent['id_os'] == CLUSTER_OS_ID) {
+ if (enterprise_installed()) {
+ $cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
+ $agent['id_agente']
+ );
+ $url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
+ $url .= '/operation/cluster/cluster';
+ $url = ui_get_full_url(
+ $url.'&op=view&id='.$cluster->id()
+ );
+ echo '
'.__('View').'';
+ }
} else {
$data[0] .= '
'.__('View').'';
}
@@ -800,8 +810,18 @@ foreach ($agents as $agent) {
if (check_acl($config['id_user'], $agent['id_grupo'], 'AW')) {
$data[0] .= ' | ';
- if ($agent['id_os'] == 100) {
- $data[0] .= '
'.__('Edit').'';
+ if ($agent['id_os'] == CLUSTER_OS_ID) {
+ if (enterprise_installed()) {
+ $cluster = PandoraFMS\Enterprise\Cluster::loadFromAgentId(
+ $agent['id_agente']
+ );
+ $url = 'index.php?sec=reporting&sec2='.ENTERPRISE_DIR;
+ $url .= '/operation/cluster/cluster';
+ $url = ui_get_full_url(
+ $url.'&op=update&id='.$cluster->id()
+ );
+ echo '
'.__('Edit').'';
+ }
} else {
$data[0] .= '
'.__('Edit').'';
}
diff --git a/pandora_console/operation/agentes/estado_monitores.php b/pandora_console/operation/agentes/estado_monitores.php
index d50ed3a0fb..37b23e622c 100755
--- a/pandora_console/operation/agentes/estado_monitores.php
+++ b/pandora_console/operation/agentes/estado_monitores.php
@@ -148,8 +148,10 @@ $sort = get_parameter('sort', 'up');
$modules_not_init = agents_monitor_notinit($id_agente);
-if (!empty($modules_not_init)) {
- $help_not_init = clippy_context_help('modules_not_init');
+if (empty($modules_not_init) === false) {
+ $help_not_init = ui_print_warning_message(
+ __('No initialized modules found.')
+ );
} else {
$help_not_init = '';
}
diff --git a/pandora_console/operation/users/user_edit.php b/pandora_console/operation/users/user_edit.php
index d02b117720..50af55e637 100644
--- a/pandora_console/operation/users/user_edit.php
+++ b/pandora_console/operation/users/user_edit.php
@@ -463,7 +463,7 @@ $autorefresh_list_out['operation/snmpconsole/snmp_view'] = 'SNMP console';
$autorefresh_list_out['operation/agentes/pandora_networkmap'] = 'Network map';
$autorefresh_list_out['operation/visual_console/render_view'] = 'Visual console';
$autorefresh_list_out['operation/events/events'] = 'Events';
-$autorefresh_list_out['enterprise/godmode/reporting/cluster_view'] = 'Cluster view';
+$autorefresh_list_out['enterprise/operation/cluster/cluster'] = 'Cluster view';
if (enterprise_installed()) {
$autorefresh_list_out['general/sap_view'] = 'SAP view';
}