diff --git a/ci4/app/Controllers/Configuracion/Users.php b/ci4/app/Controllers/Configuracion/Users.php index 82cf1422..7864620f 100755 --- a/ci4/app/Controllers/Configuracion/Users.php +++ b/ci4/app/Controllers/Configuracion/Users.php @@ -265,7 +265,7 @@ class Users extends \App\Controllers\GoBaseController foreach ($chatDepartments as $chatDepartment) { $this->chat_department_user_model->insert([ "user_id" => $id, - "chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()["id"] + "chat_department_id" => $this->chat_department_model->where("name", $chatDepartment)->first()->id ]); } $id = $user->id ?? $id; diff --git a/ci4/app/Language/es/Chat.php b/ci4/app/Language/es/Chat.php index 1aca873e..0f130fb1 100644 --- a/ci4/app/Language/es/Chat.php +++ b/ci4/app/Language/es/Chat.php @@ -28,5 +28,6 @@ return [ "add_notification" => "Notificación", "check_as_unviewed" => "Marcar como no leídos", "add_notification_message" => "Envía a los usuarios añadidos una notificación con los mensajes presentes en el chat.", - "chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]' + "chat_title_presupuesto" => 'Presupuesto[{title,string,0}][{id}]', + "no_messages_notification" => 'No hay mensajes que revisar por el momento' ]; \ No newline at end of file diff --git a/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php b/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php index 3e75ae63..e7e5b32a 100644 --- a/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php +++ b/ci4/app/Views/themes/vuexy/form/user/_userFormItems.php @@ -61,11 +61,11 @@ $selectedChatDepartments = isset($chatDepartmentUser) && is_array($chatDepartmentUser) ? $chatDepartmentUser : []; $selectedKeywords = array_map(fn($chatDepartment) => $chatDepartment->name, $selectedChatDepartments); foreach ($chatDepartments as $item) : - $isSelected = in_array($item["name"], $selectedKeywords) ? 'selected' : ''; + $isSelected = in_array($item->name, $selectedKeywords) ? 'selected' : ''; ?> - diff --git a/ci4/app/Views/themes/vuexy/main/defaultlayout.php b/ci4/app/Views/themes/vuexy/main/defaultlayout.php index 40358745..c2cccd59 100644 --- a/ci4/app/Views/themes/vuexy/main/defaultlayout.php +++ b/ci4/app/Views/themes/vuexy/main/defaultlayout.php @@ -136,8 +136,9 @@ $picture = "/assets/img/default-user.png";
diff --git a/httpdocs/assets/js/safekat/components/chat.js b/httpdocs/assets/js/safekat/components/chat.js index 6099c028..8d0e7f06 100644 --- a/httpdocs/assets/js/safekat/components/chat.js +++ b/httpdocs/assets/js/safekat/components/chat.js @@ -722,9 +722,11 @@ export const showNotificationMessages = (dom) => { dom.empty() $("#chat-notification-number") if (data.totalMessages > 0) { + $("#chat-message-notification-title").addClass("d-none") $("#chat-notification-number").removeClass("d-none") $("#chat-notification-number").text(data.totalMessages ?? 0) } else { + $("#chat-message-notification-title").removeClass("d-none") $("#chat-notification-number").addClass("d-none") $("#chat-notification-number").text(0) } diff --git a/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js b/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js index b97191b4..ce8d102b 100644 --- a/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js +++ b/httpdocs/assets/js/safekat/pages/configuracion/messages/messagePage.js @@ -14,7 +14,7 @@ class MessagePage { this.formNewDirectMessage = this.modalNewMessage.item.find("#formNewDirectMessage") this.alert = new Alert($("#alertDirectMessage")) this.selectUsers = $("#select-users") - this.selectUsers = $("#select-departments") + this.selectDepartments = $("#select-departments") this.selectPlaceholder = { id: '0', @@ -25,7 +25,7 @@ class MessagePage { text: "Seleccione un departamento" } this.selectMessageUsers = new ClassSelect(this.selectUsers, '/chat/users/all', this.selectPlaceholder, true) - this.selectChatDepartment = new ClassSelect(this.selectUsers, '/chat/department/select', this.selectDepartmentPlaceholder, true) + this.selectChatDepartment = new ClassSelect(this.selectDepartments, '/chat/department/select', this.selectDepartmentPlaceholder, true) } init() {