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') 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'); $this->viewData['formAction'] = route_to('NewTicket');

View File

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