mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-9817-duplicado-de-perfiles-al-crear-agente' into 'develop'
Ent 9817 duplicado de perfiles al crear agente See merge request artica/pandorafms!5377
This commit is contained in:
commit
2f4758009b
@ -1643,13 +1643,18 @@ if ($config['admin_can_add_user']) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo '</div>';
|
echo '</div>';
|
||||||
|
if ($new_user === true) {
|
||||||
|
html_print_input_hidden('json_profile', $json_profile);
|
||||||
|
}
|
||||||
|
|
||||||
html_print_input_hidden('json_profile', $json_profile);
|
|
||||||
|
|
||||||
echo '</form>';
|
echo '</form>';
|
||||||
|
|
||||||
|
if ($is_err === true && $new_user === true) {
|
||||||
profile_print_profile_table($id, io_safe_output($json_profile));
|
profile_print_profile_table($id, io_safe_output($json_profile), false, true);
|
||||||
|
} else {
|
||||||
|
profile_print_profile_table($id, io_safe_output($json_profile));
|
||||||
|
}
|
||||||
|
|
||||||
echo '<br />';
|
echo '<br />';
|
||||||
|
|
||||||
@ -1869,6 +1874,8 @@ $(document).ready (function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('input:image[name="del"]').click(function (e) {
|
$('input:image[name="del"]').click(function (e) {
|
||||||
|
if($(json_profile).length > 0) return;
|
||||||
|
if (!confirm ('Are you sure?')) return;
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var rows = $("#table_profiles tr").length;
|
var rows = $("#table_profiles tr").length;
|
||||||
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
if (((is_metaconsole === '1' && rows <= 4) || (is_metaconsole === '' && rows <= 3)) && user_is_global_admin !== '1') {
|
||||||
|
@ -181,7 +181,7 @@ function profile_delete_profile_and_clean_users($id_profile)
|
|||||||
* @param int User id
|
* @param int User id
|
||||||
* @param bool Show the tags select or not
|
* @param bool Show the tags select or not
|
||||||
*/
|
*/
|
||||||
function profile_print_profile_table($id, $json_profile=false, $return=false)
|
function profile_print_profile_table($id, $json_profile=false, $return=false, $create_user=false)
|
||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
@ -296,12 +296,26 @@ function profile_print_profile_table($id, $json_profile=false, $return=false)
|
|||||||
|
|
||||||
$data['hierarchy'] = $profile['no_hierarchy'] ? __('Yes') : __('No');
|
$data['hierarchy'] = $profile['no_hierarchy'] ? __('Yes') : __('No');
|
||||||
|
|
||||||
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
if ($create_user) {
|
||||||
$data['actions'] .= html_print_input_image('del', 'images/cross.png', 1, ['class' => 'invert_filter'], true);
|
$data['actions'] .= html_print_input_image(
|
||||||
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
'del',
|
||||||
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
'images/cross.png',
|
||||||
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
1,
|
||||||
$data['actions'] .= '</form>';
|
'',
|
||||||
|
true,
|
||||||
|
[
|
||||||
|
'onclick' => 'delete_profile(event, this)',
|
||||||
|
'class' => 'invert_filter',
|
||||||
|
]
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
$data['actions'] = '<form method="post" onsubmit="if (!confirm (\''.__('Are you sure?').'\')) return false">';
|
||||||
|
$data['actions'] .= html_print_input_image('del', 'images/cross.png', 1, ['class' => 'invert_filter'], true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('delete_profile', 1, true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('id_user_profile', $profile['id_up'], true);
|
||||||
|
$data['actions'] .= html_print_input_hidden('id_user', $id, true);
|
||||||
|
$data['actions'] .= '</form>';
|
||||||
|
}
|
||||||
|
|
||||||
array_push($table->data, $data);
|
array_push($table->data, $data);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user