Merge branch 'ent-4509-AADCM-MCM-8206-Bug-en-consola-visual-link-a-consola-visual-publica' into 'develop'

Fixed bug in public visual console view

See merge request artica/pandorafms!2672
This commit is contained in:
Alejandro Fraguas 2019-08-26 13:12:31 +02:00
commit fadccf0ff3
3 changed files with 18 additions and 18 deletions

View File

@ -2684,7 +2684,7 @@ function can_user_access_node()
$userinfo = get_user_info($config['id_user']);
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
return $userinfo['is_admin'] == 1 ? 1 : $userinfo['metaconsole_access_node'];
} else {
return 1;

View File

@ -1794,7 +1794,7 @@ function ui_process_page_head($string, $bitfield)
array_push($loaded, $name);
$url_css = ui_get_full_url($filename);
$url_css = ui_get_full_url($filename, false, false, false);
$output .= '<link rel="stylesheet" href="'.$url_css.'" type="text/css" />'."\n\t";
}
@ -1851,7 +1851,7 @@ function ui_process_page_head($string, $bitfield)
array_push($loaded, $name);
$url_js = ui_get_full_url($filename);
$url_js = ui_get_full_url($filename, false, false, false);
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
}
@ -1892,7 +1892,7 @@ function ui_process_page_head($string, $bitfield)
array_push($loaded, $name);
$url_js = ui_get_full_url($filename);
$url_js = ui_get_full_url($filename, false, false, false);
$output .= '<script type="text/javascript" src="'.$url_js.'"></script>'."\n\t";
}
@ -2841,7 +2841,7 @@ function ui_progress(
width_interval = '.$ajax['interval'].';
if (last % 10 == 0) {
$.post({
url: "'.ui_get_full_url('ajax.php').'",
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
data: {';
if (is_array($ajax['data'])) {
foreach ($ajax['data'] as $token => $value) {
@ -3216,7 +3216,7 @@ function ui_print_datatable(array $parameters)
],
lengthMenu: '.json_encode($pagination_options).',
ajax: {
url: "'.ui_get_full_url('ajax.php').'",
url: "'.ui_get_full_url('ajax.php', false, false, false).'",
type: "POST",
dataSrc: function (json) {
if (json.error) {
@ -3692,7 +3692,7 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true)
$url = htmlspecialchars($url);
if (! $relative) {
return ui_get_full_url($url);
return ui_get_full_url($url, false, false, false);
}
return $url;
@ -4455,7 +4455,7 @@ function ui_print_agent_autocomplete_input($parameters)
// Javascript configurations
// ------------------------------------------------------------------.
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false, false);
$javascript_ajax_page = ui_get_full_url('ajax.php', false, false, false);
// Default value.
if (isset($parameters['javascript_ajax_page'])) {
$javascript_ajax_page = $parameters['javascript_ajax_page'];

View File

@ -3278,7 +3278,12 @@ function visual_map_get_color_line_status($layoutData)
*/
function visual_map_get_image_status_element($layoutData, $status=false)
{
$img = 'images/console/icons/'.$layoutData['image'];
$metaconsole_hack = '';
if (is_metaconsole()) {
$metaconsole_hack = '../../';
}
$img = $metaconsole_hack.'images/console/icons/'.$layoutData['image'];
if ($layoutData['type'] == 5) {
// ICON ELEMENT
@ -3611,11 +3616,6 @@ function visual_map_print_visual_map(
global $config;
$metaconsole_hack = '/';
if (defined('METACONSOLE')) {
$metaconsole_hack = '../../';
}
enterprise_include_once('meta/include/functions_ui_meta.php');
include_once $config['homedir'].'/include/functions_custom_graphs.php';
@ -3681,11 +3681,11 @@ function visual_map_print_visual_map(
$mapHeight = $layout['height'];
$backgroundImage = '';
if ($layout['background'] != 'None.png') {
$backgroundImage = $metaconsole_hack.'images/console/background/'.$layout['background'];
$backgroundImage = 'images/console/background/'.$layout['background'];
}
}
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
echo "<div style='width: 100%; overflow:auto; margin: 0 auto; padding:5px;'>";
}
@ -3698,7 +3698,7 @@ function visual_map_print_visual_map(
background-color:'.$layout['background_color'].';">';
if ($layout['background'] != 'None.png') {
echo "<img src='".ui_get_full_url($backgroundImage)."' width='100%' height='100%' />";
echo "<img src='".ui_get_full_url($backgroundImage, false, false, false)."' width='100%' height='100%' />";
}
$layout_datas = db_get_all_rows_field_filter(
@ -3776,7 +3776,7 @@ function visual_map_print_visual_map(
// End main div
echo '</div></div>';
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
echo '</div>';
}
}