diff --git a/ci4/app/Helpers/general_helper.php b/ci4/app/Helpers/general_helper.php index 0736e7aa..8bad0bf2 100755 --- a/ci4/app/Helpers/general_helper.php +++ b/ci4/app/Helpers/general_helper.php @@ -101,6 +101,20 @@ function getGravatarURL(int $size = 30) { return "https://gravatar.com/avatar/".md5(auth()->user()->getEmail())."?s=".$size; } + + +if (!function_exists('gravatar_url')) { + function gravatar_url(?string $email, int $size = 40): string + { + if (!$email) { + return "https://www.gravatar.com/avatar/?s={$size}&d=mp"; + } + + return "https://www.gravatar.com/avatar/" . md5(strtolower(trim($email))) . "?s={$size}&d=identicon"; + } +} + + function getAllClassFolder($folder = null){ try { helper('filesystem'); diff --git a/ci4/app/Models/Usuarios/GroupModel.php b/ci4/app/Models/Usuarios/GroupModel.php index 704d0535..9530ebc2 100755 --- a/ci4/app/Models/Usuarios/GroupModel.php +++ b/ci4/app/Models/Usuarios/GroupModel.php @@ -100,6 +100,18 @@ class GroupModel extends \App\Models\BaseModel ->countAllResults(); } + public function getUsersByRol(string $groupKeyWord) + { + return $this->db + ->table('auth_groups_users agu') + ->select('u.id, ai.secret as email, u.first_name, u.last_name') + ->join('users u', 'u.id = agu.user_id') + ->join('auth_identities ai', 'ai.user_id = u.id AND ai.type = "email_password"', 'left') + ->where('agu.group', $groupKeyWord) + ->get() + ->getResult(); + } + public function getUsersRoles($userId) { diff --git a/ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php b/ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php index da3892ac..c07a6792 100755 --- a/ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php +++ b/ci4/app/Views/themes/vuexy/form/group/viewUserGroupList.php @@ -1,82 +1,94 @@ include('themes/_commonPartialsBs/datatables') ?> extend('themes/vuexy/main/defaultlayout') ?> section('content'); ?> -
-
-
-
-

-
-
-
- -
-
-
-
-
-
- add-new-roles -
+
+
+
+
+

+
+
+
+ +
+
+
+
+
+
+ add-new-roles
-
-
- -

-
+
+
+
+ +

+
- -
-
-
-
-
getUsersWithRol($item->keyword); ?>
+ + users = $model->getUsersByRol($item->keyword); ?> +
+
+
+
+
+ getUsersWithRol($item->keyword); ?> + +
+
    + users as $user): ?> +
  • + <?= esc($user->email) ?> +
  • + +
+
+
+
+

title) ?>

+ + +
-
-
-

title) ?>

- - - -
- ", + ", [ 'class' => 'text-muted', 'data-href' => route_to('deleteGroup', $item->id), 'data-bs-toggle' => 'modal', 'data-bs-target' => '#confirm2delete' - ]); - ?> -
+ ] + ); + ?>
- -
- +
+
- + +
+ -
- + -
-
-
+
+
+
+
endSection() ?> \ No newline at end of file