Merge branch 'ent-9662-second-round' of brutus.artica.es:artica/pandorafms into ent-9662-second-round

This commit is contained in:
Jonathan 2023-03-14 15:42:02 +01:00
commit 2424e5009c
17 changed files with 531 additions and 431 deletions

View File

@ -407,7 +407,6 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
// 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',

View File

@ -406,9 +406,9 @@ $filterTable->data[1][0] = html_print_submit_button(
);
// Print filter table.
echo '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
$form = '<form method=\'post\' action=\'index.php?sec=gagente&sec2=godmode/agentes/modificar_agente\'>';
ui_toggle(
html_print_table($filterTable, true),
$form.html_print_table($filterTable, true).'</form>',
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
@ -418,7 +418,6 @@ ui_toggle(
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
echo '</form>';
// Data table.
$selected = true;

View File

@ -61,13 +61,19 @@ if ($default_action != 0) {
}
// Header.
ui_print_page_header(
ui_print_standard_header(
__('Alert details'),
'images/op_alerts.png',
false,
'',
false,
''
[],
[
[
'link' => '',
'label' => __('Alerts'),
],
]
);
// TABLE DETAILS.

View File

@ -1,5 +1,4 @@
<?php
/**
* User creation / update.
*
@ -996,15 +995,6 @@ if (!users_is_admin() && $config['id_user'] !== $id && $new_user === false) {
}
}
if (is_metaconsole() === true) {
html_print_div(
[
'class' => 'user_form_title',
'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
]
);
}
if (!$new_user) {
$user_id = '<div class="label_select_simple"><p class="edit_user_labels">'.__('User ID').': </p>';
$user_id .= '<span>'.$id.'</span>';
@ -1282,8 +1272,9 @@ if (is_metaconsole() === false) {
if (is_metaconsole() === true) {
$array_filters = get_filters_custom_fields_view(0, true);
$search_custom_fields_view = '<div class="label_select"><p class="edit_user_labels">'.__('Search custom field view').' '.ui_print_help_tip(__('Load by default the selected view in custom field view'), true).'</p>';
$search_custom_fields_view .= html_print_select(
$searchCustomFieldView = [];
$searchCustomFieldView[] = __('Search custom field view');
$searchCustomFieldView[] = html_print_select(
$array_filters,
'default_custom_view',
$user_info['default_custom_view'],
@ -1295,7 +1286,10 @@ if (is_metaconsole() === true) {
true,
'',
false
).'</div>';
).ui_print_input_placeholder(
__('Load by default the selected view in custom field view'),
true
);
}
$values = [
@ -1377,6 +1371,8 @@ $home_screen .= html_print_input_text(
false
);
$home_screen = '';
$size_pagination = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Block size for pagination').'</p>';
$size_pagination .= html_print_input_text(
'block_size',
@ -1395,19 +1391,20 @@ if ($id === $config['id_user']) {
);
}
if (enterprise_installed() && is_metaconsole() === true) {
if (enterprise_installed() === true && is_metaconsole() === true) {
$user_info_metaconsole_access = 'only_console';
if (isset($user_info['metaconsole_access'])) {
$user_info_metaconsole_access = $user_info['metaconsole_access'];
}
// TODO review help tips on meta.
$meta_access = '<div class="label_select"><p class="edit_user_labels">'.__('Metaconsole access').' './* ui_print_help_icon('meta_access', true). */ '</p>';
$metaconsole_accesses = [
'basic' => __('Basic'),
'advanced' => __('Advanced'),
];
$meta_access .= html_print_select(
$outputMetaAccess = [];
$outputMetaAccess[] = __('Metaconsole access');
$outputMetaAccess[] = html_print_select(
$metaconsole_accesses,
'metaconsole_access',
$user_info_metaconsole_access,
@ -1417,51 +1414,9 @@ if (enterprise_installed() && is_metaconsole() === true) {
true,
false,
false
).'</div>';
);
}
/*
$not_login = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Not Login').'</p>';
$not_login .= ui_print_help_tip(
__('The user with not login set only can access to API.'),
true
);
$not_login .= html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
).'</div>';
$local_user = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Local user').'</p>';
$local_user .= ui_print_help_tip(
__('The user with local authentication enabled will always use local authentication.'),
true
);
$local_user .= html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
).'</div>';
$session_time = '<div class="label_select_simple"><p class="edit_user_labels">'.__('Session Time');
$session_time .= ui_print_help_tip(
__('This is defined in minutes, If you wish a permanent session should putting -1 in this field.'),
true
).'</p>';
$session_time .= html_print_input_text(
'session_time',
$user_info['session_time'],
'',
5,
5,
true.false,
false,
'',
'class="input_line_small"'
).'</div>';
*/
$user_groups = implode(',', array_keys((users_get_groups($id, 'AR', $display_all_group))));
if (empty($user_groups) === false) {
@ -1582,31 +1537,6 @@ if (empty($doubleAuthElementsContent) === false) {
$doubleAuthentication = '';
}
/*
if (isset($double_authentication)) {
$double_authentication .= '</div>';
}*/
$autorefresh_list_out = [];
if (is_metaconsole() === false || is_centralized() === true) {
$autorefresh_list_out['operation/agentes/estado_agente'] = 'Agent detail';
@ -1665,31 +1595,32 @@ if (isset($autorefresh_list) === false) {
}
}
if (is_metaconsole() === true) {
enterprise_include_once('include/functions_metaconsole.php');
$access_node = db_get_value('metaconsole_access_node', 'tusuario', 'id_user', $id);
$metaconsole_agents_manager = '<div class="label_select_simple" id="metaconsole_agents_manager_div"><p class="edit_user_labels">'.__('Enable agents managment').'</p>';
$metaconsole_agents_manager .= html_print_checkbox_switch(
$metaconsoleAgentManager = [];
$metaconsoleAgentManager[] = __('Enable agents managment');
$metaconsoleAgentManager[] = html_print_checkbox_switch(
'metaconsole_agents_manager',
1,
$user_info['metaconsole_agents_manager'],
true
).'</div>';
);
$metaconsole_access_node = '<div class="label_select_simple" id="metaconsole_access_node_div"><p class="edit_user_labels">'.__('Enable node access').ui_print_help_tip(__('With this option enabled, the user will can access to nodes console'), true).'</p>';
$metaconsole_access_node .= html_print_checkbox(
$metaconsoleAgentManager[] = __('Enable node access').ui_print_help_tip(
__('With this option enabled, the user will can access to nodes console'),
true
);
$metaconsoleAgentManager[] = html_print_checkbox_switch(
'metaconsole_access_node',
1,
$access_node,
true
).'</div>';
);
}
echo '<div class="max_floating_element_size">';
echo '<form id="user_profile_form" name="user_profile_form" method="post" autocomplete="off" action="#">';
@ -1701,141 +1632,8 @@ if (!$id) {
$user_id_create = $user_id;
}
if (is_metaconsole() === true) {
$access_or_pagination = $meta_access;
if ($id != '' && !$is_err) {
$div_user_info = '<div class="edit_user_info_left">'.$avatar.$user_id_create.'</div>
<div class="edit_user_info_right">'.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$own_pass_confirm.$global_profile.'</div>';
} else {
$div_user_info = '<div class="edit_user_info_left">'.$avatar.'</div>
<div class="edit_user_info_right">'.$user_id_create.$user_id_update_view.$full_name.$new_pass.$new_pass_confirm.$global_profile.'</div>';
}
echo '<div id="user_form">
<div class="user_edit_first_row">
<div class="edit_user_info white_box">'.$div_user_info.'</div>
<div class="edit_user_autorefresh white_box"><p class="bolder">Extra info</p>'.$email.$phone.$not_login.$local_user.$session_time.'</div>
</div>
<div class="user_edit_second_row white_box">
<div class="edit_user_options">'.$language.$access_or_pagination.$skin.$default_event_filter.$double_authentication.'</div>
<div class="edit_user_timezone">'.$timezone;
echo $search_custom_fields_view.$metaconsole_agents_manager.$metaconsole_access_node;
$autorefresh_show = '<p class="edit_user_labels">'._('Autorefresh').ui_print_help_tip(
__('This will activate autorefresh in selected pages'),
true
).'</p>';
$select_out = html_print_select(
$autorefresh_list_out,
'autorefresh_list_out[]',
'',
'',
'',
'',
true,
true,
true,
'',
false,
'width:100%'
);
$arrows = ' ';
$select_in = html_print_select(
$autorefresh_list,
'autorefresh_list[]',
'',
'',
'',
'',
true,
true,
true,
'',
false,
'width:100%'
);
$table_ichanges = '<div class="autorefresh_select">
<div class="autorefresh_select_list_out">
<p class="autorefresh_select_text">'.__('Full list of pages').': </p>
<div>'.$select_out.'</div>
</div>
<div class="autorefresh_select_arrows" style="display:grid">
<a href="javascript:">'.html_print_image(
'images/darrowright_green.png',
true,
[
'id' => 'right_autorefreshlist',
'alt' => __('Push selected pages into autorefresh list'),
'title' => __('Push selected pages into autorefresh list'),
]
).'</a>
<a href="javascript:">'.html_print_image(
'images/darrowleft_green.png',
true,
[
'id' => 'left_autorefreshlist',
'alt' => __('Pop selected pages out of autorefresh list'),
'title' => __('Pop selected pages out of autorefresh list'),
]
).'</a>
</div>
<div class="autorefresh_select_list">
<p class="autorefresh_select_text">'.__('List of pages with autorefresh').': </p>
<div>'.$select_in.'</div>
</div>
</div>';
$autorefresh_show .= $table_ichanges;
// Time autorefresh.
$times = get_refresh_time_array();
$time_autorefresh = '<div class="label_select"><p class="edit_user_labels">'.__('Time autorefresh');
$time_autorefresh .= ui_print_help_tip(
__('Interval of autorefresh of the elements, by default they are 30 seconds, needing to enable the autorefresh first'),
true
).'</p>';
$time_autorefresh .= html_print_select(
$times,
'time_autorefresh',
$user_info['time_autorefresh'],
'',
'',
'',
true,
false,
false
).'</div>';
echo '</div>
</div>
<div class="edit_user_autorefresh white_box">'.$autorefresh_show.$time_autorefresh.'</div>
<div class="user_edit_third_row white_box">
<div class="edit_user_comments">'.$comments.'</div>
</div>';
if (empty($ehorus) === false) {
html_print_div(
[
'class' => 'user_edit_third_row white_box',
'content' => $ehorus,
],
true
);
}
// User Profile definition table. (Only where user is not creating).
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}
} else {
$access_or_pagination = $size_pagination;
// WIP: Only for node.
include_once 'user_management.php';
}
// User management form.
require_once 'user_management.php';
if ((bool) $config['admin_can_add_user'] === true) {
html_print_csrf_hidden();
@ -1916,7 +1714,7 @@ if (is_metaconsole() === false) {
$(document).ready(function() {
// Set up the picker to update target timezone and country select lists.
$('#timezone-image').timezonePicker({
target: '#timezone',
target: '#timezone1',
});
// Optionally an auto-detect button to trigger JavaScript geolocation.
@ -1938,23 +1736,13 @@ if (is_metaconsole() === false) {
var json_profile = $('#hidden-json_profile');
/* <![CDATA[ */
$(document).ready(function() {
// Set up the picker to update target timezone and country select lists.
$('#timezone-image').timezonePicker({
target: '#timezone1',
});
// Optionally an auto-detect button to trigger JavaScript geolocation.
$('#timezone-detect').click(function() {
$('#timezone-image').timezonePicker('detectLocation');
});
$("#right_autorefreshlist").click(function() {
jQuery.each($("select[name='autorefresh_list_out[]'] option:selected"), function(key, value) {
imodule_name = $(value).html();
if (imodule_name != <?php echo "'".__('None')."'"; ?>) {
id_imodule = $(value).attr('value');
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>'));
$("select[name='autorefresh_list[]'] option").each(function() { $(this).attr("selected", true) });
$("select[name='autorefresh_list[]']").append($("<option></option>").val(id_imodule).html('<i>' + imodule_name + '</i>').attr("selected", true));
$("#autorefresh_list_out").find("option[value='" + id_imodule + "']").remove();
$("#autorefresh_list").find("option[value='']").remove();
$("#autorefresh_list").find("option[value='0']").remove();

View File

@ -395,8 +395,6 @@ if ($delete_user === true) {
__('There was a problem deleting the user from %s', io_safe_input($server['server_name']))
);
}
header('Refresh:1');
}
} else {
ui_print_error_message(__('There was a problem deleting the user'));
@ -463,43 +461,72 @@ if (($filter_group == 0) && ($filter_search == '')) {
$filterTable = new stdClass();
$filterTable->width = '100%';
$filterTable->class = 'fixed_filter_bar';
$filterTable->class = 'filter-table-adv';
$filterTable->rowclass[0] = '';
$filterTable->cellstyle[0][0] = 'width:0';
$filterTable->cellstyle[0][1] = 'width:0';
$filterTable->data[0][0] = __('Group');
$filterTable->data[1][0] = html_print_select_groups(
false,
'AR',
true,
'filter_group',
$filter_group,
'',
'',
0,
true
$filterTable->data[0][] = html_print_label_input_block(
__('Group'),
html_print_select_groups(
false,
'AR',
true,
'filter_group',
$filter_group,
'',
'',
0,
true
)
);
$filterTable->data[0][1] = __('Search').ui_print_help_tip(__('Search by username, fullname or email'), true);
$filterTable->data[1][1] = html_print_input_text(
'filter_search',
$filter_search,
__('Search by username, fullname or email'),
30,
90,
true
);
$filterTable->cellstyle[1][2] = 'vertical-align: bottom';
$filterTable->data[1][2] = html_print_submit_button(
$filterTable->data[0][] = html_print_label_input_block(
__('Search'),
'search',
false,
html_print_input_text(
'filter_search',
$filter_search,
__('Search by username, fullname or email'),
30,
90,
true
).ui_print_input_placeholder(
__('Search by username, fullname or email'),
true
)
);
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= html_print_div(
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
'class' => 'action-buttons-right-forced',
'content' => html_print_submit_button(
__('Search'),
'search',
false,
[
'icon' => 'search',
'class' => 'float-right',
'mode' => 'secondary mini',
],
true
),
],
true
);
$form_filter .= '</form>';
ui_toggle(
$form_filter,
'<span class="subsection_header_title">'.__('Filter').'</span>',
__('Filter'),
'filter',
true,
false,
'',
'white-box-content no_border',
'filter-datatable-main box-flat white_table_graph fixed_filter_bar'
);
$is_management_allowed = true;
if (is_metaconsole() === false && is_management_allowed() === false) {
@ -520,20 +547,6 @@ if (is_metaconsole() === false && is_management_allowed() === false) {
);
}
if (is_metaconsole() === true) {
$filterTable->width = '96%';
$form_filter = "<form class='filters_form' method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= '</form>';
ui_toggle($form_filter, __('Show Options'));
} else {
$form_filter = "<form method='post'>";
$form_filter .= html_print_table($filterTable, true);
$form_filter .= '</form>';
echo $form_filter;
}
// Urls to sort the table.
$url_up_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=up&pure='.$pure;
$url_down_id = '?sec='.$sec.'&sec2=godmode/users/user_list&sort_field=id_user&sort=down&pure='.$pure;

View File

@ -325,53 +325,55 @@ if ($new_user === false) {
$userManagementTable->data['passwordManage_table'] = html_print_table($passwordManageTable, true);
if (users_is_admin() === true) {
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
$notLoginCheckContent = [];
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
$notLoginCheckContent[] = html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
);
$userManagementTable->rowclass['captions_loginErrorUser'] = 'field_half_width w50p';
$userManagementTable->cellclass['captions_loginErrorUser'][0] = 'wrap';
$userManagementTable->cellclass['captions_loginErrorUser'][1] = 'wrap';
$notLoginCheckContent = [];
$notLoginCheckContent[] = '<span>'.__('Not Login').'</span>';
$notLoginCheckContent[] = html_print_checkbox_switch(
'not_login',
1,
$user_info['not_login'],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $notLoginCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
__('The user with not login set only can access to API.'),
true
);
$userManagementTable->data['captions_loginErrorUser'][0] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $notLoginCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][0] .= ui_print_input_placeholder(
__('The user with not login set only can access to API.'),
true
);
$localUserCheckContent = [];
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
$localUserCheckContent[] = html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
);
$localUserCheckContent = [];
$localUserCheckContent[] = '<span>'.__('Local User').'</span>';
$localUserCheckContent[] = html_print_checkbox_switch(
'local_user',
1,
$user_info['local_user'],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $localUserCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
__('The user with local authentication enabled will always use local authentication.'),
true
);
}
$userManagementTable->data['captions_loginErrorUser'][1] = html_print_div(
[
'class' => 'margin-top-10',
'style' => 'display: flex; flex-direction: row-reverse; align-items: center;',
'content' => implode('', $localUserCheckContent),
],
true
);
$userManagementTable->data['captions_loginErrorUser'][1] .= ui_print_input_placeholder(
__('The user with local authentication enabled will always use local authentication.'),
true
);
$userManagementTable->data['show_tips_startup'][0] = html_print_checkbox_switch('show_tips_startup', 1, ($user_info['show_tips_startup'] === null) ? true : $user_info['show_tips_startup'], true);
$userManagementTable->data['show_tips_startup'][1] = '<span>'.__('Show usage tips at startup').'</span>';
@ -551,10 +553,10 @@ $userManagementTable->data['fields_autorefreshTime'][0] .= ui_print_input_placeh
// Title for Language and Appearance.
$userManagementTable->data['title_lookAndFeel'] = html_print_subtitle_table(__('Language and Appearance'));
// Language and color scheme.
$userManagementTable->rowclass['captions_lang_colorscheme'] = 'field_half_width';
$userManagementTable->rowclass['fields_lang_colorscheme'] = 'field_half_width';
$userManagementTable->data['captions_lang_colorscheme'][0] = __('Language');
$userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_from_sql(
$userManagementTable->rowclass['line1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['line2_looknfeel'] = 'field_half_width';
$userManagementTable->data['line1_looknfeel'][0] = __('Language');
$userManagementTable->data['line2_looknfeel'][0] = html_print_select_from_sql(
'SELECT id_language, name FROM tlanguage',
'language',
$user_info['language'],
@ -564,8 +566,15 @@ $userManagementTable->data['fields_lang_colorscheme'][0] = html_print_select_fro
true
);
$userManagementTable->data['captions_lang_colorscheme'][1] = __('User color scheme');
$userManagementTable->data['fields_lang_colorscheme'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
if (is_metaconsole() === true) {
if (users_is_admin() === true) {
$userManagementTable->data['line1_looknfeel'][1] = $outputMetaAccess[0];
$userManagementTable->data['line2_looknfeel'][1] = $outputMetaAccess[1];
}
} else {
$userManagementTable->data['line1_looknfeel'][1] = __('User color scheme');
$userManagementTable->data['line2_looknfeel'][1] = skins_print_select($id_usr, 'skin', $user_info['id_skin'], '', __('None'), 0, true);
}
$userManagementTable->rowclass['captions_blocksize_eventfilter'] = 'field_half_width';
$userManagementTable->rowclass['fields_blocksize_eventfilter'] = 'field_half_width';
@ -591,41 +600,55 @@ $userManagementTable->data['fields_blocksize_eventfilter'][1] = html_print_selec
false,
false
);
if (is_metaconsole() === false) {
// Home screen table.
$homeScreenTable = new stdClass();
$homeScreenTable->class = 'w100p table_section full_section';
$homeScreenTable->id = 'home_screen_table';
$homeScreenTable->style = [];
$homeScreenTable->rowclass = [];
$homeScreenTable->data = [];
// Home screen.
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
$homeScreenValues,
'section',
io_safe_output($user_info['section']),
'show_data_section();',
'',
-1,
true,
false,
false
);
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
[
'class' => 'w100p',
'content' => $customHomeScreenDataField,
],
true
);
// Home screen table.
$homeScreenTable = new stdClass();
$homeScreenTable->class = 'w100p table_section full_section';
$homeScreenTable->id = 'home_screen_table';
$homeScreenTable->style = [];
$homeScreenTable->rowclass = [];
$homeScreenTable->data = [];
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
}
// Home screen.
$homeScreenTable->data['captions_homescreen'][0] = __('Home screen');
$homeScreenTable->colspan['captions_homescreen'][0] = 2;
$homeScreenTable->rowclass['captions_homescreen'] = 'field_half_width';
$homeScreenTable->rowclass['fields_homescreen'] = 'field_half_width flex';
$homeScreenTable->data['fields_homescreen'][0] = html_print_select(
$homeScreenValues,
'section',
io_safe_output($user_info['section']),
'show_data_section();',
'',
-1,
true,
false,
false
);
$homeScreenTable->data['fields_homescreen'][1] = html_print_div(
[
'class' => 'w100p',
'content' => $customHomeScreenDataField,
],
true
);
if (is_metaconsole() === true && users_is_admin() === true) {
$userManagementTable->rowclass['search_custom1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['search_custom2_looknfeel'] = 'field_half_width flex-column';
$userManagementTable->data['search_custom1_looknfeel'][0] = $searchCustomFieldView[0];
$userManagementTable->data['search_custom2_looknfeel'][0] = $searchCustomFieldView[1];
$userManagementTable->rowclass['homescreen_table'] = 'w100p';
$userManagementTable->data['homescreen_table'] = html_print_table($homeScreenTable, true);
$userManagementTable->rowclass['agent_manager1_looknfeel'] = 'field_half_width';
$userManagementTable->rowclass['agent_manager2_looknfeel'] = 'field_half_width flex-column';
$userManagementTable->data['agent_manager1_looknfeel'][0] = $metaconsoleAgentManager[0];
$userManagementTable->data['agent_manager1_looknfeel'][1] = $metaconsoleAgentManager[2];
$userManagementTable->data['agent_manager2_looknfeel'][0] = $metaconsoleAgentManager[1];
$userManagementTable->data['agent_manager2_looknfeel'][1] = $metaconsoleAgentManager[3];
}
// Timezone.
$userManagementTable->rowclass['captions_timezone'] = 'field_half_width';
@ -639,14 +662,15 @@ $userManagementTable->data['fields_timezone'][0] .= ui_print_input_placeholder(
__('The timezone must be that of the associated server.'),
true
);
$userManagementTable->data['fields_timezone'][1] = html_print_div(
[
'id' => 'timezone-picker',
'content' => implode('', $timezoneContent),
],
true
);
if (is_metaconsole() === false) {
$userManagementTable->data['fields_timezone'][1] = html_print_div(
[
'id' => 'timezone-picker',
'content' => implode('', $timezoneContent),
],
true
);
}
// Title for Language and Appearance.
$userManagementTable->data['title_additionalSettings'] = html_print_subtitle_table(__('Additional settings'));
@ -743,3 +767,19 @@ html_print_table($userManagementTable);
if ($new_user === false && ((bool) check_acl($config['id_user'], 0, 'UM') === true)) {
profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}
?>
<!--
<script>
paint_qrcode(
"
<?php
// echo ui_get_full_url('mobile/index.php?page=agent&id='.$id_agente);
?>
",
"#qr_code_agent_view",
128,
128
);
</script>
-->

View File

@ -4356,7 +4356,7 @@ function events_page_details($event, $server_id=0)
$graph_params_str = http_build_query($graph_params);
$link = "winopeng_var('".$url.'?'.$graph_params_str."','".$win_handle."', 800, 480)";
$link = 'winopeng_var("'.$url.'?'.$graph_params_str.'","'.$win_handle.'", 800, 480)';
$data[1] = html_print_button(__('View graph'), 'view_graph_button', false, $link, ['mode' => 'link'], true);
$table_details->data[] = $data;
}

View File

@ -1153,6 +1153,27 @@ function modules_get_raw_data($id_agent_module, $date_init, $date_end)
}
function module_get_min_max_tagente_datos($id_agent_module, $date_init, $date_end)
{
$table = modules_get_table_data($id_agent_module, null);
$datelimit = ($date_init - $date_end);
$search_in_history_db = db_search_in_history_db($datelimit);
$data = db_get_all_rows_sql(
'
SELECT max(datos) as max, min(datos) as min
FROM '.$table.'
WHERE id_agente_modulo = '.$id_agent_module.'
AND utimestamp >= '.$date_init.'
AND utimestamp <= '.$date_end,
$search_in_history_db
);
return $data;
}
function modules_get_agent_groups($id_agent_module)
{
$return = false;

View File

@ -191,15 +191,9 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$table->id = 'table_profiles';
$table->width = '100%';
$table->class = 'info_table';
if (is_metaconsole() === true) {
$table->head_colspan[0] = 0;
$table->width = '100%';
$table->class = 'databox_tactical data';
$table->title = $title;
} else {
echo '<div id="edit_user_profiles" class="floating_form white_box">';
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
}
echo '<div id="edit_user_profiles" class="floating_form white_box">';
echo '<p class="subsection_header_title padding-lft-10">'.$title.'</p>';
$table->data = [];
$table->head = [];
@ -405,9 +399,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
array_push($table->data, $data);
html_print_table($table, $return);
if (is_metaconsole() === false) {
echo '</div>';
}
echo '</div>';
unset($table);
}

View File

@ -3885,6 +3885,7 @@ function ui_print_datatable(array $parameters)
$("div.dataTables_paginate").hide();
$("div.dataTables_info").hide();
$("div.dataTables_length").hide();
$("div.dt-buttons").hide();
if (dt_'.$table_id.'.page.info().pages > 1) {
$(".dataTables_paginate.paging_simple_numbers").show()
@ -3895,6 +3896,7 @@ function ui_print_datatable(array $parameters)
$("div.dataTables_paginate").show();
$("div.dataTables_info").show();
$("div.dataTables_length").show();
$("div.dt-buttons").show();
if (dt_'.$table_id.'.page.info().pages == 1) {
$(".dataTables_paginate.paging_simple_numbers").hide()

View File

@ -316,6 +316,10 @@ class AvgSumMaxMinModule extends Widget
$values['unit'] = $decoder['unit'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
}
return $values;
}
@ -501,6 +505,18 @@ class AvgSumMaxMinModule extends Widget
],
];
// Layout.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'type' => 'switch',
'value' => $values['layout'],
'return' => true,
],
];
return $inputs;
}
@ -525,6 +541,7 @@ class AvgSumMaxMinModule extends Widget
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['text_color'] = \get_parameter('text_color', 0);
$values['unit'] = \get_parameter_switch('unit');
$values['layout'] = \get_parameter_switch('layout');
return $values;
}
@ -601,13 +618,13 @@ class AvgSumMaxMinModule extends Widget
break;
case 2:
$rows = modules_get_min_max_data($id_module, $to);
$rows = module_get_min_max_tagente_datos($id_module, $to, $now);
$data = $rows[0]['max'];
break;
case 3:
$rows = modules_get_min_max_data($id_module, $to);
$rows = module_get_min_max_tagente_datos($id_module, $to, $now);
$data = $rows[0]['min'];
break;
@ -621,11 +638,22 @@ class AvgSumMaxMinModule extends Widget
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
$output .= '<div class="container-center">';
$uuid = uniqid();
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
} else {
$orientation = 'grid';
}
// General div.
$output .= '<div class="container-icon">';
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;'.$text_color.'">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="font-size:'.$sizeValue.'px;'.$text_color.'">';
if (is_numeric($data) === true) {
$dataDatos = remove_right_zeros(
@ -651,11 +679,22 @@ class AvgSumMaxMinModule extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="font-size:'.$sizeLabel.'px;'.$text_color.'">'.$label.'</div>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '<script>
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
if (generalWidth >= containerWidth) {
$("#container-'.$uuid.'").css("align-items", "flex-start");
} else {
$("#container-'.$uuid.'").css("align-items", "center");
}
</script>';
return $output;
}

View File

@ -305,6 +305,10 @@ class ModuleIconWidget extends Widget
$values['imageSrc'] = $decoder['imageSrc'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
}
return $values;
}
@ -482,6 +486,18 @@ class ModuleIconWidget extends Widget
],
];
// Layout.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'type' => 'switch',
'value' => $values['layout'],
'return' => true,
],
];
return $inputs;
}
@ -504,6 +520,7 @@ class ModuleIconWidget extends Widget
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
$values['layout'] = \get_parameter_switch('layout');
return $values;
}
@ -533,39 +550,84 @@ class ModuleIconWidget extends Widget
$this->values['moduleId']
);
$unit = \modules_get_unit($this->values['moduleId']);
$icon = $this->values['imageSrc'];
$label = $this->values['label'];
$sizeLabel = (($this->values['sizeLabel'] !== 0) ? $this->values['sizeLabel'] : 20);
$sizeValue = (($this->values['sizeValue'] !== 0) ? $this->values['sizeValue'] : 20);
$sizeIcon = (($this->values['sizeIcon'] !== 0) ? $this->values['sizeIcon'] : 100);
$output .= '<div class="container-center">';
$uuid = uniqid();
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
}
// General div.
$output .= '<div class="container-icon">';
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
$sql = 'SELECT min_warning,
max_warning,
min_critical,
max_critical,
str_warning,
str_critical
FROM tagente_modulo
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
$sql_data = db_get_row_sql($sql);
$last = modules_get_last_value($this->values['moduleId']);
$color_icon = '_ok';
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
$color_icon = '_warning';
}
if ($last >= $sql_data['max_warning']) {
$color_icon = '_bad';
}
// Div image.
$output .= '<div style="flex: 0 1 '.$sizeIcon.'px;">';
$style_icon = 'flex: 0 1 '.$sizeIcon.'px;';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
$output .= html_print_image(
'images/console/icons/'.$icon.'.png',
'images/console/icons/'.$icon.$color_icon.'.png',
true,
['width' => $sizeIcon]
);
$output .= '</div>';
// Div value.
$output .= '<div style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
$output .= '<div class="mrgn_btn_15px" style="flex: 0 1 10px; font-size:'.$sizeValue.'px;">';
$output .= remove_right_zeros(
number_format($data_module, $config['graph_precision'], $config['decimal_separator'], $config['thousand_separator'])
);
).$unit;
$output .= '</div>';
if (empty($label) === false) {
// Div Label.
$output .= '<div style="flex: 1; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '<script>
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
if (generalWidth >= containerWidth) {
$("#container-'.$uuid.'").css("align-items", "flex-start");
} else {
$("#container-'.$uuid.'").css("align-items", "center");
}
</script>';
return $output;
}

