Merge branch 'feat/add-chat-presupuesto-cliente' into 'dev/presu_cliente_v2'

Feat/add chat presupuesto cliente

See merge request jjimenez/safekat!354
This commit is contained in:
Alvaro
2024-10-23 05:19:36 +00:00
18 changed files with 45 additions and 125834 deletions

3
.gitignore vendored
View File

@ -1,4 +1,5 @@
ci4/.env ci4/.env
.vscode/ .vscode/
xdebug.log xdebug.log
xdebug.*

View File

@ -156,7 +156,7 @@ class Presupuestocliente extends \App\Controllers\BaseResourceController
$this->model->removeIsDuplicado($presupuestoEntity->id); $this->model->removeIsDuplicado($presupuestoEntity->id);
} }
$this->viewData['presupuestoId'] = $presupuestoEntity->id;
$this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . $this->viewData['pageTitle'] . ' ' . lang('Basic.global.edit3'); $this->viewData['boxTitle'] = lang('Basic.global.edit2') . ' ' . $this->viewData['pageTitle'] . ' ' . lang('Basic.global.edit3');
return $this->displayForm(__METHOD__, $id); return $this->displayForm(__METHOD__, $id);

View File

@ -2,6 +2,7 @@
return [ return [
"chat" => "Mensajería", "chat" => "Mensajería",
"messages" => "Mensajes",
"modal" => [ "modal" => [
"new_hebra" => "Nueva hebra", "new_hebra" => "Nueva hebra",
"title" => "Título", "title" => "Título",

View File

@ -210,6 +210,7 @@ class ChatModel extends Model
->join("chat_departments","chat_departments.id = chats.chat_department_id","left") ->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("pedidos","pedidos.id = chats.pedido_id","left") ->join("pedidos","pedidos.id = chats.pedido_id","left")
->whereIn("pedidos.id",$pedidos) ->whereIn("pedidos.id",$pedidos)
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
->get()->getResultObject(); ->get()->getResultObject();
$chatMessageModel = model(ChatMessageModel::class); $chatMessageModel = model(ChatMessageModel::class);
$count = 0; $count = 0;
@ -237,6 +238,7 @@ class ChatModel extends Model
->join("chat_departments","chat_departments.id = chats.chat_department_id","left") ->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("facturas","facturas.id = chats.factura_id","left") ->join("facturas","facturas.id = chats.factura_id","left")
->whereIn("facturas.id",$facturas) ->whereIn("facturas.id",$facturas)
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
->get()->getResultObject(); ->get()->getResultObject();
$chatMessageModel = model(ChatMessageModel::class); $chatMessageModel = model(ChatMessageModel::class);
$count = 0; $count = 0;
@ -264,6 +266,7 @@ class ChatModel extends Model
->join("chat_departments","chat_departments.id = chats.chat_department_id","left") ->join("chat_departments","chat_departments.id = chats.chat_department_id","left")
->join("presupuestos","presupuestos.id = chats.presupuesto_id","left") ->join("presupuestos","presupuestos.id = chats.presupuesto_id","left")
->whereIn("presupuestos.id",$presupuestos) ->whereIn("presupuestos.id",$presupuestos)
->where("chats.chat_department_id is NOT NULL",NULL,FALSE)
->get()->getResultObject(); ->get()->getResultObject();
$chatMessageModel = model(ChatMessageModel::class); $chatMessageModel = model(ChatMessageModel::class);
$count = 0; $count = 0;

View File

@ -15,17 +15,21 @@
<li class="nav-item"> <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> <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> </li>
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<li class="nav-item"> <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> <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> </li>
<?php } ?>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel"> <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"]) ?> <?= view("themes/vuexy/components/chat_factura", data: ["modelId" => $modelId,"type" => "factura"]) ?>
</div> </div>
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel"> <div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId,"type" => "factura"]) ?> <?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId,"type" => "factura"]) ?>
</div> </div>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -15,17 +15,21 @@
<li class="nav-item"> <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> <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> </li>
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<li class="nav-item"> <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> <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> </li>
<?php } ?>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel"> <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"]) ?> <?= view("themes/vuexy/components/chat_pedido", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
</div> </div>
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel"> <?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?> <div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
</div> <?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "pedido"]) ?>
</div>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -15,17 +15,21 @@
<li class="nav-item"> <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> <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> </li>
<?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<li class="nav-item"> <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> <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> </li>
<?php } ?>
</ul> </ul>
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane fade show active" id="navs-pills-top-chat" role="tabpanel"> <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"]) ?> <?= view("themes/vuexy/components/chat_presupuesto", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
</div> </div>
<div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel"> <?php if (auth()->user()->inGroup('admin') || auth()->user()->inGroup('beta')) { ?>
<?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?> <div class="tab-pane fade" id="navs-pills-top-internal-messages" role="tabpanel">
</div> <?= view("themes/vuexy/components/internal_messages", data: ["modelId" => $modelId, "type" => "presupuesto"]) ?>
</div>
<?php } ?>
</div> </div>
</div> </div>
</div> </div>

View File

@ -37,16 +37,6 @@
<!-- CHAT LIST --> <!-- CHAT LIST -->
</ul> </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>
</div> </div>
<!-- /Chat contacts --> <!-- /Chat contacts -->

View File

@ -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="app-chat card overflow-hidden">
<div class="row g-0"> <div class="row g-0">

View File

@ -31,7 +31,7 @@
</form> </form>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.come_back') ?></button> <button type="button" class="btn btn-label-secondary" data-bs-dismiss="modal"><?= lang('App.global_come_back') ?></button>
<button type="button" id="submit_new_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send') ?></button> <button type="button" id="submit_new_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send') ?></button>
<button type="button" id="submit_update_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send_update') ?></button> <button type="button" id="submit_update_hebra" class="btn btn-primary d-none"><?= lang('Chat.modal.btn_send_update') ?></button>
</div> </div>

View File

@ -132,8 +132,7 @@
<div id="form_buttons" class="row col-sm-12 justify-content-center" style="display: none;"> <div id="form_buttons" class="row col-sm-12 justify-content-center" style="display: none;">
</div> </div>
<?php //<?= view("themes/vuexy/components/chat_presupuesto", data: ["modelId" => $presupuestoEntity->id]) <?= view("themes/vuexy/components/chat_internal_presupuesto",data:["modelId" => $presupuestoId,"type" => "presupuesto"]) ?>
?> */?>
</div><!--//.row --> </div><!--//.row -->
<?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?> <?= view("themes/_commonPartialsBs/_modalConfirmDialog") ?>
<?= view("themes/_commonPartialsBs/_modalMessageDialog") ?> <?= view("themes/_commonPartialsBs/_modalMessageDialog") ?>

View File

@ -124,7 +124,7 @@ $picture = "/assets/img/default-user.png";
<div class="dropdown-menu dropdown-menu-end py-0"> <div class="dropdown-menu dropdown-menu-end py-0">
<div class="dropdown-menu-header border-bottom"> <div class="dropdown-menu-header border-bottom">
<div class="dropdown-header d-flex align-items-center py-3"> <div class="dropdown-header d-flex align-items-center py-3">
<h5 class="text-body mb-0 me-auto">Chats</h5> <h5 class="text-body mb-0 me-auto"><?= lang("Chat.messages") ?></h5>
</div> </div>
</div> </div>

View File

@ -54,14 +54,15 @@ class Chat {
if (this.chatContactsBody[0]) { if (this.chatContactsBody[0]) {
this.scrollbarContacts = new PerfectScrollbar(this.chatContactsBody[0], { this.scrollbarContacts = new PerfectScrollbar(this.chatContactsBody[0], {
wheelPropagation: false, wheelPropagation: false,
suppressScrollX: true suppressScrollX: true,
}); });
} }
if (this.chatHistoryBody[0]) { if (this.chatHistoryBody[0]) {
this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], { this.scrollbarChatHistory = new PerfectScrollbar(this.chatHistoryBody[0], {
wheelPropagation: false, wheelPropagation: false,
suppressScrollX: true suppressScrollX: true,
}); });
} }
} }

View File

@ -5,7 +5,9 @@ $(document).ready(() => {
let chat = new Chat($("#chat-factura")) let chat = new Chat($("#chat-factura"))
chat.init() chat.init()
chat.initFactura() chat.initFactura()
if($("#internal_messages_chat").length > 0){
let internalMessages = new InternalMessages($("#internal_messages_chat")) let internalMessages = new InternalMessages($("#internal_messages_chat"))
internalMessages.init() internalMessages.init()
}
}) })

View File

@ -5,7 +5,9 @@ $(document).ready(() => {
let chat = new Chat($("#chat-pedido")) let chat = new Chat($("#chat-pedido"))
chat.init() chat.init()
chat.initPedido() chat.initPedido()
let internalMessages = new InternalMessages($("#internal_messages_chat")) if($("#internal_messages_chat").length > 0){
internalMessages.init() let internalMessages = new InternalMessages($("#internal_messages_chat"))
internalMessages.init()
}
}) })

View File

@ -5,7 +5,9 @@ $(document).ready(() => {
let chat = new Chat($("#chat-presupuesto")) let chat = new Chat($("#chat-presupuesto"))
chat.init() chat.init()
chat.initPresupuesto() chat.initPresupuesto()
if($("#internal_messages_chat").length > 0){
let internalMessages = new InternalMessages($("#internal_messages_chat")) let internalMessages = new InternalMessages($("#internal_messages_chat"))
internalMessages.init() internalMessages.init()
}
}) })

View File

@ -7,7 +7,7 @@ a.send-msg-btn {
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.layout-horizontal .app-chat { .layout-horizontal .app-chat {
height: calc(100vh - 11.5rem - 2.2rem) !important; height: calc(100vh - 20rem - 2.2rem) !important;
} }
} }
@media (max-width: 992px) { @media (max-width: 992px) {
@ -35,7 +35,7 @@ a.send-msg-btn {
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.layout-horizontal .app-chat .app-chat-contacts { .layout-horizontal .app-chat .app-chat-contacts {
height: calc(100vh - 11.5rem - 2.2rem); height: calc(100vh - 20rem - 2.2rem);
} }
} }
@media (min-width: 992px) { @media (min-width: 992px) {
@ -97,7 +97,7 @@ a.send-msg-btn {
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.layout-horizontal .app-chat .app-chat-sidebar-left { .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 { .app-chat .app-chat-sidebar-left.show {
@ -119,7 +119,7 @@ a.send-msg-btn {
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.layout-horizontal .app-chat .app-chat-history { .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 { .app-chat .app-chat-history .chat-history-header {
@ -182,7 +182,7 @@ a.send-msg-btn {
} }
@media (min-width: 1200px) { @media (min-width: 1200px) {
.layout-horizontal .app-chat .app-chat-sidebar-right { .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 { .app-chat .app-chat-sidebar-right.show {

125802
xdebug.log

File diff suppressed because one or more lines are too long