Merge branch 'trunk'
This commit is contained in:
commit
0b6aa1cc34
14 changed files with 221 additions and 192 deletions
|
|
@ -1,3 +1,8 @@
|
|||
### 29.09 -> 1.0.3
|
||||
- Correction des avertissements avant cloture des tickets
|
||||
- Ajout d'un bouton pour les utilisateurs afin de réouvrir un ticket clos
|
||||
- Ajout de messages de confirmation sur les actions de tickets
|
||||
|
||||
### 29.09 -> 1.0.2
|
||||
- Modification Un ticket qui est marqué comme traité ou en production depuis plus de 15 jours et sans activité sera automatiquement clos et archivé
|
||||
- Modification Il n'est désomrais plus possible de répondre à un ticket archivé dans touts les cas
|
||||
|
|
|
|||
|
|
@ -4,6 +4,8 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Enums\TicketStatus;
|
||||
use App\Enums\TicketType;
|
||||
use App\Events\NotifySubscriptions;
|
||||
use App\Events\TicketStatusChanged;
|
||||
use App\Http\Requests\ChangeTicketStatus;
|
||||
use App\Http\Requests\CreateMessage;
|
||||
use App\Http\Requests\SortTickets;
|
||||
|
|
@ -177,7 +179,8 @@ class TicketController extends Controller
|
|||
throw new Exception('Missing MAIL_ADMIN in .env');
|
||||
}
|
||||
|
||||
return redirect()->route('ticket.show', $ticket)->with('success', 'Ticket enregistré !');
|
||||
return redirect()->route('ticket.show', $ticket)
|
||||
->with('success', 'Ticket enregistré !');
|
||||
}
|
||||
|
||||
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
|
||||
|
|
@ -213,7 +216,8 @@ class TicketController extends Controller
|
|||
|
||||
$ticket->save();
|
||||
|
||||
return redirect()->route('ticket.edit', $ticket->id)->with('success', 'Modifications enregistrées !');
|
||||
return redirect()->route('ticket.edit', $ticket->id)
|
||||
->with('success', 'Modifications enregistrées !');
|
||||
}
|
||||
|
||||
public function changeStatus(ChangeTicketStatus $request, Ticket $ticket)
|
||||
|
|
@ -221,7 +225,8 @@ class TicketController extends Controller
|
|||
$ticket->fill($request->validated());
|
||||
$ticket->save();
|
||||
|
||||
return back();
|
||||
return back()
|
||||
->with('warning', trans('Le status à été modifié'));
|
||||
}
|
||||
|
||||
public function createMessage(CreateMessage $request, Ticket $ticket)
|
||||
|
|
@ -256,19 +261,40 @@ class TicketController extends Controller
|
|||
|
||||
$message->saveOrFail();
|
||||
|
||||
return back();
|
||||
return back()
|
||||
->with('success', trans('Votre message à été ajouté'));
|
||||
}
|
||||
|
||||
public function setToArchive(Ticket $ticket)
|
||||
{
|
||||
$ticket->status = TicketStatus::archived();
|
||||
$ticket->saveOrFail();
|
||||
return redirect()->route('ticket.index');
|
||||
return redirect()->route('ticket.index')
|
||||
->with('warning', trans('Le ticket est archivé'));
|
||||
}
|
||||
|
||||
public function subscribe(Ticket $ticket)
|
||||
{
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
User::find(Auth::user()->id)->subscriptions()->toggle($ticket->id);
|
||||
return back();
|
||||
$status = $user->subscriptions()->where('ticket_id', $ticket->id)->exists();
|
||||
if ($status) {
|
||||
return back()
|
||||
->with('success', trans('Vous avez été inscrit'));
|
||||
}
|
||||
return back()->with('warning', trans('Vous avez été désinscrit'));
|
||||
}
|
||||
|
||||
public function reopen(Ticket $ticket)
|
||||
{
|
||||
$message = "{$ticket->user->name} à réouvert le ticket n°{$ticket->id}";
|
||||
$oldStatus = $ticket->status;
|
||||
$ticket->status = TicketStatus::inprogress();
|
||||
$ticket->saveQuietly();
|
||||
event(new TicketStatusChanged($ticket, $oldStatus, null, $message));
|
||||
event(new NotifySubscriptions($ticket, $message, collect($ticket->user)));
|
||||
User::find(Auth::user()->id)->subscriptions()->toggle($ticket->id);
|
||||
return back()->with('warning', trans('Votre ticket à été réouvert.'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@ class Project extends Model
|
|||
'type' => CrudType::string(),
|
||||
'validate' => [
|
||||
'string',
|
||||
'max:255'
|
||||
'max:255',
|
||||
'unique:sites,name'
|
||||
],
|
||||
'required' => true,
|
||||
'nullable' => false,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ class Site extends Model
|
|||
'type' => CrudType::string(),
|
||||
'validate' => [
|
||||
'string',
|
||||
'max:255'
|
||||
'max:255',
|
||||
'unique:sites,name'
|
||||
],
|
||||
'required' => true,
|
||||
'nullable' => false,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,11 @@ abstract class UserRoleRules extends StaticRules
|
|||
return $user->role->equals(Role::developper());
|
||||
}
|
||||
|
||||
protected static function userIsClient(User $user)
|
||||
{
|
||||
return $user->role->equals(Role::client());
|
||||
}
|
||||
|
||||
protected static function allowEveryOne()
|
||||
{
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ class TicketPolicy extends RootPolicy
|
|||
SSR::make('userSitesHasTicket', $user, $model)
|
||||
]),
|
||||
'suscribeToTicket' => TicketStaticRules::make('ticketIsNotArchived', $model),
|
||||
'createMessage' => TicketStaticRules::make('ticketIsNotArchived', $model)
|
||||
'createMessage' => TicketStaticRules::make('ticketIsNotArchived', $model),
|
||||
'reopen' => URR::make('userIsClient', $user)
|
||||
]
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "ldcweb/supportweb",
|
||||
"version": "1.0.2",
|
||||
"version": "1.0.3",
|
||||
"type": "project",
|
||||
"description": "The Laravel Framework.",
|
||||
"keywords": [
|
||||
|
|
|
|||
|
|
@ -28,7 +28,12 @@
|
|||
@include('layout.nav')
|
||||
<div id="app" class="content mt-5">
|
||||
<div class="container container-xxl">
|
||||
@yield('content')
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-12 @yield('bodyClass')">
|
||||
@include('modules.flashMessage')
|
||||
@yield('content')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@include('layout.footer')
|
||||
|
|
|
|||
|
|
@ -1,14 +0,0 @@
|
|||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{!! $error !!}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@if(session('warning'))
|
||||
<div class="alert alert-warning">
|
||||
{{ session('warning') }}
|
||||
</div>
|
||||
@endif
|
||||
|
|
@ -1,24 +1,20 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('bodyClass', 'col-md-8')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Créer un ticket<a href="{{ route('home') }}" class="float-end btn btn-sm btn-primary">Retour</a></div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('ticket.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="card">
|
||||
<div class="card-header">Créer un ticket<a href="{{ route('home') }}" class="float-end btn btn-sm btn-primary">Retour</a></div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('ticket.store') }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
|
||||
@include('ticket.form-inputs')
|
||||
@include('ticket.form-inputs')
|
||||
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Enregistrer">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Enregistrer">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,28 +1,24 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('bodyClass', 'col-md-8')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="card">
|
||||
<div class="card-header">Modifier un ticket<a href="{{ route('home') }}" class="float-end btn btn-sm btn-primary">Retour</a></div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('ticket.update', $ticket->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">{!! session('success') !!}</div>
|
||||
@endif
|
||||
<div class="card">
|
||||
<div class="card-header">Modifier un ticket<a href="{{ route('home') }}" class="float-end btn btn-sm btn-primary">Retour</a></div>
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ route('ticket.update', $ticket->id) }}" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@if (session('success'))
|
||||
<div class="alert alert-success">{!! session('success') !!}</div>
|
||||
@endif
|
||||
|
||||
@include('ticket.form-inputs')
|
||||
@include('ticket.form-inputs')
|
||||
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Modifier">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="form-group text-center">
|
||||
<input type="submit" class="btn btn-primary" value="Modifier">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
@include('modules.error-messages')
|
||||
@php
|
||||
$userPr = Auth::user()->sites ?? collect([]);
|
||||
@endphp
|
||||
|
|
|
|||
|
|
@ -1,140 +1,145 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="form-row row">
|
||||
<h2 class="col">
|
||||
<a href="{{ route('home') }}" class="text-decoration-none">←</a>
|
||||
Ticket n°{{ $ticket->id }} : {{ $ticket->site->name }} - {{ $ticket->type->label }}
|
||||
{{--@cannot('createMessage', $ticket)--}}
|
||||
<span class="badge bg-secondary">{{ $ticket->status->label }}</span>
|
||||
{{--@endcan--}}
|
||||
</h2>
|
||||
<div class="col d-flex flex-row text-end">
|
||||
@can('suscribeToTicket', $ticket)
|
||||
<form action="{{ route('ticket.subscribe', $ticket->id) }}" method="POST" id="form_abonnement" class="col">
|
||||
@csrf
|
||||
<div class="custom-control custom-checkbox text-right p-2">
|
||||
<input type="checkbox" name="subscription" class="custom-control-input" id="subscription" @if ($isSubscribed)checked @endif onchange="$('#form_abonnement').submit()">
|
||||
<label class="custom-control-label" for="subscription">Suivre le ticket</label>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@can('changeStatus', $ticket)
|
||||
<form action="{{ route('ticket.changeStatus', $ticket->id) }}" method="POST" id="form_status" class="col">
|
||||
@csrf
|
||||
<select class="form-select" name="status" id="status" onchange="$('#form_status').submit();">
|
||||
@foreach(TicketStatus::toArray() as $ticketStatus)
|
||||
<option value="{{ $ticketStatus->value }}" @if($ticketStatus->equals($ticket->status))selected @endif>{{ $ticketStatus->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
@if ($errors->any())
|
||||
<div class="alert alert-danger">
|
||||
<ul>
|
||||
@foreach ($errors->all() as $error)
|
||||
<li>{{ $error }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
<div class="form-row row">
|
||||
<h2 class="col">
|
||||
<a href="{{ route('home') }}" class="text-decoration-none">←</a>
|
||||
{{ __('Ticket n° :ticketId : :ticketSiteName - :ticketTypeLabel', [
|
||||
'ticketId' => $ticket->id,
|
||||
'ticketSiteName' => $ticket->site->name,
|
||||
'ticketTypeLabel' => $ticket->type->label
|
||||
]) }}
|
||||
<span class="badge bg-secondary">{{ $ticket->status->label }}</span>
|
||||
</h2>
|
||||
<div class="col d-flex flex-row text-end">
|
||||
@can('suscribeToTicket', $ticket)
|
||||
<form action="{{ route('ticket.subscribe', $ticket->id) }}" method="POST" id="form_abonnement" class="col">
|
||||
@csrf
|
||||
<div class="custom-control custom-checkbox text-right p-2">
|
||||
<input type="checkbox" name="subscription" class="custom-control-input" id="subscription" @if ($isSubscribed)checked @endif onchange="$('#form_abonnement').submit()">
|
||||
<label class="custom-control-label" for="subscription">{{ __('Suivre le ticket') }}</label>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@can('changeStatus', $ticket)
|
||||
<form action="{{ route('ticket.changeStatus', $ticket->id) }}" method="POST" id="form_status" class="col">
|
||||
@csrf
|
||||
<select class="form-select" name="status" id="status" onchange="$('#form_status').submit();">
|
||||
@foreach(TicketStatus::toArray() as $ticketStatus)
|
||||
<option value="{{ $ticketStatus->value }}" @if($ticketStatus->equals($ticket->status))selected @endif>{{ $ticketStatus->label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</form>
|
||||
@endcan
|
||||
@if($ticket->status->equals(TicketStatus::archived()))
|
||||
@can('reopen', $ticket)
|
||||
<form action="{{ route('ticket.reopen', $ticket) }}" method="POST" id="form_status" class="col">
|
||||
@csrf
|
||||
<button class="btn btn-danger" type="submit">{{ __('Réouvrir le ticket') }}</button>
|
||||
</form>
|
||||
@endcan
|
||||
@endif
|
||||
<h4>
|
||||
Suivi
|
||||
@can('createMessage', $ticket)
|
||||
<button type="button" class="btn btn-sm btn-primary float-end" data-bs-toggle="modal" data-bs-target="#messageModal">
|
||||
Répondre
|
||||
</button>
|
||||
<div class="modal fade" id="messageModal" tabindex="-1" aria-labelledby="messageModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('ticket.message.create', $ticket) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="messageModalLabel">
|
||||
Répondre au ticket n°{{ $ticket->id }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textarea name="message" class="form-control" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<label for="formFile" class="form-label">Joindre un fichier (jpg, png, pdf) 2Mo max</label>
|
||||
<input class="form-control" type="file" id="formFile" name="file_message" accept="image/jpeg, image/png, image/jpg, .pdf">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="form-check">
|
||||
<input name="subscribe" type="checkbox" class="form-check-input" id="subscribeResponse" autocomplete="off" @if ($isSubscribed)checked @endif value="1">
|
||||
<label class="form-check-label" for="subscribeResponse">Suivre le ticket</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="reset" class="btn btn-sm btn-danger" data-bs-dismiss="modal">Fermer</button>
|
||||
<button type="submit" class="btn btn-sm btn-success">Envoyer</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</h4>
|
||||
@foreach ($messages as $message)
|
||||
@if ($message->user_id === null)
|
||||
<div class="offset-md-3 col-md-6 alert alert-info text-center text-dark">
|
||||
{!! nl2br(clean($message->message)) !!} - <span class="fw-bold text-light">Le {{ \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i')}}</span>
|
||||
<small class="fw-bold">(Message système)</small>
|
||||
</div>
|
||||
@else
|
||||
<div class="@if($message->user_id === Auth::user()->id)offset-md-4 alert-dark @else alert-light @endif col-md-8 alert">
|
||||
{!! Utils::plainToHtml($message->message) !!}
|
||||
@if ($message->file !== null)
|
||||
<br><a data-fslightbox="gallery" href="{{ asset($message->file) }}" target="_blank">Ouvrir la pièce jointe</a><br>
|
||||
@endif<br><br>
|
||||
<small class="text-muted fw-bold">Le {{ \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i')}} par <b>{{ $message->user ? $message->user->name : __('Utilisateur supprimé') }}</b></small>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<h4>Description</h4>
|
||||
<p>{!! Utils::plainToHtml($ticket->text) !!}</p>
|
||||
<small class="text-muted">Créé le {{ \Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }} par <b>{{ $ticket->user ? $ticket->user->name : __('Utilisateur supprimé') }}</b></small>
|
||||
</div>
|
||||
@if ($ticket->file !== null || $ticket->file2 !== null)
|
||||
<hr>
|
||||
<div>
|
||||
<h4>Pièces jointes</h4>
|
||||
<ul>
|
||||
@if ($ticket->file !== null)
|
||||
<li>
|
||||
Pièce jointe n°1 :
|
||||
<a @if(Utils::isImageFile($ticket->file))data-fslightbox="gallery" @endif href="{{ asset($ticket->file) }}" target="_blank">Ouvrir la pièce jointe</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($ticket->file2 !== null)
|
||||
<li>
|
||||
Pièce jointe n°2 :
|
||||
<a @if(Utils::isImageFile($ticket->file))data-fslightbox="gallery" @endif href="{{ asset($ticket->file2) }}" target="_blank">Ouvrir la pièce jointe</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<h4>
|
||||
{{ __('Suivi') }}
|
||||
@can('createMessage', $ticket)
|
||||
<button type="button" class="btn btn-sm btn-primary float-end" data-bs-toggle="modal" data-bs-target="#messageModal">
|
||||
{{ __('Répondre') }}
|
||||
</button>
|
||||
<div class="modal fade" id="messageModal" tabindex="-1" aria-labelledby="messageModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('ticket.message.create', $ticket) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input type="hidden" name="ticket_id" value="{{ $ticket->id }}">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="messageModalLabel">
|
||||
{{ __('Répondre au ticket n°:ticketId', ['ticketId' => $ticket->id]) }}
|
||||
</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="{{__('Fermer') }}"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textarea name="message" class="form-control" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<label for="formFile" class="form-label">{{ __('Joindre un fichier (jpg, png, pdf) 2Mo max') }}</label>
|
||||
<input class="form-control" type="file" id="formFile" name="file_message" accept="image/jpeg, image/png, image/jpg, .pdf">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="form-check">
|
||||
<input name="subscribe" type="checkbox" class="form-check-input" id="subscribeResponse" autocomplete="off" @if ($isSubscribed)checked @endif value="1">
|
||||
<label class="form-check-label" for="subscribeResponse">{{ __('Suivre le ticket') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="reset" class="btn btn-sm btn-danger" data-bs-dismiss="modal">{{ __('Fermer') }}</button>
|
||||
<button type="submit" class="btn btn-sm btn-success">{{ __('Envoyer') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
</h4>
|
||||
@foreach ($messages as $message)
|
||||
@if ($message->user_id === null)
|
||||
<div class="offset-md-3 col-md-6 alert alert-info text-center text-dark">
|
||||
{!! nl2br(clean($message->message)) !!} - <span class="fw-bold text-light">Le {{ \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i')}}</span>
|
||||
<small class="fw-bold">({{ __('Message système') }})</small>
|
||||
</div>
|
||||
@else
|
||||
<div class="@if($message->user_id === Auth::user()->id)offset-md-4 alert-dark @else alert-light @endif col-md-8 alert">
|
||||
{!! Utils::plainToHtml($message->message) !!}
|
||||
@if ($message->file !== null)
|
||||
<br><a data-fslightbox="gallery" href="{{ asset($message->file) }}" target="_blank">Ouvrir la pièce jointe</a><br>
|
||||
@endif<br><br>
|
||||
<small class="text-muted fw-bold">{!! __('Créé le :date par <b>:userName</b>', [
|
||||
'date' => \Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i'),
|
||||
'userName' => $ticket->user ? $ticket->user->name : __('Utilisateur supprimé')
|
||||
]) !!}</small>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<h4>{{__('Description') }}</h4>
|
||||
<p>{!! Utils::plainToHtml($ticket->text) !!}</p>
|
||||
<small class="text-muted">{!! __('Créé le :date par <b>:userName</b>', [
|
||||
'date' => \Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i'),
|
||||
'userName' => $ticket->user ? $ticket->user->name : __('Utilisateur supprimé')
|
||||
]) !!}</small>
|
||||
</div>
|
||||
@if ($ticket->file !== null || $ticket->file2 !== null)
|
||||
<hr>
|
||||
<div>
|
||||
<h4>{{ __('Pièces jointes') }}</h4>
|
||||
<ul>
|
||||
@if ($ticket->file !== null)
|
||||
<li>
|
||||
{{ __('Pièce jointe n°1') }} :
|
||||
<a @if(Utils::isImageFile($ticket->file))data-fslightbox="gallery" @endif href="{{ asset($ticket->file) }}" target="_blank">{{ __('Ouvrir la pièce jointe') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if ($ticket->file2 !== null)
|
||||
<li>
|
||||
{{ __('Pièce jointe n°2') }} :
|
||||
<a @if(Utils::isImageFile($ticket->file))data-fslightbox="gallery" @endif href="{{ asset($ticket->file2) }}" target="_blank">{{ __('Ouvrir la pièce jointe') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -57,6 +57,9 @@ Route::middleware(['auth'])->group(function () {
|
|||
Route::resource('sites.files', FileController::class);
|
||||
|
||||
Route::prefix('/ticket')->name('ticket.')->group(function () {
|
||||
Route::post('/{ticket}/reopen', [TicketController::class, 'reopen'])
|
||||
->middleware('can:reopen,ticket')
|
||||
->name('reopen');
|
||||
Route::post('/{ticket}/status', [TicketController::class, 'changeStatus'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('changeStatus');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue