Merge branch '1210-error-in-create-networkmaps-when-autorefresh-is-enabled-dev' into 'develop'

Added code to separate networkmap manage and networkmap view

See merge request !743
This commit is contained in:
slerena 2017-08-28 13:12:47 +02:00
commit 2ce481de54
1 changed files with 53 additions and 26 deletions

View File

@ -193,7 +193,16 @@ config_check();
$select = db_process_sql("SELECT autorefresh_white_list FROM tusuario WHERE id_user = '" . $config['id_user'] . "'");
$autorefresh_list = json_decode($select[0]['autorefresh_white_list']);
if ($autorefresh_list !== null && array_search($_GET['sec2'], $autorefresh_list) !== false) {
$do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
$do_refresh = false;
}
}
if ($do_refresh) {
$autorefresh_img = html_print_image("images/header_refresh.png", true, array("class" => 'bot', "alt" => 'lightning', 'title' => __('Configure autorefresh')));
if ($_GET['refr']) {
@ -229,6 +238,16 @@ config_check();
$autorefresh_link_open_txt = '';
$autorefresh_link_close = '';
}
}
else {
$autorefresh_img = html_print_image("images/header_refresh_disabled.png", true, array("class" => 'bot autorefresh_disabled', "alt" => 'lightning', 'title' => __('Disabled autorefresh')));
$ignored_params['refr'] = false;
$autorefresh_link_open_img = '';
$autorefresh_link_open_txt = '';
$autorefresh_link_close = '';
}
$table->data[0][1] = $autorefresh_link_open_img . $autorefresh_img . $autorefresh_link_close;
$table->data[0][2] = $autorefresh_link_open_txt . $autorefresh_txt . $autorefresh_link_close . $autorefresh_additional;
@ -357,6 +376,14 @@ config_check();
$(document).ready (function () {
<?php
if (($autorefresh_list !== null) && (array_search($_GET['sec2'], $autorefresh_list) !== false) && (!isset($_GET["refr"]))) {
$do_refresh = true;
if ($_GET['sec2'] == 'operation/agentes/pandora_networkmap') {
if ((!isset($_GET['tab'])) || ($_GET['tab'] != 'view')) {
$do_refresh = false;
}
}
if ($do_refresh) {
?>
$("a.autorefresh_txt").toggle ();
$("#combo_refr").toggle ();
@ -365,9 +392,9 @@ config_check();
$(document).attr ("location", href + "30");
<?php
}
}
?>
if (fixed_header) {
$('div#head').addClass('fixed_header');
$('div#page')