Merge branch 'ent-9662-Restyling-fuentes-colores-botones' of https://brutus.artica.es:8081/artica/pandorafms into ent-9662-Restyling-fuentes-colores-botones

This commit is contained in:
Daniel Maya 2023-02-13 14:44:41 +01:00
commit e7f25c3944
6 changed files with 71 additions and 53 deletions

View File

@ -734,7 +734,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'); ?>"; document.location = "<?php echo ui_get_full_url('index.php'); ?>";
}); });
}); });
@ -757,7 +757,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'); ?>"; document.location = "<?php echo ui_get_full_url('index.php'); ?>";
}); });
}); });

View File

@ -28,7 +28,7 @@
// Load global vars. // Load global vars.
global $config; global $config;
// hd($_REQUEST); //TODO. For testing purposes. // hd($_REQUEST, true); //TODO. For testing purposes.
check_login(); check_login();
require_once $config['homedir'].'/vendor/autoload.php'; require_once $config['homedir'].'/vendor/autoload.php';
@ -234,35 +234,39 @@ if (is_metaconsole() === true) {
user_meta_print_header(); user_meta_print_header();
$sec = 'advanced'; $sec = 'advanced';
} else { } else {
$buttons = [ if ((bool) check_acl($config['id_user'], 0, 'UM') === false) {
'user' => [ $buttons = [];
'active' => false, } else {
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">'.html_print_image( $buttons = [
'images/user.svg', 'user' => [
true, 'active' => false,
[ 'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure='.$pure.'">'.html_print_image(
'title' => __('User management'), 'images/user.svg',
'class' => 'invert_filter main_menu_icon', true,
] [
).'</a>', 'title' => __('User management'),
], 'class' => 'invert_filter main_menu_icon',
'profile' => [ ]
'active' => false, ).'</a>',
'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">'.html_print_image( ],
'images/suitcase@svg.svg', 'profile' => [
true, 'active' => false,
[ 'text' => '<a href="index.php?sec=gusuarios&sec2=godmode/users/profile_list&tab=profile&pure='.$pure.'">'.html_print_image(
'title' => __('Profile management'), 'images/suitcase@svg.svg',
'class' => 'invert_filter main_menu_icon', true,
] [
).'</a>', 'title' => __('Profile management'),
], 'class' => 'invert_filter main_menu_icon',
]; ]
).'</a>',
],
];
$buttons[$tab]['active'] = true; $buttons[$tab]['active'] = true;
}
ui_print_standard_header( ui_print_standard_header(
(empty($id) === false) ? sprintf('%s [ %s ]', __('Update User'), $config['id_user']) : __('Create User'), (empty($id) === false) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
'images/gm_users.png', 'images/gm_users.png',
false, false,
'', '',
@ -521,7 +525,6 @@ if ($create_user === true) {
$info $info
); );
HD('patatas', true);
ui_print_result_message( ui_print_result_message(
$result, $result,
__('Successfully created'), __('Successfully created'),
@ -541,7 +544,7 @@ if ($create_user === true) {
$user_info = get_user_info($id); $user_info = get_user_info($id);
$new_user = false; $new_user = false;
if (!empty($json_profile)) { if (empty($json_profile) === false) {
$json_profile = json_decode(io_safe_output($json_profile), true); $json_profile = json_decode(io_safe_output($json_profile), true);
foreach ($json_profile as $key => $profile) { foreach ($json_profile as $key => $profile) {
if (is_array($profile) === false) { if (is_array($profile) === false) {
@ -769,6 +772,7 @@ if ($update_user) {
); );
} }
hd('res1-res2', true);
ui_print_result_message( ui_print_result_message(
$res1 || $res2, $res1 || $res2,
__('User info successfully updated'), __('User info successfully updated'),
@ -842,7 +846,7 @@ if ($update_user) {
false, false,
$info $info
); );
hd('apitoken', true);
ui_print_result_message( ui_print_result_message(
$res1, $res1,
($apiTokenRenewed === true) ? __('You have generated a new API Token.') : __('User info successfully updated'), ($apiTokenRenewed === true) ? __('You have generated a new API Token.') : __('User info successfully updated'),
@ -890,7 +894,7 @@ if ((int) $status !== -1) {
} }
if ($add_profile && empty($json_profile)) { if ($add_profile && empty($json_profile)) {
$id2 = (string) get_parameter('id'); $id2 = (string) get_parameter('id', get_parameter('id_user'));
$group2 = (int) get_parameter('assign_group'); $group2 = (int) get_parameter('assign_group');
$profile2 = (int) get_parameter('assign_profile'); $profile2 = (int) get_parameter('assign_profile');
$tags = (array) get_parameter('assign_tags'); $tags = (array) get_parameter('assign_tags');
@ -911,6 +915,15 @@ if ($add_profile && empty($json_profile)) {
false, false,
'Profile: '.$profile2.' Group: '.$group2.' Tags: '.$tags 'Profile: '.$profile2.' Group: '.$group2.' Tags: '.$tags
); );
/*
hd('>>>>>', true);
hd($id2, true);
hd($profile2, true);
hd($group2, true);
hd($tags, true);
hd($no_hierarchy, true);
hd('<<<<<<', true);
*/
$return = profile_create_user_profile($id2, $profile2, $group2, false, $tags, $no_hierarchy); $return = profile_create_user_profile($id2, $profile2, $group2, false, $tags, $no_hierarchy);
if ($return === false) { if ($return === false) {
$is_err = true; $is_err = true;
@ -964,9 +977,9 @@ if (isset($values) === true && empty($values) === false) {
$user_info = $values; $user_info = $values;
} }
if (!users_is_admin() && $config['id_user'] != $id && !$new_user) { if (!users_is_admin() && $config['id_user'] !== $id && $new_user === false) {
$group_um = users_get_groups_UM($config['id_user']); $group_um = users_get_groups_UM($config['id_user']);
if (isset($group_um[0])) { if (isset($group_um[0]) === true) {
$group_um_string = implode(',', array_keys(users_get_groups($config['id_user'], 'um', true))); $group_um_string = implode(',', array_keys(users_get_groups($config['id_user'], 'um', true)));
} else { } else {
$group_um_string = implode(',', array_keys($group_um)); $group_um_string = implode(',', array_keys($group_um));
@ -996,7 +1009,7 @@ if (is_metaconsole() === true) {
html_print_div( html_print_div(
[ [
'class' => 'user_form_title', 'class' => 'user_form_title',
'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $config['id_user']) : __('Create User'), 'content' => ((bool) $id === true) ? sprintf('%s [ %s ]', __('Update User'), $id) : __('Create User'),
] ]
); );
} }
@ -1819,11 +1832,13 @@ if ((bool) $config['admin_can_add_user'] === true) {
); );
} }
$actionButtons[] = html_print_go_back_button( if ((bool) check_acl($config['id_user'], 0, 'UM') === true) {
ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0'), $actionButtons[] = html_print_go_back_button(
['button_class' => ''], ui_get_full_url('index.php?sec=gusuarios&sec2=godmode/users/user_list&tab=user&pure=0'),
true ['button_class' => ''],
); true
);
}
html_print_action_buttons(implode('', $actionButtons), ['type' => 'form_action']); html_print_action_buttons(implode('', $actionButtons), ['type' => 'form_action']);

View File

@ -133,7 +133,7 @@ $userManagementTable->colspan = [];
$userManagementTable->rowspan = []; $userManagementTable->rowspan = [];
// Title for Profile information. // Title for Profile information.
$sustitleTable = ($new_user === true) ? __('Profile information') : sprintf('%s [ %s ]', __('Profile information for'), $config['id_user']); $sustitleTable = ($new_user === true) ? __('Profile information') : sprintf('%s [ %s ]', __('Profile information for'), $id);
$userManagementTable->data['title_profile_information'] = html_print_subtitle_table($sustitleTable); $userManagementTable->data['title_profile_information'] = html_print_subtitle_table($sustitleTable);
// Id user. // Id user.
@ -701,6 +701,7 @@ $userManagementTable->data['fields_addSettings'][1] .= html_print_div(
); );
html_print_table($userManagementTable); html_print_table($userManagementTable);
// User Profile definition table. (Only where user is not creating).
// User Profile definition table. 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 && $new_user === true)); profile_print_profile_table($id, io_safe_output($json_profile), false, ($is_err === true));
}

View File

@ -117,7 +117,9 @@ function profile_create_user_profile(
'assigned_by' => $assign, 'assigned_by' => $assign,
'no_hierarchy' => $no_hierarchy ? 1 : 0, 'no_hierarchy' => $no_hierarchy ? 1 : 0,
]; ];
hd('inicio insert', true);
hd($insert, true);
hd('final insert', true);
return db_process_sql_insert('tusuario_perfil', $insert); return db_process_sql_insert('tusuario_perfil', $insert);
} }
@ -225,7 +227,8 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
} else { } else {
// Only profiles that can be viewed by the user. // Only profiles that can be viewed by the user.
$group_um = users_get_groups_UM($config['id_user']); $group_um = users_get_groups_UM($config['id_user']);
if (isset($group_um[0])) { hd($group_um, true);
if (isset($group_um[0]) === true) {
$group_um_string = implode(',', array_keys(users_get_groups($config['id_user'], 'um', true))); $group_um_string = implode(',', array_keys(users_get_groups($config['id_user'], 'um', true)));
} else { } else {
$group_um_string = implode(',', array_keys($group_um)); $group_um_string = implode(',', array_keys($group_um));
@ -238,7 +241,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$id, $id,
$group_um_string $group_um_string
); );
hd($sql, true);
$result = db_get_all_rows_sql($sql); $result = db_get_all_rows_sql($sql);
} }

View File

@ -501,11 +501,11 @@ function ui_print_empty_data($message, $attributes='', $return=false, $tag='h3')
*/ */
function ui_print_result_message($result, $good='', $bad='', $attributes='', $return=false, $tag='h3') function ui_print_result_message($result, $good='', $bad='', $attributes='', $return=false, $tag='h3')
{ {
if (empty($good) === false || $good === false) { if (empty($good) === true || $good === false) {
$good = __('Request successfully processed'); $good = __('Request successfully processed');
} }
if (empty($bad) === false || $bad === false) { if (empty($bad) === true || $bad === false) {
$bad = __('Error processing request'); $bad = __('Error processing request');
} }

View File

@ -1740,7 +1740,7 @@ div.title_line {
display: flex; display: flex;
align-items: flex-end; align-items: flex-end;
justify-content: space-between; justify-content: space-between;
border-bottom: 1px solid #14524f; border-bottom: 1px solid #c1ccdc;
/* width: calc(100% + 3em); */ /* width: calc(100% + 3em); */
width: -webkit-fill-available; width: -webkit-fill-available;
width: -moz-fill-available; width: -moz-fill-available;
@ -1749,7 +1749,6 @@ div.title_line {
height: 56px; height: 56px;
box-sizing: border-box; box-sizing: border-box;
background-color: #fff; background-color: #fff;
box-shadow: 1px 1px 4px rgb(0 0 0 / 10%);
/* margin-left: -3em;*/ /* margin-left: -3em;*/
} }
@ -9920,7 +9919,7 @@ select:disabled,
color: #8a96a6; color: #8a96a6;
} }
input:focus, input:not([type="image"]):focus,
textarea:focus, textarea:focus,
select:focus { select:focus {
border: 1px solid #8a96a6; border: 1px solid #8a96a6;