View File

@ -300,6 +300,10 @@ class ModuleStatusWidget extends Widget
$values['imageSrc'] = $decoder['imageSrc'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
}
return $values;
}
@ -461,6 +465,18 @@ class ModuleStatusWidget extends Widget
],
];
// Layout.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'type' => 'switch',
'value' => $values['layout'],
'return' => true,
],
];
return $inputs;
}
@ -483,6 +499,7 @@ class ModuleStatusWidget extends Widget
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['sizeIcon'] = \get_parameter_switch('sizeIcon');
$values['layout'] = \get_parameter_switch('layout');
return $values;
}
@ -538,12 +555,22 @@ class ModuleStatusWidget extends Widget
break;
}
$output .= '<div class="container-center">';
$uuid = uniqid();
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex aligni_center';
} else {
$orientation = 'grid';
}
// General div.
$output .= '<div class="container-icon">';
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div image.
$output .= '<div style="flex: 0 1 '.$sizeIcon.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 0 1 '.$sizeIcon.'px;">';
$output .= html_print_image(
'images/console/icons/'.$icon,
true,
@ -553,11 +580,22 @@ class ModuleStatusWidget extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '<script>
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
if (generalWidth >= containerWidth) {
$("#container-'.$uuid.'").css("align-items", "flex-start");
} else {
$("#container-'.$uuid.'").css("align-items", "center");
}
</script>';
return $output;
}

