2013-04-17 Miguel de Dios <miguel.dedios@artica.es>

* operation/visual_console/render_view.php,
	godmode/reporting/visual_console_builder.php,
	include/functions_events.php: some fixes about PHP warnings.
	
	Fixes: #3611022




git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@8009 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
mdtrooper 2013-04-18 09:25:23 +00:00
parent aebb74d46c
commit c6bacd7403
5 changed files with 169 additions and 117 deletions

View File

@ -1,3 +1,11 @@
2013-04-17 Miguel de Dios <miguel.dedios@artica.es>
* operation/visual_console/render_view.php,
godmode/reporting/visual_console_builder.php,
include/functions_events.php: some fixes about PHP warnings.
Fixes: #3611022
2013-04-17 Miguel de Dios <miguel.dedios@artica.es> 2013-04-17 Miguel de Dios <miguel.dedios@artica.es>
* include/ajax/module.php: fixed the PHP warnings. * include/ajax/module.php: fixed the PHP warnings.

View File

@ -37,6 +37,8 @@ else {
$idVisualConsole = get_parameter('id_visual_console', 0); $idVisualConsole = get_parameter('id_visual_console', 0);
} }
$id_layout = 0;
if (!defined('METACONSOLE')) { if (!defined('METACONSOLE')) {
$action = get_parameterBetweenListValues('action', array('new', 'save', 'edit', 'update', 'delete'), 'new'); $action = get_parameterBetweenListValues('action', array('new', 'save', 'edit', 'update', 'delete'), 'new');
} }
@ -46,6 +48,7 @@ else {
$activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'editor'), 'data'); $activeTab = get_parameterBetweenListValues('tab', array('data', 'list_elements', 'wizard', 'editor'), 'data');
$refr = (int) get_parameter ('refr', $config['vc_refr']);
//Save/Update data in DB //Save/Update data in DB
$statusProcessInDB = null; $statusProcessInDB = null;
@ -402,8 +405,8 @@ else {
} }
// Hash for auto-auth in public link // Hash for auto-auth in public link
$hash = md5($config["dbpass"]. $id_layout. $config["id_user"]); $hash = md5($config["dbpass"] . $id_layout . $config["id_user"]);
$buttons = array( $buttons = array(
'consoles_list' => array('active' => false, 'consoles_list' => array('active' => false,
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' . 'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' .

View File

@ -1229,10 +1229,10 @@ function return_graphtype ($id_module_type) {
case 24: case 24:
return "log4x"; return "log4x";
break; break;
default:
return "sparse";
break;
} }
return "sparse";
} }
/** /**

View File

@ -401,7 +401,7 @@ function events_validate_event ($id_event, $similars = true, $new_status = 1, $m
* @param bool history mode flag * @param bool history mode flag
* *
* @return bool Whether or not it was successful * @return bool Whether or not it was successful
*/ */
function events_change_status ($id_event, $new_status, $meta = false, $history = false) { function events_change_status ($id_event, $new_status, $meta = false, $history = false) {
global $config; global $config;
@ -467,7 +467,7 @@ function events_change_status ($id_event, $new_status, $meta = false, $history =
'estado' => $new_status, 'estado' => $new_status,
'id_usuario' => $ack_user, 'id_usuario' => $ack_user,
'ack_utimestamp' => $ack_utimestamp); 'ack_utimestamp' => $ack_utimestamp);
$ret = db_process_sql_update($event_table, $values, $ret = db_process_sql_update($event_table, $values,
array('id_evento' => $id_event)); array('id_evento' => $id_event));
@ -730,7 +730,7 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, $id_use
$priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags); $priority, $id_agent_module, $id_aam, $critical_instructions, $warning_instructions, $unknown_instructions, $source, $tags);
break; break;
} }
return (int) db_process_sql ($sql, "insert_id"); return (int) db_process_sql ($sql, "insert_id");
} }
@ -749,14 +749,14 @@ function events_create_event ($event, $id_group, $id_agent, $status = 0, $id_use
function events_print_event_table ($filter = "", $limit = 10, $width = 440, $return = false, $agent_id = 0) { function events_print_event_table ($filter = "", $limit = 10, $width = 440, $return = false, $agent_id = 0) {
global $config; global $config;
if($agent_id == 0) { if ($agent_id == 0) {
$agent_condition = ''; $agent_condition = '';
} }
else { else {
$agent_condition = "id_agente = $agent_id AND"; $agent_condition = "id_agente = $agent_id AND";
} }
if($filter == '') { if ($filter == '') {
$filter = '1 = 1'; $filter = '1 = 1';
} }
@ -769,9 +769,9 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
$sql = sprintf ("SELECT * FROM tevento WHERE %s %s AND rownum <= %d ORDER BY timestamp DESC", $agent_condition, $filter, $limit); $sql = sprintf ("SELECT * FROM tevento WHERE %s %s AND rownum <= %d ORDER BY timestamp DESC", $agent_condition, $filter, $limit);
break; break;
} }
$result = db_get_all_rows_sql ($sql); $result = db_get_all_rows_sql ($sql);
if ($result === false) { if ($result === false) {
echo '<div class="nf">'.__('No events').'</div>'; echo '<div class="nf">'.__('No events').'</div>';
} }
@ -817,7 +817,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
if (! check_acl ($config["id_user"], $event["id_grupo"], "ER")) { if (! check_acl ($config["id_user"], $event["id_grupo"], "ER")) {
continue; continue;
} }
$data = array (); $data = array ();
// Colored box // Colored box
@ -844,19 +844,19 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
switch ($event["criticity"]) { switch ($event["criticity"]) {
default: default:
case 0: case EVENT_CRIT_MAINTENANCE:
$img = "images/status_sets/default/severity_maintenance.png"; $img = "images/status_sets/default/severity_maintenance.png";
break; break;
case 1: case EVENT_CRIT_INFORMATIONAL:
$img = "images/status_sets/default/severity_informational.png"; $img = "images/status_sets/default/severity_informational.png";
break; break;
case 2: case EVENT_CRIT_NORMAL:
$img = "images/status_sets/default/severity_normal.png"; $img = "images/status_sets/default/severity_normal.png";
break; break;
case 3: case EVENT_CRIT_WARNING:
$img = "images/status_sets/default/severity_warning.png"; $img = "images/status_sets/default/severity_warning.png";
break; break;
case 4: case EVENT_CRIT_CRITICAL:
$img = "images/status_sets/default/severity_critical.png"; $img = "images/status_sets/default/severity_critical.png";
break; break;
} }
@ -906,7 +906,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
$out = '<table width="98%"><tr><td style="width: 90%; padding-right: 10px; vertical-align: top; padding-top: 0px;">'; $out = '<table width="98%"><tr><td style="width: 90%; padding-right: 10px; vertical-align: top; padding-top: 0px;">';
$out .= $events_table; $out .= $events_table;
if($agent_id != 0) { if ($agent_id != 0) {
$out .= '</td><td style="width: 200px; vertical-align: top;">'; $out .= '</td><td style="width: 200px; vertical-align: top;">';
$out .= '<table cellpadding=0 cellspacing=0 class="databox"><tr><td>'; $out .= '<table cellpadding=0 cellspacing=0 class="databox"><tr><td>';
$out .= '<fieldset class="databox tactical_set" style="width:93%;"> $out .= '<fieldset class="databox tactical_set" style="width:93%;">
@ -936,7 +936,7 @@ function events_print_event_table ($filter = "", $limit = 10, $width = 440, $ret
unset ($table); unset ($table);
if($return) { if ($return) {
return $out; return $out;
} }
else { else {
@ -1184,12 +1184,12 @@ function events_get_group_events_steps ($begin, &$result, $id_group, $period, $d
$sql = sprintf ('SELECT *, $sql = sprintf ('SELECT *,
(SELECT t2.nombre (SELECT t2.nombre
FROM tagente AS t2 FROM tagente AS t2
WHERE t2.id_agente = t3.id_agente) AS agent_name, WHERE t2.id_agente = t3.id_agente) AS agent_name,
(SELECT t2.fullname (SELECT t2.fullname
FROM tusuario AS t2 FROM tusuario AS t2
WHERE t2.id_user = t3.id_usuario) AS user_name WHERE t2.id_user = t3.id_usuario) AS user_name
FROM tevento AS t3 FROM tevento AS t3
WHERE utimestamp > %d AND utimestamp <= %d WHERE utimestamp > %d AND utimestamp <= %d
AND id_grupo IN (%s) ' . $sql_where . ' AND id_grupo IN (%s) ' . $sql_where . '
@ -1298,44 +1298,57 @@ function events_get_module ($id_agent_module, $period, $date = 0) {
function events_get_event_types ($type_id){ function events_get_event_types ($type_id){
$diferent_types = get_event_types (); $diferent_types = get_event_types ();
$type_desc = ''; $type_desc = '';
switch($type_id) { switch($type_id) {
case 'unknown': $type_desc = __('Unknown'); case 'unknown':
break; $type_desc = __('Unknown');
case 'critical': $type_desc = __('Monitor Critical'); break;
break; case 'critical':
case 'warning': $type_desc = __('Monitor Warning'); $type_desc = __('Monitor Critical');
break; break;
case 'normal': $type_desc = __('Monitor Normal'); case 'warning':
break; $type_desc = __('Monitor Warning');
case 'alert_fired': $type_desc = __('Alert fired'); break;
break; case 'normal':
case 'alert_recovered': $type_desc = __('Alert recovered'); $type_desc = __('Monitor Normal');
break; break;
case 'alert_ceased': $type_desc = __('Alert ceased'); case 'alert_fired':
break; $type_desc = __('Alert fired');
case 'alert_manual_validation': $type_desc = __('Alert manual validation'); break;
break; case 'alert_recovered':
case 'recon_host_detected': $type_desc = __('Recon host detected'); $type_desc = __('Alert recovered');
break; break;
case 'system': $type_desc = __('System'); case 'alert_ceased':
break; $type_desc = __('Alert ceased');
case 'error': $type_desc = __('Error'); break;
break; case 'alert_manual_validation':
case 'configuration_change': $type_desc = __('Configuration change'); $type_desc = __('Alert manual validation');
break; break;
case 'not_normal': $type_desc = __('Not normal'); case 'recon_host_detected':
break; $type_desc = __('Recon host detected');
break;
case 'system':
$type_desc = __('System');
break;
case 'error':
$type_desc = __('Error');
break;
case 'configuration_change':
$type_desc = __('Configuration change');
break;
case 'not_normal':
$type_desc = __('Not normal');
break;
default: default:
if (isset($config['text_char_long'])) { if (isset($config['text_char_long'])) {
foreach ($diferent_types as $key => $type) { foreach ($diferent_types as $key => $type) {
if ($key == $type_id){ if ($key == $type_id){
$type_desc = ui_print_truncate_text($type, $config['text_char_long'], false, true, false); $type_desc = ui_print_truncate_text($type, $config['text_char_long'], false, true, false);
}
} }
} }
break; }
break;
} }
return $type_desc; return $type_desc;
@ -1355,30 +1368,30 @@ function events_get_severity_types ($severity_id){
$severity_desc = ''; $severity_desc = '';
switch ($severity_id) { switch ($severity_id) {
case 0: case EVENT_CRIT_MAINTENANCE:
$severity_desc = __('Maintenance'); $severity_desc = __('Maintenance');
break; break;
case 1: case EVENT_CRIT_INFORMATIONAL:
$severity_desc = __('Informational'); $severity_desc = __('Informational');
break; break;
case 2: case EVENT_CRIT_NORMAL:
$severity_desc = __('Normal'); $severity_desc = __('Normal');
break; break;
case 3: case EVENT_CRIT_WARNING:
$severity_desc = __('Warning'); $severity_desc = __('Warning');
break; break;
case 4: case EVENT_CRIT_CRITICAL:
$severity_desc = __('Critical'); $severity_desc = __('Critical');
break; break;
default: default:
if (isset($config['text_char_long'])) { if (isset($config['text_char_long'])) {
foreach ($diferent_types as $key => $type) { foreach ($diferent_types as $key => $type) {
if ($key == $severity_id){ if ($key == $severity_id){
$severity_desc = ui_print_truncate_text($type, $config['text_char_long'], false, true, false); $severity_desc = ui_print_truncate_text($type, $config['text_char_long'], false, true, false);
}
} }
} }
break; }
break;
} }
return $severity_desc; return $severity_desc;
@ -1389,7 +1402,7 @@ function events_get_severity_types ($severity_id){
* *
* @return array Status description array. * @return array Status description array.
*/ */
function events_get_all_status (){ function events_get_all_status () {
$fields = array (); $fields = array ();
$fields[-1] = __('All event'); $fields[-1] = __('All event');
$fields[0] = __('Only new'); $fields[0] = __('Only new');
@ -1446,7 +1459,7 @@ function events_check_event_filter_group ($id_filter) {
$groups_id = array(); $groups_id = array();
$has_permission = false; $has_permission = false;
foreach($groups_user as $key => $groups){ foreach ($groups_user as $key => $groups) {
if ($groups['id_grupo'] == $id_group) if ($groups['id_grupo'] == $id_group)
return true; return true;
} }
@ -1460,7 +1473,9 @@ function events_check_event_filter_group ($id_filter) {
* @return array * @return array
*/ */
function events_get_macros() { function events_get_macros() {
return array('_agent_address_' => __('Agent address'), '_agent_id_' => __('Agent id'), '_event_id_' => __('Event id')); return array('_agent_address_' => __('Agent address'),
'_agent_id_' => __('Agent id'),
'_event_id_' => __('Event id'));
} }
/** /**
@ -1473,17 +1488,17 @@ function events_get_macros() {
* @return array A event filter matching id and filter or false. * @return array A event filter matching id and filter or false.
*/ */
function events_get_event_filter ($id_filter, $filter = false, $fields = false) { function events_get_event_filter ($id_filter, $filter = false, $fields = false) {
if (empty($id_filter)){
return false;
}
if (! is_array ($filter)){
$filter = array ();
$filter['id_filter'] = (int) $id_filter;
}
return db_get_row_filter ('tevent_filter', $filter, $fields); if (empty($id_filter)) {
return false;
}
if (! is_array ($filter)) {
$filter = array ();
$filter['id_filter'] = (int) $id_filter;
}
return db_get_row_filter ('tevent_filter', $filter, $fields);
} }
/** /**
@ -1502,10 +1517,10 @@ function events_get_event_filter_select(){
$event_filters = db_get_all_rows_sql($sql); $event_filters = db_get_all_rows_sql($sql);
if ($event_filters === false){ if ($event_filters === false) {
return array(); return array();
} }
else{ else {
$result = array(); $result = array();
foreach ($event_filters as $event_filter){ foreach ($event_filters as $event_filter){
$result[$event_filter['id_filter']] = $event_filter['id_name']; $result[$event_filter['id_filter']] = $event_filter['id_name'];
@ -1532,7 +1547,7 @@ function events_page_responses ($event) {
$table_responses->style[0] = 'width:35%; font-weight: bold; text-align: left;'; $table_responses->style[0] = 'width:35%; font-weight: bold; text-align: left;';
$table_responses->style[1] = 'text-align: left;'; $table_responses->style[1] = 'text-align: left;';
$table_responses->class = "databox alternate"; $table_responses->class = "databox alternate";
if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'])) { if (tags_check_acl ($config["id_user"], $event["id_grupo"], "EM", $event['clean_tags'])) {
// Owner // Owner
$data = array(); $data = array();
@ -1893,24 +1908,32 @@ function events_page_details ($event, $server = "") {
$data = array(); $data = array();
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Graph').'</div>'; $data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Graph').'</div>';
$graph_type = return_graphtype ($module["module_type"]); $module_module_type = -1;
if (isset($module["module_type"])) {
$module_module_type = $module["module_type"];
}
$graph_type = return_graphtype ($module_module_type);
$win_handle=dechex(crc32($module["id_agente_modulo"].$module["module_name"])); $win_handle=dechex(crc32($module["id_agente_modulo"].$module["module_name"]));
$link ="winopeng('".$serverstring."operation/agentes/stat_win.php?type=".$graph_type."&period=86400&id=" . $module["id_agente_modulo"] . "&label=" . base64_encode($module["module_name"].$hashstring) . "&refresh=600','day_".$win_handle."')"; $module_module_name = '';
if (isset($module["module_name"])) {
$module_module_name = $module["module_name"];
}
$link ="winopeng('" . $serverstring . "operation/agentes/stat_win.php?type=" . $graph_type."&period=86400&id=" . $module["id_agente_modulo"] . "&label=" . base64_encode($module_module_name . $hashstring) . "&refresh=600','day_".$win_handle."')";
$data[1] = '<a href="javascript:'.$link.'">'; $data[1] = '<a href="javascript:'.$link.'">';
$data[1] .= html_print_image('images/chart_curve.png',true); $data[1] .= html_print_image('images/chart_curve.png',true);
$data[1] .= '</a>'; $data[1] .= '</a>';
$table_details->data[] = $data; $table_details->data[] = $data;
} }
$data = array(); $data = array();
$data[0] = __('Alert details'); $data[0] = __('Alert details');
$data[1] = $event["id_alert_am"] == 0 ? '<i>' . __('N/A') . '</i>' : ''; $data[1] = $event["id_alert_am"] == 0 ? '<i>' . __('N/A') . '</i>' : '';
$table_details->data[] = $data; $table_details->data[] = $data;
if($event["id_alert_am"] != 0) { if ($event["id_alert_am"] != 0) {
$data = array(); $data = array();
$data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Source').'</div>'; $data[0] = '<div style="font-weight:normal; margin-left: 20px;">'.__('Source').'</div>';
$data[1] = '<a href="'.$serverstring.'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=alert'.$hashstring.'">'; $data[1] = '<a href="'.$serverstring.'index.php?sec=estado&amp;sec2=operation/agentes/ver_agente&amp;id_agente='.$event["id_agente"].'&amp;tab=alert'.$hashstring.'">';
@ -1934,8 +1957,8 @@ function events_page_details ($event, $server = "") {
$data[1] .= $templateName; $data[1] .= $templateName;
$data[1] .= '</a>'; $data[1] .= '</a>';
$table_details->data[] = $data; $table_details->data[] = $data;
$data = array(); $data = array();
@ -1990,7 +2013,7 @@ function events_page_details ($event, $server = "") {
$table_details->data[] = $data; $table_details->data[] = $data;
break; break;
} }
$data = array(); $data = array();
$data[0] = __('Extra id'); $data[0] = __('Extra id');
if ($event["id_extra"] != '') { if ($event["id_extra"] != '') {
@ -2012,7 +2035,7 @@ function events_page_details ($event, $server = "") {
$table_details->data[] = $data; $table_details->data[] = $data;
$details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>'; $details = '<div id="extended_event_details_page" class="extended_event_pages">'.html_print_table($table_details, true).'</div>';
return $details; return $details;
} }
@ -2022,10 +2045,10 @@ function events_page_general ($event) {
//$group_rep = $event['similar_ids'] == -1 ? 1 : count(explode(',',$event['similar_ids'])); //$group_rep = $event['similar_ids'] == -1 ? 1 : count(explode(',',$event['similar_ids']));
global $group_rep; global $group_rep;
///////// ////////////////////////////////////////////////////////////////////
// General // General
///////// ////////////////////////////////////////////////////////////////////
$table_general->width = '100%'; $table_general->width = '100%';
$table_general->data = array (); $table_general->data = array ();
@ -2056,7 +2079,7 @@ function events_page_general ($event) {
$data = array(); $data = array();
$data[0] = __('Owner'); $data[0] = __('Owner');
if(empty($event["owner_user"])) { if (empty($event["owner_user"])) {
$data[1] = '<i>'.__('N/A').'</i>'; $data[1] = '<i>'.__('N/A').'</i>';
} }
else { else {
@ -2124,8 +2147,8 @@ function events_page_general ($event) {
// If event is validated, show who and when acknowleded it // If event is validated, show who and when acknowleded it
$data = array(); $data = array();
$data[0] = __('Acknowledged by'); $data[0] = __('Acknowledged by');
if($event['estado'] == 1) { if ($event['estado'] == 1) {
$user_ack = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']); $user_ack = db_get_value('fullname', 'tusuario', 'id_user', $event['id_usuario']);
if(empty($user_ack)) { if(empty($user_ack)) {
$user_ack = $event['id_usuario']; $user_ack = $event['id_usuario'];
@ -2149,7 +2172,7 @@ function events_page_general ($event) {
if ($event["tags"] != '') { if ($event["tags"] != '') {
$tags = tags_get_tags_formatted($event["tags"]); $tags = tags_get_tags_formatted($event["tags"]);
$data[1] = $tags; $data[1] = $tags;
} }
else { else {
@ -2163,9 +2186,9 @@ function events_page_general ($event) {
} }
function events_page_comments ($event) { function events_page_comments ($event) {
///////// ////////////////////////////////////////////////////////////////////
// Comments // Comments
///////// ////////////////////////////////////////////////////////////////////
global $config; global $config;
$table_comments->width = '100%'; $table_comments->width = '100%';
@ -2173,7 +2196,7 @@ function events_page_comments ($event) {
$table_comments->head = array (); $table_comments->head = array ();
$table_comments->style[0] = 'width:35%; vertical-align: top; text-align: left;'; $table_comments->style[0] = 'width:35%; vertical-align: top; text-align: left;';
$table_comments->style[1] = 'text-align: left;'; $table_comments->style[1] = 'text-align: left;';
$table_comments->class = "databox alternate"; $table_comments->class = "databox alternate";
$comments_array = explode('<br>',io_safe_output($event["user_comment"])); $comments_array = explode('<br>',io_safe_output($event["user_comment"]));

View File

@ -25,9 +25,27 @@ if (!defined('METACONSOLE'))
else else
$id_layout = (int) get_parameter ('id_visualmap'); $id_layout = (int) get_parameter ('id_visualmap');
if (!defined('METACONSOLE')) {
if ($id_layout) {
$default_action = 'edit';
}
else {
$default_action = 'new';
}
$action = get_parameterBetweenListValues('action', array('new', 'save', 'edit', 'update', 'delete'), $default_action);
}
else {
$action = get_parameterBetweenListValues('action2', array('new', 'save', 'edit', 'update', 'delete'), $default_action);
}
$refr = (int) get_parameter ('refr', $config['vc_refr']); $refr = (int) get_parameter ('refr', $config['vc_refr']);
$vc_refr = false; $vc_refr = false;
if (isset($config['vc_refr']) and $config['vc_refr'] != 0)
$view_refresh = $config['vc_refr'];
else
$view_refresh = '60';
// Get input parameter for layout id // Get input parameter for layout id
if (! $id_layout) { if (! $id_layout) {
db_pandora_audit("ACL Violation","Trying to access visual console without id layout"); db_pandora_audit("ACL Violation","Trying to access visual console without id layout");
@ -50,7 +68,7 @@ $background = $layout["background"];
$bwidth = $layout["width"]; $bwidth = $layout["width"];
$bheight = $layout["height"]; $bheight = $layout["height"];
$pure_url = "&pure=".$config["pure"]; $pure_url = "&pure=" . $config["pure"];
if (! check_acl ($config["id_user"], $id_group, "RR")) { if (! check_acl ($config["id_user"], $id_group, "RR")) {
db_pandora_audit("ACL Violation", "Trying to access visual console without group access"); db_pandora_audit("ACL Violation", "Trying to access visual console without group access");
@ -62,25 +80,25 @@ if (! check_acl ($config["id_user"], $id_group, "RR")) {
$options = array(); $options = array();
$options['consoles_list']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' . $options['consoles_list']['text'] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/map_builder&refr=' . $refr . '">' .
html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .'</a>'; html_print_image ("images/visual_console.png", true, array ("title" => __('Visual consoles list'))) .'</a>';
if (check_acl ($config["id_user"], $id_group, "RW")) { if (check_acl ($config["id_user"], $id_group, "RW")) {
$url_base = 'index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&action='; $url_base = 'index.php?sec=reporting&sec2=godmode/reporting/visual_console_builder&action=';
$hash = md5($config["dbpass"]. $id_layout. $config["id_user"]); $hash = md5($config["dbpass"]. $id_layout. $config["id_user"]);
$options['public_link']['text'] = '<a href="' . ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"]) . '" target="_blank">'. $options['public_link']['text'] = '<a href="' . ui_get_full_url('operation/visual_console/public_console.php?hash='.$hash.'&id_layout='.$id_layout.'&id_user='.$config["id_user"]) . '" target="_blank">'.
html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>'; html_print_image ("images/camera_mc.png", true, array ("title" => __('Show link to public Visual Console'))).'</a>';
$options['public_link']['active'] = false; $options['public_link']['active'] = false;
$options['data']['text'] = '<a href="' . $url_base . $action . '&tab=data&id_visual_console=' . $id_layout . '">' . $options['data']['text'] = '<a href="' . $url_base . $action . '&tab=data&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>'; html_print_image ("images/op_reporting.png", true, array ("title" => __('Main data'))) .'</a>';
$options['list_elements']['text'] = '<a href="' . $url_base . $action . '&tab=list_elements&id_visual_console=' . $id_layout . '">' . $options['list_elements']['text'] = '<a href="' . $url_base . $action . '&tab=list_elements&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .'</a>'; html_print_image ("images/list.png", true, array ("title" => __('List elements'))) .'</a>';
$options['wizard']['text'] = '<a href="' . $url_base . $action . '&tab=wizard&id_visual_console=' . $id_layout . '">' . $options['wizard']['text'] = '<a href="' . $url_base . $action . '&tab=wizard&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .'</a>'; html_print_image ("images/wand.png", true, array ("title" => __('Wizard'))) .'</a>';
$options['editor']['text'] = '<a href="' . $url_base . $action . '&tab=editor&id_visual_console=' . $id_layout . '">' . $options['editor']['text'] = '<a href="' . $url_base . $action . '&tab=editor&id_visual_console=' . $id_layout . '">' .
html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .'</a>'; html_print_image ("images/builder.png", true, array ("title" => __('Builder'))) .'</a>';
} }
$options['view']['text'] = '<a href="index.php?sec=reporting&sec2=operation/visual_console/render_view&id=' . $id_layout . '&refr=' . $view_refresh . '">' . html_print_image ("images/operation.png", true, array ("title" => __('View'))) .'</a>'; $options['view']['text'] = '<a href="index.php?sec=reporting&sec2=operation/visual_console/render_view&id=' . $id_layout . '&refr=' . $view_refresh . '">' . html_print_image ("images/operation.png", true, array ("title" => __('View'))) .'</a>';
@ -95,7 +113,7 @@ if (!defined('METACONSOLE')) {
$options['pure']['text'] = '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;id='.$id_layout.'&amp;refr='.$config["refr"].'">' $options['pure']['text'] = '<a href="index.php?sec=reporting&amp;sec2=operation/visual_console/render_view&amp;id='.$id_layout.'&amp;refr='.$config["refr"].'">'
. html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode'))) . html_print_image ("images/normal_screen.png", true, array ("title" => __('Back to normal mode')))
. "</a>"; . "</a>";
// In full screen, the manage options are not available // In full screen, the manage options are not available
$options = array('view' => $options['view'], 'pure' => $options['pure']); $options = array('view' => $options['view'], 'pure' => $options['pure']);
} }