mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
fix : mensaje-internos only users in group admin and beta
This commit is contained in:
@ -210,6 +210,7 @@ class ChatModel extends Model
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("pedidos","pedidos.id = chats.pedido_id","left")
|
||||
->whereIn("pedidos.id",$pedidos)
|
||||
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
|
||||
->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
@ -237,6 +238,7 @@ class ChatModel extends Model
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("facturas","facturas.id = chats.factura_id","left")
|
||||
->whereIn("facturas.id",$facturas)
|
||||
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
|
||||
->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
@ -264,6 +266,7 @@ class ChatModel extends Model
|
||||
->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
|
||||
->join("presupuestos","presupuestos.id = chats.presupuesto_id","left")
|
||||
->whereIn("presupuestos.id",$presupuestos)
|
||||
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
|
||||
->get()->getResultObject();
|
||||
$chatMessageModel = model(ChatMessageModel::class);
|
||||
$count = 0;
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_factura", data: ["modelId" => $modelId,"type" => "factura"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId,"type" => "factura"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_pedido", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -15,17 +15,21 @@
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link active" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-chat" aria-controls="navs-pills-top-internal-chat" aria-selected="false">Chat</button>
|
||||
</li>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<li class="nav-item">
|
||||
<button type="button" class="nav-link" role="tab" data-bs-toggle="tab" data-bs-target="#navs-pills-top-internal-messages" aria-controls="navs-pills-top-internal-messages" aria-selected="false">Mensajes internos</button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/chat_presupuesto", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
|
||||
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
|
||||
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -37,16 +37,6 @@
|
||||
<!-- CHAT LIST -->
|
||||
|
||||
</ul>
|
||||
<!-- Contacts -->
|
||||
<ul class="list-unstyled chat-contact-list mb-0" id="contact-list">
|
||||
<li class="chat-contact-list-item chat-contact-list-item-title">
|
||||
<h5 class="text-primary mb-0">Contactos</h5>
|
||||
</li>
|
||||
<li class="chat-contact-list-item contact-list-item-0 d-none">
|
||||
<h6 class="text-muted mb-0">No Contacts Found</h6>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- /Chat contacts -->
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
<div class="container-xl flex-grow-1 container-p-y" id="chat-presupuesto" data-id="<?= $modelId ?>">
|
||||
<div id="chat-presupuesto" data-id="<?= $modelId ?>">
|
||||
<div class="app-chat card overflow-hidden">
|
||||
<div class="row g-0">
|
||||
|
||||
|
||||
@ -54,14 +54,15 @@ class Chat {
|
||||
if (this.chatContactsBody[0]) {
|
||||
this.scrollbarContacts = new PerfectScrollbar(this.chatContactsBody[0], {
|
||||
wheelPropagation: false,
|
||||
suppressScrollX: true
|
||||
suppressScrollX: true,
|
||||
});
|
||||
}
|
||||
|
||||
if (this.chatHistoryBody[0]) {
|
||||
this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], {
|
||||
wheelPropagation: false,
|
||||
suppressScrollX: true
|
||||
suppressScrollX: true,
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,9 @@ $(document).ready(() => {
|
||||
let chat = new Chat($("#chat-factura"))
|
||||
chat.init()
|
||||
chat.initFactura()
|
||||
if($("#internal_messages_chat").length > 0){
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
}
|
||||
|
||||
})
|
||||
@ -5,7 +5,9 @@ $(document).ready(() => {
|
||||
let chat = new Chat($("#chat-pedido"))
|
||||
chat.init()
|
||||
chat.initPedido()
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
if($("#internal_messages_chat").length > 0){
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
}
|
||||
|
||||
})
|
||||
@ -5,7 +5,9 @@ $(document).ready(() => {
|
||||
let chat = new Chat($("#chat-presupuesto"))
|
||||
chat.init()
|
||||
chat.initPresupuesto()
|
||||
if($("#internal_messages_chat").length > 0){
|
||||
let internalMessages = new InternalMessages($("#internal_messages_chat"))
|
||||
internalMessages.init()
|
||||
}
|
||||
|
||||
})
|
||||
@ -7,7 +7,7 @@ a.send-msg-btn {
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.layout-horizontal .app-chat {
|
||||
height: calc(100vh - 11.5rem - 2.2rem) !important;
|
||||
height: calc(100vh - 20rem - 2.2rem) !important;
|
||||
}
|
||||
}
|
||||
@media (max-width: 992px) {
|
||||
@ -35,7 +35,7 @@ a.send-msg-btn {
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.layout-horizontal .app-chat .app-chat-contacts {
|
||||
height: calc(100vh - 11.5rem - 2.2rem);
|
||||
height: calc(100vh - 20rem - 2.2rem);
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
@ -97,7 +97,7 @@ a.send-msg-btn {
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.layout-horizontal .app-chat .app-chat-sidebar-left {
|
||||
height: calc(100vh - 11.5rem - 2.2rem);
|
||||
height: calc(100vh - 20rem - 2.2rem);
|
||||
}
|
||||
}
|
||||
.app-chat .app-chat-sidebar-left.show {
|
||||
@ -119,7 +119,7 @@ a.send-msg-btn {
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.layout-horizontal .app-chat .app-chat-history {
|
||||
height: calc(100vh - 11.5rem - 2.2rem);
|
||||
height: calc(100vh - 20rem - 2.2rem);
|
||||
}
|
||||
}
|
||||
.app-chat .app-chat-history .chat-history-header {
|
||||
@ -182,7 +182,7 @@ a.send-msg-btn {
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.layout-horizontal .app-chat .app-chat-sidebar-right {
|
||||
height: calc(100vh - 11.5rem - 2.2rem);
|
||||
height: calc(100vh - 20rem - 2.2rem);
|
||||
}
|
||||
}
|
||||
.app-chat .app-chat-sidebar-right.show {
|
||||
|
||||
Reference in New Issue
Block a user