diff --git a/ci4/app/Language/es/ClienteContactos.php b/ci4/app/Language/es/ClienteContactos.php
index d8ccfb0d..607ccada 100755
--- a/ci4/app/Language/es/ClienteContactos.php
+++ b/ci4/app/Language/es/ClienteContactos.php
@@ -5,6 +5,7 @@
return [
'apellidos' => 'Apellidos',
'cargo' => 'Cargo',
+ 'cargo_null' => 'Sin cargo',
'cliente' => 'Cliente ID',
'cliente-contactos' => 'Contactos de cliente',
'clienteId' => 'Cliente ID',
diff --git a/ci4/app/Models/Chat/ChatModel.php b/ci4/app/Models/Chat/ChatModel.php
index ddc06bcc..88bbad19 100644
--- a/ci4/app/Models/Chat/ChatModel.php
+++ b/ci4/app/Models/Chat/ChatModel.php
@@ -770,7 +770,7 @@ class ChatModel extends Model
->join("users u", "u.id = cm.sender_id", 'left')
->where("chats.presupuesto_id is NOT NULL", NULL, FALSE);
- if (auth()->user()->inGroup("admin") == false) {
+ if (auth()->user()->inGroup("cliente-administrador","cliente")) {
$query->where('presupuestos.cliente_id', auth()->user()->cliente_id)
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
}
@@ -801,7 +801,7 @@ class ChatModel extends Model
->join("presupuestos", "presupuestos.id = pedidos_linea.presupuesto_id", 'left')
->where("chats.pedido_id is NOT NULL", NULL, FALSE);
- if (auth()->user()->inGroup("admin") == false) {
+ if (auth()->user()->inGroup("cliente-administrador","cliente")) {
$query->where('presupuestos.cliente_id', auth()->user()->cliente_id)
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
}
@@ -831,12 +831,10 @@ class ChatModel extends Model
->join("facturas", "facturas.id = chats.factura_id", "left")
->where("chats.factura_id is NOT NULL", NULL, FALSE);
- if (auth()->user()->inGroup("admin") == false) {
- if (auth()->user()->inGroup("admin") == false) {
+ if (auth()->user()->inGroup("cliente-administrador","cliente")) {
$query->where('facturas.cliente_id', auth()->user()->cliente_id)
->where("chats.chat_department_id is NOT NULL", NULL, FALSE);
}
- }
return $query->groupBy('chatMessageId');
}
public function createNewDirectChat(string $title, string $message, array $users)
diff --git a/ci4/app/Models/Clientes/ClienteModel.php b/ci4/app/Models/Clientes/ClienteModel.php
index 77af360d..f2d19bbb 100755
--- a/ci4/app/Models/Clientes/ClienteModel.php
+++ b/ci4/app/Models/Clientes/ClienteModel.php
@@ -596,7 +596,7 @@ class ClienteModel extends \App\Models\BaseModel
$query = $this->builder()->select([
"cliente_contactos.id",
"CONCAT(COALESCE(cliente_contactos.nombre,''),' ',COALESCE(cliente_contactos.apellidos,'')) as name",
- 'cliente_contactos.cargo as description'
+ "COALESCE(cliente_contactos.cargo,'".lang("ClienteContactos.cargo_null")."') as description"
])
->join('cliente_contactos', 'cliente_contactos.cliente_id = clientes.id', 'left')
->where('cliente_contactos.deleted_at',null)
diff --git a/ci4/app/Views/themes/vuexy/components/chat_factura.php b/ci4/app/Views/themes/vuexy/components/chat_factura.php
index 6e0ae25a..72b1f64a 100644
--- a/ci4/app/Views/themes/vuexy/components/chat_factura.php
+++ b/ci4/app/Views/themes/vuexy/components/chat_factura.php
@@ -26,7 +26,7 @@
- user()->inGroup('cliente-editor','cliente')): ?>
+ user()->inGroup('cliente-administrador','cliente')): ?>
@@ -68,7 +68,7 @@
- user()->inGroup('cliente-editor','cliente')): ?>
+ user()->inGroup('cliente-administrador','cliente')): ?>