Merge branch 'fix/tickets_list' into 'main'

corregidos problemas

See merge request jjimenez/safekat!771
This commit is contained in:
2025-05-05 08:32:40 +00:00
3 changed files with 18 additions and 6 deletions

View File

@ -153,7 +153,10 @@ class Ticketcontroller extends \App\Controllers\BaseResourceController
return $this->redirect2listView();
endif;
$id = filter_var($requestedId, FILTER_SANITIZE_URL);
$ticket = $this->model->find($id);
$ticket = $this->model->select("tickets.*, CONCAT(users.first_name, ' ',users.last_name) as usuario_ticket")
->join('users', 'users.id = tickets.usuario_id', 'left')
->where('tickets.id', $id)->first();
if ($ticket == false):
$message = lang('Basic.global.notFoundWithIdErr', [mb_strtolower(lang('Tickets.ticket')), $id]);

View File

@ -97,6 +97,16 @@
</select>
</div>
<?php if($formAction !== route_to('NewTicket')): ?>
<div class="mb-3 col-3">
<label class="form-label"><?= lang('Tickets.usuario') ?></label>
<input readonly type="text" name="titulo" class="form-control"
value="<?= old('titulo', $ticket->usuario_ticket) ?>">
</div>
<?php endif; ?>
<div class="mb-3 col-3">
<label class="form-label"><?= lang('Tickets.asignarTo') ?></label>
<select id="user_soporte_id" name="user_soporte_id" class="form-control">
@ -125,7 +135,9 @@
<div class="mb-3">
<label class="form-label"><?= lang("Tickets.respuesta") ?></label>
<textarea id="respuestaMensaje" name="respuesta_mensaje" class="form-control"
<?= !auth()->user()->can('tickets.edit') ? "readonly" : "" ?>
<?php if (!in_array(auth()->user()->id, $supportUsers)){
echo "readonly";
} ?>
rows="4"><?= isset($respuesta) ? old('respuestaMensaje', $respuesta->mensaje) : "" ?></textarea>
</div>

View File

@ -128,11 +128,8 @@ class Ticket {
buttonsExport: true,
});
this.table.table.on('init.dt', function () {
self.table.table.one('xhr.dt', function () {
self.table.table.page.len(100).draw();
self.table.table.draw();
});
this.table.setEditCallback(function (id) {