Minor fixes

This commit is contained in:
Jose Gonzalez 2023-02-08 17:20:52 +01:00
parent 4d9c6ab33a
commit 4b592b6610
7 changed files with 53 additions and 17 deletions

View File

@ -262,7 +262,7 @@ if (is_metaconsole() === true) {
$buttons[$tab]['active'] = true;
ui_print_standard_header(
(empty($id) === false) ? __('Update user') : __('Create user'),
(empty($id) === false) ? sprintf('%s [ %s ]', __('Update User'), $config['id_user']) : __('Create User'),
'images/gm_users.png',
false,
'',
@ -996,7 +996,7 @@ if (is_metaconsole() === true) {
html_print_div(
[
'class' => 'user_form_title',
'content' => ((bool) $id === true) ? __('Update User') : __('Create User'),
'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $config['id_user']) : __('Create User'),
]
);
}

View File

@ -993,6 +993,7 @@ foreach ($info as $user_id => $user_info) {
}
html_print_table($table);
$tablePagination = ui_pagination(count($info), false, 0, 0, true, 'offset', false, 'dataTables_paginate paging_simple_numbers');
unset($table);
if ($is_management_allowed === true) {
if ($config['admin_can_add_user'] !== false) {
@ -1005,13 +1006,30 @@ if ($is_management_allowed === true) {
[ 'icon' => 'wand' ],
true
),
['type' => 'form_action'],
[
'type' => 'form_action',
'right_content' => $tablePagination,
],
);
html_print_input_hidden('new_user', 1);
echo '</form>';
} else {
echo '<i>'.__("The current authentication scheme doesn't support creating users on %s", get_product_name()).'</i>';
}
} else {
html_print_action_buttons(
html_print_submit_button(
__('Create user'),
'none',
true,
[ 'icon' => 'wand' ],
true
),
[
'type' => 'form_action',
'right_content' => $tablePagination,
],
);
}
enterprise_hook('close_meta_frame');

View File

@ -31,7 +31,6 @@ global $config;
check_login();
// Bussiness Logic.
// Data for homescreen section.
$homeScreenValues = [
@ -121,10 +120,6 @@ if (is_metaconsole() === false) {
$timezoneContent[] = '<map name="timezone-map" id="timezone-map">'.$area_data_timezone_polys.$area_data_timezone_rects.'</map>';
}
// Create the view.
$userManagementTable = new stdClass();
$userManagementTable->id = 'advanced';
@ -138,7 +133,8 @@ $userManagementTable->colspan = [];
$userManagementTable->rowspan = [];
// Title for Profile information.
$userManagementTable->data['title_profile_information'] = html_print_subtitle_table(__('Profile information'));
$sustitleTable = ($new_user === true) ? __('Profile information') : sprintf('%s [ %s ]', __('Profile information for'), $config['id_user']);
$userManagementTable->data['title_profile_information'] = html_print_subtitle_table($sustitleTable);
// Id user.
if ($new_user === true) {

View File

@ -3516,6 +3516,10 @@ function html_print_button($label='OK', $name='', $disabled=false, $script='', $
$classes .= ' buttonButton';
}
if ($disabled === true) {
$classes .= ' disabled_action_button';
}
$output = sprintf(
'<button type="%s" class="%s" %s %s %s %s %s %s>%s</button>',
$buttonType,

View File

@ -213,6 +213,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$table->head['actions'] = __('Action');
$table->align['actions'] = 'center';
$table->headstyle['tags'] = 'width: 33%';
$table->headstyle['hierarchy'] = 'text-align: center';
$table->headstyle['actions'] = 'text-align: center';
@ -263,17 +264,30 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$lastKey = 0;
foreach ($result as $key => $profile) {
if ($profile['id_grupo'] == -1) {
if ((int) $profile['id_grupo'] === -1) {
continue;
}
$data = [];
$data['name'] = '<a href="index.php?sec='.$sec.'&amp;sec2=godmode/users/configure_profile&id='.$profile['id_perfil'].'&pure='.$pure.'">'.profile_get_name($profile['id_perfil']).'</a>';
$profileName = profile_get_name($profile['id_perfil']);
if (is_management_allowed() === false) {
$data['name'] = $profileName;
} else {
$data['name'] = html_print_anchor(
[
'href' => 'index.php?sec2=godmode/users/configure_profile&id='.$profile['id_perfil'],
'content' => $profileName,
],
true
);
}
$data['group'] = ui_print_group_icon($profile['id_grupo'], true);
if (is_metaconsole() === false) {
$data['group'] .= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'&pure='.$pure.'">';
$data['group'] .= '<a href="index.php?sec=estado&sec2=operation/agentes/estado_agente&refr=60&group_id='.$profile['id_grupo'].'">';
}
$data['group'] .= '&nbsp;'.ui_print_truncate_text(groups_get_name($profile['id_grupo'], true), GENERIC_SIZE_TEXT);

View File

@ -2127,25 +2127,26 @@ function ui_pagination(
$set_id=''
) {
global $config;
ui_require_css_file('tables');
if (empty($pagination)) {
if (empty($pagination) === true) {
$pagination = (int) $config['block_size'];
}
if (is_string($offset)) {
if (is_string($offset) === true) {
$offset_name = $offset;
$offset = (int) get_parameter($offset_name);
}
if (empty($offset)) {
if (empty($offset) === true) {
$offset = (int) get_parameter($offset_name);
}
if (empty($url)) {
if (empty($url) === true) {
$url = ui_get_url_refresh([$offset_name => false]);
}
if (!empty($set_id)) {
if (empty($set_id) === false) {
$set_id = " id = '".$set_id."'";
}

View File

@ -10253,6 +10253,9 @@ button.submitButton.link:active > div {
background-color: #0d312f !important;
}
button.disabled_action_button {
visibility: hidden;
}
button div.camera {
mask: url(../../images/svg/picture.svg) no-repeat center / contain;
-webkit-mask: url(../../images/svg/picture.svg) no-repeat center / contain;