View File

@ -284,6 +284,10 @@ class ModuleValueWidget extends Widget
$values['sizeLabel'] = $decoder['sizeLabel'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
}
return $values;
}
@ -385,6 +389,18 @@ class ModuleValueWidget extends Widget
],
];
// Layout.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'type' => 'switch',
'value' => $values['layout'],
'return' => true,
],
];
return $inputs;
}
@ -405,6 +421,7 @@ class ModuleValueWidget extends Widget
$values['moduleId'] = \get_parameter('moduleId', 0);
$values['sizeValue'] = \get_parameter('sizeValue', 0);
$values['sizeLabel'] = \get_parameter_switch('sizeLabel');
$values['layout'] = \get_parameter_switch('layout');
return $values;
}
@ -422,6 +439,7 @@ class ModuleValueWidget extends Widget
$output = '';
$id_module = $this->values['moduleId'];
$unit = modules_get_unit($this->values['moduleId']);
$data_module = \modules_get_last_value($id_module);
@ -429,11 +447,41 @@ class ModuleValueWidget extends Widget
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 40;
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 40;
$output .= '<div class="container-center">';
$sql = 'SELECT min_warning,
max_warning,
min_critical,
max_critical,
str_warning,
str_critical
FROM tagente_modulo
WHERE id_agente_modulo = '.(int) $this->values['moduleId'];
$sql_data = db_get_row_sql($sql);
$last = modules_get_last_value($this->values['moduleId']);
if (($last >= $sql_data['min_warning']) && ($last < $sql_data['max_warning'])) {
$color = COL_WARNING;
}
if ($last >= $sql_data['max_warning']) {
$color = COL_CRITICAL;
}
$uuid = uniqid();
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
} else {
$orientation = 'grid';
}
// General div.
$output .= '<div class="container-icon">';
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px; color: '.$color.'">';
if (is_numeric($data_module) === true) {
$dataDatos = remove_right_zeros(
@ -443,7 +491,7 @@ class ModuleValueWidget extends Widget
$config['decimal_separator'],
$config['thousand_separator']
)
);
).$unit;
} else {
$dataDatos = trim($data_module);
}
@ -454,11 +502,22 @@ class ModuleValueWidget extends Widget
if (empty($label) === false) {
// Div Label.
$output .= '<div style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1 '.$sizeLabel.'px; font-size:'.$sizeLabel.'px;">'.$label.'</div>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '<script>
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
if (generalWidth >= containerWidth) {
$("#container-'.$uuid.'").css("align-items", "flex-start");
} else {
$("#container-'.$uuid.'").css("align-items", "center");
}
</script>';
return $output;
}

