Merge branch 'develop' into ent-10347-vista-tactica-de-grupo
This commit is contained in:
commit
fdc73be979
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-agent-unix
|
||||
Version: 7.0NG.769-230228
|
||||
Version: 7.0NG.769-230307
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.769-230228"
|
||||
pandora_version="7.0NG.769-230307"
|
||||
|
||||
echo "Test if you has the tools for to make the packages."
|
||||
whereis dpkg-deb | cut -d":" -f2 | grep dpkg-deb > /dev/null
|
||||
|
|
|
@ -1023,7 +1023,7 @@ my $Sem = undef;
|
|||
my $ThreadSem = undef;
|
||||
|
||||
use constant AGENT_VERSION => '7.0NG.769';
|
||||
use constant AGENT_BUILD => '230228';
|
||||
use constant AGENT_BUILD => '230307';
|
||||
|
||||
# Agent log default file size maximum and instances
|
||||
use constant DEFAULT_MAX_LOG_SIZE => 600000;
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230228
|
||||
%define release 230307
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
%global __os_install_post %{nil}
|
||||
%define name pandorafms_agent_linux
|
||||
%define version 7.0NG.769
|
||||
%define release 230228
|
||||
%define release 230307
|
||||
|
||||
Summary: Pandora FMS Linux agent, PERL version
|
||||
Name: %{name}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
# **********************************************************************
|
||||
|
||||
PI_VERSION="7.0NG.769"
|
||||
PI_BUILD="230228"
|
||||
PI_BUILD="230307"
|
||||
OS_NAME=`uname -s`
|
||||
|
||||
FORCE=0
|
||||
|
|
|
@ -186,7 +186,7 @@ UpgradeApplicationID
|
|||
{}
|
||||
|
||||
Version
|
||||
{230228}
|
||||
{230307}
|
||||
|
||||
ViewReadme
|
||||
{Yes}
|
||||
|
|
|
@ -30,7 +30,7 @@ using namespace Pandora;
|
|||
using namespace Pandora_Strutils;
|
||||
|
||||
#define PATH_SIZE _MAX_PATH+1
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230228")
|
||||
#define PANDORA_VERSION ("7.0NG.769 Build 230307")
|
||||
|
||||
string pandora_path;
|
||||
string pandora_dir;
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
VALUE "LegalCopyright", "Artica ST"
|
||||
VALUE "OriginalFilename", "PandoraAgent.exe"
|
||||
VALUE "ProductName", "Pandora FMS Windows Agent"
|
||||
VALUE "ProductVersion", "(7.0NG.769(Build 230228))"
|
||||
VALUE "ProductVersion", "(7.0NG.769(Build 230307))"
|
||||
VALUE "FileVersion", "1.0.0.0"
|
||||
END
|
||||
END
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
package: pandorafms-console
|
||||
Version: 7.0NG.769-230228
|
||||
Version: 7.0NG.769-230307
|
||||
Architecture: all
|
||||
Priority: optional
|
||||
Section: admin
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
|
||||
pandora_version="7.0NG.769-230228"
|
||||
pandora_version="7.0NG.769-230307"
|
||||
|
||||
package_pear=0
|
||||
package_pandora=1
|
||||
|
|
|
@ -397,61 +397,139 @@ function mainAgentsModules()
|
|||
1 => __('Show module data'),
|
||||
];
|
||||
|
||||
$filter_type_label = '<b>'.__('Information to be shown').'</b>';
|
||||
$filter_type = html_print_select($show_select, 'show_type', $show_type, '', '', 0, true, false, false, '', false, 'min-width: 180px;');
|
||||
|
||||
// Groups.
|
||||
$filter_groups_label = '<b>'.__('Group').'</b>';
|
||||
$filter_groups = html_print_select_groups(false, 'AR', true, 'group_id', $group_id, '', '', '', true, false, true, '', false, 'width: auto;');
|
||||
|
||||
$filter_recursion_label = '</td><td><b>'.__('Recursion').'</b>';
|
||||
$filter_recursion = html_print_checkbox('recursion', 1, 0, true).'</td>';
|
||||
// Groups module.
|
||||
$filter_module_groups_label = '<b>'.__('Module group').'</b>';
|
||||
$filter_module_groups = html_print_select_from_sql(
|
||||
'SELECT * FROM tmodule_group ORDER BY name',
|
||||
'modulegroup',
|
||||
$modulegroup,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'width: auto;'
|
||||
$filter_type = html_print_label_input_block(
|
||||
__('Information to be shown'),
|
||||
html_print_select(
|
||||
$show_select,
|
||||
'show_type',
|
||||
$show_type,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$filter_groups = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
true,
|
||||
'group_id',
|
||||
$group_id,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$filter_groups .= html_print_label_input_block(
|
||||
__('Recursion'),
|
||||
html_print_checkbox_switch('recursion', 1, 0, true),
|
||||
[
|
||||
'div_class' => 'add-input-reverse',
|
||||
'label_class' => 'label-thin',
|
||||
]
|
||||
);
|
||||
|
||||
$filter_module_groups = html_print_label_input_block(
|
||||
__('Module group'),
|
||||
html_print_select_from_sql(
|
||||
'SELECT * FROM tmodule_group ORDER BY name',
|
||||
'modulegroup',
|
||||
$modulegroup,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
// Agent.
|
||||
$agents = agents_get_group_agents($group_id);
|
||||
if ((empty($agents)) || $agents == -1) {
|
||||
$agents = [];
|
||||
}
|
||||
|
||||
$filter_agents_label = '<b>'.__('Agents').'</b>';
|
||||
$filter_agents = html_print_select($agents, 'id_agents2[]', $agents_id, '', '', 0, true, true, true, '', false, 'min-width: 180px; max-width: 200px;');
|
||||
$filter_agents = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
$agents,
|
||||
'id_agents2[]',
|
||||
$agents_id,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
// Type show.
|
||||
$selection = [
|
||||
0 => __('Show common modules'),
|
||||
1 => __('Show all modules'),
|
||||
];
|
||||
$filter_type_show_label = '<b>'.__('Show common modules').'</b>';
|
||||
$filter_type_show = html_print_select($selection, 'selection_agent_module', $selection_a_m, '', '', 0, true, false, true, '', false, 'min-width: 180px;');
|
||||
$filter_type_show = html_print_label_input_block(
|
||||
__('Show common modules'),
|
||||
html_print_select(
|
||||
$selection,
|
||||
'selection_agent_module',
|
||||
$selection_a_m,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
// Modules.
|
||||
$all_modules = select_modules_for_agent_group($group_id, $agents_id, $selection_a_m, false);
|
||||
$filter_modules_label = '<b>'.__('Module').'</b>';
|
||||
$filter_modules = html_print_select($all_modules, 'module[]', $modules_selected, '', '', 0, true, true, false, '', false, 'min-width: 180px; max-width: 200px;');
|
||||
|
||||
// Update.
|
||||
$filter_update = html_print_submit_button(__('Update item'), 'edit_item', false, 'class="sub upd"', true);
|
||||
$filter_modules = html_print_label_input_block(
|
||||
__('Module'),
|
||||
html_print_select(
|
||||
$all_modules,
|
||||
'module[]',
|
||||
$modules_selected,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$onheader = [
|
||||
'updated_time' => $updated_time,
|
||||
'fullscreen' => $fullscreen,
|
||||
'combo_module_groups' => $filter_module_groups,
|
||||
'combo_groups' => $filter_groups,
|
||||
'updated_time' => $updated_time,
|
||||
'fullscreen' => $fullscreen,
|
||||
];
|
||||
|
||||
/*
|
||||
|
@ -467,7 +545,7 @@ function mainAgentsModules()
|
|||
false,
|
||||
'',
|
||||
false,
|
||||
(array) $updated_time,
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
|
@ -479,12 +557,6 @@ function mainAgentsModules()
|
|||
],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<table class="w100p">';
|
||||
echo '<tr>';
|
||||
echo "<td> <span class='float-right'>".$fullscreen['text'].'</span> </td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
} else {
|
||||
if ($full_agents_id[0]) {
|
||||
$full_modules = urlencode(implode(';', $full_modules_selected));
|
||||
|
@ -574,35 +646,46 @@ function mainAgentsModules()
|
|||
|
||||
if ($config['pure'] != 1) {
|
||||
$show_filters = '<form method="post" action="'.ui_get_url_refresh(['offset' => $offset, 'hor_offset' => $offset, 'group_id' => $group_id, 'modulegroup' => $modulegroup]).'" class="w100p">';
|
||||
$show_filters .= '<table class="w100p no-border" cellpadding="15" cellspacing="0" border="0">';
|
||||
$show_filters .= '<table class="filter-table-adv w100p no-border" cellpadding="4" cellspacing="4">';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td>'.$filter_type_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_type.'</td>';
|
||||
$show_filters .= '<td width="33%">'.$filter_type.'</td>';
|
||||
$show_filters .= '<td width="33%">'.$filter_groups.'</td>';
|
||||
$show_filters .= '<td width="33%">'.$filter_module_groups.'</td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td>'.$filter_groups_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_groups.' '.$filter_recursion_label.$filter_recursion.'</td>';
|
||||
$show_filters .= '<td></td>';
|
||||
$show_filters .= '<td></td>';
|
||||
$show_filters .= '<td>'.$filter_module_groups_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_module_groups.'</td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= '<td>'.$filter_agents_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_agents.'</td>';
|
||||
$show_filters .= '<td>'.$filter_type_show_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_type_show.'</td>';
|
||||
$show_filters .= '<td>'.$filter_modules_label.'</td>';
|
||||
$show_filters .= '<td>'.$filter_modules.'</td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '<tr>';
|
||||
$show_filters .= "<td colspan=6 ><span class='right pdd_r_35px mrgn_top_25px'>".$filter_update.'</span></td>';
|
||||
$show_filters .= '</tr>';
|
||||
$show_filters .= '</table>';
|
||||
$show_filters .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$show_filters .= '</form>';
|
||||
|
||||
ui_toggle(
|
||||
$show_filters,
|
||||
__('Filters ').ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true)
|
||||
'<span class="subsection_header_title">'.__('Filters ').'</span>'.ui_print_help_tip(__('Secondary groups and agent subgroups will be taken into account.'), true),
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -751,11 +834,11 @@ function mainAgentsModules()
|
|||
return;
|
||||
}
|
||||
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="agents_modules_table w100p">';
|
||||
echo '<table cellpadding="4" cellspacing="4" border="0" class="info_table mrgn_btn_20px">';
|
||||
|
||||
echo '<tr>';
|
||||
|
||||
echo "<th width='140px' class='pdd_r_10px lign_right'>".__('Agents').' / '.__('Modules').'</th>';
|
||||
echo "<th width='140px' class='pdd_r_10px align_right'>".__('Agents').' / '.__('Modules').'</th>';
|
||||
|
||||
if ($hor_offset > 0) {
|
||||
$new_hor_offset = ($hor_offset - $block);
|
||||
|
@ -804,7 +887,20 @@ function mainAgentsModules()
|
|||
|
||||
// Prepare pagination.
|
||||
$url = 'index.php?extension_in_menu=estado&sec=extensions&sec2=extensions/agents_modules&save_serialize=1&hor_offset='.$hor_offset.'&selection_a_m='.$selection_a_m;
|
||||
ui_pagination($total_pagination, $url);
|
||||
$tablePagination = ui_pagination(
|
||||
$total_pagination,
|
||||
$url,
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
'',
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
|
||||
foreach ($agents as $agent) {
|
||||
// Get stats for this group.
|
||||
|
|
|
@ -301,10 +301,21 @@ function extension_api_checker()
|
|||
html_print_table($table3);
|
||||
echo '</fieldset>';
|
||||
|
||||
echo "<div class='right'>";
|
||||
html_print_input_hidden('api_execute', 1);
|
||||
html_print_submit_button(__('Call'), 'submit', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Call'),
|
||||
'submit',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
if ($api_execute === true) {
|
||||
|
|
|
@ -67,11 +67,20 @@ function extension_db_status()
|
|||
html_print_table($table);
|
||||
echo '</fieldset>';
|
||||
|
||||
echo "<div class='right'>";
|
||||
html_print_input_hidden('db_status_execute', 1);
|
||||
html_print_submit_button(__('Execute Test'), 'submit', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Execute Test'),
|
||||
'submit',
|
||||
false,
|
||||
[ 'icon' => 'cog' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
html_print_input_hidden('db_status_execute', 1);
|
||||
echo '</form>';
|
||||
|
||||
if ($db_status_execute) {
|
||||
|
|
|
@ -76,10 +76,6 @@ function dbmgr_extension_main()
|
|||
|
||||
global $config;
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
open_meta_frame();
|
||||
}
|
||||
|
||||
if (!is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -92,7 +88,21 @@ function dbmgr_extension_main()
|
|||
$sql = (string) get_parameter('sql');
|
||||
$node_id = (int) get_parameter('node_id', -1);
|
||||
|
||||
ui_print_page_header(__('Database interface'), 'images/gm_db.png', false, false, true);
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('Database interface'),
|
||||
'images/gm_db.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Extensions'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$img = '../../images/warning_modern.png';
|
||||
|
@ -195,15 +205,18 @@ function dbmgr_extension_main()
|
|||
);
|
||||
}
|
||||
|
||||
$data[4][2] = '<div class="action-buttons w100p">';
|
||||
$data[4][2] .= html_print_submit_button(
|
||||
__('Execute SQL'),
|
||||
'',
|
||||
false,
|
||||
'class="sub next"',
|
||||
true
|
||||
$data[4][2] = html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Execute SQL'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'cog' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
$data[4][2] .= '</div>';
|
||||
|
||||
$table->data = $data;
|
||||
html_print_table($table);
|
||||
|
@ -282,10 +295,6 @@ function dbmgr_extension_main()
|
|||
html_print_table($table);
|
||||
echo '</div>';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
close_meta_frame();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ if (!empty($files)) {
|
|||
// Last modification
|
||||
// Public URL
|
||||
$data[4] = '';
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
$table->cellclass[][4] = 'table_action_buttons';
|
||||
if (!empty($file['hash'])) {
|
||||
$public_url = ui_get_full_url(
|
||||
EXTENSIONS_DIR.'/files_repo/files_repo_get_file.php?file='.$file['hash']
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Insert Data form.
|
||||
*
|
||||
* @category Extension.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_agents.php';
|
||||
|
@ -55,7 +71,24 @@ function mainInsertData()
|
|||
{
|
||||
global $config;
|
||||
|
||||
ui_print_page_header(__('Insert data'), 'images/extensions.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Insert Data'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Insert Data'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW') && ! is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
|
@ -84,6 +117,13 @@ function mainInsertData()
|
|||
$csv = false;
|
||||
}
|
||||
|
||||
ui_print_warning_message(
|
||||
sprintf(
|
||||
__('Please check that the directory "%s" is writeable by the apache user. <br /><br />The CSV file format is date;value<newline>date;value<newline>... The date in CSV is in format Y/m/d H:i:s.'),
|
||||
$config['remote_config']
|
||||
)
|
||||
);
|
||||
|
||||
if ($save) {
|
||||
if (!check_acl($config['id_user'], agents_get_agent_group($agent_id), 'AW')) {
|
||||
ui_print_error_message(__('You haven\'t privileges for insert data in the agent.'));
|
||||
|
@ -140,27 +180,25 @@ function mainInsertData()
|
|||
}
|
||||
}
|
||||
|
||||
echo '<div class="notify mrg_btt_15">';
|
||||
echo sprintf(
|
||||
__('Please check that the directory "%s" is writeable by the apache user. <br /><br />The CSV file format is date;value<newline>date;value<newline>... The date in CSV is in format Y/m/d H:i:s.'),
|
||||
$config['remote_config']
|
||||
);
|
||||
echo '</div>';
|
||||
$modules = [];
|
||||
if ($agent_id > 0) {
|
||||
$modules = agents_get_modules($agent_id, false, ['delete_pending' => 0]);
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bolder;';
|
||||
|
||||
$table->cellstyle[0][0] = 'width: 0';
|
||||
$table->cellstyle[0][1] = 'width: 0';
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Agent');
|
||||
$table->data[0][0] = '<label>'.__('Agent').'</label>';
|
||||
$table->data[0][1] = '<label>'.__('Module').'</label>';
|
||||
$table->data[0][2] = '<label>'.__('Date').'</label>';
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'agent_name';
|
||||
$params['value'] = $agent_name;
|
||||
$params['value'] = ($save === true) ? '' : $agent_name;
|
||||
$params['javascript_is_function_select'] = true;
|
||||
$params['javascript_name_function_select'] = 'custom_select_function';
|
||||
$params['javascript_code_function_select'] = '';
|
||||
|
@ -170,18 +208,12 @@ function mainInsertData()
|
|||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
|
||||
$table->data[0][1] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
$table->data[1][0] = __('Module');
|
||||
$modules = [];
|
||||
if ($agent_id) {
|
||||
$modules = agents_get_modules($agent_id, false, ['delete_pending' => 0]);
|
||||
}
|
||||
$table->data[1][0] = html_print_div(['class' => 'flex flex-items-center', 'content' => ui_print_agent_autocomplete_input($params)], true);
|
||||
|
||||
$table->data[1][1] = html_print_select(
|
||||
$modules,
|
||||
'id_agent_module',
|
||||
$id_agent_module,
|
||||
($save === true) ? '' : $id_agent_module,
|
||||
true,
|
||||
__('Select'),
|
||||
0,
|
||||
|
@ -191,22 +223,45 @@ function mainInsertData()
|
|||
'',
|
||||
empty($agent_id)
|
||||
);
|
||||
$table->data[2][0] = __('Data');
|
||||
$table->data[2][1] = html_print_input_text('data', $data, __('Data'), 40, 60, true);
|
||||
$table->data[3][0] = __('Date');
|
||||
$table->data[3][1] = html_print_input_text('date', $date, '', 11, 11, true).' ';
|
||||
$table->data[3][1] .= html_print_input_text('time', $time, '', 7, 7, true);
|
||||
$table->data[4][0] = __('CSV');
|
||||
$table->data[4][1] = html_print_input_file('csv', true);
|
||||
$table->data[1][2] = html_print_input_text('data', ($save === true) ? date(DATE_FORMAT) : $data, __('Data'), 10, 60, true);
|
||||
$table->data[1][2] .= ' ';
|
||||
$table->data[1][2] .= html_print_input_text('time', ($save === true) ? date(TIME_FORMAT) : $time, '', 10, 7, true);
|
||||
|
||||
$table->data[2][0] = '<label>'.__('Data').'</label>';
|
||||
$table->data[2][1] = '<label>'.__('CSV').'</label>';
|
||||
$table->data[3][0] = html_print_input_text(
|
||||
'data',
|
||||
$data,
|
||||
__('Data'),
|
||||
40,
|
||||
60,
|
||||
true
|
||||
);
|
||||
$table->data[3][1] = html_print_div(
|
||||
[
|
||||
'class' => '',
|
||||
'content' => html_print_input_file('csv', true),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo "<form method='post' enctype='multipart/form-data'>";
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo "<div class='right' style='width: ".$table->width."'>";
|
||||
html_print_input_hidden('save', 1);
|
||||
html_print_submit_button(__('Save'), 'submit', ($id_agent === ''), 'class="sub next"');
|
||||
echo '</div>';
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Save'),
|
||||
'submit',
|
||||
// (empty($id_agent) === true),
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
|
@ -257,8 +312,8 @@ function mainInsertData()
|
|||
$('#id_agent_module').enable();
|
||||
$('#id_agent_module').fadeIn ('normal');
|
||||
|
||||
$('#submit-submit').enable();
|
||||
$('#submit-submit').fadeIn ('normal');
|
||||
$('button [name="submit"]').removeClass('disabled_action_button');
|
||||
$('button [name="submit"]').fadeIn ('normal');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -266,24 +266,68 @@ function mainModuleGroups()
|
|||
]
|
||||
);
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox filters bolder margin-bottom-10' width='100%'>
|
||||
<tr>";
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=view&sec2=extensions/module_groups'>";
|
||||
$output = "<form method='post'
|
||||
action='index.php?sec=view&sec2=extensions/module_groups'>";
|
||||
|
||||
echo '<td>';
|
||||
echo __('Search by agent group').' ';
|
||||
html_print_input_text('agent_group_search', $agent_group_search);
|
||||
$output .= "<table cellpadding='4' cellspacing='4' class='filter-table-adv margin-bottom-10' width='100%'><tr>";
|
||||
$output .= '<td>';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Search by agent group'),
|
||||
html_print_input_text(
|
||||
'agent_group_search',
|
||||
$agent_group_search,
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</td><td>';
|
||||
echo __('Search by module group').' ';
|
||||
html_print_input_text('module_group_search', $module_group_search);
|
||||
$output .= '</td><td>';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Search by module group'),
|
||||
html_print_input_text(
|
||||
'module_group_search',
|
||||
$module_group_search,
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true
|
||||
)
|
||||
);
|
||||
$output .= '</td>';
|
||||
$output .= '</tr></table>';
|
||||
|
||||
echo '</td><td>';
|
||||
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
echo '</form>';
|
||||
echo '<td>';
|
||||
echo '</tr></table>';
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$output .= '</form>';
|
||||
|
||||
ui_toggle(
|
||||
$output,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
$cell_style = '
|
||||
min-width: 60px;
|
||||
|
@ -299,26 +343,35 @@ function mainModuleGroups()
|
|||
|
||||
if ($info && $array_module_group) {
|
||||
$table = new StdClass();
|
||||
$table->style[0] = 'color: #ffffff; background-color: #373737; font-weight: bolder; min-width: 230px;';
|
||||
$table->class = 'info_table';
|
||||
$table->style[0] = 'font-weight: bolder; min-width: 230px;';
|
||||
$table->width = '100%';
|
||||
|
||||
if ($config['style'] === 'pandora_black' && !is_metaconsole()) {
|
||||
$background_color = '#333';
|
||||
} else {
|
||||
$background_color = '#fff';
|
||||
}
|
||||
|
||||
$head[0] = __('Groups');
|
||||
$headstyle[0] = 'width: 20%; font-weight: bolder;';
|
||||
foreach ($array_module_group as $key => $value) {
|
||||
$headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; color: #ffffff; background-color: #373737; font-weight: bolder;';
|
||||
$head[] = ui_print_truncate_text($value, GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF');
|
||||
$headstyle[] = 'min-width: 60px;max-width: 5%;text-align:center; font-weight: bolder;';
|
||||
$head[] = ui_print_truncate_text(
|
||||
$value,
|
||||
GENERIC_SIZE_TEXT,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'…'
|
||||
);
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($array_for_defect as $key => $value) {
|
||||
$deep = groups_get_group_deep($key);
|
||||
$data[$i][0] = $deep.ui_print_truncate_text($value['data']['name'], GENERIC_SIZE_TEXT, true, true, true, '…', 'color:#FFF');
|
||||
$data[$i][0] = $deep.ui_print_truncate_text(
|
||||
$value['data']['name'],
|
||||
GENERIC_SIZE_TEXT,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'…'
|
||||
);
|
||||
$j = 1;
|
||||
if (isset($array_data[$key])) {
|
||||
foreach ($value['gm'] as $k => $v) {
|
||||
|
@ -378,25 +431,37 @@ function mainModuleGroups()
|
|||
$table->headstyle = $headstyle;
|
||||
$table->data = $data;
|
||||
|
||||
ui_pagination($counter);
|
||||
|
||||
echo "<div class='w100p' style='overflow-x:auto;'>";
|
||||
html_print_table($table);
|
||||
echo '</div>';
|
||||
|
||||
ui_pagination($counter);
|
||||
$tablePagination = ui_pagination(
|
||||
$counter,
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false
|
||||
);
|
||||
|
||||
echo "<div class='legend_basic w99p'>";
|
||||
echo '<table >';
|
||||
echo "<tr><td colspan='2' class='pdd_b_10px'><b>".__('Legend').'</b></td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module group and agent have at least one alarm fired.').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module group and agent have all modules in OK status').'</td></tr>';
|
||||
echo "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__('Blue cell when the module group and agent have all modules in not init status.').'</td></tr>';
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
html_print_action_buttons(
|
||||
'',
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
|
||||
$show_legend = '<div>';
|
||||
$show_legend .= '<table>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_ALERTFIRED.";'></div></td><td>".__('Orange cell when the module group and agent have at least one alarm fired.').'</td></tr>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_CRITICAL.";'></div></td><td>".__('Red cell when the module group and agent have at least one module in critical status and the others in any status').'</td></tr>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_WARNING.";'></div></td><td>".__('Yellow cell when the module group and agent have at least one in warning status and the others in grey or green status').'</td></tr>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_UNKNOWN.";'></div></td><td>".__('Grey cell when the module group and agent have at least one in unknown status and the others in green status').'</td></tr>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NORMAL.";'></div></td><td>".__('Green cell when the module group and agent have all modules in OK status').'</td></tr>';
|
||||
$show_legend .= "<tr><td class='legend_square_simple'><div style='background-color: ".COL_NOTINIT.";'></div></td><td>".__('Blue cell when the module group and agent have all modules in not init status.').'</td></tr>';
|
||||
$show_legend .= '</table>';
|
||||
$show_legend .= '</div>';
|
||||
|
||||
ui_toggle($show_legend, __('Legend'));
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('This table shows in columns the modules group and in rows agents group. The cell shows all modules') ]);
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined groups or module groups') ]);
|
||||
|
|
|
@ -151,7 +151,7 @@ function quickShell()
|
|||
'name' => 'submit',
|
||||
'label' => __('Retry'),
|
||||
'type' => 'submit',
|
||||
'attributes' => 'class="sub next"',
|
||||
'attributes' => ['icon' => 'next'],
|
||||
'return' => true,
|
||||
],
|
||||
],
|
||||
|
@ -202,7 +202,7 @@ function quickShell()
|
|||
'arguments' => [
|
||||
'type' => 'submit',
|
||||
'label' => __('Connect'),
|
||||
'attributes' => 'class="sub next"',
|
||||
'attributes' => ['icon' => 'cog'],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
@ -544,7 +544,7 @@ if (empty($agent_id) === false
|
|||
// TabName.
|
||||
__('QuickShell'),
|
||||
// TabIcon.
|
||||
'images/ehorus/terminal.png',
|
||||
'images/quick-shell@svg.svg',
|
||||
// TabFunction.
|
||||
'quickShell',
|
||||
// Version.
|
||||
|
|
|
@ -74,61 +74,11 @@ function pandora_realtime_graphs()
|
|||
);
|
||||
}
|
||||
|
||||
$chart[time()]['graph'] = '0';
|
||||
$interactive_graph = true;
|
||||
$color = [];
|
||||
$legend = '';
|
||||
$long_index = [];
|
||||
$no_data_image = '';
|
||||
|
||||
$canvas = '<div id="graph_container" class="graph_container">';
|
||||
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
|
||||
|
||||
$width = 800;
|
||||
$height = 300;
|
||||
|
||||
$data_array['realtime']['data'][0][0] = (time() - 10);
|
||||
$data_array['realtime']['data'][0][1] = 0;
|
||||
$data_array['realtime']['data'][1][0] = time();
|
||||
$data_array['realtime']['data'][1][1] = 0;
|
||||
$data_array['realtime']['color'] = 'green';
|
||||
|
||||
$params = [
|
||||
'agent_module_id' => false,
|
||||
'period' => 300,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'unit' => $unit,
|
||||
'only_image' => $only_image,
|
||||
'homeurl' => $homeurl,
|
||||
'type_graph' => 'area',
|
||||
'font' => $config['fontpath'],
|
||||
'font-size' => $config['font_size'],
|
||||
'array_data_create' => $data_array,
|
||||
'show_legend' => false,
|
||||
'show_menu' => false,
|
||||
];
|
||||
|
||||
$canvas .= grafico_modulo_sparse($params);
|
||||
|
||||
$canvas .= '</div>';
|
||||
echo $canvas;
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->id = 'table-form';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->style = [];
|
||||
$table->cellpadding = '0';
|
||||
$table->cellspacing = '0';
|
||||
$table->style['graph'] = 'font-weight: bold;';
|
||||
$table->style['refresh'] = 'font-weight: bold;';
|
||||
$table->style['incremental'] = 'font-weight: bold;';
|
||||
$table->style['reset'] = 'font-weight: bold;';
|
||||
$table->style['snmp_address'] = 'font-weight: bold;';
|
||||
$table->style['snmp_community'] = 'font-weight: bold;';
|
||||
$table->style['snmp_oid'] = 'font-weight: bold;';
|
||||
$table->style['snmp_oid'] = 'font-weight: bold;';
|
||||
$table->data = [];
|
||||
|
||||
$graph_fields['cpu_load'] = __('%s Server CPU', get_product_name());
|
||||
|
@ -158,15 +108,22 @@ function pandora_realtime_graphs()
|
|||
$refresh = get_parameter('refresh', '1000');
|
||||
|
||||
if ($graph != 'snmp_module') {
|
||||
$data['graph'] = __('Graph').' ';
|
||||
$data['graph'] .= html_print_select(
|
||||
$graph_fields,
|
||||
'graph',
|
||||
$graph,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
$data['graph'] = html_print_label_input_block(
|
||||
__('Graph'),
|
||||
html_print_select(
|
||||
$graph_fields,
|
||||
'graph',
|
||||
$graph,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -179,18 +136,35 @@ function pandora_realtime_graphs()
|
|||
$agent_alias = io_safe_output(get_parameter('agent_alias', ''));
|
||||
$module_name = io_safe_output(get_parameter('module_name', ''));
|
||||
$module_incremental = get_parameter('incremental', 0);
|
||||
$data['module_info'] = $agent_alias.': <b>'.$module_name.'</b>';
|
||||
|
||||
// Append all the hidden in this cell.
|
||||
$data['module_info'] .= html_print_input_hidden(
|
||||
'incremental',
|
||||
$module_incremental,
|
||||
true
|
||||
$data['module_info'] = html_print_label_input_block(
|
||||
$agent_alias.': '.$module_name,
|
||||
html_print_input_hidden(
|
||||
'incremental',
|
||||
$module_incremental,
|
||||
true
|
||||
).html_print_select(
|
||||
['snmp_module' => '-'],
|
||||
'graph',
|
||||
'snmp_module',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%; display: none;'
|
||||
)
|
||||
);
|
||||
$data['module_info'] .= html_print_select(
|
||||
['snmp_module' => '-'],
|
||||
'graph',
|
||||
'snmp_module',
|
||||
}
|
||||
|
||||
$data['refresh'] = html_print_label_input_block(
|
||||
__('Refresh interval'),
|
||||
html_print_select(
|
||||
$refresh_fields,
|
||||
'refresh',
|
||||
$refresh,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
|
@ -199,33 +173,17 @@ function pandora_realtime_graphs()
|
|||
true,
|
||||
'',
|
||||
false,
|
||||
'display: none;'
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
if ($graph != 'snmp_module') {
|
||||
$data['incremental'] = html_print_label_input_block(
|
||||
__('Incremental'),
|
||||
html_print_checkbox_switch('incremental', 1, 0, true)
|
||||
);
|
||||
}
|
||||
|
||||
$data['refresh'] = __('Refresh interval').' ';
|
||||
$data['refresh'] .= html_print_select(
|
||||
$refresh_fields,
|
||||
'refresh',
|
||||
$refresh,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
if ($graph != 'snmp_module') {
|
||||
$data['incremental'] = __('Incremental').' ';
|
||||
$data['incremental'] .= html_print_checkbox('incremental', 1, 0, true);
|
||||
}
|
||||
|
||||
$data['reset'] = html_print_button(
|
||||
__('Clear graph'),
|
||||
'reset',
|
||||
false,
|
||||
'javascript:realtimeGraphs.clearGraph();',
|
||||
'class="sub delete mgn_tp_0" ',
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
|
||||
if ($graph == 'snmp_interface' || $graph == 'snmp_module') {
|
||||
|
@ -236,10 +194,79 @@ function pandora_realtime_graphs()
|
|||
html_print_input_hidden('rel_path', get_parameter('rel_path', ''));
|
||||
|
||||
// Print the form.
|
||||
echo '<form id="realgraph" method="post">';
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
$searchForm = '<form id="realgraph" method="post">';
|
||||
$searchForm .= html_print_table($table, true);
|
||||
$searchForm .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Clear graph'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'mode' => 'mini',
|
||||
'onClick' => 'javascript:realtimeGraphs.clearGraph();',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$searchForm .= '</form>';
|
||||
|
||||
ui_toggle(
|
||||
$searchForm,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
$chart[time()]['graph'] = '0';
|
||||
$canvas = '<div id="graph_container" class="graph_container">';
|
||||
$canvas .= '<div id="chartLegend" class="chartLegend"></div>';
|
||||
|
||||
$width = 800;
|
||||
$height = 300;
|
||||
|
||||
$data_array['realtime']['data'][0][0] = (time() - 10);
|
||||
$data_array['realtime']['data'][0][1] = 0;
|
||||
$data_array['realtime']['data'][1][0] = time();
|
||||
$data_array['realtime']['data'][1][1] = 0;
|
||||
$data_array['realtime']['color'] = 'green';
|
||||
|
||||
$params = [
|
||||
'agent_module_id' => false,
|
||||
'period' => 300,
|
||||
'width' => $width,
|
||||
'height' => $height,
|
||||
'only_image' => false,
|
||||
'type_graph' => 'area',
|
||||
'font' => $config['fontpath'],
|
||||
'font-size' => $config['font_size'],
|
||||
'array_data_create' => $data_array,
|
||||
'show_legend' => false,
|
||||
'show_menu' => false,
|
||||
'backgroundColor' => 'transparent',
|
||||
];
|
||||
|
||||
$canvas .= grafico_modulo_sparse($params);
|
||||
|
||||
$canvas .= '</div>';
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'white_box',
|
||||
'content' => $canvas,
|
||||
]
|
||||
);
|
||||
|
||||
// echo $canvas;
|
||||
// Define a custom action to save
|
||||
// the OID selected in the SNMP browser to the form.
|
||||
html_print_input_hidden(
|
||||
|
|
|
@ -12,6 +12,5 @@
|
|||
#graph_container {
|
||||
width: 800px;
|
||||
margin: 20px auto;
|
||||
background-color: white;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Resources exportation view.
|
||||
*
|
||||
* @category Extensions.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load global vars.
|
||||
if (isset($_GET['get_ptr'])) {
|
||||
if ($_GET['get_ptr'] == 1) {
|
||||
$ownDir = dirname(__FILE__).'/';
|
||||
|
@ -123,13 +139,6 @@ function output_xml_report($id)
|
|||
|
||||
$agent = null;
|
||||
switch (io_safe_output($item['type'])) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
break;
|
||||
|
||||
case 'simple_baseline_graph':
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 'custom_graph':
|
||||
case 'automatic_custom_graph':
|
||||
|
@ -169,30 +178,6 @@ function output_xml_report($id)
|
|||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 'max_value':
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 'min_value':
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
break;
|
||||
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
echo '<text><![CDATA['.io_safe_output($item['text'])."]]></text>\n";
|
||||
break;
|
||||
|
@ -224,18 +209,6 @@ function output_xml_report($id)
|
|||
echo '<group><![CDATA['.io_safe_output($group)."]]></group>\n";
|
||||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_agent':
|
||||
break;
|
||||
|
||||
case 'alert_report_group':
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
echo '<url><![CDATA['.io_safe_output($values['external_source']).']]></url>';
|
||||
break;
|
||||
|
@ -245,6 +218,29 @@ function output_xml_report($id)
|
|||
echo '<line_separator><![CDATA['.io_safe_output($item['line_separator']).']]></line_separator>';
|
||||
echo '<column_separator><![CDATA['.io_safe_output($item['header_definition']).']]></column_separator>';
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
case 'simple_baseline_graph':
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
case 8:
|
||||
case 'max_value':
|
||||
case 9:
|
||||
case 'min_value':
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
case 'event_report_module':
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
case 'alert_report_group':
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
}
|
||||
|
||||
echo "</item>\n";
|
||||
|
@ -417,25 +413,59 @@ function resource_exportation_extension_main()
|
|||
|
||||
$hook_enterprise = enterprise_include('extensions/resource_exportation/functions.php');
|
||||
|
||||
ui_print_page_header(__('Resource exportation'), 'images/extensions.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Resource exportation'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resource exporting'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
echo '<div class=notify>';
|
||||
echo __('This extension makes exportation of resource template more easy.').' '.__('You can export resource templates in .ptr format.');
|
||||
echo '</div>';
|
||||
|
||||
echo '<br /><br />';
|
||||
ui_print_warning_message(
|
||||
__('This extension makes exportation of resource template more easy.').'<br>'.__('You can export resource templates in .ptr format.')
|
||||
);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->style[0] = 'width: 30%;';
|
||||
$table->style[1] = 'width: 10%;';
|
||||
$table->class = 'databox filters';
|
||||
$table->data[0][0] = __('Report');
|
||||
$table->data[0][1] = html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true);
|
||||
$table->data[0][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', 'class="sub config"', true);
|
||||
$table->data[1][0] = __('Visual console');
|
||||
$table->data[1][1] = html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true);
|
||||
$table->data[1][2] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', 'class="sub config"', true);
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->id = 'resource_exportation_table';
|
||||
$table->style = [];
|
||||
$table->style[0] = 'width: 30%';
|
||||
$table->style[1] = 'vertical-align: bottom;';
|
||||
$table->data = [];
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Report'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex-content-left',
|
||||
'content' => html_print_select_from_sql('SELECT id_report, name FROM treport', 'report', '', '', '', 0, true),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[0][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'report\');', ['mode' => 'link'], true);
|
||||
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Visual console'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex-content-left',
|
||||
'content' => html_print_select_from_sql('SELECT id, name FROM tlayout', 'visual_console', '', '', '', 0, true),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[1][] = html_print_button(__('Export'), '', false, 'export_to_ptr(\'visual_console\');', ['mode' => 'link'], true);
|
||||
|
||||
if ($hook_enterprise === true) {
|
||||
add_rows_for_enterprise($table->data);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
// phpcs:disable Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps
|
||||
/**
|
||||
* Resource registration.
|
||||
*
|
||||
|
@ -14,7 +15,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -239,13 +240,6 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
}
|
||||
|
||||
switch ($item['type']) {
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
break;
|
||||
|
||||
case 'simple_baseline_graph':
|
||||
break;
|
||||
|
||||
case 2:
|
||||
case 'custom_graph':
|
||||
case 'automatic_custom_graph':
|
||||
|
@ -361,30 +355,6 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
}
|
||||
break;
|
||||
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
break;
|
||||
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
break;
|
||||
|
||||
case 8:
|
||||
case 'max_value':
|
||||
break;
|
||||
|
||||
case 9:
|
||||
case 'min_value':
|
||||
break;
|
||||
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
break;
|
||||
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
break;
|
||||
|
||||
case 'text':
|
||||
$values['text'] = io_safe_input($item['text']);
|
||||
break;
|
||||
|
@ -405,18 +375,6 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
$values['id_agent'] = db_get_value('id_grupo', 'tgrupo', 'nombre', io_safe_input($item->group));
|
||||
break;
|
||||
|
||||
case 'event_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_module':
|
||||
break;
|
||||
|
||||
case 'alert_report_agent':
|
||||
break;
|
||||
|
||||
case 'alert_report_group':
|
||||
break;
|
||||
|
||||
case 'url':
|
||||
$values['external_source'] = io_safe_input($item['url']);
|
||||
break;
|
||||
|
@ -426,9 +384,32 @@ function process_upload_xml_report($xml, $group_filter=0)
|
|||
$values['line_separator'] = io_safe_input($item['line_separator']);
|
||||
$values['column_separator'] = io_safe_input($item['column_separator']);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
case 'simple_graph':
|
||||
case 'simple_baseline_graph':
|
||||
case 6:
|
||||
case 'monitor_report':
|
||||
case 7:
|
||||
case 'avg_value':
|
||||
case 8:
|
||||
case 'max_value':
|
||||
case 9:
|
||||
case 'min_value':
|
||||
case 10:
|
||||
case 'sumatory':
|
||||
case 'event_report_module':
|
||||
case 'alert_report_module':
|
||||
case 'alert_report_agent':
|
||||
case 'alert_report_group':
|
||||
case 'agent_detailed_event':
|
||||
case 'event_report_agent':
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
}
|
||||
|
||||
if (empty($agents_item)) {
|
||||
if (empty($agents_item) === true) {
|
||||
$id_content = db_process_sql_insert('treport_content', $values);
|
||||
ui_print_result_message(
|
||||
$id_content,
|
||||
|
@ -782,7 +763,7 @@ function process_upload_xml_visualmap($xml, $filter_group=0)
|
|||
|
||||
function process_upload_xml_component($xml)
|
||||
{
|
||||
// Extract components
|
||||
// Extract components.
|
||||
$components = [];
|
||||
foreach ($xml->xpath('/component') as $componentElement) {
|
||||
$name = io_safe_input((string) $componentElement->name);
|
||||
|
@ -838,7 +819,7 @@ function process_upload_xml_component($xml)
|
|||
$idComponent = false;
|
||||
switch ((int) $componentElement->module_source) {
|
||||
case 1:
|
||||
// Local component
|
||||
// Local component.
|
||||
$values = [
|
||||
'description' => $description,
|
||||
'id_network_component_group' => $group,
|
||||
|
@ -854,12 +835,12 @@ function process_upload_xml_component($xml)
|
|||
// Network component
|
||||
// for modules
|
||||
// 15 = remote_snmp, 16 = remote_snmp_inc,
|
||||
// 17 = remote_snmp_string, 18 = remote_snmp_proc
|
||||
// 17 = remote_snmp_string, 18 = remote_snmp_proc.
|
||||
$custom_string_1 = '';
|
||||
$custom_string_2 = '';
|
||||
$custom_string_3 = '';
|
||||
if ($type >= 15 && $type <= 18) {
|
||||
// New support for snmp v3
|
||||
// New support for snmp v3.
|
||||
$tcp_send = $snmp_version;
|
||||
$plugin_user = $auth_user;
|
||||
$plugin_pass = $auth_password;
|
||||
|
@ -909,13 +890,13 @@ function process_upload_xml_component($xml)
|
|||
'post_process' => $post_process,
|
||||
]
|
||||
);
|
||||
if ((bool) $idComponent) {
|
||||
if ((bool) $idComponent === true) {
|
||||
$components[] = $idComponent;
|
||||
}
|
||||
break;
|
||||
|
||||
case 4:
|
||||
// Plugin component
|
||||
// Plugin component.
|
||||
$idComponent = network_components_create_network_component(
|
||||
$name,
|
||||
$type,
|
||||
|
@ -956,17 +937,13 @@ function process_upload_xml_component($xml)
|
|||
'post_process' => $post_process,
|
||||
]
|
||||
);
|
||||
if ((bool) $idComponent) {
|
||||
if ((bool) $idComponent === true) {
|
||||
$components[] = $idComponent;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Prediction component
|
||||
break;
|
||||
|
||||
case 6:
|
||||
// WMI component
|
||||
// WMI component.
|
||||
$idComponent = network_components_create_network_component(
|
||||
$name,
|
||||
$type,
|
||||
|
@ -1013,13 +990,17 @@ function process_upload_xml_component($xml)
|
|||
'post_process' => $post_process,
|
||||
]
|
||||
);
|
||||
if ((bool) $idComponent) {
|
||||
if ((bool) $idComponent === true) {
|
||||
$components[] = $idComponent;
|
||||
}
|
||||
break;
|
||||
|
||||
case 5:
|
||||
// Prediction component.
|
||||
case 7:
|
||||
// Web component
|
||||
// Web component.
|
||||
default:
|
||||
// Do nothing.
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1030,9 +1011,9 @@ function process_upload_xml_component($xml)
|
|||
);
|
||||
}
|
||||
|
||||
// Extract the template
|
||||
// Extract the template.
|
||||
$templateElement = $xml->xpath('//template');
|
||||
if (!empty($templateElement)) {
|
||||
if (empty($templateElement) === false) {
|
||||
$templateElement = $templateElement[0];
|
||||
|
||||
$templateName = (string) $templateElement->name;
|
||||
|
@ -1092,9 +1073,26 @@ function resource_registration_extension_main()
|
|||
include_once $config['homedir'].'/include/functions_db.php';
|
||||
enterprise_include_once('include/functions_local_components.php');
|
||||
|
||||
ui_print_page_header(__('Resource registration'), 'images/extensions.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Resource registration'),
|
||||
'images/extensions.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resource registration'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if (!extension_loaded('libxml')) {
|
||||
if (extension_loaded('libxml') === false) {
|
||||
ui_print_error_message(_('Error, please install the PHP libXML in the system.'));
|
||||
|
||||
return;
|
||||
|
@ -1119,15 +1117,42 @@ function resource_registration_extension_main()
|
|||
return;
|
||||
}
|
||||
|
||||
echo '<div class=notify>';
|
||||
echo __('This extension makes registering resource templates easier.').' '.__('Here you can upload a resource template in .ptr format.').' '.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__('You can get more resurces in our <a href="https://pandorafms.com/Library/Library/">Public Resource Library</a>');
|
||||
echo '</div>';
|
||||
ui_print_warning_message(
|
||||
__('This extension makes registering resource templates easier.').'<br>'.__('Here you can upload a resource template in .ptr format.').'<br>'.__('Please refer to our documentation for more information on how to obtain and use %s resources.', get_product_name()).' '.'<br> <br>'.__('You can get more resurces in our <a href="https://pandorafms.com/Library/Library/">Public Resource Library</a>')
|
||||
);
|
||||
|
||||
echo '<br /><br />';
|
||||
$table = new stdClass();
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->id = 'resource_registration_table';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('File to upload'),
|
||||
html_print_input_file('resource_upload', true)
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Group filter'),
|
||||
html_print_select_groups(false, 'AW', true, 'group', '', '', __('All'), 0, true)
|
||||
);
|
||||
|
||||
// Upload form.
|
||||
echo "<form name='submit_plugin' method='post' enctype='multipart/form-data'>";
|
||||
echo '<table class="databox" id="table1" width="98%" border="0" cellpadding="4" cellspacing="4">';
|
||||
echo '<form name="submit_plugin" method="POST" enctype="multipart/form-data">';
|
||||
html_print_table($table);
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Upload'),
|
||||
'upload',
|
||||
false,
|
||||
[ 'icon' => 'wand' ],
|
||||
true
|
||||
),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
echo '</form>';
|
||||
/*
|
||||
echo '<table class="databox" id="table1" width="98%" border="0" cellpadding="4" cellspacing="4">';
|
||||
echo '<tr>';
|
||||
echo "<td colspan='2' class='datos'><input type='file' name='resource_upload' accept='.ptr'/>";
|
||||
echo '<td>'.__('Group filter: ').'</td>';
|
||||
|
@ -1136,8 +1161,7 @@ function resource_registration_extension_main()
|
|||
echo '</td>';
|
||||
echo "<td class='datos'><input type='submit' class='sub next' value='".__('Upload')."' />";
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
echo '</table>';*/
|
||||
|
||||
if (isset($_FILES['resource_upload']['tmp_name']) === false) {
|
||||
return;
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
START TRANSACTION;
|
||||
|
||||
UPDATE tconfig_os SET `icon_name` = 'linux@os.svg' WHERE `id_os` = 1;
|
||||
UPDATE tconfig_os SET `icon_name` = 'solaris@os.svg' WHERE `id_os` = 2;
|
||||
UPDATE tconfig_os SET `icon_name` = 'aix@os.svg' WHERE `id_os` = 3;
|
||||
UPDATE tconfig_os SET `icon_name` = 'freebsd@os.svg' WHERE `id_os` = 4;
|
||||
UPDATE tconfig_os SET `icon_name` = 'HP@os.svg' WHERE `id_os` = 5;
|
||||
UPDATE tconfig_os SET `icon_name` = 'cisco@os.svg' WHERE `id_os` = 7;
|
||||
UPDATE tconfig_os SET `icon_name` = 'apple@os.svg' WHERE `id_os` = 8;
|
||||
UPDATE tconfig_os SET `icon_name` = 'windows@os.svg' WHERE `id_os` = 9;
|
||||
UPDATE tconfig_os SET `icon_name` = 'other-OS@os.svg' WHERE `id_os` = 10;
|
||||
UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 11;
|
||||
UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 12;
|
||||
UPDATE tconfig_os SET `icon_name` = 'network-server@os.svg' WHERE `id_os` = 13;
|
||||
UPDATE tconfig_os SET `icon_name` = 'embedded@os.svg' WHERE `id_os` = 14;
|
||||
UPDATE tconfig_os SET `icon_name` = 'android@os.svg' WHERE `id_os` = 15;
|
||||
UPDATE tconfig_os SET `icon_name` = 'vmware@os.svg' WHERE `id_os` = 16;
|
||||
UPDATE tconfig_os SET `icon_name` = 'routers@os.svg' WHERE `id_os` = 17;
|
||||
UPDATE tconfig_os SET `icon_name` = 'switch@os.svg' WHERE `id_os` = 18;
|
||||
UPDATE tconfig_os SET `icon_name` = 'satellite@os.svg' WHERE `id_os` = 19;
|
||||
UPDATE tconfig_os SET `icon_name` = 'mainframe@os.svg' WHERE `id_os` = 20;
|
||||
UPDATE tconfig_os SET `icon_name` = 'cluster@os.svg' WHERE `id_os` = 100;
|
||||
|
||||
UPDATE tgrupo SET `icon` = 'servers@groups.svg' WHERE `id_grupo` = 2;
|
||||
UPDATE tgrupo SET `icon` = 'firewall@groups.svg' WHERE `id_grupo` = 4;
|
||||
UPDATE tgrupo SET `icon` = 'database@groups.svg' WHERE `id_grupo` = 8;
|
||||
UPDATE tgrupo SET `icon` = 'network@groups.svg' WHERE `id_grupo` = 9;
|
||||
UPDATE tgrupo SET `icon` = 'unknown@groups.svg' WHERE `id_grupo` = 10;
|
||||
UPDATE tgrupo SET `icon` = 'workstation@groups.svg' WHERE `id_grupo` = 11;
|
||||
UPDATE tgrupo SET `icon` = 'applications@groups.svg' WHERE `id_grupo` = 12;
|
||||
UPDATE tgrupo SET `icon` = 'web@groups.svg' WHERE `id_grupo` = 13;
|
||||
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 1;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'generic-boolean@svg.svg' WHERE `id_tipo` = 2;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'generic-string@svg.svg' WHERE `id_tipo` = 3;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 4;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'data-server@svg.svg' WHERE `id_tipo` = 5;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-boolean-data@svg.svg' WHERE `id_tipo` = 6;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'ICMP-network-latency@svg.svg' WHERE `id_tipo` = 7;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-numeric-data@svg.svg' WHERE `id_tipo` = 8;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-boolean-data@svg.svg' WHERE `id_tipo` = 9;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 10;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'TCP-network-incremental-data@svg.svg' WHERE `id_tipo` = 11;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-numeric-data@svg.svg' WHERE `id_tipo` = 15;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 16;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-alphanumeric-data@svg.svg' WHERE `id_tipo` = 17;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'SNMP-network-incremental-data@svg.svg' WHERE `id_tipo` = 18;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 21;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 22;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'asynchronus-data@svg.svg' WHERE `id_tipo` = 23;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'wux@svg.svg' WHERE `id_tipo` = 25;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 30;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'web-analisys-data@svg.svg' WHERE `id_tipo` = 31;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 32;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 33;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-numeric-data@svg.svg' WHERE `id_tipo` = 34;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-boolean-data@svg.svg' WHERE `id_tipo` = 35;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-alphanumeric-data@svg.svg' WHERE `id_tipo` = 36;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'remote-execution-incremental-data@svg.svg' WHERE `id_tipo` = 37;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'server-web@svg.svg' WHERE `id_tipo` = 38;
|
||||
UPDATE `ttipo_modulo` SET `icon` = 'keepalive@svg.svg' WHERE `id_tipo` = 100;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `tagent_filter` (
|
||||
`id_filter` INT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`id_name` VARCHAR(600) NOT NULL,
|
||||
`id_group_filter` INT NOT NULL DEFAULT 0,
|
||||
`group_id` INT NOT NULL DEFAULT 0,
|
||||
`recursion` TEXT,
|
||||
`status` INT NOT NULL DEFAULT -1,
|
||||
`search` TEXT,
|
||||
`id_os` INT NOT NULL DEFAULT 0,
|
||||
`policies` TEXT,
|
||||
`search_custom` TEXT,
|
||||
`ag_custom_fields` TEXT,
|
||||
PRIMARY KEY (`id_filter`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=UTF8MB4;
|
||||
|
||||
CREATE TABLE `tevent_sound` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`name` TEXT NULL,
|
||||
`sound` TEXT NULL,
|
||||
`active` TINYINT NOT NULL DEFAULT '1',
|
||||
PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE INDEX agente_modulo_estado ON tevento (estado, id_agentmodule);
|
||||
CREATE INDEX idx_disabled ON talert_template_modules (disabled);
|
||||
|
||||
INSERT INTO `treport_custom_sql` (`name`, `sql`) VALUES ('Agent safe mode not enable', 'select alias from tagente where safe_mode_module = 0');
|
||||
|
||||
COMMIT;
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Custom fields first task.
|
||||
*
|
||||
* @category Custom Fields.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Opensource
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load globals.
|
||||
global $config;
|
||||
check_login();
|
||||
ui_require_css_file('first_task');
|
||||
|
@ -24,7 +40,7 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
|
|||
<?php echo html_print_image('images/first_task/icono_grande_reconserver.png', true, ['title' => __('Custom Fields')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Custom Fields'); ?></h3><p id="description_task">
|
||||
<h3> <?php echo __('Create Custom Fields'); ?></h3><p id="description_task">
|
||||
<?php
|
||||
echo __(
|
||||
"Custom fields are an easy way to personalized agent's information.
|
||||
|
@ -33,6 +49,20 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
|
|||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=gagente&sec2=godmode/agentes/configure_field" method="post">
|
||||
<?php
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Create Custom Fields'),
|
||||
'button_task',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
?>
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Custom Fields'); ?>" />
|
||||
</form>
|
||||
</div>
|
||||
|
|
|
@ -15,9 +15,6 @@ global $config;
|
|||
check_login();
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no custom graphs defined yet.') ]);
|
||||
?>
|
||||
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
|
@ -36,7 +33,17 @@ ui_print_info_message(['no_close' => true, 'message' => __('There are no custom
|
|||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder" method="post">
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Custom Graph'); ?>" />
|
||||
<?php
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create Custom Graph'),
|
||||
'button_task',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
|
@ -1,28 +1,38 @@
|
|||
<?php
|
||||
/**
|
||||
* Map builder First Task.
|
||||
*
|
||||
* @category Topology maps
|
||||
* @package Pandora FMS
|
||||
* @subpackage Visual consoles
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2007-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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;
|
||||
global $vconsoles_write;
|
||||
global $vconsoles_manage;
|
||||
check_login();
|
||||
ui_require_css_file('first_task');
|
||||
|
||||
ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
'message' => __('There are no visual console defined yet.'),
|
||||
]
|
||||
);
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
?>
|
||||
|
||||
|
@ -31,7 +41,7 @@ if ($vconsoles_write || $vconsoles_manage) {
|
|||
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Visual Console')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Visual Console'); ?></h3><p id="description_task">
|
||||
<h3> <?php echo __('Visual Consoles'); ?></h3><p id="description_task">
|
||||
<?php
|
||||
echo __(
|
||||
'%s allows users to create visual maps on which each user is able to create his or her '.'own monitoring map. The new visual console editor is much more practical, although the prior '."visual console editor had its advantages. On the new visual console, we've been successful in "."imitating the sensation and touch of a drawing application like GIMP. We've also simplified the "."editor by dividing it into several subject-divided tabs named 'Data', 'Preview', 'Wizard', 'List of "."Elements' and 'Editor'. The items the %s Visual Map was designed to handle are "."'static images', 'percentage bars', 'module graphs' and 'simple values'.",
|
||||
|
@ -41,8 +51,18 @@ if ($vconsoles_write || $vconsoles_manage) {
|
|||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder" method="post">
|
||||
<?php html_print_input_hidden('edit_layout', 1); ?>
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Visual Console'); ?>" />
|
||||
<?php
|
||||
html_print_input_hidden('edit_layout', 1);
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create a Visual Console'),
|
||||
'button_task',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Planned downtimes view
|
||||
*
|
||||
* @category Community
|
||||
* @package Pandora FMS
|
||||
* @subpackage Tools
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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();
|
||||
ui_require_css_file('first_task');
|
||||
|
@ -22,7 +38,7 @@ ui_require_css_file('first_task');
|
|||
<?php echo html_print_image('images/first_task/icono_grande_visualconsole.png', true, ['title' => __('Scehduled Downtime')]); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Scheduled Downtime'); ?></h3><p id="description_task">
|
||||
<h3> <?php echo __('Create Scheduled Downtime'); ?></h3><p id="description_task">
|
||||
<?php
|
||||
echo __(
|
||||
"%s contains a scheduled downtime management system.
|
||||
|
@ -34,7 +50,12 @@ ui_require_css_file('first_task');
|
|||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=extensions&sec2=godmode/agentes/planned_downtime.editor" method="post">
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Scheduled Downtime'); ?>" />
|
||||
<?php
|
||||
html_print_submit_button(
|
||||
__('Create Scheduled Downtime'),
|
||||
'button_task'
|
||||
);
|
||||
?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,29 +1,44 @@
|
|||
<?php
|
||||
/**
|
||||
* Services first task.
|
||||
*
|
||||
* @category Topology maps
|
||||
* @package Pandora FMS
|
||||
* @subpackage Services
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2007-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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();
|
||||
ui_require_css_file('first_task');
|
||||
?>
|
||||
<?php ui_print_info_message(['no_close' => true, 'message' => __('There are no services defined yet.') ]); ?>
|
||||
<?php if ((bool) $agent_w === true) { ?>
|
||||
<div class="new_task">
|
||||
<div class="image_task">
|
||||
<?php echo html_print_image('images/first_task/icono_grande_servicios.png', true, ['title' => __('Services')]); ?>
|
||||
<?php echo html_print_image('images/item-service.svg', true, ['title' => __('Services'), 'class' => 'w120px']); ?>
|
||||
</div>
|
||||
<div class="text_task">
|
||||
<h3> <?php echo __('Create Services'); ?></h3>
|
||||
<h3> <?php echo __('Services'); ?></h3>
|
||||
<p id="description_task">
|
||||
<?php
|
||||
echo __(
|
||||
|
@ -37,9 +52,18 @@ ui_require_css_file('first_task');
|
|||
?>
|
||||
</p>
|
||||
<form action="index.php?sec=estado&sec2=enterprise/godmode/services/services.service&action=new_service" method="post">
|
||||
<input type="submit" class="button_task" value="<?php echo __('Create Services'); ?>" />
|
||||
<?php
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create a service'),
|
||||
'button_task',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
)
|
||||
);
|
||||
?>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
|
|
|
@ -26,7 +26,7 @@ config_check();
|
|||
echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
||||
|
||||
?>
|
||||
<div id="header_table_inner">
|
||||
<div id="header_table_inner">
|
||||
<?php
|
||||
// ======= Notifications Discovery ===============================================
|
||||
$notifications_numbers = notifications_get_counters();
|
||||
|
@ -37,7 +37,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
// ======= Servers List ===============================================
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') !== false) {
|
||||
$servers_list = '<div id="servers_list">';
|
||||
$servers = [];
|
||||
$servers['all'] = (int) db_get_value('COUNT(id_server)', 'tserver');
|
||||
if ($servers['all'] != 0) {
|
||||
|
@ -45,22 +44,33 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$servers['down'] = ($servers['all'] - $servers['up']);
|
||||
if ($servers['up'] == 0) {
|
||||
// All Servers down or no servers at all.
|
||||
$servers_check_img = html_print_image('images/header_down_gray.png', true, ['alt' => 'cross', 'class' => 'bot', 'title' => __('All systems').': '.__('Down')]);
|
||||
$servers_check_img = html_print_image('images/system_error@header.svg', true, ['alt' => 'cross', 'class' => 'main_menu_icon bot', 'title' => __('All systems').': '.__('Down')]);
|
||||
} else if ($servers['down'] != 0) {
|
||||
// Some servers down.
|
||||
$servers_check_img = html_print_image('images/header_warning_gray.png', true, ['alt' => 'error', 'class' => 'bot', 'title' => $servers['down'].' '.__('servers down')]);
|
||||
$servers_check_img = html_print_image('images/system_warning@header.svg', true, ['alt' => 'error', 'class' => 'main_menu_icon bot', 'title' => $servers['down'].' '.__('servers down')]);
|
||||
} else {
|
||||
// All servers up.
|
||||
$servers_check_img = html_print_image('images/header_ready_gray.png', true, ['alt' => 'ok', 'class' => 'bot', 'title' => __('All systems').': '.__('Ready')]);
|
||||
$servers_check_img = html_print_image('images/system_ok@header.svg', true, ['alt' => 'ok', 'class' => 'main_menu_icon bot', 'title' => __('All systems').': '.__('Ready')]);
|
||||
}
|
||||
|
||||
unset($servers);
|
||||
// Since this is the header, we don't like to trickle down variables.
|
||||
$servers_check_img_link = '<a class="white" href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60">';
|
||||
$servers_check_img_link .= $servers_check_img;
|
||||
$servers_check_img_link .= '</a>';
|
||||
$servers_check_img_link = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gservers&sec2=godmode/servers/modificar_server&refr=60',
|
||||
'content' => $servers_check_img,
|
||||
],
|
||||
true
|
||||
);
|
||||
};
|
||||
$servers_list .= $servers_check_img_link.'</div>';
|
||||
|
||||
$servers_list = html_print_div(
|
||||
[
|
||||
'id' => 'servers_list',
|
||||
'content' => $servers_check_img_link,
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -71,9 +81,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
$check_minor_release_available = db_check_minor_relase_available();
|
||||
|
||||
if ($check_minor_release_available) {
|
||||
if ($check_minor_release_available === true) {
|
||||
if (users_is_admin($config['id_user'])) {
|
||||
if ($config['language'] == 'es') {
|
||||
if ($config['language'] === 'es') {
|
||||
set_pandora_error_for_header('Hay una o mas revisiones menores en espera para ser actualizadas. <a id="aviable_updates" target="blank" href="https://pandorafms.com/manual/es/documentation/02_installation/02_anexo_upgrade#version_70ng_rolling_release">'.__('Sobre actualización de revisión menor').'</a>', 'Revisión/es menor/es disponible/s');
|
||||
} else {
|
||||
set_pandora_error_for_header('There are one or more minor releases waiting for update. <a id="aviable_updates" target="blank" href="https://pandorafms.com/manual/en/documentation/02_installation/02_anexo_upgrade#version_70ng_rolling_release">'.__('About minor release update').'</a>', 'minor release/s available');
|
||||
|
@ -227,10 +237,10 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
if ($do_refresh) {
|
||||
$autorefresh_img = html_print_image(
|
||||
'images/header_refresh_gray.png',
|
||||
'images/auto_refresh@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'bot',
|
||||
'class' => 'main_menu_icon bot',
|
||||
'alt' => 'lightning',
|
||||
'title' => __('Configure autorefresh'),
|
||||
]
|
||||
|
@ -293,10 +303,10 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$display_counter = 'display:block';
|
||||
} else {
|
||||
$autorefresh_img = html_print_image(
|
||||
'images/header_refresh_disabled_gray.png',
|
||||
'images/auto_refresh@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'bot autorefresh_disabled invert_filter',
|
||||
'class' => 'main_menu_icon bot autorefresh_disabled invert_filter',
|
||||
'alt' => 'lightning',
|
||||
'title' => __('Disabled autorefresh'),
|
||||
]
|
||||
|
@ -312,10 +322,10 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
}
|
||||
} else {
|
||||
$autorefresh_img = html_print_image(
|
||||
'images/header_refresh_disabled_gray.png',
|
||||
'images/auto_refresh@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'bot autorefresh_disabled invert_filter',
|
||||
'class' => 'main_menu_icon bot autorefresh_disabled invert_filter',
|
||||
'alt' => 'lightning',
|
||||
'title' => __('Disabled autorefresh'),
|
||||
]
|
||||
|
@ -350,9 +360,10 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$header_feedback .= '<div id="modal-feedback-form" class="invisible"></div>';
|
||||
$header_feedback .= '<div id="msg-header" class="invisible"></div>';
|
||||
$header_feedback .= html_print_image(
|
||||
'images/feedback-header.png',
|
||||
'images/send_feedback@header.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'title' => __('Feedback'),
|
||||
'id' => 'feedback-header',
|
||||
'alt' => __('Feedback'),
|
||||
|
@ -373,11 +384,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$header_support = '<div id="header_support">';
|
||||
$header_support .= '<a href="'.ui_get_full_external_url($header_support_link).'" target="_blank">';
|
||||
$header_support .= html_print_image(
|
||||
'images/header_support.png',
|
||||
'images/support@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Go to support'),
|
||||
'class' => 'bot invert_filter',
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
|
@ -387,11 +398,11 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
$header_docu = '<div id="header_docu">';
|
||||
$header_docu .= '<a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">';
|
||||
$header_docu .= html_print_image(
|
||||
'images/header_docu.png',
|
||||
'images/documentation@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Go to documentation'),
|
||||
'class' => 'bot invert_filter',
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
|
@ -399,34 +410,38 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
|
|||
|
||||
|
||||
// User.
|
||||
if (is_user_admin($config['id_user']) == 1) {
|
||||
$header_user = html_print_image(
|
||||
'images/header_user_admin_green.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit my user'),
|
||||
'class' => 'bot',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
$header_user = html_print_image(
|
||||
'images/header_user_green.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit my user'),
|
||||
'class' => 'bot',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
}
|
||||
// $headerUserImage = (is_user_admin($config['id_user']) === true) ? 'images/header_user_admin_green.png' : 'images/header_user_green.png';
|
||||
$headerUser = [];
|
||||
$headerUser[] = html_print_image(
|
||||
'images/edit_user@header.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit my user'),
|
||||
'class' => 'main_menu_icon bot invert_filter',
|
||||
'alt' => 'user',
|
||||
]
|
||||
);
|
||||
|
||||
$header_user = '<div id="header_user"><a href="index.php?sec=workspace&sec2=operation/users/user_edit">'.$header_user.'<span id="user_name_header"> ('.$config['id_user'].')</span></a></div>';
|
||||
$headerUser[] = sprintf('<span id="user_name_header">[ %s ]</span>', $config['id_user']);
|
||||
|
||||
$header_user = html_print_div(
|
||||
[
|
||||
'id' => 'header_user',
|
||||
'content' => html_print_anchor(
|
||||
[
|
||||
'href' => sprintf('index.php?sec=gusuarios&sec2=godmode/users/configure_user&edit_user=1&pure=0&id_user=%s', $config['id_user']),
|
||||
'content' => implode('', $headerUser),
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Logout.
|
||||
$header_logout = '<div id="header_logout"><a class="white" href="'.ui_get_full_url('index.php?bye=bye').'">';
|
||||
$header_logout .= html_print_image(
|
||||
'images/header_logout_gray.png',
|
||||
'images/sign_out@header.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Logout'),
|
||||
|
|
|
@ -30,16 +30,21 @@ require_once __DIR__.'/../include/functions_html.php';
|
|||
|
||||
if ($config['visual_animation']) {
|
||||
echo '<style>
|
||||
@keyframes login_move {
|
||||
from {margin-left: 10%;margin-right: 10%;opacity:0.1}
|
||||
to {margin-left: 5%;margin-right: 5%;opacity:1}
|
||||
}
|
||||
|
||||
|
||||
div.container_login{
|
||||
animation-name: login_move;
|
||||
animation-duration: 3s;
|
||||
}
|
||||
div.container_login {
|
||||
animation: container_login 3s ease;
|
||||
}
|
||||
|
||||
@keyframes container_login {
|
||||
0% {
|
||||
transform: scale(.9);
|
||||
opacity: 0.1;
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
@ -87,18 +92,36 @@ if (!empty($page) && !empty($sec)) {
|
|||
}
|
||||
|
||||
$login_body_style = '';
|
||||
$login_body_class = '';
|
||||
// Overrides the default background with the defined by the user.
|
||||
if (!empty($config['login_background'])) {
|
||||
$background_url = 'images/backgrounds/background_pandora_console_keys.jpg';
|
||||
|
||||
if (empty($config['random_background']) === false) {
|
||||
$random_backgrounds = scandir($config['homedir'].'/images/backgrounds/random_backgrounds');
|
||||
unset($random_backgrounds[0], $random_backgrounds[1]);
|
||||
$random_background = array_rand($random_backgrounds);
|
||||
$background_url = 'images/backgrounds/random_backgrounds/'.$random_backgrounds[$random_background];
|
||||
$background_100 = 'background-size: 100% 100% !important; ';
|
||||
}
|
||||
|
||||
if (empty($config['login_background']) === false) {
|
||||
$background_url = 'images/backgrounds/'.$config['login_background'];
|
||||
$login_body_style = "style=\"background-size: 100% 100% !important;background:linear-gradient(74deg, rgba(2, 2, 2, 0.333) 36%, transparent 36%), url('".$background_url."');\"";
|
||||
$background_100 = 'background-size: 100% 100% !important; ';
|
||||
}
|
||||
|
||||
// Support for Internet Explorer and Microsoft Edge browsers
|
||||
if (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') !== false || strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') !== false) {
|
||||
$login_body_class = "class='login_body_trident'";
|
||||
$background_url = 'images/backgrounds/background_pandora_console_keys.jpg';
|
||||
$background_100 = '';
|
||||
}
|
||||
|
||||
if (empty($config['background_opacity']) === false) {
|
||||
$opacity = $config['background_opacity'];
|
||||
} else {
|
||||
$opacity = 30;
|
||||
}
|
||||
|
||||
$login_body_style = 'style="'.$background_100.'background: linear-gradient(rgba(0,0,0,.'.$opacity.'), rgba(0,0,0,.'.$opacity.")), url('".$background_url."');\"";
|
||||
|
||||
// Get alternative custom in case of db fail.
|
||||
$custom_fields = [
|
||||
'custom_logo_login',
|
||||
|
@ -123,36 +146,36 @@ foreach ($custom_fields as $field) {
|
|||
// Get the custom icons.
|
||||
$docs_logo = ui_get_docs_logo();
|
||||
$support_logo = ui_get_support_logo();
|
||||
echo '<div id="login_body" '.$login_body_class.' '.$login_body_style.'>';
|
||||
echo '<div id="login_body" '.$login_body_style.'>';
|
||||
echo '<div id="header_login">';
|
||||
|
||||
echo '<div id="list_icon_docs_support"><ul>';
|
||||
|
||||
if (isset($config['custom_docs_url'])) {
|
||||
if ($docs_logo !== false) {
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
echo '<li id="li_margin_doc_img"><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Docs').'</li>';
|
||||
echo '<li id="li_margin_doc"><a href="'.ui_get_full_external_url($config['custom_docs_url']).'" target="_blank">'.__('Docs').'</li>';
|
||||
} else if (!$custom_conf_enabled) {
|
||||
echo '<li><a href="https://pandorafms.com/manual/" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
echo '<li><a href="https://pandorafms.com/manual/" target="_blank">'.__('Docs').'</li>';
|
||||
echo '<li id="li_margin_doc_img"><a href="https://pandorafms.com/manual/" target="_blank"><img src="'.$docs_logo.'" alt="docs"></a></li>';
|
||||
echo '<li id="li_margin_doc"><a href="https://pandorafms.com/manual/" target="_blank">'.__('Docs').'</li>';
|
||||
}
|
||||
|
||||
if (isset($config['custom_support_url'])) {
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if ($support_logo !== false) {
|
||||
echo '<li id="li_margin_left"><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li id="li_margin_support_img"><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
}
|
||||
|
||||
echo '<li><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank">'.__('Support').'</li>';
|
||||
echo '<li id="li_margin_support"><a href="'.ui_get_full_external_url($config['custom_support_url']).'" target="_blank">'.__('Support').'</li>';
|
||||
} else {
|
||||
echo '<li id="li_margin_left"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li>'.__('Support').'</li>';
|
||||
echo '<li id="li_margin_support_img"><a href="https://pandorafms.com/monitoring-services/support/" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li id="li_margin_support"><a href="https://support.pandorafms.com" target="_blank">'.__('Support').'</a></li>';
|
||||
}
|
||||
} else if (!$custom_conf_enabled) {
|
||||
echo '<li id="li_margin_left"><a href="https://support.pandorafms.com" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li><a href="https://support.pandorafms.com" target="_blank">'.__('Docs').'</li>';
|
||||
echo '<li id="li_margin_support_img"><a href="https://support.pandorafms.com" target="_blank"><img src="'.$support_logo.'" alt="support"></a></li>';
|
||||
echo '<li id="li_margin_support"><a href="https://support.pandorafms.com" target="_blank">'.__('Support').'</a></li>';
|
||||
}
|
||||
|
||||
echo '</ul></div>';
|
||||
|
@ -248,15 +271,30 @@ switch ($login_screen) {
|
|||
echo '</div>';
|
||||
|
||||
echo '<div id="log_button" class="login_button invisible">';
|
||||
html_print_submit_button(__('Login as admin'), 'login_button', false, 'class="next_login"');
|
||||
html_print_submit_button(__('Login as admin'), 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_button" id="remove_button">';
|
||||
echo '<input type="button" id="input_saml" value="Login as admin" onclick="show_normal_menu()">';
|
||||
html_print_submit_button(
|
||||
__('Login as admin'),
|
||||
'input_saml',
|
||||
false,
|
||||
[
|
||||
'fixed_id' => 'submit-login_button',
|
||||
'class' => 'next_login',
|
||||
'onclick' => 'show_normal_menu()',
|
||||
'id' => 'input_saml',
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="login_button login_button_saml">';
|
||||
html_print_submit_button(__('Login with SAML'), 'login_button_saml', false, '');
|
||||
html_print_submit_button(
|
||||
__('Login with SAML'),
|
||||
'login_button_saml',
|
||||
false,
|
||||
['class' => 'next_login secondary']
|
||||
);
|
||||
echo '</div>';
|
||||
} else {
|
||||
echo '<div class="login_nick">';
|
||||
|
@ -288,7 +326,15 @@ switch ($login_screen) {
|
|||
);
|
||||
echo '</div>';
|
||||
echo '<div class="login_button">';
|
||||
html_print_submit_button(__('Login'), 'login_button', false, 'class="next_login"');
|
||||
html_print_submit_button(
|
||||
__('Login'),
|
||||
'login_button',
|
||||
false,
|
||||
[
|
||||
'fixed_id' => 'submit-login_button',
|
||||
'icon' => 'signin',
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
}
|
||||
break;
|
||||
|
@ -302,12 +348,13 @@ switch ($login_screen) {
|
|||
|
||||
echo '<div class="login_nick">';
|
||||
echo '<div>';
|
||||
html_print_image('/images/icono_autenticacion.png', false);
|
||||
|
||||
echo '</div>';
|
||||
html_print_input_text_extended('auth_code', '', 'auth_code', '', '', '', false, '', 'class="login login_password" placeholder="'.__('Authentication code').'"', false, true);
|
||||
echo '</div>';
|
||||
echo '<div class="login_button">';
|
||||
html_print_submit_button(__('Check code').' >', 'login_button', false, 'class="next_login"');
|
||||
// html_print_submit_button(__('Check code').' >', 'login_button', false, 'class="next_login"');
|
||||
html_print_submit_button(__('Check code').' >', 'login_button', false, [ 'fixed_id' => 'submit-login_button', 'class' => 'next_login']);
|
||||
echo '</div>';
|
||||
break;
|
||||
|
||||
|
@ -337,17 +384,18 @@ if ($config['enterprise_installed']) {
|
|||
echo '<a href="javascript:centralized_mode_reset_dialog();">'.__('Forgot your password?');
|
||||
echo '</a>';
|
||||
|
||||
echo '<div id="centralized_mode_reset_dialog" title="'.__('Password reset').'" style="display:none">';
|
||||
echo '<div id="centralized_mode_reset_dialog" title="'.__('Centralized mode').'" style="display:none">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
echo html_print_image('images/icono_stop.png', true, ['alt' => __('Password reset'), 'border' => 0]);
|
||||
echo html_print_image('images/icono_stop.png', true, ['alt' => __('Centralized mode'), 'border' => 0]);
|
||||
echo '</div>';
|
||||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<p>'.__('This node is configured with centralized mode. Go to metaconsole to reset the password').'</p>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'centralized_mode_reset_button', false);
|
||||
html_print_submit_button('Ok', 'centralized_mode_reset_button', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -358,6 +406,16 @@ if ($config['enterprise_installed']) {
|
|||
}
|
||||
}
|
||||
|
||||
echo '
|
||||
<div class="loader" id="spinner_login">
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
<span></span>
|
||||
</div>
|
||||
';
|
||||
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
|
||||
|
||||
// CSRF validation.
|
||||
if (isset($_SESSION['csrf_code']) === true) {
|
||||
unset($_SESSION['csrf_code']);
|
||||
|
@ -368,7 +426,7 @@ html_print_csrf_hidden();
|
|||
echo '</form></div>';
|
||||
echo '<div class="login_data">';
|
||||
echo '<div class ="text_banner_login">';
|
||||
echo '<div><span class="span1 pandora_upper">';
|
||||
echo '<div><span class="span1">';
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if ($config['custom_title1_login']) {
|
||||
echo io_safe_output($config['custom_title1_login']);
|
||||
|
@ -395,7 +453,7 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
|||
echo '</div>';
|
||||
echo '<div class ="img_banner_login">';
|
||||
if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
||||
if (isset($config['custom_splash_login'])) {
|
||||
if (empty($config['custom_splash_login']) === false && $config['custom_splash_login'] !== 'default') {
|
||||
html_print_image(
|
||||
'enterprise/images/custom_splash_login/'.$config['custom_splash_login'],
|
||||
false,
|
||||
|
@ -407,25 +465,39 @@ if (file_exists(ENTERPRISE_DIR.'/load_enterprise.php')) {
|
|||
false
|
||||
);
|
||||
} else {
|
||||
html_print_image(
|
||||
'enterprise/images/custom_splash_login/splash_image_default.png',
|
||||
false,
|
||||
[
|
||||
'alt' => 'logo',
|
||||
'border' => 0,
|
||||
],
|
||||
false,
|
||||
false
|
||||
);
|
||||
echo '
|
||||
<div class="loginimg-container">
|
||||
<div class="lineone"></div>
|
||||
<div class="linetwo"></div>
|
||||
<div class="linethree"></div>
|
||||
<div style="display:flex;">
|
||||
<div class="towerone"></div>
|
||||
<div class="towertwo"></div>
|
||||
<div class="towerthree"></div>
|
||||
<div class="towerfour"></div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
} else {
|
||||
html_print_image('images/splash_image_default.png', false, ['alt' => 'logo', 'border' => 0], false, true);
|
||||
echo '
|
||||
<div class="loginimg-container">
|
||||
<div class="lineone"></div>
|
||||
<div class="linetwo"></div>
|
||||
<div class="linethree"></div>
|
||||
<div style="display:flex;">
|
||||
<div class="towerone"></div>
|
||||
<div class="towertwo"></div>
|
||||
<div class="towerthree"></div>
|
||||
<div class="towerfour"></div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '<div id="ver_num">'.$pandora_version.(($develop_bypass == 1) ? ' '.__('Build').' '.$build_version : '').'</div>';
|
||||
echo '</div>';
|
||||
|
||||
if (empty($process_error_message) && isset($mail)) {
|
||||
|
@ -439,25 +511,28 @@ if (empty($process_error_message) && isset($mail)) {
|
|||
echo '<h1>'.__('INFO').'</h1>';
|
||||
echo '<p>'.__('An email has been sent to your email address').'</p>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'reset_correct_button', false);
|
||||
html_print_submit_button('Ok', 'reset_correct_button', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
} else if (isset($process_error_message) && !empty($process_error_message)) {
|
||||
echo '<div id="reset_correct" title="'.__('Password reset').'">';
|
||||
echo '<div id="reset_correct" title="'.__('Error').'">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
echo html_print_image('images/icono_stop.png', true, ['alt' => __('Password reset'), 'border' => 0]);
|
||||
echo html_print_image('images/icono_stop.png', true, ['alt' => __('Forbidden'), 'border' => 0]);
|
||||
echo '</div>';
|
||||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<h1>'.__('ERROR').'</h1>';
|
||||
echo '<p>'.$process_error_message.'</p>';
|
||||
echo '<br>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'reset_correct_button', false);
|
||||
html_print_submit_button('Ok', 'reset_correct_button', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -476,8 +551,9 @@ if (isset($correct_reset_pass_process)) {
|
|||
echo '<h1>'.__('SUCCESS').'</h1>';
|
||||
echo '<p>'.$correct_reset_pass_process.'</p>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'final_process_correct_button', false);
|
||||
html_print_submit_button('Ok', 'final_process_correct_button', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -485,9 +561,36 @@ if (isset($correct_reset_pass_process)) {
|
|||
}
|
||||
|
||||
if (isset($login_failed)) {
|
||||
$nick = get_parameter_post('nick');
|
||||
$fails = db_get_value('failed_attempt', 'tusuario', 'id_user', $nick);
|
||||
$nick = io_safe_input(get_parameter_post('nick'));
|
||||
$user_in_db = db_get_row_filter(
|
||||
'tusuario',
|
||||
['id_user' => $nick],
|
||||
'*'
|
||||
);
|
||||
$fails = $user_in_db['failed_attempt'];
|
||||
// If user not exist, and attempts its enable, lets make array and fails attemps.
|
||||
if ($fails == false && $config['enable_pass_policy'] && $user_in_db === false) {
|
||||
$nick_array_error = json_decode(base64_decode($config['nicks_error']), true);
|
||||
$nick = strtolower($nick);
|
||||
if (isset($nick_array_error[$nick]) !== false) {
|
||||
$nick_array_error[$nick] += 1;
|
||||
} else {
|
||||
$nick_array_error[$nick] = 1;
|
||||
}
|
||||
|
||||
$fails = $nick_array_error[$nick];
|
||||
// Save or update the array.
|
||||
if ($config['nicks_error']) {
|
||||
config_update_value('nicks_error', base64_encode(json_encode($nick_array_error)));
|
||||
} else {
|
||||
config_create_value('nicks_error', base64_encode(json_encode($nick_array_error)));
|
||||
}
|
||||
} else {
|
||||
$fails = ++$fails;
|
||||
}
|
||||
|
||||
$attemps = ($config['number_attempts'] - $fails);
|
||||
$attemps = ($attemps < 0) ? 0 : $attemps;
|
||||
echo '<div id="login_failed" title="'.__('Login failed').'">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
|
@ -500,12 +603,18 @@ if (isset($login_failed)) {
|
|||
echo '</div>';
|
||||
if ($config['enable_pass_policy']) {
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<p><strong>Remaining attempts: '.$attemps.'</strong></p>';
|
||||
if ($attemps !== 0 && $user_in_db['login_blocked'] == 0) {
|
||||
echo '<p><strong>'.__('Remaining attempts: ').$attemps.'</strong></p>';
|
||||
} else {
|
||||
echo '<p><strong>'.__('User is blocked').'</strong></p>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-error', false);
|
||||
html_print_submit_button('Ok', 'hide-login-error', false, ['class' => ' mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -528,8 +637,9 @@ if ($login_screen == 'logout') {
|
|||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false);
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false, ['class' => ' mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -547,8 +657,9 @@ if ($login_screen === 'disabled_access_node') {
|
|||
echo '<h1>'.__('Centralized user in metaconsole').'</h1>';
|
||||
echo '<p>'.__('This user does not have access on node, please enable node access on this user from metaconsole.').'</p>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false);
|
||||
html_print_submit_button('Ok', 'hide-login-logout', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -655,8 +766,9 @@ if ($login_screen == 'error_authconfig' || $login_screen == 'error_emptyconfig'
|
|||
echo '<h1>'.$title.'</h1>';
|
||||
echo '<p> '.$message.'</h1>';
|
||||
echo '</div>';
|
||||
echo '<br>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button('Ok', 'hide-login-error', false);
|
||||
html_print_submit_button('Ok', 'hide-login-error', false, ['class' => 'mini float-right']);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
|
@ -711,7 +823,7 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-error").click (function () {
|
||||
$("#button-hide-login-error").click (function () {
|
||||
$("#modal_alert" ).dialog('close');
|
||||
|
||||
});
|
||||
|
@ -726,19 +838,23 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
},
|
||||
open: function (event, ui) {
|
||||
$(".ui-widget-overlay").click(function () {
|
||||
$('#login_logout').dialog('close');
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-logout").click (function () {
|
||||
document.location = "<?php echo ui_get_full_url('index.php'); ?>";
|
||||
});
|
||||
$("#button-hide-login-logout").click (function () {
|
||||
$( "#login_logout" ).dialog( "close" );
|
||||
});
|
||||
});
|
||||
break;
|
||||
|
||||
|
@ -749,7 +865,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
|
@ -759,7 +874,7 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-logout").click (function () {
|
||||
$("#button-hide-login-logout").click (function () {
|
||||
document.location = "<?php echo ui_get_full_url('index.php'); ?>";
|
||||
});
|
||||
});
|
||||
|
@ -773,7 +888,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 400,
|
||||
width: 700,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
|
@ -791,8 +905,8 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
height: 230,
|
||||
width: 530,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
|
@ -800,12 +914,11 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
});
|
||||
|
||||
$("#submit-hide-login-error").click (function () {
|
||||
$("#button-hide-login-error").click (function () {
|
||||
$("#login_failed" ).dialog('close');
|
||||
$("#login_correct_pass").dialog('close');
|
||||
});
|
||||
});
|
||||
|
||||
$('#nick').focus();
|
||||
break;
|
||||
}
|
||||
|
@ -816,7 +929,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
|
@ -826,7 +938,7 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
});
|
||||
|
||||
$("#submit-reset_correct_button").click (function () {
|
||||
$("#button-reset_correct_button").click (function () {
|
||||
$("#reset_correct").dialog('close');
|
||||
});
|
||||
});
|
||||
|
@ -837,7 +949,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
|
@ -857,7 +968,6 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
height: 220,
|
||||
width: 528,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
|
@ -870,5 +980,18 @@ html_print_div(['id' => 'forced_title_layer', 'class' => 'forced_title_layer', '
|
|||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#submit-login_button span').removeAttr('style');
|
||||
$('#spinner_login').hide();
|
||||
});
|
||||
|
||||
$('#submit-login_button').click(function (e) {
|
||||
$('.login_nick').hide();
|
||||
$('.login_pass').hide();
|
||||
$('.login_button').hide();
|
||||
$('.reset_password').hide();
|
||||
$('#spinner_login').show();
|
||||
});
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
|
|
@ -124,8 +124,14 @@ foreach ($stats as $stat) {
|
|||
}
|
||||
|
||||
$status .= '</table>';
|
||||
$table->rowclass = [];
|
||||
$table->rowclass[0] = 'w100p';
|
||||
$table->rowclass[1] = 'w100p';
|
||||
$table->rowclass[2] = 'w100p';
|
||||
$table->rowclass[3] = 'w100p';
|
||||
$table->rowclass[4] = 'w100p';
|
||||
$table->rowclass[5] = 'w100p';
|
||||
$table->data[0][0] = $status;
|
||||
$table->rowclass[] = '';
|
||||
|
||||
$table->data[] = $tdata;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -26,38 +26,21 @@
|
|||
* ============================================================================
|
||||
*/
|
||||
|
||||
use function PHPSTORM_META\map;
|
||||
|
||||
// Begin.
|
||||
if (isset($config['id_user']) === false) {
|
||||
include 'general/login_page.php';
|
||||
exit();
|
||||
}
|
||||
|
||||
?>
|
||||
<script type="text/javascript" language="javascript">
|
||||
require_once 'include/functions_menu.php';
|
||||
|
||||
$(document).ready(function(){
|
||||
var menuType_value = "<?php echo ($_SESSION['menu_type'] ?? ''); ?>";
|
||||
// Global variable. Do not delete.
|
||||
$tab_active = '';
|
||||
|
||||
if (menuType_value === '' || menuType_value === 'classic') {
|
||||
$('ul.submenu').css('left', '214px');
|
||||
}
|
||||
else{
|
||||
$('ul.submenu').css('left', '59px');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
<?php
|
||||
$autohidden_menu = 0;
|
||||
|
||||
if (isset($config['autohidden_menu']) === true && (bool) $config['autohidden_menu'] === true) {
|
||||
$autohidden_menu = 1;
|
||||
}
|
||||
|
||||
// Start of full lateral menu.
|
||||
echo sprintf('<div id="menu_full" class="menu_full_%s">', $menuTypeClass);
|
||||
|
||||
$url_logo = ui_get_full_url('index.php');
|
||||
if (is_reporting_console_node() === true) {
|
||||
$url_logo = 'index.php?logged=1&sec=discovery&sec2=godmode/servers/discovery&wiz=tasklist';
|
||||
|
@ -76,311 +59,400 @@ html_print_div(
|
|||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
).'<div id="button_collapse" class="button_'.$menuTypeClass.'" style="cursor: pointer"></div>',
|
||||
]
|
||||
);
|
||||
|
||||
require 'operation/menu.php';
|
||||
require 'godmode/menu.php';
|
||||
$display_classic = '';
|
||||
$display_collapsed = 'display: none;';
|
||||
if ($menuTypeClass === 'collapsed') {
|
||||
$display_classic = 'display: none;';
|
||||
$display_collapsed = '';
|
||||
}
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'id' => 'button_collapse',
|
||||
'class' => sprintf('button_collapse button_%s', $menuTypeClass),
|
||||
]
|
||||
);
|
||||
|
||||
// Tabs.
|
||||
echo '<div id="menu_tabs">';
|
||||
// Tabs classic.
|
||||
echo '<ul class="tabs_ul" style="'.$display_classic.'">';
|
||||
echo '<li id="tab_display" class="tabs_li"><span>'.__('Operation').'</span></a></li>';
|
||||
echo '<li id="tab_management" class="tabs_li"><span>'.__('Management').'</span></a></li>';
|
||||
echo '</ul>';
|
||||
echo '<div class="div_border_line" style="'.$display_classic.'"><div id="tab_line_1" class="border_line"></div><div id="tab_line_2" class="border_line"></div></div>';
|
||||
// Tabs collapse.
|
||||
echo '<div class="tabs_collapsed" style="'.$display_collapsed.'">';
|
||||
echo '<div class="tabs_collapsed_container">';
|
||||
echo '<div id="tab_collapsed_display" class="tabs_collapsed_div" title="'.__('Operation').'"><div class="tabs_collapsed_display"></div></div>';
|
||||
echo '<div id="tab_collapsed_management" class="tabs_collapsed_div" title="'.__('Management').'"><div class="tabs_collapsed_management"></div></div>';
|
||||
echo '</div></div>';
|
||||
|
||||
echo '</div>';
|
||||
// Menu_container.
|
||||
ui_require_jquery_file('cookie');
|
||||
|
||||
$config_fixed_header = false;
|
||||
if (isset($config['fixed_header']) === true) {
|
||||
$config_fixed_header = $config['fixed_header'];
|
||||
}
|
||||
echo '<div id="div_display">';
|
||||
require 'operation/menu.php';
|
||||
echo '</div>';
|
||||
echo '<div id="div_management">';
|
||||
require 'godmode/menu.php';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
/* <![CDATA[ */
|
||||
|
||||
$('#button_collapse').on('click', function() {
|
||||
|
||||
if($('#menu_full').hasClass('menu_full_classic')){
|
||||
localStorage.setItem("menuType", "collapsed");
|
||||
$('ul.submenu').css('left', '59px');
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
menuType: menuType_val,
|
||||
page: "include/functions_menu"
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
}
|
||||
else if($('#menu_full').hasClass('menu_full_collapsed')){
|
||||
localStorage.setItem("menuType", "classic");
|
||||
$('ul.submenu').css('left', '214px');
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
menuType: menuType_val,
|
||||
page: "include/functions_menu"
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
}
|
||||
|
||||
$('.logo_full').toggle();
|
||||
$('.logo_icon').toggle();
|
||||
$('#menu_full').toggleClass('menu_full_classic menu_full_collapsed');
|
||||
$('#button_collapse').toggleClass('button_classic button_collapsed');
|
||||
$('div#title_menu').toggleClass('title_menu_classic title_menu_collapsed');
|
||||
$('div#page').toggleClass('page_classic page_collapsed');
|
||||
$('#header_table').toggleClass('header_table_classic header_table_collapsed');
|
||||
$('li.menu_icon').toggleClass("no_hidden_menu menu_icon_collapsed");
|
||||
});
|
||||
|
||||
|
||||
var autohidden_menu = <?php echo $autohidden_menu; ?>;
|
||||
var fixed_header = <?php echo json_encode((bool) $config_fixed_header); ?>;
|
||||
var id_user = "<?php echo $config['id_user']; ?>";
|
||||
var cookie_name = id_user + '-pandora_menu_state';
|
||||
var cookie_name_encoded = btoa(cookie_name);
|
||||
var click_display = "<?php echo $config['click_display']; ?>";
|
||||
|
||||
|
||||
var menuState = $.cookie(cookie_name_encoded);
|
||||
if (!menuState) {
|
||||
menuState = {};
|
||||
}
|
||||
else {
|
||||
menuState = JSON.parse(menuState);
|
||||
open_submenus();
|
||||
}
|
||||
|
||||
function open_submenus () {
|
||||
$.each(menuState, function (index, value) {
|
||||
if (value)
|
||||
$('div.menu>ul>li#' + index + '>ul').show();
|
||||
});
|
||||
//$('div.menu>ul>li.selected>ul').removeClass('invisible');
|
||||
}
|
||||
|
||||
function close_submenus () {
|
||||
$.each(menuState, function (index, value) {
|
||||
if (value)
|
||||
$('div.menu>ul>li#' + index + '>ul').hide();
|
||||
});
|
||||
//$('div.menu>ul>li.selected>ul').addClass('invisible');
|
||||
}
|
||||
|
||||
|
||||
/* ]]> */
|
||||
</script>
|
||||
|
||||
<script type="text/javascript">
|
||||
openTime = 0;
|
||||
openTime2 = 0;
|
||||
handsIn = 0;
|
||||
handsIn2 = 0;
|
||||
|
||||
|
||||
/**
|
||||
* Positionate the submenu elements. Add a negative top.
|
||||
*
|
||||
* @param int index It is the position of li.menu_icon in the ul.
|
||||
* @param string id_submenu It is the id of first level submenu.
|
||||
* @param string id_submenu2 It is the id of second level submenu.
|
||||
* @param int item_height It is the height of a menu item (28 o 35).
|
||||
*
|
||||
* @return (int) The position (in px).
|
||||
*/
|
||||
function menu_calculate_top(index, id_submenu, id_submenu2, item_height){
|
||||
|
||||
var level1 = index;
|
||||
var level2 = $('#'+id_submenu+' ul.submenu > li').length;
|
||||
var level3 = $('#'+id_submenu2+' > li.sub_subMenu').length;
|
||||
var item_height = item_height;
|
||||
|
||||
level2--;
|
||||
if (id_submenu2 !== false) {
|
||||
// If level3 is set, the position is calculated like box is in the center.
|
||||
// wiouth considering level2 box can be moved.
|
||||
level3--;
|
||||
total = (level1 + level3);
|
||||
comp = level3;
|
||||
} else {
|
||||
total = (level1 + level2);
|
||||
comp = level2;
|
||||
}
|
||||
|
||||
// Positionate in the middle
|
||||
if (total > 12 && ((total < 18) || ((level1 - comp) <= 4))) {
|
||||
return - ( Math.floor(comp / 2) * item_height);
|
||||
}
|
||||
|
||||
// Positionate in the bottom
|
||||
if (total >= 18) {
|
||||
return (- comp * item_height);
|
||||
}
|
||||
|
||||
// return 0 by default
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the menu items to be positioned.
|
||||
*
|
||||
* @param string item It is the selector of the current element.
|
||||
*
|
||||
* @return Add the top position in a inline style.
|
||||
*/
|
||||
function get_menu_items(item){
|
||||
var item_height = parseInt(item.css('min-height'));
|
||||
var id_submenu = item.attr('id');
|
||||
var id_submenu2 = false;
|
||||
var index = item.index();
|
||||
|
||||
if(item.parent().hasClass('godmode')){
|
||||
index = index+6; // This is because the menu has divided in two parts.
|
||||
}
|
||||
var top_submenu = menu_calculate_top(index, id_submenu, id_submenu2, item_height);
|
||||
top_submenu = top_submenu+'px';
|
||||
$('#'+id_submenu+' ul.submenu').css('top', top_submenu);
|
||||
|
||||
$('.has_submenu').mouseenter(function() {
|
||||
id_submenu2 = item.attr('id');
|
||||
id_submenu2 = $('#'+id_submenu2+' ul.submenu2').attr('id');
|
||||
var top_submenu2 = menu_calculate_top(index, id_submenu, id_submenu2, item_height);
|
||||
top_submenu2 = top_submenu2+'px';
|
||||
$('#'+id_submenu2).css('top', top_submenu2);
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
* Show and hide submenus
|
||||
*/
|
||||
if(!click_display){
|
||||
$('.menu_icon').mouseenter(function() {
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
$("ul#sub"+table_hover[0].id).show();
|
||||
get_menu_items(table_hover);
|
||||
if( typeof(table_noHover) != 'undefined')
|
||||
if ( "ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id )
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
}).mouseleave(function() {
|
||||
table_noHover = $(this);
|
||||
handsIn = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime;
|
||||
if(opened > 3000 && handsIn == 0) {
|
||||
openTime = 4000;
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
}
|
||||
}, 2500);
|
||||
});
|
||||
}else{
|
||||
$(document).ready(function() {
|
||||
if (autohidden_menu) {
|
||||
$('.menu_icon').on("click", function() {
|
||||
if( typeof(table_hover) != 'undefined'){
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
const menuTypeClass = '<?php echo $menuTypeClass; ?>';
|
||||
if (menuTypeClass === 'classic' && menuTypeClass !== localStorage.getItem('menuType')) {
|
||||
localStorage.setItem('menuType', 'classic');
|
||||
}
|
||||
const tab = '<?php echo $tab_active; ?>';
|
||||
|
||||
if (tab === 'management') {
|
||||
$('#tab_line_2').addClass('tabs_selected');
|
||||
$('#div_display').css('display', 'none');
|
||||
$('#div_management').css('display', 'block');
|
||||
$('#tab_display').addClass('head_tab_unselected').removeClass('head_tab_selected');
|
||||
$('#tab_management').addClass('head_tab_selected').removeClass('head_tab_unselected');
|
||||
$('#tab_collapsed_display').children().first().removeClass('tabs_collapsed_display');
|
||||
$('#tab_collapsed_display').children().first().addClass('tabs_collapsed_oval');
|
||||
} else {
|
||||
$('#tab_line_1').addClass('tabs_selected');
|
||||
$('#tab_management').addClass('head_tab_unselected').removeClass('head_tab_selected');
|
||||
$('#tab_display').addClass('head_tab_selected').removeClass('head_tab_unselected');
|
||||
$('#tab_collapsed_management').children().first().removeClass('tabs_collapsed_management');
|
||||
$('#tab_collapsed_management').children().first().addClass('tabs_collapsed_oval');
|
||||
}
|
||||
|
||||
$('#tab_display,#tab_collapsed_display').click(function() {
|
||||
$('#tab_line_1').addClass('tabs_selected');
|
||||
$('#tab_line_2').removeClass('tabs_selected');
|
||||
$('#div_management').css('display', 'none');
|
||||
$('#div_display').css('display', 'block');
|
||||
$('#tab_management').addClass('head_tab_unselected').removeClass('head_tab_selected');
|
||||
$('#tab_display').addClass('head_tab_selected').removeClass('head_tab_unselected');
|
||||
$('#tab_collapsed_management').children().first().removeClass('tabs_collapsed_management');
|
||||
$('#tab_collapsed_management').children().first().addClass('tabs_collapsed_oval');
|
||||
$('#tab_collapsed_display').children().first().removeClass('tabs_collapsed_oval');
|
||||
$('#tab_collapsed_display').children().first().addClass('tabs_collapsed_display');
|
||||
});
|
||||
|
||||
$('#tab_management,#tab_collapsed_management').click(function() {
|
||||
$('#tab_line_2').addClass('tabs_selected');
|
||||
$('#tab_line_1').removeClass('tabs_selected');
|
||||
$('#div_display').css('display', 'none');
|
||||
$('#div_management').css('display', 'block');
|
||||
$('#tab_display').addClass('head_tab_unselected').removeClass('head_tab_selected');
|
||||
$('#tab_management').addClass('head_tab_selected').removeClass('head_tab_unselected');
|
||||
$('#tab_collapsed_display').children().first().removeClass('tabs_collapsed_display');
|
||||
$('#tab_collapsed_display').children().first().addClass('tabs_collapsed_oval');
|
||||
$('#tab_collapsed_management').children().first().removeClass('tabs_collapsed_oval');
|
||||
$('#tab_collapsed_management').children().first().addClass('tabs_collapsed_management');
|
||||
});
|
||||
|
||||
$('#button_collapse').click(function() {
|
||||
if ($('#menu_full').hasClass('menu_full_classic')) {
|
||||
localStorage.setItem("menuType", "collapsed");
|
||||
$('ul.submenu').css('left', '80px');
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
menuType: menuType_val,
|
||||
page: "include/functions_menu"
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
$('.tabs_ul').hide();
|
||||
$('.div_border_line').hide();
|
||||
$('.tabs_collapsed').show();
|
||||
|
||||
$(".title_menu_classic").children('div[class*=icon_]').each(function() {
|
||||
$(this).removeClass('w15p').addClass('w100p');
|
||||
});
|
||||
|
||||
$(".title_menu_classic").children('div[class*=arrow_]').each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
$(".title_menu_classic").children('span').each(function() {
|
||||
$(this).hide();
|
||||
});
|
||||
|
||||
$('ul.submenu').css('position', 'fixed');
|
||||
$('ul.submenu').css('left', '60px');
|
||||
|
||||
$('li.selected').each(function() {
|
||||
$(`#sub${this.id}`).hide();
|
||||
})
|
||||
} else if ($('#menu_full').hasClass('menu_full_collapsed')) {
|
||||
localStorage.setItem("menuType", "classic");
|
||||
$('ul.submenu').css('left', '280px');
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "ajax.php",
|
||||
data: {
|
||||
menuType: menuType_val,
|
||||
page: "include/functions_menu"
|
||||
},
|
||||
dataType: "json"
|
||||
});
|
||||
$('.tabs_ul').show();
|
||||
$('.div_border_line').show();
|
||||
$('.tabs_collapsed').hide();
|
||||
|
||||
$(".title_menu_classic").children('div[class*=icon_]').each(function() {
|
||||
$(this).removeClass('w100p').addClass('w15p');
|
||||
});
|
||||
|
||||
$(".title_menu_classic").children('div[class*=arrow_]').each(function() {
|
||||
$(this).show();
|
||||
});
|
||||
|
||||
$(".title_menu_classic").children('span').each(function() {
|
||||
$(this).show();
|
||||
});
|
||||
|
||||
$('ul.submenu').css('position', '');
|
||||
$('ul.submenu').css('left', '80px');
|
||||
|
||||
$('li.selected').each(function() {
|
||||
$(`#sub${this.id}`).show();
|
||||
})
|
||||
}
|
||||
|
||||
$('.logo_full').toggle();
|
||||
$('.logo_icon').toggle();
|
||||
$('#menu_full').toggleClass('menu_full_classic menu_full_collapsed');
|
||||
$('#button_collapse').toggleClass('button_classic button_collapsed');
|
||||
$('div#page').toggleClass('page_classic page_collapsed');
|
||||
$('#header_table').toggleClass('header_table_classic header_table_collapsed');
|
||||
$('li.menu_icon').toggleClass("no_hidden_menu menu_icon_collapsed");
|
||||
menuActionButtonResizing();
|
||||
});
|
||||
|
||||
const id_selected = '<?php echo $menu1_selected; ?>';
|
||||
if (id_selected != '') {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (menuType_val === 'classic') {
|
||||
$(`ul#subicon_${id_selected}`).show();
|
||||
}
|
||||
|
||||
// Arrow.
|
||||
$(`#icon_${id_selected}`).children().first().children().last().removeClass('arrow_menu_down');
|
||||
$(`#icon_${id_selected}`).children().first().children().last().addClass('arrow_menu_up');
|
||||
// Span.
|
||||
$(`#icon_${id_selected}`).children().first().children().eq(1).addClass('span_selected');
|
||||
|
||||
const id_selected2 = '<?php echo $menu2_selected; ?>';
|
||||
if (id_selected2 != '') {
|
||||
if ($(`#sub${id_selected2}`).length > 0) {
|
||||
$(`#sub${id_selected2}`).show();
|
||||
// Arrow.
|
||||
$(`#${id_selected2}`).children().first().children().last().removeClass('arrow_menu_down');
|
||||
$(`#${id_selected2}`).children().first().children().last().addClass('arrow_menu_up');
|
||||
// Span.
|
||||
$(`#${id_selected2}`).children().first().children().first().addClass('span_selected');
|
||||
// Vertical line.
|
||||
$(`.sub_subMenu.selected`).prepend(`<div class="element_submenu_selected left_3"></div>`);
|
||||
} else {
|
||||
$(`#${id_selected2}`).addClass('submenu_selected_no_submenu');
|
||||
$(`#${id_selected2}`).children().first().children().first().css('color', '#fff');
|
||||
// Vertical line.
|
||||
$(`#${id_selected2}`).prepend(`<div class="element_submenu_selected"></div>`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var click_display = "<?php echo $config['click_display']; ?>";
|
||||
|
||||
$('.menu_icon').mouseenter(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
$("ul#sub"+table_hover[0].id).show();
|
||||
get_menu_items(table_hover);
|
||||
}).mouseleave(function() {
|
||||
if (typeof(table_noHover) != 'undefined') {
|
||||
if ("ul#sub"+table_hover[0].id != "ul#sub"+table_noHover[0].id ) {
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).mouseleave(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
table_noHover = $(this);
|
||||
handsIn = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime;
|
||||
if(opened > 5000 && handsIn == 0) {
|
||||
openTime = 6000;
|
||||
if(opened > 2500 && handsIn == 0) {
|
||||
openTime = 4000;
|
||||
$("ul#sub"+table_noHover[0].id).hide();
|
||||
}
|
||||
}, 5500);
|
||||
});
|
||||
} else {
|
||||
$('.menu_icon').on("click", function() {
|
||||
if( typeof(table_hover) != 'undefined'){
|
||||
}, 2500);
|
||||
}
|
||||
});
|
||||
|
||||
$('.has_submenu').mouseenter(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
table_hover2 = $(this);
|
||||
handsIn2 = 1;
|
||||
openTime2 = new Date().getTime();
|
||||
$("#sub"+table_hover2[0].id).show();
|
||||
if( typeof(table_noHover2) != 'undefined') {
|
||||
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id ) {
|
||||
$("ul#sub"+table_noHover2[0].id).hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}).mouseleave(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
table_noHover2 = table_hover2;
|
||||
handsIn2 = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime2;
|
||||
if(opened >= 3000 && handsIn2 == 0) {
|
||||
openTime2 = 4000;
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
}
|
||||
}, 3500);
|
||||
}
|
||||
});
|
||||
|
||||
$('#container').click(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (!click_display && menuType_val === 'collapsed') {
|
||||
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined') {
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
}
|
||||
table_hover = $(this);
|
||||
handsIn = 1;
|
||||
openTime = new Date().getTime();
|
||||
$("ul#sub"+table_hover[0].id).show();
|
||||
get_menu_items(table_hover);
|
||||
});
|
||||
|
||||
if( typeof(table_hover2) != 'undefined') {
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.title_menu_classic').click(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (click_display || (!click_display && menuType_val === 'classic')) {
|
||||
const table_hover = $(this).parent();
|
||||
const id = table_hover[0].id;
|
||||
const classes = $(`#${id}`).attr('class');
|
||||
|
||||
if (id === 'icon_about') {
|
||||
return;
|
||||
}
|
||||
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
|
||||
if (classes.includes('selected') === true) {
|
||||
if (menuType_val === 'collapsed' && $(`ul#sub${id}`).is(':hidden')) {
|
||||
$(`ul#sub${id}`).show();
|
||||
get_menu_items(table_hover);
|
||||
} else {
|
||||
$(`#${id}`).removeClass('selected');
|
||||
$(`ul#sub${id}`).hide();
|
||||
// Arrow.
|
||||
table_hover.children().first().children().last().removeClass('arrow_menu_up');
|
||||
table_hover.children().first().children().last().addClass('arrow_menu_down');
|
||||
// Span.
|
||||
table_hover.children().first().children().eq(1).removeClass('span_selected');
|
||||
}
|
||||
} else {
|
||||
if (menuType_val === 'collapsed') {
|
||||
// hide all submenus.
|
||||
$('ul[id^=sub]').hide();
|
||||
$(`ul#sub${id}`).show();
|
||||
// Unselect all.
|
||||
$(`li[id^=icon_]`).removeClass('selected');
|
||||
$(`#${id}`).addClass('selected');
|
||||
get_menu_items(table_hover);
|
||||
} else {
|
||||
$(`ul#sub${id}`).show();
|
||||
$(`#${id}`).addClass('selected');
|
||||
// Arrow.
|
||||
$(this).children().last().removeClass('arrow_menu_down');
|
||||
$(this).children().last().addClass('arrow_menu_up');
|
||||
// Span.
|
||||
$(this).children().eq(1).addClass('span_selected');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.has_submenu').click(function() {
|
||||
var menuType_val = localStorage.getItem("menuType");
|
||||
if (click_display || (!click_display && menuType_val === 'classic')) {
|
||||
const table_hover2 = $(this);
|
||||
const id = table_hover2[0].id;
|
||||
const classes = $(`#${id}`).attr('class');
|
||||
|
||||
if (classes.includes('submenu_selected') === true) {
|
||||
$(`#${id}`).removeClass('submenu_selected');
|
||||
$(`#${id}`).addClass('submenu_not_selected');
|
||||
$(`#sub${id}`).hide();
|
||||
// Arrow.
|
||||
table_hover2.children().first().children().last().removeClass('arrow_menu_up');
|
||||
table_hover2.children().first().children().last().addClass('arrow_menu_down');
|
||||
// Span.
|
||||
table_hover2.children().first().children().first().removeClass('span_selected');
|
||||
} else {
|
||||
$(`#${id}`).removeClass('submenu_not_selected');
|
||||
$(`#${id}`).addClass('submenu_selected');
|
||||
$(`#sub${id}`).show();
|
||||
// Arrow.
|
||||
table_hover2.children().first().children().last().removeClass('arrow_menu_down');
|
||||
table_hover2.children().first().children().last().addClass('arrow_menu_up');
|
||||
// Span.
|
||||
table_hover2.children().first().children().first().addClass('span_selected');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('.sub_subMenu').click(function (event) {
|
||||
event.stopPropagation();
|
||||
});
|
||||
|
||||
/**
|
||||
* Get the menu items to be positioned.
|
||||
*
|
||||
* @param string item It is the selector of the current element.
|
||||
*
|
||||
* @return Add the top position in a inline style.
|
||||
*/
|
||||
function get_menu_items(item) {
|
||||
var item_height = parseInt(item.css('min-height'));
|
||||
var id_submenu = item.attr('id');
|
||||
var index = item.index();
|
||||
|
||||
var top_submenu = menu_calculate_top(index, item_height);
|
||||
top_submenu = top_submenu+'px';
|
||||
$('#'+id_submenu+' ul.submenu').css('position', 'fixed');
|
||||
$('#'+id_submenu+' ul.submenu').css('top', top_submenu);
|
||||
$('#'+id_submenu+' ul.submenu').css('left', '60px');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Positionate the submenu elements. Add a negative top.
|
||||
*
|
||||
* @param int index It is the position of li.menu_icon in the ul.
|
||||
* @param int item_height It is the height of a menu item (35).
|
||||
*
|
||||
* @return (int) The position (in px).
|
||||
*/
|
||||
function menu_calculate_top(index, item_height) {
|
||||
const height_position = index * item_height;
|
||||
const height_logo = $('.logo_green').outerHeight(true);
|
||||
const height_tabs = $('#menu_tabs').outerHeight(true);
|
||||
const padding_menu = parseInt($('.godmode').css('padding-top'));
|
||||
|
||||
return height_logo + height_tabs + padding_menu + height_position;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('.has_submenu').mouseenter(function() {
|
||||
table_hover2 = $(this);
|
||||
handsIn2 = 1;
|
||||
openTime2 = new Date().getTime();
|
||||
$("#sub"+table_hover2[0].id).show();
|
||||
if( typeof(table_noHover2) != 'undefined')
|
||||
if ( "ul#sub"+table_hover2[0].id != "ul#sub"+table_noHover2[0].id )
|
||||
$("ul#sub"+table_noHover2[0].id).hide();
|
||||
}).mouseleave(function() {
|
||||
table_noHover2 = table_hover2;
|
||||
handsIn2 = 0;
|
||||
setTimeout(function() {
|
||||
opened = new Date().getTime() - openTime2;
|
||||
if(opened >= 3000 && handsIn2 == 0) {
|
||||
openTime2 = 4000;
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
}
|
||||
}, 3500);
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
if(!click_display){
|
||||
$('#container').click(function() {
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
});
|
||||
}else{
|
||||
$('#main').click(function() {
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
$('div.menu>ul>li>ul>li>a').click(function() {
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
});
|
||||
|
||||
$('div.menu>ul>li>ul>li>ul>li>a').click(function() {
|
||||
openTime = 4000;
|
||||
if( typeof(table_hover) != 'undefined')
|
||||
$("ul#sub"+table_hover[0].id).hide();
|
||||
if( typeof(table_hover2) != 'undefined')
|
||||
$("ul#sub"+table_hover2[0].id).hide();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,167 +1,77 @@
|
|||
<html>
|
||||
<head>
|
||||
|
||||
<style>
|
||||
<?php
|
||||
echo '<script src="'.ui_get_full_url('include/javascript/jquery.current.js', false, false, false).'" type="text/javascript"></script>';
|
||||
|
||||
#alert_messages_na{
|
||||
-moz-border-bottom-right-radius: 5px;
|
||||
-webkit-border-bottom-left-radius: 5px;
|
||||
border-bottom-right-radius: 5px;
|
||||
border-bottom-left-radius: 5px;
|
||||
z-index:2;
|
||||
position:fixed;
|
||||
width:700px;
|
||||
background:white;
|
||||
left:50%;
|
||||
top:20%;
|
||||
margin-left:-350px;
|
||||
$message = '';
|
||||
|
||||
if ($config['history_db_connection'] === false) {
|
||||
$message = __('Failure to connect to historical database, please check the configuration or contact system administrator if you need assistance.');
|
||||
} else {
|
||||
$message = __('Failure to connect to Database server, please check the configuration file config.php or contact system administrator if you need assistance.');
|
||||
}
|
||||
|
||||
.modalheade{
|
||||
text-align:center;
|
||||
width:100%;
|
||||
height:37px;
|
||||
left:0px;
|
||||
background-color:#82b92e;
|
||||
}
|
||||
.modalheadertex{
|
||||
color:white;
|
||||
position:relative;
|
||||
font-size:13pt;
|
||||
top:8px;
|
||||
}
|
||||
|
||||
.modalconten{
|
||||
color:black;
|
||||
background:white;
|
||||
}
|
||||
.modalcontentim{
|
||||
float:left;
|
||||
margin-left:30px;
|
||||
margin-top:30px;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.modalcontenttex{
|
||||
float:left;
|
||||
text-align:justify;
|
||||
color:black;
|
||||
font-size: 9.5pt;
|
||||
line-height:13pt;
|
||||
margin-top:40px;
|
||||
width:430px;
|
||||
margin-left:30px;
|
||||
}
|
||||
.modalwikibutto{
|
||||
cursor:pointer;
|
||||
text-align:center;
|
||||
margin-right:45px;
|
||||
float:right;
|
||||
-moz-border-radius: 3px;
|
||||
-webkit-border-radius: 3px;
|
||||
margin-bottom:30px;
|
||||
border-radius: 3px;
|
||||
width:170px;
|
||||
height:30px;
|
||||
border: 1px solid #82b92e;
|
||||
margin-top:8%;
|
||||
background-color:#82b92e;
|
||||
}
|
||||
.modalwikibuttontex{
|
||||
color:#ffffff;
|
||||
font-size:10pt;
|
||||
position:relative;
|
||||
top:6px;
|
||||
}
|
||||
|
||||
#opacity{
|
||||
background:black;opacity:0.1;left:0px;top:0px;width:100%;height:100%;
|
||||
background:black;
|
||||
opacity:0.1;
|
||||
left:0px;
|
||||
top:0px;
|
||||
width:100%;
|
||||
height:100%;
|
||||
position: fixed;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
img.modalclose {
|
||||
text-align: right;
|
||||
float: right;
|
||||
padding-right: 11px;
|
||||
padding-top: 11px;
|
||||
vertical-align: middle;
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="alert_messages_na">
|
||||
|
||||
<div class='modalheade'>
|
||||
<span class='modalheadertex'>
|
||||
<?php echo __('Database error'); ?>
|
||||
</span>
|
||||
<img class='modalclose' src='<?php echo $config['homeurl']; ?>/images/icono_cerrar.png'>
|
||||
</div>
|
||||
|
||||
<div class='modalconten'>
|
||||
<img class='modalcontentim' src='<?php echo $config['homeurl']; ?>/images/mysqlerr.png'>
|
||||
<div class='modalcontenttex'>
|
||||
<?php
|
||||
if ($config['history_db_connection'] === false) {
|
||||
echo __('Failure to connect to historical database, please check the configuration or contact system administrator if you need assistance.');
|
||||
} else {
|
||||
echo __('Failure to connect to Database server, please check the configuration file config.php or contact system administrator if you need assistance.');
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$custom_conf_enabled = false;
|
||||
foreach ($config as $key => $value) {
|
||||
if (preg_match('/._alt/i', $key)) {
|
||||
$custom_conf_enabled = true;
|
||||
break;
|
||||
}
|
||||
$custom_conf_enabled = false;
|
||||
foreach ($config as $key => $value) {
|
||||
if (preg_match('/._alt/i', $key)) {
|
||||
$custom_conf_enabled = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$custom_conf_enabled || isset($config['custom_docs_url_alt'])) {
|
||||
if (isset($config['custom_docs_url_alt'])) {
|
||||
$docs_url = $config['custom_docs_url_alt'];
|
||||
} else {
|
||||
$docs_url = 'https://pandorafms.com/manual/en/documentation/02_installation/04_configuration';
|
||||
}
|
||||
|
||||
echo '
|
||||
<a href="'.ui_get_full_external_url($docs_url).'" target="_blank">
|
||||
<div class="modalwikibutto">
|
||||
<span class="modalwikibuttontex">'.__('Documentation').'
|
||||
</span>
|
||||
</div>
|
||||
</a>
|
||||
';
|
||||
if (empty($custom_conf_enabled) === true || isset($config['custom_docs_url_alt']) === true) {
|
||||
if (isset($config['custom_docs_url_alt']) === true) {
|
||||
$docs_url = $config['custom_docs_url_alt'];
|
||||
} else {
|
||||
$docs_url = 'https://pandorafms.com/manual/en/documentation/02_installation/04_configuration';
|
||||
}
|
||||
}
|
||||
|
||||
echo '<div id="mysqlerr" title="'.__('Error').'">';
|
||||
echo '<div class="content_alert">';
|
||||
echo '<div class="icon_message_alert">';
|
||||
echo html_print_image('images/mysqlerr.png', true, ['alt' => __('Mysql error'), 'border' => 0]);
|
||||
echo '</div>';
|
||||
echo '<div class="content_message_alert">';
|
||||
echo '<div class="text_message_alert">';
|
||||
echo '<h1>'.__('Database error').'</h1>';
|
||||
echo '<p>'.$message.'</p>';
|
||||
echo '<br>';
|
||||
echo '</div>';
|
||||
echo '<div class="button_message_alert">';
|
||||
html_print_submit_button(
|
||||
__('Documentation'),
|
||||
'mysqlerr_button',
|
||||
false,
|
||||
['class' => 'mini float-right']
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div id="opacity"></div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script>
|
||||
|
||||
$(".modalclose").click(function(){
|
||||
$('div#alert_messages_na').toggle();
|
||||
$('div#opacity').toggle();
|
||||
$(function() {
|
||||
$("#mysqlerr").dialog({
|
||||
resizable: true,
|
||||
draggable: true,
|
||||
modal: true,
|
||||
width: 700,
|
||||
clickOutside: true,
|
||||
overlay: {
|
||||
opacity: 0.5,
|
||||
background: "black"
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$("#mysqlerr").hide();
|
||||
|
||||
$("#button-mysqlerr_button").click (function () {
|
||||
window.open('<?php echo ui_get_full_external_url($docs_url); ?>', '_blank');
|
||||
});
|
||||
|
||||
$(document).ready(function () {
|
||||
$("#mysqlerr").show();
|
||||
});
|
||||
</script>
|
||||
|
|
|
@ -77,7 +77,7 @@ if (! $id || ! file_exists($help_file)) {
|
|||
echo '<div class="msg msg_pandora_help">'.__("%s help system has been called with a help reference that currently don't exist. There is no help content to show.", get_product_name()).'</div></div></div>';
|
||||
echo '<br /><br />';
|
||||
echo '<div id="footer_help">';
|
||||
include 'footer.php';
|
||||
// include 'footer.php';
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ ob_end_clean();
|
|||
echo $help;
|
||||
echo '</div>';
|
||||
echo '<div id="footer_help">';
|
||||
require 'footer.php';
|
||||
// require 'footer.php';
|
||||
echo '</div>';
|
||||
?>
|
||||
</body>
|
||||
|
|
|
@ -59,7 +59,7 @@ ui_print_warning_message(
|
|||
]
|
||||
);
|
||||
|
||||
$table = new StdClass();
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->data = [];
|
||||
|
|
|
@ -59,23 +59,22 @@ $result = integria_api_call(null, null, null, null, 'get_incidents', $params, fa
|
|||
|
||||
$result = json_decode($result, true);
|
||||
|
||||
$count = count($result);
|
||||
|
||||
$result = array_slice($result, $offset, $config['block_size']);
|
||||
|
||||
if (empty($result)) {
|
||||
if (empty($result) === true) {
|
||||
$result = [];
|
||||
$count = 0;
|
||||
echo '<div class="nf">'.__('No incidents associated to this agent').'</div><br />';
|
||||
return;
|
||||
} else {
|
||||
$count = count($result);
|
||||
$result = array_slice($result, $offset, $config['block_size']);
|
||||
}
|
||||
|
||||
// Show pagination
|
||||
// Show pagination.
|
||||
ui_pagination($count, $url, $offset, 0, false, 'offset');
|
||||
// ($count + $offset) it's real count of incidents because it's use LIMIT $offset in query.
|
||||
echo '<br />';
|
||||
|
||||
// Show headers
|
||||
// Show headers.
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox';
|
||||
$table->cellpadding = 4;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,20 +1,35 @@
|
|||
<?php
|
||||
/**
|
||||
* Agent Modules Templates.
|
||||
*
|
||||
* @category Module
|
||||
* @package Pandora FMS
|
||||
* @subpackage Agent Configuration
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
global $config;
|
||||
|
||||
// Load global vars
|
||||
if (!isset($id_agente)) {
|
||||
// Load global vars.
|
||||
if (isset($id_agente) === false) {
|
||||
die('Not Authorized');
|
||||
}
|
||||
|
||||
|
@ -23,8 +38,8 @@ require_once $config['homedir'].'/include/functions_modules.php';
|
|||
// ==========================
|
||||
// TEMPLATE ASSIGMENT LOGIC
|
||||
// ==========================
|
||||
if (isset($_POST['template_id'])) {
|
||||
// Take agent data
|
||||
if (isset($_POST['template_id']) === true) {
|
||||
// Take agent data.
|
||||
$row = db_get_row('tagente', 'id_agente', $id_agente);
|
||||
if ($row !== false) {
|
||||
$intervalo = $row['intervalo'];
|
||||
|
@ -49,7 +64,8 @@ if (isset($_POST['template_id'])) {
|
|||
$npc = [];
|
||||
}
|
||||
|
||||
$success_count = $error_count = 0;
|
||||
$success_count = 0;
|
||||
$error_count = 0;
|
||||
$modules_already_added = [];
|
||||
|
||||
foreach ($npc as $row) {
|
||||
|
@ -60,7 +76,7 @@ if (isset($_POST['template_id'])) {
|
|||
}
|
||||
|
||||
foreach ($nc as $row2) {
|
||||
// Insert each module from tnetwork_component into agent
|
||||
// Insert each module from tnetwork_component into agent.
|
||||
$values = [
|
||||
'id_agente' => $id_agente,
|
||||
'id_tipo_modulo' => $row2['type'],
|
||||
|
@ -113,14 +129,14 @@ if (isset($_POST['template_id'])) {
|
|||
|
||||
$name = $row2['name'];
|
||||
|
||||
// Put tags in array if the component has to add them later
|
||||
if (!empty($row2['tags'])) {
|
||||
// Put tags in array if the component has to add them later.
|
||||
if (empty($row2['tags']) === false) {
|
||||
$tags = explode(',', $row2['tags']);
|
||||
} else {
|
||||
$tags = [];
|
||||
}
|
||||
|
||||
// Check if this module exists in the agent
|
||||
// Check if this module exists in the agent.
|
||||
$module_name_check = db_get_value_filter('id_agente_modulo', 'tagente_modulo', ['delete_pending' => 0, 'nombre' => $name, 'id_agente' => $id_agente]);
|
||||
|
||||
if ($module_name_check !== false) {
|
||||
|
@ -132,13 +148,13 @@ if (isset($_POST['template_id'])) {
|
|||
if ($id_agente_modulo === false) {
|
||||
$error_count++;
|
||||
} else {
|
||||
if (!empty($tags)) {
|
||||
// Creating tags
|
||||
if (empty($tags) === false) {
|
||||
// Creating tags.
|
||||
$tag_ids = [];
|
||||
foreach ($tags as $tag_name) {
|
||||
$tag_id = tags_get_id($tag_name);
|
||||
|
||||
// If tag exists in the system we store to create it
|
||||
// If tag exists in the system we store to create it.
|
||||
$tag_ids[] = $tag_id;
|
||||
}
|
||||
|
||||
|
@ -152,7 +168,7 @@ if (isset($_POST['template_id'])) {
|
|||
}
|
||||
|
||||
if ($error_count > 0) {
|
||||
if (empty($modules_already_added)) {
|
||||
if (empty($modules_already_added) === true) {
|
||||
ui_print_error_message(__('Error adding modules').sprintf(' (%s)', $error_count));
|
||||
} else {
|
||||
ui_print_error_message(__('Error adding modules. The following errors already exists: ').implode(', ', $modules_already_added));
|
||||
|
@ -168,8 +184,6 @@ if (isset($_POST['template_id'])) {
|
|||
// ==========================
|
||||
// TEMPLATE ASSIGMENT FORM
|
||||
// ==========================
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
|
||||
$nps = db_get_all_fields_in_table('tnetwork_profile', 'name');
|
||||
if ($nps === false) {
|
||||
$nps = [];
|
||||
|
@ -180,44 +194,45 @@ foreach ($nps as $row) {
|
|||
$select[$row['id_np']] = $row['name'];
|
||||
}
|
||||
|
||||
echo '<table width="100%" cellpadding="0" cellspacing="0" class="databox filters" >';
|
||||
echo "<tr><td class='datos w50p'>";
|
||||
html_print_select($select, 'template_id', '', '', '', 0, false, false, true, '', false, 'max-width: 200px !important');
|
||||
echo '</td>';
|
||||
echo '<td class="datos">';
|
||||
html_print_submit_button(__('Assign'), 'crt', false, 'class="sub next mgn_tp_0"');
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</form>';
|
||||
echo '</table>';
|
||||
echo '</form>';
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->width = '100%';
|
||||
$filterTable->class = 'fixed_filter_bar';
|
||||
$filterTable->data = [];
|
||||
$filterTable->data[0][0] = __('Module templates');
|
||||
$filterTable->data[1][0] = html_print_select($select, 'template_id', '', '', '', 0, true, false, true, '', false, 'max-width: 200px !important');
|
||||
$filterTable->data[1][1] = html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Assign'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'icon' => 'wand',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$outputFilterTable = '<form style="border:0" class="fixed_filter_bar" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">';
|
||||
$outputFilterTable .= html_print_table($filterTable, true);
|
||||
$outputFilterTable .= '</form>';
|
||||
|
||||
echo $outputFilterTable;
|
||||
|
||||
// ==========================
|
||||
// MODULE VISUALIZATION TABLE
|
||||
// ==========================
|
||||
switch ($config['dbtype']) {
|
||||
case 'mysql':
|
||||
case 'postgresql':
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d AND delete_pending = false
|
||||
ORDER BY id_module_group, nombre',
|
||||
$id_agente
|
||||
);
|
||||
break;
|
||||
|
||||
case 'oracle':
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d
|
||||
AND (delete_pending <> 1 AND delete_pending IS NOT NULL)
|
||||
ORDER BY id_module_group, dbms_lob.substr(nombre,4000,1)',
|
||||
$id_agente
|
||||
);
|
||||
break;
|
||||
}
|
||||
$sql = sprintf(
|
||||
'SELECT *
|
||||
FROM tagente_modulo
|
||||
WHERE id_agente = %d AND delete_pending = false
|
||||
ORDER BY id_module_group, nombre',
|
||||
$id_agente
|
||||
);
|
||||
|
||||
$result = db_get_all_rows_sql($sql);
|
||||
if ($result === false) {
|
||||
|
@ -233,10 +248,10 @@ $table->head = [];
|
|||
$table->data = [];
|
||||
$table->align = [];
|
||||
|
||||
$table->head[0] = __('Module name');
|
||||
$table->head[1] = __('Type');
|
||||
$table->head[2] = __('Description');
|
||||
$table->head[3] = __('Action');
|
||||
$table->head[0] = '<span>'.__('Module name').'</span>';
|
||||
$table->head[1] = '<span>'.__('Type').'</span>';
|
||||
$table->head[2] = '<span>'.__('Description').'</span>';
|
||||
$table->head[3] = '<span>'.__('Action').'</span>';
|
||||
|
||||
$table->align[1] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
|
@ -245,27 +260,43 @@ $table->size[1] = '5%';
|
|||
$table->size[3] = '8%';
|
||||
|
||||
foreach ($result as $row) {
|
||||
$table->cellclass[][3] = 'table_action_buttons';
|
||||
|
||||
$data = [];
|
||||
|
||||
$data[0] = '<span>'.$row['nombre'];
|
||||
if ($row['id_tipo_modulo'] > 0) {
|
||||
$data[1] = html_print_image('images/'.modules_show_icon_type($row['id_tipo_modulo']), true, ['border' => '0', 'class' => 'invert_filter']);
|
||||
} else {
|
||||
$data[1] = '';
|
||||
}
|
||||
|
||||
$data[1] = ($row['id_tipo_modulo'] > 0) ? ui_print_moduletype_icon($row['id_tipo_modulo'], true, false, true) : '';
|
||||
$data[2] = mb_substr($row['descripcion'], 0, 60);
|
||||
|
||||
$table->cellclass[][3] = 'action_buttons';
|
||||
$data[3] = '<a href="index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'].'">'.html_print_image('images/cross.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Delete'), 'onclick' => "if (!confirm('".__('Are you sure?')."')) return false;"]).'</a>';
|
||||
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'].'">'.html_print_image('images/config.png', true, ['class' => 'invert_filter', 'border' => '0', 'alt' => __('Update')]).'</a>';
|
||||
$data[3] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'&delete_module='.$row['id_agente_modulo'],
|
||||
'image' => 'images/delete.svg',
|
||||
'title' => __('Delete'),
|
||||
'onClick' => 'if (!confirm(\''.__('Are you sure?').'\')) return false;',
|
||||
],
|
||||
true
|
||||
);
|
||||
$data[3] .= html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&tab=module&edit_module=1&id_agent_module='.$row['id_agente_modulo'],
|
||||
'image' => 'images/edit.svg',
|
||||
'title' => __('Edit'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if (!empty($table->data)) {
|
||||
html_print_table($table);
|
||||
unset($table);
|
||||
if (empty($table->data) === false) {
|
||||
$output = html_print_table($table, true);
|
||||
} else {
|
||||
ui_print_empty_data(__('No modules'));
|
||||
$output = ui_print_empty_data(__('No modules'), '', true);
|
||||
}
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'datatable_form',
|
||||
'content' => $output,
|
||||
]
|
||||
);
|
||||
|
|
|
@ -295,7 +295,6 @@ if ($create_agent) {
|
|||
'fixed_ip' => $fixed_ip,
|
||||
]
|
||||
);
|
||||
enterprise_hook('update_agent', [$id_agente]);
|
||||
} else {
|
||||
$id_agente = false;
|
||||
}
|
||||
|
@ -377,86 +376,89 @@ $img_style = [
|
|||
|
||||
if ($id_agente) {
|
||||
// View tab.
|
||||
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/eye.png',
|
||||
true,
|
||||
$viewtab['text'] = html_print_anchor(
|
||||
[
|
||||
'title' => __('View'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
if ($tab == 'view') {
|
||||
$viewtab['active'] = true;
|
||||
} else {
|
||||
$viewtab['active'] = false;
|
||||
}
|
||||
'href' => 'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente='.$id_agente,
|
||||
'content' => html_print_image(
|
||||
'images/enable.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('View'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$viewtab['active'] = ($tab === 'view');
|
||||
$viewtab['operation'] = 1;
|
||||
|
||||
// Main tab.
|
||||
$maintab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/gm_setup.png',
|
||||
true,
|
||||
$maintab['text'] = html_print_anchor(
|
||||
[
|
||||
'title' => __('Setup'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
if ($tab == 'main') {
|
||||
$maintab['active'] = true;
|
||||
} else {
|
||||
$maintab['active'] = false;
|
||||
}
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=main&id_agente='.$id_agente,
|
||||
'content' => html_print_image(
|
||||
'images/configuration@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Setup'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$maintab['active'] = ($tab === 'main');
|
||||
|
||||
// Module tab.
|
||||
$moduletab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/gm_modules.png',
|
||||
true,
|
||||
$moduletab['text'] = html_print_anchor(
|
||||
[
|
||||
'title' => __('Modules'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente,
|
||||
'content' => html_print_image(
|
||||
'images/modules@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Modules'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($tab == 'module') {
|
||||
$moduletab['active'] = true;
|
||||
} else {
|
||||
$moduletab['active'] = false;
|
||||
}
|
||||
$moduletab['active'] = ($tab === 'module');
|
||||
|
||||
// Alert tab.
|
||||
$alerttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/gm_alerts.png',
|
||||
true,
|
||||
$alerttab['text'] = html_print_anchor(
|
||||
[
|
||||
'title' => __('Alerts'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente,
|
||||
'content' => html_print_image(
|
||||
'images/alert@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Alerts'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($tab == 'alert') {
|
||||
$alerttab['active'] = true;
|
||||
} else {
|
||||
$alerttab['active'] = false;
|
||||
}
|
||||
$alerttab['active'] = ($tab === 'alert');
|
||||
|
||||
// Template tab.
|
||||
$templatetab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/templates.png',
|
||||
true,
|
||||
$templatetab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=template&id_agente='.$id_agente,
|
||||
'image' => 'images/modules-group@svg.svg',
|
||||
'title' => __('Module templates'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
if ($tab == 'template') {
|
||||
$templatetab['active'] = true;
|
||||
} else {
|
||||
$templatetab['active'] = false;
|
||||
}
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$templatetab['active'] = ($tab === 'template');
|
||||
|
||||
// Inventory.
|
||||
$inventorytab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=inventory&id_agente='.$id_agente.'">'.html_print_image(
|
||||
|
@ -474,11 +476,11 @@ if ($id_agente) {
|
|||
$inventorytab['active'] = false;
|
||||
}
|
||||
|
||||
if ($inventorytab == -1) {
|
||||
$inventorytab = enterprise_hook('inventory_tab');
|
||||
if ($inventorytab === ENTERPRISE_NOT_HOOK) {
|
||||
$inventorytab = '';
|
||||
}
|
||||
|
||||
|
||||
$has_remote_conf = enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$id_agente]
|
||||
|
@ -490,7 +492,7 @@ if ($id_agente) {
|
|||
if ($has_remote_conf === true) {
|
||||
// Plugins.
|
||||
$pluginstab = enterprise_hook('plugins_tab');
|
||||
if ($pluginstab == -1) {
|
||||
if ($pluginstab === ENTERPRISE_NOT_HOOK) {
|
||||
$pluginstab = '';
|
||||
}
|
||||
} else {
|
||||
|
@ -500,60 +502,60 @@ if ($id_agente) {
|
|||
// Collection.
|
||||
if ((int) $config['license_nms'] !== 1) {
|
||||
$collectiontab = enterprise_hook('collection_tab');
|
||||
|
||||
if ($collectiontab == -1) {
|
||||
if ($collectiontab === ENTERPRISE_NOT_HOOK) {
|
||||
$collectiontab = '';
|
||||
}
|
||||
} else {
|
||||
$collectiontab = '';
|
||||
}
|
||||
|
||||
// NetworkConfigManager tab.
|
||||
$ncm_tab = enterprise_hook('networkconfigmanager_tab');
|
||||
|
||||
if ($ncm_tab === ENTERPRISE_NOT_HOOK) {
|
||||
$ncm_tab = '';
|
||||
}
|
||||
|
||||
// Group tab.
|
||||
$grouptab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group.'">'.html_print_image(
|
||||
'images/group.png',
|
||||
true,
|
||||
$grouptab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&ag_group='.$group,
|
||||
'image' => 'images/groups@svg.svg',
|
||||
'title' => __('Group'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$grouptab['active'] = false;
|
||||
|
||||
$gistab = [];
|
||||
|
||||
// GIS tab.
|
||||
if ($config['activate_gis']) {
|
||||
$gistab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/gm_gis.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('GIS data'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
// TODO. OVERRIDE.
|
||||
$config['activate_gis'] = true;
|
||||
|
||||
if ($tab == 'gis') {
|
||||
$gistab['active'] = true;
|
||||
} else {
|
||||
$gistab['active'] = false;
|
||||
}
|
||||
// GIS tab.
|
||||
if ((bool) $config['activate_gis'] === true) {
|
||||
$gistab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=gis&id_agente='.$id_agente,
|
||||
'image' => 'images/poi@svg.svg',
|
||||
'title' => __('GIS data'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$gistab['active'] = ($tab === 'gis');
|
||||
}
|
||||
|
||||
// Agent wizard tab.
|
||||
$agent_wizard['text'] = '<a href="javascript:" class="agent_wizard_tab">'.html_print_image(
|
||||
'images/wand_agent.png',
|
||||
true,
|
||||
$agent_wizard['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'javascript:',
|
||||
'class' => 'agent_wizard_tab',
|
||||
'image' => 'images/wizard@svg.svg',
|
||||
'title' => __('Agent wizard'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Hidden subtab layer.
|
||||
$agent_wizard['sub_menu'] = '<ul class="mn subsubmenu invisible float-none">';
|
||||
|
@ -601,42 +603,34 @@ if ($id_agente) {
|
|||
|
||||
// Incident tab.
|
||||
if ($total_incidents > 0) {
|
||||
$incidenttab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agente.'">'.html_print_image(
|
||||
'images/book_edit.png',
|
||||
true,
|
||||
$incidenttab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=incident&id_agente='.$id_agente,
|
||||
'image' => 'images/logs@svg.svg',
|
||||
'title' => __('Incidents'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($tab == 'incident') {
|
||||
$incidenttab['active'] = true;
|
||||
} else {
|
||||
$incidenttab['active'] = false;
|
||||
}
|
||||
$incidenttab['active'] = ($tab === 'incident');
|
||||
}
|
||||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW')) {
|
||||
if ($has_remote_conf) {
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'AW') === true) {
|
||||
if ($has_remote_conf !== false) {
|
||||
$agent_name = agents_get_name($id_agente);
|
||||
$agent_name = io_safe_output($agent_name);
|
||||
$agent_md5 = md5($agent_name, false);
|
||||
|
||||
$remote_configuration_tab['text'] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$id_agente.'&disk_conf='.$agent_md5.'">'.html_print_image(
|
||||
'images/remote_configuration.png',
|
||||
true,
|
||||
$remote_configuration_tab['text'] = html_print_menu_button(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$id_agente.'&disk_conf='.$agent_md5,
|
||||
'image' => 'images/remote-configuration@svg.svg',
|
||||
'title' => __('Remote configuration'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
if ($tab == 'remote_configuration') {
|
||||
$remote_configuration_tab['active'] = true;
|
||||
} else {
|
||||
$remote_configuration_tab['active'] = false;
|
||||
}
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$remote_configuration_tab['active'] = ($tab === 'remote_configuration');
|
||||
|
||||
$onheader = [
|
||||
'view' => $viewtab,
|
||||
|
@ -719,37 +713,32 @@ if ($id_agente) {
|
|||
// This add information to the header.
|
||||
switch ($tab) {
|
||||
case 'main':
|
||||
$tab_description = '- '.__('Setup');
|
||||
$help_header = 'main_tab';
|
||||
$tab_name = 'Setup';
|
||||
$tab_name = __('Setup');
|
||||
break;
|
||||
|
||||
case 'collection':
|
||||
$tab_description = '- '.__('Collection');
|
||||
$tab_name = 'Collection';
|
||||
$tab_name = __('Collection');
|
||||
break;
|
||||
|
||||
case 'ncm':
|
||||
$tab_description = '- '.__('Network config manager');
|
||||
$tab_name = 'Network config manager';
|
||||
$tab_name = __('Network config manager');
|
||||
break;
|
||||
|
||||
case 'inventory':
|
||||
$tab_description = '- '.__('Inventory');
|
||||
$help_header = 'inventory_tab';
|
||||
$tab_name = 'Inventory';
|
||||
$tab_name = __('Inventory');
|
||||
break;
|
||||
|
||||
case 'plugins':
|
||||
$tab_description = '- '.__('Agent plugins');
|
||||
$help_header = 'plugins_tab';
|
||||
$tab_name = __('Agent plugins');
|
||||
break;
|
||||
|
||||
case 'module':
|
||||
$type_module_t = get_parameter('moduletype', '');
|
||||
$tab_description = '- '.__('Modules');
|
||||
$tab_name = 'Modules';
|
||||
if ($type_module_t == 'webux') {
|
||||
$tab_name = __('Modules');
|
||||
if ($type_module_t === 'webux') {
|
||||
$help_header = 'wux_console';
|
||||
} else {
|
||||
$help_header = 'local_module_tab';
|
||||
|
@ -757,47 +746,42 @@ if ($id_agente) {
|
|||
break;
|
||||
|
||||
case 'alert':
|
||||
$tab_description = '- '.__('Alert');
|
||||
$help_header = 'manage_alert_list';
|
||||
$tab_name = 'Alerts';
|
||||
$tab_name = __('Alerts');
|
||||
break;
|
||||
|
||||
case 'template':
|
||||
$tab_description = '- '.__('Templates');
|
||||
$tab_name = 'Module templates';
|
||||
$tab_name = __('Module templates');
|
||||
break;
|
||||
|
||||
case 'gis':
|
||||
$tab_description = '- '.__('Gis');
|
||||
$tab_name = __('Gis');
|
||||
$help_header = 'gis_tab';
|
||||
break;
|
||||
|
||||
case 'incident':
|
||||
$tab_description = '- '.__('Incidents');
|
||||
$tab_name = __('Incidents');
|
||||
break;
|
||||
|
||||
case 'remote_configuration':
|
||||
$tab_description = '- '.__('Remote configuration');
|
||||
$tab_name = __('Remote configuration');
|
||||
break;
|
||||
|
||||
case 'agent_wizard':
|
||||
switch (get_parameter('wizard_section')) {
|
||||
case 'snmp_explorer':
|
||||
$tab_description = '- '.__('SNMP Wizard');
|
||||
$help_header = 'agent_snmp_explorer_tab';
|
||||
$tab_name = 'SNMP Wizard';
|
||||
$tab_name = __('SNMP Wizard');
|
||||
break;
|
||||
|
||||
case 'snmp_interfaces_explorer':
|
||||
$tab_description = '- '.__('SNMP Interfaces wizard');
|
||||
$tab_name = __('SNMP Interfaces Wizard');
|
||||
$help_header = 'agent_snmp_interfaces_explorer_tab';
|
||||
$tab_name = 'SNMP Interfaces wizard';
|
||||
break;
|
||||
|
||||
case 'wmi_explorer':
|
||||
$tab_description = '- '.__('WMI Wizard');
|
||||
$tab_name = __('WMI Wizard');
|
||||
$help_header = 'agent_snmp_wmi_explorer_tab';
|
||||
$tab_name = 'WMI Wizard';
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -826,48 +810,49 @@ if ($id_agente) {
|
|||
}
|
||||
|
||||
$helper = ($help_header === 'main_tab') ? 'main_tab' : '';
|
||||
$pure = get_parameter('pure', 0);
|
||||
if (!$pure) {
|
||||
ui_print_page_header(
|
||||
agents_get_alias($id_agente),
|
||||
'images/setup.png',
|
||||
$pure = (int) get_parameter('pure');
|
||||
if ($pure === 0) {
|
||||
ui_print_standard_header(
|
||||
__('Agent setup view'),
|
||||
'images/agent.png',
|
||||
false,
|
||||
$helper,
|
||||
true,
|
||||
$onheader,
|
||||
false,
|
||||
'',
|
||||
$config['item_title_size_text'],
|
||||
'',
|
||||
ui_print_breadcrums(
|
||||
$onheader,
|
||||
[
|
||||
[
|
||||
__('Resources'),
|
||||
__('Manage agents'),
|
||||
'<span class="breadcrumb_active">'.$tab_name.'</span>',
|
||||
]
|
||||
)
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente',
|
||||
'label' => __('Manage agents'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => $tab_name,
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Create agent.
|
||||
ui_print_page_header(
|
||||
__('Agent manager'),
|
||||
ui_print_standard_header(
|
||||
__('Create agent'),
|
||||
'images/agent.png',
|
||||
false,
|
||||
'create_agent',
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
GENERIC_SIZE_TEXT,
|
||||
'',
|
||||
ui_print_breadcrums(
|
||||
[],
|
||||
[
|
||||
[
|
||||
__('Resources'),
|
||||
__('Manage agents'),
|
||||
'<span class="breadcrumb_active">'.__('Create agent').'</span>',
|
||||
]
|
||||
)
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente',
|
||||
'label' => __('Manage agents'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -892,7 +877,8 @@ if ($delete_conf_file) {
|
|||
ui_print_result_message(
|
||||
$correct,
|
||||
__('Conf file deleted successfully'),
|
||||
__('Could not delete conf file')
|
||||
__('Could not delete conf file'),
|
||||
[ 'autoclose' => true ]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1250,9 +1236,9 @@ if ($id_agente) {
|
|||
$intervalo = $agent['intervalo'];
|
||||
// Define interval in seconds.
|
||||
$nombre_agente = $agent['nombre'];
|
||||
if (empty($alias)) {
|
||||
if (empty($alias) === true) {
|
||||
$alias = $agent['alias'];
|
||||
if (empty($alias)) {
|
||||
if (empty($alias) === true) {
|
||||
$alias = $nombre_agente;
|
||||
}
|
||||
}
|
||||
|
@ -1291,7 +1277,7 @@ $duplicate_module = (int) get_parameter('duplicate_module');
|
|||
$edit_module = (bool) get_parameter('edit_module');
|
||||
|
||||
// GET DATA for MODULE UPDATE OR MODULE INSERT.
|
||||
if ($update_module || $create_module) {
|
||||
if ($update_module === true || $create_module === true) {
|
||||
$id_grupo = agents_get_agent_group($id_agente);
|
||||
$all_groups = agents_get_all_groups_agent($id_agente, $id_grupo);
|
||||
|
||||
|
@ -1318,12 +1304,7 @@ if ($update_module || $create_module) {
|
|||
*/
|
||||
|
||||
$post_process = (string) get_parameter('post_process', 0.0);
|
||||
if (get_parameter('prediction_module')) {
|
||||
$prediction_module = 1;
|
||||
} else {
|
||||
$prediction_module = 0;
|
||||
}
|
||||
|
||||
$prediction_module = (int) get_parameter('prediction_module');
|
||||
$max_timeout = (int) get_parameter('max_timeout');
|
||||
$max_retries = (int) get_parameter('max_retries');
|
||||
$min = (int) get_parameter('min');
|
||||
|
@ -1580,11 +1561,11 @@ if ($update_module || $create_module) {
|
|||
}
|
||||
|
||||
$cron_interval = $minute_from.$minute_to.' '.$hour_from.$hour_to.' '.$mday_from.$mday_to.' '.$month_from.$month_to.' '.$wday_from.$wday_to;
|
||||
if (!cron_check_syntax($cron_interval)) {
|
||||
if (cron_check_syntax($cron_interval) === false) {
|
||||
$cron_interval = '';
|
||||
}
|
||||
|
||||
if ($prediction_module != MODULE_PREDICTION_SYNTHETIC) {
|
||||
if ($prediction_module !== MODULE_PREDICTION_SYNTHETIC) {
|
||||
unset($serialize_ops);
|
||||
enterprise_hook(
|
||||
'modules_delete_synthetic_operations',
|
||||
|
@ -1709,7 +1690,7 @@ if ($update_module) {
|
|||
$values['plugin_parameter'] = '';
|
||||
|
||||
foreach ($plugin_parameter_split as $key => $value) {
|
||||
if ($key == 1) {
|
||||
if ((int) $key === 1) {
|
||||
if ($http_user) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
}
|
||||
|
@ -1728,12 +1709,12 @@ if ($update_module) {
|
|||
|
||||
// In local modules, the interval is updated by agent.
|
||||
$module_kind = (int) get_parameter('moduletype');
|
||||
if ($module_kind == MODULE_DATA) {
|
||||
if ($module_kind === MODULE_DATA) {
|
||||
unset($values['module_interval']);
|
||||
}
|
||||
|
||||
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC
|
||||
&& $serialize_ops == ''
|
||||
if ($prediction_module === MODULE_PREDICTION_SYNTHETIC
|
||||
&& empty($serialize_ops) === true
|
||||
) {
|
||||
$result = false;
|
||||
} else {
|
||||
|
@ -1754,7 +1735,7 @@ if ($update_module) {
|
|||
}
|
||||
}
|
||||
|
||||
if (is_error($result)) {
|
||||
if (is_error($result) === true) {
|
||||
switch ($result) {
|
||||
case ERR_EXIST:
|
||||
$msg = __('There was a problem updating module. Another module already exists with the same name.');
|
||||
|
@ -1787,7 +1768,7 @@ if ($update_module) {
|
|||
"Fail to try update module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
||||
);
|
||||
} else {
|
||||
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC) {
|
||||
if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) {
|
||||
enterprise_hook(
|
||||
'modules_create_synthetic_operations',
|
||||
[
|
||||
|
@ -1821,28 +1802,16 @@ if ($create_module) {
|
|||
// Old configuration data must always be empty in case of creation.
|
||||
$old_configuration_data = '';
|
||||
|
||||
if (isset($_POST['combo_snmp_oid'])) {
|
||||
if (isset($_POST['combo_snmp_oid']) === true) {
|
||||
$combo_snmp_oid = get_parameter_post('combo_snmp_oid');
|
||||
}
|
||||
|
||||
if ($snmp_oid == '') {
|
||||
if (empty($snmp_oid) === true) {
|
||||
$snmp_oid = $combo_snmp_oid;
|
||||
}
|
||||
|
||||
$id_module = (int) get_parameter('id_module');
|
||||
|
||||
switch ($config['dbtype']) {
|
||||
case 'oracle':
|
||||
if (empty($description) || !isset($description)) {
|
||||
$description = ' ';
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
// Default.
|
||||
break;
|
||||
}
|
||||
|
||||
$values = [
|
||||
'id_tipo_modulo' => $id_module_type,
|
||||
'descripcion' => $description,
|
||||
|
@ -1911,13 +1880,13 @@ if ($create_module) {
|
|||
'warning_time' => $warning_time,
|
||||
];
|
||||
|
||||
if ($id_module_type == 30 || $id_module_type == 31 || $id_module_type == 32 || $id_module_type == 33) {
|
||||
if ($id_module_type === 30 || $id_module_type === 31 || $id_module_type === 32 || $id_module_type === 33) {
|
||||
$plugin_parameter_split = explode('
', $values['plugin_parameter']);
|
||||
|
||||
$values['plugin_parameter'] = '';
|
||||
|
||||
foreach ($plugin_parameter_split as $key => $value) {
|
||||
if ($key == 1) {
|
||||
if ((int) $key === 1) {
|
||||
if ($http_user) {
|
||||
$values['plugin_parameter'] .= 'http_auth_user '.$http_user.'
';
|
||||
}
|
||||
|
@ -1925,15 +1894,13 @@ if ($create_module) {
|
|||
if ($http_pass) {
|
||||
$values['plugin_parameter'] .= 'http_auth_pass '.$http_pass.'
';
|
||||
}
|
||||
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
} else {
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
}
|
||||
|
||||
$values['plugin_parameter'] .= $value.'
';
|
||||
}
|
||||
}
|
||||
|
||||
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC && $serialize_ops == '') {
|
||||
if ((int) $prediction_module === MODULE_PREDICTION_SYNTHETIC && empty($serialize_ops) === true) {
|
||||
$id_agent_module = false;
|
||||
} else {
|
||||
$id_agent_module = modules_create_agent_module(
|
||||
|
@ -1945,7 +1912,7 @@ if ($create_module) {
|
|||
);
|
||||
}
|
||||
|
||||
if (is_error($id_agent_module)) {
|
||||
if (is_error($id_agent_module) === true) {
|
||||
switch ($id_agent_module) {
|
||||
case ERR_EXIST:
|
||||
$msg = __('There was a problem adding module. Another module already exists with the same name.');
|
||||
|
@ -1974,7 +1941,7 @@ if ($create_module) {
|
|||
"Fail to try added module '".io_safe_output($name)."' for agent ".io_safe_output($agent['alias'])
|
||||
);
|
||||
} else {
|
||||
if ($prediction_module == MODULE_PREDICTION_SYNTHETIC) {
|
||||
if ($prediction_module === MODULE_PREDICTION_SYNTHETIC) {
|
||||
enterprise_hook(
|
||||
'modules_create_synthetic_operations',
|
||||
[
|
||||
|
@ -2254,8 +2221,8 @@ if ($disable_module) {
|
|||
}
|
||||
|
||||
// UPDATE GIS.
|
||||
$updateGIS = get_parameter('update_gis', 0);
|
||||
if ($updateGIS) {
|
||||
$updateGIS = (bool) get_parameter('update_gis', 0);
|
||||
if ($updateGIS === true) {
|
||||
$updateGisData = get_parameter('update_gis_data');
|
||||
$lastLatitude = get_parameter('latitude');
|
||||
$lastLongitude = get_parameter('longitude');
|
||||
|
@ -2525,7 +2492,7 @@ switch ($tab) {
|
|||
if(wizard_tab_showed <= 0) {
|
||||
$('.subsubmenu').hide("fast");
|
||||
}
|
||||
},15000);
|
||||
},1500);
|
||||
}
|
||||
|
||||
/* ]]> */
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit Fields manager.
|
||||
*
|
||||
* @category Resources.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -47,13 +63,8 @@ if ($id_field) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox';
|
||||
$table->id = 'configure_field';
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[4] = 'font-weight: bold';
|
||||
$table->style[6] = 'font-weight: bold';
|
||||
|
||||
echo "<div id='message_set_password' title='".__('Agent Custom Fields Information')."' class='invisible'>";
|
||||
echo "<p class='center bolder'>".__('You cannot set the Password type until you clear the combo values and click on update button.').'</p>';
|
||||
|
@ -75,7 +86,7 @@ echo '</div>';
|
|||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
$table->data[1][0] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
|
@ -84,30 +95,39 @@ $table->data[0][1] = html_print_input_text(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[1][0] = __('Pass type').ui_print_help_tip(
|
||||
$table->data[2][0] = __('Pass type').ui_print_help_tip(
|
||||
__('The fields with pass type enabled will be displayed like html input type pass in html'),
|
||||
true
|
||||
);
|
||||
$table->data[1][1] = html_print_checkbox_switch(
|
||||
$table->data[2][1] = __('Display on front').ui_print_help_tip(
|
||||
__('The fields with display on front enabled will be displayed into the agent details'),
|
||||
true
|
||||
);
|
||||
$table->data[2][2] = __('Link type');
|
||||
|
||||
$table->data[3][0] = html_print_checkbox_switch(
|
||||
'is_password_type',
|
||||
1,
|
||||
$is_password_type,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Display on front').ui_print_help_tip(
|
||||
__('The fields with display on front enabled will be displayed into the agent details'),
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = html_print_checkbox_switch(
|
||||
$table->data[3][1] = html_print_checkbox_switch(
|
||||
'display_on_front',
|
||||
1,
|
||||
$display_on_front,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Enabled combo');
|
||||
$table->data[3][1] = html_print_checkbox_switch_extended(
|
||||
$table->data[3][2] = html_print_checkbox_switch_extended(
|
||||
'is_link_enabled',
|
||||
1,
|
||||
$is_link_enabled,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[4][0] = __('Enabled combo');
|
||||
$table->data[5][0] = html_print_checkbox_switch_extended(
|
||||
'is_combo_enable',
|
||||
0,
|
||||
$config['is_combo_enable'],
|
||||
|
@ -117,12 +137,15 @@ $table->data[3][1] = html_print_checkbox_switch_extended(
|
|||
true
|
||||
);
|
||||
|
||||
$table->rowstyle[4] = 'display: none;';
|
||||
$table->data[4][0] = __('Combo values').ui_print_help_tip(
|
||||
|
||||
$table->cellstyle[4][1] = 'display: none;';
|
||||
$table->cellstyle[5][1] = 'display: none;';
|
||||
|
||||
$table->data[4][1] = __('Combo values').ui_print_help_tip(
|
||||
__('Set values separated by comma'),
|
||||
true
|
||||
);
|
||||
$table->data[4][1] = html_print_textarea(
|
||||
$table->data[5][1] = html_print_textarea(
|
||||
'combo_values',
|
||||
3,
|
||||
65,
|
||||
|
@ -131,31 +154,40 @@ $table->data[4][1] = html_print_textarea(
|
|||
true
|
||||
);
|
||||
|
||||
$table->data[5][0] = __('Link type');
|
||||
$table->data[5][1] = html_print_checkbox_switch_extended(
|
||||
'is_link_enabled',
|
||||
1,
|
||||
$is_link_enabled,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
echo '<form name="field" method="post" action="index.php?sec=gagente&sec2=godmode/agentes/fields_manager">';
|
||||
html_print_table($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
if ($id_field) {
|
||||
if ($id_field > 0) {
|
||||
html_print_input_hidden('update_field', 1);
|
||||
html_print_input_hidden('id_field', $id_field);
|
||||
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
$buttonCaption = __('Update');
|
||||
$buttonName = 'updbutton';
|
||||
} else {
|
||||
html_print_input_hidden('create_field', 1);
|
||||
html_print_submit_button(__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
$buttonCaption = __('Create');
|
||||
$buttonName = 'crtbutton';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
$actionButtons = [];
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
$buttonCaption,
|
||||
$buttonName,
|
||||
false,
|
||||
[ 'icon' => 'wand' ],
|
||||
true
|
||||
);
|
||||
$actionButtons[] = html_print_go_back_button(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/fields_manager',
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
['type' => 'form_action'],
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
?>
|
||||
|
||||
|
|
|
@ -1,22 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* Fields manager.
|
||||
*
|
||||
* @category Resources.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'PM')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === false) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access Group Management'
|
||||
|
@ -27,7 +42,24 @@ if (!check_acl($config['id_user'], 0, 'PM')) {
|
|||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(__('Agents custom fields manager'), 'images/custom_field.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Agents custom fields manager'),
|
||||
'images/custom_field.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom fields'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$create_field = (bool) get_parameter('create_field');
|
||||
$update_field = (bool) get_parameter('update_field');
|
||||
|
@ -114,7 +146,6 @@ $fields = db_get_all_rows_filter(
|
|||
);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
if ($fields) {
|
||||
$table->head = [];
|
||||
|
@ -140,34 +171,66 @@ if ($fields === false) {
|
|||
|
||||
foreach ($fields as $field) {
|
||||
$data[0] = $field['id_field'];
|
||||
$data[1] = $field['name'];
|
||||
|
||||
$data[1] = '<b>'.$field['name'].'</b>';
|
||||
$data[2] = html_print_image(
|
||||
((bool) $field['display_on_front'] === true) ? 'images/validate.svg' : 'images/icono_stop.png',
|
||||
true,
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
);
|
||||
|
||||
if ($field['display_on_front']) {
|
||||
$data[2] = html_print_image('images/tick.png', true, ['class' => 'invert_filter']);
|
||||
} else {
|
||||
$data[2] = html_print_image(
|
||||
'images/icono_stop.png',
|
||||
true,
|
||||
['style' => 'width:21px;height:21px;']
|
||||
);
|
||||
}
|
||||
$table->cellclass[][3] = 'table_action_buttons';
|
||||
$tableActionButtons = [];
|
||||
$tableActionButtons[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'],
|
||||
'content' => html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$table->cellclass[][3] = 'action_buttons';
|
||||
$data[3] = '<a href="index.php?sec=gagente&sec2=godmode/agentes/configure_field&id_field='.$field['id_field'].'">'.html_print_image('images/config.png', true, ['alt' => __('Edit'), 'title' => __('Edit'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
|
||||
$data[3] .= '<a href="index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'].'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'border' => '0', 'class' => 'invert_filter']).'</a>';
|
||||
$tableActionButtons[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gagente&sec2=godmode/agentes/fields_manager&delete_field=1&id_field='.$field['id_field'],
|
||||
'content' => html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
'onClick' => 'if (!confirm(\' '.__('Are you sure?').'\')) return false;',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$data[3] = implode('', $tableActionButtons);
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if ($fields) {
|
||||
ui_pagination($count_fields, false, $offset);
|
||||
html_print_table($table);
|
||||
ui_pagination($count_fields, false, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination($count_fields, false, $offset, 0, true, 'offset', false);
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configure_field">';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(__('Create field'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
echo '<form method="POST" action="index.php?sec=gagente&sec2=godmode/agentes/configure_field">';
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create field'),
|
||||
'crt',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
echo '</form>';
|
||||
|
|
|
@ -36,10 +36,10 @@ $ag_group = get_parameter('ag_group_refresh', -1);
|
|||
$sortField = get_parameter('sort_field');
|
||||
$sort = get_parameter('sort', 'none');
|
||||
$recursion = (bool) get_parameter('recursion', false);
|
||||
$disabled = get_parameter('disabled', 0);
|
||||
$os = get_parameter('os', 0);
|
||||
$disabled = (int) get_parameter('disabled');
|
||||
$os = (int) get_parameter('os');
|
||||
|
||||
if ($ag_group == -1) {
|
||||
if ($ag_group === -1) {
|
||||
$ag_group = (int) get_parameter('ag_group', -1);
|
||||
}
|
||||
|
||||
|
@ -68,15 +68,16 @@ if (! check_acl(
|
|||
enterprise_include_once('include/functions_policies.php');
|
||||
require_once 'include/functions_agents.php';
|
||||
require_once 'include/functions_users.php';
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
|
||||
$search = get_parameter('search', '');
|
||||
$search = get_parameter('search');
|
||||
|
||||
// Prepare the tab system to the future.
|
||||
$tab = 'view';
|
||||
|
||||
// Setup tab.
|
||||
$viewtab['text'] = '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente">'.html_print_image(
|
||||
'images/eye_show.png',
|
||||
'images/see-details@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('View'),
|
||||
|
@ -132,20 +133,19 @@ $agent_to_delete = (int) get_parameter('borrar_agente');
|
|||
$enable_agent = (int) get_parameter('enable_agent');
|
||||
$disable_agent = (int) get_parameter('disable_agent');
|
||||
|
||||
if ($disable_agent != 0) {
|
||||
if ($disable_agent !== 0) {
|
||||
$server_name = db_get_row_sql(
|
||||
'select server_name from tagente where id_agente = '.$disable_agent
|
||||
);
|
||||
} else if ($enable_agent != 0) {
|
||||
} else if ($enable_agent !== 0) {
|
||||
$server_name = db_get_row_sql(
|
||||
'select server_name from tagente where id_agente = '.$enable_agent
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
$result = null;
|
||||
|
||||
if ($agent_to_delete) {
|
||||
if ($agent_to_delete > 0) {
|
||||
$id_agente = $agent_to_delete;
|
||||
if (check_acl_one_of_groups(
|
||||
$config['id_user'],
|
||||
|
@ -171,17 +171,10 @@ if ($agent_to_delete) {
|
|||
__('Could not be deleted.')
|
||||
);
|
||||
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
// Check if the remote config file still exist.
|
||||
if (isset($config['remote_config'])) {
|
||||
enterprise_include_once(
|
||||
'include/functions_config_agents.php'
|
||||
);
|
||||
if (enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$id_agente]
|
||||
)
|
||||
) {
|
||||
if (isset($config['remote_config']) === true) {
|
||||
if ((bool) enterprise_hook('config_agents_has_remote_configuration', [$id_agente]) === true) {
|
||||
ui_print_error_message(
|
||||
__('Maybe the files conf or md5 could not be deleted')
|
||||
);
|
||||
|
@ -190,7 +183,7 @@ if ($agent_to_delete) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($enable_agent) {
|
||||
if ($enable_agent > 0) {
|
||||
$result = db_process_sql_update(
|
||||
'tagente',
|
||||
['disabled' => 0],
|
||||
|
@ -198,7 +191,7 @@ if ($enable_agent) {
|
|||
);
|
||||
$alias = io_safe_output(agents_get_alias($enable_agent));
|
||||
|
||||
if ($result) {
|
||||
if ((bool) $result !== false) {
|
||||
// Update the agent from the metaconsole cache.
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
$values = ['disabled' => 0];
|
||||
|
@ -236,7 +229,7 @@ if ($enable_agent) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($disable_agent) {
|
||||
if ($disable_agent > 0) {
|
||||
$result = db_process_sql_update('tagente', ['disabled' => 1], ['id_agente' => $disable_agent]);
|
||||
$alias = io_safe_output(agents_get_alias($disable_agent));
|
||||
|
||||
|
@ -279,28 +272,45 @@ if ($disable_agent) {
|
|||
);
|
||||
}
|
||||
|
||||
echo "<table cellpadding='4' cellspacing='4' class='databox filters font_bold margin-bottom-10' width='100%'>
|
||||
<tr>";
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente'>";
|
||||
|
||||
echo '<td>';
|
||||
|
||||
echo __('Group').' ';
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl(
|
||||
if ((bool) $own_info['is_admin'] === false && (bool) check_acl(
|
||||
$config['id_user'],
|
||||
0,
|
||||
'AR'
|
||||
) && !check_acl($config['id_user'], 0, 'AW')
|
||||
) === false && (bool) check_acl($config['id_user'], 0, 'AW') === false
|
||||
) {
|
||||
$return_all_group = false;
|
||||
} else {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
echo '<div class="w250px inline">';
|
||||
html_print_select_groups(
|
||||
$showAgentFields = [
|
||||
2 => __('Everyone'),
|
||||
1 => __('Only disabled'),
|
||||
0 => __('Only enabled'),
|
||||
];
|
||||
|
||||
$pre_fields = db_get_all_rows_sql(
|
||||
'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'
|
||||
);
|
||||
|
||||
$fields = [];
|
||||
|
||||
foreach ($pre_fields as $key => $value) {
|
||||
$fields[$value['id_os']] = $value['name'];
|
||||
}
|
||||
|
||||
// Filter table.
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->class = 'fixed_filter_bar';
|
||||
$filterTable->data = [];
|
||||
$filterTable->cellstyle[0][0] = 'width:0';
|
||||
$filterTable->cellstyle[0][1] = 'width:0';
|
||||
$filterTable->cellstyle[0][2] = 'width:0';
|
||||
$filterTable->cellstyle[0][3] = 'width:0';
|
||||
|
||||
$filterTable->data[0][0] = __('Group');
|
||||
$filterTable->data[1][0] = html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
$return_all_group,
|
||||
|
@ -309,71 +319,78 @@ html_print_select_groups(
|
|||
'this.form.submit();',
|
||||
'',
|
||||
0,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false
|
||||
);
|
||||
echo '</div></td>';
|
||||
|
||||
// Recursion checkbox.
|
||||
echo '<td>';
|
||||
echo __('Recursion').' ';
|
||||
html_print_checkbox(
|
||||
$filterTable->data[0][1] = __('Recursion');
|
||||
$filterTable->data[1][1] = html_print_checkbox_switch(
|
||||
'recursion',
|
||||
1,
|
||||
$recursion,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'this.form.submit()'
|
||||
);
|
||||
echo '</td>';
|
||||
echo '<td>';
|
||||
echo __('Show Agents').' ';
|
||||
$fields = [
|
||||
2 => __('Everyone'),
|
||||
1 => __('Only disabled'),
|
||||
0 => __('Only enabled'),
|
||||
];
|
||||
html_print_select(
|
||||
$fields,
|
||||
|
||||
$filterTable->data[0][2] = __('Show agents');
|
||||
$filterTable->data[1][2] = html_print_select(
|
||||
$showAgentFields,
|
||||
'disabled',
|
||||
$disabled,
|
||||
'this.form.submit()'
|
||||
);
|
||||
|
||||
echo '</td>';
|
||||
|
||||
echo '<td>';
|
||||
echo __('Operative System').' ';
|
||||
|
||||
$pre_fields = db_get_all_rows_sql(
|
||||
'select distinct(tagente.id_os),tconfig_os.name from tagente,tconfig_os where tagente.id_os = tconfig_os.id_os'
|
||||
);
|
||||
$fields = [];
|
||||
|
||||
foreach ($pre_fields as $key => $value) {
|
||||
$fields[$value['id_os']] = $value['name'];
|
||||
}
|
||||
|
||||
html_print_select($fields, 'os', $os, 'this.form.submit()', 'All', 0);
|
||||
|
||||
echo '</td><td>';
|
||||
echo __('Search').' ';
|
||||
html_print_input_text('search', $search, '', 12);
|
||||
|
||||
echo ui_print_help_tip(
|
||||
__('Search filter by alias, name, description, IP address or custom fields content'),
|
||||
'this.form.submit()',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
echo '</td><td>';
|
||||
echo "<input name='srcbutton' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
echo '</form>';
|
||||
echo '<td>';
|
||||
echo '</tr></table>';
|
||||
$filterTable->data[0][3] = __('Operating System');
|
||||
$filterTable->data[1][3] = html_print_select(
|
||||
$fields,
|
||||
'os',
|
||||
$os,
|
||||
'this.form.submit()',
|
||||
'All',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
$filterTable->data[0][4] = __('Free search');
|
||||
$filterTable->data[0][4] .= ui_print_help_tip(
|
||||
__('Search filter by alias, name, description, IP address or custom fields content'),
|
||||
true
|
||||
);
|
||||
$filterTable->data[1][4] = html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
12,
|
||||
255,
|
||||
true
|
||||
);
|
||||
|
||||
$filterTable->cellstyle[1][5] = 'vertical-align: bottom';
|
||||
$filterTable->data[1][5] = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'float-right',
|
||||
'mode' => 'secondary mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Print filter table.
|
||||
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
|
||||
html_print_table($filterTable);
|
||||
echo '</form>';
|
||||
|
||||
// Data table.
|
||||
$selected = true;
|
||||
$selectNameUp = false;
|
||||
$selectNameDown = false;
|
||||
|
@ -381,6 +398,8 @@ $selectOsUp = false;
|
|||
$selectOsDown = false;
|
||||
$selectGroupUp = false;
|
||||
$selectGroupDown = false;
|
||||
$selectRemoteUp = false;
|
||||
$selectRemoteDown = false;
|
||||
switch ($sortField) {
|
||||
case 'remote':
|
||||
switch ($sort) {
|
||||
|
@ -553,7 +572,7 @@ if ($disabled == 1) {
|
|||
}
|
||||
}
|
||||
|
||||
if ($os != 0) {
|
||||
if ($os !== 0) {
|
||||
$search_sql .= ' AND id_os = '.$os;
|
||||
}
|
||||
|
||||
|
@ -562,7 +581,7 @@ $user_groups_to_sql = '';
|
|||
if ($ag_group > 0) {
|
||||
$ag_groups = [];
|
||||
$ag_groups = (array) $ag_group;
|
||||
if ($recursion) {
|
||||
if ($recursion === true) {
|
||||
$ag_groups = groups_get_children_ids($ag_group, true);
|
||||
}
|
||||
|
||||
|
@ -610,23 +629,15 @@ $sql = sprintf(
|
|||
);
|
||||
|
||||
$agents = db_get_all_rows_sql($sql);
|
||||
|
||||
// Delete rnum row generated by oracle_recode_query() function.
|
||||
if (($config['dbtype'] == 'oracle') && ($agents !== false)) {
|
||||
for ($i = 0; $i < count($agents); $i++) {
|
||||
unset($agents[$i]['rnum']);
|
||||
}
|
||||
}
|
||||
|
||||
$custom_font_size = '';
|
||||
// Prepare pagination.
|
||||
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
|
||||
|
||||
// ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
|
||||
if ($agents !== false) {
|
||||
// Urls to sort the table.
|
||||
if ($config['language'] == 'ja'
|
||||
|| $config['language'] == 'zh_CN'
|
||||
|| $own_info['language'] == 'ja'
|
||||
|| $own_info['language'] == 'zh_CN'
|
||||
if ($config['language'] === 'ja'
|
||||
|| $config['language'] === 'zh_CN'
|
||||
|| $own_info['language'] === 'ja'
|
||||
|| $own_info['language'] === 'zh_CN'
|
||||
) {
|
||||
// Adds a custom font size for Japanese and Chinese language.
|
||||
$custom_font_size = 'custom_font_size';
|
||||
|
@ -641,38 +652,33 @@ if ($agents !== false) {
|
|||
$url_up_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=up&disabled=$disabled';
|
||||
$url_down_group = 'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id='.$ag_group.'&recursion='.$recursion.'&search='.$search.'&os='.$os.'&offset='.$offset.'&sort_field=group&sort=down&disabled=$disabled';
|
||||
|
||||
$tableAgents = new stdClass();
|
||||
$tableAgents->id = 'agent_list';
|
||||
$tableAgents->class = 'info_table tactical_table';
|
||||
$tableAgents->head = [];
|
||||
$tableAgents->data = [];
|
||||
// Header.
|
||||
$tableAgents->head[0] = '<span>'.__('Agent name').'</span>';
|
||||
$tableAgents->head[0] .= ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown);
|
||||
$tableAgents->head[1] = '<span title=\''.__('Remote agent configuration').'\'>'.__('R').'</span>';
|
||||
$tableAgents->head[1] .= ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown);
|
||||
$tableAgents->head[2] = '<span>'.__('OS').'</span>';
|
||||
$tableAgents->head[2] .= ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown);
|
||||
$tableAgents->head[3] = '<span>'.__('Type').'</span>';
|
||||
$tableAgents->head[4] = '<span>'.__('Group').'</span>';
|
||||
$tableAgents->head[4] .= ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown);
|
||||
$tableAgents->head[5] = '<span>'.__('Description').'</span>';
|
||||
$tableAgents->head[6] = '<span>'.__('Actions').'</span>';
|
||||
// Body.
|
||||
foreach ($agents as $key => $agent) {
|
||||
// Begin Update tagente.remote with 0/1 values.
|
||||
$resultHasRemoteConfig = ((int) enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']]) > 0);
|
||||
db_process_sql_update(
|
||||
'tagente',
|
||||
['remote' => ((int) $resultHasRemoteConfig) ],
|
||||
'id_agente = '.$agent['id_agente'].''
|
||||
);
|
||||
|
||||
echo "<table cellpadding='0' id='agent_list' cellspacing='0' width='100%' class='info_table'>";
|
||||
echo '<thead><tr>';
|
||||
echo '<th>'.__('Agent name').ui_get_sorting_arrows($url_up_agente, $url_down_agente, $selectNameUp, $selectNameDown).'</th>';
|
||||
echo "<th title='".__('Remote agent configuration')."'>".__('R').ui_get_sorting_arrows($url_up_remote, $url_down_remote, $selectRemoteUp, $selectRemoteDown).'</th>';
|
||||
echo '<th>'.__('OS').ui_get_sorting_arrows($url_up_os, $url_down_os, $selectOsUp, $selectOsDown).'</th>';
|
||||
echo '<th>'.__('Type').'</th>';
|
||||
echo '<th>'.__('Group').ui_get_sorting_arrows($url_up_group, $url_down_group, $selectGroupUp, $selectGroupDown).'</th>';
|
||||
echo '<th>'.__('Description').'</th>';
|
||||
echo "<th class='context_help_body'>".__('Actions').'</th>';
|
||||
echo '</tr></thead>';
|
||||
$color = 1;
|
||||
|
||||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
foreach ($agents as $agent) {
|
||||
// Begin Update tagente.remote 0/1 with remote agent function return.
|
||||
if (enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$agent['id_agente']]
|
||||
)
|
||||
) {
|
||||
db_process_sql_update(
|
||||
'tagente',
|
||||
['remote' => 1],
|
||||
'id_agente = '.$agent['id_agente'].''
|
||||
);
|
||||
} else {
|
||||
db_process_sql_update('tagente', ['remote' => 0], 'id_agente = '.$agent['id_agente'].'');
|
||||
}
|
||||
|
||||
// End Update tagente.remote 0/1 with remote agent function return.
|
||||
$all_groups = agents_get_all_groups_agent(
|
||||
$agent['id_agente'],
|
||||
$agent['id_grupo']
|
||||
|
@ -688,87 +694,66 @@ if ($agents !== false) {
|
|||
'AD'
|
||||
);
|
||||
|
||||
$cluster = db_get_row_sql('select id from tcluster where id_agent = '.$agent['id_agente']);
|
||||
$cluster = db_get_row_sql(
|
||||
'select id from tcluster where id_agent = '.$agent['id_agente']
|
||||
);
|
||||
|
||||
// Do not show the agent if there is not enough permissions.
|
||||
if (!$check_aw && !$check_ad) {
|
||||
if ($check_aw === false && $check_ad === false) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($color == 1) {
|
||||
$tdcolor = 'datos';
|
||||
$color = 0;
|
||||
if ((int) $agent['id_os'] === CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId($agent['id_agente']);
|
||||
$agentNameUrl = sprintf(
|
||||
'index.php?sec=reporting&sec2=operation/cluster/cluster&op=update&id=%s',
|
||||
$cluster->id()
|
||||
);
|
||||
$agentViewUrl = sprintf(
|
||||
'index.php?sec=reporting&sec2=operation/cluster/cluster&op=view&id=%s',
|
||||
$cluster->id()
|
||||
);
|
||||
} else {
|
||||
$tdcolor = 'datos2';
|
||||
$color = 1;
|
||||
$main_tab = ($check_aw === true) ? 'main' : 'module';
|
||||
$agentNameUrl = sprintf(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=%s&id_agente=%s',
|
||||
$main_tab,
|
||||
$agent['id_agente']
|
||||
);
|
||||
$agentViewUrl = sprintf(
|
||||
'index.php?sec=estado&sec2=operation/agentes/ver_agente&id_agente=%s',
|
||||
$agent['id_agente']
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if ($rowPair) {
|
||||
$rowclass = 'rowPair';
|
||||
} else {
|
||||
$rowclass = 'rowOdd';
|
||||
}
|
||||
|
||||
$rowPair = !$rowPair;
|
||||
$iterator++;
|
||||
// Agent name.
|
||||
echo "<tr class='$rowclass'><td class='$tdcolor' width='40%'>";
|
||||
if ($agent['disabled']) {
|
||||
echo '<em>';
|
||||
}
|
||||
|
||||
echo '<span class="left">';
|
||||
echo '<strong>';
|
||||
|
||||
if ($check_aw) {
|
||||
$main_tab = 'main';
|
||||
} else {
|
||||
$main_tab = 'module';
|
||||
}
|
||||
|
||||
if ($agent['alias'] == '') {
|
||||
if (empty($agent['alias']) === true) {
|
||||
$agent['alias'] = $agent['nombre'];
|
||||
}
|
||||
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2=';
|
||||
$url .= 'operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.ui_print_truncate_text($agent['alias'], 'agent_medium').'</a>';
|
||||
} else {
|
||||
echo '<a alt ='.$agent['nombre']." href='index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=$main_tab&
|
||||
id_agente=".$agent['id_agente']."'>".'<span class="'.$custom_font_size.' title ="'.$agent['nombre'].'">'.ui_print_truncate_text($agent['alias'], 'agent_medium').'</span>'.'</a>';
|
||||
}
|
||||
$additionalDataAgentName = [];
|
||||
|
||||
echo '</strong>';
|
||||
|
||||
$in_planned_downtime = db_get_sql(
|
||||
$inPlannedDowntime = db_get_sql(
|
||||
'SELECT executed FROM tplanned_downtime
|
||||
INNER JOIN tplanned_downtime_agents ON tplanned_downtime.id = tplanned_downtime_agents.id_downtime
|
||||
WHERE tplanned_downtime_agents.id_agent = '.$agent['id_agente'].' AND tplanned_downtime.executed = 1
|
||||
AND tplanned_downtime.type_downtime <> "disable_agent_modules"'
|
||||
);
|
||||
|
||||
if ($agent['disabled']) {
|
||||
ui_print_help_tip(__('Disabled'));
|
||||
|
||||
if (!$in_planned_downtime) {
|
||||
echo '</em>';
|
||||
}
|
||||
if ($inPlannedDowntime !== false) {
|
||||
$additionalDataAgentName[] = ui_print_help_tip(
|
||||
__('Module in scheduled downtime'),
|
||||
true,
|
||||
'images/clock.svg'
|
||||
);
|
||||
}
|
||||
|
||||
if ($agent['quiet']) {
|
||||
echo ' ';
|
||||
html_print_image(
|
||||
if ((bool) $agent['disabled'] === true) {
|
||||
$additionalDataAgentName[] = ui_print_help_tip(__('Disabled'));
|
||||
}
|
||||
|
||||
if ((bool) $agent['quiet'] === true) {
|
||||
$additionalDataAgentName[] = html_print_image(
|
||||
'images/dot_blue.png',
|
||||
false,
|
||||
true,
|
||||
[
|
||||
'border' => '0',
|
||||
'title' => __('Quiet'),
|
||||
|
@ -777,183 +762,254 @@ if ($agents !== false) {
|
|||
);
|
||||
}
|
||||
|
||||
if ($in_planned_downtime) {
|
||||
ui_print_help_tip(
|
||||
__('Agent in scheduled downtime'),
|
||||
false,
|
||||
'images/minireloj-16.png'
|
||||
);
|
||||
// Agent name column (1). Agent name.
|
||||
$agentNameColumn = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url($agentNameUrl),
|
||||
'title' => $agent['nombre'],
|
||||
'content' => ui_print_truncate_text($agent['alias'], 'agent_medium').implode('', $additionalDataAgentName),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo '</em>';
|
||||
$additionalOptionsAgentName = [];
|
||||
// Additional options generation.
|
||||
if ($check_aw === true) {
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url($agentNameUrl),
|
||||
'content' => __('Edit'),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '</span><div class="left actions clear_left" style=" visibility: hidden">';
|
||||
if ($check_aw) {
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2=';
|
||||
$url .= 'operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=update&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('Edit').'</a>';
|
||||
echo ' | ';
|
||||
} else {
|
||||
echo '<a href="index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=main&
|
||||
id_agente='.$agent['id_agente'].'">'.__('Edit').'</a>';
|
||||
echo ' | ';
|
||||
}
|
||||
if ((int) $agent['id_os'] !== 100) {
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$agent['id_agente']),
|
||||
'content' => __('Modules'),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($agent['id_os'] != 100) {
|
||||
echo '<a href="index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=module&
|
||||
id_agente='.$agent['id_agente'].'">'.__('Modules').'</a>';
|
||||
echo ' | ';
|
||||
}
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$agent['id_agente']),
|
||||
'content' => __('Alerts'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo '<a href="index.php?sec=gagente&
|
||||
sec2=godmode/agentes/configurar_agente&tab=alert&
|
||||
id_agente='.$agent['id_agente'].'">'.__('Alerts').'</a>';
|
||||
echo ' | ';
|
||||
$additionalOptionsAgentName[] = html_print_anchor(
|
||||
[
|
||||
'href' => ui_get_full_url($agentViewUrl),
|
||||
'content' => __('View'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($agent['id_os'] == CLUSTER_OS_ID) {
|
||||
$cluster = PandoraFMS\Cluster::loadFromAgentId(
|
||||
$agent['id_agente']
|
||||
// Agent name column (2). Available options.
|
||||
$agentAvailableActionsColumn = html_print_div(
|
||||
[
|
||||
'class' => 'left actions clear_left w100p',
|
||||
'style' => 'visibility: hidden',
|
||||
'content' => implode(' | ', $additionalOptionsAgentName),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Remote Configuration column.
|
||||
if ($resultHasRemoteConfig === true) {
|
||||
$remoteConfigurationColumn = html_print_menu_button(
|
||||
[
|
||||
'href' => ui_get_full_url('index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=remote_configuration&id_agente='.$agent['id_agente'].'&disk_conf=1'),
|
||||
'image' => 'images/remote-configuration@svg.svg',
|
||||
'title' => __('Edit remote config'),
|
||||
],
|
||||
true
|
||||
);
|
||||
$url = 'index.php?sec=reporting&sec2=';
|
||||
$url .= 'operation/cluster/cluster';
|
||||
$url = ui_get_full_url(
|
||||
$url.'&op=view&id='.$cluster->id()
|
||||
);
|
||||
echo '<a href="'.$url.'">'.__('View').'</a>';
|
||||
} else {
|
||||
echo '<a href="index.php?sec=estado
|
||||
&sec2=operation/agentes/ver_agente
|
||||
&id_agente='.$agent['id_agente'].'">'.__('View').'</a>';
|
||||
$remoteConfigurationColumn = '';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</td>';
|
||||
// Operating System icon column.
|
||||
$osIconColumn = html_print_div(
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'content' => ui_print_os_icon($agent['id_os'], false, true),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
echo "<td align='left' class='$tdcolor'>";
|
||||
// Has remote configuration ?
|
||||
if (enterprise_installed()) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
if (enterprise_hook('config_agents_has_remote_configuration', [$agent['id_agente']])) {
|
||||
echo "<a href='index.php?".'sec=gagente&'.'sec2=godmode/agentes/configurar_agente&'.'tab=remote_configuration&'.'id_agente='.$agent['id_agente']."&disk_conf=1'>";
|
||||
echo html_print_image(
|
||||
'images/application_edit.png',
|
||||
true,
|
||||
[
|
||||
'align' => 'middle',
|
||||
'title' => __('Edit remote config'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
echo '</a>';
|
||||
}
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
|
||||
// Operating System icon.
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
ui_print_os_icon($agent['id_os'], false);
|
||||
echo '</td>';
|
||||
|
||||
// Type agent (Networt, Software or Satellite).
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>";
|
||||
echo ui_print_type_agent_icon(
|
||||
// Agent type column.
|
||||
$agentTypeIconColumn = ui_print_type_agent_icon(
|
||||
$agent['id_os'],
|
||||
$agent['ultimo_contacto_remoto'],
|
||||
$agent['ultimo_contacto'],
|
||||
true,
|
||||
$agent['remote'],
|
||||
$agent['agent_version']
|
||||
);
|
||||
echo '</td>';
|
||||
|
||||
// Group icon and name column.
|
||||
$agentGroupIconColumn = html_print_div(
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'content' => ui_print_group_icon($agent['id_grupo'], true),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
// Group icon and name.
|
||||
echo "<td class='$tdcolor' align='left' valign='middle'>".ui_print_group_icon($agent['id_grupo'], true).'</td>';
|
||||
// Description column.
|
||||
$descriptionColumn = ui_print_truncate_text(
|
||||
$agent['comentarios'],
|
||||
'description',
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'[…]'
|
||||
);
|
||||
|
||||
// Description.
|
||||
echo "<td class='".$tdcolor."f9'><span class='".$custom_font_size."'>".ui_print_truncate_text($agent['comentarios'], 'description', true, true, true, '[…]').'</span></td>';
|
||||
$agentActionButtons = [];
|
||||
|
||||
// Action
|
||||
// When there is only one element in page it's necesary go back page.
|
||||
if ((count($agents) == 1) && ($offset >= $config['block_size'])) {
|
||||
$offsetArg = ($offset - $config['block_size']);
|
||||
if ((bool) $agent['disabled'] === true) {
|
||||
$agentDisableEnableTitle = __('Enable agent');
|
||||
$agentDisableEnableAction = 'enable_agent';
|
||||
$agentDisableEnableCaption = __('You are going to enable a cluster agent. Are you sure?');
|
||||
$agentDisableEnableIcon = 'change-pause.svg';
|
||||
} else {
|
||||
$offsetArg = $offset;
|
||||
$agentDisableEnableTitle = __('Disable agent');
|
||||
$agentDisableEnableAction = 'disable_agent';
|
||||
$agentDisableEnableCaption = __('You are going to disable a cluster agent. Are you sure?');
|
||||
$agentDisableEnableIcon = 'change-active.svg';
|
||||
}
|
||||
|
||||
echo "<td class='$tdcolor action_buttons' align='left' width=7% valign='middle'>";
|
||||
$agentActionButtons[] = html_print_menu_button(
|
||||
[
|
||||
'href' => ui_get_full_url(
|
||||
sprintf(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&%s_agent=%s&group_id=%s&recursion=%s&search=%s&offset=%s&sort_field=%s&sort=%s&disabled=%s',
|
||||
$agentDisableEnableAction,
|
||||
$agent['id_agente'],
|
||||
$ag_group,
|
||||
$recursion,
|
||||
$search,
|
||||
'',
|
||||
$sortField,
|
||||
$sort,
|
||||
$disabled
|
||||
)
|
||||
),
|
||||
'onClick' => ($agent['id_os'] === CLUSTER_OS_ID) ? sprintf('if (!confirm(\'%s\')) return false', $agentDisableEnableCaption) : 'return true;',
|
||||
'image' => sprintf('images/%s', $agentDisableEnableIcon),
|
||||
'title' => $agentDisableEnableTitle,
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if ($agent['disabled']) {
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
|
||||
enable_agent=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";
|
||||
|
||||
if ($agent['id_os'] != 100) {
|
||||
echo '>';
|
||||
if ($check_aw === true && is_management_allowed() === true) {
|
||||
if ($agent['id_os'] !== CLUSTER_OS_ID) {
|
||||
$onClickActionDeleteAgent = 'if (!confirm(\' '.__('Are you sure?').'\')) return false;';
|
||||
} else {
|
||||
echo ' onClick="if (!confirm(\' '.__('You are going to enable a cluster agent. Are you sure?').'\')) return false;">';
|
||||
$onClickActionDeleteAgent = 'if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;';
|
||||
}
|
||||
|
||||
echo html_print_image('images/lightbulb_off.png', true, ['alt' => __('Enable agent'), 'title' => __('Enable agent'), 'class' => 'filter_none']).'</a>';
|
||||
} else {
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
|
||||
disable_agent=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";
|
||||
if ($agent['id_os'] != 100) {
|
||||
echo '>';
|
||||
} else {
|
||||
echo ' onClick="if (!confirm(\' '.__('You are going to disable a cluster agent. Are you sure?').'\')) return false;">';
|
||||
}
|
||||
|
||||
echo html_print_image('images/lightbulb.png', true, ['alt' => __('Disable agent'), 'title' => __('Disable agent'), 'class' => 'invert_filter']).'</a>';
|
||||
$agentActionButtons[] = html_print_menu_button(
|
||||
[
|
||||
'href' => ui_get_full_url(
|
||||
sprintf(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&borrar_agente=%s&%s_agent=%s&group_id=%s&recursion=%s&search=%s&offset=%s&sort_field=%s&sort=%s&disabled=%s',
|
||||
$agent['id_agente'],
|
||||
$agentDisableEnableAction,
|
||||
$agent['id_agente'],
|
||||
$ag_group,
|
||||
$recursion,
|
||||
$search,
|
||||
'',
|
||||
$sortField,
|
||||
$sort,
|
||||
$disabled
|
||||
)
|
||||
),
|
||||
'onClick' => $onClickActionDeleteAgent,
|
||||
'image' => sprintf('images/delete.svg'),
|
||||
'title' => __('Delete agent'),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($check_aw && is_management_allowed() === true) {
|
||||
echo "<a href='index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&
|
||||
borrar_agente=".$agent['id_agente']."&group_id=$ag_group&recursion=$recursion&search=$search&offset=$offsetArg&sort_field=$sortField&sort=$sort&disabled=$disabled'";
|
||||
|
||||
if ($agent['id_os'] != 100) {
|
||||
echo ' onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">';
|
||||
} else {
|
||||
echo ' onClick="if (!confirm(\' '.__('WARNING! - You are going to delete a cluster agent. Are you sure?').'\')) return false;">';
|
||||
}
|
||||
|
||||
echo html_print_image('images/cross.png', true, ['border' => '0', 'class' => 'invert_filter']).'</a>';
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
// Action buttons column.
|
||||
$actionButtonsColumn = implode('', $agentActionButtons);
|
||||
// Defined class for action buttons.
|
||||
$tableAgents->cellclass[$key][6] = 'table_action_buttons';
|
||||
// Row data.
|
||||
$tableAgents->data[$key][0] = $agentNameColumn;
|
||||
$tableAgents->data[$key][0] .= $agentAvailableActionsColumn;
|
||||
$tableAgents->data[$key][1] = $remoteConfigurationColumn;
|
||||
$tableAgents->data[$key][2] = $osIconColumn;
|
||||
$tableAgents->data[$key][3] = $agentTypeIconColumn;
|
||||
$tableAgents->data[$key][4] = $agentGroupIconColumn;
|
||||
$tableAgents->data[$key][5] = $descriptionColumn;
|
||||
$tableAgents->data[$key][6] = $actionButtonsColumn;
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
ui_pagination($total_agents, "index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os", $offset);
|
||||
echo "<table width='100%'><tr><td align='right'>";
|
||||
html_print_table($tableAgents);
|
||||
|
||||
$tablePagination = ui_pagination(
|
||||
$total_agents,
|
||||
ui_get_url_refresh(
|
||||
[
|
||||
'group_id' => $group_id,
|
||||
'search' => $search,
|
||||
'sort_field' => $sortField,
|
||||
'sort' => $sort,
|
||||
'status' => $status,
|
||||
]
|
||||
),
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false,
|
||||
'dataTables_paginate paging_simple_numbers'
|
||||
);
|
||||
|
||||
/*
|
||||
ui_pagination(
|
||||
$total_agents,
|
||||
"index.php?sec=gagente&sec2=godmode/agentes/modificar_agente&group_id=$ag_group&recursion=$recursion&search=$search&sort_field=$sortField&sort=$sort&disabled=$disabled&os=$os",
|
||||
$offset
|
||||
);
|
||||
*/
|
||||
} else {
|
||||
$tablePagination = '';
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined agents') ]);
|
||||
}
|
||||
|
||||
if (check_acl($config['id_user'], 0, 'AW')) {
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
// Create agent button.
|
||||
echo '<div class="action-buttons">';
|
||||
echo '<form method="post" action="index.php?sec=gagente&sec2=godmode/agentes/configurar_agente">';
|
||||
html_print_submit_button(
|
||||
__('Create agent'),
|
||||
'crt-2',
|
||||
false,
|
||||
'class="sub next"'
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create agent'),
|
||||
'crt-2',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
[
|
||||
'type' => 'data_table',
|
||||
'class' => 'fixed_action_buttons',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</td></tr></table>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -396,9 +396,9 @@ if ($id_agent_module) {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
if (isset($moduletype) === false) {
|
||||
if (isset($moduletype) === false || $moduletype === 0) {
|
||||
$moduletype = (string) get_parameter('moduletype');
|
||||
if ($_SESSION['create_module'] && $config['welcome_state'] == 1) {
|
||||
if ((bool) $_SESSION['create_module'] === true && (bool) $config['welcome_state'] === true) {
|
||||
$moduletype = 'networkserver';
|
||||
}
|
||||
|
||||
|
@ -581,11 +581,11 @@ if ($__code_from !== 'policies') {
|
|||
$tag_acl = true;
|
||||
|
||||
// If edit a existing module.
|
||||
if (!empty($id_agent_module)) {
|
||||
if (empty($id_agent_module) === false) {
|
||||
$tag_acl = tags_check_acl_by_module($id_agent_module);
|
||||
}
|
||||
|
||||
if (!$tag_acl) {
|
||||
if ($tag_acl !== true) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
'Trying to access agent manager'
|
||||
|
@ -595,16 +595,15 @@ if ($__code_from !== 'policies') {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
switch ($moduletype) {
|
||||
case 'dataserver':
|
||||
case MODULE_DATA:
|
||||
$moduletype = MODULE_DATA;
|
||||
// Has remote configuration ?
|
||||
$remote_conf = false;
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
$remote_conf = enterprise_hook(
|
||||
$remote_conf = (bool) enterprise_hook(
|
||||
'config_agents_has_remote_configuration',
|
||||
[$id_agente]
|
||||
);
|
||||
|
@ -621,7 +620,7 @@ switch ($moduletype) {
|
|||
];
|
||||
include 'module_manager_editor_common.php';
|
||||
include 'module_manager_editor_data.php';
|
||||
if ($config['enterprise_installed'] && $remote_conf) {
|
||||
if ((bool) $config['enterprise_installed'] === true && $remote_conf === true) {
|
||||
if ($id_agent_module) {
|
||||
enterprise_include_once('include/functions_config_agents.php');
|
||||
$configuration_data = enterprise_hook(
|
||||
|
@ -649,7 +648,7 @@ switch ($moduletype) {
|
|||
4,
|
||||
5,
|
||||
];
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
$categories[] = 10;
|
||||
}
|
||||
|
||||
|
@ -700,7 +699,7 @@ switch ($moduletype) {
|
|||
$moduletype = MODULE_WEB;
|
||||
// Remove content of $ip_target when it is ip_agent because
|
||||
// it is used as HTTP auth (server) ....ONLY IN NEW MODULE!!!
|
||||
if (empty($id_agent_module)
|
||||
if (empty($id_agent_module) === true
|
||||
&& ($ip_target === agents_get_address($id_agente))
|
||||
) {
|
||||
$ip_target = '';
|
||||
|
@ -724,8 +723,8 @@ switch ($moduletype) {
|
|||
}
|
||||
|
||||
|
||||
if ($config['enterprise_installed'] && $id_agent_module) {
|
||||
if (policies_is_module_in_policy($id_agent_module)) {
|
||||
if ((bool) $config['enterprise_installed'] === true && $id_agent_module) {
|
||||
if (policies_is_module_in_policy($id_agent_module) === true) {
|
||||
policies_add_policy_linkation($id_agent_module);
|
||||
}
|
||||
}
|
||||
|
@ -733,27 +732,45 @@ if ($config['enterprise_installed'] && $id_agent_module) {
|
|||
echo '<h3 id="message" class="error invisible"></h3>';
|
||||
|
||||
// TODO: Change to the ui_print_error system.
|
||||
echo '<form method="post" id="module_form">';
|
||||
|
||||
ui_toggle(
|
||||
$outputForm = '<form method="post" id="module_form">';
|
||||
$outputForm .= ui_toggle(
|
||||
html_print_table($table_simple, true),
|
||||
__('Base options'),
|
||||
'<span class="subsection_header_title">'.__('Base options').'</span>',
|
||||
'',
|
||||
'',
|
||||
false
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'',
|
||||
'box-flat white_table_flex white_table_graph_fixed'
|
||||
);
|
||||
|
||||
ui_toggle(
|
||||
$outputForm .= ui_toggle(
|
||||
html_print_table($table_advanced, true),
|
||||
__('Advanced options')
|
||||
);
|
||||
ui_toggle(
|
||||
html_print_table($table_macros, true),
|
||||
__('Custom macros')
|
||||
'<span class="subsection_header_title">'.__('Advanced options').'</span>',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
'',
|
||||
'box-flat white_table_flex white_table_graph_fixed'
|
||||
);
|
||||
|
||||
if ($moduletype != 13) {
|
||||
ui_toggle(
|
||||
$outputForm .= ui_toggle(
|
||||
html_print_table($table_macros, true),
|
||||
'<span class="subsection_header_title">'.__('Custom macros').'</span>',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
'',
|
||||
'box-flat white_table_flex white_table_graph_fixed'
|
||||
);
|
||||
|
||||
if ((int) $moduletype !== 13) {
|
||||
$outputForm .= ui_toggle(
|
||||
html_print_table(
|
||||
$table_new_relations,
|
||||
true
|
||||
|
@ -761,51 +778,78 @@ if ($moduletype != 13) {
|
|||
$table_relations,
|
||||
true
|
||||
),
|
||||
__('Module relations')
|
||||
'<span class="subsection_header_title">'.__('Module relations').'<span>',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
'',
|
||||
'box-flat white_table_flex white_table_graph_fixed'
|
||||
);
|
||||
}
|
||||
|
||||
// Submit.
|
||||
echo '<div class="action-buttons" style="width: '.$table_simple->width.'">';
|
||||
if ($id_agent_module) {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
);
|
||||
html_print_input_hidden('update_module', 1);
|
||||
html_print_input_hidden('id_agent_module', $id_agent_module);
|
||||
html_print_input_hidden('id_module_type', $id_module_type);
|
||||
|
||||
if ($config['enterprise_installed'] && $remote_conf) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var check_remote_conf = true;
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
$actionButtons .= html_print_button(
|
||||
__('Delete'),
|
||||
'deleteModule',
|
||||
false,
|
||||
'window.location.assign(\'index.php?sec=gagente&tab=module&sec2=godmode/agentes/configurar_agente&id_agente='.$id_agente.'&delete_module='.$id_agent_module.')',
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
$actionButtons .= html_print_input_hidden('update_module', 1, true);
|
||||
$actionButtons .= html_print_input_hidden('id_agent_module', $id_agent_module, true);
|
||||
$actionButtons .= html_print_input_hidden('id_module_type', $id_module_type, true);
|
||||
} else {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Create'),
|
||||
'crtbutton',
|
||||
false,
|
||||
'class="sub wand"'
|
||||
[ 'icon' => 'wand' ],
|
||||
true
|
||||
);
|
||||
html_print_input_hidden('id_module', $moduletype);
|
||||
html_print_input_hidden('create_module', 1);
|
||||
|
||||
if ($config['enterprise_installed'] && $remote_conf) {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
var check_remote_conf = true;
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
$actionButtons .= html_print_input_hidden('id_module', $moduletype, true);
|
||||
$actionButtons .= html_print_input_hidden('create_module', 1, true);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$actionButtons .= html_print_go_back_button(
|
||||
'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=module&id_agente='.$id_agente,
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
$outputForm .= html_print_action_buttons(
|
||||
$actionButtons,
|
||||
['type' => 'form_action'],
|
||||
true
|
||||
);
|
||||
|
||||
if ((bool) $config['enterprise_installed'] === true && $remote_conf === true) {
|
||||
$outputForm .= '<script type="text/javascript">var check_remote_conf = true;</script>';
|
||||
}
|
||||
|
||||
$outputForm .= '</form>';
|
||||
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'max_floating_element_size',
|
||||
'content' => $outputForm,
|
||||
],
|
||||
false
|
||||
);
|
||||
|
||||
ui_require_jquery_file('ui');
|
||||
ui_require_jquery_file('form');
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,9 +1,8 @@
|
|||
<?php
|
||||
/**
|
||||
* Extension to manage a list of gateways and the node address where they should
|
||||
* point to.
|
||||
* Network module manager editor.
|
||||
*
|
||||
* @category Extensions
|
||||
* @category Modules
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
|
@ -15,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -28,10 +27,12 @@
|
|||
*/
|
||||
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
require_once $config['homedir'].'/include/functions_snmp_browser.php';
|
||||
$snmp_browser_path = (is_metaconsole()) ? '../../' : '';
|
||||
$snmp_browser_path = (is_metaconsole() === true) ? '../../' : '';
|
||||
$snmp_browser_path .= 'include/javascript/pandora_snmp_browser.js';
|
||||
$array_credential_identifier = CredentialStore::getKeys('CUSTOM');
|
||||
|
||||
echo "<script type='text/javascript' src='".$snmp_browser_path."'></script>";
|
||||
|
||||
// Define a custom action to save the OID selected
|
||||
|
@ -63,13 +64,13 @@ if (strstr($page, 'policy_modules') === false) {
|
|||
if ($disabledBecauseInPolicy) {
|
||||
$disabledTextBecauseInPolicy = 'readonly = "yes"';
|
||||
$classdisabledBecauseInPolicy = 'readonly';
|
||||
$largeclassdisabledBecauseInPolicy = 'class = readonly';
|
||||
$largeclassdisabledBecauseInPolicy = 'readonly';
|
||||
}
|
||||
}
|
||||
|
||||
define('ID_NETWORK_COMPONENT_TYPE', 2);
|
||||
|
||||
if (empty($edit_module)) {
|
||||
if (empty($edit_module) === true) {
|
||||
// Function in module_manager_editor_common.php.
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
}
|
||||
|
@ -78,12 +79,20 @@ $extra_title = __('Network server module');
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Target IP');
|
||||
if ((int) $id_module_type !== 6 && $id_module_type !== 7) {
|
||||
$data[1] = __('Port');
|
||||
}
|
||||
|
||||
$table_simple->rowclass['caption_target_ip'] = 'w50p';
|
||||
push_table_simple($data, 'caption_target_ip');
|
||||
|
||||
$data = [];
|
||||
// Show agent_for defect.
|
||||
if ($page == 'enterprise/godmode/policies/policy_modules') {
|
||||
if ($ip_target != 'auto' && $ip_target != '') {
|
||||
if ($page === 'enterprise/godmode/policies/policy_modules') {
|
||||
if (empty($ip_target) === false && $ip_target !== 'auto') {
|
||||
$custom_ip_target = $ip_target;
|
||||
$ip_target = 'custom';
|
||||
} else if ($ip_target == '') {
|
||||
} else if (empty($ip_target) === true) {
|
||||
$ip_target = 'force_pri';
|
||||
$custom_ip_target = '';
|
||||
} else {
|
||||
|
@ -95,7 +104,7 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
|
|||
$target_ip_values['force_pri'] = __('Force primary key');
|
||||
$target_ip_values['custom'] = __('Custom');
|
||||
|
||||
$data[1] = html_print_select(
|
||||
$data[0] = html_print_select(
|
||||
$target_ip_values,
|
||||
'ip_target',
|
||||
$ip_target,
|
||||
|
@ -105,39 +114,37 @@ if ($page == 'enterprise/godmode/policies/policy_modules') {
|
|||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p',
|
||||
false,
|
||||
'width:200px;'
|
||||
);
|
||||
$data[1] .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 15, 60, true);
|
||||
$data[0] .= html_print_input_text('custom_ip_target', $custom_ip_target, '', 0, 60, true, false, false, '', 'w100p');
|
||||
} else {
|
||||
if ($ip_target == 'auto') {
|
||||
if ($ip_target === 'auto') {
|
||||
$ip_target = agents_get_address($id_agente);
|
||||
}
|
||||
|
||||
$data[1] = html_print_input_text('ip_target', $ip_target, '', 15, 60, true);
|
||||
$data[0] = html_print_input_text('ip_target', $ip_target, '', 0, 60, true, false, false, '', 'w100p');
|
||||
}
|
||||
|
||||
// In ICMP modules, port is not configurable.
|
||||
if ($id_module_type >= 6 && $id_module_type <= 7) {
|
||||
$data[2] = '';
|
||||
$data[3] = '';
|
||||
} else {
|
||||
$data[2] = __('Port');
|
||||
$data[3] = html_print_input_text(
|
||||
if ($id_module_type !== 6 && $id_module_type !== 7) {
|
||||
$data[1] = html_print_input_text(
|
||||
'tcp_port',
|
||||
$tcp_port,
|
||||
'',
|
||||
5,
|
||||
0,
|
||||
20,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
$classdisabledBecauseInPolicy.' w100p',
|
||||
);
|
||||
} else {
|
||||
$data[1] = '';
|
||||
}
|
||||
|
||||
$table_simple->rowclass['target_ip'] = 'w50p';
|
||||
push_table_simple($data, 'target_ip');
|
||||
|
||||
$user_groups = users_get_groups(false, 'AR');
|
||||
|
@ -162,7 +169,10 @@ if (empty($credentials) === false) {
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Credential store');
|
||||
$data[1] = html_print_select(
|
||||
push_table_simple($data, 'caption_snmp_credentials');
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_select(
|
||||
$fields,
|
||||
'credentials',
|
||||
0,
|
||||
|
@ -178,102 +188,93 @@ if (empty($credentials) === false) {
|
|||
'',
|
||||
false
|
||||
);
|
||||
|
||||
push_table_simple($data, 'snmp_credentials');
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('SNMP community');
|
||||
$data[1] = __('SNMP version');
|
||||
$data[2] = __('SNMP OID');
|
||||
$data[2] .= ui_print_help_icon('snmpwalk', true);
|
||||
$table_simple->cellclass['snmp_1'][0] = 'w25p';
|
||||
$table_simple->cellclass['snmp_1'][1] = 'w25p';
|
||||
$table_simple->cellclass['snmp_1'][2] = 'w50p';
|
||||
push_table_simple($data, 'snmp_1');
|
||||
|
||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && isset($id_agent_module) === true) {
|
||||
$adopt = policies_is_module_adopt($id_agent_module);
|
||||
} else {
|
||||
$adopt = false;
|
||||
}
|
||||
|
||||
if ($adopt === false) {
|
||||
$snmpCommunityInput = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
0,
|
||||
60,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy.' w100p'
|
||||
);
|
||||
} else {
|
||||
$snmpCommunityInput = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
0,
|
||||
60,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
);
|
||||
}
|
||||
|
||||
$snmp_versions['1'] = 'v. 1';
|
||||
$snmp_versions['2'] = 'v. 2';
|
||||
$snmp_versions['2c'] = 'v. 2c';
|
||||
$snmp_versions['3'] = 'v. 3';
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('SNMP community');
|
||||
$adopt = false;
|
||||
if ($isFunctionPolicies !== ENTERPRISE_NOT_HOOK && isset($id_agent_module)) {
|
||||
$adopt = policies_is_module_adopt($id_agent_module);
|
||||
}
|
||||
$snmpVersionsInput = html_print_select(
|
||||
$snmp_versions,
|
||||
'snmp_version',
|
||||
($id_module_type >= 15 && $id_module_type <= 18) ? $snmp_version : 0,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy,
|
||||
'width: 100%',
|
||||
'',
|
||||
$classdisabledBecauseInPolicy.' w100p'
|
||||
);
|
||||
|
||||
if (!$adopt) {
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_input_text(
|
||||
'snmp_community',
|
||||
$snmp_community,
|
||||
'',
|
||||
15,
|
||||
60,
|
||||
true,
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
$data[2] = _('SNMP version');
|
||||
|
||||
if ($id_module_type >= 15 && $id_module_type <= 18) {
|
||||
$data[3] = html_print_select(
|
||||
$snmp_versions,
|
||||
'snmp_version',
|
||||
$snmp_version,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
} else {
|
||||
$data[3] = html_print_select(
|
||||
$snmp_versions,
|
||||
'snmp_version',
|
||||
0,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy,
|
||||
false,
|
||||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
}
|
||||
|
||||
if ($disabledBecauseInPolicy) {
|
||||
if ($disabledBecauseInPolicy === true) {
|
||||
if ($id_module_type >= 15 && $id_module_type <= 18) {
|
||||
$data[3] .= html_print_input_hidden('snmp_version', $tcp_send, true);
|
||||
$snmpVersionsInput .= html_print_input_hidden('snmp_version', $tcp_send, true);
|
||||
}
|
||||
}
|
||||
|
||||
push_table_simple($data, 'snmp_1');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('SNMP OID');
|
||||
$data[1] = '<span class="left w50p">';
|
||||
$data[1] .= html_print_input_text(
|
||||
$table_simple->cellclass['snmp_2'][0] = 'w25p';
|
||||
$table_simple->cellclass['snmp_2'][1] = 'w25p';
|
||||
$table_simple->cellclass['snmp_2'][2] = 'w50p';
|
||||
|
||||
$data[0] = $snmpCommunityInput;
|
||||
$data[1] = $snmpVersionsInput;
|
||||
$data[2] = html_print_input_text(
|
||||
'snmp_oid',
|
||||
$snmp_oid,
|
||||
'',
|
||||
30,
|
||||
0,
|
||||
255,
|
||||
true,
|
||||
$disabledBecauseInPolicy,
|
||||
|
@ -281,8 +282,8 @@ $data[1] .= html_print_input_text(
|
|||
'',
|
||||
$classdisabledBecauseInPolicy
|
||||
);
|
||||
$data[1] .= '<span class="invisible" id="oid">';
|
||||
$data[1] .= html_print_select(
|
||||
$data[2] .= '<span class="invisible" id="oid">';
|
||||
$data[2] .= html_print_select(
|
||||
[],
|
||||
'select_snmp_oid',
|
||||
$snmp_oid,
|
||||
|
@ -295,7 +296,7 @@ $data[1] .= html_print_select(
|
|||
'',
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
$data[1] .= html_print_image(
|
||||
$data[2] .= html_print_image(
|
||||
'images/edit.png',
|
||||
true,
|
||||
[
|
||||
|
@ -303,26 +304,27 @@ $data[1] .= html_print_image(
|
|||
'id' => 'edit_oid',
|
||||
]
|
||||
);
|
||||
$data[1] .= '</span>';
|
||||
$data[1] .= '</span><span class="right w50p right">';
|
||||
$data[1] .= html_print_button(
|
||||
__('SNMP walk'),
|
||||
$data[2] .= '</span>';
|
||||
$data[2] .= html_print_button(
|
||||
__('SNMP Walk'),
|
||||
'snmp_walk',
|
||||
false,
|
||||
'snmpBrowserWindow()',
|
||||
'class="sub next"',
|
||||
[ 'mode' => 'link' ],
|
||||
true
|
||||
);
|
||||
$data[1] .= ui_print_help_icon('snmpwalk', true);
|
||||
$data[1] .= '</span>';
|
||||
$table_simple->colspan['snmp_2'][1] = 3;
|
||||
|
||||
push_table_simple($data, 'snmp_2');
|
||||
|
||||
// Advanced stuff.
|
||||
$data = [];
|
||||
$data[0] = __('TCP send');
|
||||
$data[1] = html_print_textarea(
|
||||
$data[1] = __('TCP receive');
|
||||
|
||||
push_table_simple($data, 'caption_tcp_send_receive');
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_textarea(
|
||||
'tcp_send',
|
||||
2,
|
||||
65,
|
||||
|
@ -331,11 +333,6 @@ $data[1] = html_print_textarea(
|
|||
true,
|
||||
$largeclassdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->colspan['tcp_send'][1] = 3;
|
||||
|
||||
push_table_simple($data, 'tcp_send');
|
||||
|
||||
$data[0] = __('TCP receive');
|
||||
$data[1] = html_print_textarea(
|
||||
'tcp_rcv',
|
||||
2,
|
||||
|
@ -345,9 +342,8 @@ $data[1] = html_print_textarea(
|
|||
true,
|
||||
$largeclassdisabledBecauseInPolicy
|
||||
);
|
||||
$table_simple->colspan['tcp_receive'][1] = 3;
|
||||
|
||||
push_table_simple($data, 'tcp_receive');
|
||||
push_table_simple($data, 'tcp_send_receive');
|
||||
|
||||
if ($id_module_type < 8 || $id_module_type > 11) {
|
||||
// NOT TCP.
|
||||
|
@ -475,33 +471,41 @@ push_table_simple($data, 'field_snmpv3_row3');
|
|||
|
||||
$data = [];
|
||||
$data[0] = __('Command');
|
||||
$data[1] = html_print_input_text_extended(
|
||||
'command_text',
|
||||
$command_text,
|
||||
'command_text',
|
||||
'',
|
||||
100,
|
||||
10000,
|
||||
$disabledBecauseInPolicy,
|
||||
'',
|
||||
$largeClassDisabledBecauseInPolicy,
|
||||
true
|
||||
);
|
||||
$data[1] .= ui_print_help_tip(
|
||||
$data[0] .= ui_print_help_tip(
|
||||
__(
|
||||
'Please use single quotation marks when necessary. '."\n".'
|
||||
If double quotation marks are needed, please escape them with a backslash (\")'
|
||||
),
|
||||
true
|
||||
);
|
||||
$table_simple->colspan['row-cmd-row-1'][1] = 3;
|
||||
push_table_simple($data, 'caption-row-cmd-row-1');
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_input_text_extended(
|
||||
'command_text',
|
||||
$command_text,
|
||||
'command_text',
|
||||
'',
|
||||
0,
|
||||
10000,
|
||||
$disabledBecauseInPolicy,
|
||||
'',
|
||||
$largeClassDisabledBecauseInPolicy.' class="w100p"',
|
||||
true
|
||||
);
|
||||
$table_simple->rowclass['row-cmd-row-1'] = 'w100p';
|
||||
push_table_simple($data, 'row-cmd-row-1');
|
||||
|
||||
require_once $config['homedir'].'/include/class/CredentialStore.class.php';
|
||||
$array_credential_identifier = CredentialStore::getKeys('CUSTOM');
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Credential identifier');
|
||||
$data[1] = html_print_select(
|
||||
$data[1] = __('Connection method');
|
||||
// $table_simple->rowclass['row-cmd-row-1'] = 'w100p';
|
||||
$table_simple->cellclass['caption-row-cmd-row-2'][0] = 'w50p';
|
||||
$table_simple->cellclass['caption-row-cmd-row-2'][1] = 'w50p';
|
||||
push_table_simple($data, 'caption-row-cmd-row-2');
|
||||
|
||||
$data = [];
|
||||
$data[0] = html_print_select(
|
||||
$array_credential_identifier,
|
||||
'command_credential_identifier',
|
||||
$command_credential_identifier,
|
||||
|
@ -512,10 +516,18 @@ $data[1] = html_print_select(
|
|||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
$disabledBecauseInPolicy,
|
||||
'width: 100%;'
|
||||
);
|
||||
|
||||
$data[1] .= '<br> <br><a class="info_cell" href="'.ui_get_full_url('index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox').'">'.__('Manage credentials').'</a>';
|
||||
$data[0] .= html_print_button(
|
||||
__('Manage credentials'),
|
||||
'manage_credentials_button',
|
||||
false,
|
||||
'window.location.assign(\'index.php?sec=gmodules&sec2=godmode/groups/group_list&tab=credbox\')',
|
||||
[ 'mode' => 'link' ],
|
||||
true
|
||||
);
|
||||
|
||||
$array_os = [
|
||||
'inherited' => __('Inherited'),
|
||||
|
@ -523,8 +535,7 @@ $array_os = [
|
|||
'windows' => __('Windows remote'),
|
||||
];
|
||||
|
||||
$data[2] = __('Connection method');
|
||||
$data[3] = html_print_select(
|
||||
$data[1] = html_print_select(
|
||||
$array_os,
|
||||
'command_os',
|
||||
$command_os,
|
||||
|
@ -535,9 +546,11 @@ $data[3] = html_print_select(
|
|||
false,
|
||||
false,
|
||||
'',
|
||||
$disabledBecauseInPolicy
|
||||
$disabledBecauseInPolicy,
|
||||
'width: 100%;'
|
||||
);
|
||||
|
||||
$table_simple->cellclass['row-cmd-row-2'][0] = 'w50p';
|
||||
$table_simple->cellclass['row-cmd-row-2'][1] = 'w50p';
|
||||
push_table_simple($data, 'row-cmd-row-2');
|
||||
|
||||
if ($id_module_type !== 34
|
||||
|
@ -545,7 +558,9 @@ if ($id_module_type !== 34
|
|||
&& $id_module_type !== 36
|
||||
&& $id_module_type !== 37
|
||||
) {
|
||||
$table_simple->rowstyle['caption-row-cmd-row-1'] = 'display: none;';
|
||||
$table_simple->rowstyle['row-cmd-row-1'] = 'display: none;';
|
||||
$table_simple->rowstyle['caption-row-cmd-row-2'] = 'display: none;';
|
||||
$table_simple->rowstyle['row-cmd-row-2'] = 'display: none;';
|
||||
}
|
||||
|
||||
|
@ -581,9 +596,13 @@ $(document).ready (function () {
|
|||
(this.value == "37")
|
||||
) {
|
||||
$("#simple-row-cmd-row-1").attr("style", "");
|
||||
$("#simple-caption-row-cmd-row-1").attr("style", "");
|
||||
$("#simple-row-cmd-row-2").attr("style", "");
|
||||
$("#simple-caption-row-cmd-row-2").attr("style", "");
|
||||
} else {
|
||||
$("#simple-caption-row-cmd-row-1").css("display", "none");
|
||||
$("#simple-row-cmd-row-1").css("display", "none");
|
||||
$("#simple-caption-row-cmd-row-2").css("display", "none");
|
||||
$("#simple-row-cmd-row-2").css("display", "none");
|
||||
}
|
||||
});
|
||||
|
@ -704,7 +723,7 @@ $(document).ready (function () {
|
|||
$("#text-custom_ip_target").hide();
|
||||
}
|
||||
$('#ip_target').change(function() {
|
||||
if($(this).val() == 'custom') {
|
||||
if($(this).val() === 'custom') {
|
||||
$("#text-custom_ip_target").show();
|
||||
}
|
||||
else{
|
||||
|
|
|
@ -1,16 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* Prediction module manager editor.
|
||||
*
|
||||
* @category Modules
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
enterprise_include_once('include/functions_policies.php');
|
||||
enterprise_include_once('godmode/agentes/module_manager_editor_prediction.php');
|
||||
require_once 'include/functions_agents.php';
|
||||
|
@ -31,7 +46,7 @@ $is_service = false;
|
|||
$is_synthetic = false;
|
||||
$is_synthetic_avg = false;
|
||||
$ops = false;
|
||||
if ($row !== false && is_array($row)) {
|
||||
if ($row !== false && is_array($row) === true) {
|
||||
$prediction_module = $row['prediction_module'];
|
||||
$custom_integer_2 = $row['custom_integer_2'];
|
||||
// Services are an Enterprise feature.
|
||||
|
@ -49,19 +64,14 @@ if ($row !== false && is_array($row)) {
|
|||
[$id_agente_modulo]
|
||||
);
|
||||
|
||||
|
||||
$ops = json_decode($ops_json, true);
|
||||
|
||||
|
||||
|
||||
// Erase the key of array serialize as <num>**
|
||||
// Erase the key of array serialize as <num>**.
|
||||
$chunks = explode('**', reset(array_keys($ops)));
|
||||
|
||||
$first_op = explode('_', $chunks[1]);
|
||||
|
||||
|
||||
|
||||
if (isset($first_op[1]) && $first_op[1] == 'avg') {
|
||||
if (isset($first_op[1]) === true && $first_op[1] === 'avg') {
|
||||
$selected = 'synthetic_avg_selected';
|
||||
} else {
|
||||
$selected = 'synthetic_selected';
|
||||
|
@ -109,23 +119,28 @@ $extra_title = __('Prediction server module');
|
|||
$data = [];
|
||||
$data[0] = __('Source module');
|
||||
$data[0] .= ui_print_help_icon('prediction_source_module', true);
|
||||
$data[1] = '';
|
||||
push_table_simple($data, 'caption_module_service_synthetic_selector');
|
||||
// Services and Synthetic are an Enterprise feature.
|
||||
$module_service_synthetic_selector = enterprise_hook('get_module_service_synthetic_selector', [$selected]);
|
||||
if ($module_service_synthetic_selector !== ENTERPRISE_NOT_HOOK) {
|
||||
$data[1] = $module_service_synthetic_selector;
|
||||
$data = [];
|
||||
$data[0] = $module_service_synthetic_selector;
|
||||
|
||||
$table_simple->colspan['module_service_synthetic_selector'][1] = 3;
|
||||
push_table_simple($data, 'module_service_synthetic_selector');
|
||||
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
}
|
||||
|
||||
$data[1] = '<div id="module_data" class="w50p float-left top-1em">';
|
||||
$data[1] .= html_print_label(__('Agent'), 'agent_name', true).'<br/>';
|
||||
$data = [];
|
||||
$data[0] = __('Agent');
|
||||
$data[1] = __('Module');
|
||||
$data[2] = __('Period');
|
||||
$table_simple->cellclass['caption_prediction_module'][0] = 'w33p';
|
||||
$table_simple->cellclass['caption_prediction_module'][1] = 'w33p';
|
||||
$table_simple->cellclass['caption_prediction_module'][2] = 'w33p';
|
||||
push_table_simple($data, 'caption_prediction_module');
|
||||
|
||||
// Get module and agent of the target prediction module
|
||||
$data = [];
|
||||
// Get module and agent of the target prediction module.
|
||||
if (empty($prediction_module) === false) {
|
||||
$id_agente_clean = modules_get_agentmodule_agent($prediction_module);
|
||||
$prediction_module_agent = modules_get_agentmodule_agent_name($prediction_module);
|
||||
|
@ -137,7 +152,6 @@ if (empty($prediction_module) === false) {
|
|||
$agent_alias = '';
|
||||
}
|
||||
|
||||
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -147,106 +161,105 @@ $params['javascript_is_function_select'] = true;
|
|||
$params['selectbox_id'] = 'prediction_module';
|
||||
$params['none_module_text'] = __('Select Module');
|
||||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['input_style'] = 'width: 100%;';
|
||||
$params['hidden_input_idagent_id'] = 'hidden-id_agente_module_prediction';
|
||||
$data[1] .= ui_print_agent_autocomplete_input($params);
|
||||
$data[0] = ui_print_agent_autocomplete_input($params);
|
||||
|
||||
$data[1] .= '<br />';
|
||||
$data[1] .= html_print_label(__('Module'), 'prediction_module', true).'<br />';
|
||||
if ($id_agente) {
|
||||
$sql = 'SELECT id_agente_modulo, nombre
|
||||
FROM tagente_modulo
|
||||
WHERE delete_pending = 0
|
||||
AND history_data = 1
|
||||
AND id_agente = '.$id_agente_clean.'
|
||||
AND id_agente_modulo <> '.$id_agente_modulo;
|
||||
|
||||
$data[1] .= html_print_input(
|
||||
[
|
||||
'type' => 'select_from_sql',
|
||||
'sql' => $sql,
|
||||
'name' => 'prediction_module',
|
||||
'selected' => $prediction_module,
|
||||
'nothing' => __('Select Module'),
|
||||
'nothing_value' => 0,
|
||||
'return' => true,
|
||||
]
|
||||
if ($id_agente > 0) {
|
||||
$predictionModuleInput = html_print_select_from_sql(
|
||||
'SELECT id_agente_modulo, nombre
|
||||
FROM tagente_modulo
|
||||
WHERE delete_pending = 0
|
||||
AND history_data = 1
|
||||
AND id_agente = '.$id_agente_clean.'
|
||||
AND id_agente_modulo <> '.$id_agente_modulo,
|
||||
'prediction_module',
|
||||
$prediction_module,
|
||||
'',
|
||||
__('Select Module'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
'width: 100%;'
|
||||
);
|
||||
} else {
|
||||
$data[1] .= '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
||||
$predictionModuleInput = '<select id="prediction_module" name="custom_integer_1" disabled="disabled"><option value="0">Select an Agent first</option></select>';
|
||||
}
|
||||
|
||||
$data[1] .= '<br />';
|
||||
$data[1] .= html_print_label(__('Period'), 'custom_integer_2', true).'<br/>';
|
||||
|
||||
$periods[0] = __('Weekly');
|
||||
$periods[1] = __('Monthly');
|
||||
$periods[2] = __('Daily');
|
||||
$data[1] .= html_print_select($periods, 'custom_integer_2', $custom_integer_2, '', '', 0, true);
|
||||
|
||||
$data[1] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
||||
$data[1] .= '</div>';
|
||||
|
||||
$table_simple->colspan['prediction_module'][1] = 3;
|
||||
$data[1] = $predictionModuleInput;
|
||||
$data[2] = html_print_select([__('Weekly'), __('Monthly'), __('Daily')], 'custom_integer_2', $custom_integer_2, '', '', 0, true, false, true, '', false, 'width: 100%;');
|
||||
$data[2] .= html_print_input_hidden('id_agente_module_prediction', $id_agente, true);
|
||||
$table_simple->cellclass['prediction_module'][0] = 'w33p';
|
||||
$table_simple->cellclass['prediction_module'][1] = 'w33p';
|
||||
$table_simple->cellclass['prediction_module'][2] = 'w33p';
|
||||
push_table_simple($data, 'prediction_module');
|
||||
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
$data[0] = __('Calculation type');
|
||||
$data[1] = __('Future estimation');
|
||||
$data[2] = __('Limit value');
|
||||
$table_simple->cellclass['caption_capacity_planning'][0] = 'w33p';
|
||||
$table_simple->cellclass['caption_capacity_planning'][1] = 'w33p';
|
||||
$table_simple->cellclass['caption_capacity_planning'][2] = 'w33p';
|
||||
push_table_simple($data, 'caption_capacity_planning');
|
||||
|
||||
$data[1] .= html_print_label(__('Calculation type'), 'estimation_type', true).'<br/>';
|
||||
$data[1] .= html_print_input(
|
||||
$data = [];
|
||||
$data[0] = html_print_select(
|
||||
[
|
||||
'type' => 'select',
|
||||
'return' => 'true',
|
||||
'name' => 'estimation_type',
|
||||
'class' => 'w250px',
|
||||
'fields' => [
|
||||
'estimation_absolute' => __('Estimated absolute value'),
|
||||
'estimation_calculation' => __('Calculation of days to reach limit'),
|
||||
],
|
||||
'selected' => $estimation_type,
|
||||
'estimation_absolute' => __('Estimated absolute value'),
|
||||
'estimation_calculation' => __('Calculation of days to reach limit'),
|
||||
],
|
||||
'div',
|
||||
false
|
||||
'estimation_type',
|
||||
$estimation_type,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%;'
|
||||
);
|
||||
|
||||
$data[1] .= '<div id="estimation_interval_row">';
|
||||
$data[1] .= html_print_label(__('Future estimation'), 'estimation_interval', true).'<br/>';
|
||||
$data[1] .= html_print_input(
|
||||
$data[1] = html_print_input(
|
||||
[
|
||||
'type' => 'interval',
|
||||
'return' => 'true',
|
||||
'name' => 'estimation_interval',
|
||||
'value' => $estimation_interval,
|
||||
'class' => 'w100p',
|
||||
],
|
||||
'div',
|
||||
false
|
||||
);
|
||||
$data[1] .= '</div>';
|
||||
|
||||
|
||||
$data[1] .= '<div id="estimation_days_row">';
|
||||
$data[1] .= html_print_label(__('Limit value'), 'estimation_days', true).'<br/>';
|
||||
$data[1] .= html_print_input(
|
||||
$data[2] = html_print_input(
|
||||
[
|
||||
'type' => 'number',
|
||||
'return' => 'true',
|
||||
'id' => 'estimation_days',
|
||||
'name' => 'estimation_days',
|
||||
'value' => $estimation_interval,
|
||||
'class' => 'w100p',
|
||||
]
|
||||
);
|
||||
$data[1] .= '</div>';
|
||||
|
||||
$table_simple->cellclass['capacity_planning'][0] = 'w33p';
|
||||
$table_simple->cellclass['capacity_planning'][1] = 'w33p';
|
||||
$table_simple->cellclass['capacity_planning'][2] = 'w33p';
|
||||
push_table_simple($data, 'capacity_planning');
|
||||
|
||||
// Services are an Enterprise feature.
|
||||
$selector_form = enterprise_hook('get_selector_form', [$custom_integer_1]);
|
||||
if ($selector_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
$data[1] = $selector_form;
|
||||
$data[0] = $selector_form['caption'];
|
||||
push_table_simple($data, 'caption_service_module');
|
||||
|
||||
$table_simple->colspan['service_module'][1] = 3;
|
||||
$data = [];
|
||||
$data[0] = $selector_form['input'];
|
||||
push_table_simple($data, 'service_module');
|
||||
}
|
||||
|
||||
|
@ -254,38 +267,31 @@ if ($selector_form !== ENTERPRISE_NOT_HOOK) {
|
|||
$synthetic_module_form = enterprise_hook('get_synthetic_module_form');
|
||||
if ($synthetic_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
$data[1] = $synthetic_module_form;
|
||||
|
||||
$data[0] = $synthetic_module_form;
|
||||
push_table_simple($data, 'synthetic_module');
|
||||
}
|
||||
|
||||
$trending_module_form = enterprise_hook('get_trending_module_form', [$custom_string_1]);
|
||||
if ($trending_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
$data[1] .= $trending_module_form;
|
||||
$data[0] = $trending_module_form['caption'];
|
||||
push_table_simple($data, 'caption_trending_module');
|
||||
|
||||
$data = [];
|
||||
$data[0] = $trending_module_form['input'];
|
||||
push_table_simple($data, 'trending_module');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Netflow modules are an Enterprise feature.
|
||||
$netflow_module_form = enterprise_hook('get_netflow_module_form', [$custom_integer_1]);
|
||||
if ($netflow_module_form !== ENTERPRISE_NOT_HOOK) {
|
||||
$data = [];
|
||||
$data[0] = '';
|
||||
$data[1] = $netflow_module_form;
|
||||
|
||||
$table_simple->colspan['netflow_module_form'][1] = 3;
|
||||
push_table_simple($data, 'netflow_module');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Removed common useless parameter
|
||||
// Removed common useless parameter.
|
||||
unset($table_advanced->data[3]);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* Web Module Editor for Module Manager.
|
||||
* Web module manager editor.
|
||||
*
|
||||
* @category Module manager
|
||||
* @category Modules
|
||||
* @package Pandora FMS
|
||||
* @subpackage Module manager
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -32,9 +32,11 @@ enterprise_include_once('include/functions_policies.php');
|
|||
$disabledBecauseInPolicy = false;
|
||||
$disabledTextBecauseInPolicy = '';
|
||||
$classdisabledBecauseInPolicy = '';
|
||||
$page = get_parameter('page', '');
|
||||
$page = get_parameter('page', '');
|
||||
$id_policy_module = (int) get_parameter('id_policy_module');
|
||||
|
||||
if (strstr($page, 'policy_modules') === false) {
|
||||
if ($config['enterprise_installed']) {
|
||||
if ((bool) $config['enterprise_installed'] === true) {
|
||||
if (policies_is_module_linked($id_agent_module) == 1) {
|
||||
$disabledBecauseInPolicy = 1;
|
||||
} else {
|
||||
|
@ -44,7 +46,7 @@ if (strstr($page, 'policy_modules') === false) {
|
|||
$disabledBecauseInPolicy = false;
|
||||
}
|
||||
|
||||
if ($disabledBecauseInPolicy) {
|
||||
if ((bool) $disabledBecauseInPolicy === true) {
|
||||
$disabledTextBecauseInPolicy = 'disabled = "disabled"';
|
||||
$classdisabledBecauseInPolicy = 'readonly';
|
||||
}
|
||||
|
@ -62,45 +64,47 @@ html_print_div(
|
|||
]
|
||||
);
|
||||
|
||||
if (is_int($id_agent_module) && $id_agent_module !== 0) {
|
||||
if (is_int($id_agent_module) === true && $id_agent_module !== 0) {
|
||||
include_once $config['homedir'].'/include/ajax/web_server_module_debug.php';
|
||||
}
|
||||
|
||||
define('ID_NETWORK_COMPONENT_TYPE', 7);
|
||||
|
||||
if (!$tcp_port && !$id_agent_module) {
|
||||
if (empty($tcp_port) === true && $id_agent_module !== 0) {
|
||||
$tcp_port = 80;
|
||||
}
|
||||
|
||||
// plugin_server is the browser id
|
||||
if ($plugin_user == '' && !$id_agent_module) {
|
||||
// Plugin_server is the browser id.
|
||||
if (empty($plugin_user) === true && $id_agent_module !== 0) {
|
||||
$plugin_user = get_product_name().' / Webcheck';
|
||||
}
|
||||
|
||||
// plugin_server is the referer
|
||||
if ($plugin_pass == '' && !$id_agent_module) {
|
||||
// Plugin_server is the referer.
|
||||
if (empty($plugin_pass) === true && $id_agent_module !== 0) {
|
||||
$plugin_pass = 1;
|
||||
}
|
||||
|
||||
if (empty($edit_module)) {
|
||||
// Function in module_manager_editor_common.php
|
||||
if (empty($edit_module) === true) {
|
||||
add_component_selection(ID_NETWORK_COMPONENT_TYPE);
|
||||
} else {
|
||||
// TODO: Print network component if available
|
||||
}
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Web checks');
|
||||
$suc_err_check = ' <span id="check_conf_suc" class="checks invisible">'.html_print_image('/images/ok.png', true).'</span>';
|
||||
$suc_err_check .= ' <span id="check_conf_err" class="checks invisible">'.html_print_image('/images/error_red.png', true).'</span>';
|
||||
$data[1] = $suc_err_check;
|
||||
push_table_simple($data, 'header_web_checks');
|
||||
|
||||
$adopt = false;
|
||||
if (isset($id_agent_module)) {
|
||||
if (isset($id_agent_module) === true && $id_agent_module !== 0) {
|
||||
$adopt = enterprise_hook('policies_is_module_adopt', [$id_agent_module]);
|
||||
}
|
||||
|
||||
$id_policy_module = (int) get_parameter('id_policy_module', '');
|
||||
if ($id_policy_module) {
|
||||
if ($id_policy_module > 0) {
|
||||
$module = enterprise_hook('policies_get_module', [$id_policy_module]);
|
||||
$plugin_parameter = $module['plugin_parameter'];
|
||||
} else {
|
||||
$plugin_parameter = '';
|
||||
}
|
||||
|
||||
$plugin_parameter_split = explode('
', $plugin_parameter);
|
||||
|
@ -121,7 +125,7 @@ foreach ($plugin_parameter_split as $key => $value) {
|
|||
}
|
||||
|
||||
if ((bool) $adopt === false) {
|
||||
$data[1] = html_print_textarea(
|
||||
$textareaPluginParameter = html_print_textarea(
|
||||
'plugin_parameter',
|
||||
15,
|
||||
65,
|
||||
|
@ -131,7 +135,7 @@ if ((bool) $adopt === false) {
|
|||
'resizev'
|
||||
);
|
||||
} else {
|
||||
$data[1] = html_print_textarea(
|
||||
$textareaPluginParameter = html_print_textarea(
|
||||
'plugin_parameter',
|
||||
15,
|
||||
65,
|
||||
|
@ -141,7 +145,9 @@ if ((bool) $adopt === false) {
|
|||
);
|
||||
}
|
||||
|
||||
$table_simple->colspan['web_checks'][1] = 2;
|
||||
$data = [];
|
||||
$data[0] = $textareaPluginParameter;
|
||||
push_table_simple($data, 'textarea_web_checks');
|
||||
|
||||
// Disable debug button if module has not started.
|
||||
if ($id_agent_module > 0
|
||||
|
@ -158,35 +164,43 @@ if ($id_agent_module > 0
|
|||
$hintDebug = __('Debug this module once it has been initialized');
|
||||
}
|
||||
|
||||
$suc_err_check = ' <span id="check_conf_suc" class="checks invisible">'.html_print_image('/images/ok.png', true).'</span>';
|
||||
$suc_err_check .= ' <span id="check_conf_err" class="checks invisible">'.html_print_image('/images/error_red.png', true).'</span>';
|
||||
$data[2] = html_print_button(
|
||||
$actionButtons = html_print_button(
|
||||
__('Load basic'),
|
||||
'btn_loadbasic',
|
||||
false,
|
||||
'',
|
||||
'class="sub config"',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'mini secondary',
|
||||
],
|
||||
true
|
||||
).ui_print_help_tip(__('Load a basic structure on Web Checks'), true);
|
||||
$data[2] .= '<br><br>'.html_print_button(
|
||||
$actionButtons .= html_print_button(
|
||||
__('Check'),
|
||||
'btn_checkconf',
|
||||
false,
|
||||
'',
|
||||
'class="sub upd"',
|
||||
[
|
||||
'icon' => 'update',
|
||||
'mode' => 'mini secondary',
|
||||
],
|
||||
true
|
||||
).ui_print_help_tip(__('Check the correct structure of the WebCheck'), true).$suc_err_check;
|
||||
$data[2] .= '<br><br>'.html_print_button(
|
||||
).ui_print_help_tip(__('Check the correct structure of the WebCheck'), true);
|
||||
$actionButtons .= html_print_button(
|
||||
__('Debug'),
|
||||
'btn_debugModule',
|
||||
$disableDebug,
|
||||
'',
|
||||
'class="sub config" onClick="loadDebugWindow()"',
|
||||
'loadDebugWindow()',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'mini secondary ',
|
||||
],
|
||||
true
|
||||
).ui_print_help_tip($hintDebug, true);
|
||||
|
||||
|
||||
push_table_simple($data, 'web_checks');
|
||||
$data = [];
|
||||
$data[0] = $actionButtons;
|
||||
push_table_simple($data, 'buttons_web_checks');
|
||||
|
||||
$http_checks_type = [
|
||||
0 => 'Anyauth',
|
||||
|
|
|
@ -117,79 +117,91 @@ if ($not_found) {
|
|||
$table = new StdClass();
|
||||
$table->id = 'form_editor';
|
||||
|
||||
$table->width = '98%';
|
||||
$table->class = 'databox_color';
|
||||
|
||||
$table->head = [];
|
||||
|
||||
$table->size = [];
|
||||
$table->size[0] = '30%';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filter-table-adv';
|
||||
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold; width: 150px;';
|
||||
$table->style[0] = 'width: 50%';
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
);
|
||||
$table->data[1][0] = __('Group');
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
).'</div>';
|
||||
|
||||
$table->data[2][0] = __('Node radius');
|
||||
$table->data[2][1] = html_print_input_text(
|
||||
'node_radius',
|
||||
$node_radius,
|
||||
'',
|
||||
2,
|
||||
10,
|
||||
true
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
30,
|
||||
100,
|
||||
true
|
||||
),
|
||||
[ 'div_class' => 'w50p' ]
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Description');
|
||||
$table->data[3][1] = html_print_textarea('description', 7, 25, $description, '', true);
|
||||
$table->data[1][] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
),
|
||||
[ 'div_class' => 'w50p' ]
|
||||
);
|
||||
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Node radius'),
|
||||
html_print_input_text(
|
||||
'node_radius',
|
||||
$node_radius,
|
||||
'',
|
||||
2,
|
||||
10,
|
||||
true
|
||||
),
|
||||
[ 'div_class' => 'w50p' ]
|
||||
);
|
||||
|
||||
$table->data[3][] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea(
|
||||
'description',
|
||||
7,
|
||||
25,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '<form method="post" action="index.php?sec=network&sec2=operation/agentes/pandora_networkmap">';
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
echo "<div style='width: ".$table->width."; text-align: right; margin-top:20px;'>";
|
||||
if ($new_empty_networkmap) {
|
||||
html_print_input_hidden('save_empty_networkmap', 1);
|
||||
html_print_submit_button(
|
||||
__('Save networkmap'),
|
||||
'crt',
|
||||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
$titleButton = __('Save networkmap');
|
||||
}
|
||||
|
||||
if ($edit_networkmap) {
|
||||
html_print_input_hidden('id_networkmap', $id);
|
||||
html_print_input_hidden('update_empty_networkmap', 1);
|
||||
html_print_submit_button(
|
||||
__('Update networkmap'),
|
||||
'crt',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
);
|
||||
$titleButton = __('Update networkmap');
|
||||
}
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
$titleButton,
|
||||
'crt',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
|
|
@ -419,7 +419,10 @@ $row[] = html_print_submit_button(
|
|||
__('Search'),
|
||||
'search',
|
||||
false,
|
||||
'class="sub search"',
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
|
@ -632,17 +635,23 @@ if ($downtimes === false && $filter_performed === false) {
|
|||
// Info message.
|
||||
echo '<div class="nf">'.__('No scheduled downtime').'</div>';
|
||||
|
||||
echo '<div class="action-buttons w100p" >';
|
||||
|
||||
// Create button.
|
||||
if ($write_permisson === true) {
|
||||
echo ' ';
|
||||
echo '<form method="post" class="display_in" action="'.$url_editor.'">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Create'),
|
||||
'create',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
} else {
|
||||
// Has downtimes.
|
||||
echo '<form method="post" action="'.$url_list.'">';
|
||||
|
|
|
@ -122,8 +122,6 @@ if ($fields_selected[0] != '') {
|
|||
}
|
||||
}
|
||||
|
||||
echo '<h3>'.__('Show monitor detail fields').'</h3>';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
@ -161,6 +159,12 @@ foreach ($fields_available as $key => $available) {
|
|||
}
|
||||
}
|
||||
|
||||
// General title.
|
||||
$generalTitleContent = [];
|
||||
$generalTitleContent[] = html_print_div([ 'style' => 'width: 10px; flex: 0 0 auto; margin-right: 5px;}', 'class' => 'section_table_title_line' ], true);
|
||||
$generalTitleContent[] = html_print_div([ 'class' => 'section_table_title', 'content' => __('Show monitor detail fields')], true);
|
||||
$titledata[0] = html_print_div(['class' => 'flex-row-center', 'content' => implode('', $generalTitleContent) ], true);
|
||||
$table->data['general_title'] = $titledata;
|
||||
$table->data[0][0] = '<b>'.__('Fields available').'</b>';
|
||||
$table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
|
||||
$table->data[1][1] = '<a href="javascript:">'.html_print_image(
|
||||
|
@ -202,10 +206,18 @@ $table->data[1][2] = html_print_select(
|
|||
echo '<form id="custom_status_monitor" method="post" action="index.php?sec=view&sec2=operation/agentes/status_monitor§ion=fields&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -36,10 +36,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
|
|||
|
||||
check_login();
|
||||
|
||||
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'LM')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -70,12 +66,19 @@ if (check_acl_restricted_all($config['id_user'], 0, 'LM')) {
|
|||
if (defined('METACONSOLE')) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert actions'),
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Alert actions'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -234,21 +237,25 @@ $url = 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&search_string='
|
|||
// Filter table.
|
||||
$table_filter = new stdClass();
|
||||
$table_filter->width = '100%';
|
||||
$table_filter->class = 'databox filters';
|
||||
$table_filter->class = 'databox filters no_border filter-table-adv';
|
||||
$table_filter->style = [];
|
||||
$table_filter->style[0] = 'font-weight: bold';
|
||||
$table_filter->style[2] = 'font-weight: bold';
|
||||
$table_filter->style[4] = 'font-weight: bold';
|
||||
$table_filter->style[0] = 'width: 33%';
|
||||
$table_filter->style[1] = 'width: 33%';
|
||||
$table_filter->style[2] = 'width: 33%';
|
||||
$table_filter->data = [];
|
||||
$table_filter->colspan = [];
|
||||
$table_filter->colspan[1][0] = 3;
|
||||
|
||||
$table_filter->data[0][0] = __('Search');
|
||||
$table_filter->data[0][1] = html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true
|
||||
$table_filter->data[0][0] = html_print_label_input_block(
|
||||
__('Search'),
|
||||
html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$return_all_group = false;
|
||||
|
@ -257,19 +264,22 @@ if (users_can_manage_group_all('LM') === true) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table_filter->data[0][2] = __('Group');
|
||||
$table_filter->data[0][3] = html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'LM',
|
||||
$return_all_group,
|
||||
'group_search',
|
||||
$group_search,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
|
||||
$table_filter->data[0][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'LM',
|
||||
$return_all_group,
|
||||
'group_search',
|
||||
$group_search,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
$table_filter->data[0][4] = __('Command');
|
||||
|
||||
$commands_sql = db_get_all_rows_filter(
|
||||
'talert_commands',
|
||||
['id_group' => array_keys(users_get_groups(false, 'LW'))],
|
||||
|
@ -283,39 +293,54 @@ $commands_sql = db_get_all_rows_filter(
|
|||
);
|
||||
|
||||
$commands = db_get_all_rows_sql($commands_sql);
|
||||
$table_filter->data[0][5] = html_print_select(
|
||||
index_array($commands, 'id', 'name'),
|
||||
'id_command_search',
|
||||
$id_command_search,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:150px'
|
||||
|
||||
$table_filter->data[0][2] = html_print_label_input_block(
|
||||
__('Command'),
|
||||
html_print_select(
|
||||
index_array($commands, 'id', 'name'),
|
||||
'id_command_search',
|
||||
$id_command_search,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table_filter->data[0][6] = '<div class="action-buttons">';
|
||||
$table_filter->data[0][6] .= html_print_submit_button(
|
||||
|
||||
$table_filter->data[1][0] = '<div class="float-right">';
|
||||
$table_filter->data[1][0] .= html_print_submit_button(
|
||||
__('Search'),
|
||||
'',
|
||||
false,
|
||||
'class="sub search"',
|
||||
[
|
||||
'icon' => 'search',
|
||||
'class' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
$table_filter->data[0][5] .= '</div>';
|
||||
$table_filter->data[1][0] .= '</div>';
|
||||
|
||||
|
||||
$show_table_filter = '<form method="post" action="'.$url.'">';
|
||||
$show_table_filter .= html_print_table($table_filter, true);
|
||||
$show_table_filter .= ui_toggle(
|
||||
html_print_table($table_filter, true),
|
||||
'<span class="subsection_header_title">'.__('Search').'</span>',
|
||||
__('Search'),
|
||||
'search',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar '
|
||||
);
|
||||
$show_table_filter .= '</form>';
|
||||
if (is_metaconsole()) {
|
||||
ui_toggle($show_table_filter, __('Show Options'));
|
||||
} else {
|
||||
echo $show_table_filter;
|
||||
}
|
||||
|
||||
echo $show_table_filter;
|
||||
|
||||
|
||||
$table = new stdClass();
|
||||
|
@ -416,8 +441,8 @@ foreach ($actions as $action) {
|
|||
&& check_acl($config['id_user'], $action['id_group'], 'LM')
|
||||
) {
|
||||
$table->cellclass[] = [
|
||||
3 => 'action_buttons',
|
||||
4 => 'action_buttons',
|
||||
3 => 'table_action_buttons',
|
||||
4 => 'table_action_buttons',
|
||||
];
|
||||
|
||||
$id_action = $action['id'];
|
||||
|
@ -428,11 +453,14 @@ foreach ($actions as $action) {
|
|||
$data[3] .= html_print_input_hidden('id', $id_action, true);
|
||||
$data[3] .= html_print_input_image(
|
||||
'dup',
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Duplicate')]
|
||||
[
|
||||
'title' => __('Duplicate'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[3] .= '</form> ';
|
||||
|
||||
|
@ -442,11 +470,14 @@ foreach ($actions as $action) {
|
|||
$data[4] .= html_print_input_hidden('id', $id_action, true);
|
||||
$data[4] .= html_print_input_image(
|
||||
'del',
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Delete')]
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[4] .= '</form> ';
|
||||
} else {
|
||||
|
@ -457,10 +488,10 @@ foreach ($actions as $action) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
ui_pagination($total_actions, $url);
|
||||
$pagination = '';
|
||||
if (isset($data)) {
|
||||
html_print_table($table);
|
||||
ui_pagination($total_actions, $url, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$pagination = ui_pagination($total_actions, $url, 0, 0, true, 'offset', false, '');
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No alert actions configured') ]);
|
||||
}
|
||||
|
@ -468,10 +499,9 @@ if (isset($data)) {
|
|||
if (is_management_allowed() === true) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'&offset='.$offset.'">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
$button = html_print_submit_button(__('Create'), 'create', false, ['icon' => 'wand'], true);
|
||||
html_print_input_hidden('create_alert', 1);
|
||||
html_print_action_buttons($button, ['right_content' => $pagination]);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
|
|
@ -566,8 +566,6 @@ tyle='display:none;'>";
|
|||
echo '</div>';
|
||||
}
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if ($update_command) {
|
||||
include_once 'configure_alert_command.php';
|
||||
return;
|
||||
|
@ -794,8 +792,9 @@ foreach ($commands as $command) {
|
|||
io_safe_output($command['description'])
|
||||
);
|
||||
$data['action'] = '';
|
||||
$table->cellclass[]['action'] = 'action_buttons';
|
||||
$table->cellclass[]['action'] = 'table_action_buttons';
|
||||
$offset_delete = ($offset >= ($total_commands - 1)) ? ($offset - $limit) : $offset;
|
||||
|
||||
// (IMPORTANT, DO NOT CHANGE!) only users with permissions over "All" group have access to edition of commands belonging to "All" group.
|
||||
if ($is_management_allowed === true && !$command['internal'] && check_acl_restricted_all($config['id_user'], $command['id_group'], 'LM')) {
|
||||
if (is_user_admin($config['id_user']) === true) {
|
||||
|
@ -835,8 +834,6 @@ if (users_is_admin() === true) {
|
|||
echo '</div>';
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -32,29 +32,16 @@ $pure = get_parameter('pure', 0);
|
|||
|
||||
$table = new stdClass();
|
||||
$table->id = 'add_alert_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->width = '100%';
|
||||
$table->head = [];
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
$table->size = [];
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[1] = 'font-weight: bold;display: flex;align-items: baseline;';
|
||||
$table->style[2] = 'font-weight: bold;';
|
||||
$table->style[3] = 'font-weight: bold;';
|
||||
|
||||
// This is because if this view is reused after list alert view then
|
||||
// styles in the previous view can affect this table.
|
||||
$table->rowstyle[0] = '';
|
||||
$table->rowstyle[1] = '';
|
||||
$table->rowstyle[2] = '';
|
||||
$table->rowstyle[3] = '';
|
||||
|
||||
$table->style[0] = 'width: 50%';
|
||||
$table->style[1] = 'width: 50%';
|
||||
|
||||
// Add an agent selector
|
||||
if (! $id_agente) {
|
||||
$table->data['agent'][0] = __('Agent');
|
||||
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -64,36 +51,37 @@ if (! $id_agente) {
|
|||
$params['metaconsole_enabled'] = false;
|
||||
$params['use_hidden_input_idagent'] = true;
|
||||
$params['print_hidden_input_idagent'] = true;
|
||||
$table->data['agent'][1] = ui_print_agent_autocomplete_input($params);
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[0][0] = __('Module');
|
||||
$modules = [];
|
||||
|
||||
if ($id_agente) {
|
||||
$modules = agents_get_modules($id_agente, false, ['delete_pending' => 0]);
|
||||
}
|
||||
|
||||
$table->data[0][1] = html_print_select(
|
||||
$modules,
|
||||
'id_agent_module',
|
||||
0,
|
||||
true,
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
($id_agente == 0),
|
||||
'min-width: 250px;margin-right: 0.5em;'
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Module'),
|
||||
html_print_select(
|
||||
$modules,
|
||||
'id_agent_module',
|
||||
0,
|
||||
true,
|
||||
__('Select'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
($id_agente == 0),
|
||||
'width: 100%;'
|
||||
).'<span id="latest_value" class="invisible">'.__('Latest value').':
|
||||
<span id="value"> </span></span>
|
||||
<span id="module_loading" class="invisible">'.html_print_image('images/spinner.gif', true).'</span>'
|
||||
);
|
||||
$table->data[0][1] .= ' <span id="latest_value" class="invisible">'.__('Latest value').': ';
|
||||
$table->data[0][1] .= '<span id="value"> </span></span>';
|
||||
$table->data[0][1] .= ' <span id="module_loading" class="invisible">';
|
||||
$table->data[0][1] .= html_print_image('images/spinner.gif', true).'</span>';
|
||||
|
||||
$table->data[1][0] = __('Actions');
|
||||
|
||||
$groups_user = users_get_groups($config['id_user']);
|
||||
if (!empty($groups_user)) {
|
||||
|
@ -109,36 +97,36 @@ if (!empty($groups_user)) {
|
|||
$actions = db_get_all_rows_sql($sql);
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select(
|
||||
index_array($actions, 'id', 'name'),
|
||||
'action_select',
|
||||
'',
|
||||
'',
|
||||
__('Default action'),
|
||||
'0',
|
||||
true,
|
||||
'',
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'min-width: 250px;'
|
||||
);
|
||||
$table->data[1][1] .= '<span id="advanced_action" class="advanced_actions invisible"><br>';
|
||||
$table->data[1][1] .= __('Number of alerts match from').' ';
|
||||
$table->data[1][1] .= html_print_input_text('fires_min', '', '', 4, 10, true);
|
||||
$table->data[1][1] .= ' '.__('to').' ';
|
||||
$table->data[1][1] .= html_print_input_text('fires_max', '', '', 4, 10, true);
|
||||
|
||||
$table->data[1][1] .= '</span>';
|
||||
if (check_acl($config['id_user'], 0, 'LM')) {
|
||||
$table->data[1][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'">';
|
||||
$table->data[1][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
|
||||
$table->data[1][1] .= '<span class="mrgn_lft_05em">'.__('Create Action').'</span>';
|
||||
$table->data[1][1] .= '</a>';
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$create_action = html_print_button(
|
||||
__('Create Action'),
|
||||
'',
|
||||
false,
|
||||
'window.location.assign("index.php?sec=galertas&sec2=godmode/alerts/configure_alert_action&pure='.$pure.'")',
|
||||
[ 'mode' => 'link' ],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Template');
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Actions'),
|
||||
html_print_select(
|
||||
index_array($actions, 'id', 'name'),
|
||||
'action_select',
|
||||
'',
|
||||
'',
|
||||
__('Default action'),
|
||||
'0',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
).'<span id="advanced_action" class="advanced_actions invisible"><br>'.__('Number of alerts match from').' '.html_print_input_text('fires_min', '', '', 4, 10, true).' '.__('to').' '.html_print_input_text('fires_max', '', '', 4, 10, true).'</span>'.$create_action
|
||||
);
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if ($own_info['is_admin']) {
|
||||
$templates = alerts_get_alert_templates(false, ['id', 'name']);
|
||||
} else {
|
||||
|
@ -148,7 +136,20 @@ if ($own_info['is_admin']) {
|
|||
$templates = alerts_get_alert_templates(['id_group IN ('.$filter_groups.')'], ['id', 'name']);
|
||||
}
|
||||
|
||||
$table->data[2][1] = html_print_select(
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$create_template = html_print_button(
|
||||
__('Create Template'),
|
||||
'',
|
||||
false,
|
||||
'window.location.assign("index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'")',
|
||||
[ 'mode' => 'link' ],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Template'),
|
||||
html_print_select(
|
||||
index_array($templates, 'id', 'name'),
|
||||
'template',
|
||||
'',
|
||||
|
@ -158,20 +159,15 @@ if ($own_info['is_admin']) {
|
|||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'w100p',
|
||||
false,
|
||||
'width: 250px;'
|
||||
);
|
||||
$table->data[2][1] .= ' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>';
|
||||
if (check_acl($config['id_user'], 0, 'LM')) {
|
||||
$table->data[2][1] .= '<a href="index.php?sec=galertas&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
$table->data[2][1] .= html_print_image('images/add.png', true, ['class' => 'invert_filter']);
|
||||
$table->data[2][1] .= '<span class=""mrgn_lft_05em>'.__('Create Template').'</span>';
|
||||
$table->data[2][1] .= '</a>';
|
||||
}
|
||||
'width: 100%;'
|
||||
).' <a class="template_details invisible" href="#">'.html_print_image('images/zoom.png', true, ['class' => 'img_help']).'</a>'.$create_template
|
||||
);
|
||||
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_extended_select_for_time(
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Threshold'),
|
||||
html_print_extended_select_for_time(
|
||||
'module_action_threshold',
|
||||
0,
|
||||
'',
|
||||
|
@ -181,38 +177,58 @@ if ($own_info['is_admin']) {
|
|||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'w100p',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
if (isset($step) === false) {
|
||||
echo '<form class="add_alert_form max_floating_element_size" method="post">';
|
||||
html_print_table($table);
|
||||
}
|
||||
|
||||
if (isset($step) === false) {
|
||||
$output = '';
|
||||
|
||||
if ($id_cluster) {
|
||||
$actionButtons .= html_print_button(
|
||||
__('Finish and view cluster'),
|
||||
'store',
|
||||
false,
|
||||
'window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");',
|
||||
[
|
||||
'icon' => 'update',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$actionButtons .= html_print_submit_button(
|
||||
__('Add alert'),
|
||||
'add',
|
||||
false,
|
||||
[ 'icon' => 'wand' ],
|
||||
true
|
||||
);
|
||||
|
||||
if (!isset($step)) {
|
||||
echo '<form class="add_alert_form" method="post">';
|
||||
html_print_table($table);
|
||||
}
|
||||
html_print_action_buttons($actionButtons, ['right_content' => $pagination]);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_input_hidden('create_alert', 1);
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
if (!isset($step)) {
|
||||
if ($id_cluster) {
|
||||
echo "<input onclick='window.location.replace(\"index.php?sec=reporting&sec2=enterprise/godmode/reporting/cluster_view&id=".$id_cluster."\");' type=button name='store' class='sub upd right mrgn_lft_20px' value='".__('Finish and view cluster')."'>";
|
||||
}
|
||||
ui_require_css_file('cluetip', 'include/styles/js/');
|
||||
ui_require_jquery_file('validate');
|
||||
ui_require_jquery_file('cluetip');
|
||||
ui_require_jquery_file('pandora.controls');
|
||||
ui_require_jquery_file('bgiframe');
|
||||
|
||||
html_print_submit_button(__('Add alert'), 'add', false, 'class="sub wand"');
|
||||
html_print_input_hidden('create_alert', 1);
|
||||
echo '</div></form>';
|
||||
}
|
||||
|
||||
ui_require_css_file('cluetip', 'include/styles/js/');
|
||||
ui_require_jquery_file('validate');
|
||||
ui_require_jquery_file('cluetip');
|
||||
ui_require_jquery_file('pandora.controls');
|
||||
ui_require_jquery_file('bgiframe');
|
||||
|
||||
?>
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
/* <![CDATA[ */
|
||||
$(document).ready (function () {
|
||||
|
|
|
@ -61,11 +61,13 @@ if ($id_agente) {
|
|||
// Table for filter controls.
|
||||
$form_filter = '<form method="post" action="index.php?sec='.$sec.'&sec2='.$sec2.'&refr='.((int) get_parameter('refr', 0)).'&pure='.$config['pure'].'">';
|
||||
$form_filter .= "<input type='hidden' name='search' value='1' />";
|
||||
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p">';
|
||||
$form_filter .= '<table cellpadding="0" cellspacing="0" class="databox filters w100p filter-table-adv">';
|
||||
$form_filter .= '<tr>';
|
||||
$form_filter .= "<td class='bolder''>".__('Template name').'</td><td>';
|
||||
$form_filter .= html_print_input_text('template_name', $templateName, '', 12, 255, true);
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Template name'),
|
||||
html_print_input_text('template_name', $templateName, '', 12, 255, true)
|
||||
).'</td>';
|
||||
|
||||
$temp = agents_get_agents();
|
||||
$arrayAgents = [];
|
||||
|
||||
|
@ -76,8 +78,6 @@ if ($temp !== false) {
|
|||
}
|
||||
}
|
||||
|
||||
$form_filter .= "<td class='bolder''>".__('Agents').'</td><td>';
|
||||
|
||||
$params = [];
|
||||
$params['return'] = true;
|
||||
$params['show_helptip'] = true;
|
||||
|
@ -91,14 +91,19 @@ $params['hidden_input_idagent_id'] = 'hidden-autocomplete_id_agent';
|
|||
$params['hidden_input_idagent_name'] = 'agent_id';
|
||||
$params['hidden_input_idagent_value'] = $agent_id;
|
||||
|
||||
$form_filter .= ui_print_agent_autocomplete_input($params);
|
||||
|
||||
|
||||
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Agents'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
).'</td>';
|
||||
|
||||
$form_filter .= "<td class='bolder''>".__('Module name').'</td><td>';
|
||||
$form_filter .= html_print_input_text('module_name', $moduleName, '', 12, 255, true);
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Module name'),
|
||||
html_print_input_text('module_name', $moduleName, '', 12, 255, true)
|
||||
).'</td>';
|
||||
$form_filter .= '</tr>';
|
||||
|
||||
$all_groups = db_get_value('is_admin', 'tusuario', 'id_user', $config['id_user']);
|
||||
|
@ -127,19 +132,37 @@ if (is_array($temp) === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$form_filter .= "<td class='bolder''>".__('Actions').'</td><td>';
|
||||
$form_filter .= html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true, false, true, '', false, 'width:95%');
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= "<td class='bolder''>".__('Field content').'</td><td>';
|
||||
$form_filter .= html_print_input_text('field_content', $fieldContent, '', 12, 255, true);
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= "<td class='bolder''>".__('Priority').'</td><td>';
|
||||
$form_filter .= html_print_select(get_priorities(), 'priority', $priority, '', __('All'), -1, true);
|
||||
$form_filter .= "</td class='bolder''>";
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Actions'),
|
||||
html_print_select($arrayActions, 'action_id', $actionID, '', __('All'), -1, true, false, true, '', false, 'width:95%')
|
||||
).'</td>';
|
||||
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Field content'),
|
||||
html_print_input_text('field_content', $fieldContent, '', 12, 255, true)
|
||||
).'</td>';
|
||||
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
get_priorities(),
|
||||
'priority',
|
||||
$priority,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
).'</td>';
|
||||
|
||||
$form_filter .= '</tr>';
|
||||
|
||||
$form_filter .= '<tr>';
|
||||
$form_filter .= "<td class='bolder'>".__('Status').'</td><td>';
|
||||
$ed_list = [];
|
||||
$alert_status_filter = [];
|
||||
$alert_status_filter['all_enabled'] = __('All (Enabled)');
|
||||
|
@ -147,14 +170,45 @@ $alert_status_filter['all'] = __('All');
|
|||
$alert_status_filter['fired'] = __('Fired');
|
||||
$alert_status_filter['notfired'] = __('Not fired');
|
||||
$alert_status_filter['disabled'] = __('Disabled');
|
||||
$form_filter .= html_print_select($alert_status_filter, 'status_alert', $status_alert, '', '', '', true);
|
||||
$form_filter .= "</td><td class='bolder'>".__('Standby').'</td><td>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Status'),
|
||||
html_print_select(
|
||||
$alert_status_filter,
|
||||
'status_alert',
|
||||
$status_alert,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
).'</td>';
|
||||
|
||||
$sb_list = [];
|
||||
$sb_list[1] = __('Standby on');
|
||||
$sb_list[0] = __('Standby off');
|
||||
$form_filter .= html_print_select($sb_list, 'standby', $standby, '', __('All'), -1, true);
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= "</td><td class='bolder''>".__('Group').'</td><td>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Standby'),
|
||||
html_print_select(
|
||||
$sb_list,
|
||||
'standby',
|
||||
$standby,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
).'</td>';
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_acl($config['id_user'], 0, 'AW')) {
|
||||
$return_all_group = false;
|
||||
|
@ -162,20 +216,35 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'AR') && !check_
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$form_filter .= html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false);
|
||||
$form_filter .= '</td></tr>';
|
||||
$form_filter .= '<td class="w33p">'.html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, '', '', 0, true, false, true, '', false)
|
||||
).'</td>';
|
||||
|
||||
$form_filter .= '</tr>';
|
||||
|
||||
$updateButton = html_print_submit_button(
|
||||
__('Update'),
|
||||
'',
|
||||
false,
|
||||
[
|
||||
'icon' => 'update',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$form_filter .= '<tr>';
|
||||
$form_filter .= "<td colspan='6' align='right'>";
|
||||
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
|
||||
$form_filter .= $updateButton;
|
||||
$form_filter .= '</td>';
|
||||
$form_filter .= '</tr>';
|
||||
$form_filter .= '</table>';
|
||||
} else {
|
||||
$form_filter .= '</table>';
|
||||
$form_filter .= "<div class='right height_100p'>";
|
||||
$form_filter .= html_print_submit_button(__('Update'), '', false, 'class="sub upd"', true);
|
||||
$form_filter .= $updateButton;
|
||||
$form_filter .= '</div>';
|
||||
}
|
||||
|
||||
|
@ -185,7 +254,17 @@ if (is_metaconsole() === true) {
|
|||
}
|
||||
|
||||
if (!$id_cluster) {
|
||||
ui_toggle($form_filter, __('Alert control filter'), __('Toggle filter(s)'));
|
||||
ui_toggle(
|
||||
$form_filter,
|
||||
'<span class="subsection_header_title">'.__('Alert control filter').'</span>',
|
||||
__('Toggle filter(s)'),
|
||||
'update',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar '
|
||||
);
|
||||
} else {
|
||||
unset($form_filter);
|
||||
}
|
||||
|
@ -427,12 +506,6 @@ switch ($sortField) {
|
|||
$form_params = '&template_name='.$templateName.'&agent_name='.$agentName.'&module_name='.$moduleName.'&action_id='.$actionID.'&field_content='.$fieldContent.'&priority='.$priority.'&enabledisable='.$enabledisable.'&standby='.$standby.'&ag_group='.$ag_group.'&status_alert='.$status_alert;
|
||||
$sort_params = '&sort_field='.$sortField.'&sort='.$sort;
|
||||
|
||||
if ($id_agente) {
|
||||
ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params);
|
||||
} else {
|
||||
ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params);
|
||||
}
|
||||
|
||||
$offset = (int) get_parameter('offset');
|
||||
$simple_alerts = agents_get_alerts_simple(
|
||||
(empty($agent_id) === false) ? ['0' => $agent_id] : $id_agents,
|
||||
|
@ -514,8 +587,7 @@ $table_alert_list->cellstyle = [];
|
|||
|
||||
$table_alert_list->data = [];
|
||||
|
||||
$url .= $sort_params;
|
||||
|
||||
// $url .= $sort_params;
|
||||
$rowPair = true;
|
||||
$iterator = 0;
|
||||
|
||||
|
@ -580,7 +652,7 @@ foreach ($simple_alerts as $alert) {
|
|||
}
|
||||
|
||||
$module_name = modules_get_agentmodule_name($alert['id_agent_module']);
|
||||
$data[0] .= ui_print_truncate_text($module_name, 'module_medium', false, true, true, '[…]', 'display:block;font-weight:normal;').'<br>';
|
||||
$data[0] .= ui_print_truncate_text($module_name, 'module_medium', false, true, true, '[…]', 'display:block;font-weight:normal;');
|
||||
|
||||
$data[1] = ui_print_status_image($status, $title, true);
|
||||
|
||||
|
@ -600,7 +672,7 @@ foreach ($simple_alerts as $alert) {
|
|||
'[…]',
|
||||
''
|
||||
);
|
||||
$data[2] .= ' <a class="template_details"
|
||||
$data[2] .= ' <a class="template_details patatas"
|
||||
href="'.ui_get_full_url(false, false, false, false).'ajax.php?page=godmode/alerts/alert_templates&get_template_tooltip=1&id_template='.$alert['id_alert_template'].'">';
|
||||
$data[2] .= html_print_image(
|
||||
'images/zoom.png',
|
||||
|
@ -679,7 +751,7 @@ foreach ($simple_alerts as $alert) {
|
|||
$data[3] .= '<form method="post" action="'.$url.'" class="delete_link display_in">';
|
||||
$data[3] .= html_print_input_image(
|
||||
'delete',
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'padding:0px; margin-left:5px; margin-right:5px;',
|
||||
true,
|
||||
|
@ -731,67 +803,73 @@ foreach ($simple_alerts as $alert) {
|
|||
|
||||
$data[3] .= '<div id="add_action-div-'.$alert['id'].'" class="invisible">';
|
||||
$data[3] .= '<form id="add_action_form-'.$alert['id'].'" method="post" style="height:85%;">';
|
||||
$data[3] .= '<table class="w100p bg_color222">';
|
||||
$data[3] .= '<table class="w100p bg_color222 filter-table-adv">';
|
||||
$data[3] .= html_print_input_hidden('add_action', 1, true);
|
||||
$data[3] .= html_print_input_hidden('id_alert_module', $alert['id'], true);
|
||||
|
||||
if (! $id_agente) {
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Agent');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
$data[3] .= ui_print_truncate_text($alias, 'agent_small', false, true, true, '[…]');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_truncate_text($alias, 'agent_small', false, true, true, '[…]')
|
||||
).'</td>';
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Module'),
|
||||
ui_print_truncate_text($module_name, 'module_small', false, true, true, '[…]')
|
||||
).'</td>';
|
||||
$data[3] .= '</tr>';
|
||||
}
|
||||
|
||||
$data[3] .= '<tr class="datos">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Module');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
$data[3] .= ui_print_truncate_text($module_name, 'module_small', false, true, true, '[…]');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Action');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos2">';
|
||||
$data[3] .= html_print_select($actions, 'action_select', '', '', __('None'), 0, true, false, true, '', false, 'width:95%');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos">';
|
||||
$data[3] .= '<td class="datos bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Number of alerts match from');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos">';
|
||||
$data[3] .= html_print_input_text(
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Action'),
|
||||
html_print_select(
|
||||
$actions,
|
||||
'action_select',
|
||||
'',
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
).'</td>';
|
||||
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Number of alerts match from'),
|
||||
'<div class="inline">'.html_print_input_text(
|
||||
'fires_min',
|
||||
0,
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$data[3] .= ' '.__('to').' ';
|
||||
$data[3] .= html_print_input_text(
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w40p'
|
||||
).' '.__('to').' '.html_print_input_text(
|
||||
'fires_max',
|
||||
0,
|
||||
'',
|
||||
4,
|
||||
10,
|
||||
true
|
||||
);
|
||||
$data[3] .= '</td>';
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w40p'
|
||||
).'</div>'
|
||||
).'</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '<tr class="datos2">';
|
||||
$data[3] .= '<td class="datos2 bolder pdd_6px font_10pt">';
|
||||
$data[3] .= __('Threshold');
|
||||
$data[3] .= '</td>';
|
||||
$data[3] .= '<td class="datos2">';
|
||||
$data[3] .= html_print_extended_select_for_time(
|
||||
$data[3] .= '<td class="w50p">'.html_print_label_input_block(
|
||||
__('Threshold'),
|
||||
html_print_extended_select_for_time(
|
||||
'module_action_threshold',
|
||||
0,
|
||||
'',
|
||||
|
@ -807,15 +885,18 @@ foreach ($simple_alerts as $alert) {
|
|||
'',
|
||||
false,
|
||||
true
|
||||
);
|
||||
$data[3] .= '</td>';
|
||||
)
|
||||
).'</td>';
|
||||
$data[3] .= '</tr>';
|
||||
$data[3] .= '</table>';
|
||||
$data[3] .= html_print_submit_button(
|
||||
__('Add'),
|
||||
'addbutton',
|
||||
false,
|
||||
['class' => 'sub next right'],
|
||||
[
|
||||
'icon' => 'next',
|
||||
'class' => 'mini float-right',
|
||||
],
|
||||
true
|
||||
);
|
||||
$data[3] .= '</form>';
|
||||
|
@ -823,8 +904,8 @@ foreach ($simple_alerts as $alert) {
|
|||
}
|
||||
|
||||
$table_alert_list->cellclass[] = [
|
||||
1 => 'action_buttons',
|
||||
4 => 'action_buttons',
|
||||
1 => 'table_action_buttons',
|
||||
4 => 'table_action_buttons',
|
||||
];
|
||||
$data[4] = '<form class="disable_alert_form display_in" action="'.$url.'" method="post" >';
|
||||
if ($alert['disabled']) {
|
||||
|
@ -834,7 +915,7 @@ foreach ($simple_alerts as $alert) {
|
|||
1,
|
||||
'padding:0px',
|
||||
true,
|
||||
['class' => 'filter_none']
|
||||
['class' => 'filter_none main_menu_icon']
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('enable_alert', 1, true);
|
||||
} else {
|
||||
|
@ -843,7 +924,8 @@ foreach ($simple_alerts as $alert) {
|
|||
'images/lightbulb.png',
|
||||
1,
|
||||
'padding:0px;',
|
||||
true
|
||||
true,
|
||||
['class' => 'main_menu_icon']
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('disable_alert', 1, true);
|
||||
}
|
||||
|
@ -861,7 +943,7 @@ foreach ($simple_alerts as $alert) {
|
|||
1,
|
||||
'padding:0px;',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('standbyon_alert', 1, true);
|
||||
} else {
|
||||
|
@ -871,7 +953,7 @@ foreach ($simple_alerts as $alert) {
|
|||
1,
|
||||
'padding:0px;',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('standbyoff_alert', 1, true);
|
||||
}
|
||||
|
@ -911,19 +993,37 @@ foreach ($simple_alerts as $alert) {
|
|||
true,
|
||||
[
|
||||
'title' => __('Add action'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
);
|
||||
} else {
|
||||
if ((int) $alert['id_policy_alerts'] === 0 || $module_linked === '0') {
|
||||
$data[4] .= '<a href="javascript:show_add_action(\''.$alert['id'].'\');">';
|
||||
$data[4] .= html_print_image('images/add.png', true, ['title' => __('Add action'), 'class' => 'invert_filter']);
|
||||
$data[4] .= html_print_image(
|
||||
'images/plus-black.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Add action'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'style' => 'margin-bottom: 12px;',
|
||||
]
|
||||
);
|
||||
$data[4] .= '</a>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$data[4] .= html_print_input_image('delete', 'images/cross.png', 1, '', true, ['title' => __('Delete'), 'class' => 'invert_filter']);
|
||||
$data[4] .= html_print_input_image(
|
||||
'delete',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('delete_alert', 1, true);
|
||||
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
|
||||
$data[4] .= '</form>';
|
||||
|
@ -931,7 +1031,17 @@ foreach ($simple_alerts as $alert) {
|
|||
if ($is_cluster) {
|
||||
$data[4] .= '<form class="view_alert_form display_in" method="post">';
|
||||
|
||||
$data[4] .= html_print_input_image('update', 'images/builder.png', 1, '', true, ['title' => __('Update'), 'class' => 'invert_filter']);
|
||||
$data[4] .= html_print_input_image(
|
||||
'update',
|
||||
'images/builder.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'title' => __('Update'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('upd_alert', 1, true);
|
||||
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
|
||||
|
||||
|
@ -941,7 +1051,17 @@ foreach ($simple_alerts as $alert) {
|
|||
|
||||
if (check_acl_one_of_groups($config['id_user'], $all_groups, 'LM')) {
|
||||
$data[4] .= '<form class="view_alert_form display_in" method="post" action="index.php?sec=galertas&sec2=godmode/alerts/alert_view">';
|
||||
$data[4] .= html_print_input_image('view_alert', 'images/operation.png', 1, '', true, ['title' => __('View alert advanced details'), 'class' => 'invert_filter']);
|
||||
$data[4] .= html_print_input_image(
|
||||
'view_alert',
|
||||
'images/operation.png',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
[
|
||||
'title' => __('View alert advanced details'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
);
|
||||
$data[4] .= html_print_input_hidden('id_alert', $alert['id'], true);
|
||||
$data[4] .= '</form>';
|
||||
}
|
||||
|
@ -949,12 +1069,13 @@ foreach ($simple_alerts as $alert) {
|
|||
array_push($table_alert_list->data, $data);
|
||||
}
|
||||
|
||||
$pagination = '';
|
||||
if (isset($data)) {
|
||||
html_print_table($table_alert_list);
|
||||
if ($id_agente) {
|
||||
ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$pagination .= ui_pagination($total, 'index.php?sec=gagente&sec2=godmode/agentes/configurar_agente&tab=alert&id_agente='.$id_agente.$form_params.$sort_params, 0, 0, true, 'offset', false, '');
|
||||
} else {
|
||||
ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$pagination .= ui_pagination($total, 'index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list'.$form_params.$sort_params, 0, 0, true, 'offset', false, '');
|
||||
}
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No alerts defined') ]);
|
||||
|
@ -970,11 +1091,16 @@ if (isset($dont_display_alert_create_bttn)) {
|
|||
}
|
||||
|
||||
if ($display_create && (check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], $template_group, 'LM')) && !$id_cluster) {
|
||||
echo '<div class="action-buttons" style="width: '.$table_alert_list->width.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">';
|
||||
html_print_submit_button(__('Create'), 'crtbtn', false, 'class="sub next"');
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Create'),
|
||||
'crtbtn',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
html_print_action_buttons($actionButtons, ['right_content' => $pagination]);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
ui_require_css_file('cluetip', 'include/styles/js/');
|
||||
|
@ -1154,7 +1280,7 @@ function show_add_action(id_alert) {
|
|||
dropdownParent: $("#add_action-div-" + id_alert)
|
||||
});
|
||||
},
|
||||
width: 600,
|
||||
width: 665,
|
||||
height: 300
|
||||
})
|
||||
.show ();
|
||||
|
|
|
@ -476,6 +476,70 @@ if ($standbyoff_alert) {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
$searchFlag = true;
|
||||
if (!is_metaconsole()) {
|
||||
// The tabs will be shown only with manage alerts permissions
|
||||
if (check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], 0, 'LM')) {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts'), 'class' => 'invert_filter']).'</a>',
|
||||
],
|
||||
'builder' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pencil.png', true, ['title' => __('Builder alert'), 'class' => 'invert_filter']).'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
} else {
|
||||
$buttons = '';
|
||||
}
|
||||
|
||||
if ($tab == 'list') {
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage alerts'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('List'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Manage alerts'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Create'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
alerts_meta_print_header();
|
||||
}
|
||||
|
||||
if ($id_agente) {
|
||||
$agents = [$id_agente => agents_get_name($id_agente)];
|
||||
|
||||
|
@ -494,64 +558,35 @@ if ($id_agente) {
|
|||
}
|
||||
|
||||
return;
|
||||
} else {
|
||||
$searchFlag = true;
|
||||
if (!is_metaconsole()) {
|
||||
// The tabs will be shown only with manage alerts permissions
|
||||
if (check_acl($config['id_user'], 0, 'LW') || check_acl($config['id_user'], 0, 'LM')) {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=list&pure='.$pure.'">'.html_print_image('images/list.png', true, ['title' => __('List alerts'), 'class' => 'invert_filter']).'</a>',
|
||||
],
|
||||
'builder' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/alerts/alert_list&tab=builder&pure='.$pure.'">'.html_print_image('images/pencil.png', true, ['title' => __('Builder alert'), 'class' => 'invert_filter']).'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
} else {
|
||||
$buttons = '';
|
||||
}
|
||||
|
||||
if ($tab == 'list') {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Manage alerts').' » '.__('List'), 'images/gm_alerts.png', false, '', true, $buttons);
|
||||
} else {
|
||||
ui_print_page_header(__('Alerts').' » '.__('Manage alerts').' » '.__('Create'), 'images/gm_alerts.png', false, '', true, $buttons);
|
||||
}
|
||||
} else {
|
||||
alerts_meta_print_header();
|
||||
}
|
||||
|
||||
echo $messageAction;
|
||||
|
||||
switch ($tab) {
|
||||
case 'list':
|
||||
if ($group == 0) {
|
||||
$groups = users_get_groups();
|
||||
} else {
|
||||
$groups = [0 => __('All')];
|
||||
}
|
||||
|
||||
$agents = agents_get_group_agents(array_keys($groups), false, 'none', true);
|
||||
|
||||
include_once $config['homedir'].'/godmode/alerts/alert_list.list.php';
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
case 'builder':
|
||||
if ($group == 0) {
|
||||
$groups = users_get_groups();
|
||||
} else {
|
||||
$groups = [0 => __('All')];
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/godmode/alerts/alert_list.builder.php';
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo $messageAction;
|
||||
|
||||
switch ($tab) {
|
||||
case 'list':
|
||||
if ($group == 0) {
|
||||
$groups = users_get_groups();
|
||||
} else {
|
||||
$groups = [0 => __('All')];
|
||||
}
|
||||
|
||||
$agents = agents_get_group_agents(array_keys($groups), false, 'none', true);
|
||||
|
||||
include_once $config['homedir'].'/godmode/alerts/alert_list.list.php';
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
case 'builder':
|
||||
if ($group == 0) {
|
||||
$groups = users_get_groups();
|
||||
} else {
|
||||
$groups = [0 => __('All')];
|
||||
}
|
||||
|
||||
include_once $config['homedir'].'/godmode/alerts/alert_list.builder.php';
|
||||
|
||||
return;
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (is_ajax()) {
|
||||
$get_template_tooltip = (bool) get_parameter('get_template_tooltip');
|
||||
|
||||
|
@ -124,15 +122,22 @@ $sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
|
|||
// case delete_templete action is performed.
|
||||
if (!$delete_template) {
|
||||
// Header.
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Alert templates'),
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Alert templates'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -285,7 +290,7 @@ $url = ui_get_url_refresh(
|
|||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
if (is_metaconsole() === true) {
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
|
@ -295,51 +300,70 @@ $table->data = [];
|
|||
$table->head = [];
|
||||
$table->style = [];
|
||||
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[0] = 'width: 50%;';
|
||||
$table->style[1] = 'width: 50%;';
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
alerts_get_alert_templates_types(),
|
||||
'search_type',
|
||||
$search_type,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%;'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][0] = __('Type');
|
||||
$table->data[0][1] = html_print_select(
|
||||
alerts_get_alert_templates_types(),
|
||||
'search_type',
|
||||
$search_type,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Search'),
|
||||
html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = __('Search');
|
||||
$table->data[0][3] = html_print_input_text(
|
||||
'search_string',
|
||||
$search_string,
|
||||
'',
|
||||
25,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$table->data[0][4] = '<div class="action-buttons">';
|
||||
$table->data[0][4] .= html_print_submit_button(
|
||||
|
||||
$table->data[1][0] = ' ';
|
||||
$table->data[1][1] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'',
|
||||
false,
|
||||
'class="sub search"',
|
||||
[
|
||||
'class' => 'float-right',
|
||||
'icon' => 'search',
|
||||
],
|
||||
true
|
||||
);
|
||||
$table->data[0][4] .= '</div>';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$filter = '<form class="" method="post" action="'.$url.'">';
|
||||
$filter .= html_print_table($table, true);
|
||||
$filter .= '</form>';
|
||||
ui_toggle($filter, __('Show Options'));
|
||||
} else {
|
||||
echo '<form method="post" action="'.$url.'">';
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
}
|
||||
$filter = '<form class="" method="post" action="'.$url.'">';
|
||||
$filter .= html_print_table($table, true);
|
||||
$filter .= '</form>';
|
||||
ui_toggle(
|
||||
$filter,
|
||||
'<span class="subsection_header_title">'.__('Show Options').'</span>',
|
||||
__('Show Options'),
|
||||
'update',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content no_border',
|
||||
'filter-datatable-main box-flat white_table_graph fixed_filter_bar '
|
||||
);
|
||||
|
||||
|
||||
unset($table);
|
||||
|
||||
|
@ -420,7 +444,7 @@ foreach ($templates as $template) {
|
|||
if (is_management_allowed() === true
|
||||
&& check_acl($config['id_user'], $template['id_group'], 'LM')
|
||||
) {
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
$table->cellclass[][4] = 'table_action_buttons';
|
||||
$data[4] = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'&offset='.$offset.'" class="float-left inline_line">';
|
||||
$data[4] .= html_print_input_hidden('duplicate_template', 1, true);
|
||||
$data[4] .= html_print_input_hidden('source_id', $template['id'], true);
|
||||
|
@ -430,7 +454,10 @@ foreach ($templates as $template) {
|
|||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Duplicate')]
|
||||
[
|
||||
'title' => __('Duplicate'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
$data[4] .= '</form> ';
|
||||
|
||||
|
@ -440,11 +467,14 @@ foreach ($templates as $template) {
|
|||
$data[4] .= html_print_input_hidden('id', $template['id'], true);
|
||||
$data[4] .= html_print_input_image(
|
||||
'del',
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Delete')]
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon',
|
||||
]
|
||||
);
|
||||
$data[4] .= '</form> ';
|
||||
}
|
||||
|
@ -455,18 +485,18 @@ foreach ($templates as $template) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
ui_pagination($total_templates, $url);
|
||||
$pagination = '';
|
||||
if (isset($data) === true) {
|
||||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$pagination = ui_pagination(
|
||||
$total_templates,
|
||||
$url,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom'
|
||||
'offset',
|
||||
false,
|
||||
''
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
|
@ -477,13 +507,15 @@ if (isset($data) === true) {
|
|||
);
|
||||
}
|
||||
|
||||
$buttons = '';
|
||||
if (is_management_allowed() === true) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_template&pure='.$pure.'">';
|
||||
html_print_submit_button(__('Create'), 'create', false, 'class="sub next"');
|
||||
html_print_input_hidden('create_alert', 1);
|
||||
$buttons = html_print_submit_button(__('Create'), 'create', false, ['icon' => 'wand'], true);
|
||||
$buttons .= html_print_input_hidden('create_alert', 1);
|
||||
html_print_action_buttons($buttons, ['right_content' => $pagination]);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
} else {
|
||||
html_print_action_buttons($buttons, ['right_content' => $pagination]);
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
|
|
@ -48,8 +48,6 @@ if (is_ajax()) {
|
|||
}
|
||||
}
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
|
@ -160,43 +158,34 @@ html_print_div(
|
|||
$table = new stdClass();
|
||||
$table->id = 'table_macros';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if ($id) {
|
||||
$table->head[0] = __('Update Action');
|
||||
} else {
|
||||
$table->head[0] = __('Create Action');
|
||||
}
|
||||
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->class = 'databox filters filter-table-adv';
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->size = [];
|
||||
$table->size[0] = '20%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
if (io_safe_output($name) == 'Monitoring Event') {
|
||||
|
@ -207,34 +196,30 @@ if (io_safe_output($name) == 'Monitoring Event') {
|
|||
);
|
||||
}
|
||||
|
||||
$table->colspan[0][1] = 2;
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('LW') === true || $disabled) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table->data[1][1] = '<div class="w250px inline">'.html_print_select_groups(
|
||||
false,
|
||||
'LW',
|
||||
$return_all_group,
|
||||
'group',
|
||||
$group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
).'</div>';
|
||||
$table->colspan[1][1] = 2;
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'LW',
|
||||
$return_all_group,
|
||||
'group',
|
||||
$group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$create_ticket_command_id = db_get_value('id', 'talert_commands', 'name', io_safe_input('Integria IMS Ticket'));
|
||||
|
||||
|
@ -244,7 +229,6 @@ if (!is_metaconsole() && $config['integria_enabled'] == 0 && $create_ticket_comm
|
|||
$sql_exclude_command_id = ' AND id <> '.$create_ticket_command_id;
|
||||
}
|
||||
|
||||
$table->data[2][0] = __('Command');
|
||||
$commands_sql = db_get_all_rows_filter(
|
||||
'talert_commands',
|
||||
'id_group IN ('.implode(',', array_keys(users_get_groups(false, 'LW'))).')'.$sql_exclude_command_id,
|
||||
|
@ -256,56 +240,65 @@ $commands_sql = db_get_all_rows_filter(
|
|||
false,
|
||||
true
|
||||
);
|
||||
$table->data[2][1] = html_print_select_from_sql(
|
||||
$commands_sql,
|
||||
'id_command',
|
||||
$id_command,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
(!$is_management_allowed | $disabled)
|
||||
);
|
||||
$table->data[2][1] .= ' ';
|
||||
|
||||
$create_command = ' ';
|
||||
if ($is_management_allowed === true
|
||||
&& check_acl($config['id_user'], 0, 'PM') && !$disabled
|
||||
) {
|
||||
$table->data[2][1] .= __('Create Command');
|
||||
$table->data[2][1] .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
$table->data[2][1] .= html_print_image('images/add.png', true);
|
||||
$table->data[2][1] .= '</a>';
|
||||
$create_command .= __('Create Command');
|
||||
$create_command .= '<a href="index.php?sec='.$sec.'&sec2=godmode/alerts/configure_alert_command&pure='.$pure.'">';
|
||||
$create_command .= html_print_image('images/add.png', true);
|
||||
$create_command .= '</a>';
|
||||
}
|
||||
|
||||
$table->data[2][1] .= '<div id="command_description" ></div>';
|
||||
$table->colspan[2][1] = 2;
|
||||
$create_command .= '<div id="command_description" ></div>';
|
||||
|
||||
$table->data[3][0] = __('Threshold');
|
||||
$table->data[3][1] = html_print_extended_select_for_time(
|
||||
'action_threshold',
|
||||
$action_threshold,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled),
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
true
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Command'),
|
||||
html_print_select_from_sql(
|
||||
$commands_sql,
|
||||
'id_command',
|
||||
$id_command,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
(!$is_management_allowed | $disabled)
|
||||
).$create_command
|
||||
);
|
||||
$table->colspan[3][1] = 2;
|
||||
|
||||
$table->data[4][0] = '';
|
||||
$table->data[4][1] = __('Firing');
|
||||
$table->data[4][2] = __('Recovery');
|
||||
$table->cellstyle[4][1] = 'font-weight: bold;';
|
||||
$table->cellstyle[4][2] = 'font-weight: bold;';
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Threshold'),
|
||||
html_print_extended_select_for_time(
|
||||
'action_threshold',
|
||||
$action_threshold,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
(!$is_management_allowed | $disabled),
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Recovery'),
|
||||
''
|
||||
);
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Recovery'),
|
||||
''
|
||||
);
|
||||
|
||||
$table->data[5][0] = __('Command preview');
|
||||
$table->data[5][1] = html_print_textarea(
|
||||
|
@ -374,46 +367,53 @@ for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
|||
|
||||
$offset = (int) get_parameter('offset', 0);
|
||||
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions&pure='.$pure.'&offset='.$offset.'" class="max_floating_element_size">';
|
||||
$table_html = html_print_table($table, true);
|
||||
|
||||
$backButton = '';
|
||||
$submitButton = '';
|
||||
echo $table_html;
|
||||
if ($is_management_allowed === true) {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
if ($id) {
|
||||
html_print_input_hidden('id', $id);
|
||||
if (!$disabled) {
|
||||
html_print_input_hidden('update_action', 1);
|
||||
html_print_submit_button(
|
||||
$submitButton = html_print_submit_button(
|
||||
__('Update'),
|
||||
'create',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_actions">';
|
||||
html_print_submit_button(__('Back'), 'back', false, 'class="sub upd"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
$backButton = html_print_button(
|
||||
__('Back'),
|
||||
'back',
|
||||
false,
|
||||
"window.location.href = 'index.php?sec=galertas&sec2=godmode/alerts/alert_actions'",
|
||||
[
|
||||
'icon' => 'back',
|
||||
'class' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
html_print_input_hidden('create_action', 1);
|
||||
html_print_submit_button(
|
||||
$submitButton = html_print_submit_button(
|
||||
__('Create'),
|
||||
'create',
|
||||
false,
|
||||
'class="sub wand"'
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
html_print_action_buttons($submitButton.$backButton);
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_require_javascript_file('tiny_mce', 'include/javascript/tiny_mce/');
|
||||
?>
|
||||
|
|
|
@ -36,8 +36,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -392,7 +390,6 @@ if ($is_management_allowed === true) {
|
|||
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -37,10 +37,6 @@ enterprise_include_once('meta/include/functions_alerts_meta.php');
|
|||
|
||||
check_login();
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
enterprise_hook('open_meta_frame');
|
||||
}
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'LM')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -95,12 +91,19 @@ if ($a_template !== false) {
|
|||
$help_header = '';
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
'',
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
$help_header,
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configure alert template'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -119,12 +122,19 @@ if ($a_template !== false) {
|
|||
if (is_metaconsole() === true) {
|
||||
alerts_meta_print_header();
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
'conf_alert_template',
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configure alert template'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
} else {
|
||||
|
@ -151,12 +161,19 @@ if ($a_template !== false) {
|
|||
$help_header = '';
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
__('Alerts').' » '.__('Configure alert template'),
|
||||
ui_print_standard_header(
|
||||
__('Alerts'),
|
||||
'images/gm_alerts.png',
|
||||
false,
|
||||
$help_header,
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configure alert template'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -602,27 +619,22 @@ print_alert_template_steps($step, $id);
|
|||
$table = new stdClass();
|
||||
$table->id = 'template';
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
if (is_metaconsole() === true) {
|
||||
$table->head[0] = __('Create Template');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
$table->class = 'databox filters w100p filter-table-adv';
|
||||
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[2] = 'font-weight: bold;';
|
||||
|
||||
$table->size = [];
|
||||
$table->size[0] = '20%';
|
||||
$table->size[2] = '20%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[2] = '50%';
|
||||
|
||||
$table->colspan = [];
|
||||
$table->colspan[1][0] = 2;
|
||||
|
||||
if ($step == 2) {
|
||||
if (!isset($show_matches)) {
|
||||
$show_matches = false;
|
||||
}
|
||||
|
||||
$table->data[0][0] = __('Use special days list');
|
||||
$data_special_days = Calendar::calendars(
|
||||
// Fields.
|
||||
[ '`talert_calendar`.*' ],
|
||||
|
@ -641,121 +653,154 @@ if ($step == 2) {
|
|||
// Reduce to a select.
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[0][1] = html_print_select(
|
||||
$data_special_days,
|
||||
'special_day',
|
||||
$special_day,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Use special days list'),
|
||||
html_print_select(
|
||||
$data_special_days,
|
||||
'special_day',
|
||||
$special_day,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
(!$is_management_allowed | $disabled),
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][1] = ' ';
|
||||
|
||||
// Firing conditions and events.
|
||||
$table->colspan = [];
|
||||
$table->data[1][0] = __('Schedule');
|
||||
$table->colspan[1][1] = 3;
|
||||
$table->data[1][1] = ui_print_warning_message(
|
||||
[
|
||||
'message' => __('No alert has been scheduled yet'),
|
||||
'force_style' => 'display:none;',
|
||||
'force_class' => 'alert_schedule',
|
||||
],
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][1] .= '<div id="calendar_map" style="width: 90%;"></div>';
|
||||
$table->data[1][1] .= html_print_input_hidden('schedule', $schedule, true);
|
||||
|
||||
$table->colspan['threshold'][1] = 3;
|
||||
$table->data['threshold'][0] = __('Time threshold');
|
||||
$table->data['threshold'][1] = html_print_extended_select_for_time(
|
||||
'threshold',
|
||||
$threshold,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Schedule'),
|
||||
ui_print_warning_message(
|
||||
[
|
||||
'message' => __('No alert has been scheduled yet'),
|
||||
'force_style' => 'display:none;',
|
||||
'force_class' => 'alert_schedule',
|
||||
],
|
||||
'',
|
||||
true
|
||||
).'<div id="calendar_map" style="width: 90%;"></div>'.html_print_input_hidden('schedule', $schedule, true)
|
||||
);
|
||||
|
||||
$table->data[4][0] = __('Min. number of alerts');
|
||||
$table->data[4][1] = html_print_input_text(
|
||||
'min_alerts',
|
||||
$min_alerts,
|
||||
'',
|
||||
5,
|
||||
7,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Time threshold'),
|
||||
html_print_extended_select_for_time(
|
||||
'threshold',
|
||||
$threshold,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[4][2] = __('Reset counter for non-sustained alerts');
|
||||
$table->data[4][2] .= ui_print_help_tip(
|
||||
__('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'),
|
||||
true
|
||||
);
|
||||
$table->data[4][3] = html_print_checkbox(
|
||||
'min_alerts_reset_counter',
|
||||
1,
|
||||
$min_alerts_reset_counter,
|
||||
true,
|
||||
(!$is_management_allowed | $disabled),
|
||||
'',
|
||||
false,
|
||||
($create_template == 1) ? 'checked=checked' : ''
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Default action').ui_print_help_tip(
|
||||
__('Unless they\'re left blank, the fields from the action will override those set on the template.'),
|
||||
true
|
||||
),
|
||||
html_print_select_from_sql(
|
||||
$sql_query,
|
||||
'default_action',
|
||||
$default_action,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
(!$is_management_allowed | $disabled),
|
||||
false,
|
||||
false,
|
||||
0,
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[5][0] = __('Max. number of alerts');
|
||||
$table->data[5][1] = html_print_input_text(
|
||||
'max_alerts',
|
||||
$max_alerts,
|
||||
'',
|
||||
5,
|
||||
7,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Min. number of alerts'),
|
||||
html_print_input_text(
|
||||
'min_alerts',
|
||||
$min_alerts,
|
||||
'',
|
||||
5,
|
||||
7,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[5][2] = __('Disable event');
|
||||
$table->data[5][3] = html_print_checkbox(
|
||||
'disable_event',
|
||||
1,
|
||||
$disable_event,
|
||||
true,
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
__('Reset counter for non-sustained alerts').ui_print_help_tip(
|
||||
__('Enable this option if you want the counter to be reset when the alert is not being fired consecutively, even if it\'s within the time threshold'),
|
||||
true
|
||||
),
|
||||
html_print_checkbox(
|
||||
'min_alerts_reset_counter',
|
||||
1,
|
||||
$min_alerts_reset_counter,
|
||||
true,
|
||||
(!$is_management_allowed | $disabled),
|
||||
'',
|
||||
false,
|
||||
($create_template == 1) ? 'checked=checked' : ''
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Max. number of alerts'),
|
||||
html_print_input_text(
|
||||
'max_alerts',
|
||||
$max_alerts,
|
||||
'',
|
||||
5,
|
||||
7,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Disable event'),
|
||||
html_print_checkbox(
|
||||
'disable_event',
|
||||
1,
|
||||
$disable_event,
|
||||
true,
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[6][0] = __('Default action');
|
||||
$usr_groups = implode(
|
||||
',',
|
||||
array_keys(users_get_groups($config['id_user'], 'LM', true))
|
||||
|
@ -769,123 +814,98 @@ if ($step == 2) {
|
|||
$usr_groups
|
||||
);
|
||||
|
||||
$table->data[6][1] = html_print_select_from_sql(
|
||||
$sql_query,
|
||||
'default_action',
|
||||
$default_action,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
(!$is_management_allowed | $disabled),
|
||||
false,
|
||||
false,
|
||||
0
|
||||
);
|
||||
$table->data[6][1] .= ui_print_help_tip(
|
||||
__('Unless they\'re left blank, the fields from the action will override those set on the template.'),
|
||||
true
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Condition type'),
|
||||
html_print_select(
|
||||
alerts_get_alert_templates_types(),
|
||||
'type',
|
||||
$type,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p',
|
||||
(!$is_management_allowed | $disabled)
|
||||
).'<span id="matches_value" '.(($show_matches) ? '' : 'class="invisible"').'>'.' '.html_print_checkbox('matches_value', 1, $matches, true).html_print_label(
|
||||
__('Trigger when matches the value'),
|
||||
'checkbox-matches_value',
|
||||
true
|
||||
).'</span>'
|
||||
);
|
||||
|
||||
$table->data[7][0] = __('Condition type');
|
||||
$table->data[7][1] = html_print_select(
|
||||
alerts_get_alert_templates_types(),
|
||||
'type',
|
||||
$type,
|
||||
'',
|
||||
__('None'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data['value'][1] = html_print_label_input_block(
|
||||
__('Value'),
|
||||
html_print_input_text(
|
||||
'value',
|
||||
$value,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true
|
||||
).' <span id="regex_ok">'.html_print_image(
|
||||
'images/suc.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'display:none',
|
||||
'id' => 'regex_good',
|
||||
'title' => __('The regular expression is valid'),
|
||||
'width' => '20px',
|
||||
]
|
||||
).html_print_image(
|
||||
'images/err.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'display:none',
|
||||
'id' => 'regex_bad',
|
||||
'title' => __('The regular expression is not valid'),
|
||||
'width' => '20px',
|
||||
]
|
||||
).'</span>'
|
||||
);
|
||||
$table->data[7][1] .= '<span id="matches_value" '.(($show_matches) ? '' : 'class="invisible"').'>';
|
||||
$table->data[7][1] .= ' '.html_print_checkbox('matches_value', 1, $matches, true);
|
||||
$table->data[7][1] .= html_print_label(
|
||||
__('Trigger when matches the value'),
|
||||
'checkbox-matches_value',
|
||||
true
|
||||
);
|
||||
$table->data[7][1] .= '</span>';
|
||||
$table->colspan[7][1] = 3;
|
||||
|
||||
$table->data['value'][0] = __('Value');
|
||||
$table->data['value'][1] = html_print_input_text(
|
||||
'value',
|
||||
$value,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$table->data['value'][1] .= ' <span id="regex_ok">';
|
||||
$table->data['value'][1] .= html_print_image(
|
||||
'images/suc.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'display:none',
|
||||
'id' => 'regex_good',
|
||||
'title' => __('The regular expression is valid'),
|
||||
'width' => '20px',
|
||||
]
|
||||
);
|
||||
$table->data['value'][1] .= html_print_image(
|
||||
'images/err.png',
|
||||
true,
|
||||
[
|
||||
'style' => 'display:none',
|
||||
'id' => 'regex_bad',
|
||||
'title' => __('The regular expression is not valid'),
|
||||
'width' => '20px',
|
||||
]
|
||||
);
|
||||
$table->data['value'][1] .= '</span>';
|
||||
$table->colspan['value'][1] = 3;
|
||||
|
||||
// Min first, then max, that's more logical.
|
||||
$table->data['min'][0] = __('Min.');
|
||||
$table->data['min'][1] = html_print_input_text(
|
||||
'min',
|
||||
$min,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true,
|
||||
$disabled
|
||||
$table->data['min'][0] = html_print_label_input_block(
|
||||
__('Min.'),
|
||||
html_print_input_text(
|
||||
'min',
|
||||
$min,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true,
|
||||
$disabled
|
||||
)
|
||||
);
|
||||
$table->colspan['min'][1] = 3;
|
||||
|
||||
$table->data['max'][0] = __('Max.');
|
||||
$table->data['max'][1] = html_print_input_text(
|
||||
'max',
|
||||
$max,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true,
|
||||
$disabled
|
||||
$table->data['max'][1] = html_print_label_input_block(
|
||||
__('Max.'),
|
||||
html_print_input_text(
|
||||
'max',
|
||||
$max,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true,
|
||||
$disabled
|
||||
)
|
||||
);
|
||||
$table->colspan['max'][1] = 3;
|
||||
|
||||
$table->data['example'][1] = ui_print_alert_template_example(
|
||||
$table->data['example'][0] = ui_print_alert_template_example(
|
||||
$id,
|
||||
true,
|
||||
false
|
||||
);
|
||||
$table->colspan['example'][1] = 4;
|
||||
} else if ($step == 3) {
|
||||
$table->style[0] = 'font-weight: bold; vertical-align: middle';
|
||||
$table->style[1] = 'font-weight: bold; vertical-align: top';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align: top';
|
||||
$table->style[1] = 'font-weight: bold; vertical-align: top;';
|
||||
$table->style[2] = 'font-weight: bold; vertical-align: top;';
|
||||
$table->size = [];
|
||||
$table->size[0] = '10%';
|
||||
$table->size[1] = '45%';
|
||||
$table->size[2] = '45%';
|
||||
$table->size[1] = '50%';
|
||||
$table->size[2] = '50%';
|
||||
$table->colspan[0][0] = 2;
|
||||
|
||||
$table->class = 'databox filters w100p filter-table-adv alert-template-fields';
|
||||
// Alert recover.
|
||||
if (! $recovery_notify) {
|
||||
$table->cellstyle['label_fields'][2] = 'display:none;';
|
||||
|
@ -894,29 +914,29 @@ if ($step == 2) {
|
|||
}
|
||||
}
|
||||
|
||||
$table->data[0][0] = __('Alert recovery');
|
||||
$values = [
|
||||
false => __('Disabled'),
|
||||
true => __('Enabled'),
|
||||
];
|
||||
$table->data[0][1] = html_print_select(
|
||||
$values,
|
||||
'recovery_notify',
|
||||
$recovery_notify,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Alert recovery'),
|
||||
html_print_select(
|
||||
$values,
|
||||
'recovery_notify',
|
||||
$recovery_notify,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w25p',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
$table->colspan[0][1] = 2;
|
||||
|
||||
$table->data['label_fields'][0] = '';
|
||||
$table->data['label_fields'][1] = __('Firing fields');
|
||||
$table->data['label_fields'][2] = __('Recovery fields');
|
||||
$table->data['label_fields'][1] = '<span class"center">'.__('Firing fields').'</span>';
|
||||
$table->data['label_fields'][2] = '<span class"center">'.__('Recovery fields').'</span>';
|
||||
|
||||
for ($i = 1; $i <= $config['max_macro_fields']; $i++) {
|
||||
if (isset($template[$name]) === true) {
|
||||
|
@ -925,99 +945,106 @@ if ($step == 2) {
|
|||
$value = '';
|
||||
}
|
||||
|
||||
$table->data['field'.$i][0] = sprintf(__('Field %s'), $i);
|
||||
// $table->data['field'.$i][0] = sprintf(__('Field %s'), $i);
|
||||
// TinyMCE.
|
||||
// triggering fields.
|
||||
// Basic.
|
||||
$table->data['field'.$i][1] = '<div id="command_div"><b><small>';
|
||||
$table->data['field'.$i][1] .= __('Basic').' ';
|
||||
$table->data['field'.$i][1] .= html_print_radio_button_extended(
|
||||
$col1 = '<div id="command_div"><b><small>';
|
||||
$col1 .= __('Basic').' ';
|
||||
$col1 .= html_print_radio_button_extended(
|
||||
'editor_type_value_'.$i,
|
||||
0,
|
||||
'',
|
||||
false,
|
||||
(!$is_management_allowed | $disabled),
|
||||
"removeTinyMCE('textarea_field".$i."')",
|
||||
'',
|
||||
'style="height: 15px !important;"',
|
||||
true
|
||||
);
|
||||
// Advanced.
|
||||
$table->data['field'.$i][1] .= ' ';
|
||||
$table->data['field'.$i][1] .= __('Advanced').' ';
|
||||
$table->data['field'.$i][1] .= html_print_radio_button_extended(
|
||||
$col1 .= ' ';
|
||||
$col1 .= __('Advanced').' ';
|
||||
$col1 .= html_print_radio_button_extended(
|
||||
'editor_type_value_'.$i,
|
||||
0,
|
||||
'',
|
||||
true,
|
||||
(!$is_management_allowed | $disabled),
|
||||
"addTinyMCE('textarea_field".$i."')",
|
||||
'',
|
||||
'style="height: 15px !important;"',
|
||||
true
|
||||
);
|
||||
$table->data['field'.$i][1] .= '</small></b></div>';
|
||||
$col1 .= '</small></b></div>';
|
||||
|
||||
// Texarea.
|
||||
$table->data['field'.$i][1] .= html_print_textarea(
|
||||
$col1 .= html_print_textarea(
|
||||
'field'.$i,
|
||||
1,
|
||||
1,
|
||||
isset($fields[$i]) ? $fields[$i] : '',
|
||||
'class="fields" min-height-40px',
|
||||
'class="fields w100p" style="min-height: 100px !important;"',
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
);
|
||||
$table->data['field'.$i][1] = html_print_label_input_block(
|
||||
sprintf(__('Field %s'), $i),
|
||||
$col1
|
||||
);
|
||||
|
||||
// Recovery.
|
||||
// Basic.
|
||||
$table->data['field'.$i][2] = '<div id="command_div"><b><small>';
|
||||
$table->data['field'.$i][2] .= __('Basic').' ';
|
||||
$table->data['field'.$i][2] .= html_print_radio_button_extended(
|
||||
$col2 = '<div id="command_div"><b><small>';
|
||||
$col2 .= __('Basic').' ';
|
||||
$col2 .= html_print_radio_button_extended(
|
||||
'editor_type_recovery_value_'.$i,
|
||||
0,
|
||||
'',
|
||||
false,
|
||||
(!$is_management_allowed | $disabled),
|
||||
"removeTinyMCE('textarea_field".$i."_recovery')",
|
||||
'',
|
||||
'style="height: 15px !important;"',
|
||||
true
|
||||
);
|
||||
// Advanced.
|
||||
$table->data['field'.$i][2] .= ' ';
|
||||
$table->data['field'.$i][2] .= __('Advanced').' ';
|
||||
$table->data['field'.$i][2] .= html_print_radio_button_extended(
|
||||
$col2 .= ' ';
|
||||
$col2 .= __('Advanced').' ';
|
||||
$col2 .= html_print_radio_button_extended(
|
||||
'editor_type_recovery_value_'.$i,
|
||||
0,
|
||||
'',
|
||||
true,
|
||||
(!$is_management_allowed | $disabled),
|
||||
"addTinyMCE('textarea_field".$i."_recovery')",
|
||||
'',
|
||||
'style="height: 15px !important;"',
|
||||
true
|
||||
);
|
||||
$table->data['field'.$i][2] .= '</small></b></div>';
|
||||
$col2 .= '</small></b></div>';
|
||||
|
||||
// Texarea.
|
||||
$table->data['field'.$i][2] .= html_print_textarea(
|
||||
$col2 .= html_print_textarea(
|
||||
'field'.$i.'_recovery',
|
||||
1,
|
||||
1,
|
||||
isset($fields_recovery[$i]) ? $fields_recovery[$i] : '',
|
||||
'class="fields min-height-40px"',
|
||||
'class="fields w100p" style="min-height: 100px !important;"',
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
);
|
||||
$table->data['field'.$i][2] = html_print_label_input_block(
|
||||
' ',
|
||||
$col2
|
||||
);
|
||||
}
|
||||
} else {
|
||||
// Step 1 by default.
|
||||
$table->size = [];
|
||||
$table->size[0] = '20%';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->colspan = [];
|
||||
$table->colspan[1][0] = 2;
|
||||
$table->data = [];
|
||||
$table->rowstyle = [];
|
||||
$table->rowstyle['value'] = 'display: none';
|
||||
$table->rowstyle['max'] = 'display: none';
|
||||
$table->rowstyle['min'] = 'display: none';
|
||||
|
||||
$show_matches = false;
|
||||
switch ($type) {
|
||||
|
@ -1049,29 +1076,29 @@ if ($step == 2) {
|
|||
break;
|
||||
}
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$name,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$table->data[0][1] .= ' '.__('Group');
|
||||
$groups = users_get_groups();
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
|
||||
|
@ -1085,59 +1112,76 @@ if ($step == 2) {
|
|||
}
|
||||
}
|
||||
|
||||
$table->data[0][1] .= ' ';
|
||||
$table->data[0][1] .= '<div class="w250px inline">'.html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
).'</div>';
|
||||
|
||||
|
||||
$table->data[1][0] = __('Description');
|
||||
$table->data[1][1] = html_print_textarea(
|
||||
'description',
|
||||
10,
|
||||
30,
|
||||
$description,
|
||||
'',
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Priority');
|
||||
$table->data[2][1] = html_print_select(
|
||||
get_priorities(),
|
||||
'priority',
|
||||
$priority,
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea(
|
||||
'description',
|
||||
10,
|
||||
30,
|
||||
$description,
|
||||
'',
|
||||
true,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Priority'),
|
||||
html_print_select(
|
||||
get_priorities(),
|
||||
'priority',
|
||||
$priority,
|
||||
'',
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
(!$is_management_allowed | $disabled)
|
||||
)
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data[3][0] = __('Wizard level');
|
||||
$wizard_levels = [
|
||||
'nowizard' => __('No wizard'),
|
||||
'basic' => __('Basic'),
|
||||
'advanced' => __('Advanced'),
|
||||
];
|
||||
$table->data[3][1] = html_print_select($wizard_levels, 'wizard_level', $wizard_level, '', '', -1, true, false, false);
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Wizard level'),
|
||||
html_print_select(
|
||||
$wizard_levels,
|
||||
'wizard_level',
|
||||
$wizard_level,
|
||||
'',
|
||||
'',
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$table->data[2][1] .= html_print_input_hidden('wizard_level', $wizard_level, true);
|
||||
}
|
||||
|
@ -1150,9 +1194,9 @@ if ($step == 2) {
|
|||
$offset = (int) get_parameter('offset');
|
||||
// If it's the last step it will redirect to template lists.
|
||||
if ($step >= LAST_STEP) {
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'&offset='.$offset.'">';
|
||||
echo '<form class="max_floating_element_size" method="post" action="index.php?sec='.$sec.'&sec2=godmode/alerts/alert_templates&pure='.$pure.'&offset='.$offset.'">';
|
||||
} else {
|
||||
echo '<form method="post">';
|
||||
echo '<form class="max_floating_element_size" method="post">';
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
@ -1168,41 +1212,46 @@ if ($id) {
|
|||
if (!$disabled) {
|
||||
if ($is_management_allowed === true) {
|
||||
if ($step >= LAST_STEP) {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Finish'),
|
||||
'finish',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_input_hidden('step', ($step + 1));
|
||||
if ($step == 2) {
|
||||
// Javascript onsubmit to avoid min = 0 and max = 0.
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Next'),
|
||||
'next',
|
||||
false,
|
||||
'class="sub next" onclick="return check_fields_step2();"'
|
||||
[
|
||||
'class' => 'submitButton',
|
||||
'onclick' => 'return check_fields_step2();',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Next'),
|
||||
'next',
|
||||
false,
|
||||
'class="sub next"'
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
enterprise_hook('close_meta_frame');
|
||||
}
|
||||
|
||||
ui_require_javascript_file('pandora_alerts');
|
||||
ui_include_time_picker();
|
||||
ui_require_jquery_file('ui.datepicker-'.get_user_language(), 'include/javascript/i18n/');
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -32,8 +32,6 @@ global $config;
|
|||
// Check login and ACLs.
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'PM') && !is_user_admin($config['id_user'])) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -52,45 +50,42 @@ $search = (int) get_parameter('search_category', 0);
|
|||
$category_name = (string) get_parameter('category_name', '');
|
||||
$tab = (string) get_parameter('tab', 'list');
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
];
|
||||
} else {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=galertas&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
];
|
||||
}
|
||||
$sec = (is_metaconsole() === true) ? 'advanced' : 'galertas';
|
||||
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec='.$sec.'&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
];
|
||||
|
||||
$buttons[$tab]['active'] = true;
|
||||
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
ui_meta_print_header(__('Categories configuration'), __('List'), $buttons);
|
||||
} else {
|
||||
ui_print_page_header(__('Categories configuration'), 'images/gm_modules.png', false, '', true, $buttons);
|
||||
}
|
||||
|
||||
ui_print_standard_header(
|
||||
__('Categories configuration'),
|
||||
'images/gm_modules.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Module categories'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$is_management_allowed = true;
|
||||
if (is_management_allowed() === false) {
|
||||
|
@ -152,11 +147,7 @@ $rowPair = true;
|
|||
$iterator = 0;
|
||||
|
||||
if (empty($result) === false) {
|
||||
// Prepare pagination.
|
||||
ui_pagination($total_categories, $url);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
|
||||
$table->data = [];
|
||||
|
@ -185,14 +176,20 @@ if (empty($result) === false) {
|
|||
if (is_metaconsole() === true) {
|
||||
$data[0] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".$category['name'].'</a>';
|
||||
$data[1] = "<a href='index.php?sec=advanced&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
true,
|
||||
['title' => 'Edit']
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a> ';
|
||||
$data[1] .= '<a href="index.php?sec=advanced&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delet.svg',
|
||||
true,
|
||||
['title' => 'Delete']
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
} else {
|
||||
if ($is_management_allowed === true) {
|
||||
|
@ -202,17 +199,40 @@ if (empty($result) === false) {
|
|||
}
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[][1] = 'action_buttons';
|
||||
$data[1] = "<a href='index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category=".$category['id'].'&pure='.(int) $config['pure']."'>".html_print_image(
|
||||
'images/config.png',
|
||||
true,
|
||||
['title' => 'Edit']
|
||||
).'</a>';
|
||||
$data[1] .= '<a href="index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'].'"onclick="if (! confirm (\''.__('Are you sure?').'\')) return false">'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
['title' => 'Delete']
|
||||
).'</a>';
|
||||
$table->cellclass[][1] = 'table_action_buttons';
|
||||
$tableActionButtonsContent = [];
|
||||
$tableActionButtonsContent[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gmodules&sec2=godmode/category/edit_category&action=update&id_category='.$category['id'].'&pure='.(int) $config['pure'],
|
||||
'content' => html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$tableActionButtonsContent[] = html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec=gmodules&sec2=godmode/category/category&delete_category='.$category['id'].'&pure='.(int) $config['pure'],
|
||||
'onClick' => 'if (! confirm (\''.__('Are you sure?').'\')) return false',
|
||||
'content' => html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$data[1] = implode('', $tableActionButtonsContent);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -220,7 +240,7 @@ if (empty($result) === false) {
|
|||
}
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination($total_categories, $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination($total_categories, $url, $offset, 0, true, 'offset', false);
|
||||
} else {
|
||||
// No categories available or selected.
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('No categories found') ]);
|
||||
|
@ -228,17 +248,25 @@ if (empty($result) === false) {
|
|||
|
||||
if ($is_management_allowed === true) {
|
||||
// Form to add new categories or search categories.
|
||||
echo "<div class='w100p right_align'>";
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<form method="post" action="index.php?sec=advanced&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">';
|
||||
} else {
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">';
|
||||
}
|
||||
$sec = (is_metaconsole() === true) ? 'advanced' : 'gmodules';
|
||||
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/category/edit_category&action=new&pure='.(int) $config['pure'].'">';
|
||||
|
||||
html_print_input_hidden('create_category', '1', true);
|
||||
html_print_submit_button(__('Create category'), 'create_button', false, 'class="sub next"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create category'),
|
||||
'create_button',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
}
|
||||
|
|
|
@ -1,21 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* Edit Category.
|
||||
*
|
||||
* @category Category
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
// Include functions code
|
||||
// Include functions code.
|
||||
require_once $config['homedir'].'/include/functions_categories.php';
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! is_user_admin($config['id_user'])) {
|
||||
|
@ -35,44 +48,55 @@ $update_category = (int) get_parameter('update_category', 0);
|
|||
$create_category = (int) get_parameter('create_category', 0);
|
||||
$name_category = (string) get_parameter('name_category', '');
|
||||
$tab = (string) get_parameter('tab', 'list');
|
||||
// Main URL.
|
||||
$mainUrl = 'index.php?sec=gagente&sec2=godmode/category/category';
|
||||
$sec = (is_metaconsole() === true) ? 'advanced' : 'gmodules';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=advanced&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
];
|
||||
} else {
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=gmodules&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'].'">'.html_print_image(
|
||||
'images/list.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
];
|
||||
}
|
||||
$buttons = [
|
||||
'list' => [
|
||||
'active' => false,
|
||||
'text' => html_print_anchor(
|
||||
[
|
||||
'href' => 'index.php?sec='.$sec.'&sec2=godmode/category/category&tab=list&pure='.(int) $config['pure'],
|
||||
'content' => html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('List categories'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
];
|
||||
|
||||
$buttons[$tab]['active'] = false;
|
||||
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
ui_meta_print_header(__('Categories configuration'), __('Editor'), $buttons);
|
||||
} else {
|
||||
ui_print_page_header(__('Categories configuration'), 'images/gm_modules.png', false, '', true, $buttons);
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('Manage category'),
|
||||
'images/gm_modules.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => $mainUrl,
|
||||
'label' => __('Module categories'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
@ -136,7 +160,7 @@ if ($create_category) {
|
|||
|
||||
// Form fields are filled here
|
||||
// Get results when update action is performed.
|
||||
if ($action == 'update' && $id_category != 0) {
|
||||
if ($action === 'update' && $id_category != 0) {
|
||||
$result_category = db_get_row_filter('tcategory', ['id' => $id_category]);
|
||||
$name_category = $result_category['name'];
|
||||
} //end if
|
||||
|
@ -144,76 +168,58 @@ else {
|
|||
$name_category = '';
|
||||
}
|
||||
|
||||
// Create/Update category form.
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/category/edit_category&action='.$action.'&id_category='.$id_category.'&pure='.(int) $config['pure'].'" enctype="multipart/form-data">';
|
||||
|
||||
// Create/Update category form
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/category/edit_category&action='.$action.'&id_category='.$id_category.'&pure='.(int) $config['pure'].'" enctype="multipart/form-data">';
|
||||
$table = new stdClass();
|
||||
$table->id = 'edit_catagory_table';
|
||||
$table->class = 'databox';
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
echo '<div align=left class="pandora_form w100p">';
|
||||
} else {
|
||||
echo '<div align=left class="pandora_form w100p">';
|
||||
}
|
||||
|
||||
echo "<table border=0 cellpadding=4 cellspacing=4 class='databox filters' width=100%>";
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if ($action == 'update') {
|
||||
echo '<thead>
|
||||
<tr>
|
||||
<th align=center colspan=5>'.__('Update category').'</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
}
|
||||
|
||||
if ($action == 'new') {
|
||||
echo '<thead>
|
||||
<tr>
|
||||
<th align=center colspan=5>'.__('Create category').'</th>
|
||||
</tr>
|
||||
</thead>';
|
||||
$table->head = [];
|
||||
if (is_metaconsole() === true) {
|
||||
if ($action === 'update') {
|
||||
$table->head[0] = __('Update category');
|
||||
} else if ($action === 'new') {
|
||||
$table->head[0] = __('Create category');
|
||||
}
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
echo "<td class='bolder'>";
|
||||
$table->data = [];
|
||||
|
||||
html_print_label(__('Name'), 'name');
|
||||
echo '</td>';
|
||||
echo '<td>';
|
||||
html_print_input_text('name_category', $name_category);
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[1][0] = html_print_input_text('name_category', $name_category, '', 50, 255, true);
|
||||
|
||||
echo '</table>';
|
||||
html_print_table($table);
|
||||
|
||||
echo "<table border=0 cellpadding=0 cellspacing=0 class='' width=100%>";
|
||||
echo '<tr>';
|
||||
echo '<td align=right>';
|
||||
if ($action == 'update') {
|
||||
if ($action === 'update') {
|
||||
html_print_input_hidden('update_category', 1);
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'update_button',
|
||||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
}
|
||||
|
||||
if ($action == 'new') {
|
||||
$buttonCaption = __('Update');
|
||||
$buttonName = 'update_button';
|
||||
$buttonIcon = 'update';
|
||||
} else if ($action === 'new') {
|
||||
html_print_input_hidden('create_category', 1);
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'create_button',
|
||||
false,
|
||||
'class="sub next"'
|
||||
);
|
||||
$buttonCaption = __('Create');
|
||||
$buttonName = 'create_button';
|
||||
$buttonIcon = 'next';
|
||||
}
|
||||
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
$actionButtons = [];
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
$buttonCaption,
|
||||
$buttonName,
|
||||
false,
|
||||
[ 'icon' => $buttonIcon ],
|
||||
true
|
||||
);
|
||||
$actionButtons[] = html_print_go_back_button(
|
||||
$mainUrl,
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
[ 'type' => 'form_action' ]
|
||||
);
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
|
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
/**
|
||||
* Audit log View.
|
||||
*
|
||||
* @category Audit log
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @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;
|
||||
|
||||
require_once $config['homedir'].'/include/class/EventSound.class.php';
|
||||
|
||||
$ajaxPage = 'godmode/events/configuration_sounds';
|
||||
|
||||
// Control call flow.
|
||||
try {
|
||||
// User access and validation is being processed on class constructor.
|
||||
$controller = new EventSound($ajaxPage);
|
||||
} catch (Exception $e) {
|
||||
if ((bool) is_ajax() === true) {
|
||||
echo json_encode(['error' => '[EventSound]'.$e->getMessage() ]);
|
||||
exit;
|
||||
} else {
|
||||
echo '[EventSound]'.$e->getMessage();
|
||||
}
|
||||
|
||||
// Stop this execution, but continue 'globally'.
|
||||
return;
|
||||
}
|
||||
|
||||
// AJAX controller.
|
||||
if ((bool) is_ajax() === true) {
|
||||
$method = get_parameter('method');
|
||||
|
||||
if (method_exists($controller, $method) === true) {
|
||||
if ($controller->ajaxMethod($method) === true) {
|
||||
$controller->{$method}();
|
||||
} else {
|
||||
$controller->error('Unavailable method.');
|
||||
}
|
||||
} else {
|
||||
$controller->error('Method not found. ['.$method.']');
|
||||
}
|
||||
|
||||
// Stop any execution.
|
||||
exit;
|
||||
} else {
|
||||
// Run.
|
||||
$controller->run();
|
||||
}
|
|
@ -81,9 +81,7 @@ $table->width = '100%';
|
|||
$table->class = 'databox filters';
|
||||
|
||||
$table->size = [];
|
||||
// ~ $table->size[0] = '20%';
|
||||
$table->size[1] = '10px';
|
||||
// ~ $table->size[2] = '20%';
|
||||
$table->style[0] = 'text-align:center;';
|
||||
$table->style[2] = 'text-align:center;';
|
||||
|
||||
|
@ -129,19 +127,21 @@ foreach ($fields_available as $key => $available) {
|
|||
$table->data[0][0] = '<b>'.__('Fields available').'</b>';
|
||||
$table->data[1][0] = html_print_select($fields_available, 'fields_available[]', true, '', '', 0, true, true, false, '', false, 'width: 300px');
|
||||
$table->data[1][1] = '<a href="javascript:">'.html_print_image(
|
||||
'images/darrowright_green.png',
|
||||
'images/arrow@svg.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'right',
|
||||
'title' => __('Add fields to select'),
|
||||
'style' => 'rotate: 180deg; width: 40px',
|
||||
]
|
||||
).'</a>';
|
||||
$table->data[1][1] .= '<br><br><br><br><a href="javascript:">'.html_print_image(
|
||||
'images/darrowleft_green.png',
|
||||
'images/arrow@svg.svg',
|
||||
true,
|
||||
[
|
||||
'id' => 'left',
|
||||
'title' => __('Delete fields to select'),
|
||||
'style' => 'width: 40px',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
|
@ -184,10 +184,17 @@ $table->data[1][2] .= '</div></div>';
|
|||
echo '<form id="custom_events" method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=fields&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(__('Update'), 'upd_button', false, 'class="sub upd"');
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Update'),
|
||||
'upd_button',
|
||||
false,
|
||||
[ 'icon' => 'update' ],
|
||||
true
|
||||
),
|
||||
[ 'type' => 'form_action' ]
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
@ -234,7 +241,7 @@ $(document).ready (function () {
|
|||
}
|
||||
});
|
||||
|
||||
$("#submit-upd_button").click(function () {
|
||||
$("#button-upd_button").click(function () {
|
||||
$("#fields_selected").find("option[value='0']").remove();
|
||||
$('#fields_selected option').map(function() {
|
||||
$(this).prop('selected', true);
|
||||
|
|
|
@ -262,33 +262,37 @@ if ($create) {
|
|||
$own_info = get_user_info($config['id_user']);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->width = '1366px';
|
||||
// $table->width = '100%';
|
||||
$table->border = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
$table->class = 'databox filters';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->class = 'databox filters events-filters-create pdd_10px';
|
||||
$table->style[0] = 'vertical-align: top;';
|
||||
$table->rowspan = [];
|
||||
$table->rowspan[3][0] = 2;
|
||||
|
||||
$table->valign[1] = 'top';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
if ($id) {
|
||||
$table->head[0] = __('Update Filter');
|
||||
} else {
|
||||
$table->head[0] = __('Create Filter');
|
||||
}
|
||||
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
$table->style[0] = '';
|
||||
$table->valign[1] = '';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
$table->data[0][0] = '<b>'.__('Filter name').'</b>';
|
||||
$table->data[0][1] = html_print_input_text('id_name', $id_name, false, 20, 80, true);
|
||||
|
||||
$table->data[1][0] = '<b>'.__('Save in group').'</b>'.ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true);
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Filter name'),
|
||||
html_print_input_text(
|
||||
'id_name',
|
||||
$id_name,
|
||||
false,
|
||||
20,
|
||||
80,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
|
||||
$returnAllGroup = users_can_manage_group_all();
|
||||
// If the user can't manage All group but the filter is for All group, the user should see All group in the select.
|
||||
|
@ -296,115 +300,135 @@ if ($returnAllGroup === false && $id_group_filter == 0) {
|
|||
$returnAllGroup = true;
|
||||
}
|
||||
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
$returnAllGroup,
|
||||
'id_group_filter',
|
||||
$id_group_filter,
|
||||
'',
|
||||
'',
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo',
|
||||
$strict_user
|
||||
).'</div>';
|
||||
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Save in group').ui_print_help_tip(__('This group will be use to restrict the visibility of this filter with ACLs'), true),
|
||||
'<div class="w100p">'.html_print_select_groups(
|
||||
$config['id_user'],
|
||||
$access,
|
||||
$returnAllGroup,
|
||||
'id_group_filter',
|
||||
$id_group_filter,
|
||||
'',
|
||||
'',
|
||||
-1,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo',
|
||||
$strict_user
|
||||
).'</div>'
|
||||
);
|
||||
$return_all_group = false;
|
||||
|
||||
if (users_can_manage_group_all('AR') === true) {
|
||||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table->data[2][0] = '<b>'.__('Group').'</b>';
|
||||
$display_all_group = (users_is_admin() || users_can_manage_group_all('AR'));
|
||||
$table->data[2][1] = '<div class="w250px">'.html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).'</div>';
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
'<div class="w100p">'.html_print_select_groups(
|
||||
$config['id_user'],
|
||||
'AR',
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$types = get_event_types();
|
||||
// Expand standard array to add not_normal (not exist in the array, used only for searches)
|
||||
$types['not_normal'] = __('Not normal');
|
||||
|
||||
$table->data[3][0] = '<b>'.__('Event type').'</b>';
|
||||
$table->data[3][1] = html_print_select(
|
||||
$types,
|
||||
'event_type',
|
||||
$event_type,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Event type'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$types,
|
||||
'event_type',
|
||||
$event_type,
|
||||
'',
|
||||
__('All'),
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
if (empty($severity) && $severity !== '0') {
|
||||
$severity = -1;
|
||||
}
|
||||
|
||||
$table->data[4][0] = '<b>'.__('Severity').'</b>';
|
||||
$table->data[4][1] = html_print_select(
|
||||
get_priorities(),
|
||||
'severity[]',
|
||||
$severity,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 175px'
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Severity'),
|
||||
html_print_select(
|
||||
get_priorities(),
|
||||
'severity[]',
|
||||
$severity,
|
||||
'',
|
||||
__('All'),
|
||||
-1,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$fields = events_get_all_status();
|
||||
|
||||
$table->data[5][0] = '<b>'.__('Event status').'</b>';
|
||||
$table->data[5][1] = html_print_select(
|
||||
$fields,
|
||||
'status',
|
||||
$status,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
__('Event status'),
|
||||
html_print_select(
|
||||
$fields,
|
||||
'status',
|
||||
$status,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%'
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[6][0] = '<b>'.__('Free search').'</b>';
|
||||
$table->data[6][1] = html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
15,
|
||||
255,
|
||||
true
|
||||
);
|
||||
$table->data[6][1] .= ' '.html_print_checkbox_switch(
|
||||
'not_search',
|
||||
$not_search,
|
||||
$not_search,
|
||||
true,
|
||||
false,
|
||||
'checked_slide_events(this);',
|
||||
true
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Free search'),
|
||||
'<div class="flex_center">'.html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
15,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w96p mrgn_right_15px'
|
||||
).' '.html_print_checkbox_switch(
|
||||
'not_search',
|
||||
$not_search,
|
||||
$not_search,
|
||||
true,
|
||||
false,
|
||||
'checked_slide_events(this);',
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[7][0] = '<b>'.__('Agent search').'</b>';
|
||||
$params = [];
|
||||
$params['show_helptip'] = true;
|
||||
$params['input_name'] = 'text_agent';
|
||||
|
@ -419,39 +443,48 @@ if (is_metaconsole()) {
|
|||
$params['hidden_input_idagent_value'] = $id_agent;
|
||||
}
|
||||
|
||||
$table->data[7][1] = ui_print_agent_autocomplete_input($params);
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Agent search'),
|
||||
'<div class="w100p">'.ui_print_agent_autocomplete_input($params).'</div>'
|
||||
);
|
||||
|
||||
$lpagination[25] = 25;
|
||||
$lpagination[50] = 50;
|
||||
$lpagination[100] = 100;
|
||||
$lpagination[200] = 200;
|
||||
$lpagination[500] = 500;
|
||||
$table->data[8][0] = '<b>'.__('Block size for pagination').'</b>';
|
||||
$table->data[8][1] = html_print_select(
|
||||
$lpagination,
|
||||
'pagination',
|
||||
$pagination,
|
||||
'',
|
||||
__('Default'),
|
||||
$config['block_size'],
|
||||
true
|
||||
$table->data[5][1] = html_print_label_input_block(
|
||||
__('Block size for pagination'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$lpagination,
|
||||
'pagination',
|
||||
$pagination,
|
||||
'',
|
||||
__('Default'),
|
||||
$config['block_size'],
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[9][0] = '<b>'.__('Max. hours old').'</b>';
|
||||
$table->data[9][1] = html_print_input_text(
|
||||
'event_view_hr',
|
||||
$event_view_hr,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[10][0] = '<b>'.__('User ack.').'</b>';
|
||||
$table->data[10][0] .= ' ';
|
||||
$table->data[10][0] .= ui_print_help_tip(
|
||||
__('Choose between the users who have validated an event. '),
|
||||
true
|
||||
$table->data[6][0] = html_print_label_input_block(
|
||||
__('Max. hours old'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'event_view_hr',
|
||||
$event_view_hr,
|
||||
'',
|
||||
5,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
if ($strict_user) {
|
||||
|
@ -464,49 +497,96 @@ if ($strict_user) {
|
|||
);
|
||||
}
|
||||
|
||||
$table->data[10][1] = html_print_select(
|
||||
$users,
|
||||
'id_user_ack',
|
||||
$id_user_ack,
|
||||
'',
|
||||
__('Any'),
|
||||
0,
|
||||
true
|
||||
$table->data[6][1] = html_print_label_input_block(
|
||||
__('User ack.').' '.ui_print_help_tip(
|
||||
__('Choose between the users who have validated an event. '),
|
||||
true
|
||||
),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$users,
|
||||
'id_user_ack',
|
||||
$id_user_ack,
|
||||
'',
|
||||
__('Any'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[11][0] = '<b>'.__('Owner.').'</b>';
|
||||
$table->data[11][1] = html_print_select(
|
||||
$users,
|
||||
'owner_user',
|
||||
$owner_user,
|
||||
'',
|
||||
__('Any'),
|
||||
0,
|
||||
true
|
||||
$table->data[7][0] = html_print_label_input_block(
|
||||
__('Owner.'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$users,
|
||||
'owner_user',
|
||||
$owner_user,
|
||||
'',
|
||||
__('Any'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$repeated_sel = [
|
||||
EVENT_GROUP_REP_ALL => __('All events'),
|
||||
EVENT_GROUP_REP_EVENTS => __('Group events'),
|
||||
EVENT_GROUP_REP_AGENTS => __('Group agents'),
|
||||
EVENT_GROUP_REP_EXTRAIDS => __('Group extra id'),
|
||||
];
|
||||
$table->data[12][0] = '<b>'.__('Repeated').'</b>';
|
||||
$table->data[12][1] = html_print_select(
|
||||
$repeated_sel,
|
||||
'group_rep',
|
||||
$group_rep,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
|
||||
$table->data[7][1] = html_print_label_input_block(
|
||||
__('Repeated'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$repeated_sel,
|
||||
'group_rep',
|
||||
$group_rep,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[13][0] = '<b>'.__('Date from').'</b>';
|
||||
$table->data[13][1] = html_print_input_text('date_from', $date_from, '', 15, 10, true);
|
||||
$date_from = html_print_label_input_block(
|
||||
__('Date from'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'date_to',
|
||||
$date_to,
|
||||
'',
|
||||
15,
|
||||
10,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[14][0] = '<b>'.__('Date to').'</b>';
|
||||
$table->data[14][1] = html_print_input_text('date_to', $date_to, '', 15, 10, true);
|
||||
$date_to = html_print_label_input_block(
|
||||
__('Date from'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'date_to',
|
||||
$date_to,
|
||||
'',
|
||||
15,
|
||||
10,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[8][0] = '<div class="flex-row">'.$date_from.$date_to.'</div>';
|
||||
|
||||
$tag_with = json_decode($tag_with_json_clean, true);
|
||||
if (empty($tag_with)) {
|
||||
|
@ -545,176 +625,272 @@ $remove_with_tag_disabled = empty($tag_with_temp);
|
|||
$add_without_tag_disabled = empty($tags_select_without);
|
||||
$remove_without_tag_disabled = empty($tag_without_temp);
|
||||
|
||||
$table->colspan[15][0] = '2';
|
||||
$table->data[15][0] = '<b>'.__('Events with following tags').'</b>';
|
||||
$table->data[16][0] = html_print_select(
|
||||
$tags_select_with,
|
||||
'select_with',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 220px;'
|
||||
);
|
||||
$table->data[16][1] = html_print_button(
|
||||
__('Add'),
|
||||
'add_whith',
|
||||
$add_with_tag_disabled,
|
||||
'',
|
||||
'class="add sub"',
|
||||
true
|
||||
$table->data[8][0] = html_print_label_input_block(
|
||||
__('Events with following tags'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$tags_select_with,
|
||||
'select_with',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[17][0] = html_print_select(
|
||||
$tag_with_temp,
|
||||
'tag_with_temp',
|
||||
[],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 220px; height: 50px;'
|
||||
$table->data[8][1] = html_print_label_input_block(
|
||||
' ',
|
||||
'<div class="w100p">'.html_print_button(
|
||||
__('Add'),
|
||||
'add_whith',
|
||||
$add_with_tag_disabled,
|
||||
'',
|
||||
['class' => 'submitButton mini'],
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[17][0] .= html_print_input_hidden(
|
||||
|
||||
$table->data[9][0] = html_print_label_input_block(
|
||||
'',
|
||||
'<div class="w100p no-margin-top">'.html_print_select(
|
||||
$tag_with_temp,
|
||||
'tag_with_temp',
|
||||
[],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%; height: 50px;'
|
||||
).'</div>'
|
||||
).html_print_input_hidden(
|
||||
'tag_with',
|
||||
$tag_with_base64,
|
||||
true
|
||||
);
|
||||
$table->data[17][1] = html_print_button(
|
||||
__('Remove'),
|
||||
'remove_whith',
|
||||
$remove_with_tag_disabled,
|
||||
'',
|
||||
'class="delete sub"',
|
||||
true
|
||||
|
||||
$table->data[9][1] = html_print_label_input_block(
|
||||
' ',
|
||||
'<div class="w100p">'.html_print_button(
|
||||
__('Remove'),
|
||||
'remove_whith',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'mode' => 'link',
|
||||
'class' => 'submitButton',
|
||||
],
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->colspan[18][0] = '2';
|
||||
$table->data[18][0] = '<b>'.__('Events without following tags').'</b>';
|
||||
$table->data[19][0] = html_print_select(
|
||||
$tags_select_without,
|
||||
'select_without',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 220px;'
|
||||
);
|
||||
$table->data[19][1] = html_print_button(
|
||||
__('Add'),
|
||||
'add_whithout',
|
||||
$add_without_tag_disabled,
|
||||
'',
|
||||
'class="add sub"',
|
||||
true
|
||||
$table->data[10][0] = html_print_label_input_block(
|
||||
__('Events without following tags'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$tags_select_without,
|
||||
'select_without',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[20][0] = html_print_select(
|
||||
$tag_without_temp,
|
||||
'tag_without_temp',
|
||||
[],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 220px; height: 50px;'
|
||||
$table->data[10][1] = html_print_label_input_block(
|
||||
' ',
|
||||
'<div class="w100p">'.html_print_button(
|
||||
__('Add'),
|
||||
'add_whithout',
|
||||
$add_without_tag_disabled,
|
||||
'',
|
||||
['class' => 'submitButton mini'],
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[20][0] .= html_print_input_hidden(
|
||||
|
||||
$table->data[11][0] = html_print_label_input_block(
|
||||
'',
|
||||
'<div class="w100p no-margin-top">'.html_print_select(
|
||||
$tag_without_temp,
|
||||
'tag_without_temp',
|
||||
[],
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width: 100%; height: 50px;'
|
||||
).'</div>'
|
||||
).html_print_input_hidden(
|
||||
'tag_without',
|
||||
$tag_without_base64,
|
||||
true
|
||||
);
|
||||
$table->data[20][1] = html_print_button(
|
||||
__('Remove'),
|
||||
'remove_whithout',
|
||||
$remove_without_tag_disabled,
|
||||
'',
|
||||
'class="delete sub"',
|
||||
true
|
||||
|
||||
$table->data[11][1] = html_print_label_input_block(
|
||||
' ',
|
||||
'<div class="w100p">'.html_print_button(
|
||||
__('Remove'),
|
||||
'remove_whithout',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'mode' => 'link',
|
||||
'class' => 'submitButton',
|
||||
],
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[21][0] = '<b>'.__('Alert events').'</b>';
|
||||
$table->data[21][1] = html_print_select(
|
||||
[
|
||||
'-1' => __('All'),
|
||||
'0' => __('Filter alert events'),
|
||||
'1' => __('Only alert events'),
|
||||
],
|
||||
'filter_only_alert',
|
||||
$filter_only_alert,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
$table->data[12][0] = html_print_label_input_block(
|
||||
__('Alert events'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
[
|
||||
'-1' => __('All'),
|
||||
'0' => __('Filter alert events'),
|
||||
'1' => __('Only alert events'),
|
||||
],
|
||||
'filter_only_alert',
|
||||
$filter_only_alert,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
$table->data[22][0] = '<b>'.__('Module search').'</b>';
|
||||
$table->data[22][1] .= html_print_autocomplete_modules(
|
||||
'module_search',
|
||||
$text_module,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
[],
|
||||
true,
|
||||
$id_agent_module
|
||||
$table->data[12][1] = html_print_label_input_block(
|
||||
__('Module search'),
|
||||
'<div class="w100p">'.html_print_autocomplete_modules(
|
||||
'module_search',
|
||||
$text_module,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
[],
|
||||
true,
|
||||
$id_agent_module
|
||||
).'</div>'
|
||||
);
|
||||
} else {
|
||||
$table->data[12][1] = '';
|
||||
}
|
||||
|
||||
$table->data[23][0] = '<b>'.__('Source').'</b>';
|
||||
$table->data[23][1] = html_print_input_text('source', $source, '', 35, 255, true);
|
||||
|
||||
$table->data[24][0] = '<b>'.__('Extra ID').'</b>';
|
||||
$table->data[24][1] = html_print_input_text('id_extra', $id_extra, '', 11, 255, true);
|
||||
|
||||
$table->data[25][0] = '<b>'.__('Comment').'</b>';
|
||||
$table->data[25][1] = html_print_input_text('user_comment', $user_comment, '', 35, 255, true);
|
||||
|
||||
$table->data[26][0] = '<b>'.__('Custom data filter type').'</b>';
|
||||
$table->data[26][1] = html_print_select(
|
||||
[
|
||||
'0' => __('Filter custom data by name field'),
|
||||
'1' => __('Filter custom data by value field'),
|
||||
],
|
||||
'custom_data_filter_type',
|
||||
$custom_data_filter_type,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
$table->data[27][0] = '<b>'.__('Custom data').'</b>';
|
||||
$table->data[27][1] = html_print_input_text('custom_data', $custom_data, '', 35, 255, true);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table->data[28][0] = '<b>'.__('Id souce event').'</b>';
|
||||
$table->data[28][1] = html_print_input_text(
|
||||
'id_source_event',
|
||||
$id_source_event,
|
||||
$table->data[13][0] = html_print_label_input_block(
|
||||
__('Source'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'source',
|
||||
$source,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[13][1] = html_print_label_input_block(
|
||||
__('Extra ID'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'id_extra',
|
||||
$id_extra,
|
||||
'',
|
||||
11,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[14][0] = html_print_label_input_block(
|
||||
__('Comment'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'user_comment',
|
||||
$user_comment,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[14][1] = html_print_label_input_block(
|
||||
__('Custom data filter type'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
[
|
||||
'0' => __('Filter custom data by name field'),
|
||||
'1' => __('Filter custom data by value field'),
|
||||
],
|
||||
'custom_data_filter_type',
|
||||
$custom_data_filter_type,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[15][0] = html_print_label_input_block(
|
||||
__('Custom data'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'custom_data',
|
||||
$custom_data,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table->data[15][1] = html_print_label_input_block(
|
||||
__('Id souce event'),
|
||||
'<div class="w100p">'.html_print_input_text(
|
||||
'id_source_event',
|
||||
$id_source_event,
|
||||
'',
|
||||
35,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -750,20 +926,20 @@ if (is_metaconsole() === true) {
|
|||
}
|
||||
}
|
||||
|
||||
$table->data[29][0] = '<b>'.__('Server').'</b>';
|
||||
$table->data[29][1] = html_print_select(
|
||||
$servers,
|
||||
'server_id[]',
|
||||
$server_id,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'height: 60px;'
|
||||
$table->data[16][0] = html_print_label_input_block(
|
||||
__('Server'),
|
||||
'<div class="w100p">'.html_print_select(
|
||||
$servers,
|
||||
'server_id[]',
|
||||
$server_id,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
true,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -775,12 +951,14 @@ echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
|||
if ($id) {
|
||||
html_print_input_hidden('update', 1);
|
||||
html_print_input_hidden('id', $id);
|
||||
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
|
||||
$actionButtons = html_print_submit_button(__('Update'), 'crt', false, ['icon' => 'update'], true);
|
||||
} else {
|
||||
html_print_input_hidden('create', 1);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
|
||||
$actionButtons = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand'], true);
|
||||
}
|
||||
|
||||
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ foreach ($filters as $filter) {
|
|||
if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'EW')
|
||||
|| check_acl_restricted_all($config['id_user'], $filter['id_group'], 'EM')
|
||||
) {
|
||||
$table->cellclass[][6] = 'action_buttons';
|
||||
$table->cellclass[][6] = 'table_action_buttons';
|
||||
$data[6] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'href='index.php?sec=geventos&sec2=godmode/events/events§ion=filter&delete=1&id=".$filter['id_filter'].'&offset=0&pure='.$config['pure']."'>".html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
|
@ -198,37 +198,61 @@ foreach ($filters as $filter) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=geventos&sec2=godmode/events/events&pure=".$config['pure']."'>";
|
||||
echo "<form id='form-delete-filters' method='post' action='index.php?sec=geventos&sec2=godmode/events/events&pure=".$config['pure']."'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
if (!is_metaconsole()) {
|
||||
echo "<div class='pdd_b_20px right'>";
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
echo "<div class='right'>";
|
||||
}
|
||||
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
if (is_metaconsole() === true) {
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined filters') ]);
|
||||
}
|
||||
|
||||
if (!defined('METACONSOLE')) {
|
||||
echo "<div class='pdd_b_20px right w100p'>";
|
||||
} else {
|
||||
echo "<div class='right'>";
|
||||
}
|
||||
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=edit_filter&pure='.$config['pure'].'">';
|
||||
html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"');
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
$submitButtons = '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=edit_filter&pure='.$config['pure'].'">';
|
||||
$submitButtons .= html_print_submit_button(
|
||||
__('Create filter'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'icon' => 'wand',
|
||||
'class' => 'mrgn_lft_15px',
|
||||
],
|
||||
true
|
||||
);
|
||||
$submitButtons .= '</form>';
|
||||
|
||||
$submitButtons .= html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'class' => 'secondary',
|
||||
'id' => 'delete-event-filters',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
$submitButtons,
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'id' => 'list-events-filters',
|
||||
]
|
||||
);
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
|
@ -243,13 +267,17 @@ echo '</div>';
|
|||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
$("[id^=checkbox-delete_multiple]").prop("checked", true);
|
||||
}
|
||||
else{
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
$("[id^=checkbox-delete_multiple]").prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
$('#button-delete_btn').click(function (e) {
|
||||
$('#form-delete-filters').submit();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Event responses editor view.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -66,35 +82,32 @@ if ($event_response_id > 0) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'margin: 10px 10px 10px';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table->head[0] = __('Edit event responses');
|
||||
$table->head_colspan[0] = 5;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->size = [];
|
||||
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->style[2] = 'font-weight: bold;';
|
||||
$table->cellspacing = 0;
|
||||
$table->cellpadding = 0;
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Name');
|
||||
$data[1] = html_print_input_text(
|
||||
'name',
|
||||
$event_response['name'],
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
true
|
||||
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
'<div class="w100p margin-top-10">'.html_print_input_text(
|
||||
'name',
|
||||
$event_response['name'],
|
||||
'',
|
||||
false,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
'w100p'
|
||||
).html_print_input_hidden('id_response', $event_response['id'], true).'</div>'
|
||||
);
|
||||
$data[1] .= html_print_input_hidden('id_response', $event_response['id'], true);
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
|
@ -102,32 +115,64 @@ if (users_can_manage_group_all('PM') === true) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$data[2] = __('Group');
|
||||
$data[3] = html_print_select_groups(false, 'PM', $return_all_group, 'id_group', $event_response['id_group'], '', '', '', true);
|
||||
|
||||
$data[1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
'<div class="w100p margin-top-10">'.html_print_select_groups(
|
||||
false,
|
||||
'PM',
|
||||
$return_all_group,
|
||||
'id_group',
|
||||
$event_response['id_group'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[0] = $data;
|
||||
|
||||
$data = [];
|
||||
$table->colspan[1][1] = 3;
|
||||
$data[0] = __('Description');
|
||||
$data[1] = html_print_textarea(
|
||||
'description',
|
||||
5,
|
||||
40,
|
||||
$event_response['description'],
|
||||
'class="'.$class_description.'"',
|
||||
true
|
||||
$table->colspan[1][0] = 2;
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
'<div class="w100p margin-top-10">'.html_print_textarea(
|
||||
'description',
|
||||
5,
|
||||
1,
|
||||
$event_response['description'],
|
||||
'class="'.$class_description.' w100p"',
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[1] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Location').ui_print_help_tip(__('For Command type Modal Window mode is enforced'), true);
|
||||
$locations = [
|
||||
__('Modal window'),
|
||||
__('New window'),
|
||||
];
|
||||
$data[1] = html_print_select($locations, 'new_window', $event_response['new_window'], '', '', '', true);
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Location').ui_print_help_tip(__('For Command type Modal Window mode is enforced'), true),
|
||||
'<div class="w100p margin-top-10">'.html_print_select(
|
||||
$locations,
|
||||
'new_window',
|
||||
$event_response['new_window'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$data[2] = '<span class="size">'.__('Size').'</span>';
|
||||
$data[1] = '<span class="size">'.__('Size').'</span>';
|
||||
if ($event_response['modal_width'] == 0) {
|
||||
$event_response['modal_width'] = 620;
|
||||
}
|
||||
|
@ -136,40 +181,88 @@ if ($event_response['modal_height'] == 0) {
|
|||
$event_response['modal_height'] = 500;
|
||||
}
|
||||
|
||||
$data[3] = '<span class="size">'.__('Width').' (px) </span>';
|
||||
$data[3] .= '<span class="size">'.html_print_input_text('modal_width', $event_response['modal_width'], '', 4, 5, true).'</span>';
|
||||
$data[3] .= '<span class="size">'.__('Height').' (px) </span>';
|
||||
$data[3] .= '<span class="size">'.html_print_input_text('modal_height', $event_response['modal_height'], '', 4, 5, true).'</span>';
|
||||
$data[1] = '<div class="flex flex-space-around">';
|
||||
$data[1] .= html_print_label_input_block(
|
||||
__('Width').' (px) ',
|
||||
'<div class="w100p margin-top-10">'.html_print_input_text(
|
||||
'modal_width',
|
||||
$event_response['modal_width'],
|
||||
'',
|
||||
4,
|
||||
5,
|
||||
true
|
||||
).'</div>',
|
||||
['div_class' => 'mgn_tp_0_imp']
|
||||
);
|
||||
$data[1] .= html_print_label_input_block(
|
||||
__('Height').' (px) ',
|
||||
'<div class="w100p margin-top-10">'.html_print_input_text(
|
||||
'modal_height',
|
||||
$event_response['modal_height'],
|
||||
'',
|
||||
4,
|
||||
5,
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$data[1] .= '</div>';
|
||||
$table->data[2] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Parameters');
|
||||
$data[1] = html_print_input_text(
|
||||
'params',
|
||||
$event_response['params'],
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Parameters'),
|
||||
'<div class="w100p margin-top-10">'.html_print_input_text(
|
||||
'params',
|
||||
$event_response['params'],
|
||||
'',
|
||||
50,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'w100p'
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$types = [
|
||||
'url' => __('URL'),
|
||||
'command' => __('Command'),
|
||||
];
|
||||
$data[2] = __('Type');
|
||||
$data[3] = html_print_select($types, 'type', $event_response['type'], '', '', '', true);
|
||||
|
||||
$data[1] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
'<div class="w100p margin-top-10">'.html_print_select(
|
||||
$types,
|
||||
'type',
|
||||
$event_response['type'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'w100p',
|
||||
false,
|
||||
'width: 100%'
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[3] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<span id="command_label" class="labels">'.__('Command').'</span><span id="url_label" class="labels invisible">'.__('URL').'</span>'.ui_print_help_icon('response_macros', true);
|
||||
$data[1] = html_print_textarea(
|
||||
'target',
|
||||
3,
|
||||
1,
|
||||
$event_response['target'],
|
||||
'class="mh_initial"',
|
||||
true
|
||||
$table->colspan[4][0] = 2;
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Command').'<span id="url_label" class="labels invisible">'.__('URL').'</span>'.ui_print_help_icon('response_macros', true),
|
||||
'<div class="w100p margin-top-10">'.html_print_textarea(
|
||||
'target',
|
||||
3,
|
||||
1,
|
||||
$event_response['target'],
|
||||
'class="mh_initial w100p"',
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
$table->data[4] = $data;
|
||||
|
||||
$servers_to_exec = [];
|
||||
$servers_to_exec[0] = __('Local console');
|
||||
|
@ -189,45 +282,70 @@ if (enterprise_installed()) {
|
|||
}
|
||||
}
|
||||
|
||||
$data[2] = '<div id="server_to_exec_label" class="labels invisible">'.__('Server to execute command').'</div>';
|
||||
$data[3] = '<div id="server_to_exec_value" class="invisible" >'.html_print_select($servers_to_exec, 'server_to_exec', $event_response['server_to_exec'], '', '', '', true).'</div>';
|
||||
|
||||
$table->data[4] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = '<div id="command_timeout_label" class="labels invisible">'.__('Command timeout (s)');
|
||||
$data[1] = '<div id="command_timeout_value" class="invisible">'.html_print_input_text('command_timeout', $event_response['command_timeout'], '', 4, 5, true);
|
||||
$data[0] = html_print_label_input_block(
|
||||
'<div id="server_to_exec_label" class="labels invisible">'.__('Server to execute command').'</div>',
|
||||
'<div id="server_to_exec_value" class="invisible" >'.html_print_select(
|
||||
$servers_to_exec,
|
||||
'server_to_exec',
|
||||
$event_response['server_to_exec'],
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$data[1] = html_print_label_input_block(
|
||||
'<div id="command_timeout_label" class="labels invisible">'.__('Command timeout (s)'),
|
||||
'<div id="command_timeout_value" class="invisible">'.html_print_input_text(
|
||||
'command_timeout',
|
||||
$event_response['command_timeout'],
|
||||
'',
|
||||
4,
|
||||
5,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[5] = $data;
|
||||
|
||||
$data = [];
|
||||
$data[0] = __('Display command').ui_print_help_tip(__('If enabled the command will be displayed to any user that can execute this event response'), true);
|
||||
$data[1] = html_print_checkbox_switch(
|
||||
'display_command',
|
||||
1,
|
||||
$event_response['display_command'],
|
||||
true
|
||||
$data[0] = html_print_label_input_block(
|
||||
__('Display command').ui_print_help_tip(__('If enabled the command will be displayed to any user that can execute this event response'), true),
|
||||
'<div class="w100p margin-top-10">'.html_print_checkbox_switch(
|
||||
'display_command',
|
||||
1,
|
||||
$event_response['display_command'],
|
||||
true
|
||||
).'</div>'
|
||||
);
|
||||
|
||||
$table->data[6] = $data;
|
||||
|
||||
if ($event_response_id == 0) {
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=create_response&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
echo '<div class="w100p right_align">';
|
||||
|
||||
html_print_submit_button(__('Create'), 'create_response_button', false, ['class' => 'sub next']);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
if ((int) $event_response_id === 0) {
|
||||
$actionUrl = 'index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=create_response&pure='.$config['pure'];
|
||||
$buttonCaption = __('Create');
|
||||
$buttonName = 'create_response_button';
|
||||
} else {
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=update_response&pure='.$config['pure'].'">';
|
||||
html_print_table($table);
|
||||
echo '<div class="w100p right_align">';
|
||||
|
||||
html_print_submit_button(__('Update'), 'update_response_button', false, ['class' => 'sub next']);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$actionUrl = 'index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=list&action=update_response&pure='.$config['pure'];
|
||||
$buttonCaption = __('Update');
|
||||
$buttonName = 'update_response_button';
|
||||
}
|
||||
|
||||
echo '<form method="POST" action="'.$actionUrl.'">';
|
||||
html_print_table($table);
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
$buttonCaption,
|
||||
$buttonName,
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
),
|
||||
[ 'type' => 'form_action']
|
||||
);
|
||||
echo '</form>';
|
||||
?>
|
||||
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Event responses list view.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_event_responses.php';
|
||||
|
@ -35,8 +51,8 @@ if (empty($event_responses)) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->styleTable = 'margin: 10px 10px 0';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
|
||||
|
@ -63,36 +79,51 @@ foreach ($event_responses as $response) {
|
|||
$data[0] = '<a href="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=editor&id_response='.$response['id'].'&pure='.$config['pure'].'">'.$response['name'].'</a>';
|
||||
$data[1] = $response['description'];
|
||||
$data[2] = ui_print_group_icon($response['id_group'], true);
|
||||
$table->cellclass[][3] = 'action_buttons';
|
||||
$data[3] = '<a href="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&action=delete_response&id_response='.$response['id'].'&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
$table->cellclass[][3] = 'table_action_buttons';
|
||||
$data[3] = html_print_anchor(
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
$data[3] .= '<a href="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=editor&id_response='.$response['id'].'&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/pencil.png',
|
||||
true,
|
||||
'href' => 'index.php?sec=geventos&sec2=godmode/events/events§ion=responses&action=delete_response&id_response='.$response['id'].'&pure='.$config['pure'],
|
||||
'content' => html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$data[3] .= html_print_anchor(
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
'href' => 'index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=editor&id_response='.$response['id'].'&pure='.$config['pure'],
|
||||
'content' => html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$table->data[] = $data;
|
||||
}
|
||||
|
||||
html_print_table($table);
|
||||
|
||||
|
||||
echo '<div class="w100p right_align">';
|
||||
echo '<form method="post" action="index.php?sec=geventos&sec2=godmode/events/events§ion=responses&mode=editor&pure='.$config['pure'].'">';
|
||||
html_print_submit_button(
|
||||
__('Create response'),
|
||||
'create_response_button',
|
||||
false,
|
||||
['class' => 'sub next']
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create response'),
|
||||
'create_response_button',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
|
|
|
@ -1,16 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Event responses view handler.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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; 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.
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
require_once $config['homedir'].'/include/functions_event_responses.php';
|
||||
|
|
|
@ -1,22 +1,37 @@
|
|||
<?php
|
||||
/**
|
||||
* Event configuration.
|
||||
*
|
||||
* @category Events
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
|
||||
if (!check_acl($config['id_user'], 0, 'EW') && !check_acl($config['id_user'], 0, 'EM') && ! check_acl($config['id_user'], 0, 'PM')) {
|
||||
db_pandora_audit(
|
||||
|
@ -35,11 +50,11 @@ if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, '
|
|||
$buttons['view'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=eventos&sec2=operation/events/events&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/events_list.png',
|
||||
'images/event.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Event list'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
'operation' => true,
|
||||
|
@ -48,11 +63,11 @@ if (check_acl($config['id_user'], 0, 'EW') || check_acl($config['id_user'], 0, '
|
|||
$buttons['filter'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&section=filter&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/filter_mc.png',
|
||||
'images/filters@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Filter list'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -62,11 +77,11 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
$buttons['responses'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&section=responses&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/event_responses.png',
|
||||
'images/responses.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Event responses'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -74,11 +89,11 @@ if (check_acl($config['id_user'], 0, 'PM')) {
|
|||
$buttons['fields'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=eventos&sec2=godmode/events/events&section=fields&pure='.$config['pure'].'">'.html_print_image(
|
||||
'images/custom_columns.png',
|
||||
'images/edit_columns@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Custom columns'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -110,28 +125,25 @@ switch ($section) {
|
|||
break;
|
||||
}
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
ui_print_standard_header(
|
||||
$subpage,
|
||||
'images/gm_events.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
(array) $buttons,
|
||||
ui_print_standard_header(
|
||||
$subpage,
|
||||
'images/gm_events.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
(array) $buttons,
|
||||
[
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configuration'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Events'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_meta_print_header(__('Manage events').$subpage, '', $buttons);
|
||||
}
|
||||
'link' => '',
|
||||
'label' => __('Configuration'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Events'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
require_once $config['homedir'].'/include/functions_events.php';
|
||||
|
||||
|
@ -153,5 +165,3 @@ switch ($section) {
|
|||
include_once $config['homedir'].'/godmode/events/event_responses.php';
|
||||
break;
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
|
|
@ -252,7 +252,7 @@ foreach ($extensions as $file => $extension) {
|
|||
|
||||
// Avoid to delete or disabled update_manager
|
||||
if ($file != 'update_manager.php') {
|
||||
$table->cellclass[][10] = 'action_buttons';
|
||||
$table->cellclass[][10] = 'table_action_buttons';
|
||||
if (!$extension['enabled']) {
|
||||
$data[] = '<a title="'.__('Delete').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&delete='.$file.'" class="mn">'.html_print_image('images/cross.disabled.png', true, ['class' => 'filter_none']).'</a>'.' <a title="'.__('Enable').'" href="index.php?sec=godmode/extensions&sec2=godmode/extensions&enterprise='.(int) $extension['enterprise'].'&enabled='.$file.'" class="mn">'.html_print_image('images/lightbulb_off.png', true, ['class' => 'filter_none']).'</a>';
|
||||
} else {
|
||||
|
|
|
@ -31,8 +31,6 @@ global $config;
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -47,66 +45,54 @@ require_once $config['homedir'].'/include/functions_users.php';
|
|||
enterprise_include_once('meta/include/functions_agents_meta.php');
|
||||
|
||||
// Default values.
|
||||
$icon = '';
|
||||
$name = '';
|
||||
$id_parent = 0;
|
||||
$group_pass = '';
|
||||
$alerts_disabled = 0;
|
||||
$custom_id = '';
|
||||
$propagate = 0;
|
||||
$skin = 0;
|
||||
$contact = '';
|
||||
$other = '';
|
||||
$description = '';
|
||||
$max_agents = 0;
|
||||
|
||||
$create_group = (bool) get_parameter('create_group');
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
if ($id_group) {
|
||||
$acl_parent = true;
|
||||
if ($id_group > 0) {
|
||||
$group = db_get_row('tgrupo', 'id_grupo', $id_group);
|
||||
if ($group) {
|
||||
if ($group !== false) {
|
||||
$icon = $group['icon'];
|
||||
$name = $group['nombre'];
|
||||
if (empty($group['icon'])) {
|
||||
$icon = false;
|
||||
} else {
|
||||
$icon = $group['icon'].'.png';
|
||||
}
|
||||
|
||||
$id_parent = $group['parent'];
|
||||
$group_pass = io_safe_output($group['password']);
|
||||
$alerts_disabled = $group['disabled'];
|
||||
$id_parent = $group['parent'];
|
||||
$custom_id = $group['custom_id'];
|
||||
$propagate = $group['propagate'];
|
||||
$skin = $group['id_skin'];
|
||||
$description = $group['description'];
|
||||
$contact = $group['contact'];
|
||||
$other = $group['other'];
|
||||
$description = $group['description'];
|
||||
$max_agents = $group['max_agents'];
|
||||
} else {
|
||||
ui_print_error_message(__('There was a problem loading group'));
|
||||
echo '</table>';
|
||||
echo '</div>';
|
||||
echo '<div id="both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
include 'general/footer.php';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_SYSTEM,
|
||||
'There was a problem loading group in configure agent group.'
|
||||
);
|
||||
include 'general/noaccess.php';
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
// Set default values.
|
||||
$icon = '';
|
||||
$name = '';
|
||||
$id_parent = 0;
|
||||
$group_pass = '';
|
||||
$alerts_disabled = 0;
|
||||
$custom_id = '';
|
||||
$propagate = 0;
|
||||
$skin = 0;
|
||||
$contact = '';
|
||||
$other = '';
|
||||
$description = '';
|
||||
$max_agents = 0;
|
||||
}
|
||||
|
||||
// Header
|
||||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
agents_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
if ($id_group) {
|
||||
$title_in_header = __('Update group');
|
||||
} else {
|
||||
$title_in_header = __('Create group');
|
||||
}
|
||||
$title_in_header = ($id_group > 0) ? __('Update group') : __('Create group');
|
||||
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
|
@ -130,55 +116,51 @@ if (is_metaconsole() === true) {
|
|||
$sec = 'gagente';
|
||||
}
|
||||
|
||||
|
||||
// Data before table.
|
||||
$files = list_files('images/', '@groups.svg', 1, 0);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
if (defined('METACONSOLE')) {
|
||||
if ($id_group) {
|
||||
$table->head[0] = __('Update Group');
|
||||
} else {
|
||||
$table->head[0] = __('Create Group');
|
||||
}
|
||||
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
|
||||
|
||||
$table->data[1][0] = __('Icon');
|
||||
$files = list_files('images/groups_small/', 'png', 1, 0);
|
||||
foreach ($files as $key => $f) {
|
||||
// Remove from the list the non-desired .png files
|
||||
if (strpos($f, '.bad.png') !== false || strpos($f, '.default.png') !== false || strpos($f, '.ok.png') !== false || strpos($f, '.warning.png') !== false) {
|
||||
unset($files[$key]);
|
||||
}
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text('name', $name, '', 35, 100, true)
|
||||
);
|
||||
|
||||
$input_icon = html_print_select($files, 'icon', $icon, '', 'None', '', true, false, true, '', false, 'width: 100%;');
|
||||
$input_icon .= ' <span id="icon_preview" class="mrgn_lft_05em">';
|
||||
if (empty($icon) === false) {
|
||||
$input_icon .= html_print_image('images/'.$icon, true);
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_select($files, 'icon', $icon, '', 'None', '', true);
|
||||
$table->data[1][1] .= ' <span id="icon_preview">';
|
||||
if ($icon) {
|
||||
$table->data[1][1] .= html_print_image('images/groups_small/'.$icon, true);
|
||||
}
|
||||
$input_icon .= '</span>';
|
||||
|
||||
$table->data[1][1] .= '</span>';
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Icon'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex-content-left ',
|
||||
'content' => $input_icon,
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[2][0] = __('Parent');
|
||||
|
||||
$acl_parent = true;
|
||||
if ($id_group) {
|
||||
if ($id_group > 0) {
|
||||
// The user can access to the parent, but she want to edit the group.
|
||||
if (!check_acl($config['id_user'], $id_parent, 'AR')) {
|
||||
if ((bool) check_acl($config['id_user'], $id_parent, 'AR') === false) {
|
||||
$acl_parent = false;
|
||||
|
||||
$table->data[2][1] = __('You have not access to the parent.').html_print_input_hidden('id_parent', $id_parent, true);
|
||||
$input_parent = __('You have not access to the parent.').html_print_input_hidden('id_parent', $id_parent, true);
|
||||
} else {
|
||||
$table->data[2][1] = '<div class="w250px inline">';
|
||||
$table->data[2][1] .= html_print_select_groups(
|
||||
$input_parent = '<div class="w250px inline">';
|
||||
$input_parent .= html_print_select_groups(
|
||||
false,
|
||||
'AR',
|
||||
false,
|
||||
|
@ -196,11 +178,11 @@ if ($id_group) {
|
|||
false,
|
||||
$id_group
|
||||
);
|
||||
$table->data[2][1] .= '</div>';
|
||||
$input_parent .= '</div>';
|
||||
}
|
||||
} else {
|
||||
$table->data[2][1] = '<div class="w250px inline">';
|
||||
$table->data[2][1] .= html_print_input(
|
||||
$input_parent = '<div class="w250px inline">';
|
||||
$input_parent .= html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'name' => 'id_parent',
|
||||
|
@ -211,78 +193,111 @@ if ($id_group) {
|
|||
'nothing_value' => -1,
|
||||
]
|
||||
);
|
||||
$table->data[2][1] .= '</div>';
|
||||
$input_parent .= '</div>';
|
||||
}
|
||||
|
||||
if ($acl_parent) {
|
||||
$table->data[2][1] .= ' <span id="parent_preview">';
|
||||
$table->data[2][1] .= html_print_image('images/groups_small/'.( $id_parent != 0 ? groups_get_icon($id_parent) : 'without_group').'.png', true);
|
||||
$table->data[2][1] .= '</span>';
|
||||
if ($acl_parent === true) {
|
||||
$input_parent .= ' <span id="parent_preview" class="mrgn_lft_05em">';
|
||||
$input_parent .= html_print_image('images/'.(($id_parent !== 0) ? groups_get_icon($id_parent) : 'unknown@groups.svg'), true);
|
||||
$input_parent .= '</span>';
|
||||
}
|
||||
|
||||
$i = 3;
|
||||
if ($config['enterprise_installed']) {
|
||||
$i = 4;
|
||||
$table->data[3][0] = __('Group Password');
|
||||
$table->data[3][1] = html_print_input_password('group_pass', $group_pass, '', 16, 255, true);
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Parent'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex-content-left ',
|
||||
'content' => $input_parent,
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
if ((bool) $config['enterprise_installed'] === true) {
|
||||
$table->data[1][1] .= html_print_label_input_block(
|
||||
__('Group Password'),
|
||||
html_print_input_password('group_pass', $group_pass, '', 16, 255, true)
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[$i][0] = __('Alerts').ui_print_help_tip(__('Enable alert use in this group.'), true);
|
||||
$table->data[$i][1] = html_print_checkbox_switch('alerts_enabled', 1, ! $alerts_disabled, true);
|
||||
$i++;
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Alerts').ui_print_help_tip(__('Enable alert use in this group.'), true),
|
||||
html_print_checkbox_switch('alerts_enabled', 1, ! $alerts_disabled, true)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Propagate ACL').ui_print_help_tip(__('Propagate the same ACL security into the child subgroups.'), true);
|
||||
$table->data[$i][1] = html_print_checkbox_switch('propagate', 1, $propagate, true);
|
||||
$i++;
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Propagate ACL').ui_print_help_tip(__('Propagate the same ACL security into the child subgroups.'), true),
|
||||
html_print_checkbox_switch('propagate', 1, $propagate, true)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Custom ID');
|
||||
$table->data[$i][1] = html_print_input_text('custom_id', $custom_id, '', 16, 255, true);
|
||||
$i++;
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Custom ID'),
|
||||
html_print_input_text('custom_id', $custom_id, '', 16, 255, true)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Description');
|
||||
$table->data[$i][1] = html_print_input_text('description', $description, '', 60, 255, true);
|
||||
$i++;
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_input_text('description', $description, '', 60, 255, true)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Contact').ui_print_help_tip(__('Contact information accessible through the _groupcontact_ macro'), true);
|
||||
$table->data[$i][1] = html_print_textarea('contact', 4, 40, $contact, "class='min-height-0px'", true);
|
||||
$i++;
|
||||
$table->data[4][0] = html_print_label_input_block(
|
||||
__('Contact').ui_print_help_tip(__('Contact information accessible through the _groupcontact_ macro'), true),
|
||||
html_print_textarea('contact', 4, 40, $contact, "class='min-height-0px'", true)
|
||||
);
|
||||
|
||||
$table->data[$i][0] = __('Other').ui_print_help_tip(__('Information accessible through the _group_other_ macro'), true);
|
||||
$table->data[$i][1] = html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true);
|
||||
$i++;
|
||||
$table->data[4][1] = html_print_label_input_block(
|
||||
__('Other').ui_print_help_tip(__('Information accessible through the _group_other_ macro'), true),
|
||||
html_print_textarea('other', 4, 40, $other, "class='min-height-0px'", true)
|
||||
);
|
||||
|
||||
// $isFunctionSkins = enterprise_include_once('include/functions_skins.php');
|
||||
// if ($isFunctionSkins !== ENTERPRISE_NOT_HOOK && !defined('METACONSOLE')) {
|
||||
// $table->data[10][0] = __('Skin');
|
||||
// $table->data[10][1] = skins_print_select($config['id_user'], 'skin', $skin, '', __('None'), 0, true);
|
||||
// }
|
||||
$table->data[$i][0] = __('Max agents allowed').' '.ui_print_help_tip(__('Set the maximum of agents allowed for this group. 0 is unlimited.'), true);
|
||||
$table->data[$i][1] = html_print_input_text('max_agents', $max_agents, '', 10, 255, true);
|
||||
$i++;
|
||||
$table->data[5][0] = html_print_label_input_block(
|
||||
__('Max agents allowed').ui_print_help_tip(__('Set the maximum of agents allowed for this group. 0 is unlimited.'), true),
|
||||
html_print_input_text('max_agents', $max_agents, '', 10, 255, true)
|
||||
);
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
$sec = 'gagente';
|
||||
}
|
||||
$sec = (is_metaconsole() === true) ? 'advanced' : 'gagente';
|
||||
|
||||
echo '<form name="grupo" method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/group_list&pure='.$config['pure'].'" >';
|
||||
echo '<form name="grupo" class="max_floating_element_size" method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/group_list&pure='.$config['pure'].'" >';
|
||||
html_print_table($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_button(__('Back'), 'button_back', false, '', 'class="sub cancel"');
|
||||
|
||||
$buttons = '';
|
||||
if ($id_group) {
|
||||
html_print_input_hidden('update_group', 1);
|
||||
html_print_input_hidden('id_group', $id_group);
|
||||
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
$buttons .= html_print_input_hidden('update_group', 1, true);
|
||||
$buttons .= html_print_input_hidden('id_group', $id_group, true);
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Update'),
|
||||
'updbutton',
|
||||
false,
|
||||
['icon' => 'upd'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_input_hidden('create_group', 1);
|
||||
html_print_submit_button(__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
$buttons .= html_print_input_hidden('create_group', 1);
|
||||
$buttons .= html_print_submit_button(
|
||||
__('Create'),
|
||||
'crtbutton',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$buttons .= html_print_button(
|
||||
__('Go back'),
|
||||
'button_back',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'back',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
html_print_action_buttons(
|
||||
$buttons
|
||||
);
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script language="javascript" type="text/javascript">
|
||||
|
@ -294,7 +309,7 @@ function icon_changed () {
|
|||
if (data != "") {
|
||||
var params = [];
|
||||
params.push("get_image_path=1");
|
||||
params.push("img_src=images/groups_small/" + data);
|
||||
params.push("img_src=images/" + data);
|
||||
params.push("page=include/ajax/skins.ajax");
|
||||
params.push("only_src=1");
|
||||
jQuery.ajax ({
|
||||
|
@ -330,7 +345,7 @@ function parent_changed () {
|
|||
}
|
||||
var params = [];
|
||||
params.push("get_image_path=1");
|
||||
params.push("img_src=images/groups_small/" + data['icon'] + ".png");
|
||||
params.push("img_src=images/" + data['icon']);
|
||||
params.push("page=include/ajax/skins.ajax");
|
||||
params.push("only_src=1");
|
||||
jQuery.ajax ({
|
||||
|
|
|
@ -15,8 +15,6 @@ global $config;
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -26,9 +24,26 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
// Header
|
||||
ui_print_page_header(__('Module group management'), 'images/module_group.png', false, '', true, '');
|
||||
ui_print_standard_header(
|
||||
__('Module group management'),
|
||||
'images/module_group.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Module groups'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
// Init vars
|
||||
|
@ -53,7 +68,7 @@ if ($id_group) {
|
|||
echo '<div id="both"> </div>';
|
||||
echo '</div>';
|
||||
echo '<div id="foot">';
|
||||
include 'general/footer.php';
|
||||
// include 'general/footer.php';
|
||||
echo '</div>';
|
||||
echo '</div>';
|
||||
exit;
|
||||
|
@ -61,33 +76,52 @@ if ($id_group) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox';
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->data = [];
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 35, 100, true);
|
||||
$table->data[1][0] = html_print_input_text('name', $name, '', 35, 100, true);
|
||||
|
||||
|
||||
echo '</span>';
|
||||
if (is_metaconsole()) {
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&offset='.$offset.'">';
|
||||
if (is_metaconsole() === true) {
|
||||
$formUrl = 'index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&offset='.$offset;
|
||||
} else {
|
||||
echo '<form name="grupo" method="post" action="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&offset='.$offset.'">';
|
||||
$formUrl = 'index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&offset='.$offset;
|
||||
}
|
||||
|
||||
echo '<form name="grupo" method="POST" action="'.$formUrl.'">';
|
||||
html_print_table($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
if ($id_group) {
|
||||
html_print_input_hidden('update_group', 1);
|
||||
html_print_input_hidden('id_group', $id_group);
|
||||
html_print_submit_button(__('Update'), 'updbutton', false, 'class="sub upd"');
|
||||
$actionButtonTitle = __('Update');
|
||||
$actionButtonName = 'updbutton';
|
||||
} else {
|
||||
$actionButtonTitle = __('Create');
|
||||
$actionButtonName = 'crtbutton';
|
||||
html_print_input_hidden('create_group', 1);
|
||||
html_print_submit_button(__('Create'), 'crtbutton', false, 'class="sub wand"');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$actionButtons = [];
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
$actionButtonTitle,
|
||||
$actionButtonName,
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
|
||||
$actionButtons[] = html_print_go_back_button(
|
||||
ui_get_full_url('index.php?sec=gmodules&sec2=godmode/groups/modu_group_list'),
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
echo '</form>';
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -274,8 +274,6 @@ if (is_ajax() === true) {
|
|||
return;
|
||||
}
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
$tab = (string) get_parameter('tab', 'groups');
|
||||
|
||||
if ($tab !== 'credbox'
|
||||
|
@ -308,11 +306,11 @@ $url_groups = 'index.php?sec='.$sec.'&sec2=godmode/groups/group_list&tab=groups'
|
|||
$buttons['tree'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_tree.'">'.html_print_image(
|
||||
'images/gm_massive_operations.png',
|
||||
'images/snmp-trap@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Tree Group view'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -320,11 +318,11 @@ $buttons['tree'] = [
|
|||
$buttons['groups'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_groups.'">'.html_print_image(
|
||||
'images/group.png',
|
||||
'images/groups@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Group view'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -336,7 +334,7 @@ $buttons['credbox'] = [
|
|||
true,
|
||||
[
|
||||
'title' => __('Credential Store'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -364,12 +362,6 @@ switch ($tab) {
|
|||
// Header.
|
||||
if (is_metaconsole() === true) {
|
||||
agents_meta_print_header();
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'notify',
|
||||
'content' => __('Edit or delete groups can cause problems with synchronization'),
|
||||
]
|
||||
);
|
||||
} else {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
|
@ -766,6 +758,8 @@ if ($tab == 'tree') {
|
|||
$search = (string) get_parameter('search', '');
|
||||
$block_size = $config['block_size'];
|
||||
|
||||
$tablePagination = '';
|
||||
|
||||
if (empty($search) === false) {
|
||||
$search_name = 'AND t.nombre LIKE "%'.$search.'%"';
|
||||
}
|
||||
|
@ -786,23 +780,58 @@ if ($tab == 'tree') {
|
|||
}
|
||||
|
||||
$form = "<form method='post' action=''>";
|
||||
$form .= "<table class='databox filters bolder' width='100%'>";
|
||||
$form .= '<tr><td>'.__('Search').' ';
|
||||
$form .= html_print_input_text(
|
||||
$form .= "<table class='filter-table-adv' width='100%'>";
|
||||
$form .= '<tr><td>'.html_print_label_input_block(
|
||||
__('Search'),
|
||||
html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
30,
|
||||
30,
|
||||
true
|
||||
);
|
||||
$form .= '</td><td style="text-align: right">';
|
||||
$form .= "<input name='find' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
)
|
||||
);
|
||||
$form .= '</td>';
|
||||
$form .= '</tr>';
|
||||
$form .= '</table>';
|
||||
$buttons = html_print_submit_button(
|
||||
__('Filter'),
|
||||
'find',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$form .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => $buttons,
|
||||
],
|
||||
true
|
||||
);
|
||||
$form .= '</form>';
|
||||
|
||||
echo $form;
|
||||
ui_toggle(
|
||||
$form,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
ui_print_info_message(
|
||||
__('Edit or delete groups can cause problems with synchronization')
|
||||
);
|
||||
}
|
||||
|
||||
$groups_sql = sprintf(
|
||||
'SELECT t.*,
|
||||
|
@ -892,7 +921,7 @@ if ($tab == 'tree') {
|
|||
|
||||
if ($group['icon'] != '') {
|
||||
$table->data[$key][2] = html_print_image(
|
||||
'images/groups_small/'.$group['icon'].'.png',
|
||||
'images/'.$group['icon'],
|
||||
true,
|
||||
[
|
||||
'style' => '',
|
||||
|
@ -915,14 +944,14 @@ if ($tab == 'tree') {
|
|||
$table->data[$key][4] = $group['parent_name'];
|
||||
$table->data[$key][5] = $group['description'];
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[$key][6] = 'action_buttons';
|
||||
$table->cellclass[$key][6] = 'table_action_buttons';
|
||||
$table->data[$key][6] = '<a href="'.$url_edit.'">'.html_print_image(
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Edit'),
|
||||
'title' => __('Edit'),
|
||||
'border' => '0',
|
||||
'alt' => __('Edit'),
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
|
@ -937,35 +966,26 @@ if ($tab == 'tree') {
|
|||
}
|
||||
|
||||
$table->data[$key][6] .= '<a href="'.$url_delete.'" onClick="if (!confirm(\' '.$confirm_message.'\')) return false;">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'border' => '0',
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
}
|
||||
}
|
||||
|
||||
echo ui_pagination(
|
||||
$groups_count,
|
||||
false,
|
||||
$offset,
|
||||
$block_size,
|
||||
true,
|
||||
'offset',
|
||||
true
|
||||
);
|
||||
html_print_table($table);
|
||||
echo ui_pagination(
|
||||
$tablePagination = ui_pagination(
|
||||
$groups_count,
|
||||
false,
|
||||
$offset,
|
||||
$block_size,
|
||||
true,
|
||||
'offset',
|
||||
true,
|
||||
false,
|
||||
'pagination-bottom'
|
||||
);
|
||||
} else {
|
||||
|
@ -978,20 +998,34 @@ if ($tab == 'tree') {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$button_form = '';
|
||||
if ($is_management_allowed === true
|
||||
&& (bool) check_acl($config['id_user'], 0, 'PM') === true
|
||||
) {
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group">';
|
||||
echo '<div class="action-buttons w100p">';
|
||||
html_print_submit_button(__('Create group'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$button_form = '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/groups/configure_group">';
|
||||
$button_form .= html_print_submit_button(
|
||||
__('Create group'),
|
||||
'crt',
|
||||
false,
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
$button_form .= '</form>';
|
||||
}
|
||||
|
||||
|
||||
html_print_action_buttons(
|
||||
$button_form,
|
||||
[
|
||||
'type' => 'data_table',
|
||||
'class' => 'fixed_action_buttons',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
ui_require_javascript_file('TreeController', 'include/javascript/tree/');
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
$tab = 'group_edition';
|
||||
|
||||
?>
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -43,7 +43,7 @@ if (is_ajax() === true) {
|
|||
$get_group_json = (bool) get_parameter('get_group_json');
|
||||
$get_group_agents = (bool) get_parameter('get_group_agents');
|
||||
|
||||
if ($get_group_json) {
|
||||
if ($get_group_json === true) {
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
|
||||
if (! check_acl($config['id_user'], $id_group, 'AR')) {
|
||||
|
@ -66,13 +66,23 @@ if (is_ajax() === true) {
|
|||
|
||||
if (is_metaconsole() === false) {
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
__('Module groups defined in %s', get_product_name()),
|
||||
ui_print_standard_header(
|
||||
__('Module groups list'),
|
||||
'images/module_group.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
''
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Module groups'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -174,7 +184,7 @@ if ($is_management_allowed === true && $delete_group === true) {
|
|||
|
||||
$result = db_process_sql_delete('tmodule_group', ['id_mg' => $id_group]);
|
||||
|
||||
if ($result) {
|
||||
if ((bool) $result === true) {
|
||||
$result = db_process_sql_update(
|
||||
'tagente_modulo',
|
||||
['id_module_group' => 0],
|
||||
|
@ -223,11 +233,11 @@ if ($is_management_allowed === true && $delete_group === true) {
|
|||
}
|
||||
}
|
||||
|
||||
if (! $result) {
|
||||
ui_print_error_message(__('There was a problem deleting group'));
|
||||
} else {
|
||||
ui_print_success_message(__('Group successfully deleted'));
|
||||
}
|
||||
ui_print_result_message(
|
||||
$result,
|
||||
__('Group successfully deleted'),
|
||||
__('There was a problem deleting group')
|
||||
);
|
||||
}
|
||||
|
||||
// Prepare pagination.
|
||||
|
@ -243,7 +253,6 @@ $sql = 'SELECT *
|
|||
$groups = db_get_all_rows_sql($sql);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
|
||||
if (empty($groups) === false) {
|
||||
|
@ -254,6 +263,8 @@ if (empty($groups) === false) {
|
|||
$table->head[2] = __('Delete');
|
||||
}
|
||||
|
||||
$table->size[0] = '5%';
|
||||
|
||||
$table->align = [];
|
||||
$table->align[1] = 'left';
|
||||
if ($is_management_allowed === true) {
|
||||
|
@ -270,10 +281,10 @@ if (empty($groups) === false) {
|
|||
if ($is_management_allowed === true) {
|
||||
$data[1] = '<strong><a href="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group&id_group='.$id_group['id_mg'].'&offset='.$offset.'">'.ui_print_truncate_text($id_group['name'], GENERIC_SIZE_TEXT).'</a></strong>';
|
||||
if (is_metaconsole() === true) {
|
||||
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
$data[2] = '<a href="index.php?sec=advanced&sec2=advanced/component_management&tab=module_group&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
} else {
|
||||
$table->cellclass[][2] = 'action_buttons';
|
||||
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/cross.png', true, ['border' => '0']).'</a>';
|
||||
$table->cellclass[][2] = 'table_action_buttons';
|
||||
$data[2] = '<a href="index.php?sec=gmodules&sec2=godmode/groups/modu_group_list&id_group='.$id_group['id_mg'].'&delete_group=1&offset='.$offset_delete.'" onClick="if (!confirm(\' '.__('Are you sure?').'\')) return false;">'.html_print_image('images/delete.svg', true, ['class' => 'main_menu_icon invert_filter']).'</a>';
|
||||
}
|
||||
} else {
|
||||
$data[1] = '<strong>';
|
||||
|
@ -284,9 +295,8 @@ if (empty($groups) === false) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
ui_pagination($total_groups, $url, $offset);
|
||||
html_print_table($table);
|
||||
ui_pagination($total_groups, $url, $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination($total_groups, $url, $offset, 0, true, 'offset', false);
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
[
|
||||
|
@ -298,13 +308,18 @@ if (empty($groups) === false) {
|
|||
|
||||
if ($is_management_allowed === true) {
|
||||
echo '<form method="post" action="index.php?sec=gmodules&sec2=godmode/groups/configure_modu_group">';
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_submit_button(
|
||||
__('Create module group'),
|
||||
'crt',
|
||||
false,
|
||||
'class="sub next"'
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create module group'),
|
||||
'crt',
|
||||
false,
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
|
|
@ -148,7 +148,11 @@ $delete = (bool) get_parameter_post('delete');
|
|||
if ($delete === true) {
|
||||
$result = process_manage_delete($id_agents);
|
||||
|
||||
$info = '{"Agent":"'.implode(',', $id_agents).'"}';
|
||||
if (empty($id_agents) === true) {
|
||||
$info = '{"Agent":"empty"}';
|
||||
} else {
|
||||
$info = '{"Agent":"'.implode(',', $id_agents).'"}';
|
||||
}
|
||||
|
||||
if ($result === true) {
|
||||
db_pandora_audit(
|
||||
|
|
|
@ -61,7 +61,6 @@ if (is_management_allowed() === false) {
|
|||
|
||||
if (is_metaconsole() === true) {
|
||||
include_once $config['homedir'].'/include/functions_visual_map.php';
|
||||
open_meta_frame();
|
||||
}
|
||||
|
||||
$edit_users = (int) get_parameter('edit_users');
|
||||
|
@ -589,8 +588,6 @@ if (is_metaconsole() === false) {
|
|||
});
|
||||
</script>
|
||||
<?php
|
||||
} else {
|
||||
close_meta_frame();
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
@ -33,10 +33,11 @@ require_once 'include/functions_menu.php';
|
|||
|
||||
check_login();
|
||||
|
||||
$access_console_node = !is_reporting_console_node();
|
||||
$access_console_node = is_reporting_console_node() === false;
|
||||
$menu_godmode = [];
|
||||
$menu_godmode['class'] = 'godmode';
|
||||
|
||||
$menuGodmode = [];
|
||||
if ($access_console_node === true) {
|
||||
enterprise_include('godmode/menu.php');
|
||||
}
|
||||
|
@ -49,7 +50,7 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
|||
) {
|
||||
$sub = [];
|
||||
$sub['godmode/servers/discovery&wiz=main']['text'] = __('Start');
|
||||
$sub['godmode/servers/discovery&wiz=main']['id'] = 'Discovery';
|
||||
$sub['godmode/servers/discovery&wiz=main']['id'] = 'discovery';
|
||||
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['text'] = __('Task list');
|
||||
$sub['godmode/servers/discovery&wiz=tasklist']['id'] = 'tasklist';
|
||||
|
@ -71,6 +72,8 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
|||
|
||||
$sub['godmode/servers/discovery&wiz=hd']['text'] = __('Host & devices');
|
||||
$sub['godmode/servers/discovery&wiz=hd']['id'] = 'hd';
|
||||
$sub['godmode/servers/discovery&wiz=hd']['type'] = 'direct';
|
||||
$sub['godmode/servers/discovery&wiz=hd']['subtype'] = 'nolink';
|
||||
$sub['godmode/servers/discovery&wiz=hd']['sub2'] = $sub2;
|
||||
}
|
||||
|
||||
|
@ -92,36 +95,36 @@ if ($access_console_node === true) {
|
|||
$sub = [];
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true || (bool) check_acl($config['id_user'], 0, 'AD') === true) {
|
||||
$sub['godmode/agentes/modificar_agente']['text'] = __('Manage agents');
|
||||
$sub['godmode/agentes/modificar_agente']['id'] = 'Manage agents';
|
||||
$sub['godmode/agentes/modificar_agente']['id'] = 'Manage_agents';
|
||||
$sub['godmode/agentes/modificar_agente']['subsecs'] = ['godmode/agentes/configurar_agente'];
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub['godmode/agentes/fields_manager']['text'] = __('Custom fields');
|
||||
$sub['godmode/agentes/fields_manager']['id'] = 'Custom fields';
|
||||
$sub['godmode/agentes/fields_manager']['id'] = 'custom_fields';
|
||||
|
||||
$sub['godmode/modules/manage_nc_groups']['text'] = __('Component groups');
|
||||
$sub['godmode/modules/manage_nc_groups']['id'] = 'Component groups';
|
||||
$sub['godmode/modules/manage_nc_groups']['id'] = 'component_groups';
|
||||
// Category.
|
||||
$sub['godmode/category/category']['text'] = __('Module categories');
|
||||
$sub['godmode/category/category']['id'] = 'Module categories';
|
||||
$sub['godmode/category/category']['id'] = 'module_categories';
|
||||
$sub['godmode/category/category']['subsecs'] = 'godmode/category/edit_category';
|
||||
|
||||
$sub['godmode/modules/module_list']['text'] = __('Module types');
|
||||
$sub['godmode/modules/module_list']['id'] = 'Module types';
|
||||
$sub['godmode/modules/module_list']['id'] = 'module_types';
|
||||
|
||||
$sub['godmode/groups/modu_group_list']['text'] = __('Module groups');
|
||||
$sub['godmode/groups/modu_group_list']['id'] = 'Module groups';
|
||||
$sub['godmode/groups/modu_group_list']['id'] = 'module_groups';
|
||||
|
||||
$sub['godmode/setup/os']['text'] = __('Operating systems');
|
||||
$sub['godmode/setup/os']['id'] = 'Edit OS';
|
||||
$sub['godmode/setup/os']['id'] = 'edit_OS';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
// Netflow.
|
||||
if ((bool) $config['activate_netflow'] === true) {
|
||||
$sub['godmode/netflow/nf_edit']['text'] = __('Netflow filters');
|
||||
$sub['godmode/netflow/nf_edit']['id'] = 'Netflow filters';
|
||||
$sub['godmode/netflow/nf_edit']['id'] = 'netflow_filters';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,13 +138,13 @@ if ($access_console_node === true) {
|
|||
$sub = [];
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub['godmode/groups/group_list']['text'] = __('Manage agents groups');
|
||||
$sub['godmode/groups/group_list']['id'] = 'Manage agents groups';
|
||||
$sub['godmode/groups/group_list']['id'] = 'manage_agents_groups';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
// Tag.
|
||||
$sub['godmode/tag/tag']['text'] = __('Module tags');
|
||||
$sub['godmode/tag/tag']['id'] = 'Module tags';
|
||||
$sub['godmode/tag/tag']['id'] = 'module_tags';
|
||||
$sub['godmode/tag/tag']['subsecs'] = 'godmode/tag/edit_tag';
|
||||
|
||||
enterprise_hook('enterprise_acl_submenu');
|
||||
|
@ -149,12 +152,12 @@ if ($access_console_node === true) {
|
|||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
|
||||
$sub['godmode/users/user_list']['text'] = __('Users management');
|
||||
$sub['godmode/users/user_list']['id'] = 'Users management';
|
||||
$sub['godmode/users/user_list']['id'] = 'Users_management';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub['godmode/users/profile_list']['text'] = __('Profile management');
|
||||
$sub['godmode/users/profile_list']['id'] = 'Profile management';
|
||||
$sub['godmode/users/profile_list']['id'] = 'Profile_management';
|
||||
}
|
||||
|
||||
if (empty($sub) === false) {
|
||||
|
@ -172,17 +175,17 @@ if ($access_console_node === true) {
|
|||
$sub['templates']['subtype'] = 'nolink';
|
||||
$sub2 = [];
|
||||
$sub2['godmode/modules/manage_module_templates']['text'] = __('Module templates');
|
||||
$sub2['godmode/modules/manage_module_templates']['id'] = 'Module templates';
|
||||
$sub2['godmode/modules/manage_module_templates']['id'] = 'module_templates';
|
||||
$sub2['godmode/modules/private_enterprise_numbers']['text'] = __('Private Enterprise Numbers');
|
||||
$sub2['godmode/modules/private_enterprise_numbers']['id'] = 'Private Enterprise Numbers';
|
||||
$sub2['godmode/modules/private_enterprise_numbers']['id'] = 'private_Enterprise_Numbers';
|
||||
$sub2['enterprise/godmode/modules/local_components']['text'] = __('Local components');
|
||||
$sub2['enterprise/godmode/modules/local_components']['id'] = 'Local components';
|
||||
$sub2['enterprise/godmode/modules/local_components']['id'] = 'local_components';
|
||||
$sub2['godmode/modules/manage_network_components']['text'] = __('Remote components');
|
||||
$sub2['godmode/modules/manage_network_components']['id'] = 'Network components';
|
||||
$sub2['godmode/modules/manage_network_components']['id'] = 'network_components';
|
||||
$sub['templates']['sub2'] = $sub2;
|
||||
|
||||
$sub['godmode/modules/manage_inventory_modules']['text'] = __('Inventory modules');
|
||||
$sub['godmode/modules/manage_inventory_modules']['id'] = 'Inventory modules';
|
||||
$sub['godmode/modules/manage_inventory_modules']['id'] = 'Inventory_modules';
|
||||
|
||||
enterprise_hook('autoconfiguration_menu');
|
||||
enterprise_hook('agent_repository_menu');
|
||||
|
@ -199,7 +202,7 @@ if ($access_console_node === true) {
|
|||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
$sub['gmassive']['text'] = __('Bulk operations');
|
||||
$sub['gmassive']['id'] = 'Bulk operations';
|
||||
$sub['gmassive']['id'] = 'Bulk_operations';
|
||||
$sub['gmassive']['type'] = 'direct';
|
||||
$sub['gmassive']['subtype'] = 'nolink';
|
||||
$sub2 = [];
|
||||
|
@ -221,7 +224,7 @@ if ($access_console_node === true) {
|
|||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($config['id_user'], 0, 'UM') === true) {
|
||||
$sub['godmode/groups/group_list&tab=credbox']['text'] = __('Credential store');
|
||||
$sub['godmode/groups/group_list&tab=credbox']['id'] = 'credential store';
|
||||
$sub['godmode/groups/group_list&tab=credbox']['id'] = 'credential_store';
|
||||
}
|
||||
|
||||
// Manage events.
|
||||
|
@ -229,14 +232,14 @@ if ($access_console_node === true) {
|
|||
if ((bool) check_acl($config['id_user'], 0, 'EW') === true || (bool) check_acl($config['id_user'], 0, 'EM') === true) {
|
||||
// Custom event fields.
|
||||
$sub2['godmode/events/events§ion=filter']['text'] = __('Event filters');
|
||||
$sub2['godmode/events/events§ion=filter']['id'] = 'Event filters';
|
||||
$sub2['godmode/events/events§ion=filter']['id'] = 'event_filters';
|
||||
}
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'PM') === true) {
|
||||
$sub2['godmode/events/events§ion=fields']['text'] = __('Custom columns');
|
||||
$sub2['godmode/events/events§ion=fields']['id'] = 'Custom events';
|
||||
$sub2['godmode/events/events§ion=fields']['id'] = 'Custom_events';
|
||||
$sub2['godmode/events/events§ion=responses']['text'] = __('Event responses');
|
||||
$sub2['godmode/events/events§ion=responses']['id'] = 'Event responses';
|
||||
$sub2['godmode/events/events§ion=responses']['id'] = 'Event_responses';
|
||||
}
|
||||
|
||||
if (empty($sub2) === false) {
|
||||
|
@ -265,12 +268,12 @@ if ($access_console_node === true) {
|
|||
|
||||
$sub = [];
|
||||
$sub['godmode/alerts/alert_list']['text'] = __('List of Alerts');
|
||||
$sub['godmode/alerts/alert_list']['id'] = 'List of Alerts';
|
||||
$sub['godmode/alerts/alert_list']['id'] = 'List_of_Alerts';
|
||||
$sub['godmode/alerts/alert_list']['pages'] = ['godmode/alerts/alert_view'];
|
||||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'LM') === true) {
|
||||
$sub['godmode/alerts/alert_templates']['text'] = __('Templates');
|
||||
$sub['godmode/alerts/alert_templates']['id'] = 'Templates';
|
||||
$sub['godmode/alerts/alert_templates']['id'] = 'templates';
|
||||
$sub['godmode/alerts/alert_templates']['pages'] = ['godmode/alerts/configure_alert_template'];
|
||||
|
||||
$sub['godmode/alerts/alert_actions']['text'] = __('Actions');
|
||||
|
@ -280,12 +283,12 @@ if ($access_console_node === true) {
|
|||
$sub['godmode/alerts/alert_commands']['id'] = 'Commands';
|
||||
$sub['godmode/alerts/alert_commands']['pages'] = ['godmode/alerts/configure_alert_command'];
|
||||
$sub['godmode/alerts/alert_special_days']['text'] = __('Special days list');
|
||||
$sub['godmode/alerts/alert_special_days']['id'] = __('Special days list');
|
||||
$sub['godmode/alerts/alert_special_days']['id'] = 'Special_days_list';
|
||||
$sub['godmode/alerts/alert_special_days']['pages'] = ['godmode/alerts/configure_alert_special_days'];
|
||||
|
||||
enterprise_hook('eventalerts_submenu');
|
||||
$sub['godmode/snmpconsole/snmp_alert']['text'] = __('SNMP alerts');
|
||||
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP alerts';
|
||||
$sub['godmode/snmpconsole/snmp_alert']['id'] = 'SNMP_alerts';
|
||||
enterprise_hook('alert_inventory_submenu');
|
||||
}
|
||||
|
||||
|
@ -302,7 +305,7 @@ if ($access_console_node === true) {
|
|||
|
||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||
$sub['godmode/servers/modificar_server']['text'] = __('Manage servers');
|
||||
$sub['godmode/servers/modificar_server']['id'] = 'Manage servers';
|
||||
$sub['godmode/servers/modificar_server']['id'] = 'Manage_servers';
|
||||
}
|
||||
|
||||
// This subtabs are only for Pandora Admin.
|
||||
|
@ -339,7 +342,7 @@ if ($access_console_node === true) {
|
|||
$sub2 = [];
|
||||
|
||||
$sub2['godmode/setup/setup§ion=general']['text'] = __('General Setup');
|
||||
$sub2['godmode/setup/setup§ion=general']['id'] = 'General Setup';
|
||||
$sub2['godmode/setup/setup§ion=general']['id'] = 'general_Setup';
|
||||
$sub2['godmode/setup/setup§ion=general']['refr'] = 0;
|
||||
|
||||
enterprise_hook('password_submenu');
|
||||
|
@ -386,7 +389,7 @@ if ($access_console_node === true) {
|
|||
|
||||
$sub['general']['sub2'] = $sub2;
|
||||
$sub['godmode/setup/license']['text'] = __('License');
|
||||
$sub['godmode/setup/license']['id'] = 'License';
|
||||
$sub['godmode/setup/license']['id'] = 'license';
|
||||
|
||||
enterprise_hook('skins_submenu');
|
||||
|
||||
|
@ -406,28 +409,28 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($
|
|||
if ($access_console_node === true) {
|
||||
// Audit //meter en extensiones.
|
||||
$sub['godmode/audit_log']['text'] = __('System audit log');
|
||||
$sub['godmode/audit_log']['id'] = 'System audit log';
|
||||
$sub['godmode/audit_log']['id'] = 'system_audit_log';
|
||||
$sub['godmode/setup/links']['text'] = __('Links');
|
||||
$sub['godmode/setup/links']['id'] = 'Links';
|
||||
$sub['godmode/setup/links']['id'] = 'links';
|
||||
$sub['tools/diagnostics']['text'] = __('Diagnostic info');
|
||||
$sub['tools/diagnostics']['id'] = 'Diagnostic info';
|
||||
$sub['tools/diagnostics']['id'] = 'diagnostic_info';
|
||||
enterprise_hook('omnishell');
|
||||
enterprise_hook('ipam_submenu');
|
||||
|
||||
$sub['godmode/setup/news']['text'] = __('Site news');
|
||||
$sub['godmode/setup/news']['id'] = 'Site news';
|
||||
$sub['godmode/setup/news']['id'] = 'site_news';
|
||||
}
|
||||
|
||||
$sub['godmode/setup/file_manager']['text'] = __('File manager');
|
||||
$sub['godmode/setup/file_manager']['id'] = 'File manager';
|
||||
$sub['godmode/setup/file_manager']['id'] = 'file_manager';
|
||||
|
||||
if ($access_console_node === true) {
|
||||
if (is_user_admin($config['id_user']) === true) {
|
||||
$sub['extensions/db_status']['text'] = __('DB Schema Check');
|
||||
$sub['extensions/db_status']['id'] = 'DB Schema Check';
|
||||
$sub['extensions/db_status']['id'] = 'DB_Schema_Check';
|
||||
$sub['extensions/db_status']['sec'] = 'gextensions';
|
||||
$sub['extensions/dbmanager']['text'] = __('DB Interface');
|
||||
$sub['extensions/dbmanager']['id'] = 'DB Interface';
|
||||
$sub['extensions/dbmanager']['id'] = 'DB_Interface';
|
||||
$sub['extensions/dbmanager']['sec'] = 'gextensions';
|
||||
enterprise_hook('dbBackupManager');
|
||||
enterprise_hook('elasticsearch_interface_menu');
|
||||
|
@ -435,6 +438,10 @@ if ((bool) check_acl($config['id_user'], 0, 'PM') === true || (bool) check_acl($
|
|||
}
|
||||
}
|
||||
|
||||
$sub['godmode/events/configuration_sounds']['text'] = __('Accoustic console setup');
|
||||
$sub['godmode/events/configuration_sounds']['id'] = 'Accoustic console setup';
|
||||
$sub['godmode/events/configuration_sounds']['pages'] = ['godmode/events/configuration_sounds'];
|
||||
|
||||
$menu_godmode['gextensions']['sub'] = $sub;
|
||||
}
|
||||
|
||||
|
@ -465,7 +472,7 @@ if ($access_console_node === true) {
|
|||
// Check if was displayed inside other menu.
|
||||
if (empty($extension['godmode_menu']['fatherId']) === true) {
|
||||
$sub2[$extmenu['sec2']]['text'] = __($extmenu['name']);
|
||||
$sub2[$extmenu['sec2']]['id'] = $extmenu['name'];
|
||||
$sub2[$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']);
|
||||
$sub2[$extmenu['sec2']]['refr'] = 0;
|
||||
} else {
|
||||
if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) {
|
||||
|
@ -473,7 +480,7 @@ if ($access_console_node === true) {
|
|||
if (array_key_exists('subfatherId', $extmenu) === true) {
|
||||
if (strlen($extmenu['subfatherId']) > 0) {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['sec'] = 'extensions';
|
||||
|
@ -482,7 +489,7 @@ if ($access_console_node === true) {
|
|||
$menu_godmode[$extmenu['fatherId']]['hasExtensions'] = true;
|
||||
} else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['text'] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = $extmenu['fatherId'];
|
||||
|
@ -492,7 +499,7 @@ if ($access_console_node === true) {
|
|||
}
|
||||
} else {
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['text'] = __($extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = $extmenu['name'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']);
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['refr'] = 0;
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['icon'] = $extmenu['icon'];
|
||||
$menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['sec2']]['sec'] = 'gextensions';
|
||||
|
@ -507,13 +514,13 @@ if ($access_console_node === true) {
|
|||
|
||||
// Complete the submenu.
|
||||
$extension_view = [];
|
||||
$extension_view['godmode/extensions']['id'] = 'Extension manager view';
|
||||
$extension_view['godmode/extensions']['id'] = 'extension_manager_view';
|
||||
$extension_view['godmode/extensions']['text'] = __('Extension manager view');
|
||||
$extension_submenu = array_merge($extension_view, $sub2);
|
||||
|
||||
$sub['godmode/extensions']['sub2'] = $extension_submenu;
|
||||
$sub['godmode/extensions']['text'] = __('Extension manager');
|
||||
$sub['godmode/extensions']['id'] = 'Extension manager';
|
||||
$sub['godmode/extensions']['id'] = 'extension_manager';
|
||||
$sub['godmode/extensions']['type'] = 'direct';
|
||||
$sub['godmode/extensions']['subtype'] = 'nolink';
|
||||
|
||||
|
|
|
@ -33,7 +33,6 @@ $management_allowed = is_management_allowed();
|
|||
if (is_metaconsole() === true) {
|
||||
$sec = 'advanced';
|
||||
enterprise_include_once('meta/include/functions_components_meta.php');
|
||||
enterprise_hook('open_meta_frame');
|
||||
components_meta_print_header();
|
||||
|
||||
if ($management_allowed === false) {
|
||||
|
@ -41,12 +40,24 @@ if (is_metaconsole() === true) {
|
|||
}
|
||||
} else {
|
||||
$sec = 'gmodules';
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Inventory modules'),
|
||||
|
||||
ui_print_standard_header(
|
||||
__('Inventory modules'),
|
||||
'images/page_white_text.png',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configuration'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Inventory modules'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if ($management_allowed === false) {
|
||||
|
@ -266,7 +277,7 @@ if ($create_module_inventory === true) {
|
|||
$total_modules = db_get_sql('SELECT COUNT(*) FROM tmodule_inventory');
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'margin: 10px 10px 0; width: -webkit-fill-available; width: -moz-available';
|
||||
$table->class = 'info_table';
|
||||
$table->size = [];
|
||||
$table->size[0] = '140px';
|
||||
|
@ -302,9 +313,15 @@ if ($result === false) {
|
|||
|
||||
$data[1] = $row['description'];
|
||||
if ($row['os_name'] == null) {
|
||||
$data[2] = html_print_image('images/agent.png', true, ['border' => '0', 'alt' => __('Agent'), 'title' => __('Agent'), 'height' => '18', 'class' => 'invert_filter']);
|
||||
$data[2] = html_print_image('images/agents@svg.svg', true, ['border' => '0', 'alt' => __('Agent'), 'title' => __('Agent'), 'height' => '18', 'class' => 'invert_filter main_menu_icon']);
|
||||
} else {
|
||||
$data[2] = ui_print_os_icon($row['id_os'], false, true);
|
||||
$data[2] = html_print_div(
|
||||
[
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'content' => ui_print_os_icon($row['id_os'], false, true),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
if ($row['interpreter'] == '') {
|
||||
|
@ -328,32 +345,35 @@ if ($result === false) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_inventory_modules'>";
|
||||
echo '<form id="form_delete" method="POST" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules">';
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset);
|
||||
html_print_table($table);
|
||||
ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div class='pdd_l_5px float-right'>";
|
||||
echo '</form>';
|
||||
$tablePagination = ui_pagination($total_modules, 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules', $offset, 0, true, 'offset', false);
|
||||
|
||||
$actionButtons = [];
|
||||
|
||||
if ($management_allowed === true) {
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
$actionButtons[] = html_print_submit_button(__('Delete'), 'delete_btn', false, ['icon' => 'delete', 'mode' => 'secondary', 'form' => 'form_delete'], true);
|
||||
$actionButtons[] = html_print_submit_button(__('Create'), 'crt', false, ['icon' => 'wand', 'form' => 'form_create'], true);
|
||||
|
||||
$actionButtons[] = '<form id="form_create" method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
|
||||
$actionButtons[] = html_print_input_hidden('create_module_inventory', 1, true);
|
||||
$actionButtons[] = '<form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
if ($management_allowed === true) {
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_inventory_modules_form">';
|
||||
echo '<div class="float-right mrgn_btn_15px">';
|
||||
html_print_input_hidden('create_module_inventory', 1);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
],
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
enterprise_hook('close_meta_frame');
|
||||
echo '<div id="deploy_messages" class="invisible">';
|
||||
echo '<span>'.__(
|
||||
'The configurations of inventory modules from the nodes have been unified.
|
||||
|
|
|
@ -29,7 +29,6 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'],
|
|||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
enterprise_include_once('meta/include/functions_components_meta.php');
|
||||
enterprise_hook('open_meta_frame');
|
||||
components_meta_print_header();
|
||||
} else {
|
||||
$sec = 'gmodules';
|
||||
|
@ -174,10 +173,6 @@ if ($id_module_inventory) {
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
enterprise_hook('close_meta_frame');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -1,23 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* Component group Management.
|
||||
*
|
||||
* @category Modules.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -32,16 +45,27 @@ require_once $config['homedir'].'/include/functions_network_components.php';
|
|||
require_once $config['homedir'].'/include/functions_component_groups.php';
|
||||
|
||||
// Header
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
components_meta_print_header();
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Component group management'),
|
||||
ui_print_standard_header(
|
||||
__('Component group management'),
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
true
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Component groups'),
|
||||
],
|
||||
]
|
||||
);
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
|
@ -234,12 +258,11 @@ foreach ($groups as $group_key => $group_val) {
|
|||
$groups = component_groups_get_groups_tree_recursive($groups_clean, 0, 0);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->head = [];
|
||||
$table->head['checkbox'] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->head[0] = __('Name');
|
||||
if (is_management_allowed() === true || is_metaconsole()) {
|
||||
if (is_management_allowed() === true || is_metaconsole() === true) {
|
||||
$table->head[1] = __('Action');
|
||||
}
|
||||
|
||||
|
@ -270,10 +293,16 @@ foreach ($groups as $group) {
|
|||
$data[0] = $tabulation.'<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_nc_groups&id='.$group['id_sg'].'">'.$group['name'].'</a>';
|
||||
}
|
||||
|
||||
$table->cellclass[][1] = 'action_buttons';
|
||||
$table->cellclass[][1] = 'table_action_buttons';
|
||||
if (is_management_allowed() === true || is_metaconsole()) {
|
||||
$data[1] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
|
||||
href='index.php?sec=".$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg']."&offset=0'>".html_print_image('images/cross.png', true, ['title' => __('Delete')]).'</a>';
|
||||
$data[1] = html_print_anchor(
|
||||
[
|
||||
'onClick' => 'if(confirm(\"'.__('Are you sure?').'\")) return true; else return false;',
|
||||
'href' => 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups&delete=1&id='.$group['id_sg'].'&offset=0',
|
||||
'content' => html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'main_menu_icon invert_filter']),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
|
@ -296,35 +325,61 @@ if (is_management_allowed() === false && is_metaconsole() === false) {
|
|||
);
|
||||
}
|
||||
|
||||
if (isset($data)) {
|
||||
echo "<form method='post' action='index.php?sec=".$sec."&sec2=godmode/modules/manage_nc_groups'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
$actionButtons = [];
|
||||
if (isset($data) === true) {
|
||||
echo '<form id="multiple_delete_form" method="POST" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups">';
|
||||
html_print_table($table);
|
||||
if (is_management_allowed() === true || is_metaconsole()) {
|
||||
echo "<div class='pdd_l_10px float-right mrgn_btn_15px'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</div>';
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
} else {
|
||||
ui_print_info_message(['no_close' => true, 'message' => __('There are no defined component groups') ]);
|
||||
}
|
||||
|
||||
if (is_management_allowed() === true || is_metaconsole()) {
|
||||
echo '<form method="post" action='.$url.'>';
|
||||
echo '<div class="float-right">';
|
||||
html_print_input_hidden('new', 1);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub next"');
|
||||
echo '</div>';
|
||||
// Create form.
|
||||
echo '<form id="create_form" method="POST" action="'.$url.'">';
|
||||
html_print_input_hidden('new', 1);
|
||||
echo '</form>';
|
||||
// Create action button.
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
__('Create'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'icon' => 'wand',
|
||||
'form' => 'create_form',
|
||||
],
|
||||
true
|
||||
);
|
||||
// Delete action button.
|
||||
if (isset($data) === true) {
|
||||
$actionButtons[] = html_print_input_hidden(
|
||||
'multiple_delete',
|
||||
1,
|
||||
false,
|
||||
false,
|
||||
'form="multiple_delete_form"'
|
||||
);
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'mode' => 'secondary',
|
||||
'form' => 'multiple_delete_form',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
|
@ -332,11 +387,11 @@ enterprise_hook('close_meta_frame');
|
|||
$(this).parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
|
@ -344,11 +399,7 @@ enterprise_hook('close_meta_frame');
|
|||
else{
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Component group management form.
|
||||
*
|
||||
* @category Modules.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -28,12 +43,7 @@ if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'],
|
|||
require_once $config['homedir'].'/include/functions_network_components.php';
|
||||
|
||||
$id = (int) get_parameter('id');
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$sec = 'advanced';
|
||||
} else {
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
$sec = (is_metaconsole() === true) ? 'advanced' : 'gmodules';
|
||||
|
||||
if ($id) {
|
||||
$group = network_components_get_group($id);
|
||||
|
@ -45,31 +55,24 @@ if ($id) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->class = 'databox';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
$table->class = 'databox data';
|
||||
if ($id) {
|
||||
$table->head[0] = __('Update Group Component');
|
||||
} else {
|
||||
$table->head[0] = __('Create Group Component');
|
||||
}
|
||||
|
||||
$table->head[0] = ($id) ? __('Update Group Component') : __('Create Group Component');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->style = [];
|
||||
$table->style[0] = 'font-weight: bold';
|
||||
$table->style[2] = 'font-weight: bold';
|
||||
$table->style[0] = 'width: 0';
|
||||
$table->style[1] = 'width: 0';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->data[0][0] = __('Name');
|
||||
$table->data[0][1] = html_print_input_text('name', $name, '', 15, 255, true);
|
||||
|
||||
$table->data[0][2] = __('Parent');
|
||||
$table->data[0][3] = html_print_select(
|
||||
$table->data[0][1] = __('Parent');
|
||||
$table->data[1][0] = html_print_input_text('name', $name, '', 0, 255, true, false, false, '', 'w100p');
|
||||
$table->data[1][1] = html_print_select(
|
||||
network_components_get_groups(),
|
||||
'parent',
|
||||
$parent,
|
||||
|
@ -81,17 +84,39 @@ $table->data[0][3] = html_print_select(
|
|||
false
|
||||
);
|
||||
|
||||
echo '<form method="post" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups">';
|
||||
$manageNcGroupsUrl = 'index.php?sec='.$sec.'&sec2=godmode/modules/manage_nc_groups';
|
||||
|
||||
echo '<form method="post" action="'.$manageNcGroupsUrl.'">';
|
||||
html_print_table($table);
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
|
||||
if ($id) {
|
||||
html_print_input_hidden('update', 1);
|
||||
html_print_input_hidden('id', $id);
|
||||
html_print_submit_button(__('Update'), 'crt', false, 'class="sub upd"');
|
||||
$actionButtonTitle = __('Update');
|
||||
} else {
|
||||
html_print_input_hidden('create', 1);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
|
||||
$actionButtonTitle = __('Create');
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
$actionButtons = [];
|
||||
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
$actionButtonTitle,
|
||||
'crt',
|
||||
false,
|
||||
['icon' => 'wand'],
|
||||
true
|
||||
);
|
||||
|
||||
$actionButtons[] = html_print_go_back_button(
|
||||
$manageNcGroupsUrl,
|
||||
['button_class' => ''],
|
||||
true
|
||||
);
|
||||
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
[ 'type' => 'form_action']
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -30,8 +30,6 @@ global $config;
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'PM') && ! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -287,16 +285,25 @@ if (is_metaconsole() === true) {
|
|||
$help_header = 'network_component_tab';
|
||||
}
|
||||
|
||||
ui_print_page_header(
|
||||
__('Module management').' » '.__('Remote component management'),
|
||||
ui_print_standard_header(
|
||||
__('Remote component management'),
|
||||
'',
|
||||
false,
|
||||
$help_header,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'modulemodal'
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Configuration'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Templates'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$sec = 'gmodules';
|
||||
}
|
||||
|
||||
|
@ -715,7 +722,7 @@ $total_components = network_components_get_network_components(
|
|||
$total_components = $total_components[0]['total'];
|
||||
$offset_delete = ($offset >= ($total_components - 1)) ? ($offset - $config['block_size']) : $offset;
|
||||
ui_pagination($total_components, $name_url);
|
||||
$filter['offset'] = $offset;
|
||||
$filter['offset'] = (int) get_parameter('offset');
|
||||
$filter['limit'] = (int) $config['block_size'];
|
||||
$components = network_components_get_network_components(
|
||||
false,
|
||||
|
@ -737,7 +744,7 @@ if ($components === false) {
|
|||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'margin: 10px 10px 0; width: -webkit-fill-available; width: -moz-available';
|
||||
$table->head = [];
|
||||
$table->class = 'info_table';
|
||||
if ($is_management_allowed === true) {
|
||||
|
@ -800,55 +807,7 @@ foreach ($components as $component) {
|
|||
$data[0] = io_safe_output($component['name']);
|
||||
}
|
||||
|
||||
switch ($component['id_modulo']) {
|
||||
case MODULE_NETWORK:
|
||||
$data[1] .= html_print_image(
|
||||
'images/op_network.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Network module'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case MODULE_WMI:
|
||||
$data[1] .= html_print_image(
|
||||
'images/wmi.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('WMI module'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case MODULE_PLUGIN:
|
||||
$data[1] .= html_print_image(
|
||||
'images/plugin.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Plug-in module'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
case MODULE_WIZARD:
|
||||
$data[1] .= html_print_image(
|
||||
'images/wand.png',
|
||||
true,
|
||||
[
|
||||
'title' => __('Wizard module'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
);
|
||||
break;
|
||||
|
||||
default:
|
||||
// Not possible.
|
||||
break;
|
||||
}
|
||||
$data[1] .= ui_print_servertype_icon((int) $component['id_modulo']);
|
||||
|
||||
$data[2] = ui_print_moduletype_icon($component['type'], true);
|
||||
$data[3] = "<span class='font_8px'>".mb_strimwidth(io_safe_output($component['description']), 0, 60, '...').'</span>';
|
||||
|
@ -856,59 +815,59 @@ foreach ($components as $component) {
|
|||
$data[5] = $component['max'].' / '.$component['min'];
|
||||
|
||||
if ($is_management_allowed === true) {
|
||||
$table->cellclass[][6] = 'action_buttons';
|
||||
$data[6] = '<a class="inline_line float-left" href="'.$url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'&offset='.$offset.'">'.html_print_image(
|
||||
'images/copy.png',
|
||||
true,
|
||||
$table->cellclass[][6] = 'table_action_buttons';
|
||||
|
||||
$data[6] = html_print_anchor(
|
||||
[
|
||||
'alt' => __('Duplicate'),
|
||||
'title' => __('Duplicate'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
$data[6] .= '<a href="'.$url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'&offset='.$offset_delete.'" onclick="if (! confirm (\''.__('Are you sure?').'\')) return false" >'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
'href' => $url.'&search_id_group='.$search_id_group.'search_string='.$search_string.'&duplicate_network_component=1&source_id='.$component['id_nc'].'&offset='.$offset,
|
||||
'content' => html_print_image(
|
||||
'images/copy.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Duplicate'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$data[6] .= html_print_anchor(
|
||||
[
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
'href' => $url.'&delete_component=1&id='.$component['id_nc'].'&search_id_group='.$search_id_group.'search_string='.$search_string.'&offset='.$offset_delete,
|
||||
'onClick' => 'if (! confirm (\''.__('Are you sure?').'\')) return false',
|
||||
'content' => html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if (isset($data) === true) {
|
||||
if ($is_management_allowed === true) {
|
||||
echo "<form method='post' action='index.php?sec=".$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure."'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
}
|
||||
$tablePagination = ui_pagination(
|
||||
$total_components,
|
||||
$url,
|
||||
0,
|
||||
0,
|
||||
true,
|
||||
'offset',
|
||||
false
|
||||
);
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$total_components,
|
||||
$name_url,
|
||||
0,
|
||||
0,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom'
|
||||
);
|
||||
if ($is_management_allowed === true) {
|
||||
echo "<div id='btn_delete_5' class='float-right'>";
|
||||
html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
'class="sub delete"'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
} else {
|
||||
echo '<form id="form_delete" method="POST" action="index.php?sec='.$sec.'&sec2=godmode/modules/manage_network_components&search_id_group=0search_string=&pure='.$pure.'">';
|
||||
html_print_table($table);
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
echo '</form>';
|
||||
|
||||
if (isset($data) === false) {
|
||||
ui_print_info_message(
|
||||
[
|
||||
'no_close' => true,
|
||||
|
@ -917,11 +876,33 @@ if (isset($data) === true) {
|
|||
);
|
||||
}
|
||||
|
||||
$actionButtons = [];
|
||||
if ($is_management_allowed === true) {
|
||||
echo '<form method="post" action="'.$url.'">';
|
||||
echo '<div class="right_align mrgn_btn_15px">';
|
||||
html_print_input_hidden('new_component', 1);
|
||||
html_print_select(
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
__('Create'),
|
||||
'crt',
|
||||
false,
|
||||
[
|
||||
'icon' => 'wand',
|
||||
'form' => 'form_create',
|
||||
],
|
||||
true
|
||||
);
|
||||
$actionButtons[] = html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'mode' => 'secondary',
|
||||
'form' => 'form_delete',
|
||||
],
|
||||
true
|
||||
);
|
||||
// Create.
|
||||
$actionButtons[] = '<form style="z-index: 10" id="form_create" method="post" action="'.$url.'">';
|
||||
$actionButtons[] = html_print_input_hidden('new_component', 1, true);
|
||||
$actionButtons[] = html_print_select(
|
||||
[
|
||||
COMPONENT_TYPE_NETWORK => __('Create a new network component'),
|
||||
COMPONENT_TYPE_PLUGIN => __('Create a new plugin component'),
|
||||
|
@ -933,19 +914,23 @@ if ($is_management_allowed === true) {
|
|||
'',
|
||||
'',
|
||||
'',
|
||||
''
|
||||
);
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'crt',
|
||||
true,
|
||||
false,
|
||||
'class="sub next mrgn_lft_5px"'
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'z-index: 10'
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
$actionButtons[] = '</form>';
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
html_print_action_buttons(
|
||||
implode('', $actionButtons),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
]
|
||||
);
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -327,7 +327,7 @@ if ($id_component_type == COMPONENT_TYPE_WMI) {
|
|||
4,
|
||||
5,
|
||||
];
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
$categories[] = 10;
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,7 @@ if ($id_component_type == COMPONENT_TYPE_WMI) {
|
|||
4,
|
||||
5,
|
||||
];
|
||||
if (enterprise_installed()) {
|
||||
if (enterprise_installed() === true) {
|
||||
$categories[] = 10;
|
||||
}
|
||||
|
||||
|
@ -353,7 +353,7 @@ echo '<form name="component" method="post">';
|
|||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
if ($id) {
|
||||
$table->head[0] = __('Update Network Component');
|
||||
} else {
|
||||
|
@ -366,26 +366,50 @@ if (defined('METACONSOLE')) {
|
|||
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
html_print_button(__('Go back'), 'go_back', false, '', 'class="sub cancel"');
|
||||
html_print_input_hidden('id_component_type', $id_component_type);
|
||||
if ($id) {
|
||||
html_print_input_hidden('update_component', 1);
|
||||
html_print_input_hidden('id', $id);
|
||||
$buttonCaption = __('Update');
|
||||
$buttonIcon = 'update';
|
||||
$buttonName = 'upd';
|
||||
html_print_submit_button(__('Update'), 'upd', false, 'class="sub upd"');
|
||||
} else {
|
||||
html_print_input_hidden('create_component', 1);
|
||||
html_print_input_hidden('create_network_from_module', 0);
|
||||
html_print_submit_button(__('Create'), 'crt', false, 'class="sub wand"');
|
||||
$buttonCaption = __('Create');
|
||||
$buttonIcon = 'wand';
|
||||
$buttonName = 'crt';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_button(
|
||||
__('Go back'),
|
||||
'go_back',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'back',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
).html_print_submit_button(
|
||||
$buttonCaption,
|
||||
$buttonName,
|
||||
false,
|
||||
['icon' => $buttonIcon],
|
||||
true
|
||||
),
|
||||
]
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
|
||||
ui_require_javascript_file('pandora_modules');
|
||||
?>
|
||||
<script language="JavaScript" type="text/javascript">
|
||||
<!--
|
||||
|
||||
$('#button-go_back').click(function () {
|
||||
window.location.href = "<?php echo ui_get_full_url('index.php?sec=templates&sec2=godmode/modules/manage_network_components'); ?>";
|
||||
|
|
|
@ -263,7 +263,7 @@ foreach ($result as $row) {
|
|||
$data[0] = html_print_checkbox_extended('delete_multiple[]', $row['id_np'], false, false, '', 'class="check_delete"', true);
|
||||
$data[1] = '<a href="index.php?sec=gmodules&sec2=godmode/modules/manage_network_templates_form&id_np='.$row['id_np'].'">'.io_safe_output($row['name']).'</a>';
|
||||
$data[2] = ui_print_truncate_text(io_safe_output($row['description']), 'description', true, true, true, '[…]');
|
||||
$table->cellclass[][3] = 'action_buttons';
|
||||
$table->cellclass[][3] = 'table_action_buttons';
|
||||
$data[3] = html_print_input_image(
|
||||
'delete_profile',
|
||||
'images/cross.png',
|
||||
|
|
|
@ -1,17 +1,32 @@
|
|||
<?php
|
||||
/**
|
||||
* Module Type List.
|
||||
*
|
||||
* @category Modules.
|
||||
* @package Pandora FMS
|
||||
* @subpackage Community
|
||||
* @version 1.0.0
|
||||
* @license See below
|
||||
*
|
||||
* ______ ___ _______ _______ ________
|
||||
* | __ \.-----.--.--.--| |.-----.----.-----. | ___| | | __|
|
||||
* | __/| _ | | _ || _ | _| _ | | ___| |__ |
|
||||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2023 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.
|
||||
* ============================================================================
|
||||
*/
|
||||
|
||||
// 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.
|
||||
// Load global vars
|
||||
// Load global vars.
|
||||
global $config;
|
||||
|
||||
check_login();
|
||||
|
@ -26,12 +41,30 @@ if (! check_acl($config['id_user'], 0, 'PM')) {
|
|||
}
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(__('Module management').' » '.__('Defined modules'), 'images/gm_modules.png', false, '', true);
|
||||
ui_print_standard_header(
|
||||
__('Defined module types'),
|
||||
'images/module_group.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
[],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Resources'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Module types'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
$update_module = (bool) get_parameter_post('update_module');
|
||||
|
||||
// Update
|
||||
if ($update_module) {
|
||||
if ($update_module === true) {
|
||||
$name = get_parameter_post('name');
|
||||
$id_type = get_parameter_post('id_type');
|
||||
$description = get_parameter_post('description');
|
||||
|
@ -54,43 +87,33 @@ if ($update_module) {
|
|||
}
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'module_type_list';
|
||||
$table->class = 'info_table';
|
||||
$table->size = [];
|
||||
$table->size[0] = '5%';
|
||||
$table->size[1] = '5%';
|
||||
$table->head = [];
|
||||
$table->head[0] = __('ID');
|
||||
$table->head[1] = __('Icon');
|
||||
$table->head[2] = __('Name');
|
||||
$table->head[3] = __('Description');
|
||||
|
||||
echo "<table cellpadding='0' cellspacing='0' width='100%' class='info_table'>";
|
||||
echo '<thead>';
|
||||
echo '<th>'.__('Icon').'</th>';
|
||||
echo '<th>'.__('ID').'</th>';
|
||||
echo '<th>'.__('Name').'</th>';
|
||||
echo '<th>'.__('Description').'</th>';
|
||||
echo '</thead';
|
||||
$table->data = [];
|
||||
|
||||
$rows = db_get_all_rows_sql('SELECT * FROM ttipo_modulo ORDER BY nombre');
|
||||
$rows = db_get_all_rows_sql('SELECT * FROM ttipo_modulo ORDER BY id_tipo');
|
||||
if ($rows === false) {
|
||||
$rows = [];
|
||||
}
|
||||
|
||||
$color = 0;
|
||||
foreach ($rows as $row) {
|
||||
if ($color == 1) {
|
||||
$tdcolor = 'datos';
|
||||
$color = 0;
|
||||
} else {
|
||||
$tdcolor = 'datos2';
|
||||
$color = 1;
|
||||
}
|
||||
$data[0] = $row['id_tipo'];
|
||||
$data[1] = html_print_image('images/'.$row['icon'], true, ['class' => 'main_menu_icon invert_filter']);
|
||||
$data[2] = $row['nombre'];
|
||||
$data[3] = $row['descripcion'];
|
||||
|
||||
echo "
|
||||
<tr>
|
||||
<td class='$tdcolor' align=''>".html_print_image('images/'.$row['icon'], true, ['border' => '0', 'class' => 'invert_filter'])."</td>
|
||||
<td class='$tdcolor'>
|
||||
<b>".$row['id_tipo']."
|
||||
</b></td>
|
||||
<td class='$tdcolor'>
|
||||
<b>".$row['nombre']."
|
||||
</b></td>
|
||||
<td class='$tdcolor'>
|
||||
".$row['descripcion'].'
|
||||
</td>
|
||||
</tr>';
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
html_print_table($table);
|
||||
// $tablePagination = ui_pagination($total_groups, $url, $offset, 0, true, 'offset', false);
|
||||
|
|
|
@ -19,8 +19,6 @@ require_once $config['homedir'].'/include/functions_netflow.php';
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
if (! check_acl($config['id_user'], 0, 'AW')) {
|
||||
db_pandora_audit(
|
||||
AUDIT_LOG_ACL_VIOLATION,
|
||||
|
@ -187,11 +185,11 @@ foreach ($filters as $filter) {
|
|||
}
|
||||
|
||||
|
||||
$data[2] = ui_print_group_icon($filter['id_group'], true, 'groups_small', '', !defined('METACONSOLE'));
|
||||
$data[2] = ui_print_group_icon($filter['id_group'], true);
|
||||
$data[3] = '';
|
||||
|
||||
if (check_acl_restricted_all($config['id_user'], $filter['id_group'], 'AW')) {
|
||||
$table->cellclass[][3] = 'action_buttons';
|
||||
$table->cellclass[][3] = 'table_action_buttons';
|
||||
$data[3] = "<a onclick='if(confirm(\"".__('Are you sure?')."\")) return true; else return false;'
|
||||
href='".$config['homeurl'].'index.php?sec=netf&sec2=godmode/netflow/nf_edit&delete=1&id='.$filter['id_sg']."&offset=0&pure=$pure'>".html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
|
||||
}
|
||||
|
@ -218,8 +216,6 @@ html_print_submit_button(__('Create filter'), 'crt', false, 'class="sub wand"');
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -20,8 +20,6 @@ require_once $config['homedir'].'/include/functions_groups.php';
|
|||
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
|
||||
// Fix: Netflow have to check RW ACL
|
||||
if (! check_acl($config['id_user'], 0, 'RW')) {
|
||||
db_pandora_audit(
|
||||
|
@ -275,8 +273,6 @@ if ($id) {
|
|||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -192,13 +192,23 @@ $buttons['graph_container'] = [
|
|||
];
|
||||
|
||||
// Header.
|
||||
ui_print_page_header(
|
||||
ui_print_standard_header(
|
||||
__('Create container'),
|
||||
'',
|
||||
'images/chart.png',
|
||||
false,
|
||||
'create_container',
|
||||
false,
|
||||
$buttons
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom graphs'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if ($add_container) {
|
||||
|
@ -212,28 +222,33 @@ if ($update_container) {
|
|||
ui_print_result_message($success, __('Update the container'), __('Bad update the container'));
|
||||
}
|
||||
|
||||
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
|
||||
$table = '';
|
||||
if ($edit_container) {
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&update_container=1&id=".$id_container."'>";
|
||||
$table .= "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&update_container=1&id=".$id_container."'>";
|
||||
} else {
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&add_container=1'>";
|
||||
$table .= "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&add_container=1'>";
|
||||
}
|
||||
|
||||
$table .= "<table width='100%' class='filter-table-adv' cellpadding=4 cellspacing=4 >";
|
||||
$table .= '<tr class="datos2"><td class="datos2" width="30%">';
|
||||
|
||||
$input_value = '';
|
||||
if ($edit_container) {
|
||||
$input_value = io_safe_output($name);
|
||||
}
|
||||
|
||||
echo '<tr>';
|
||||
echo "<td class='datos w10p'><b>".__('Name').'</b></td>';
|
||||
if ($id_container === '1') {
|
||||
echo "<td class='datos w30p'><input type='text' name='name' size='30' disabled='1'";
|
||||
$input_name = html_print_input_text('name', $input_value, '', false, 255, true, true);
|
||||
} else {
|
||||
echo "<td class='datos w30p'><input type='text' name='name' size='30' ";
|
||||
// Using latest style...
|
||||
echo ' required ';
|
||||
$input_name = html_print_input_text('name', $input_value, '', false, 255, true, false, true);
|
||||
}
|
||||
|
||||
if ($edit_container) {
|
||||
echo "value='".io_safe_output($name)."'";
|
||||
}
|
||||
$table .= html_print_label_input_block(
|
||||
__('Name'),
|
||||
$input_name
|
||||
);
|
||||
|
||||
echo '></td>';
|
||||
$table .= '</td>';
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
||||
$return_all_groups = true;
|
||||
|
@ -241,41 +256,96 @@ if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'PM')) {
|
|||
$return_all_groups = false;
|
||||
}
|
||||
|
||||
echo "<td class='w10p'><b>".__('Group').'</b></td><td>';
|
||||
echo '<div class="w250px">';
|
||||
echo html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'RW',
|
||||
'returnAllGroup' => $return_all_groups,
|
||||
'name' => 'container_id_group',
|
||||
'selected' => $id_group,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => false,
|
||||
'required' => true,
|
||||
'disabled' => ($id_container === '1'),
|
||||
]
|
||||
$table .= "<td class='datos2' width='30%'>";
|
||||
$table .= html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'RW',
|
||||
'returnAllGroup' => $return_all_groups,
|
||||
'name' => 'container_id_group',
|
||||
'selected' => $id_group,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
'disabled' => ($id_container === '1'),
|
||||
'style' => 'width:100% !important',
|
||||
]
|
||||
)
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</td></tr>';
|
||||
$table .= '</td>';
|
||||
|
||||
echo '<tr>';
|
||||
echo "<td class='datos2'><b>".__('Description').'</b></td>';
|
||||
$table .= "<td class='datos2' width='30%'>";
|
||||
if ($id_container === '1') {
|
||||
echo "<td class='datos2' colspan=3><textarea name='description' style='height:45px;' cols=95 rows=2 disabled>";
|
||||
$table .= html_print_label_input_block(
|
||||
__('Parent container'),
|
||||
html_print_select(
|
||||
$containers_tree,
|
||||
'id_parent',
|
||||
$id_parent,
|
||||
'',
|
||||
__('none'),
|
||||
0,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'w130',
|
||||
true,
|
||||
'width: 100%',
|
||||
''
|
||||
)
|
||||
);
|
||||
} else {
|
||||
echo "<td class='datos2' colspan=3><textarea name='description' style='height:45px;' cols=95 rows=2>";
|
||||
$table .= html_print_label_input_block(
|
||||
__('Parent container'),
|
||||
html_print_select(
|
||||
$containers_tree,
|
||||
'id_parent',
|
||||
$id_parent,
|
||||
'',
|
||||
__('none'),
|
||||
0,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'w130',
|
||||
'',
|
||||
'width: 100%',
|
||||
''
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$table .= '</td></tr><tr class="datos2">';
|
||||
$table .= '<td class="datos2" colspan="3">';
|
||||
$textarea_disabled = false;
|
||||
if ($id_container === '1') {
|
||||
$textarea_disabled = true;
|
||||
}
|
||||
|
||||
$texarea_value = '';
|
||||
if ($edit_container) {
|
||||
echo io_safe_output($description);
|
||||
$texarea_value = io_safe_output($description);
|
||||
}
|
||||
|
||||
echo '</textarea>';
|
||||
echo '</td></tr>';
|
||||
$table .= html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea(
|
||||
'description',
|
||||
2,
|
||||
95,
|
||||
$texarea_value,
|
||||
'',
|
||||
true,
|
||||
'',
|
||||
$textarea_disabled
|
||||
)
|
||||
);
|
||||
$table .= '</td></tr>';
|
||||
$container = folder_get_folders();
|
||||
$tree = folder_get_folders_tree_recursive($container);
|
||||
$containers_tree = folder_flatten_tree_folders($tree, 0);
|
||||
|
@ -283,57 +353,59 @@ $containers_tree = folder_get_select($containers_tree);
|
|||
|
||||
unset($containers_tree[$id_container]);
|
||||
|
||||
echo '<tr>';
|
||||
echo "<td class='datos2'><b>".__('Parent container').'</b></td>';
|
||||
if ($id_container === '1') {
|
||||
echo "<td class='datos2'>".html_print_select(
|
||||
$containers_tree,
|
||||
'id_parent',
|
||||
$id_parent,
|
||||
'',
|
||||
__('none'),
|
||||
0,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'w130',
|
||||
true,
|
||||
'width: 195px',
|
||||
''
|
||||
);
|
||||
} else {
|
||||
echo "<td class='datos2'>".html_print_select(
|
||||
$containers_tree,
|
||||
'id_parent',
|
||||
$id_parent,
|
||||
'',
|
||||
__('none'),
|
||||
0,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'w130',
|
||||
'',
|
||||
'width: 195px',
|
||||
''
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
echo '</td></tr>';
|
||||
|
||||
|
||||
echo '</table>';
|
||||
$table .= '</table>';
|
||||
|
||||
if ($edit_container) {
|
||||
if ($id_container !== '1') {
|
||||
echo "<div class='w100p'><input type=submit name='store' disbaled class='sub upd right' value='".__('Update')."'></div>";
|
||||
$table .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Update'),
|
||||
'store',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
} else {
|
||||
echo "<div class='w100p'><input type=submit name='store' class='sub next right' value='".__('Create')."'></div>";
|
||||
$table .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Create'),
|
||||
'store',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
echo '</form>';
|
||||
$table .= '</form>';
|
||||
ui_toggle(
|
||||
$table,
|
||||
'<span class="subsection_header_title">'.__('Container').'</span>',
|
||||
'container',
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph'
|
||||
);
|
||||
|
||||
echo '</br>';
|
||||
echo '</br>';
|
||||
|
@ -358,35 +430,31 @@ if ($edit_container) {
|
|||
$type_graphs[0] = __('Area');
|
||||
$type_graphs[1] = __('Line');
|
||||
|
||||
$single_table = "<table width='100%' cellpadding=4 cellspacing=4>";
|
||||
$single_table .= "<tr id='row_time_lapse' class='datos'>";
|
||||
$single_table .= "<td class='bolder w10p'>";
|
||||
$single_table .= __('Time lapse');
|
||||
$single_table .= ui_print_help_tip(__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '), true);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '<td>';
|
||||
$single_table .= html_print_extended_select_for_time(
|
||||
'period_single',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
$periods
|
||||
$single_table = "<table width='100%' class='filter-table-adv' cellpadding=4 cellspacing=4>";
|
||||
$single_table .= "<tr class='datos2'>";
|
||||
$single_table .= "<td id='row_time_lapse' class='datos2' width='30%'>";
|
||||
$single_table .= html_print_label_input_block(
|
||||
__('Time lapse').ui_print_help_tip(
|
||||
__('This is the interval or period of time with which the graph data will be obtained. For example, a week means data from a week ago from now. '),
|
||||
true
|
||||
),
|
||||
html_print_extended_select_for_time(
|
||||
'period_single',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
10,
|
||||
true,
|
||||
'width:100%',
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
$periods
|
||||
)
|
||||
);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
|
||||
$single_table .= "<tr id='row_agent' class='datos'>";
|
||||
$single_table .= "<td class='bolder w10p'>";
|
||||
$single_table .= __('Agent');
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '<td>';
|
||||
$single_table .= "<td id='row_agent' class='datos2' width='30%'>";
|
||||
$params = [];
|
||||
|
||||
$params['show_helptip'] = false;
|
||||
|
@ -401,62 +469,74 @@ if ($edit_container) {
|
|||
$params['hidden_input_idagent_id'] = 'hidden-id_agent';
|
||||
|
||||
|
||||
$single_table .= ui_print_agent_autocomplete_input($params);
|
||||
$single_table .= html_print_label_input_block(
|
||||
__('Agent'),
|
||||
ui_print_agent_autocomplete_input($params)
|
||||
);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
$single_table .= "<td id='row_module' class='datos2' width='30%'>";
|
||||
|
||||
$single_table .= "<tr id='row_module' class='datos'>";
|
||||
$single_table .= "<td class='bolder w10p'>";
|
||||
$single_table .= __('Module');
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '<td>';
|
||||
if ($idAgent) {
|
||||
$single_table .= html_print_select_from_sql($sql_modules, 'id_agent_module', $idAgentModule, '', '', '0', true);
|
||||
$select_module .= html_print_select_from_sql($sql_modules, 'id_agent_module', $idAgentModule, '', '', '0', true);
|
||||
} else {
|
||||
$single_table .= "<select class='maxw180px' id='id_agent_module' name='id_agent_module' disabled='disabled'>";
|
||||
$single_table .= "<option value='0'>";
|
||||
$single_table .= __('Select an Agent first');
|
||||
$single_table .= '</option>';
|
||||
$single_table .= '</select>';
|
||||
$select_module .= "<select id='id_agent_module' name='id_agent_module' disabled='disabled' style='width:100%'>";
|
||||
$select_module .= "<option value='0'>";
|
||||
$select_module .= __('Select an Agent first');
|
||||
$select_module .= '</option>';
|
||||
$select_module .= '</select>';
|
||||
}
|
||||
|
||||
$single_table .= html_print_label_input_block(
|
||||
__('Module'),
|
||||
$select_module
|
||||
);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
|
||||
$single_table .= "<tr id='row_type_graphs' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Type of graph');
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '<td>';
|
||||
$single_table .= html_print_select($type_graphs, 'simple_type_graph', '', '', '', 0, true);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
|
||||
$single_table .= "<tr id='row_fullscale' style='' class='datos'>";
|
||||
$single_table .= "<td style='font-weight:bold;'>";
|
||||
$single_table .= __('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true);
|
||||
$single_table .= "<tr class='datos2'>";
|
||||
$single_table .= "<td id='row_type_graphs' width='30%'>";
|
||||
$single_table .= html_print_label_input_block(
|
||||
__('Type of graph'),
|
||||
html_print_select($type_graphs, 'simple_type_graph', '', '', '', 0, true)
|
||||
);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '<td>';
|
||||
$single_table .= html_print_checkbox('fullscale', 1, false, true);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
|
||||
$single_table .= '<tr>';
|
||||
$single_table .= '<td >';
|
||||
$single_table .= '</td>';
|
||||
$single_table .= "<td style='float:right;'>";
|
||||
$single_table .= "<input style='float:right;' type=submit name='add_single' class='sub add' value='".__('Add item')."'>";
|
||||
$single_table .= "<td id='row_fullscale' width='30%' colspan='2'>";
|
||||
$single_table .= html_print_label_input_block(
|
||||
__('Show full scale graph (TIP)').ui_print_help_tip('This option may cause performance issues', true),
|
||||
html_print_checkbox('fullscale', 1, false, true)
|
||||
);
|
||||
$single_table .= '</td>';
|
||||
$single_table .= '</tr>';
|
||||
$single_table .= '</table>';
|
||||
|
||||
echo "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
|
||||
echo '<tr>';
|
||||
echo '<td>';
|
||||
echo ui_toggle($single_table, 'Simple module graph', '', '', true);
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
echo '</table>';
|
||||
$single_table .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons-right-forced mrgn_right_10px',
|
||||
'content' => html_print_submit_button(
|
||||
__('Add item'),
|
||||
'add_single',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
ui_toggle(
|
||||
$single_table,
|
||||
'<span class="subsection_header_title">'.__('Simple module graph').'</span>',
|
||||
'container',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph'
|
||||
);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->id = 'custom_graph_table';
|
||||
|
@ -680,7 +760,7 @@ if ($edit_container) {
|
|||
}
|
||||
|
||||
$data[7] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/create_container&edit_container=1&delete_item=1&id_item='.$item['id_ci'].'&id='.$id_container.'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
|
||||
return false;">'.html_print_image('images/cross.png', true, ['alt' => __('Delete'), 'title' => __('Delete')]).'</a>';
|
||||
return false;">'.html_print_image('images/delete.svg', true, ['alt' => __('Delete'), 'title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
@ -694,7 +774,7 @@ echo html_print_input_hidden('id_agent', 0);
|
|||
|
||||
<script type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$("input[name=add_single]").click (function () {
|
||||
$("#button-add_single").click (function () {
|
||||
var id_agent_module = $("#id_agent_module").val();
|
||||
if(id_agent_module !== '0'){
|
||||
var id_agent = $("#hidden-id_agent").attr('value');
|
||||
|
|
|
@ -235,8 +235,18 @@ if ($count_module_array > 0) {
|
|||
echo '<table><tr>';
|
||||
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&tab=graph_editor&change_label=1&id=".$id_graph.'&graph='.$idgs_array[$a]."'>";
|
||||
echo '<div class="flex">';
|
||||
html_print_input_text('label', $label_array[$a], '', 30, 80, false, false);
|
||||
html_print_submit_button('Ok', 'btn', false, '', false);
|
||||
html_print_submit_button(
|
||||
__('Ok'),
|
||||
'btn',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'class' => 'inputbuton',
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
echo '</tr></table>';
|
||||
|
@ -246,14 +256,24 @@ if ($count_module_array > 0) {
|
|||
echo '<table><tr>';
|
||||
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&tab=graph_editor&change_weight=1&id=".$id_graph.'&graph='.$idgs_array[$a]."'>";
|
||||
echo '<div class="flex">';
|
||||
html_print_input_text('weight', $weight_array[$a], '', 20, 10, false, false);
|
||||
html_print_submit_button('Ok', 'btn', false, '', false);
|
||||
html_print_submit_button(
|
||||
__('Ok'),
|
||||
'btn',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'class' => 'inputbuton',
|
||||
]
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
echo '</tr></table>';
|
||||
echo '</td>';
|
||||
echo "<td class='$tdcolor' align=''>";
|
||||
echo "<a href='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&tab=graph_editor&delete_module=1&id=".$id_graph.'&delete='.$idgs_array[$a]."'>".html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
|
||||
echo "<a href='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&tab=graph_editor&delete_module=1&id=".$id_graph.'&delete='.$idgs_array[$a]."'>".html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
|
||||
|
||||
echo '</td>';
|
||||
|
||||
|
@ -275,54 +295,78 @@ $table = new stdClass();
|
|||
$table->width = '100%';
|
||||
$table->colspan[0][0] = 3;
|
||||
$table->size = [];
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->class = 'databox data';
|
||||
$table->head[0] = __('Sort items');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
} else {
|
||||
$table->data[0][0] = '<b>'.__('Sort items').'</b>';
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Sort selected items');
|
||||
$table->data[1][1] = html_print_select_style(
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Sort selected items'),
|
||||
html_print_select_style(
|
||||
[
|
||||
'before' => __('before to'),
|
||||
'after' => __('after to'),
|
||||
],
|
||||
'move_to',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Position'),
|
||||
html_print_input_text_extended(
|
||||
'position_to_sort',
|
||||
1,
|
||||
'text-position_to_sort',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_sort');",
|
||||
'',
|
||||
true
|
||||
).html_print_input_hidden('ids_items_to_sort', '', true)
|
||||
);
|
||||
|
||||
|
||||
$SortItems = "<form action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=".$id_graph."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||
$SortItems .= html_print_table($table, true);
|
||||
$SortItems .= html_print_input_hidden('action', 'sort_items', true);
|
||||
$SortItems .= html_print_div(
|
||||
[
|
||||
'before' => __('before to'),
|
||||
'after' => __('after to'),
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Sort'),
|
||||
'srcbutton',
|
||||
false,
|
||||
[
|
||||
'class' => 'mini',
|
||||
'icon' => 'search',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
'move_to',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text_extended(
|
||||
'position_to_sort',
|
||||
1,
|
||||
'text-position_to_sort',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_sort');",
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
|
||||
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
|
||||
$table->data[1][4] = html_print_input_hidden('action', 'sort_items', true);
|
||||
$SortItems .= '</form>';
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=graph_editor&edit_graph=1&id=".$id_graph."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
|
||||
echo '<br>';
|
||||
ui_toggle($SortItems, __('Sort items'), '', '', false);
|
||||
|
||||
|
||||
// Configuration form.
|
||||
|
@ -349,7 +393,20 @@ echo '</td>';
|
|||
echo '</tr><tr>';
|
||||
echo "<td colspan='3' align='right'></td>";
|
||||
echo '</tr></table>';
|
||||
echo "<div class='w100p'><input id='submit-add' type=submit name='store' class='sub add right' value='".__('Add')."'></div></form>";
|
||||
$ActionButtons[] = html_print_submit_button(
|
||||
__('Add'),
|
||||
'submit-add',
|
||||
false,
|
||||
[
|
||||
'class' => 'sub ok',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
);
|
||||
html_print_action_buttons(
|
||||
implode('', $ActionButtons),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
|
||||
ui_require_jquery_file('pandora.controls');
|
||||
ui_require_jquery_file('ajaxqueue');
|
||||
|
@ -360,9 +417,8 @@ ui_require_jquery_file('autocomplete');
|
|||
<script language="javascript" type="text/javascript">
|
||||
$(document).ready (function () {
|
||||
$(document).data('text_for_module', $("#none_text").html());
|
||||
|
||||
|
||||
$("#submit-add").click(function() {
|
||||
|
||||
$("#button-submit-add").click(function() {
|
||||
if($('#filtered-module-modules-modules')[0].value == "" || $('#filtered-module-modules-modules')[0].value == "0") {
|
||||
alert("<?php echo __('Please, select a module'); ?>");
|
||||
return false;
|
||||
|
@ -377,35 +433,34 @@ $(document).ready (function () {
|
|||
|
||||
$("#agentmodules").submit( function(eventObj) {
|
||||
$("<input />").attr("type", "hidden")
|
||||
.attr("value", agents_selected)
|
||||
.attr("name", "id_agents")
|
||||
.appendTo("#agentmodules");
|
||||
$("<input />").attr("type", "hidden")
|
||||
.attr("value", modules_selected)
|
||||
.attr("name", "id_modules")
|
||||
.appendTo("#agentmodules");
|
||||
.attr("value", agents_selected)
|
||||
.attr("name", "id_agents")
|
||||
.appendTo("#agentmodules");
|
||||
$("<input />").attr("type", "hidden")
|
||||
.attr("value", modules_selected)
|
||||
.attr("name", "id_modules")
|
||||
.appendTo("#agentmodules");
|
||||
return true;
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function added_ids_sorted_items_to_hidden_input() {
|
||||
var ids = '';
|
||||
var first = true;
|
||||
|
||||
|
||||
$("input.selected_check:checked").each(function(i, val) {
|
||||
if (!first)
|
||||
ids = ids + '|';
|
||||
first = false;
|
||||
|
||||
|
||||
ids = ids + $(val).val();
|
||||
});
|
||||
|
||||
|
||||
$("input[name='ids_items_to_sort']").val(ids);
|
||||
|
||||
|
||||
if (ids == '') {
|
||||
alert("<?php echo __('Please select any item to order'); ?>");
|
||||
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -115,20 +115,18 @@ if ($edit_graph === true) {
|
|||
// -----------------------
|
||||
$url = 'index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1';
|
||||
if ($edit_graph === true) {
|
||||
$output = "<form method='post' action='".$url.'&update_graph=1&id='.$id_graph."'>";
|
||||
$output = "<form method='post' class='max_floating_element_size' action='".$url.'&update_graph=1&id='.$id_graph."'>";
|
||||
} else {
|
||||
$output = "<form method='post' action='".$url."&add_graph=1'>";
|
||||
$output = "<form method='post' class='max_floating_element_size' action='".$url."&add_graph=1'>";
|
||||
}
|
||||
|
||||
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='databox filters'>";
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos'><b>".__('Name').'</b></td>';
|
||||
$output .= "<td class='datos'><input type='text' name='name' size='25' ";
|
||||
if ($edit_graph === true) {
|
||||
$output .= "value='".$graphInTgraph['name']."' ";
|
||||
}
|
||||
|
||||
$output .= '>';
|
||||
$output .= "<table width='100%' cellpadding=4 cellspacing=4 class='filter-table-adv databox'>";
|
||||
$output .= '<tbody width="100%">';
|
||||
$output .= '<tr class="datos2">';
|
||||
$graphInTgraph['name'] = (isset($graphInTgraph['name']) === true) ? $graphInTgraph['name'] : '';
|
||||
$output .= '<td width="50%">';
|
||||
$output .= html_print_label_input_block(__('Name'), html_print_input_text('name', $graphInTgraph['name'], '', '', 255, true), ['style' => 'width:50%']);
|
||||
$output .= '</td>';
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
|
||||
|
@ -140,9 +138,9 @@ if (users_can_manage_group_all('RW') === false
|
|||
$return_all_group = false;
|
||||
}
|
||||
|
||||
$output .= '<td><b>'.__('Group').'</b></td><td>';
|
||||
$output .= '<td width="50%">';
|
||||
if (check_acl($config['id_user'], 0, 'RW')) {
|
||||
$output .= html_print_input(
|
||||
$inputGroup = html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
|
@ -158,7 +156,7 @@ if (check_acl($config['id_user'], 0, 'RW')) {
|
|||
]
|
||||
);
|
||||
} else if (check_acl($config['id_user'], 0, 'RM')) {
|
||||
$output .= html_print_input(
|
||||
$inputGroup = html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
|
@ -175,38 +173,34 @@ if (check_acl($config['id_user'], 0, 'RW')) {
|
|||
);
|
||||
}
|
||||
|
||||
$output .= html_print_label_input_block(__('Group'), $inputGroup);
|
||||
$output .= '</td></tr>';
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos2'><b>".__('Description').'</b></td>';
|
||||
$output .= "<td class='datos2' colspan=3><textarea name='description' class='height_45px' cols=55 rows=2>";
|
||||
if ($edit_graph === true) {
|
||||
$output .= $graphInTgraph['description'];
|
||||
}
|
||||
|
||||
$output .= '</textarea>';
|
||||
$output .= '</td></tr>';
|
||||
if ($stacked == CUSTOM_GRAPH_GAUGE) {
|
||||
$hidden = ' class="invisible" ';
|
||||
} else {
|
||||
$hidden = '';
|
||||
}
|
||||
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos'>";
|
||||
$output .= '<b>'.__('Period').'</b></td>';
|
||||
$output .= "<td class='datos'>";
|
||||
$output .= html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
10,
|
||||
true
|
||||
$output .= '<tr class="datos2">';
|
||||
$output .= '<td width="100%" colspan="2">';
|
||||
$graphInTgraph['description'] = (isset($graphInTgraph['description']) === true) ? $graphInTgraph['description'] : '';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea('description', 10, 5, $graphInTgraph['description'], '', true)
|
||||
);
|
||||
$output .= "</td><td class='datos2'>";
|
||||
$output .= '<b>'.__('Type of graph').'</b></td>';
|
||||
$output .= "<td class='datos2'> <div class='left inline'>";
|
||||
$output .= '</td>';
|
||||
$output .= '</tr><tr class="datos2">';
|
||||
$output .= "<td class='datos' width='50%''>";
|
||||
$output .= html_print_label_input_block(
|
||||
__('Period'),
|
||||
html_print_extended_select_for_time(
|
||||
'period',
|
||||
$period,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'w100p'
|
||||
)
|
||||
);
|
||||
$output .= "</td><td class='datos2' width='50%'>";
|
||||
|
||||
require_once $config['homedir'].'/include/functions_graph.php';
|
||||
|
||||
|
@ -221,97 +215,116 @@ $stackeds = [
|
|||
CUSTOM_GRAPH_VBARS => __('Vertical bars'),
|
||||
CUSTOM_GRAPH_PIE => __('Pie'),
|
||||
];
|
||||
$output .= html_print_select($stackeds, 'stacked', $stacked, '', '', 0, true);
|
||||
|
||||
$output .= '</div></td></tr>';
|
||||
|
||||
$output .= '<tr>';
|
||||
$output .= "<td class='datos2 thresholdDiv'><b>";
|
||||
$output .= __('Equalize maximum thresholds');
|
||||
$output .= '</b></td>';
|
||||
$output .= "<td class='datos2 thresholdDiv'>";
|
||||
$output .= html_print_checkbox(
|
||||
'threshold',
|
||||
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
|
||||
$check,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false
|
||||
$output .= html_print_label_input_block(
|
||||
__('Type of graph'),
|
||||
html_print_select(
|
||||
$stackeds,
|
||||
'stacked',
|
||||
$stacked,
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
$output .= '</td></tr>';
|
||||
|
||||
$output .= "<tr><td class='datos2 sparse_graph '><b>";
|
||||
$output .= __('Percentil');
|
||||
$output .= '</b></td>';
|
||||
$output .= "<td class='datos2 sparse_graph'>";
|
||||
$output .= html_print_checkbox(
|
||||
'percentil',
|
||||
1,
|
||||
$percentil,
|
||||
true
|
||||
$output .= '<tr class="datos2">';
|
||||
$output .= "<td class='datos2 thresholdDiv' width='50%'>";
|
||||
$output .= html_print_label_input_block(
|
||||
__('Equalize maximum thresholds'),
|
||||
html_print_checkbox(
|
||||
'threshold',
|
||||
CUSTOM_GRAPH_BULLET_CHART_THRESHOLD,
|
||||
$check,
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
false
|
||||
)
|
||||
);
|
||||
$output .= '</td>';
|
||||
|
||||
$output .= '<td class="datos2 sparse_graph" width="50%">';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Percentil'),
|
||||
html_print_checkbox(
|
||||
'percentil',
|
||||
1,
|
||||
$percentil,
|
||||
true
|
||||
)
|
||||
);
|
||||
$output .= '</td>';
|
||||
$output .= '</tr>';
|
||||
|
||||
$output .= "<tr><td class='datos2 sparse_graph'><b>";
|
||||
$output .= __('Add summatory series');
|
||||
$output .= '</b></td>';
|
||||
$output .= "<td class='datos2 sparse_graph'>";
|
||||
$output .= html_print_checkbox(
|
||||
'summatory_series',
|
||||
1,
|
||||
$summatory_series,
|
||||
true
|
||||
$output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Add summatory series'),
|
||||
html_print_checkbox(
|
||||
'summatory_series',
|
||||
1,
|
||||
$summatory_series,
|
||||
true
|
||||
)
|
||||
);
|
||||
$output .= "</td><td class='datos2 sparse_graph'><b>";
|
||||
$output .= __('Add average series');
|
||||
$output .= '</b></td>';
|
||||
$output .= "<td class='datos2 sparse_graph'>";
|
||||
$output .= html_print_checkbox(
|
||||
'average_series',
|
||||
1,
|
||||
$average_series,
|
||||
true
|
||||
$output .= "</td><td class='datos2 sparse_graph' width='50%'>";
|
||||
$output .= html_print_label_input_block(
|
||||
__('Add average series'),
|
||||
html_print_checkbox(
|
||||
'average_series',
|
||||
1,
|
||||
$average_series,
|
||||
true
|
||||
)
|
||||
);
|
||||
$output .= '</td></tr>';
|
||||
$output .= "<tr><td class='datos2 sparse_graph'><b>";
|
||||
$output .= __('Modules and series');
|
||||
$output .= '</b></td>';
|
||||
$output .= "<td class='datos2 sparse_graph'>";
|
||||
$output .= html_print_checkbox('modules_series', 1, $modules_series, true);
|
||||
$output .= '<tr class="datos2"><td class="datos2 sparse_graph" width="50%">';
|
||||
$output .= html_print_label_input_block(
|
||||
__('Modules and series'),
|
||||
html_print_checkbox('modules_series', 1, $modules_series, true)
|
||||
);
|
||||
$output .= '</td>';
|
||||
$output .= "<td class='datos2 sparse_graph'><b>";
|
||||
$output .= __('Show full scale graph (TIP)');
|
||||
$output .= '</td>';
|
||||
$output .= "<td class='datos2 sparse_graph'>";
|
||||
$output .= html_print_checkbox('fullscale', 1, $fullscale, true);
|
||||
$output .= "<td class='datos2 sparse_graph' width='50%'>";
|
||||
$output .= html_print_label_input_block(
|
||||
__('Show full scale graph (TIP)'),
|
||||
html_print_checkbox('fullscale', 1, $fullscale, true)
|
||||
);
|
||||
$output .= '</td>';
|
||||
$output .= '</tr>';
|
||||
|
||||
$output .= '</tbody>';
|
||||
$output .= '</table>';
|
||||
|
||||
$stringButton = ($edit_graph === true) ? __('Update') : __('Create');
|
||||
$labelButton = ($edit_graph === true) ? __('Update') : __('Create');
|
||||
|
||||
$output .= html_print_div(
|
||||
$ActionButtons[] = html_print_submit_button(
|
||||
$labelButton,
|
||||
'store',
|
||||
false,
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'content' => "<input type=submit name='store' class='sub next right databox' value='".$stringButton."'>",
|
||||
'class' => 'sub ok submitButton',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$ActionButtons[] = html_print_button(
|
||||
__('Go back'),
|
||||
'back',
|
||||
false,
|
||||
"window.location.href = 'index.php?sec=reporting&sec2=godmode/reporting/graphs'",
|
||||
[
|
||||
'class' => 'sub ok submitButton',
|
||||
'icon' => 'back',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'class' => 'w100p',
|
||||
'content' => html_print_button(
|
||||
__('Go back'),
|
||||
'go_back',
|
||||
false,
|
||||
'window.location.href = \'index.php?sec=reporting&sec2=godmode/reporting/graphs\'',
|
||||
'class="sub cancel right"',
|
||||
true
|
||||
),
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_action_buttons(implode('', $ActionButtons), ['type' => 'form_action'], true),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
|
|
@ -287,22 +287,22 @@ if ($edit_graph === true) {
|
|||
'graph_list' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">'.html_print_image(
|
||||
'images/list.png',
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph list'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
'main' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&tab=main&edit_graph=1&id='.$id_graph.'">'.html_print_image(
|
||||
'images/chart.png',
|
||||
'images/graph@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Main data'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
|
@ -313,18 +313,18 @@ if ($edit_graph === true) {
|
|||
true,
|
||||
[
|
||||
'title' => __('Graph editor'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
],
|
||||
'view' => [
|
||||
'active' => false,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$id_graph.'">'.html_print_image(
|
||||
'images/eye.png',
|
||||
'images/enable.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('View graph'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
|
||||
]
|
||||
).'</a>',
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2005-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2005-2023 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
|
||||
|
@ -61,11 +61,11 @@ if (enterprise_include_once('include/functions_reporting.php') !== ENTERPRISE_NO
|
|||
$buttons['graph_list'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs">'.html_print_image(
|
||||
'images/list.png',
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Graph list'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -222,218 +222,310 @@ $graphs = custom_graphs_get_user($config['id_user'], false, true, $access);
|
|||
$offset = (int) get_parameter('offset');
|
||||
$table_aux = new stdClass();
|
||||
|
||||
$table_aux->width = '100%';
|
||||
$table_aux->class = 'databox filters';
|
||||
$table_aux->cellpadding = 0;
|
||||
$table_aux->cellspacing = 0;
|
||||
$table_aux->width = '100%';
|
||||
if (is_metaconsole() === true) {
|
||||
$table_aux->class = 'databox filters';
|
||||
$table_aux->cellpadding = 0;
|
||||
$table_aux->cellspacing = 0;
|
||||
$table_aux->colspan[0][0] = 4;
|
||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
|
||||
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
).'</b>';
|
||||
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
|
||||
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
|
||||
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
|
||||
method='post'>";
|
||||
$filter .= html_print_table($table_aux, true);
|
||||
$filter .= '</form>';
|
||||
ui_toggle($filter, __('Show Option'));
|
||||
} else {
|
||||
$table_aux->class = 'filter-table-adv';
|
||||
$table_aux->size[0] = '50%';
|
||||
|
||||
$table_aux->colspan[0][0] = 4;
|
||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||
$table_aux->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo',
|
||||
$strict_user
|
||||
)
|
||||
);
|
||||
$table_aux->data[0][1] = html_print_label_input_block(
|
||||
__('Free text for search: ').ui_print_help_tip(__('Search by report name or description, list matches.'), true),
|
||||
html_print_input_text('search', $search, '', 30, '', true)
|
||||
);
|
||||
|
||||
$table_aux->data[0][1] = html_print_select_groups(false, $access, true, 'id_group', $id_group, '', '', '', true, false, true, '', false, '', false, false, 'id_grupo', $strict_user).'<br>';
|
||||
$searchForm .= '<form action="index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group='.$id_group.'&pure='.$pure.'"method="post">';
|
||||
$searchForm .= html_print_table($table_aux, true);
|
||||
|
||||
$table_aux->data[0][2] = '<b>'.__('Free text for search: ').ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
).'</b>';
|
||||
$table_aux->data[0][3] = html_print_input_text('search', $search, '', 30, '', true);
|
||||
$searchForm .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'search_submit',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'icon' => 'search',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$searchForm .= '</form>';
|
||||
|
||||
$table_aux->data[0][6] = html_print_submit_button(__('Search'), 'search_submit', false, 'class="sub upd"', true);
|
||||
ui_toggle(
|
||||
$searchForm,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$filter = "<form class ='' action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
|
||||
method='post'>";
|
||||
$filter .= html_print_table($table_aux, true);
|
||||
$filter .= '</form>';
|
||||
ui_toggle($filter, __('Show Option'));
|
||||
} else {
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/graphs&id_group=$id_group&pure=$pure'
|
||||
method='post'>";
|
||||
html_print_table($table_aux);
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
} else {
|
||||
$group = false;
|
||||
}
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
|
||||
$return_all_group = true;
|
||||
} else {
|
||||
$return_all_group = false;
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$filter = [
|
||||
'name' => $search_name,
|
||||
'order' => 'name',
|
||||
];
|
||||
} else {
|
||||
$filter = ['order' => 'name'];
|
||||
}
|
||||
|
||||
// Fix : group filter was not working
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
$filter['id_group'] = $id_group;
|
||||
} else {
|
||||
$group = false;
|
||||
}
|
||||
|
||||
// Filter normal and metaconsole reports.
|
||||
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||
$filter['metaconsole'] = 1;
|
||||
} else {
|
||||
$filter['metaconsole'] = 0;
|
||||
}
|
||||
|
||||
if ($id_group != null || $search != null) {
|
||||
$graphs = custom_graphs_search($id_group, $search);
|
||||
}
|
||||
|
||||
if (!empty($graphs)) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->align = [];
|
||||
$table->head = [];
|
||||
|
||||
$table->head[0] = __('Graph name');
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('Number of Graphs');
|
||||
$table->head[3] = __('Group');
|
||||
$table->size[0] = '30%';
|
||||
$table->size[2] = '200px';
|
||||
$table->size[3] = '200px';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$op_column = false;
|
||||
if ($report_w || $report_m) {
|
||||
$op_column = true;
|
||||
$table->align[4] = 'left';
|
||||
$table->head[4] = __('Op.');
|
||||
$table->size[4] = '90px';
|
||||
}
|
||||
|
||||
if ($report_w || $report_m) {
|
||||
$table->align[5] = 'left';
|
||||
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size[5] = '20px';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
|
||||
|
||||
foreach ($result_graphs as $graph) {
|
||||
$data = [];
|
||||
|
||||
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
|
||||
$graph['name'],
|
||||
70
|
||||
).'</a>';
|
||||
|
||||
$data[1] = ui_print_truncate_text($graph['description'], 70);
|
||||
|
||||
$data[2] = $graph['graphs_count'];
|
||||
$data[3] = ui_print_group_icon($graph['id_group'], true);
|
||||
|
||||
$data[4] = '';
|
||||
$table->cellclass[][4] = 'table_action_buttons';
|
||||
if (($report_w || $report_m)) {
|
||||
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
|
||||
'images/edit.svg',
|
||||
true,
|
||||
['class' => 'invert_filter main_menu_icon']
|
||||
).'</a>';
|
||||
}
|
||||
|
||||
$data[5] = '';
|
||||
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
|
||||
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
|
||||
return false;">'.html_print_image(
|
||||
'images/delete.svg',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
$data[5] .= html_print_checkbox_extended(
|
||||
'delete_multiple[]',
|
||||
$graph['id_graph'],
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'class' => 'check_delete mrgn_lft_2px check_delete',
|
||||
'form' => 'form_delete',
|
||||
'data-value' => $graph['id_graph'],
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
if (!empty($result_graphs)) {
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div class='right'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
} else {
|
||||
$group = false;
|
||||
|
||||
echo "<div class='right'>";
|
||||
if ($report_w || $report_m) {
|
||||
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
|
||||
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
|
||||
echo '</form>';
|
||||
}
|
||||
} else {
|
||||
if ($report_w || $report_m) {
|
||||
$ActionButtons[] = '<form method="post" class="right mrgn_lft_10px" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
|
||||
$ActionButtons[] = html_print_submit_button(
|
||||
__('Create graph'),
|
||||
'create',
|
||||
false,
|
||||
[
|
||||
'class' => 'sub ok',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
);
|
||||
$ActionButtons[] = '</form>';
|
||||
}
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if ($own_info['is_admin'] || check_acl($config['id_user'], 0, 'RM')) {
|
||||
$return_all_group = true;
|
||||
} else {
|
||||
$return_all_group = false;
|
||||
if (!empty($result_graphs)) {
|
||||
$ActionButtons[] = "<form method='post' id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
$ActionButtons[] = html_print_input_hidden('multiple_delete', 1, true);
|
||||
$ActionButtons[] = html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'class' => 'secondary',
|
||||
'icon' => 'delete',
|
||||
],
|
||||
true
|
||||
);
|
||||
$ActionButtons[] = '</form>';
|
||||
}
|
||||
|
||||
if ($search != '') {
|
||||
$filter = [
|
||||
'name' => $search_name,
|
||||
'order' => 'name',
|
||||
];
|
||||
} else {
|
||||
$filter = ['order' => 'name'];
|
||||
}
|
||||
// FALTA METER EL PRINT TABLE.
|
||||
html_print_table($table);
|
||||
html_print_action_buttons(
|
||||
implode('', $ActionButtons),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
}
|
||||
|
||||
// Fix : group filter was not working
|
||||
// Show only selected groups.
|
||||
if ($id_group > 0) {
|
||||
$group = ["$id_group" => $id_group];
|
||||
$filter['id_group'] = $id_group;
|
||||
} else {
|
||||
$group = false;
|
||||
}
|
||||
echo '</div>';
|
||||
|
||||
// Filter normal and metaconsole reports.
|
||||
if ($config['metaconsole'] == 1 && defined('METACONSOLE')) {
|
||||
$filter['metaconsole'] = 1;
|
||||
} else {
|
||||
$filter['metaconsole'] = 0;
|
||||
}
|
||||
echo '</div>';
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
|
||||
}
|
||||
|
||||
if ($id_group != null || $search != null) {
|
||||
$graphs = custom_graphs_search($id_group, $search);
|
||||
}
|
||||
|
||||
ui_pagination(count($graphs));
|
||||
|
||||
if (!empty($graphs)) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
$table->align = [];
|
||||
$table->head = [];
|
||||
|
||||
$table->head[0] = __('Graph name');
|
||||
$table->head[1] = __('Description');
|
||||
$table->head[2] = __('Number of Graphs');
|
||||
$table->head[3] = __('Group');
|
||||
$table->size[0] = '30%';
|
||||
$table->size[2] = '200px';
|
||||
$table->size[3] = '200px';
|
||||
$table->align[2] = 'left';
|
||||
$table->align[3] = 'left';
|
||||
$op_column = false;
|
||||
if ($report_w || $report_m) {
|
||||
$op_column = true;
|
||||
$table->align[4] = 'left';
|
||||
$table->head[4] = __('Op.');
|
||||
$table->size[4] = '90px';
|
||||
}
|
||||
|
||||
if ($report_w || $report_m) {
|
||||
$table->align[5] = 'left';
|
||||
$table->head[5] = html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size[5] = '20px';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$result_graphs = array_slice($graphs, $offset, $config['block_size']);
|
||||
|
||||
foreach ($result_graphs as $graph) {
|
||||
$data = [];
|
||||
|
||||
$data[0] = '<a href="index.php?sec=reporting&sec2=operation/reporting/graph_viewer&view_graph=1&id='.$graph['id_graph'].'">'.ui_print_truncate_text(
|
||||
$graph['name'],
|
||||
70
|
||||
).'</a>';
|
||||
|
||||
$data[1] = ui_print_truncate_text($graph['description'], 70);
|
||||
|
||||
$data[2] = $graph['graphs_count'];
|
||||
$data[3] = ui_print_group_icon($graph['id_group'], true);
|
||||
|
||||
$data[4] = '';
|
||||
$table->cellclass[][4] = 'action_buttons';
|
||||
if (($report_w || $report_m)) {
|
||||
$data[4] = '<a href="index.php?sec=reporting&sec2=godmode/reporting/graph_builder&edit_graph=1&id='.$graph['id_graph'].'">'.html_print_image(
|
||||
'images/config.png',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
).'</a>';
|
||||
}
|
||||
|
||||
$data[5] = '';
|
||||
if (check_acl_restricted_all($config['id_user'], $graph['id_group'], 'RM')) {
|
||||
$data[4] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/graphs&delete_graph=1&id='.$graph['id_graph'].'" onClick="if (!confirm(\''.__('Are you sure?').'\'))
|
||||
return false;">'.html_print_image(
|
||||
'images/cross.png',
|
||||
true,
|
||||
[
|
||||
'alt' => __('Delete'),
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
).'</a>';
|
||||
|
||||
$data[5] .= html_print_checkbox_extended(
|
||||
'delete_multiple[]',
|
||||
$graph['id_graph'],
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'class="check_delete mrgn_lft_2px"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
||||
if (!empty($result_graphs)) {
|
||||
echo "<form method='post' action='index.php?sec=reporting&sec2=godmode/reporting/graphs'>";
|
||||
html_print_input_hidden('multiple_delete', 1);
|
||||
html_print_table($table);
|
||||
ui_pagination(count($graphs), false, 0, 0, false, 'offset', true, 'pagination-bottom');
|
||||
echo "<div class='right'>";
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
|
||||
echo "<div class='right'>";
|
||||
if ($report_w || $report_m) {
|
||||
echo '<form method="post" class="right" action="index.php?sec=reporting&sec2=godmode/reporting/graph_builder">';
|
||||
html_print_submit_button(__('Create graph'), 'create', false, 'class="sub next mrgn_right_5px"');
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
} else {
|
||||
include_once $config['homedir'].'/general/first_task/custom_graphs.php';
|
||||
}
|
||||
|
||||
?>
|
||||
?>
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
$('[id^=checkbox-delete_multiple]').change(function(){
|
||||
if($(this).parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().addClass('checkselected');
|
||||
$('[id^=checkbox-delete_multiple]').click(function(){
|
||||
if($(this).prop("checked") === false ){
|
||||
$(this).prop("checked", false);
|
||||
} else {
|
||||
$(this).prop("checked", true);
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
$('#checkbox-all_delete').click(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked") === true) {
|
||||
$("[id^=checkbox-delete_multiple]").prop("checked", true);
|
||||
}
|
||||
else{
|
||||
$('[id^=checkbox-delete_multiple]').parent().parent().removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
}
|
||||
$("[id^=checkbox-delete_multiple]").prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
* |___| |___._|__|__|_____||_____|__| |___._| |___| |__|_|__|_______|
|
||||
*
|
||||
* ============================================================================
|
||||
* Copyright (c) 2007-2021 Artica Soluciones Tecnologicas
|
||||
* Copyright (c) 2007-2023 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
|
||||
|
@ -62,18 +62,18 @@ if ($is_metaconsole === false) {
|
|||
|
||||
$pure = (int) get_parameter('pure', 0);
|
||||
$hack_metaconsole = '';
|
||||
if (defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === true) {
|
||||
$hack_metaconsole = '../../';
|
||||
}
|
||||
|
||||
$buttons['visual_console'] = [
|
||||
'active' => true,
|
||||
'text' => '<a href="'.$url_visual_console.'">'.html_print_image(
|
||||
'images/visual_console.png',
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Visual Console List'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -81,11 +81,11 @@ $buttons['visual_console'] = [
|
|||
$buttons['visual_console_favorite'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_visual_console_favorite.'">'.html_print_image(
|
||||
'images/list.png',
|
||||
'images/star@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Visual Favourite Console'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -94,11 +94,11 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
|
|||
$buttons['visual_console_template'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_visual_console_template.'">'.html_print_image(
|
||||
'images/templates.png',
|
||||
'images/groups@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Visual Console Template'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
|
@ -106,42 +106,34 @@ if ($is_enterprise !== ENTERPRISE_NOT_HOOK && $vconsoles_manage) {
|
|||
$buttons['visual_console_template_wizard'] = [
|
||||
'active' => false,
|
||||
'text' => '<a href="'.$url_visual_console_template_wizard.'">'.html_print_image(
|
||||
'images/wand.png',
|
||||
'images/wizard@svg.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Visual Console Template Wizard'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
).'</a>',
|
||||
];
|
||||
}
|
||||
|
||||
if ($is_metaconsole === false) {
|
||||
ui_print_standard_header(
|
||||
__('Visual Console List'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
ui_print_standard_header(
|
||||
__('Visual Console List'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Topology maps'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Visual console'),
|
||||
],
|
||||
]
|
||||
);
|
||||
} else {
|
||||
ui_meta_print_header(
|
||||
__('Visual console').' » '.$visualConsoleName,
|
||||
'',
|
||||
$buttons
|
||||
);
|
||||
}
|
||||
'link' => '',
|
||||
'label' => __('Topology maps'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Visual console'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
$id_layout = (int) get_parameter('id_layout');
|
||||
$copy_layout = (bool) get_parameter('copy_layout');
|
||||
|
@ -336,24 +328,6 @@ if ($ag_group > 0) {
|
|||
}
|
||||
}
|
||||
|
||||
echo "<table class='databox filters bolder mrgn_btn_10px' width='100%'>
|
||||
<tr>";
|
||||
if (!is_metaconsole()) {
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=network&sec2=godmode/reporting/map_builder'>";
|
||||
} else {
|
||||
echo "<form method='post'
|
||||
action='index.php?sec=screen&sec2=screens/screens&action=visualmap'>";
|
||||
}
|
||||
|
||||
echo "<td class='w33p'>";
|
||||
echo __('Search').' ';
|
||||
html_print_input_text('search', $search, '', 50);
|
||||
|
||||
echo '</td>';
|
||||
echo "<td class='w25p'>";
|
||||
|
||||
echo __('Group').' ';
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
|
||||
$return_all_group = false;
|
||||
|
@ -361,18 +335,69 @@ if (!$own_info['is_admin'] && !check_acl($config['id_user'], 0, 'VR')) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
echo '<div class="w250px inline">';
|
||||
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, false, false, true, '', false);
|
||||
echo '</div>';
|
||||
echo "<td class='w25p'>";
|
||||
echo __('Group Recursion').' ';
|
||||
html_print_checkbox('recursion', 1, $recursion, false, false, 'this.form.submit()');
|
||||
$filterTable = new stdClass();
|
||||
$filterTable->id = 'map_buider_filter';
|
||||
$filterTable->class = 'filter-table-adv';
|
||||
$filterTable->width = '100%';
|
||||
$filterTable->size = [];
|
||||
$filterTable->size[0] = '33%';
|
||||
$filterTable->size[1] = '33%';
|
||||
|
||||
echo "</td><td class='w22p'>";
|
||||
echo "<input name='search_visual_console' type='submit' class='sub search' value='".__('Search')."'>";
|
||||
echo '</form>';
|
||||
echo '</td>';
|
||||
echo '</tr></table>';
|
||||
$filterTable->data = [];
|
||||
|
||||
$filterTable->data[0][] = html_print_label_input_block(
|
||||
__('Search'),
|
||||
html_print_input_text('search', $search, '', 50, 255, true)
|
||||
);
|
||||
|
||||
$filterTable->data[0][] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(false, 'AR', $return_all_group, 'ag_group', $ag_group, 'this.form.submit();', '', 0, true, false, true, '', false)
|
||||
);
|
||||
|
||||
$filterTable->data[0][] = html_print_label_input_block(
|
||||
__('Group Recursion'),
|
||||
html_print_checkbox_switch('recursion', 1, $recursion, true, false, 'this.form.submit()')
|
||||
);
|
||||
|
||||
if (is_metaconsole() === false) {
|
||||
$actionUrl = 'index.php?sec=network&sec2=godmode/reporting/map_builder';
|
||||
} else {
|
||||
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap';
|
||||
}
|
||||
|
||||
$searchForm = [];
|
||||
$searchForm[] = '<form method="POST" action="'.$actionUrl.'">';
|
||||
$searchForm[] = html_print_table($filterTable, true);
|
||||
$searchForm[] = html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'search_visual_console',
|
||||
false,
|
||||
[
|
||||
'icon' => 'search',
|
||||
'mode' => 'mini',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$searchForm[] = '</form>';
|
||||
|
||||
ui_toggle(
|
||||
implode('', $searchForm),
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
|
@ -401,7 +426,7 @@ $table->align[4] = 'left';
|
|||
// or has "VR" privileges, otherwise show only maps of user group
|
||||
$filters['offset'] = $offset;
|
||||
$filters['limit'] = $pagination;
|
||||
if (!empty($search)) {
|
||||
if (empty($search) === false) {
|
||||
$filters['name'] = io_safe_input($search);
|
||||
}
|
||||
|
||||
|
@ -410,7 +435,7 @@ if ($ag_group) {
|
|||
}
|
||||
|
||||
$own_info = get_user_info($config['id_user']);
|
||||
if (!defined('METACONSOLE')) {
|
||||
if (is_metaconsole() === false) {
|
||||
$url = 'index.php?sec=network&sec2=godmode/reporting/map_builder&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination;
|
||||
} else {
|
||||
$url = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&recursion='.$recursion.'&ag_group='.$ag_group.'&search='.$search.'&pagination='.$pagination;
|
||||
|
@ -441,7 +466,7 @@ if ($own_info['is_admin'] || $vconsoles_read) {
|
|||
$total_maps = count($count_maps);
|
||||
}
|
||||
|
||||
if (!$maps && !is_metaconsole()) {
|
||||
if (!$maps && is_metaconsole() === false) {
|
||||
$total = count(visual_map_get_user_layouts($config['id_user'], false, false, false));
|
||||
if (!$total) {
|
||||
include_once $config['homedir'].'/general/first_task/map_builder.php';
|
||||
|
@ -453,7 +478,7 @@ if (!$maps && !is_metaconsole()) {
|
|||
]
|
||||
);
|
||||
}
|
||||
} else if (!$maps && is_metaconsole()) {
|
||||
} else if (!$maps && is_metaconsole() === true) {
|
||||
$total = count(visual_map_get_user_layouts($config['id_user'], false, false, false));
|
||||
if (!$total) {
|
||||
ui_print_info_message(
|
||||
|
@ -471,25 +496,24 @@ if (!$maps && !is_metaconsole()) {
|
|||
);
|
||||
}
|
||||
} else {
|
||||
ui_pagination($total_maps, $url, $offset, $pagination);
|
||||
foreach ($maps as $map) {
|
||||
// ACL for the visual console permission
|
||||
// ACL for the visual console permission.
|
||||
$vconsole_write = false;
|
||||
$vconsole_manage = false;
|
||||
if (isset($map['vw'])) {
|
||||
if (isset($map['vw']) === true) {
|
||||
$vconsole_write = true;
|
||||
}
|
||||
|
||||
if (isset($map['vm'])) {
|
||||
if (isset($map['vm']) === true) {
|
||||
$vconsole_manage = true;
|
||||
}
|
||||
|
||||
$data = [];
|
||||
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
$data[0] = '<a href="index.php?sec=network&sec2=operation/visual_console/render_view&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
} else {
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_visualmap='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
$data[0] = '<a href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id='.$map['id'].'&refr='.$refr.'">'.$map['name'].'</a>';
|
||||
}
|
||||
|
||||
$data[1] = ui_print_group_icon($map['id_group'], true);
|
||||
|
@ -499,31 +523,31 @@ if (!$maps && !is_metaconsole()) {
|
|||
$vconsoles_manage_action_btn = check_acl_restricted_all($config['id_user'], $map['id_group'], 'VM');
|
||||
|
||||
if ($vconsoles_write_action_btn || $vconsoles_manage_action_btn) {
|
||||
if (!is_metaconsole()) {
|
||||
if (is_metaconsole() === false) {
|
||||
$table->cellclass[] = [
|
||||
3 => 'action_buttons',
|
||||
4 => 'action_buttons',
|
||||
3 => 'table_action_buttons',
|
||||
4 => 'table_action_buttons',
|
||||
];
|
||||
$data[3] = '<a class="copy_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&copy_layout=1">'.html_print_image(
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=network&sec2=godmode/reporting/map_builder&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
} else {
|
||||
$data[3] = '<a class="copy_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&copy_layout=1">'.html_print_image(
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
$data[4] = '<a class="delete_visualmap" href="index.php?sec=screen&sec2=screens/screens&action=visualmap&pure='.$pure.'&id_layout='.$map['id'].'&delete_layout=1" onclick="javascript: if (!confirm(\''.__('Are you sure?').'\n'.__('Delete').': '.$map['name'].'\')) return false;">'.html_print_image(
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
true,
|
||||
['class' => 'invert_filter']
|
||||
['class' => 'main_menu_icon invert_filter']
|
||||
).'</a>';
|
||||
}
|
||||
} else {
|
||||
|
@ -535,34 +559,31 @@ if (!$maps && !is_metaconsole()) {
|
|||
}
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination($total_maps, $url, $offset, $pagination, false, 'offset', true, 'pagination-bottom');
|
||||
$tablePagination = ui_pagination($total_maps, $url, $offset, $pagination, true, 'offset', false);
|
||||
}
|
||||
|
||||
if ($maps) {
|
||||
if (!is_metaconsole()) {
|
||||
echo '<div class="action-buttons w100p right_align">';
|
||||
} else {
|
||||
echo '<div class="w100p right right_align mrgn_btn_20px">';
|
||||
}
|
||||
}
|
||||
|
||||
if ($maps || defined('METACONSOLE')) {
|
||||
if ($maps || is_metaconsole() === true) {
|
||||
if ($vconsoles_write || $vconsoles_manage) {
|
||||
if (!defined('METACONSOLE')) {
|
||||
echo '<form action="index.php?sec=network&sec2=godmode/reporting/visual_console_builder" method="post">';
|
||||
if (is_metaconsole() === false) {
|
||||
$actionUrl = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder';
|
||||
} else {
|
||||
echo '<form action="index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure.'" method="post">';
|
||||
$actionUrl = 'index.php?sec=screen&sec2=screens/screens&action=visualmap&action2=new&operation=new_visualmap&tab=data&pure='.$pure;
|
||||
}
|
||||
|
||||
echo '<form action="'.$actionUrl.'" method="post">';
|
||||
html_print_input_hidden('edit_layout', 1);
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
'class="sub next"'
|
||||
|
||||
html_print_action_buttons(
|
||||
html_print_submit_button(
|
||||
__('Create'),
|
||||
'',
|
||||
false,
|
||||
[ 'icon' => 'next'],
|
||||
true
|
||||
),
|
||||
[ 'right_content' => $tablePagination ]
|
||||
);
|
||||
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
}
|
||||
|
|
|
@ -281,7 +281,7 @@ switch ($action) {
|
|||
$server_name = $item['server_name'];
|
||||
|
||||
// Metaconsole db connection.
|
||||
if ($meta && empty($server_name) === false) {
|
||||
if ($meta && empty($server_name) === false && $server_name !== 'all') {
|
||||
$connection = metaconsole_get_connection($server_name);
|
||||
$server_id = $connection['id'];
|
||||
if (metaconsole_load_external_db($connection) != NOERR) {
|
||||
|
@ -1040,7 +1040,7 @@ html_print_input_hidden('id_item', $idItem);
|
|||
$class = 'databox filters';
|
||||
|
||||
?>
|
||||
<table class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<table id="table_item_edit_reporting" class="<?php echo $class; ?>" id="" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<?php
|
||||
if (defined('METACONSOLE')) {
|
||||
echo '<thead>
|
||||
|
@ -1100,7 +1100,7 @@ $class = 'databox filters';
|
|||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
''
|
||||
);
|
||||
} else {
|
||||
html_print_input_text(
|
||||
|
@ -1113,7 +1113,7 @@ $class = 'databox filters';
|
|||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
''
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
@ -1160,7 +1160,7 @@ $class = 'databox filters';
|
|||
<td class="bolder"><?php echo __('Description'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
echo html_print_textarea('description', 3, 25, $description);
|
||||
echo html_print_textarea('description', 2, 80, $description, 'style="padding-right: 0px !important;"');
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -1233,6 +1233,29 @@ $class = 'databox filters';
|
|||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$servers_all_opt = array_merge(['all' => 'All nodes'], $servers);
|
||||
if ($meta) {
|
||||
?>
|
||||
<tr id="row_servers_all_opt" class="datos">
|
||||
<td class="bolder"><?php echo __('Server'); ?></td>
|
||||
<td >
|
||||
<?php
|
||||
html_print_select(
|
||||
$servers_all_opt,
|
||||
'combo_server',
|
||||
$server_name,
|
||||
'',
|
||||
$nothing,
|
||||
$nothing_value
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
if ($meta) {
|
||||
?>
|
||||
|
@ -1276,13 +1299,13 @@ $class = 'databox filters';
|
|||
'label',
|
||||
$label,
|
||||
'',
|
||||
50,
|
||||
80,
|
||||
255,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'fullwidth'
|
||||
''
|
||||
);
|
||||
?>
|
||||
</td>
|
||||
|
@ -2458,7 +2481,7 @@ $class = 'databox filters';
|
|||
</tr>
|
||||
<tr id="row_order_uptodown" class="datos">
|
||||
<td class="bolder"><?php echo __('Order'); ?></td>
|
||||
<td>
|
||||
<td class="flex-row-center">
|
||||
<?php
|
||||
echo __('Ascending');
|
||||
html_print_radio_button(
|
||||
|
@ -2517,7 +2540,7 @@ $class = 'databox filters';
|
|||
|
||||
<tr id="row_max_min_avg" class="datos">
|
||||
<td class="bolder"><?php echo __('Display'); ?></td>
|
||||
<td>
|
||||
<td class="flex-row-center">
|
||||
<?php
|
||||
echo __('Max');
|
||||
html_print_radio_button(
|
||||
|
@ -3196,7 +3219,7 @@ $class = 'databox filters';
|
|||
echo __('Priority mode');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<td class="flex-row-center">
|
||||
<?php
|
||||
echo __('Priority ok mode');
|
||||
echo '<span class="mrgn_lft_5px"></span>';
|
||||
|
@ -3249,7 +3272,7 @@ $class = 'databox filters';
|
|||
echo __('Failover type');
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<td class="flex-row-center">
|
||||
<?php
|
||||
echo __('Failover normal');
|
||||
echo '<span class="mrgn_lft_5px"></span>';
|
||||
|
@ -3358,7 +3381,7 @@ $class = 'databox filters';
|
|||
</tr>
|
||||
|
||||
<tr id="row_visual_format" class="datos advanced_elements">
|
||||
<td class="bolder" colspan="2">
|
||||
<td class="bolder flex-row-center" colspan="2">
|
||||
<?php
|
||||
if ($visual_format == 1) {
|
||||
$visual_format_table = true;
|
||||
|
@ -3920,21 +3943,25 @@ print_SLA_list('100%', $action, $idItem);
|
|||
print_General_list('100%', $action, $idItem, $type);
|
||||
echo '<div class="action-buttons w100p" >';
|
||||
if ($action == 'new') {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Create item'),
|
||||
'create_item',
|
||||
false,
|
||||
'class="sub wand"'
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Update item'),
|
||||
'edit_item',
|
||||
false,
|
||||
'class="sub upd"'
|
||||
['icon' => 'next'],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
|
||||
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
|
||||
|
@ -3980,7 +4007,7 @@ function print_SLA_list($width, $action, $idItem=null)
|
|||
$idItem
|
||||
);
|
||||
?>
|
||||
<table class="databox data" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<table class="info_table" id="sla_list" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="header sla_list_agent_col" scope="col">
|
||||
|
@ -4496,7 +4523,7 @@ function print_General_list($width, $action, $idItem=null, $type='general')
|
|||
|
||||
include_once $config['homedir'].'/include/functions_html.php';
|
||||
?>
|
||||
<table class="databox data" id="general_list" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<table class="info_table" id="general_list" border="0" cellpadding="4" cellspacing="4" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php
|
||||
|
@ -5130,7 +5157,7 @@ $(document).ready (function () {
|
|||
|
||||
$('#checkbox-fullscale').trigger('change');
|
||||
|
||||
$("#submit-create_item").click(function () {
|
||||
$("#button-create_item").click(function () {
|
||||
var type = $('#type').val();
|
||||
var name = $('#text-name').val();
|
||||
|
||||
|
@ -6334,6 +6361,7 @@ function chooseType() {
|
|||
$("#row_alert_templates").hide();
|
||||
$("#row_alert_actions").hide();
|
||||
$("#row_servers").hide();
|
||||
$("#row_servers_all_opt").hide();
|
||||
$("#row_multiple_servers").hide();
|
||||
$("#row_sort").hide();
|
||||
$("#row_date").hide();
|
||||
|
@ -6648,7 +6676,7 @@ function chooseType() {
|
|||
$("#row_header").show();
|
||||
$("#row_custom").show();
|
||||
$("#row_custom_example").show();
|
||||
$("#row_servers").show();
|
||||
$("#row_servers_all_opt").show();
|
||||
$("#row_historical_db_check").show();
|
||||
break;
|
||||
|
||||
|
@ -7398,4 +7426,8 @@ function dialog_message(message_id) {
|
|||
});
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
$('[id^=period], #combo_graph_options, #combo_sla_sort_options').next().css('z-index', 0);
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
|
@ -204,22 +204,84 @@ $urlFilter = '&agent_filter='.$agentFilter.'&module_filter='.$moduleFilter.'&typ
|
|||
if (!defined('METACONSOLE')) {
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox filters';
|
||||
$table->data[0][0] = __('Agents');
|
||||
$table->data[0][0] .= html_print_select($agents, 'agent_filter', $agentFilter, '', __('All'), 0, true);
|
||||
$table->data[0][1] = __('Modules');
|
||||
$table->data[0][1] .= html_print_select($modules, 'module_filter', $moduleFilter, '', __('All'), 0, true);
|
||||
$table->data[0][2] = __('Type');
|
||||
$table->data[0][2] .= html_print_select($types, 'type_filter', $typeFilter, '', __('All'), 0, true);
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->size[0] = '33%';
|
||||
$table->size[1] = '33%';
|
||||
$table->size[1] = '33%';
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Agents'),
|
||||
html_print_select(
|
||||
$agents,
|
||||
'agent_filter',
|
||||
$agentFilter,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Modules'),
|
||||
html_print_select(
|
||||
$modules,
|
||||
'module_filter',
|
||||
$moduleFilter,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$table->data[0][2] = html_print_label_input_block(
|
||||
__('Type'),
|
||||
html_print_select(
|
||||
$types,
|
||||
'type_filter',
|
||||
$typeFilter,
|
||||
'',
|
||||
__('All'),
|
||||
0,
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'width:100%'
|
||||
)
|
||||
);
|
||||
$form = '<form method="post" action ="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=filter&id_report='.$idReport.'">';
|
||||
$form .= html_print_table($table, true);
|
||||
$form .= '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
$form .= html_print_submit_button(__('Filter'), 'filter', false, 'class="sub upd"', true);
|
||||
$form .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'filter',
|
||||
false,
|
||||
[
|
||||
'class' => 'mini',
|
||||
'icon' => 'search',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$form .= html_print_input_hidden('action', 'filter', true);
|
||||
$form .= '</div>';
|
||||
$form .= '</form>';
|
||||
|
||||
ui_toggle($form, __('Filters'));
|
||||
ui_toggle($form, __('Filters'), '', '', false);
|
||||
} else {
|
||||
$table = new stdClass();
|
||||
$table->width = '96%';
|
||||
|
@ -349,7 +411,7 @@ $table->style[0] = 'text-align: right;';
|
|||
|
||||
|
||||
if ($items) {
|
||||
$table->width = '98%';
|
||||
$table->width = '100%';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->width = '100%';
|
||||
$table->class = 'databox data';
|
||||
|
@ -616,17 +678,19 @@ foreach ($items as $item) {
|
|||
$row[6] = '';
|
||||
|
||||
if (check_acl($config['id_user'], $item['id_group'], 'RM')) {
|
||||
$table->cellclass[][6] = 'action_buttons';
|
||||
$table->cellclass[][6] = 'table_action_buttons';
|
||||
$row[6] .= '<a href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=item_editor&action=edit&id_report='.$idReport.'&id_item='.$item['id_rc'].'">'.html_print_image(
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'invert_filter',
|
||||
'title' => __('Edit'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
'form' => 'form_delete',
|
||||
'data-value' => $item['id_rc'],
|
||||
]
|
||||
).'</a>';
|
||||
$row[6] .= ' ';
|
||||
$row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report='.$idReport.'&id_item='.$item['id_rc'].$urlFilter.'">'.html_print_image('images/cross.png', true, ['title' => __('Delete'), 'class' => 'invert_filter']).'</a>';
|
||||
$row[6] .= '<a onClick="if (!confirm (\'Are you sure?\')) return false;" href="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete&id_report='.$idReport.'&id_item='.$item['id_rc'].$urlFilter.'">'.html_print_image('images/delete.svg', true, ['title' => __('Delete'), 'class' => 'invert_filter main_menu_icon']).'</a>';
|
||||
$row[6] .= ' ';
|
||||
$row[6] .= html_print_checkbox_extended(
|
||||
'delete_multiple[]',
|
||||
|
@ -682,128 +746,260 @@ if (defined('METACONSOLE')) {
|
|||
'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=edit&id_report='.$idReport.$urlFilter
|
||||
);
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
|
||||
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
|
||||
echo "<div class='pdd_b_20px right; w100p'>";
|
||||
echo "<form id='form_delete' action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items&id_report=".$idReport."'
|
||||
method='post' onSubmit='return added_ids_deleted_items_to_hidden_input();'>";
|
||||
|
||||
html_print_input_hidden('ids_items_to_delete', '');
|
||||
html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete right mrgn_btn_15px"');
|
||||
echo '</div>';
|
||||
echo '<div class="action-buttons w100p">';
|
||||
html_print_input_hidden('ids_items_to_delete', '');
|
||||
$ActionButtons[] = html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'class' => 'sub ok',
|
||||
'icon' => 'next',
|
||||
],
|
||||
true
|
||||
);
|
||||
html_print_action_buttons(
|
||||
implode('', $ActionButtons),
|
||||
['type' => 'form_action']
|
||||
);
|
||||
echo '</div>';
|
||||
echo '</form>';
|
||||
}
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->colspan[0][0] = 3;
|
||||
$table->size = [];
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->colspan[0][0] = 3;
|
||||
$table->size = [];
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
$table->class = 'databox data';
|
||||
$table->head[0] = __('Sort items');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
|
||||
$table->data[1][0] = __('Sort selected items from position: ');
|
||||
$table->data[1][1] = html_print_select_style(
|
||||
[
|
||||
'before' => __('Move before to'),
|
||||
'after' => __('Move after to'),
|
||||
],
|
||||
'move_to',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text_extended(
|
||||
'position_to_sort',
|
||||
1,
|
||||
'text-position_to_sort',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_sort');",
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
|
||||
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."'
|
||||
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
} else {
|
||||
$table->data[0][0] = '<b>'.__('Sort items').'</b>';
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Sort selected items from position: '),
|
||||
html_print_select_style(
|
||||
[
|
||||
'before' => __('Move before to'),
|
||||
'after' => __('Move after to'),
|
||||
],
|
||||
'move_to',
|
||||
'',
|
||||
'width:100%',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true,
|
||||
)
|
||||
);
|
||||
$table->data[1][2] = html_print_label_input_block(
|
||||
__('Position'),
|
||||
html_print_input_text_extended(
|
||||
'position_to_sort',
|
||||
1,
|
||||
'text-position_to_sort',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_sort');",
|
||||
'',
|
||||
true
|
||||
).html_print_input_hidden('ids_items_to_sort', '', true)
|
||||
);
|
||||
|
||||
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."' method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||
$form .= html_print_table($table, true);
|
||||
$form .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Sort'),
|
||||
'sort_submit',
|
||||
false,
|
||||
[
|
||||
'class' => 'mini',
|
||||
'icon' => 'search',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$form .= html_print_input_hidden('action', 'filter', true);
|
||||
$form .= '</form>';
|
||||
|
||||
ui_toggle($form, __('Sort items'), '', '', false);
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Sort selected items from position: ');
|
||||
$table->data[1][1] = html_print_select_style(
|
||||
[
|
||||
'before' => __('Move before to'),
|
||||
'after' => __('Move after to'),
|
||||
],
|
||||
'move_to',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text_extended(
|
||||
'position_to_sort',
|
||||
1,
|
||||
'text-position_to_sort',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_sort');",
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_sort', '', true);
|
||||
$table->data[1][3] = html_print_submit_button(__('Sort'), 'sort_submit', false, 'class="sub upd"', true);
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=sort_items&id_report=".$idReport."'
|
||||
method='post' onsubmit='return added_ids_sorted_items_to_hidden_input();'>";
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->colspan[0][0] = 3;
|
||||
$table->size = [];
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->colspan[0][0] = 3;
|
||||
$table->size = [];
|
||||
$table->size[0] = '25%';
|
||||
$table->size[1] = '25%';
|
||||
$table->size[2] = '25%';
|
||||
$table->size[3] = '25%';
|
||||
$table->class = 'databox data';
|
||||
$table->head[0] = __('Delete items');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
|
||||
$table->data[1][0] = __('Delete selected items from position: ');
|
||||
$table->data[1][1] = html_print_select_style(
|
||||
[
|
||||
'above' => __('Delete above to'),
|
||||
'below' => __('Delete below to'),
|
||||
],
|
||||
'delete_m',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text_extended(
|
||||
'position_to_delete',
|
||||
1,
|
||||
'text-position_to_delete',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_delete');",
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
|
||||
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
|
||||
method='post'>";
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
} else {
|
||||
$table->data[0][0] = '<b>'.__('Delete items').'</b>';
|
||||
$table->class = 'filter-table-adv';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Delete selected items from position: '),
|
||||
html_print_select_style(
|
||||
[
|
||||
'above' => __('Delete above to'),
|
||||
'below' => __('Delete below to'),
|
||||
],
|
||||
'delete_m',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Poisition'),
|
||||
html_print_input_text_extended(
|
||||
'position_to_delete',
|
||||
1,
|
||||
'text-position_to_delete',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_delete');",
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$form = "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
|
||||
method='post'>";
|
||||
$form .= html_print_input_hidden('ids_items_to_delete', '', true);
|
||||
$form .= html_print_table($table, true);
|
||||
$form .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_submit',
|
||||
false,
|
||||
[
|
||||
'class' => 'mini',
|
||||
'icon' => 'delete',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$form .= '</form>';
|
||||
ui_toggle($form, __('Delete items'), '', '', false);
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Delete selected items from position: ');
|
||||
$table->data[1][1] = html_print_select_style(
|
||||
[
|
||||
'above' => __('Delete above to'),
|
||||
'below' => __('Delete below to'),
|
||||
],
|
||||
'delete_m',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
$table->data[1][2] = html_print_input_text_extended(
|
||||
'position_to_delete',
|
||||
1,
|
||||
'text-position_to_delete',
|
||||
'',
|
||||
3,
|
||||
10,
|
||||
false,
|
||||
"only_numbers('position_to_delete');",
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data[1][2] .= html_print_input_hidden('ids_items_to_delete', '', true);
|
||||
$table->data[1][3] = html_print_submit_button(__('Delete'), 'delete_submit', false, 'class="sub upd"', true);
|
||||
|
||||
echo "<form action='index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=list_items&action=delete_items_pos&id_report=".$idReport."'
|
||||
method='post'>";
|
||||
html_print_table($table);
|
||||
echo '</form>';
|
||||
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
|
||||
function check_all_checkboxes() {
|
||||
if ($("input[name=all_delete]").prop("checked")) {
|
||||
$(".check_delete").prop("checked", true);
|
||||
$("[name^='delete_multiple']").prop("checked", true);
|
||||
}
|
||||
else {
|
||||
$(".check_delete").prop("checked", false);
|
||||
$("[name^='delete_multiple']").prop("checked", false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -830,12 +1026,14 @@ function added_ids_sorted_items_to_hidden_input() {
|
|||
var ids = '';
|
||||
var first = true;
|
||||
|
||||
$("input.selected_check:checked").each(function(i, val) {
|
||||
if (!first)
|
||||
ids = ids + '|';
|
||||
first = false;
|
||||
|
||||
ids = ids + $(val).val();
|
||||
$("[name^='sorted_items']").each(function(i, val) {
|
||||
if($(this).prop('checked')){
|
||||
if (!first)
|
||||
ids = ids + '|';
|
||||
first = false;
|
||||
|
||||
ids = ids + $(val).val();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='ids_items_to_sort']").val(ids);
|
||||
|
@ -877,29 +1075,29 @@ function message_check_delete_items() {
|
|||
}
|
||||
|
||||
function added_ids_deleted_items_to_hidden_input() {
|
||||
var success = message_check_delete_items();
|
||||
var success = message_check_delete_items();
|
||||
|
||||
if(success === false){
|
||||
$(".check_delete").prop("checked", false);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(success === false){
|
||||
$(".check_delete").prop("checked", false);
|
||||
return false;
|
||||
}
|
||||
|
||||
var ids = '';
|
||||
var first = true;
|
||||
|
||||
$("input.check_delete:checked").each(function(i, val) {
|
||||
if (!first)
|
||||
ids = ids + ',';
|
||||
first = false;
|
||||
|
||||
ids = ids + $(val).val();
|
||||
|
||||
$("[name^='delete_multiple']").each(function(i, val) {
|
||||
if($(this).prop('checked')){
|
||||
if (!first)
|
||||
ids = ids + ',';
|
||||
first = false;
|
||||
ids = ids + $(val).val();
|
||||
}
|
||||
});
|
||||
|
||||
$("input[name='ids_items_to_delete']").val(ids);
|
||||
|
||||
$("#hidden-ids_items_to_delete").val(ids);
|
||||
|
||||
if (ids == '') {
|
||||
alert("<?php echo __('Please select any item to delete'); ?>");
|
||||
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -41,22 +41,22 @@ $groups = users_get_groups();
|
|||
switch ($action) {
|
||||
default:
|
||||
case 'new':
|
||||
$actionButtonHtml = html_print_submit_button(
|
||||
__('Save'),
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Create'),
|
||||
'add',
|
||||
false,
|
||||
'class="sub wand"',
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
);
|
||||
$hiddenFieldAction = 'save';
|
||||
break;
|
||||
case 'update':
|
||||
case 'edit':
|
||||
$actionButtonHtml = html_print_submit_button(
|
||||
$actionButtons = html_print_submit_button(
|
||||
__('Update'),
|
||||
'edit',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
);
|
||||
$hiddenFieldAction = 'update';
|
||||
|
@ -66,39 +66,26 @@ switch ($action) {
|
|||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
$table->id = 'add_alert_table';
|
||||
$table->class = 'databox filters';
|
||||
$table->head = [];
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$table->class = 'databox filters';
|
||||
$table->head[0] = __('Main data');
|
||||
$table->head_colspan[0] = 4;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
}
|
||||
|
||||
$table->data = [];
|
||||
$table->size = [];
|
||||
$table->size = [];
|
||||
$table->size[0] = '15%';
|
||||
$table->size[1] = '90%';
|
||||
if (is_metaconsole() === false) {
|
||||
$table->size[0] = '15%';
|
||||
$table->size[1] = '90%';
|
||||
$table->style[0] = 'font-weight: bold; vertical-align: top;';
|
||||
} else {
|
||||
$table->style[0] = 'font-weight: bold;';
|
||||
$table->class = 'filter-table-adv databox';
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
$table->size[2] = '50%';
|
||||
$table->size[3] = '50%';
|
||||
}
|
||||
|
||||
$table->data['name'][0] = __('Name');
|
||||
$table->data['name'][1] = html_print_input_text(
|
||||
'name',
|
||||
$reportName,
|
||||
__('Name'),
|
||||
80,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data['group'][0] = __('Group');
|
||||
$write_groups = users_get_groups_for_select(
|
||||
false,
|
||||
'AR',
|
||||
|
@ -108,6 +95,36 @@ $write_groups = users_get_groups_for_select(
|
|||
'id_grupo'
|
||||
);
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['name'][0] = __('Name');
|
||||
$table->data['name'][1] = html_print_input_text(
|
||||
'name',
|
||||
$reportName,
|
||||
__('Name'),
|
||||
80,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data['group'][0] = __('Group');
|
||||
} else {
|
||||
$table->data[0][0] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$reportName,
|
||||
__('Name'),
|
||||
false,
|
||||
100,
|
||||
true,
|
||||
false,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// If the report group is not among the
|
||||
// RW groups (special permission) we add it.
|
||||
if (isset($write_groups[$idGroupReport]) === false && $idGroupReport) {
|
||||
|
@ -120,23 +137,44 @@ if (users_can_manage_group_all('RW') === true) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table->data['group'][1] = '<div class="w290px inline">';
|
||||
$table->data['group'][1] .= html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'AR',
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'name' => 'id_group',
|
||||
'selected' => $idGroupReport,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
]
|
||||
);
|
||||
$table->data['group'][1] .= '</div>';
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['group'][1] = '<div class="w290px inline">';
|
||||
$table->data['group'][1] .= html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'AR',
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'name' => 'id_group',
|
||||
'selected' => $idGroupReport,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
]
|
||||
);
|
||||
$table->data['group'][1] .= '</div>';
|
||||
} else {
|
||||
$table->data[0][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'AR',
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'name' => 'id_group',
|
||||
'selected' => $idGroupReport,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
]
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if ($report_id_user == $config['id_user']
|
||||
|| is_user_admin($config['id_user'])
|
||||
|
@ -147,41 +185,81 @@ if ($report_id_user == $config['id_user']
|
|||
'group_edit' => __('The next group can edit the report'),
|
||||
'user_edit' => __('Only the user and admin user can edit the report'),
|
||||
];
|
||||
$table->data['access'][0] = __('Write Access');
|
||||
$table->data['access'][0] .= ui_print_help_tip(
|
||||
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
|
||||
true
|
||||
);
|
||||
$table->data['access'][1] = html_print_select(
|
||||
$type_access,
|
||||
'type_access',
|
||||
$type_access_selected,
|
||||
'change_type_access(this)',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['access'][0] = __('Write Access');
|
||||
$table->data['access'][0] .= ui_print_help_tip(
|
||||
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
|
||||
true
|
||||
);
|
||||
$table->data['access'][1] = html_print_select(
|
||||
$type_access,
|
||||
'type_access',
|
||||
$type_access_selected,
|
||||
'change_type_access(this)',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
);
|
||||
|
||||
$style = 'display: none;';
|
||||
if ($type_access_selected == 'group_edit') {
|
||||
$style = '';
|
||||
$class = ' invisible_important ';
|
||||
if ($type_access_selected == 'group_edit') {
|
||||
$class = '';
|
||||
}
|
||||
|
||||
$table->data['access'][1] .= '<span class="access_subform'.$class.'" id="group_edit">';
|
||||
$table->data['access'][1] .= '<div class="w290px inline">';
|
||||
$table->data['access'][1] .= html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
false,
|
||||
'id_group_edit',
|
||||
$id_group_edit,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['access'][1] .= '</div>';
|
||||
$table->data['access'][1] .= '</span>';
|
||||
} else {
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Write Access').ui_print_help_tip(
|
||||
__('For example, you want a report that the people of "All" groups can see but you want to edit only for you or your group.'),
|
||||
true
|
||||
),
|
||||
html_print_select(
|
||||
$type_access,
|
||||
'type_access',
|
||||
$type_access_selected,
|
||||
'change_type_access(this)',
|
||||
'',
|
||||
0,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$options['div_class'] = 'invisible_important';
|
||||
$options['div_id'] = 'group_edit';
|
||||
if ($type_access_selected == 'group_edit') {
|
||||
$options['div_class'] = '';
|
||||
}
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
false,
|
||||
'id_group_edit',
|
||||
$id_group_edit,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
),
|
||||
$options
|
||||
);
|
||||
}
|
||||
|
||||
$table->data['access'][1] .= '<span style="'.$style.'" class="access_subform" id="group_edit">';
|
||||
$table->data['access'][1] .= '<div class="w290px inline">';
|
||||
$table->data['access'][1] .= html_print_select_groups(
|
||||
false,
|
||||
'RW',
|
||||
false,
|
||||
'id_group_edit',
|
||||
$id_group_edit,
|
||||
false,
|
||||
'',
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table->data['access'][1] .= '</div>';
|
||||
$table->data['access'][1] .= '</span>';
|
||||
}
|
||||
|
||||
if ($enterpriseEnable) {
|
||||
|
@ -190,72 +268,106 @@ if ($enterpriseEnable) {
|
|||
$non_interactive_check = $non_interactive;
|
||||
}
|
||||
|
||||
$table->data['interactive_report'][0] = __('Non interactive report');
|
||||
$table->data['interactive_report'][1] = __('Yes');
|
||||
$table->data['interactive_report'][1] .= ' ';
|
||||
$table->data['interactive_report'][1] .= html_print_radio_button(
|
||||
'non_interactive',
|
||||
1,
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['interactive_report'][0] = __('Non interactive report');
|
||||
$table->data['interactive_report'][1] .= html_print_checkbox_switch(
|
||||
'non_interactive',
|
||||
1,
|
||||
$non_interactive_check,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[2][0] = html_print_label_input_block(
|
||||
__('Non interactive report'),
|
||||
html_print_checkbox_switch(
|
||||
'non_interactive',
|
||||
1,
|
||||
$non_interactive_check,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['description'][0] = __('Description');
|
||||
$table->data['description'][1] = html_print_textarea(
|
||||
'description',
|
||||
2,
|
||||
80,
|
||||
$description,
|
||||
'',
|
||||
$non_interactive_check,
|
||||
true
|
||||
);
|
||||
$table->data['interactive_report'][1] .= ' ';
|
||||
$table->data['interactive_report'][1] .= __('No');
|
||||
$table->data['interactive_report'][1] .= ' ';
|
||||
$table->data['interactive_report'][1] .= html_print_radio_button(
|
||||
'non_interactive',
|
||||
0,
|
||||
'',
|
||||
$non_interactive_check,
|
||||
true
|
||||
} else {
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Description'),
|
||||
html_print_textarea(
|
||||
'description',
|
||||
2,
|
||||
1,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
$table->data['description'][0] = __('Description');
|
||||
$table->data['description'][1] = html_print_textarea(
|
||||
'description',
|
||||
5,
|
||||
15,
|
||||
$description,
|
||||
'',
|
||||
true
|
||||
);
|
||||
|
||||
if (enterprise_installed() === true) {
|
||||
$table->data['cover'][0] = __('Generate cover page in PDF render');
|
||||
$table->data['cover'][1] = html_print_checkbox_switch(
|
||||
'cover_page_render',
|
||||
1,
|
||||
$cover_page_render,
|
||||
true
|
||||
);
|
||||
if (is_metaconsole() === true) {
|
||||
$table->data['cover'][0] = __('Generate cover page in PDF render');
|
||||
$table->data['cover'][1] = html_print_checkbox_switch(
|
||||
'cover_page_render',
|
||||
1,
|
||||
$cover_page_render,
|
||||
true
|
||||
);
|
||||
|
||||
$table->data['index'][0] = __('Generate index in PDF render');
|
||||
$table->data['index'][1] = html_print_checkbox_switch(
|
||||
'index_render',
|
||||
1,
|
||||
$index_render,
|
||||
true
|
||||
);
|
||||
$table->data['index'][0] = __('Generate index in PDF render');
|
||||
$table->data['index'][1] = html_print_checkbox_switch(
|
||||
'index_render',
|
||||
1,
|
||||
$index_render,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[3][0] = html_print_label_input_block(
|
||||
__('Generate cover page in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'cover_page_render',
|
||||
1,
|
||||
$cover_page_render,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[3][1] = html_print_label_input_block(
|
||||
__('Generate index in PDF render'),
|
||||
html_print_checkbox_switch(
|
||||
'index_render',
|
||||
1,
|
||||
$index_render,
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
echo '<form class="" method="post">';
|
||||
html_print_table($table);
|
||||
|
||||
echo '<div class="action-buttons" style="width: '.$table->width.'">';
|
||||
echo $actionButtonHtml;
|
||||
html_print_action_buttons($actionButtons, ['type' => 'form_action']);
|
||||
html_print_input_hidden('action', $hiddenFieldAction);
|
||||
html_print_input_hidden('id_report', $idReport);
|
||||
echo '</div></form>';
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function change_type_access(select_item) {
|
||||
$(".access_subform").hide();
|
||||
if ($(select_item).val() == "group_edit") {
|
||||
$("#group_edit").show()
|
||||
$("#group_edit").removeClass('invisible_important');
|
||||
} else {
|
||||
$("#group_edit").hide()
|
||||
$("#group_edit").addClass('invisible_important');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -46,33 +46,14 @@ function dialog_message(message_id) {
|
|||
});
|
||||
});
|
||||
|
||||
$('[id^=checkbox-massive_report_check]').change(function(){
|
||||
if($(this).parent().parent().parent().hasClass('checkselected')){
|
||||
$(this).parent().parent().parent().removeClass('checkselected');
|
||||
}
|
||||
else{
|
||||
$(this).parent().parent().parent().addClass('checkselected');
|
||||
}
|
||||
});
|
||||
|
||||
$('[id^=checkbox-all_delete]').change(function(){
|
||||
if ($("#checkbox-all_delete").prop("checked")) {
|
||||
$('[id^=checkbox-massive_report_check]')
|
||||
.parent()
|
||||
.parent()
|
||||
.parent()
|
||||
.addClass('checkselected');
|
||||
$(".check_delete").prop("checked", true);
|
||||
$('.check_delete').each(function(){
|
||||
$('#hidden-id_report_'+$(this).val()).prop("disabled", false);
|
||||
});
|
||||
}
|
||||
else{
|
||||
$('[id^=checkbox-massive_report_check]')
|
||||
.parent()
|
||||
.parent()
|
||||
.parent()
|
||||
.removeClass('checkselected');
|
||||
$(".check_delete").prop("checked", false);
|
||||
}
|
||||
});
|
||||
|
@ -121,7 +102,6 @@ global $config;
|
|||
// Login check.
|
||||
check_login();
|
||||
|
||||
enterprise_hook('open_meta_frame');
|
||||
$report_r = check_acl($config['id_user'], 0, 'RR');
|
||||
$report_w = check_acl($config['id_user'], 0, 'RW');
|
||||
$report_m = check_acl($config['id_user'], 0, 'RM');
|
||||
|
@ -253,7 +233,7 @@ if ($idReport != 0) {
|
|||
// Despite its permissions.
|
||||
$delete_report_bypass = false;
|
||||
|
||||
if ($action == 'delete_report') {
|
||||
if ($action === 'delete_report') {
|
||||
if ($config['id_user'] == $report['id_user']
|
||||
|| is_user_admin($config['id_user'])
|
||||
) {
|
||||
|
@ -563,42 +543,25 @@ switch ($action) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Page header for metaconsole.
|
||||
if ($enterpriseEnable && defined('METACONSOLE')) {
|
||||
// Bread crumbs.
|
||||
ui_meta_add_breadcrumb(
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('List of reports'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure,
|
||||
'text' => __('Reporting'),
|
||||
]
|
||||
);
|
||||
|
||||
ui_meta_print_page_header($nav_bar);
|
||||
|
||||
// Print header.
|
||||
ui_meta_print_header(__('Reporting'), '', $buttons);
|
||||
} else {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
__('List of reports'),
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$buttons,
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
if ($action == 'delete_report') {
|
||||
$delete = false;
|
||||
|
@ -750,55 +713,100 @@ switch ($action) {
|
|||
|
||||
$table_aux = new stdClass();
|
||||
$table_aux->width = '100%';
|
||||
$table_aux->class = 'databox filters';
|
||||
$table_aux->cellpadding = 0;
|
||||
$table_aux->cellspacing = 0;
|
||||
if (is_metaconsole()) {
|
||||
$table_aux->class = 'databox filters';
|
||||
|
||||
$table_aux->colspan[0][0] = 4;
|
||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||
$table_aux->colspan[0][0] = 4;
|
||||
$table_aux->data[0][0] = '<b>'.__('Group').'</b>';
|
||||
|
||||
$table_aux->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo'
|
||||
).'<br>';
|
||||
$table_aux->data[0][1] = html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo'
|
||||
).'<br>';
|
||||
|
||||
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
|
||||
$table_aux->data[0][2] .= ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
);
|
||||
$table_aux->data[0][2] .= '</b>';
|
||||
$table_aux->data[0][3] = html_print_input_text(
|
||||
'search',
|
||||
$search,
|
||||
'',
|
||||
30,
|
||||
'',
|
||||
true
|
||||
);
|
||||
$table_aux->data[0][2] = '<b>'.__('Free text for search: ');
|
||||
$table_aux->data[0][2] .= ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
);
|
||||
$table_aux->data[0][2] .= '</b>';
|
||||
$table_aux->data[0][3] = html_print_input_text(
|
||||
__('search'),
|
||||
$search,
|
||||
'',
|
||||
30,
|
||||
'',
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table_aux->class = 'filter-table-adv';
|
||||
$table_aux->size[0] = '30%';
|
||||
$table_aux->size[1] = '30%';
|
||||
$table_aux->size[2] = '30%';
|
||||
|
||||
$table_aux->data[0][6] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'search_submit',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
);
|
||||
$table_aux->data[0][0] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_select_groups(
|
||||
false,
|
||||
$access,
|
||||
true,
|
||||
'id_group',
|
||||
$id_group,
|
||||
'',
|
||||
'',
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
'',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'id_grupo'
|
||||
)
|
||||
);
|
||||
|
||||
$table_aux->data[0][1] = html_print_label_input_block(
|
||||
__('Free text for search: ').ui_print_help_tip(
|
||||
__('Search by report name or description, list matches.'),
|
||||
true
|
||||
),
|
||||
html_print_input_text(
|
||||
__('search'),
|
||||
$search,
|
||||
'',
|
||||
30,
|
||||
'',
|
||||
true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
if (is_metaconsole()) {
|
||||
$table_aux->data[0][6] = html_print_submit_button(
|
||||
__('Search'),
|
||||
'search_submit',
|
||||
false,
|
||||
'class="sub upd"',
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$url_rb = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
|
||||
if (is_metaconsole()) {
|
||||
|
@ -807,9 +815,37 @@ switch ($action) {
|
|||
$filter .= '</form>';
|
||||
ui_toggle($filter, __('Show Option'));
|
||||
} else {
|
||||
echo '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
|
||||
html_print_table($table_aux);
|
||||
echo '</form>';
|
||||
$searchForm = '<form action="'.$url_rb.'&id_group='.$id_group.'&pure='.$pure.'" method="post">';
|
||||
$searchForm .= html_print_table($table_aux, true);
|
||||
$searchForm .= html_print_div(
|
||||
[
|
||||
'class' => 'action-buttons',
|
||||
'content' => html_print_submit_button(
|
||||
__('Filter'),
|
||||
'search_submit',
|
||||
false,
|
||||
[
|
||||
'mode' => 'mini',
|
||||
'icon' => 'search',
|
||||
],
|
||||
true
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$searchForm .= '</form>';
|
||||
|
||||
ui_toggle(
|
||||
$searchForm,
|
||||
'<span class="subsection_header_title">'.__('Filters').'</span>',
|
||||
'filter_form',
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'white-box-content',
|
||||
'box-flat white_table_graph fixed_filter_bar'
|
||||
);
|
||||
}
|
||||
|
||||
ui_require_jquery_file('pandora.controls');
|
||||
|
@ -887,11 +923,10 @@ switch ($action) {
|
|||
$filtersStr = http_build_query($filters, '', '&');
|
||||
$url = 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder';
|
||||
$url .= '&'.$filtersStr;
|
||||
ui_pagination($total_reports, $url, $offset, $pagination);
|
||||
|
||||
// ui_pagination($total_reports, $url, $offset, $pagination);
|
||||
$table = new stdClass();
|
||||
$table->id = 'report_list';
|
||||
$table->width = '100%';
|
||||
$table->styleTable = 'margin: 0 10px;';
|
||||
$table->class = 'info_table';
|
||||
$table->cellpadding = 0;
|
||||
$table->cellspacing = 0;
|
||||
|
@ -1044,37 +1079,55 @@ switch ($action) {
|
|||
['title' => __('This report exceeds the item limit for realtime operations')]
|
||||
);
|
||||
$data[3] = null;
|
||||
} else if (!$report['non_interactive']) {
|
||||
$data[2] = '<a href="'.$config['homeurl'].'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'&pure='.$pure.'">';
|
||||
$data[2] .= html_print_image(
|
||||
'images/html.png',
|
||||
true,
|
||||
} else if ((bool) $report['non_interactive'] === false) {
|
||||
$data[2] = html_print_anchor(
|
||||
[
|
||||
'title' => __('HTML view'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
'href' => $config['homeurl'].'index.php?sec=reporting&sec2=operation/reporting/reporting_viewer&id='.$report['id_report'].'&pure='.$pure,
|
||||
'content' => html_print_image(
|
||||
'images/file-html.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('HTML view'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$data[2] .= '</a>';
|
||||
$data[3] = '<a onclick="blockResubmit($(this))" href="'.ui_get_full_url(false, false, false, false).'ajax.php?page='.$config['homedir'].'/operation/reporting/reporting_xml&id='.$report['id_report'].'">';
|
||||
$data[3] .= html_print_image(
|
||||
'images/xml.png',
|
||||
true,
|
||||
|
||||
$data[3] = html_print_anchor(
|
||||
[
|
||||
'title' => __('Export to XML'),
|
||||
'class' => 'invert_filter',
|
||||
]
|
||||
'onClick' => 'blockResubmit($(this))',
|
||||
'href' => ui_get_full_url(false, false, false, false).'ajax.php?page='.$config['homedir'].'/operation/reporting/reporting_xml&id='.$report['id_report'],
|
||||
'content' => html_print_image(
|
||||
'images/file-xml.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Export to XML'),
|
||||
'class' => 'invert_filter main_menu_icon',
|
||||
]
|
||||
),
|
||||
],
|
||||
true
|
||||
);
|
||||
$data[3] .= '</a>';
|
||||
// I chose ajax.php because it's supposed
|
||||
// to give XML anyway.
|
||||
} else {
|
||||
$data[2] = html_print_image(
|
||||
'images/html_disabled.png',
|
||||
true
|
||||
'images/file-html.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('HTML view'),
|
||||
'class' => 'invert_filter main_menu_icon alpha50',
|
||||
]
|
||||
);
|
||||
$data[3] = html_print_image(
|
||||
'images/xml_disabled.png',
|
||||
true
|
||||
'images/file-xml.svg',
|
||||
true,
|
||||
[
|
||||
'title' => __('Export to XML'),
|
||||
'class' => 'invert_filter main_menu_icon alpha50',
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1098,9 +1151,12 @@ switch ($action) {
|
|||
$data[$next] = ui_print_group_icon(
|
||||
$report['id_group'],
|
||||
true,
|
||||
'groups_small',
|
||||
'',
|
||||
!defined('METACONSOLE')
|
||||
'',
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
'invert_filter'
|
||||
);
|
||||
$next++;
|
||||
}
|
||||
|
@ -1148,89 +1204,103 @@ switch ($action) {
|
|||
|
||||
if ($edit || $delete) {
|
||||
$columnview = true;
|
||||
$table->cellclass[][$next] = 'action_buttons';
|
||||
|
||||
// $table->cellclass[][$next] = 'table_action_buttons';
|
||||
$tableActionButtons = [];
|
||||
if (!isset($table->head[$next])) {
|
||||
$table->head[$next] = '<span title="Operations">'.__('Op.').'</span>'.html_print_checkbox('all_delete', 0, false, true, false);
|
||||
$table->size = [];
|
||||
// $table->size[$next] = '80px';
|
||||
}
|
||||
|
||||
if ($edit) {
|
||||
$data[$next] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&pure='.$pure.'" class="inline_line">';
|
||||
$data[$next] .= html_print_input_image(
|
||||
$tableActionButtons[] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&action=edit&pure='.$pure.'" class="inline_line">';
|
||||
$tableActionButtons[] = html_print_input_image(
|
||||
'edit',
|
||||
'images/config.png',
|
||||
'images/edit.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Edit')]
|
||||
[
|
||||
'title' => __('Edit'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[$next] .= html_print_input_hidden(
|
||||
$tableActionButtons[] = html_print_input_hidden(
|
||||
'id_report',
|
||||
$report['id_report'],
|
||||
true
|
||||
);
|
||||
$data[$next] .= '</form>';
|
||||
$tableActionButtons[] = '</form>';
|
||||
}
|
||||
|
||||
$data[$next] .= '<form method="post" style="display: inline"; onsubmit="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$data[$next] .= html_print_input_hidden(
|
||||
$tableActionButtons[] = '<form method="post" style="display: inline"; onsubmit="if (!confirm(\''.__('Are you sure?').'\')) return false;">';
|
||||
$tableActionButtons[] = html_print_input_hidden(
|
||||
'id_report',
|
||||
$report['id_report'],
|
||||
true
|
||||
);
|
||||
$data[$next] .= html_print_input_hidden(
|
||||
$tableActionButtons[] = html_print_input_hidden(
|
||||
'action',
|
||||
'copy_report',
|
||||
true
|
||||
);
|
||||
$data[$next] .= html_print_input_image(
|
||||
$tableActionButtons[] = html_print_input_image(
|
||||
'dup',
|
||||
'images/copy.png',
|
||||
'images/copy.svg',
|
||||
1,
|
||||
'',
|
||||
true,
|
||||
['title' => __('Duplicate')]
|
||||
[
|
||||
'title' => __('Duplicate'),
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[$next] .= '</form> ';
|
||||
$tableActionButtons[] = '</form> ';
|
||||
|
||||
if ($delete) {
|
||||
$data[$next] .= '<form method="post" class="inline_line" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$data[$next] .= html_print_input_image(
|
||||
$tableActionButtons[] = '<form method="post" class="inline_line" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||
$tableActionButtons[] = html_print_input_image(
|
||||
'delete',
|
||||
'images/cross.png',
|
||||
'images/delete.svg',
|
||||
1,
|
||||
'margin-right: 10px;',
|
||||
true,
|
||||
[
|
||||
'title' => __('Delete'),
|
||||
'class' => 'invert_filter',
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
]
|
||||
);
|
||||
$data[$next] .= html_print_input_hidden(
|
||||
$tableActionButtons[] = html_print_input_hidden(
|
||||
'id_report',
|
||||
$report['id_report'],
|
||||
true
|
||||
);
|
||||
$data[$next] .= html_print_input_hidden(
|
||||
$tableActionButtons[] = html_print_input_hidden(
|
||||
'action',
|
||||
'delete_report',
|
||||
true
|
||||
);
|
||||
|
||||
$data[$next] .= html_print_checkbox_extended(
|
||||
$tableActionButtons[] = html_print_checkbox_extended(
|
||||
'massive_report_check',
|
||||
$report['id_report'],
|
||||
false,
|
||||
false,
|
||||
'',
|
||||
'class="check_delete"',
|
||||
[ 'input_class' => 'check_delete' ],
|
||||
true
|
||||
);
|
||||
|
||||
$data[$next] .= '</form>';
|
||||
$tableActionButtons[] = '</form>';
|
||||
}
|
||||
|
||||
$data[$next] = html_print_div(
|
||||
[
|
||||
'class' => 'table_action_buttons',
|
||||
'style' => 'padding-top: 8px;',
|
||||
'content' => implode('', $tableActionButtons),
|
||||
],
|
||||
true
|
||||
);
|
||||
} else {
|
||||
if ($op_column) {
|
||||
$data[$next] = '';
|
||||
|
@ -1240,18 +1310,15 @@ switch ($action) {
|
|||
array_push($table->data, $data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
html_print_table($table);
|
||||
ui_pagination(
|
||||
$tablePagination = ui_pagination(
|
||||
$total_reports,
|
||||
$url,
|
||||
$offset,
|
||||
$pagination,
|
||||
false,
|
||||
'offset',
|
||||
true,
|
||||
'pagination-bottom'
|
||||
'offset',
|
||||
false,
|
||||
);
|
||||
} else {
|
||||
ui_print_info_message(
|
||||
|
@ -1265,39 +1332,50 @@ switch ($action) {
|
|||
if (check_acl($config['id_user'], 0, 'RW')
|
||||
|| check_acl($config['id_user'], 0, 'RM')
|
||||
) {
|
||||
echo '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new&pure='.$pure.'">';
|
||||
if (is_metaconsole() === true) {
|
||||
echo '<div class="action-buttons w100p">';
|
||||
} else {
|
||||
echo '<div class="action-buttons w100p">';
|
||||
}
|
||||
|
||||
html_print_submit_button(
|
||||
$buttonsOutput = [];
|
||||
// Create form.
|
||||
$buttonsOutput[] = '<form method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=new&pure='.$pure.'">';
|
||||
$buttonsOutput[] = html_print_submit_button(
|
||||
__('Create report'),
|
||||
'create',
|
||||
false,
|
||||
'class="sub next"'
|
||||
[ 'icon' => 'next' ],
|
||||
true
|
||||
);
|
||||
$buttonsOutput[] = '</form>';
|
||||
|
||||
echo '</form>';
|
||||
echo '<form class="inline_line" id="massive_report_form" method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=delete">';
|
||||
// Delete form.
|
||||
$buttonsOutput[] = '<form class="inline_line mrgn_right_10px" id="massive_report_form" method="post" action="index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&tab=main&action=delete">';
|
||||
|
||||
foreach ($reports as $report) {
|
||||
echo '<input class="massive_report_form_elements" id="hidden-id_report_'.$report['id_report'].'" name="id_report[]" type="hidden" disabled value="'.$report['id_report'].'">';
|
||||
$buttonsOutput[] = '<input class="massive_report_form_elements" id="hidden-id_report_'.$report['id_report'].'" name="id_report[]" type="hidden" disabled value="'.$report['id_report'].'">';
|
||||
}
|
||||
|
||||
echo '<input id="hidden-action" name="action" type="hidden" value="delete_report">';
|
||||
html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
'class="sub delete" class="mrgn_lft_5px"'
|
||||
);
|
||||
echo '</form>';
|
||||
echo '</div>';
|
||||
}
|
||||
if (empty($report) === false) {
|
||||
$buttonsOutput[] = html_print_input_hidden('action', 'delete_report', true);
|
||||
$buttonsOutput[] = html_print_submit_button(
|
||||
__('Delete'),
|
||||
'delete_btn',
|
||||
false,
|
||||
[
|
||||
'icon' => 'delete',
|
||||
'mode' => 'secondary',
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
$buttonsOutput[] = '</form>';
|
||||
|
||||
echo html_print_action_buttons(
|
||||
implode('', $buttonsOutput),
|
||||
[
|
||||
'type' => 'form_action',
|
||||
'right_content' => $tablePagination,
|
||||
],
|
||||
true
|
||||
);
|
||||
}
|
||||
return;
|
||||
|
||||
break;
|
||||
|
@ -3550,41 +3628,25 @@ switch ($action) {
|
|||
break;
|
||||
}
|
||||
|
||||
// Page header for metaconsole.
|
||||
if ($enterpriseEnable && defined('METACONSOLE')) {
|
||||
// Bread crumbs.
|
||||
ui_meta_add_breadcrumb(
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$subsection,
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure,
|
||||
'text' => __('Reporting'),
|
||||
]
|
||||
);
|
||||
|
||||
ui_meta_print_page_header($nav_bar);
|
||||
|
||||
// Print header.
|
||||
ui_meta_print_header(__('Reporting'), '', $buttons);
|
||||
} else {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$subsection,
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
'',
|
||||
false,
|
||||
$buttons,
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
reporting_enterprise_select_main_tab($action);
|
||||
}
|
||||
|
@ -3661,44 +3723,28 @@ if ($idReport != 0) {
|
|||
$textReportName = __('Create Custom Report');
|
||||
}
|
||||
|
||||
// Page header for metaconsole.
|
||||
if ($enterpriseEnable && defined('METACONSOLE')) {
|
||||
// Bread crumbs.
|
||||
ui_meta_add_breadcrumb(
|
||||
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
|
||||
|
||||
if ($action !== 'update') {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$textReportName,
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
$tab_builder,
|
||||
false,
|
||||
$buttons,
|
||||
[
|
||||
'link' => 'index.php?sec=reporting&sec2=godmode/reporting/reporting_builder&pure='.$pure,
|
||||
'text' => __('Reporting'),
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
|
||||
ui_meta_print_page_header($nav_bar);
|
||||
|
||||
// Print header.
|
||||
ui_meta_print_header(__('Reporting').$textReportName, '', $buttons);
|
||||
} else {
|
||||
$tab_builder = ($activeTab === 'item_editor') ? 'reporting_item_editor_tab' : '';
|
||||
|
||||
if ($action !== 'update' && is_metaconsole() === false) {
|
||||
// Header.
|
||||
ui_print_standard_header(
|
||||
$textReportName,
|
||||
'images/op_reporting.png',
|
||||
false,
|
||||
$tab_builder,
|
||||
false,
|
||||
$buttons,
|
||||
[
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Reporting'),
|
||||
],
|
||||
[
|
||||
'link' => '',
|
||||
'label' => __('Custom reports'),
|
||||
],
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if ($resultOperationDB !== null) {
|
||||
|
@ -3767,5 +3813,3 @@ switch ($activeTab) {
|
|||
reporting_enterprise_select_tab($activeTab);
|
||||
break;
|
||||
}
|
||||
|
||||
enterprise_hook('close_meta_frame');
|
||||
|
|
|
@ -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-2023 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,74 +78,27 @@ 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'>";
|
||||
echo "<form id='back' action='index.php?sec=screen&sec2=screens/screens&tab=".$activeTab.'&id_visual_console='.$idVisualConsole.'&id='.$idVisualConsole."&action=visualmap' method='post' enctype='multipart/form-data'>";
|
||||
html_print_input_hidden('action2', 'update');
|
||||
}
|
||||
break;
|
||||
|
||||
case 'edit':
|
||||
if (!defined('METACONSOLE')) {
|
||||
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');
|
||||
default:
|
||||
if (is_metaconsole() === false) {
|
||||
$formAction = 'index.php?sec=network&sec2=godmode/reporting/visual_console_builder&tab='.$activeTab.'&id_visual_console='.$idVisualConsole;
|
||||
$formHidden = html_print_input_hidden('action', 'update', true);
|
||||
} else {
|
||||
echo "<form id='back' action='index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&tab=".$activeTab.'&id_visual_console='.$idVisualConsole."&action=visualmap' method='post' enctype='multipart/form-data' >";
|
||||
html_print_input_hidden('action2', 'update');
|
||||
$formAction = 'index.php?operation=edit_visualmap&sec=screen&sec2=screens/screens&tab='.$activeTab.'&id_visual_console='.$idVisualConsole.'&action=visualmap';
|
||||
$formHidden = html_print_input_hidden('action2', 'update', true);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->class = 'databox data';
|
||||
$table->head[0] = __('Create visual console');
|
||||
$table->head_colspan[0] = 5;
|
||||
$table->headstyle[0] = 'text-align: center';
|
||||
$table->align[0] = 'left';
|
||||
$table->align[1] = 'left';
|
||||
}
|
||||
|
||||
$table->class = 'databox filters';
|
||||
$table->size[0] = '20%';
|
||||
$table->size[1] = '20%';
|
||||
$table->size[1] = '50%';
|
||||
$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);
|
||||
|
||||
$table->data[0][1] = html_print_input_text(
|
||||
'name',
|
||||
$visualConsoleName,
|
||||
'',
|
||||
80,
|
||||
100,
|
||||
true
|
||||
);
|
||||
|
||||
$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="">';
|
||||
} else {
|
||||
if (defined('METACONSOLE')) {
|
||||
$table->data[0][2] = '<img id="imagen2" style="width:230px;"
|
||||
src="../../images/console/background/'.$background.'">';
|
||||
} else {
|
||||
$table->data[0][2] = '<img id="imagen2" style="width:230px;"
|
||||
src="images/console/background/'.$background.'">';
|
||||
}
|
||||
|
||||
$table->data[0][2] .= '<img id="imagen" class="invisible"
|
||||
src="">';
|
||||
}
|
||||
|
||||
$table->data[1][0] = __('Group');
|
||||
|
||||
$return_all_group = false;
|
||||
|
||||
|
@ -141,21 +106,6 @@ if (users_can_manage_group_all('RW') === true) {
|
|||
$return_all_group = true;
|
||||
}
|
||||
|
||||
$table->data[1][1] = '<div class="w250px">'.html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'RW',
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'name' => 'id_group',
|
||||
'selected' => $idGroup,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
]
|
||||
).'</div>';
|
||||
$backgrounds_list = list_files(
|
||||
$config['homedir'].'/images/console/background/',
|
||||
'jpg',
|
||||
|
@ -166,40 +116,120 @@ $backgrounds_list = array_merge(
|
|||
$backgrounds_list,
|
||||
list_files($config['homedir'].'/images/console/background/', 'png', 1, 0)
|
||||
);
|
||||
$table->data[2][0] = __('Background');
|
||||
$table->data[2][1] = html_print_select(
|
||||
$backgrounds_list,
|
||||
'background',
|
||||
io_safe_output($background),
|
||||
'',
|
||||
'None',
|
||||
'None.png',
|
||||
true
|
||||
);
|
||||
$table->data[3][0] = __('Background image');
|
||||
$table->data[3][1] = html_print_input_file('background_image', true);
|
||||
$table->data[4][0] = __('Background color');
|
||||
|
||||
if ($action == 'new') {
|
||||
$table->data[4][1] .= html_print_input_text(
|
||||
$backgroundPreviewImages = [];
|
||||
if ($action === 'new') {
|
||||
$backgroundPreviewImages[] = html_print_image('', true, ['id' => 'imagen2', 'class' => 'invisible']);
|
||||
} else {
|
||||
if (is_metaconsole() === true) {
|
||||
$backgroundPreviewImages[] = html_print_image('../../images/console/background/'.$background, true, ['id' => 'imagen2', 'style' => 'width: 230px']);
|
||||
} else {
|
||||
$backgroundPreviewImages[] = html_print_image('images/console/background/'.$background, true, ['id' => 'imagen2', 'style' => 'width: 230px']);
|
||||
}
|
||||
}
|
||||
|
||||
$backgroundPreviewImages[] = html_print_image('', true, ['id' => 'imagen', 'class' => 'invisible']);
|
||||
|
||||
// Form.
|
||||
echo '<form id="back" class="max_floating_element_size" method="POST" action="'.$formAction.'" enctype="multipart/form-data">';
|
||||
echo $formHidden;
|
||||
|
||||
$table = new stdClass();
|
||||
$table->width = '100%';
|
||||
|
||||
|
||||
|
||||
$table->class = 'databox filter-table-adv';
|
||||
$table->size = [];
|
||||
$table->size[0] = '50%';
|
||||
$table->size[1] = '50%';
|
||||
|
||||
$table->data = [];
|
||||
|
||||
$table->colspan[-1][0] = 2;
|
||||
$table->data[-1][0] = '<div class="section_table_title">'.__('Create visual console').'</div>';
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Name'),
|
||||
html_print_input_text(
|
||||
'name',
|
||||
$visualConsoleName,
|
||||
'',
|
||||
80,
|
||||
100,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[0][] = html_print_label_input_block(
|
||||
__('Group'),
|
||||
html_print_input(
|
||||
[
|
||||
'type' => 'select_groups',
|
||||
'id_user' => $config['id_user'],
|
||||
'privilege' => 'RW',
|
||||
'returnAllGroup' => $return_all_group,
|
||||
'name' => 'id_group',
|
||||
'selected' => $idGroup,
|
||||
'script' => '',
|
||||
'nothing' => '',
|
||||
'nothing_value' => '',
|
||||
'return' => true,
|
||||
'required' => true,
|
||||
]
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[1][0] = html_print_label_input_block(
|
||||
__('Background'),
|
||||
html_print_select(
|
||||
$backgrounds_list,
|
||||
'background',
|
||||
io_safe_output($background),
|
||||
'',
|
||||
'None',
|
||||
'None.png',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->rowspan[1][1] = 2;
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Background preview'),
|
||||
implode('', $backgroundPreviewImages)
|
||||
);
|
||||
|
||||
$table->data[2][] = html_print_label_input_block(
|
||||
__('Background image'),
|
||||
html_print_input_file(
|
||||
'background_image',
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
if ($action === 'new') {
|
||||
$backgroundColorInput = html_print_input_color(
|
||||
'background_color',
|
||||
'white',
|
||||
'',
|
||||
8,
|
||||
8,
|
||||
'background_color',
|
||||
false,
|
||||
true
|
||||
);
|
||||
} else {
|
||||
$table->data[4][1] .= html_print_input_text(
|
||||
$backgroundColorInput = html_print_input_color(
|
||||
'background_color',
|
||||
$background_color,
|
||||
'',
|
||||
8,
|
||||
8,
|
||||
'background_color',
|
||||
false,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$table->data[3][] = html_print_label_input_block(
|
||||
__('Background color'),
|
||||
$backgroundColorInput
|
||||
);
|
||||
|
||||
if ($idVisualConsole) {
|
||||
$preimageh = db_get_value_sql('select height from tlayout where id ='.$idVisualConsole);
|
||||
$preimagew = db_get_value_sql('select width from tlayout where id ='.$idVisualConsole);
|
||||
|
@ -208,41 +238,95 @@ if ($idVisualConsole) {
|
|||
$preimagew = 1024;
|
||||
}
|
||||
|
||||
$table->data[5][0] = __('Layout size').': <span id="preimagew">'.$preimagew.'</span> x <span id="preimageh">'.$preimageh.'</span>';
|
||||
$layoutSizeElements = [];
|
||||
|
||||
$table->data[5][1] = '<button id="modsize"
|
||||
style="margin-right:20px;" value="modsize">'.__('Set custom size').'</button>';
|
||||
$layoutSizeElements[] = html_print_div(
|
||||
[
|
||||
'class' => 'preimage_container',
|
||||
'content' => '<span id="preimagew">'.$preimagew.'</span><span>x</span><span id="preimageh">'.$preimageh.'</span>',
|
||||
],
|
||||
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>';
|
||||
$layoutSizeElements[] = 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;">
|
||||
<button id="getsize" class="margin_lft_20px"
|
||||
value="modsize">'.__('Get default image size').'</button></span>';
|
||||
$layoutSizeElements[] = '<span class="opt" style="visibility:hidden;">'.html_print_input_text('width', $preimagew, '', 8, 10, true, false).' x '.html_print_input_text('height', $preimageh, '', 8, 10, true, false).'</span>';
|
||||
$layoutSizeElements[] = '<span class="opt" style="visibility:hidden;">';
|
||||
$layoutSizeElements[] = html_print_button(
|
||||
__('Get default image size'),
|
||||
'getsize',
|
||||
false,
|
||||
'',
|
||||
[
|
||||
'icon' => 'cog',
|
||||
'mode' => 'link',
|
||||
'value' => 'modsize',
|
||||
],
|
||||
true
|
||||
);
|
||||
$layoutSizeElements[] = '</span>';
|
||||
|
||||
$table->data[6][0] = __('Favourite visual console');
|
||||
$table->data[6][1] = html_print_checkbox('is_favourite', 0, $is_favourite, true);
|
||||
$table->data[4][] = html_print_label_input_block(
|
||||
__('Layout size'),
|
||||
html_print_div(
|
||||
[
|
||||
'class' => 'flex flex-items-center',
|
||||
'content' => implode('', $layoutSizeElements),
|
||||
],
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
$table->data[7][0] = __('Auto adjust to screen in fullscreen');
|
||||
$table->data[7][1] = html_print_checkbox('auto_adjust', 0, $auto_adjust, true);
|
||||
$table->data[5][] = html_print_label_input_block(
|
||||
__('Favourite visual console'),
|
||||
html_print_checkbox_switch(
|
||||
'is_favourite',
|
||||
0,
|
||||
$is_favourite,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
if ($action == 'new') {
|
||||
$table->data[6][] = html_print_label_input_block(
|
||||
__('Auto adjust to screen in fullscreen'),
|
||||
html_print_checkbox_switch(
|
||||
'auto_adjust',
|
||||
0,
|
||||
$auto_adjust,
|
||||
true
|
||||
)
|
||||
);
|
||||
|
||||
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_action_buttons(
|
||||
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 +336,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 +362,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 +387,6 @@ $(document).ready (function () {
|
|||
$('input[name=height]').val($('#imagen').height());
|
||||
$('#preimageh').html($('#imagen').height());
|
||||
}
|
||||
|
||||
}
|
||||
else{
|
||||
original_image=new Image();
|
||||
|
@ -315,14 +395,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 +410,7 @@ $(document).ready (function () {
|
|||
$('input[name=height]').val(original_image.height);
|
||||
$('#preimageh').html(original_image.height);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
$( "input[type=submit]" ).click(function( event ) {
|
||||
|
@ -412,7 +490,7 @@ $(document).ready (function () {
|
|||
readURL(this);
|
||||
});
|
||||
|
||||
$("#text-background_color").attachColorPicker();
|
||||
//$("#text-background_color").attachColorPicker();
|
||||
|
||||
if($("#checkbox-is_favourite").is(":checked")) {
|
||||
$("#hidden-is_favourite_sent").val(1);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue