68 lines
No EOL
3.2 KiB
PHP
68 lines
No EOL
3.2 KiB
PHP
@php
|
|
$userPr = Auth::user()->sites ?? collect([]);
|
|
@endphp
|
|
<div class="form-row">
|
|
<div class="form-group col">
|
|
<label for="site" class="col-form-label">{{ __('Projet') }}</label>
|
|
<select class="form-select" name="site_id" id="site">
|
|
@foreach($sites as $site)
|
|
@if (Auth::user()->isAdmin())
|
|
<option value="{{ $site->id }}" @if ($site->id == old('site_id') or (isset($ticket) and $ticket->site->id == $site->id))selected @endif>{{ $site->name }}</option>
|
|
@elseif ($userPr->filter(function($pr) use($site) { return $pr->id === $site->id; })->count())
|
|
<option value="{{ $site->id }}" selected>{{ $site->name }}</option>
|
|
@endif
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
<div class="form-group col">
|
|
<label for="type" class="col-form-label">{{ __('Type') }}</label>
|
|
<select class="form-select" name="type" id="type">
|
|
@foreach(TicketType::toArray() as $ticketType)
|
|
<option value="{{ $ticketType->value }}" @if($ticketType->value == old('type') or (isset($ticket) and $ticketType->equals($ticket->type)))selected @endif>{{ $ticketType->label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
@can('changeStatus', App\Model\Ticket::class)
|
|
<div class="form-group col">
|
|
<label for="status" class="col-form-label">Status</label>
|
|
<select class="form-select" name="status" id="status">
|
|
@foreach(TicketStatus::toArray() as $ticketStatus)
|
|
<option value="{{ $ticketStatus->value }}" @if($ticketType->value == old('status') or (isset($ticket) and $ticketStatus->equals($ticket->status)))selected @endif>{{ $ticketStatus->label }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
@else
|
|
<input type="hidden" name="status" value="{{ \App\Enums\TicketStatus::new() }}" required>
|
|
@endcan
|
|
</div>
|
|
|
|
<div class="form-group mb-5">
|
|
<label for="text" class="col-form-label text-md-right">{{ __('Description') }}</label>
|
|
<textarea class="form-control" style="min-height: 15rem;" name="text" id="text" placeholder="{{ __('Description du ticket') }} *">{{ old('text') ?? $ticket->text ?? ''}}</textarea>
|
|
</div>
|
|
<h4>Fichier joint 1</h4>
|
|
<div class="form-group mb-3">
|
|
<input type="file" name="file_ticket" accept="image/png, image/jpeg, image/jpg, .pdf">
|
|
@if (isset($ticket) and $ticket->file !== null)
|
|
<hr>
|
|
<div class="text-center">
|
|
<img src="{{ asset($ticket->file) }}" style="max-width: 100%;">
|
|
</div>
|
|
@endif
|
|
</div>
|
|
<h4>Fichier joint 2</h4>
|
|
<div class="form-group">
|
|
<input type="file" name="file_ticket2" accept="image/png, image/jpeg, image/jpg, .pdf">
|
|
@if (isset($ticket) and $ticket->file2 !== null)
|
|
<hr>
|
|
<div class="text-center">
|
|
<img src="{{ asset($ticket->file2) }}" style="max-width: 100%;">
|
|
</div>
|
|
@endif
|
|
</div>
|
|
@can('changeInternalStatus', App\Model\Ticket::class)
|
|
<div class="form-group text-center">
|
|
<input type="checkbox" name="is_internal" id="is_internal" @if ((old('is_internal') && old('is_internal')===1) || (isset($ticket) && $ticket->is_internal === 1)) checked @endif>
|
|
<label for="is_internal" class="col-form-label">Ticket interne</label>
|
|
</div>
|
|
@endcan |