Adapted views

This commit is contained in:
jose.gonzalez@pandorafms.com 2022-10-26 17:00:54 +02:00
parent 30fb724359
commit 2cb72f532c
6 changed files with 290 additions and 181 deletions

View File

@ -1,40 +1,52 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
/**
* Visual console Builder Wizard Data.
*
* @category Legacy.
* @package Pandora FMS
* @subpackage Enterprise
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
check_login();
if (empty($idVisualConsole)) {
// ACL for the a new visual console
// if (!isset($vconsole_read))
// $vconsole_read = check_acl ($config['id_user'], 0, "VR");
if (!isset($vconsole_write)) {
if (empty($idVisualConsole) === true) {
// ACL for the a new visual console.
if (isset($vconsole_write) === false) {
$vconsole_write = check_acl($config['id_user'], 0, 'VW');
}
if (!isset($vconsole_manage)) {
if (isset($vconsole_manage) === false) {
$vconsole_manage = check_acl($config['id_user'], 0, 'VM');
}
} else {
// ACL for the existing visual console
// if (!isset($vconsole_read))
// $vconsole_read = check_acl ($config['id_user'], $idGroup, "VR");
if (!isset($vconsole_write)) {
// ACL for the existing visual console.
if (isset($vconsole_write) === false) {
$vconsole_write = check_acl($config['id_user'], $idGroup, 'VW');
}
if (!isset($vconsole_manage)) {
if (isset($vconsole_manage) === false) {
$vconsole_manage = check_acl($config['id_user'], $idGroup, 'VM');
}
}
@ -55,7 +67,7 @@ $pure = get_parameter('pure', 0);
switch ($action) {
case 'new':
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
echo "<form id='back' method='post' action='index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab=".$activeTab."' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'save');
} else {
@ -66,18 +78,18 @@ switch ($action) {
case 'update':
case 'save':
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
echo "<form id='back' method='post' action='index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab=".$activeTab.'&id_visual_console='.$idVisualConsole."' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'update');
} else {
// echo '<form action="index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=' . $pure . '" method="post">';
echo "<form id='back' action='index.php?sec=screen&sec2=screens/screens&tab=".$activeTab.'&id_visual_console='.$idVisualConsole.'&id_visualmap='.$idVisualConsole."&action=visualmap' method='post' enctype='multipart/form-data'>";
html_print_input_hidden('action2', 'update');
}
break;
case 'edit':
if (!defined('METACONSOLE')) {
default:
if (is_metaconsole() === false) {
echo "<form id='back' method='post' action='index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab=".$activeTab.'&id_visual_console='.$idVisualConsole."' enctype='multipart/form-data'>";
html_print_input_hidden('action', 'update');
} else {
@ -89,7 +101,7 @@ switch ($action) {
$table = new stdClass();
$table->width = '100%';
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
$table->class = 'databox data';
$table->head[0] = __('Create visual console');
$table->head_colspan[0] = 5;
@ -100,8 +112,8 @@ if (defined('METACONSOLE')) {
$table->class = 'databox filters';
$table->size[0] = '20%';
$table->size[1] = '20%';
$table->size[1] = '50%';
$table->size[1] = '100%';
$table->style[1] = 'display: flex;flex-direction: row;flex-wrap: wrap;align-items: center;';
$table->data = [];
$table->data[0][0] = __('Name:').ui_print_help_tip(__("Use [ or ( as first character, for example '[*] Map name', to render this map name in main menu"), true);
@ -115,13 +127,11 @@ $table->data[0][1] = html_print_input_text(
);
$table->rowspan[0][2] = 6;
if ($action == 'new') {
$table->data[0][2] = '<img id="imagen2" class="invisible"
src="">';
$table->data[0][2] .= '<img id="imagen" class="invisible"
src="">';
if ($action === 'new') {
$table->data[0][2] = '<img id="imagen2" class="invisible" src="">';
$table->data[0][2] .= '<img id="imagen" class="invisible" src="">';
} else {
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
$table->data[0][2] = '<img id="imagen2" style="width:230px;"
src="../../images/console/background/'.$background.'">';
} else {
@ -129,8 +139,7 @@ if ($action == 'new') {
src="images/console/background/'.$background.'">';
}
$table->data[0][2] .= '<img id="imagen" class="invisible"
src="">';
$table->data[0][2] .= '<img id="imagen" class="invisible" src="">';
}
$table->data[1][0] = __('Group');
@ -210,14 +219,35 @@ if ($idVisualConsole) {
$table->data[5][0] = __('Layout size').': <span id="preimagew">'.$preimagew.'</span> x <span id="preimageh">'.$preimageh.'</span>';
$table->data[5][1] = '<button id="modsize"
style="margin-right:20px;" value="modsize">'.__('Set custom size').'</button>';
$table->data[5][1] = html_print_button(
__('Set custom size'),
'modsize',
false,
'',
[
'icon' => 'cog',
'mode' => 'link',
'value' => 'modsize',
],
true
);
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">'.html_print_input_text('width', $preimagew, '', 10, 10, true, false).' x '.html_print_input_text('height', $preimageh, '', 10, 10, true, false).'</span>';
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">
<button id="getsize" class="margin_lft_20px"
value="modsize">'.__('Get default image size').'</button></span>';
$table->data[5][1] .= '<span class="opt" style="visibility:hidden;">';
$table->data[5][1] .= html_print_button(
__('Get default image size'),
'getsize',
false,
'',
[
'icon' => 'cog',
'mode' => 'link',
'value' => 'modsize',
],
true
);
$table->data[5][1] .= '</span>';
$table->data[6][0] = __('Favourite visual console');
$table->data[6][1] = html_print_checkbox('is_favourite', 0, $is_favourite, true);
@ -225,24 +255,28 @@ $table->data[6][1] = html_print_checkbox('is_favourite', 0, $is_favourite, true)
$table->data[7][0] = __('Auto adjust to screen in fullscreen');
$table->data[7][1] = html_print_checkbox('auto_adjust', 0, $auto_adjust, true);
if ($action == 'new') {
if ($action === 'new') {
$textButtonSubmit = __('Save');
$classButtonSubmit = 'sub wand';
$classButtonSubmit = 'wand';
} else {
$textButtonSubmit = __('Update');
$classButtonSubmit = 'sub upd';
$classButtonSubmit = 'update';
}
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(
$textButtonSubmit,
'update_layout',
false,
'class="'.$classButtonSubmit.'"'
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
$textButtonSubmit,
'update_layout',
false,
[ 'icon' => $classButtonSubmit ],
true
),
]
);
echo '</div>';
echo '</form>';
ui_require_css_file('color-picker', 'include/styles/js/');
@ -252,15 +286,14 @@ ui_require_jquery_file('colorpicker');
<script type="text/javascript">
$(document).ready (function () {
$("#modsize").click(function(event){
$("#button-modsize").click(function(event){
event.preventDefault();
if($('.opt').css('visibility') == 'hidden'){
$('.opt').css('visibility','visible');
}
if ($('#imagen').attr('src') != '') {
if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
@ -279,26 +312,24 @@ $(document).ready (function () {
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
}
});
$("#getsize").click(function(event){
$("#button-getsize").click(function(event){
event.preventDefault();
if ($('#imagen').attr('src') != '') {
if (parseInt($('#imagen').width()) < 1024){
alert('Default width is '+$('#imagen').width()+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val($('#imagen').width());
$('#preimagew').html($('#imagen').width());
$('#preimagew').html($('#imagen').width());
}
if (parseInt($('#imagen').height()) < 768){
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
alert('Default height is '+$('#imagen').height()+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
@ -306,7 +337,6 @@ $(document).ready (function () {
$('input[name=height]').val($('#imagen').height());
$('#preimageh').html($('#imagen').height());
}
}
else{
original_image=new Image();
@ -315,14 +345,14 @@ $(document).ready (function () {
if (parseInt(original_image.width) < 1024){
alert('Default width is '+original_image.width+'px, smaller than minimum -> 1024px');
$('input[name=width]').val('1024');
$('#preimagew').html(1024);
$('#preimagew').html(1024);
}
else{
$('input[name=width]').val(original_image.height);
$('#preimagew').html(original_image.height);
$('#preimagew').html(original_image.height);
}
if (parseInt(original_image.height) < 768){
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
alert('Default height is '+original_image.height+'px, smaller than minimum -> 768px');
$('input[name=height]').val('768');
$('#preimageh').html(768);
}
@ -330,9 +360,7 @@ $(document).ready (function () {
$('input[name=height]').val(original_image.height);
$('#preimageh').html(original_image.height);
}
}
});
$( "input[type=submit]" ).click(function( event ) {

View File

@ -1,22 +1,39 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
/**
* Visual console Builder editor.
*
* @category Topology maps
* @package Pandora FMS
* @subpackage Visual consoles
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2007-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
// Login check
// Login check.
check_login();
// Visual console required
if (empty($visualConsole)) {
// Visual console required.
if (empty($visualConsole) === true) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
@ -27,18 +44,16 @@ if (empty($visualConsole)) {
ui_require_css_file('visual_maps');
// ACL for the existing visual console
// if (!isset($vconsole_read))
// $vconsole_read = check_acl ($config['id_user'], $visualConsole['id_group'], "VR");
if (!isset($vconsole_write)) {
// ACL for the existing visual console.
if (isset($vconsole_write) === false) {
$vconsole_write = check_acl($config['id_user'], $visualConsole['id_group'], 'VW');
}
if (!isset($vconsole_manage)) {
if (isset($vconsole_manage) === false) {
$vconsole_manage = check_acl($config['id_user'], $visualConsole['id_group'], 'VM');
}
if (!$vconsole_write && !$vconsole_manage) {
if ((bool) $vconsole_write === false && (bool) $vconsole_manage === false) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
@ -48,7 +63,7 @@ if (!$vconsole_write && !$vconsole_manage) {
}
$metaconsole_hack = '';
if (defined('METACONSOLE')) {
if (is_metaconsole()) {
$metaconsole_hack = '../../';
}
@ -72,17 +87,12 @@ if ($layoutDatas === false) {
$layoutDatas = [];
}
// Set the hidden value for the javascript
if (defined('METACONSOLE')) {
html_print_input_hidden('metaconsole', 1);
} else {
html_print_input_hidden('metaconsole', 0);
}
html_print_input_hidden('metaconsole', (is_metaconsole() === true) ? 1 : 0);
visual_map_editor_print_hack_translate_strings();
visual_map_editor_print_item_palette($visualConsole['id'], $background);
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
echo '<div id="frame_view" class="frame_view_meta">';
} else {
echo '<div id="frame_view" class="frame_view_node mrgn_top_meta_35px">';
@ -100,7 +110,7 @@ echo "<div id='background_grid'
foreach ($layoutDatas as $layoutData) {
$layoutData['status_calculated'] = visual_map_get_status_element($layoutData);
// Pending delete and disable modules must be ignored
// Pending delete and disable modules must be ignored.
$delete_pending_module = db_get_value(
'delete_pending',
'tagente_modulo',
@ -163,27 +173,27 @@ html_print_input_hidden('id_visual_console', $visualConsole['id']);
html_print_input_hidden('message_size', __('Min allowed size is 1024x768'));
// Loading dialog
// Loading dialog.
echo "<div id='loading_in_progress_dialog' class='invisible center' title='".__('Action in progress')."'>".__('Loading in progress').'<br />'.html_print_image('images/spinner.gif', true).'</div>';
echo "<div id='saving_in_progress_dialog' class='invisible center' title='".__('Action in progress')."'>".__('Saving in progress').'<br />'.html_print_image('images/spinner.gif', true).'</div>';
echo "<div id='delete_in_progress_dialog' class='invisible center' title='".__('Action in progress')."'>".__('Deletion in progress').'<br />'.html_print_image('images/spinner.gif', true).'</div>';
// CSS
// CSS.
ui_require_css_file('color-picker', 'include/styles/js/');
ui_require_css_file('jquery-ui.min', 'include/styles/js/');
ui_require_jquery_file('jquery-ui_custom');
// Javascript
// Javascript.
ui_require_jquery_file('colorpicker');
ui_require_javascript_file('wz_jsgraphics');
ui_require_javascript_file('pandora_visual_console');
ui_require_javascript_file('visual_console_builder.editor', 'godmode/reporting/');
ui_require_javascript_file_enterprise('functions_visualmap', defined('METACONSOLE'));
ui_require_javascript_file_enterprise('functions_visualmap', is_metaconsole() === true);
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
// Javascript file for base 64 encoding of label parameter
// Javascript file for base 64 encoding of label parameter.
ui_require_javascript_file('encode_decode_base64');
?>
<style type="text/css">
@ -195,11 +205,11 @@ ui_require_javascript_file('encode_decode_base64');
<script type="text/javascript">
id_visual_console = <?php echo $visualConsole['id']; ?>;
visual_map_main();
var added_config = {
"plugins": "noneditable",
"elements": "text-label",
"theme_advanced_buttons1":
"theme_advanced_buttons1":
"bold,italic,|,justifyleft,justifycenter,justifyright,|,undo,redo,|,image,link,|,fontselect,|,forecolor,fontsizeselect,|,code",
"valid_children": "+body[style]",
"theme_advanced_font_sizes": "true",
@ -213,9 +223,9 @@ ui_require_javascript_file('encode_decode_base64');
defineTinyMCE(added_config);
$('.item img').each(function(){
if($(this).css('float')=='left' || $(this).css('float')=='right'){
$(this).css('margin-top',(parseInt($(this).parent().css('height'))/2-parseInt($(this).css('height'))/2)+'px');
$(this).css('margin-left','');
}
@ -223,9 +233,9 @@ ui_require_javascript_file('encode_decode_base64');
$(this).css('margin-left',(parseInt($(this).parent().css('width'))/2-parseInt($(this).css('width'))/2)+'px');
$(this).css('margin-top','');
}
});
$('#process_value').change(function(){
if($(this).val() == 0){
$('#period_row').css('display','none');
@ -234,5 +244,5 @@ ui_require_javascript_file('encode_decode_base64');
$('#period_row').css('display','');
}
});
</script>

View File

@ -1,22 +1,38 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
/**
* Visual console Builder Elements.
*
* @category Legacy.
* @package Pandora FMS
* @subpackage Enterprise
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
check_login();
// Visual console required
if (empty($visualConsole)) {
// Visual console required.
if (empty($visualConsole) === true) {
db_pandora_audit(
AUDIT_LOG_ACL_VIOLATION,
'Trying to access report builder'
@ -739,43 +755,56 @@ foreach ($layoutDatas as $layoutData) {
$pure = get_parameter('pure', 0);
if (!defined('METACONSOLE')) {
if (is_metaconsole() === false) {
echo '<form class="vc_elem_form" method="post" action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'].'">';
} else {
echo "<form class='vc_elem_form' method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
}
if (!defined('METACONSOLE')) {
echo '<div class="action-buttons" style="width: '.$table->width.'; margin-bottom:15px;">';
}
if (!defined('METACONSOLE')) {
html_print_input_hidden('action', 'update');
} else {
echo "<form class='vc_elem_form' method='post' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console=".$idVisualConsole."'>";
html_print_input_hidden('action2', 'update');
}
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
html_print_submit_button(__('Update'), 'go', false, 'class="sub next"');
echo '&nbsp;';
html_print_button(__('Delete'), 'delete', false, 'submit_delete_multiple_items();', 'class="sub delete"');
echo '</div>';
$buttons = html_print_submit_button(
__('Update'),
'go',
false,
[ 'icon' => 'next' ],
true
);
$buttons .= html_print_button(
__('Delete'),
'delete',
false,
'submit_delete_multiple_items();',
[
'icon' => 'delete',
'mode' => 'secondary',
],
true
);
html_print_div(
[
'class' => 'action-buttons',
'content' => $buttons,
]
);
echo '</form>';
// Form for multiple delete
if (!defined('METACONSOLE')) {
$url_multiple_delete = 'index.php?'.'sec=network&'.'sec2=godmode/reporting/visual_console_builder&'.'tab='.$activeTab.'&'.'id_visual_console='.$visualConsole['id'];
echo '<form id="form_multiple_delete" method="post" action="'.$url_multiple_delete.'">';
// Form for multiple delete.
if (is_metaconsole() === false) {
$url_multiple_delete = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$visualConsole['id'];
} else {
$url_multiple_delete = 'index.php?'.'operation=edit_visualmap&'.'sec=screen&'.'sec2=screens/screens&'.'action=visualmap&'.'pure=0&'.'tab=list_elements&'.'id_visual_console='.$idVisualConsole;
echo "<form id='form_multiple_delete' method='post' action=".$url_multiple_delete.'>';
$url_multiple_delete = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&action=visualmap&pure=0&tab=list_elements&id_visual_console='.$idVisualConsole;
}
if (!defined('METACONSOLE')) {
echo "<form id='form_multiple_delete' method='post' action=".$url_multiple_delete.'>';
if (is_metaconsole() === false) {
html_print_input_hidden('action', 'multiple_delete');
} else {
html_print_input_hidden('action2', 'multiple_delete');

View File

@ -1,16 +1,32 @@
<?php
// Pandora FMS - http://pandorafms.com
// ==================================================
// Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
// Please see http://pandorafms.org for full contribution list
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation for version 2.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Login check
/**
* Visual console Builder Wizard.
*
* @category Legacy.
* @package Pandora FMS
* @subpackage Enterprise
* @version 1.0.0
* @license See below
*
* ______ ___ _______ _______ ________
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
*
* ============================================================================
* Copyright (c) 2005-2022 Artica Soluciones Tecnologicas
* Please see http://pandorafms.org for full contribution list
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* ============================================================================
*/
// Begin.
global $config;
check_login();
@ -408,7 +424,7 @@ $table->rowstyle['all_4'] = 'display: none;';
$table->data['all_4'][0] = __('Agents').ui_print_help_tip(__('If you select several agents, only the common modules will be displayed'), true);
$agents_list = [];
if (!is_metaconsole()) {
if (is_metaconsole() === false) {
$agents_list = agents_get_group_agents(
0,
false,
@ -469,7 +485,7 @@ $table->data['all_7'][1] .= __('No').'&nbsp;&nbsp;&nbsp;'.html_print_radio_butto
$parents = visual_map_get_items_parents($visualConsole['id']);
if (empty($parents)) {
if (empty($parents) === true) {
$parents = [];
}
@ -502,7 +518,7 @@ $table->data['all_8'][3] = '<span id="parent_column_3_item_in_visual_map">'.html
if (is_metaconsole()) {
if (is_metaconsole() === true) {
$pure = get_parameter('pure', 0);
echo '<form method="post"
@ -514,22 +530,32 @@ if (is_metaconsole()) {
onsubmit="if (! confirm(\''.__('Are you sure to add many elements\nin visual map?').'\')) return false; else return check_fields();">';
}
if (defined('METACONSOLE')) {
if (is_metaconsole() === true) {
echo "<div class='title_tactical mrgn_top_15px'>".__('Wizard').'</div>';
}
html_print_table($table);
echo '<div class="action-buttons" style="width: '.$table->width.'">';
if (is_metaconsole()) {
if (is_metaconsole() === true) {
html_print_input_hidden('action2', 'update');
} else {
html_print_input_hidden('action', 'update');
}
html_print_input_hidden('id_visual_console', $visualConsole['id']);
html_print_submit_button(__('Add'), 'go', false, 'class="sub wizard wand"');
echo '</div>';
html_print_div(
[
'class' => 'action-buttons',
'content' => html_print_submit_button(
__('Add'),
'go',
false,
[ 'icon' => 'wand' ],
true
),
]
);
echo '</form>';
// Trick for it have a traduct text for javascript.

View File

@ -2374,25 +2374,38 @@ if (check_acl(
echo '<div class="multi-response-buttons">';
echo '<form method="post" id="form_event_response">';
echo '<input type="hidden" id="max_execution_event_response" value="'.$config['max_execution_event_response'].'" />';
html_print_select(
$elements = html_print_button(
__('Execute event response'),
'submit_event_response',
false,
'execute_event_response(true);',
[
'icon' => 'cog',
'mode' => 'mini',
],
true
);
$elements .= html_print_select(
$array_events_actions,
'response_id',
'',
'',
'',
0,
false,
true,
false,
false
);
echo '&nbsp&nbsp';
html_print_button(
__('Execute event response'),
'submit_event_response',
false,
'execute_event_response(true);',
'class="sub next"'
html_print_div(
[
'class' => 'action-buttons',
'content' => $elements,
]
);
echo "<span id='response_loading_dialog' class='invisible'>".html_print_image(
'images/spinner.gif',
true

View File

@ -60,7 +60,10 @@ function visual_map_print_button_editor_refactor(
$idDiv,
$disabled,
'',
'class=" sub visual_editor_button_toolbox '.$idDiv.' '.$class.'"',
[
'class' => $class,
'mode' => 'onlyIcon',
],
false,
true
);
@ -249,7 +252,7 @@ if ($pure === false) {
if ($edit_capable === true) {
echo '<div id ="edit-vc">';
echo '<div id ="edit-controls" class="visual-console-edit-controls" style="visibility:hidden">';
echo '<div>';
echo '<div class="toolbox-buttons">';
$class_camera = 'camera_min link-create-item';
$class_percentile = 'percentile_item_min link-create-item';
$class_module_graph = 'graph_min link-create-item';
@ -269,7 +272,7 @@ if ($pure === false) {
$class_basic_chart = 'basic_chart_min link-create-item';
$class_delete = 'delete_item delete_min';
$class_copy = 'copy_item';
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
if ($config['style'] === 'pandora_black' && is_metaconsole() === false) {
$class_camera = 'camera_min_white link-create-item';
$class_percentile = 'percentile_item_min_white link-create-item';
$class_module_graph = 'graph_min_white link-create-item';