From e0b751b57f1bd5166a06a1ac7fc2aadbcd4315ef Mon Sep 17 00:00:00 2001 From: Daniel Cebrian Date: Wed, 14 Feb 2024 11:04:14 +0100 Subject: [PATCH] #12879 fixed message and button with acl in group list --- pandora_console/godmode/groups/group_list.php | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/pandora_console/godmode/groups/group_list.php b/pandora_console/godmode/groups/group_list.php index cbf92f59a0..f1b40867d9 100644 --- a/pandora_console/godmode/groups/group_list.php +++ b/pandora_console/godmode/groups/group_list.php @@ -880,6 +880,28 @@ if ($tab == 'tree') { echo "
"; + if (users_can_manage_group_all('AR') === false) { + $user_groups_acl = users_get_groups(false, 'AR'); + $groups_acl = implode('","', $user_groups_acl); + if (empty($groups_acl) === true) { + $is_management_allowed = false; + } + } + + html_print_div( + [ + 'content' => ui_print_info_message( + [ + 'no_close' => true, + 'message' => __('There are no defined groups'), + ], + '', + true + ), + 'class' => 'invisible', + 'id' => 'message-tree-info', + ] + ); } else { /* * Group list view. @@ -1246,7 +1268,7 @@ $tab = 'group_edition'; treeController.init({ recipient: $("div#tree-controller-recipient"), page: parameters['page'], - emptyMessage: "", + emptyMessage: $("#message-tree-info").html(), foundMessage: "", tree: data.tree, baseURL: "",