Merge branch 'issue-67' into 'develop'
Issue 67 See merge request ldc-web/projets/support-web!88
This commit is contained in:
commit
cc7a9b54e5
23 changed files with 728 additions and 565 deletions
49
app/Enums/Credit/EstimationTimeEnum.php
Normal file
49
app/Enums/Credit/EstimationTimeEnum.php
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums\Credit;
|
||||
|
||||
use App\Traits\Enums\BaseEnum;
|
||||
|
||||
enum EstimationTimeEnum: int
|
||||
{
|
||||
use BaseEnum;
|
||||
|
||||
case halfHour = 0.0625;
|
||||
case hour = 0.125;
|
||||
case hourAndHalf = 0.1875;
|
||||
case twoHours = 0.25;
|
||||
case twoHoursAndHalf = 0.3125;
|
||||
case threeHours = 0.375;
|
||||
case threeHoursAndHalf = 0.4375;
|
||||
case fourHours = 0.5;
|
||||
case fourHoursAndHalf = 0.5625;
|
||||
case fiveHours = 0.625;
|
||||
case fiveHoursAndHalf = 0.6875;
|
||||
case sixHours = 0.75;
|
||||
case sixHoursAndHalf = 0.8125;
|
||||
case sevenHours = 0.875;
|
||||
case sevenHoursAndHalf = 0.9375;
|
||||
case eightHours = 1;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition
|
||||
*/
|
||||
private const LABELS = [
|
||||
self::halfHour->name => "Une demi-heure",
|
||||
self::hour->name => "Une heure",
|
||||
self::hourAndHalf->name => "Une heure et demie",
|
||||
self::twoHours->name => "Deux heures",
|
||||
self::twoHoursAndHalf->name => "Deux heures et demie",
|
||||
self::threeHours->name => "Trois heures",
|
||||
self::twoHoursAndHalf->name => "Trois heures et demie",
|
||||
self::fourHours->name => "Quatre heures",
|
||||
self::fourHoursAndHalf->name => "Quatre heures et demie",
|
||||
self::fiveHours->name => "Cinq heures",
|
||||
self::fiveHoursAndHalf->name => "Cinq heures et demie",
|
||||
self::sixHours->name => "Six heures",
|
||||
self::sixHoursAndHalf->name => "Six heures et demie",
|
||||
self::sevenHours->name => "Sept heures",
|
||||
self::sevenHoursAndHalf->name => "Sept heures et demi",
|
||||
self::eightHours->name => "Huit heures",
|
||||
];
|
||||
}
|
||||
67
app/Enums/Tickets/TicketFileTypeEnum.php
Normal file
67
app/Enums/Tickets/TicketFileTypeEnum.php
Normal file
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace App\Enums\Tickets;
|
||||
|
||||
use App\Traits\Enums\BaseEnum;
|
||||
|
||||
enum TicketFileTypeEnum: int
|
||||
{
|
||||
use BaseEnum;
|
||||
|
||||
case png = '.png';
|
||||
case jpeg = '.jpeg';
|
||||
case jpg = '.jpg';
|
||||
case pdf = '.pdf';
|
||||
case pptx = '.pptx';
|
||||
case docx = '.docx';
|
||||
case xlsx = '.xlsx';
|
||||
case csv = '.csv';
|
||||
|
||||
/**
|
||||
* Optionnal labels definition
|
||||
*/
|
||||
private const LABELS = [
|
||||
self::png->name => "Fichier png",
|
||||
self::jpeg->name => "Fichier jpeg",
|
||||
self::jpg->name => "Fichier jpg",
|
||||
self::pdf->name => "Fichier pdf",
|
||||
self::pptx->name => "Fichier pptx",
|
||||
self::docx->name => "Fichier docx",
|
||||
self::xlsx->name => "Fichier xlsx",
|
||||
self::csv->name => "Fichier csv",
|
||||
];
|
||||
|
||||
/**
|
||||
* Custom added mimes type definition
|
||||
*/
|
||||
private const MIMETYPE = [
|
||||
self::png->name => 'image/png',
|
||||
self::jpeg->name => 'image/jpeg',
|
||||
self::jpg->name => 'image/jpeg',
|
||||
self::pdf->name => 'application/pdf',
|
||||
self::pptx->name => 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
|
||||
self::docx->name => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
|
||||
self::xlsx->name => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
|
||||
self::csv->name => 'text/csv',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get Class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function mimetypes(): string
|
||||
{
|
||||
return self::MIMETYPE[$this->name];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get enum classes
|
||||
*
|
||||
* @return array<string>
|
||||
*/
|
||||
public static function toMimetypes(): array
|
||||
{
|
||||
return self::MIMETYPE;
|
||||
}
|
||||
}
|
||||
|
|
@ -9,12 +9,14 @@ enum GitlabUsersEnum: int
|
|||
use BaseEnum;
|
||||
|
||||
// Each user is associated to his ID on gitlab.
|
||||
case olivier = 11;
|
||||
case olivier = 11;
|
||||
case sebastien = 15;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition
|
||||
*/
|
||||
private const LABELS = [
|
||||
self::olivier->name => "Olivier LEGAT",
|
||||
self::olivier->name => "Olivier LEGAT",
|
||||
self::sebastien->name => "Sebastien Hattry",
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,16 +182,17 @@ class TicketController extends Controller
|
|||
|
||||
$ticket = new Ticket($request->validated());
|
||||
|
||||
/** @var \Illuminate\Http\UploadedFile|null */
|
||||
$fileTicket = $request->file_ticket;
|
||||
/** @var \Illuminate\Http\UploadedFile|null */
|
||||
$fileTicket2 = $request->file_ticket2;
|
||||
|
||||
if ($fileTicket) {
|
||||
$ticket->file = FileStorageHelper::storeFile($ticket, $fileTicket);
|
||||
}
|
||||
if ($fileTicket2) {
|
||||
$ticket->file2 = FileStorageHelper::storeFile($ticket, $fileTicket2);
|
||||
/** @var array<\Illuminate\Http\UploadedFile> */
|
||||
$fileTickets = $request->file_tickets ?? [];
|
||||
if (count($fileTickets) > 0) {
|
||||
foreach ($fileTickets as $key => $file) {
|
||||
if ($key === 0) {
|
||||
$ticket->file = FileStorageHelper::storeFile($ticket, $file);
|
||||
} else {
|
||||
$fileNumber = 'file' . $key + 1;
|
||||
$ticket->$fileNumber = FileStorageHelper::storeFile($ticket, $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ticket->user()->associate(auth()->user());
|
||||
|
|
@ -256,18 +257,18 @@ class TicketController extends Controller
|
|||
/** @var \App\Models\Site */
|
||||
$site = Site::findOrFail($request->site_id);
|
||||
|
||||
/** @var \Illuminate\Http\UploadedFile|null */
|
||||
$fileTicket = $request->file_ticket;
|
||||
/** @var \Illuminate\Http\UploadedFile|null */
|
||||
$fileTicket2 = $request->file_ticket2;
|
||||
|
||||
if ($fileTicket) {
|
||||
$ticket->file = FileStorageHelper::storeFile($ticket, $fileTicket);
|
||||
/** @var null|array<\Illuminate\Http\UploadedFile> */
|
||||
$fileTickets = $request->file_tickets;
|
||||
if (isset($fileTickets) && count($fileTickets) > 0) {
|
||||
foreach ($fileTickets as $key => $file) {
|
||||
if ($key === 0) {
|
||||
$ticket->file = FileStorageHelper::storeFile($ticket, $file);
|
||||
} else {
|
||||
$fileNumber = 'file' . $key + 1;
|
||||
$ticket->$fileNumber = FileStorageHelper::storeFile($ticket, $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($fileTicket2) {
|
||||
$ticket->file2 = FileStorageHelper::storeFile($ticket, $fileTicket2);
|
||||
}
|
||||
|
||||
|
||||
$ticket->labels()->sync($request->labels);
|
||||
|
||||
|
|
@ -313,9 +314,8 @@ class TicketController extends Controller
|
|||
try {
|
||||
return DB::transaction(function () use ($request, $ticket) {
|
||||
/** @var \Illuminate\Http\UploadedFile|null */
|
||||
$fileMessage = $request->file_message;
|
||||
|
||||
$message = new Message($request->validated());
|
||||
$filesMessage = $request->file_messages;
|
||||
$message = new Message($request->validated());
|
||||
$message->user()->associate(auth()->user());
|
||||
$message->ticket()->associate($ticket);
|
||||
|
||||
|
|
@ -330,12 +330,21 @@ class TicketController extends Controller
|
|||
$user->subscriptions()->detach($ticket->id);
|
||||
}
|
||||
|
||||
if (isset($filesMessage) and $filesMessage) {
|
||||
foreach ($filesMessage as $key => $singleFile) {
|
||||
if ($key === 0) {
|
||||
$message->file = FileStorageHelper::storeFile($message, $singleFile);
|
||||
$message->saveOrFail();
|
||||
} else {
|
||||
$fileNumber = 'file' . $key + 1;
|
||||
$message->$fileNumber = FileStorageHelper::storeFile($message, $singleFile);
|
||||
$message->saveOrFail();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$message->saveOrFail();
|
||||
|
||||
if ($fileMessage) {
|
||||
$message->file = FileStorageHelper::storeFile($message, $fileMessage);
|
||||
$message->saveOrFail();
|
||||
}
|
||||
return back()
|
||||
->with('success', trans('Votre message à été ajouté'));
|
||||
});
|
||||
|
|
@ -539,8 +548,13 @@ class TicketController extends Controller
|
|||
Session::has('tickets.sort_col') and
|
||||
Session::has('tickets.sort_way') and
|
||||
in_array(Session::get('tickets.sort_col'), [
|
||||
'id', 'site_id', 'created_at', 'created_by',
|
||||
'type', 'status', 'assigned_to'
|
||||
'id',
|
||||
'site_id',
|
||||
'created_at',
|
||||
'created_by',
|
||||
'type',
|
||||
'status',
|
||||
'assigned_to'
|
||||
])
|
||||
) {
|
||||
$tickets->orderBy(
|
||||
|
|
@ -599,7 +613,7 @@ class TicketController extends Controller
|
|||
});
|
||||
} //end foreach
|
||||
} //end if
|
||||
}, 'text', 'title', 'file', 'file2');
|
||||
}, 'text', 'title', 'file', 'file2', 'file3', 'file4', 'file5');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -648,15 +662,32 @@ class TicketController extends Controller
|
|||
};
|
||||
|
||||
try {
|
||||
if (!\is_null($ticket->file)) {
|
||||
$uploadedFile = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file);
|
||||
$description .= $this->formatGitlabFiles($ticket, $uploadedFile, 1);
|
||||
foreach ($ticket->getFiles() as $key => $file) {
|
||||
if (!\is_null($file)) {
|
||||
$uploadedFile = GitLab::projects()->uploadFile($gitlabRepoId, $file);
|
||||
$description .= $this->formatGitlabFiles($ticket, $uploadedFile, $key + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!\is_null($ticket->file2)) {
|
||||
$uploadedFile2 = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file2);
|
||||
$description .= $this->formatGitlabFiles($ticket, $uploadedFile2, 2);
|
||||
}
|
||||
// if (!\is_null($ticket->file2)) {
|
||||
// $uploadedFile2 = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file2);
|
||||
// $description .= $this->formatGitlabFiles($ticket, $uploadedFile2, 2);
|
||||
// }
|
||||
|
||||
// if (!\is_null($ticket->file3)) {
|
||||
// $uploadedFile3 = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file3);
|
||||
// $description .= $this->formatGitlabFiles($ticket, $uploadedFile3, 3);
|
||||
// }
|
||||
|
||||
// if (!\is_null($ticket->file4)) {
|
||||
// $uploadedFile4 = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file4);
|
||||
// $description .= $this->formatGitlabFiles($ticket, $uploadedFile4, 4);
|
||||
// }
|
||||
|
||||
// if (!\is_null($ticket->file5)) {
|
||||
// $uploadedFile5 = GitLab::projects()->uploadFile($gitlabRepoId, $ticket->file5);
|
||||
// $description .= $this->formatGitlabFiles($ticket, $uploadedFile5, 5);
|
||||
// }
|
||||
|
||||
$issue = GitLab::issues()->create($gitlabRepoId, [
|
||||
'title' => 'ts-' . $ticket->id,
|
||||
|
|
@ -665,7 +696,7 @@ class TicketController extends Controller
|
|||
'c-support',
|
||||
$cLabel
|
||||
]),
|
||||
'assignee_id' => GitlabUsersEnum::olivier,
|
||||
'assignee_id' => GitlabUsersEnum::sebastien,
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
\report($e);
|
||||
|
|
@ -694,7 +725,7 @@ class TicketController extends Controller
|
|||
*/
|
||||
private function formatGitlabFiles(Ticket $ticket, array $uploadedFile, int $fileNb)
|
||||
{
|
||||
if (Str::endsWith($ticket->file, ['jpg', 'png', 'jpeg'])) {
|
||||
if (Str::endsWith($ticket->file, ['jpg', 'png', 'jpeg', 'pptx', 'docx', 'xslx', 'csv'])) {
|
||||
$file = \sprintf(
|
||||
"",
|
||||
$fileNb,
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class CreateMessage extends FormRequest
|
|||
{
|
||||
$this->merge([
|
||||
'subscribe' => $this->subscribe ? true : false,
|
||||
'type' => $this->is_private ? MessageTypeEnum::private->value : MessageTypeEnum::public->value
|
||||
'type' => $this->is_private ? MessageTypeEnum::private->value : MessageTypeEnum::public->value
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
@ -53,13 +53,11 @@ class CreateMessage extends FormRequest
|
|||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
return [
|
||||
'subscribe' => 'required|boolean',
|
||||
'message' => 'required|min:' . ($user->isAdmin() ? '5' : '20'),
|
||||
'file_message' => 'sometimes|mimes:jpeg,jpg,png,pdf|max:2048',
|
||||
'type' => [
|
||||
'required',
|
||||
new Enum(MessageTypeEnum::class)
|
||||
]
|
||||
'subscribe' => 'required|boolean',
|
||||
'message' => 'required|min:' . ($user->isAdmin() ? '5' : '20'),
|
||||
'file_messages' => 'sometimes|array',
|
||||
'file_messages.*' => 'mimes:pptx,docx,xlsx,csv,txt,jpeg,jpg,png,pdf|max:2048',
|
||||
'type' => ['required', new Enum(MessageTypeEnum::class)]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,14 +33,18 @@ class CreateEstimateRequest extends FormRequest
|
|||
$ticket = $this->ticket;
|
||||
return [
|
||||
'amount' => [
|
||||
'required', 'numeric', 'gt:0', function ($attribute, $value, $fail) {
|
||||
if ((\floatval($value) * 1000) % 125 !== 0) {
|
||||
$fail("$attribute doit être un multiple de 125 (soit 0.125)");
|
||||
'required',
|
||||
'numeric',
|
||||
'gt:0',
|
||||
function ($attribute, $value, $fail) {
|
||||
if (fmod((\floatval($value) * 1000), 62.5) !== 0.0) {
|
||||
$fail("$attribute doit être un multiple de 62.5 (soit 0.0625)");
|
||||
}
|
||||
}
|
||||
],
|
||||
'credit_account_id' => [
|
||||
'required', 'exists:credit_accounts,id',
|
||||
'required',
|
||||
'exists:credit_accounts,id',
|
||||
function ($attribute, $value, $fail) use ($ticket) {
|
||||
/** @var \App\Models\Credit\Account|null */
|
||||
$account = Account::whereId($value)->first();
|
||||
|
|
@ -57,11 +61,11 @@ class CreateEstimateRequest extends FormRequest
|
|||
*
|
||||
* @return array
|
||||
*/
|
||||
public function messages(): array
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'amount' => 'Montant',
|
||||
'credit_account_id' => 'Compte'
|
||||
'credit_account_id' => 'Compte à débiter'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,37 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use App\Enums\Planning\TableRowEnum;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rules\Enum;
|
||||
|
||||
class EraseCellContentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return auth()->check() and $this->ajax();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'id' => 'required|exists:week_plannings,id',
|
||||
'day' => 'required|numeric',
|
||||
'row' => [
|
||||
'required',
|
||||
new Enum(TableRowEnum::class)
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ class StoreInvoiceRequest extends FormRequest
|
|||
protected function prepareForValidation()
|
||||
{
|
||||
$this->merge([
|
||||
'tasks' => request()->tasks ? \collect(json_decode(request()->tasks))
|
||||
'tasks' => request()->tasks ? \collect(json_decode(request()->tasks))
|
||||
->map(function ($task) {
|
||||
return \array_intersect_key((array)$task, Invoice::getTaskStructure());
|
||||
})->toArray() : [],
|
||||
|
|
@ -44,24 +44,24 @@ class StoreInvoiceRequest extends FormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'firstname' => 'required|string|min:3|max:255',
|
||||
'lastname' => 'required|string|min:3|max:255',
|
||||
'object' => 'required|string|min:3|max:255',
|
||||
'tasks' => 'required|array|min:1',
|
||||
'tasks.*' => 'required|array',
|
||||
'tasks.*.days' => 'required|numeric',
|
||||
'firstname' => 'required|string|min:3|max:255',
|
||||
'lastname' => 'required|string|min:3|max:255',
|
||||
'object' => 'required|string|min:3|max:255',
|
||||
'tasks' => 'required|array|min:1',
|
||||
'tasks.*' => 'required|array',
|
||||
'tasks.*.days' => 'required|numeric',
|
||||
'tasks.*.amount' => 'required|numeric',
|
||||
'tasks.*.desc' => 'required|string|min:10',
|
||||
'tasks.*.type' => [
|
||||
'tasks.*.desc' => 'required|string|min:10',
|
||||
'tasks.*.type' => [
|
||||
'required', new Enum(TaskTypeEnum::class)
|
||||
],
|
||||
'tasks.*.package' => 'required_if:tasks.*.type,' . TaskTypeEnum::package->value .
|
||||
'|nullable|exists:packages,id',
|
||||
'comment' => 'sometimes|nullable|string|min:15',
|
||||
'show_days' => 'required|boolean',
|
||||
'site_id' => 'required|integer|exists:sites,id',
|
||||
'company_id' => 'required|integer|exists:companies,id',
|
||||
'invoiced_to_id' => 'required|integer|exists:companies,id',
|
||||
'comment' => 'sometimes|nullable|string|min:15',
|
||||
'show_days' => 'required|boolean',
|
||||
'site_id' => 'required|integer|exists:sites,id',
|
||||
'company_id' => 'required|integer|exists:companies,id',
|
||||
'invoiced_to_id' => 'required|integer|exists:companies,id',
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,11 +21,11 @@ class UpdateInvoiceRequest extends StoreInvoiceRequest
|
|||
$rules = array_merge($rules, parent::rules());
|
||||
}
|
||||
$rules = array_merge($rules, [
|
||||
'comment' => 'sometimes|nullable|string|min:15',
|
||||
'sent_client_date' => 'required_with:signed_date,sent_accounting_date|sometimes|nullable|date',
|
||||
'signed_date' => 'required_with:sent_accounting_date|sometimes|nullable|date',
|
||||
'comment' => 'sometimes|nullable|string|min:15',
|
||||
'sent_client_date' => 'required_with:signed_date,sent_accounting_date|sometimes|nullable|date',
|
||||
'signed_date' => 'required_with:sent_accounting_date|sometimes|nullable|date',
|
||||
'sent_accounting_date' => 'sometimes|nullable|date',
|
||||
'status' => [
|
||||
'status' => [
|
||||
'required',
|
||||
new Enum(InvoiceStatusEnum::class),
|
||||
//phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
|
||||
|
|
|
|||
|
|
@ -1,68 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use App\Enums\Planning\CellModelEnum;
|
||||
use App\Enums\Planning\CellTypeEnum;
|
||||
use App\Enums\Planning\TableRowEnum;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Validation\Rules\Enum;
|
||||
|
||||
class SetCellContentRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
$this->merge([
|
||||
'model' => $this->model ?? null,
|
||||
'foreign' => $this->foreign ?? null,
|
||||
'text' => $this->text ?? ''
|
||||
]);
|
||||
return auth()->check() and $this->ajax();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'id' => 'required|exists:week_plannings,id',
|
||||
'day' => 'required|numeric',
|
||||
'row' => [
|
||||
'required',
|
||||
new Enum(TableRowEnum::class)
|
||||
],
|
||||
'type' => [
|
||||
'required',
|
||||
new Enum(CellTypeEnum::class)
|
||||
],
|
||||
'CellModelEnum' => \sprintf(
|
||||
'nullable',
|
||||
new Enum(CellModelEnum::class)
|
||||
),
|
||||
'foreign' => 'required_with:CellModelEnum|nullable|numeric',
|
||||
'text' => 'required|string|min:5|max:90'
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'CellModelEnum' => 'Type d\'élément lié',
|
||||
'foreign' => 'Élément lié',
|
||||
'text' => 'Description courte'
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -96,13 +96,13 @@ class StoreTicket extends FormRequest
|
|||
}
|
||||
}
|
||||
],
|
||||
'text' => 'required|string|min:40',
|
||||
'title' => 'required|string|between:3,255',
|
||||
'file_ticket' => 'mimes:jpeg,jpg,png,pdf|max:2048',
|
||||
'file_ticket2' => 'mimes:jpeg,jpg,png,pdf|max:2048',
|
||||
'is_internal' => 'required|boolean',
|
||||
'labels' => 'sometimes|array',
|
||||
'labels.*' => [
|
||||
'text' => 'required|string|min:40',
|
||||
'title' => 'required|string|between:3,255',
|
||||
'file_tickets' => 'sometimes|array',
|
||||
'file_tickets.*' => 'mimes:pptx,docx,xlsx,csv,txt,jpeg,jpg,png,pdf|max:2048',
|
||||
'is_internal' => 'required|boolean',
|
||||
'labels' => 'sometimes|array',
|
||||
'labels.*' => [
|
||||
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundBeforeLastUsed
|
||||
'required', 'exists:labels,id', function ($attribute, $value, $fail) use ($user) {
|
||||
if (!$user->can('assignLabels', Ticket::class)) {
|
||||
|
|
|
|||
|
|
@ -68,6 +68,18 @@ class ToolboxHelper
|
|||
return \preg_match('/(\.png|\.jpg|\.jpeg|\.gif)$/', $url, $m) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check uri points to pdf file
|
||||
*
|
||||
* @param string $url
|
||||
* @return boolean
|
||||
*/
|
||||
public static function isPdfFile(string $url): bool
|
||||
{
|
||||
$m = [];
|
||||
return \preg_match('/(\.pdf)$/', $url, $m) === 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Strip scheme (https) on oembed urls
|
||||
* Only embed allowed are for MP4 self hosted videos right now
|
||||
|
|
@ -339,7 +351,7 @@ class ToolboxHelper
|
|||
): Builder {
|
||||
$currentLocale = app()->currentLocale();
|
||||
$locales = collect(config('app.locales'))
|
||||
->mapWithKeys(fn (string $locale) => [$locale => $locale]);
|
||||
->mapWithKeys(fn(string $locale) => [$locale => $locale]);
|
||||
if (!$locales->has($defaultLocale)) {
|
||||
// * Remove default locale.
|
||||
$locales->pull($defaultLocale);
|
||||
|
|
@ -357,7 +369,7 @@ class ToolboxHelper
|
|||
$q->whereRaw("JSON_EXTRACT({$column}, '$.{$currentLocale}') = '{$value}'");
|
||||
}
|
||||
// * Query any other locale
|
||||
$locales->each(fn ($locale) => $q->orWhereRaw(
|
||||
$locales->each(fn($locale) => $q->orWhereRaw(
|
||||
"JSON_EXTRACT({$column}, '$.{$locale}') = '{$value}'"
|
||||
));
|
||||
});
|
||||
|
|
@ -449,7 +461,10 @@ class ToolboxHelper
|
|||
$fileFullPath = self::getUploadedFileFullPath($value, $useStorage);
|
||||
if (
|
||||
!\in_array(self::getUploadedFileMimeType($value, $useStorage), [
|
||||
'image/jpeg', 'image/jpg', 'image/png', 'image/gif'
|
||||
'image/jpeg',
|
||||
'image/jpg',
|
||||
'image/png',
|
||||
'image/gif'
|
||||
])
|
||||
) {
|
||||
$fail(trans(':attribute doit être une image de type \'image/jpeg,image/jpg,image/png,image/gif\'', [
|
||||
|
|
|
|||
|
|
@ -44,9 +44,9 @@ class Ticket extends Model
|
|||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'is_internal' => 'bool',
|
||||
'type' => TicketTypeEnum::class,
|
||||
'status' => TicketStatusEnum::class,
|
||||
'is_internal' => 'bool',
|
||||
'type' => TicketTypeEnum::class,
|
||||
'status' => TicketStatusEnum::class,
|
||||
'last_activity' => 'timestamp',
|
||||
];
|
||||
|
||||
|
|
@ -275,4 +275,20 @@ class Ticket extends Model
|
|||
Str::limit(\preg_replace('/[[:cntrl:]]+/', '', $ticket->text), 35),
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get an array of all files columns of the ticket.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getFiles(): array
|
||||
{
|
||||
return [
|
||||
$this->file,
|
||||
$this->file2,
|
||||
$this->file3,
|
||||
$this->file4,
|
||||
$this->file5,
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class InvoiceFactory extends Factory
|
|||
\mt_srand();
|
||||
$lines = \mt_rand(2, 9);
|
||||
for ($i = 0; $i < $lines; $i++) {
|
||||
$days = 0.125 * $this->faker->numberBetween(1, 4);
|
||||
$days = 0.0625 * $this->faker->numberBetween(1, 4);
|
||||
$type = \collect(TaskTypeEnum::cases())->random();
|
||||
$amount = 0;
|
||||
switch ($type) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->string('file3')->after('file2')->nullable()->comment('Pièce jointes n°3');
|
||||
$table->string('file4')->after('file3')->nullable()->comment('Pièce jointes n°4');
|
||||
$table->string('file5')->after('file4')->nullable()->comment('Pièce jointes n°5');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->dropColumn('file3');
|
||||
$table->dropColumn('file4');
|
||||
$table->dropColumn('file5');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('messages', function (Blueprint $table) {
|
||||
$table->string('file2')->after('file')->nullable()->comment('Pièce jointes n°2');
|
||||
$table->string('file3')->after('file2')->nullable()->comment('Pièce jointes n°3');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('messages', function (Blueprint $table) {
|
||||
$table->dropColumn('file3');
|
||||
$table->dropColumn('file4');
|
||||
});
|
||||
}
|
||||
};
|
||||
2
package-lock.json
generated
2
package-lock.json
generated
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "support-web",
|
||||
"name": "srcs",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
v-model="task.days"
|
||||
@change="updateAmount(index)"
|
||||
type="number"
|
||||
step="0.125"
|
||||
step="0.0625"
|
||||
>
|
||||
</td>
|
||||
<td>
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@
|
|||
@foreach ($invoiceModel->tasks as $task)
|
||||
<tr class="@if (!$loop->last) border-bottom @endif list-item">
|
||||
<td class="text-center align-middle">{!! nl2br($task['desc']) !!}</td>
|
||||
<td class="text-center align-middle">{{ $task['type'] }}</td>
|
||||
<td class="text-center align-middle">{{ \App\Enums\Invoices\TaskTypeEnum::make($task['type'])->label() }}</td>
|
||||
<td class="text-center align-middle">{{ $task['days'] }}</td>
|
||||
<td class="text-center align-middle">{{ $task['amount'] }}</td>
|
||||
<td class="text-center align-middle">{{ $task['amount'] }}€</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
</tr>
|
||||
<tr class="border-bottom list-item">
|
||||
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.total')) }}</td>
|
||||
<td class="text-center align-middle">{{ $invoiceModel->total }}</td>
|
||||
<td class="text-center align-middle">{{ $invoiceModel->total }}€</td>
|
||||
</tr>
|
||||
<tr class="border-bottom list-item">
|
||||
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.total_days')) }}</td>
|
||||
|
|
|
|||
|
|
@ -105,26 +105,23 @@
|
|||
<label class="col-form-label text-md-right" for="text">{{ __('Description') }}</label>
|
||||
<textarea class="form-control" id="text" name="text" rows="15" placeholder="{{ __('Description du ticket') }} *">{{ old('text') ?? ($ticket->text ?? '') }}</textarea>
|
||||
</div>
|
||||
<h4>Fichier joint 1</h4>
|
||||
<div class="form-group mb-3">
|
||||
<input name="file_ticket" type="file" accept="image/png, image/jpeg, image/jpg, .pdf">
|
||||
@if (isset($ticket) and $ticket->file !== null)
|
||||
<hr>
|
||||
<div class="text-center">
|
||||
<img class="img-fluid" src="{{ asset($ticket->file) }}">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<h4>Fichier joint 2</h4>
|
||||
<div class="form-group">
|
||||
<input name="file_ticket2" type="file" accept="image/png, image/jpeg, image/jpg, .pdf">
|
||||
@if (isset($ticket) and $ticket->file2 !== null)
|
||||
<hr>
|
||||
<div class="text-center">
|
||||
<img class="img-fluid" src="{{ asset($ticket->file2) }}">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@for ($i = 1; $i < 6; $i++)
|
||||
<h4>Fichier joint {{ $i }}</h4>
|
||||
<div class="form-group mb-3">
|
||||
<input name="file_tickets[]" type="file" accept="image/png, image/jpeg, image/jpg, .pdf, .pptx, .docx, .xlsx, .csv">
|
||||
@if (isset($ticket) and $ticket->file !== null)
|
||||
@php
|
||||
$fileNumber = 'file'. $i;
|
||||
@endphp
|
||||
<div class="text-center">
|
||||
<img class="img-fluid" src="{{ asset($ticket->$fileNumber) }}">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<hr>
|
||||
@endfor
|
||||
|
||||
@can('changeInternalStatus', App\Model\Ticket::class)
|
||||
<div class="form-group text-center">
|
||||
<input id="is_internal" name="is_internal" type="checkbox" @if (old('is_internal', isset($ticket) and $ticket->is_internal)) checked @endif>
|
||||
|
|
|
|||
|
|
@ -225,100 +225,102 @@
|
|||
<div class="d-flex flex-column">
|
||||
<div>
|
||||
<div class="btn-group" role="group">
|
||||
@if ($ticket->file !== null)
|
||||
<a class="glightbox btn btn-outline-dark"
|
||||
data-gallery="gallery{{ $ticket->id }}" href="{{ asset($ticket->file) }}"
|
||||
target="_blank"><i class="fa-solid fa-file-image"></i></a>
|
||||
@php
|
||||
$ticket_files = $ticket->getFiles();
|
||||
@endphp
|
||||
@foreach ($ticket_files as $key => $file)
|
||||
@if ($file !== null && (\App\Lib\Helpers\ToolboxHelper::isImageFile($file) || \App\Lib\Helpers\ToolboxHelper::isPdfFile($file)))
|
||||
<a class="glightbox btn btn-outline-dark"
|
||||
data-gallery="gallery{{ $ticket->id }}" href="{{ asset($file) }}"
|
||||
target="_blank"><i class="fa-solid fa-file-image"></i>
|
||||
</a>
|
||||
@break
|
||||
@endif
|
||||
@if ($ticket->file2 !== null)
|
||||
<a class="glightbox btn btn-outline-dark {{ $ticket->file !== null ? 'd-none' : '' }}"
|
||||
data-gallery="gallery{{ $ticket->id }}" href="{{ asset($ticket->file2) }}"
|
||||
target="_blank"></a>
|
||||
@endforeach
|
||||
{{-- Modal du ticket --}}
|
||||
<!-- Button trigger modal -->
|
||||
<button class="btn btn-outline-info" data-bs-toggle="modal"
|
||||
data-bs-target="#ticket{{ $ticket->id }}Modal" type="button"><i
|
||||
class="fa-solid fa-eye"></i></button>
|
||||
<a class="btn btn-outline-success"
|
||||
href="{{ route('bo.ticket.show', $ticket->id) }}"><i
|
||||
class="fa-solid fa-comment"></i></a>
|
||||
@if (auth()->user()->isAdmin())
|
||||
<a class="btn btn-outline-primary"
|
||||
href="{{ route('bo.ticket.edit', $ticket) }}"><i
|
||||
class="fa-solid fa-pen"></i></a>
|
||||
@endif
|
||||
@can('changeStatus', $ticket)
|
||||
@if (!$ticket->status->equals(\App\Enums\Tickets\TicketStatusEnum::archived))
|
||||
<form class="confirmJS" method="POST"
|
||||
action="{{ route('bo.ticket.archive', $ticket) }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<button class="btn btn-outline-danger rounded-0 rounded-end" type="submit"><i
|
||||
class="fa-solid fa-box-archive"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
{{-- Modal du ticket --}}
|
||||
<!-- Button trigger modal -->
|
||||
<button class="btn btn-outline-info" data-bs-toggle="modal"
|
||||
data-bs-target="#ticket{{ $ticket->id }}Modal" type="button"><i
|
||||
class="fa-solid fa-eye"></i></button>
|
||||
<a class="btn btn-outline-success"
|
||||
href="{{ route('bo.ticket.show', $ticket->id) }}"><i
|
||||
class="fa-solid fa-comment"></i></a>
|
||||
@if (auth()->user()->isAdmin())
|
||||
<a class="btn btn-outline-primary"
|
||||
href="{{ route('bo.ticket.edit', $ticket) }}"><i
|
||||
class="fa-solid fa-pen"></i></a>
|
||||
@endif
|
||||
@can('changeStatus', $ticket)
|
||||
@if (!$ticket->status->equals(\App\Enums\Tickets\TicketStatusEnum::archived))
|
||||
<form class="confirmJS" method="POST"
|
||||
action="{{ route('bo.ticket.archive', $ticket) }}">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<button class="btn btn-outline-danger rounded-0 rounded-end" type="submit"><i
|
||||
class="fa-solid fa-box-archive"></i></button>
|
||||
</form>
|
||||
@endif
|
||||
@endcan
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="ticket{{ $ticket->id }}Modal"
|
||||
aria-labelledby="ticket{{ $ticket->id }}ModalLabel" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="ticket{{ $ticket->id }}ModalLabel">
|
||||
@can('isAdmin')
|
||||
<a href="{{ route('bo.sites.show', $ticket->site) }}"
|
||||
title="{{ __('Voir le site :sitename', [
|
||||
'sitename' => $ticket->site->name,
|
||||
]) }}"><b>{{ $ticket->site->name }}</b></a>
|
||||
@else
|
||||
<b>{{ $ticket->site->name }}</b>
|
||||
@endcan -
|
||||
<u>
|
||||
{{ __('Ticket n°') }} {{ $ticket->id }}
|
||||
@if ($ticket->is_internal)
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
</u> -
|
||||
<span class="badge {{ $ticket->type->class() }}">
|
||||
{{ $ticket->type->label() }}
|
||||
</span>
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-primary bg-primary" data-bs-dismiss="modal"
|
||||
type="button" aria-label="Close">
|
||||
<i class="fa-solid fa-xmark text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<div class="mb-3 mt-1">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize"
|
||||
data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
@endcan
|
||||
<p>{!! clean(nl2br($ticket->text)) !!}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal"
|
||||
type="button">{{ __('Fermer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal -->
|
||||
<div class="modal fade" id="ticket{{ $ticket->id }}Modal"
|
||||
aria-labelledby="ticket{{ $ticket->id }}ModalLabel" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="ticket{{ $ticket->id }}ModalLabel">
|
||||
@can('isAdmin')
|
||||
<a href="{{ route('bo.sites.show', $ticket->site) }}"
|
||||
title="{{ __('Voir le site :sitename', [
|
||||
'sitename' => $ticket->site->name,
|
||||
]) }}"><b>{{ $ticket->site->name }}</b></a>
|
||||
@else
|
||||
<b>{{ $ticket->site->name }}</b>
|
||||
@endcan -
|
||||
<u>
|
||||
{{ __('Ticket n°') }} {{ $ticket->id }}
|
||||
@if ($ticket->is_internal)
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
</u> -
|
||||
<span class="badge {{ $ticket->type->class() }}">
|
||||
{{ $ticket->type->label() }}
|
||||
</span>
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-primary bg-primary" data-bs-dismiss="modal"
|
||||
type="button" aria-label="Close">
|
||||
<i class="fa-solid fa-xmark text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<div class="mb-3 mt-1">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize"
|
||||
data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
@endcan
|
||||
<p>{!! clean(nl2br($ticket->text)) !!}</p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-sm btn-primary" data-bs-dismiss="modal"
|
||||
type="button">{{ __('Fermer') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $tickets->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
{{ $tickets->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -5,271 +5,288 @@
|
|||
@section('bodyClass', 'content ticketsShow')
|
||||
|
||||
@section('content')
|
||||
<div class="form-row row">
|
||||
<h2 class="col">
|
||||
<a href="{{ route('bo.ticket.index') }}" class="text-decoration-none btn btn-sm btn-primary" role="button" aria-roledescription="{{ _('Revenir en arrière') }}"><i class="fa-solid fa-arrow-left-long"></i></a>
|
||||
{{ $ticket->full_name }}
|
||||
@if ($ticket->is_internal)<i class="fa-solid fa-lock"></i>@endif
|
||||
<span class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</h2>
|
||||
<div class="col d-flex flex-row text-end">
|
||||
@can('suscribeToTicket', $ticket)
|
||||
<form action="{{ route('bo.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>
|
||||
<label class="custom-control-label" for="subscription">{{ __('Suivre le ticket') }}</label>
|
||||
</div>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">document.getElementById('subscription').addEventListener('change', function (e) {
|
||||
document.getElementById('form_abonnement').submit();
|
||||
});</script>
|
||||
@endpush
|
||||
</form>
|
||||
@endcan
|
||||
@can('assignTo', $ticket)
|
||||
<form action="{{ route('bo.ticket.assignTo', ['ticket' => $ticket]) }}" method="POST" id="form_assign" class="col me-2">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="assign"><i class="fa-solid fa-hat-wizard"></i></label>
|
||||
<select class="form-select" name="assign" id="assign">
|
||||
<option value="" @if(!$ticket->assignedUser)selected @endif>{{ __('Personne n\'est assigné') }}</option>
|
||||
@foreach(\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}" @if(optional($ticket->assignedUser)->id == $user->id)selected @endif>{{ $user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">document.getElementById('assign').addEventListener('change', function (e) {
|
||||
document.getElementById('form_assign').submit();
|
||||
});</script>
|
||||
@endpush
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@can('changeStatus', $ticket)
|
||||
<form action="{{ route('bo.ticket.changeStatus', $ticket->id) }}" method="POST" id="form_status" class="col">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="status"><i class="fa-solid fa-sign-hanging"></i></label>
|
||||
<select class="form-select" name="status" id="status">
|
||||
@foreach(\App\Enums\Tickets\TicketStatusEnum::cases() as $ticketStatus)
|
||||
<option value="{{ $ticketStatus->value }}" @if($ticketStatus === $ticket->status)selected @endif>{{ $ticketStatus->label() }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">document.getElementById('status').addEventListener('change', function (e) {
|
||||
document.getElementById('form_status').submit();
|
||||
});</script>
|
||||
@endpush
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@if($ticket->status->equals(\App\Enums\Tickets\TicketStatusEnum::archived))
|
||||
@can('reopen', $ticket)
|
||||
<form action="{{ route('bo.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
|
||||
</div>
|
||||
</div>
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize" data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<hr>
|
||||
@if($ticket->estimation)
|
||||
@include('estimations.pendingCard', ['ticket' => $ticket, 'estimation' => $ticket->estimation])
|
||||
<hr>
|
||||
@endif
|
||||
<div>
|
||||
<h4>
|
||||
{{ __('Suivi') }}
|
||||
@can('createMessage', $ticket)
|
||||
<button type="button" class="btn btn-sm btn-primary mx-1 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('bo.ticket.message.create', $ticket) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
<div class="form-row row">
|
||||
<h2 class="col">
|
||||
<a class="text-decoration-none btn btn-sm btn-primary" href="{{ route('bo.ticket.index') }}" role="button"
|
||||
aria-roledescription="{{ _('Revenir en arrière') }}"><i class="fa-solid fa-arrow-left-long"></i></a>
|
||||
{{ $ticket->full_name }}
|
||||
@if ($ticket->is_internal)<i class="fa-solid fa-lock"></i>@endif
|
||||
<span class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</h2>
|
||||
<div class="col d-flex flex-row text-end">
|
||||
@can('suscribeToTicket', $ticket)
|
||||
<form class="col" id="form_abonnement" action="{{ route('bo.ticket.subscribe', $ticket->id) }}" method="POST">
|
||||
@csrf
|
||||
<div class="custom-control custom-checkbox p-2 text-right">
|
||||
<input class="custom-control-input" id="subscription" name="subscription" type="checkbox"
|
||||
@if ($isSubscribed) checked @endif>
|
||||
<label class="custom-control-label" for="subscription">{{ __('Suivre le ticket') }}</label>
|
||||
</div>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('subscription').addEventListener('change', function(e) {
|
||||
document.getElementById('form_abonnement').submit();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</form>
|
||||
@endcan
|
||||
@can('assignTo', $ticket)
|
||||
<form class="col me-2" id="form_assign" action="{{ route('bo.ticket.assignTo', ['ticket' => $ticket]) }}" method="POST">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="assign"><i class="fa-solid fa-hat-wizard"></i></label>
|
||||
<select class="form-select" id="assign" name="assign">
|
||||
<option value="" @if (!$ticket->assignedUser) selected @endif>{{ __('Personne n\'est assigné') }}</option>
|
||||
@foreach (\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}" @if (optional($ticket->assignedUser)->id == $user->id) selected @endif>{{ $user->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('assign').addEventListener('change', function(e) {
|
||||
document.getElementById('form_assign').submit();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@can('changeStatus', $ticket)
|
||||
<form class="col" id="form_status" action="{{ route('bo.ticket.changeStatus', $ticket->id) }}" method="POST">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="status"><i class="fa-solid fa-sign-hanging"></i></label>
|
||||
<select class="form-select" id="status" name="status">
|
||||
@foreach (\App\Enums\Tickets\TicketStatusEnum::cases() as $ticketStatus)
|
||||
<option value="{{ $ticketStatus->value }}" @if ($ticketStatus === $ticket->status) selected @endif>
|
||||
{{ $ticketStatus->label() }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('status').addEventListener('change', function(e) {
|
||||
document.getElementById('form_status').submit();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
@if ($ticket->status->equals(\App\Enums\Tickets\TicketStatusEnum::archived))
|
||||
@can('reopen', $ticket)
|
||||
<form class="col" id="form_status" action="{{ route('bo.ticket.reopen', $ticket) }}" method="POST">
|
||||
@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]) }} <span class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</h5>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-primary bg-primary"
|
||||
data-bs-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<i class="text-white fa-solid fa-xmark"></i>
|
||||
</button>
|
||||
<button class="btn btn-danger" type="submit">{{ __('Réouvrir le ticket') }}</button>
|
||||
</form>
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize" data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<hr>
|
||||
@if ($ticket->estimation)
|
||||
@include('estimations.pendingCard', ['ticket' => $ticket, 'estimation' => $ticket->estimation])
|
||||
<hr>
|
||||
@endif
|
||||
<div>
|
||||
<h4>
|
||||
{{ __('Suivi') }}
|
||||
@can('createMessage', $ticket)
|
||||
<button class="btn btn-sm btn-primary float-end mx-1" data-bs-toggle="modal" data-bs-target="#messageModal" type="button">
|
||||
{{ __('Répondre') }}
|
||||
</button>
|
||||
<div class="modal fade" id="messageModal" aria-labelledby="messageModalLabel" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('bo.ticket.message.create', $ticket) }}" method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input name="ticket_id" type="hidden" value="{{ $ticket->id }}">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="messageModalLabel">
|
||||
{{ __('Répondre au ticket n°:ticketId', ['ticketId' => $ticket->id]) }} <span
|
||||
class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-primary bg-primary" data-bs-dismiss="modal" type="button" aria-label="Close">
|
||||
<i class="fa-solid fa-xmark text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textarea class="form-control" name="message" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
@for ($i = 1; $i < 4; $i++)
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<h4>Fichier joint {{ $i }}</h4>
|
||||
<input class="form-control" name="file_messages[]" type="file"
|
||||
accept="image/png, image/jpeg, image/jpg, .pdf, .pptx, .docx, .xlsx, .csv">
|
||||
</div>
|
||||
</div>
|
||||
@endfor
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" id="subscribeResponse" name="subscribe" type="checkbox"
|
||||
value="1" autocomplete="off" @if ($isSubscribed) checked @endif>
|
||||
<label class="form-check-label" for="subscribeResponse">{{ __('Suivre le ticket') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('createPrivateMessage', $ticket)
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" id="setPrivate" name="is_private" type="checkbox"
|
||||
value="{{ \App\Enums\MessageTypeEnum::private }}" autocomplete="off">
|
||||
<label class="form-check-label" for="setPrivate">{{ __('Rendre le message privé') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-sm btn-danger" data-bs-dismiss="modal" type="reset">{{ __('Fermer') }}</button>
|
||||
<button class="btn btn-sm btn-success" type="submit">{{ __('Envoyer') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</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>
|
||||
@endcan
|
||||
@can('estimate', $ticket)
|
||||
<a class="btn btn-sm btn-info float-end mx-1"
|
||||
href="{{ route('bo.ticket.estimation.estimate', $ticket) }}">{{ __('Estimation') }}</a>
|
||||
@endcan
|
||||
</h4>
|
||||
@foreach ($messages as $message)
|
||||
@if ($message->type->equals(\App\Enums\MessageTypeEnum::public) || Auth::user()->can('createPrivateMessage', $ticket))
|
||||
@if ($message->user_id === null)
|
||||
<div class="offset-md-3 col-md-6 alert alert-info text-dark text-center">
|
||||
{!! 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 @if ($message->type->equals(\App\Enums\MessageTypeEnum::private)) border border-danger border-2 @endif col-md-8 alert">
|
||||
@if ($message->type->equals(\App\Enums\MessageTypeEnum::private))
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
{!! \App\Lib\Helpers\ToolboxHelper::plainToHtml($message->message) !!}
|
||||
@foreach ([$message->file, $message->file2, $message->file3] as $file)
|
||||
@if ($file !== null)
|
||||
<br><a href="{{ asset($file) }}" target="_blank">Ouvrir la pièce jointe</a>
|
||||
@endif
|
||||
@endforeach
|
||||
<br><br>
|
||||
<small class="@if ($message->user_id === Auth::user()->id) text-bg-dark @else text-body-secondary @endif fw-bold">
|
||||
{!! __('Créé le :date par <b>:userName</b>', [
|
||||
'date' => \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i'),
|
||||
'userName' => $message->user ? $message->user->name : __('Utilisateur supprimé'),
|
||||
]) !!}
|
||||
</small>
|
||||
@if ($message->user_id === Auth::user()->id)
|
||||
@can('updateMessage', $ticket, $message)
|
||||
<button class="btn btn-sm btn-primary float-end" data-bs-toggle="modal"
|
||||
data-bs-target="#updateMessageModal{{ $message->id }}" type="button">
|
||||
{{ __('Modifier le message') }}
|
||||
</button>
|
||||
<div class="modal fade" id="updateMessageModal{{ $message->id }}" aria-labelledby="updateMessageModalLabel"
|
||||
aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('bo.ticket.message.update', ['ticket' => $ticket, 'message' => $message]) }}"
|
||||
method="POST" enctype="multipart/form-data">
|
||||
@method('PUT')
|
||||
@csrf
|
||||
<input name="ticket_id" type="hidden" value="{{ $ticket->id }}">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="messageModalLabel">
|
||||
{{ __('Modification du message n°:messageid', ['messageid' => $message->id]) }}
|
||||
</h5>
|
||||
<button class="btn btn-sm btn-primary bg-primary" data-bs-dismiss="modal" type="button"
|
||||
aria-label="Close">
|
||||
<i class="fa-solid fa-xmark text-white"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textarea class="form-control" name="message" rows="10">{{ $message->message }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button class="btn btn-sm btn-danger" data-bs-dismiss="modal"
|
||||
type="reset">{{ __('Fermer') }}</button>
|
||||
<button class="btn btn-sm btn-success" type="submit">{{ __('Envoyer') }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@can('createPrivateMessage', $ticket)
|
||||
<div class="row mt-4">
|
||||
<div class="col">
|
||||
<div class="form-check">
|
||||
<input name="is_private" type="checkbox" class="form-check-input" id="setPrivate" autocomplete="off" value="{{ \App\Enums\MessageTypeEnum::private }}">
|
||||
<label class="form-check-label" for="setPrivate">{{ __('Rendre le message privé') }}</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
@endif
|
||||
</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>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<h4>{{ __('Description') }}</h4>
|
||||
<p>{!! clean(\App\Lib\Helpers\ToolboxHelper::plainToHtml($ticket->text)) !!}</p>
|
||||
<small class="text-body-secondary">{!! __('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>
|
||||
@php
|
||||
$ticket_files = $ticket->getFiles();
|
||||
@endphp
|
||||
@if (!empty(Arr::whereNotNull($ticket_files)))
|
||||
<div>
|
||||
<h4>{{ __('Pièces jointes') }}</h4>
|
||||
@foreach ($ticket_files as $key => $file)
|
||||
@if (!is_null($file))
|
||||
<ul>
|
||||
<li>
|
||||
{{ __('Pièce jointe ') }}{{ $key + 1 }} :
|
||||
<a href="{{ asset($file) }}" @if (\App\Lib\Helpers\ToolboxHelper::isImageFile($file)) class="glightbox" data-gallery="ticket" @endif
|
||||
target="_blank">{{ __('Ouvrir la pièce jointe') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
@can('estimate', $ticket)
|
||||
<a href="{{ route('bo.ticket.estimation.estimate', $ticket) }}" class="btn btn-sm btn-info mx-1 float-end">{{ __('Estimation') }}</a>
|
||||
@endcan
|
||||
</h4>
|
||||
@foreach ($messages as $message)
|
||||
@if (
|
||||
$message->type->equals(\App\Enums\MessageTypeEnum::public) ||
|
||||
(Auth::user()->can('createPrivateMessage', $ticket))
|
||||
)
|
||||
@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>
|
||||
@endif
|
||||
<hr>
|
||||
@can('createGitlabIssue', $ticket)
|
||||
<form class="col d-flex justify-content-end" id="form_issue" action="{{ route('bo.ticket.create-issue', $ticket) }}" method="POST">
|
||||
@csrf
|
||||
<button class="btn btn-warning align-end" type="submit">{{ __("Créer l'issue Gitlab") }}</button>
|
||||
</form>
|
||||
@else
|
||||
<div class="@if($message->user_id === Auth::user()->id)offset-md-4 alert-dark @else alert-light @endif @if($message->type->equals(\App\Enums\MessageTypeEnum::private)) border border-danger border-2 @endif col-md-8 alert">
|
||||
@if ($message->type->equals(\App\Enums\MessageTypeEnum::private))
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
{!! \App\Lib\Helpers\ToolboxHelper::plainToHtml($message->message) !!}
|
||||
@if ($message->file !== null)
|
||||
<br><a @if(\App\Lib\Helpers\ToolboxHelper::isImageFile($message->file))data-fslightbox="gallery" @endif href="{{ asset($message->file) }}" target="_blank">Ouvrir la pièce jointe</a><br>
|
||||
@endif<br><br>
|
||||
<small class="@if($message->user_id === Auth::user()->id)text-bg-dark @else text-body-secondary @endif fw-bold">
|
||||
{!! __('Créé le :date par <b>:userName</b>', [
|
||||
'date' => \Carbon\Carbon::parse($message->created_at)->format('d/m/Y à H:i'),
|
||||
'userName' => $message->user ? $message->user->name : __('Utilisateur supprimé')
|
||||
]) !!}
|
||||
</small>
|
||||
@if($message->user_id === Auth::user()->id)
|
||||
@can('updateMessage', $ticket, $message)
|
||||
<button type="button" class="btn btn-sm btn-primary float-end" data-bs-toggle="modal" data-bs-target="#updateMessageModal{{$message->id}}">
|
||||
{{ __('Modifier le message') }}
|
||||
</button>
|
||||
<div class="modal fade" id="updateMessageModal{{$message->id}}" tabindex="-1" aria-labelledby="updateMessageModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('bo.ticket.message.update', ['ticket'=>$ticket, 'message'=>$message]) }}" 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">
|
||||
{{ __('Modification du message n°:messageid', ['messageid' => $message->id]) }}
|
||||
</h5>
|
||||
<button type="button"
|
||||
class="btn btn-sm btn-primary bg-primary"
|
||||
data-bs-dismiss="modal"
|
||||
aria-label="Close">
|
||||
<i class="text-white fa-solid fa-xmark"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<textarea name="message" class="form-control" rows="10">{{ $message->message }}</textarea>
|
||||
</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>
|
||||
@can('isAdmin')
|
||||
@if (!\is_null($ticket->gitlab_issue))
|
||||
<br>
|
||||
<p>
|
||||
{{ __("Lien vers l'issue Gitlab : ") }}
|
||||
<a href="{{ $ticket->gitlab_issue }}" target="_blank">{{ __('Ouvrir') }}</a>
|
||||
</p>
|
||||
@endif
|
||||
@endcan
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
<hr>
|
||||
<div>
|
||||
<h4>{{__('Description') }}</h4>
|
||||
<p>{!! clean(\App\Lib\Helpers\ToolboxHelper::plainToHtml($ticket->text)) !!}</p>
|
||||
<small class="text-body-secondary">{!! __('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 (!is_null($ticket->file) or !is_null($ticket->file2))
|
||||
<hr>
|
||||
<div>
|
||||
<h4>{{ __('Pièces jointes') }}</h4>
|
||||
<ul>
|
||||
@if (!is_null($ticket->file))
|
||||
<li>
|
||||
{{ __('Pièce jointe n°1') }} :
|
||||
<a @if(\App\Lib\Helpers\ToolboxHelper::isImageFile($ticket->file)) class="glightbox" data-gallery="ticket" @endif href="{{ asset($ticket->file) }}" target="_blank">{{ __('Ouvrir la pièce jointe') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
@if (!is_null($ticket->file2))
|
||||
<li>
|
||||
{{ __('Pièce jointe n°2') }} :
|
||||
<a @if(\App\Lib\Helpers\ToolboxHelper::isImageFile($ticket->file2)) class="glightbox" data-gallery="ticket" @endif href="{{ asset($ticket->file2) }}" target="_blank">{{ __('Ouvrir la pièce jointe') }}</a>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
@endif
|
||||
@can('createGitlabIssue', $ticket)
|
||||
<form action="{{ route('bo.ticket.create-issue', $ticket) }}" method="POST" id="form_issue" class="col d-flex justify-content-end">
|
||||
@csrf
|
||||
<button class="btn btn-warning align-end" type="submit">{{ __("Créer l'issue Gitlab") }}</button>
|
||||
</form>
|
||||
@else
|
||||
@can('isAdmin')
|
||||
@if (!\is_null($ticket->gitlab_issue))
|
||||
<br>
|
||||
<p>
|
||||
{{ __("Lien vers l'issue Gitlab : ")}}
|
||||
<a href="{{ $ticket->gitlab_issue}}" target="_blank">{{ __("Ouvrir") }}</a>
|
||||
</p>
|
||||
@endif
|
||||
@endcan
|
||||
@endcan
|
||||
@endsection
|
||||
@endcan
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<div class="form-group mb-5">
|
||||
<label for="amount" class="col-form-label text-md-right">{{ __('Montant estimé') }}</label>
|
||||
<input class="form-control" name="amount" id="amount" type="number" min="0.125" step="0.125" value="{{ old('number', 0.125) }}" aria-describedby="amountHelper"/>
|
||||
<input class="form-control" name="amount" id="amount" type="number" min="0.0625" step="0.0625" value="{{ old('number', 0.0625) }}" aria-describedby="amountHelper"/>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => 'amount', 'helperId' => 'amountHelper' , 'helper' => __('Le montant en homme jour estimé.')
|
||||
])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue