Merge branch 'ent-11375-user-bulk-operations-al-intentar-anadir-un-perfil-que-el-usuario-ya-tiene-el-aviso-de-error' into 'develop'

Ent 11375 user bulk operations al intentar anadir un perfil que el usuario ya tiene el aviso de error

See merge request artica/pandorafms!6160
This commit is contained in:
Rafael Ameijeiras 2023-08-18 06:37:31 +00:00
commit 640c417a35
1 changed files with 4 additions and 1 deletions

View File

@ -103,6 +103,7 @@ if ($create_profiles) {
$groups_id = get_parameter('groups_id', -1);
$users_id = get_parameter('users_id', -1);
$n_added = 0;
$msg_error = __('Profiles cannot be added');
if ($profiles_id == -1 || $groups_id == -1 || $users_id == -1) {
$result = false;
@ -155,6 +156,8 @@ if ($create_profiles) {
if ($return !== false) {
$n_added++;
}
} else {
$msg_error = __('The profile already exist on the user');
}
}
}
@ -182,7 +185,7 @@ if ($create_profiles) {
ui_print_result_message(
$n_added > 0,
__('Profiles added successfully').'('.$n_added.')',
__('Profiles cannot be added')
$msg_error
);
}