diff --git a/app/Policies/TicketPolicy.php b/app/Policies/TicketPolicy.php index 506d58f..0ae33d2 100644 --- a/app/Policies/TicketPolicy.php +++ b/app/Policies/TicketPolicy.php @@ -284,7 +284,11 @@ class TicketPolicy public function createGitlabIssue(User $user, Ticket $ticket) { return $user->role->equals(RoleEnum::developper) - && ($ticket->type->equals(TicketTypeEnum::bug) || $ticket->type->equals(TicketTypeEnum::evolution) || $ticket->type->equals(TicketTypeEnum::newsletter)) + && ( + $ticket->type->equals(TicketTypeEnum::bug) + || $ticket->type->equals(TicketTypeEnum::evolution) + || $ticket->type->equals(TicketTypeEnum::newsletter) + ) && !\is_null($ticket->site->gitlab_project_id) && \is_null($ticket->gitlab_issue); } @@ -293,12 +297,11 @@ class TicketPolicy * Determine if the user can changeOrder * * @param User $user - * @return bool - * @throws Error + * @return boolean + * @throws Error The error. */ public function changeOrder(User $user) { return $user->role->equals(RoleEnum::developper); } - } diff --git a/resources/views/bo/pages/tickets/index.blade.php b/resources/views/bo/pages/tickets/index.blade.php index c8c4a40..dcf74a3 100644 --- a/resources/views/bo/pages/tickets/index.blade.php +++ b/resources/views/bo/pages/tickets/index.blade.php @@ -21,7 +21,7 @@ $projectManager = \App\Models\Site::query()->find(session('tickets.pr'))->projectManager; @endphp @if($projectManager) -

{{ __("Chef de projet") }} : {{ $projectManager->name; }}

+

{{ __("Chef de projet") }} : {{ $projectManager->name }}

@endif @endif diff --git a/resources/views/bo/pages/tickets/show.blade.php b/resources/views/bo/pages/tickets/show.blade.php index 8f61f7a..45d3e3c 100644 --- a/resources/views/bo/pages/tickets/show.blade.php +++ b/resources/views/bo/pages/tickets/show.blade.php @@ -89,168 +89,177 @@ @can('assignLabels', App\Models\Ticket::class) -
-
- @foreach ($ticket->labels as $label) - {{ $label->name }} - @endforeach -
+
+
+ @foreach ($ticket->labels as $label) + {{ $label->name }} + @endforeach
+
@endcan
@if ($ticket->estimation) - @include('estimations.pendingCard', ['ticket' => $ticket, 'estimation' => $ticket->estimation]) -
+ @include('estimations.pendingCard', ['ticket' => $ticket, 'estimation' => $ticket->estimation]) +
@endif
-

+
@if ($ticket->site->projectManager) +

{{ __("Chef de projet") }} : {{ $ticket->site->projectManager->name }} +

@endif - @can('createMessage', $ticket) +
+ @can('estimate', $ticket) + {{ __('Estimation') }} + @endcan + @can('createMessage', $ticket) -

- @foreach ($messages as $message) - @if ($message->type->equals(\App\Enums\MessageTypeEnum::public) || Auth::user()->can('createPrivateMessage', $ticket)) - @if ($message->user_id === null) -
- {!! nl2br(clean($message->message)) !!} - Le - {{ \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i') }} - ({{ __('Message système') }}) -
- @else -
- @if ($message->type->equals(\App\Enums\MessageTypeEnum::private)) -    + @else +
+ @if ($message->type->equals(\App\Enums\MessageTypeEnum::private)) +    + @endif + {!! \App\Lib\Helpers\ToolboxHelper::plainToHtml($message->message) !!} + @foreach ([$message->file, $message->file2, $message->file3] as $file) + @if ($file !== null) +
Ouvrir la pièce jointe @endif - {!! \App\Lib\Helpers\ToolboxHelper::plainToHtml($message->message) !!} - @foreach ([$message->file, $message->file2, $message->file3] as $file) - @if ($file !== null) -
Ouvrir la pièce jointe - @endif - @endforeach -

- - {!! __('Créé le :date par :userName', [ - 'date' => \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i'), - 'userName' => $message->user ? $message->user->name : __('Utilisateur supprimé'), - ]) !!} - - @if ($message->user_id === Auth::user()->id) - @can('updateMessage', $ticket, $message) - -