View File

@ -282,10 +282,10 @@ class OsQuickReportWidget extends Widget
$table->head = [];
$table->head[0] = __('OS');
$table->head[1] = __('OS name');
$table->head[2] = ucfirst(__('total agents'));
$table->head[3] = ucfirst(__('normal agents'));
$table->head[4] = ucfirst(__('critical agents'));
$table->head[5] = ucfirst(__('unknown agents'));
$table->head[2] = ucfirst(__('total'));
$table->head[3] = ucfirst(__('normal'));
$table->head[4] = ucfirst(__('critical'));
$table->head[5] = ucfirst(__('unknown'));
$table->headstyle = [];
$table->headstyle[0] = 'text-align:center;background-color: '.$values['background'];
@ -296,12 +296,12 @@ class OsQuickReportWidget extends Widget
$table->headstyle[5] = 'text-align:center;background-color: '.$values['background'];
$table->style = [];
$table->style[0] = 'background-color: '.$values['background'];
$table->style[1] = 'background-color: '.$values['background'];
$table->style[2] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[3] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[4] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[5] = 'font-size: 22px;background-color: '.$values['background'];
$table->style[0] = 'background-color: '.$values['background'].';';
$table->style[1] = 'background-color: '.$values['background'].';';
$table->style[2] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[3] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[4] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
$table->style[5] = 'background-color: '.$values['background'].'; font-size: 1.5em; font-weight: bolder;';
foreach ($result as $id => $os) {
$data = [];

View File

@ -289,6 +289,10 @@ class SLAPercentWidget extends Widget
$values['period'] = $decoder['period'];
}
if (isset($decoder['layout']) === true) {
$values['layout'] = $decoder['layout'];
}
return $values;
}
@ -404,6 +408,18 @@ class SLAPercentWidget extends Widget
],
];
// Layout.
$inputs[] = [
'label' => __('Layout').ui_print_help_tip(__('Off: vertical. On: horizontal'), true),
'arguments' => [
'wrapper' => 'div',
'name' => 'layout',
'type' => 'switch',
'value' => $values['layout'],
'return' => true,
],
];
return $inputs;
}
@ -425,6 +441,7 @@ class SLAPercentWidget extends Widget
$values['period'] = \get_parameter('period', 0);
$values['sizeValue'] = \get_parameter('sizeValue', '');
$values['sizeLabel'] = \get_parameter('sizeLabel', '');
$values['layout'] = \get_parameter_switch('layout');
return $values;
}
@ -494,21 +511,42 @@ class SLAPercentWidget extends Widget
$sizeLabel = (isset($this->values['sizeLabel']) === true) ? $this->values['sizeLabel'] : 30;
$sizeValue = (isset($this->values['sizeValue']) === true) ? $this->values['sizeValue'] : 30;
$output .= '<div class="container-center">';
$uuid = uniqid();
$output .= '<div class="container-center" id="container-'.$uuid.'">';
$orientation = '';
if ((int) $this->values['layout'] === 1) {
$orientation = 'flex';
} else {
$orientation = 'grid';
}
// General div.
$output .= '<div class="container-icon">';
$output .= '<div class="'.$orientation.'" id="general-'.$uuid.'">';
// Div value.
$output .= '<div style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= '<div class="pdd_l_15px pdd_r_15px mrgn_btn_20px" style="flex: 0 1 '.$sizeValue.'px; font-size:'.$sizeValue.'px;">';
$output .= $sla_array['sla_fixed'].'%';
$output .= '</div>';
if (empty($label) === false) {
// Div Label.
$output .= '<div style="flex: 1 1; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
$output .= '<div class="pdd_l_15px pdd_r_15px" style="flex: 1 1; font-size:'.$sizeLabel.'px; text-align: left;">'.$label.'</div>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '<script>
var containerWidth = document.querySelector("#container-'.$uuid.'").offsetWidth;
var generalWidth = document.querySelector("#general-'.$uuid.'").offsetWidth;
if (generalWidth >= containerWidth) {
$("#container-'.$uuid.'").css("align-items", "flex-start");
} else {
$("#container-'.$uuid.'").css("align-items", "center");
}
</script>';
return $output;
}

View File

@ -11664,3 +11664,7 @@ div.ui-dialog-buttonset > button.ui-button.ui-corner-all.ui-widget:active {
background-color: #0d312f;
border-color: #0d312f;
}
div#menu_full > div#menu_tabs > ul.tabs_ul {
margin-bottom: 0px;
}