terminado tickets. faltan respuestas 2

This commit is contained in:
2025-02-16 18:58:38 +01:00
parent aff79ec3d6
commit 809a705c88
2 changed files with 6 additions and 7 deletions

View File

@ -141,7 +141,7 @@ class Ticketcontroller extends \App\Controllers\BaseResourceController
endif; // ($requestMethod === 'post')
$this->viewData['ticketEntity'] = isset($sanitizedData) ? new TicketEntity($sanitizedData) : new TicketEntity();
$this->viewData['ticket'] = isset($sanitizedData) ? new TicketEntity($sanitizedData) : new TicketEntity();
$this->viewData['formAction'] = route_to('NewTicket');

View File

@ -33,7 +33,7 @@
<div class="mb-3 col-9">
<label class="form-label"><?= lang("Tickets.asunto") ?></label>
<input type="text" name="titulo" class="form-control"
<?= ($formAction === route_to('updateTicket', $ticket->id))?"readonly":"" ?>
<?= ($formAction !== route_to('NewTicket', $ticket->id))?"readonly":"" ?>
value="<?= old('titulo', $ticket->titulo) ?>">
</div>
</div>
@ -43,7 +43,7 @@
<div class="col-3 mb-3">
<label class="form-label"><?= lang("Tickets.tipo") ?></label>
<select id="categoria" name="categoria_id" class="form-control select2"
<?= ($formAction === route_to('updateTicket', $ticket->id) && !auth()->user()->can('tickets.edit'))?"disabled":"" ?>>
<?= ($formAction !== route_to('NewTicket', $ticket->id) && !auth()->user()->can('tickets.edit'))?"disabled":"" ?>>
<?php foreach ($categorias as $categoria): ?>
<option value="<?= $categoria['id']; ?>" <?= $categoria['id'] == $ticket->categoria_id ? ' selected' : '' ?>> <?= $categoria['text']; ?>
</option>
@ -55,7 +55,7 @@
<div class="col-3 mb-3">
<label class="form-label"><?= lang("Tickets.seccion") ?></label>
<select id="seccion" name="seccion_id" class="form-control select2"
<?= ($formAction === route_to('updateTicket', $ticket->id) && !auth()->user()->can('tickets.edit'))?"disabled":"" ?>>
<?= ($formAction !== route_to('NewTicket', $ticket->id) && !auth()->user()->can('tickets.edit'))?"disabled":"" ?>>
<?php foreach ($secciones as $seccion): ?>
<option value="<?= $seccion['id']; ?>" <?= $seccion['id'] == $ticket->seccion_id ? ' selected' : '' ?>><?= $seccion['text']; ?>
</option>
@ -114,13 +114,12 @@
<div class="mb-3">
<label class="form-label"><?= lang("Tickets.descripcion") ?></label>
<textarea id="descripcion" name="descripcion" class="form-control"
<?= ($formAction === route_to('updateTicket', $ticket->id))?"readonly":"" ?>
<?= ($formAction !== route_to('NewTicket', $ticket->id))?"readonly":"" ?>
rows="4"><?= old('descripcion', $ticket->descripcion) ?></textarea>
</div>
<?php if ($formAction === route_to('NewTicket')): ?>
<h4><?= lang("Tickets.adjuntos") ?></h4>
<div class="row">
<div class="mb-3">
<label for="filesInput" class="form-label"><?= lang("Tickets.adjuntos") ?></label>
@ -147,7 +146,7 @@
<div class="pt-4">
<?php if ($formAction === route_to('NewTicket') ||
($formAction === route_to('updateTicket', $ticket->id) && auth()->user()->can('tickets.edit'))): ?>
($formAction !== route_to('NewTicket') && auth()->user()->can('tickets.edit'))): ?>
<input
type="submit"
class="btn btn-primary float-start me-sm-3 me-1"