Merge branch 'trunk'
This commit is contained in:
commit
e1944924c1
73 changed files with 1297 additions and 1174 deletions
|
|
@ -8,13 +8,17 @@ enum GitlabUsersEnum: int
|
|||
{
|
||||
use BaseEnum;
|
||||
|
||||
// Each user is associated to his ID on gitlab.
|
||||
case nicolas = 24;
|
||||
/**
|
||||
* Each user is associated to his ID on gitlab.
|
||||
*
|
||||
* 24 is Nicolas Demangeat
|
||||
*/
|
||||
case default = 24;
|
||||
|
||||
/**
|
||||
* Optionnal labels definition
|
||||
*/
|
||||
private const LABELS = [
|
||||
self::nicolas->name => "Nicolas Demangeat",
|
||||
self::default->name => "Default",
|
||||
];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Dutyhour;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
class DashboardController extends Controller
|
||||
{
|
||||
/**
|
||||
* Show Home page
|
||||
*
|
||||
* @return \Illuminate\Contracts\View\View|\Illuminate\Contracts\View\Factory
|
||||
*/
|
||||
public function index(): View
|
||||
{
|
||||
/**
|
||||
* Get only duty hours for today or later.
|
||||
*
|
||||
* @var \Illuminate\Database\Eloquent\Builder $dutyhour
|
||||
*/
|
||||
$dutyhourModels = Dutyhour::where('date', '>', now()->modify('-1 day'))
|
||||
->orderBy('date', 'asc')
|
||||
->limit(10)
|
||||
->get();
|
||||
return view('home', compact('dutyhourModels'));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,157 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Bo;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\Bo\Dutyhours\StoreDutyhourRequest;
|
||||
use App\Http\Requests\Bo\Dutyhours\UpdateDutyhourRequest;
|
||||
use App\Models\Dutyhour;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class DutyhourController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function index(Request $request): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $dutyhourModels */
|
||||
$dutyhourModels = Dutyhour::query();
|
||||
|
||||
/** @var string $search Search field */
|
||||
$search = $request->search;
|
||||
if ($search) {
|
||||
$this->searchQuery(
|
||||
$dutyhourModels,
|
||||
$search,
|
||||
null,
|
||||
'date',
|
||||
'person',
|
||||
'place'
|
||||
);
|
||||
}
|
||||
$searchFields = trans('Date, personne, lieu');
|
||||
|
||||
/** Sort columns with a query */
|
||||
$this->sortQuery($dutyhourModels);
|
||||
|
||||
/** Custom pagination */
|
||||
$dutyhourModels = $this->customPaginate($dutyhourModels, $request->pagination);
|
||||
|
||||
return view('bo.pages.dutyhours.index', compact('dutyhourModels', 'search', 'searchFields'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*
|
||||
* @param \App\Models\Dutyhour $dutyhour
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function create(Dutyhour $dutyhour): \Illuminate\Contracts\View\View
|
||||
{
|
||||
return view('bo.pages.dutyhours.create', [
|
||||
'dutyhourModel' => $dutyhour
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\Dutyhours\StoreDutyhourRequest $request
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function store(StoreDutyhourRequest $request): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
return DB::transaction(function () use ($request) {
|
||||
$dutyhour = new Dutyhour();
|
||||
$dutyhour->fill($request->validated());
|
||||
|
||||
if ($dutyhour->saveOrFail()) {
|
||||
return redirect()
|
||||
->route('bo.dutyhours.edit', $dutyhour)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_created',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_created',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\Models\Dutyhour $dutyhour
|
||||
* @return \Illuminate\Contracts\View\View
|
||||
*/
|
||||
public function edit(Dutyhour $dutyhour): \Illuminate\Contracts\View\View
|
||||
{
|
||||
return view('bo.pages.dutyhours.edit', [
|
||||
'dutyhourModel' => $dutyhour
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\Dutyhours\UpdateDutyhourRequest $request
|
||||
* @param \App\Models\Dutyhour $dutyhour
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function update(UpdateDutyhourRequest $request, Dutyhour $dutyhour): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
return DB::transaction(function () use ($request, $dutyhour) {
|
||||
$dutyhour->fill($request->validated());
|
||||
if ($dutyhour->saveOrFail()) {
|
||||
return redirect()
|
||||
->route('bo.dutyhours.edit', $dutyhour)
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_updated',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
} //end if
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
'crud.messages.cannot_be_updated',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param \App\Models\Dutyhour $dutyhour
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function destroy(Dutyhour $dutyhour): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
return DB::transaction(function () use ($dutyhour) {
|
||||
if ($dutyhour->deleteOrFail()) {
|
||||
return redirect()
|
||||
->route('bo.dutyhours.index')
|
||||
->with('success', trans(
|
||||
'crud.messages.has_been_deleted',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
}
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', trans(
|
||||
':crud.messages.cannot_be_deleted',
|
||||
['model' => Str::singular(trans('models.classes.dutyhours'))]
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -9,6 +9,7 @@ use App\Lib\Helpers\ToolboxHelper;
|
|||
use App\Models\Site;
|
||||
use App\Models\User;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
|
|
@ -23,7 +24,7 @@ class SiteController extends Controller
|
|||
public function index(Request $request): \Illuminate\Contracts\View\View
|
||||
{
|
||||
/** @var \App\Models\User $user */
|
||||
$user = \auth()->user();
|
||||
$user = Auth::user();
|
||||
|
||||
if ($user->isAdmin()) {
|
||||
/** @var \Illuminate\Database\Eloquent\Builder $siteModels */
|
||||
|
|
|
|||
|
|
@ -13,8 +13,10 @@ use App\Http\Requests\Bo\ChangeTicketStatus;
|
|||
use App\Http\Requests\Bo\CreateMessage;
|
||||
use App\Http\Requests\Bo\SortTickets;
|
||||
use App\Http\Requests\Bo\StoreTicket;
|
||||
use App\Http\Requests\Bo\UpdateChangeOrderRequest;
|
||||
use App\Http\Requests\Bo\UpdateMessage;
|
||||
use App\Http\Requests\Bo\UpdateTicket;
|
||||
use App\Http\Requests\Bo\LinkTicket;
|
||||
use App\Lib\Helpers\FileStorageHelper;
|
||||
use App\Lib\Helpers\ToolboxHelper;
|
||||
use App\Mail\NewTicket;
|
||||
|
|
@ -25,6 +27,7 @@ use App\Models\User;
|
|||
use GrahamCampbell\GitLab\Facades\GitLab;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
|
|
@ -74,7 +77,6 @@ class TicketController extends Controller
|
|||
}));
|
||||
} //end if
|
||||
|
||||
|
||||
/** @var \App\Models\User */
|
||||
$user = auth()->user();
|
||||
$tickets = Ticket::with(['site', 'labels']);
|
||||
|
|
@ -95,14 +97,28 @@ class TicketController extends Controller
|
|||
TicketStatusEnum::archived
|
||||
);
|
||||
|
||||
if (!$user->isAdmin() && $user->sites->count() === 1) {
|
||||
$request->merge([
|
||||
'pr' => $user->sites->first()->id,
|
||||
]);
|
||||
}
|
||||
|
||||
$tickets = $this->filterTickets($tickets, $request);
|
||||
$tickets = $this->searchTicket($tickets, $request);
|
||||
|
||||
/** Sort columns with a query */
|
||||
$this->sortQuery($tickets);
|
||||
|
||||
/** Custom pagination */
|
||||
$tickets = $this->customPaginate($tickets, $request->pagination);
|
||||
|
||||
$sites = Site::select('id', 'name')->orderBy('name')->get();
|
||||
$status = TicketStatusEnum::cases();
|
||||
$types = TicketTypeEnum::cases();
|
||||
$status = Arr::sort(TicketStatusEnum::cases(), function (TicketStatusEnum $value) {
|
||||
return $value->label();
|
||||
});
|
||||
$types = Arr::sort(TicketTypeEnum::cases(), function (TicketTypeEnum $value) {
|
||||
return $value->label();
|
||||
});
|
||||
|
||||
return view('bo.pages.tickets.index', compact('tickets', 'sites', 'status', 'types'));
|
||||
}
|
||||
|
|
@ -484,6 +500,48 @@ class TicketController extends Controller
|
|||
return back()->with('info', trans('Le ticket n\'est plus assigné à personne'));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Link two tickets.
|
||||
*
|
||||
* @param LinkTicket $request
|
||||
* @param Ticket $ticket
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function linkTicket(LinkTicket $request, Ticket $ticket)
|
||||
{
|
||||
$linkedTicket = Ticket::findOrFail($request->validated())->first();
|
||||
|
||||
if ($ticket->site_id !== $linkedTicket->site_id) {
|
||||
return back()->with('error', trans('Le ticket que vous avez renseigné ne fait pas partie du même site.'));
|
||||
}
|
||||
|
||||
if (!$ticket->linkedTicket()->where('linked_ticket_id', $linkedTicket->id)->exists()) {
|
||||
$ticket->linkedTicket()->attach($linkedTicket->id);
|
||||
$linkedTicket->linkedTicket()->attach($ticket->id);
|
||||
return back()->with('success', trans('Les tickets ont été liés avec succès.'));
|
||||
}
|
||||
|
||||
return back()->with('error', trans('Les tickets sont déjà liés ensemble.'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Unlink two tickets.
|
||||
*
|
||||
* @param Ticket $ticket
|
||||
* @param Ticket $linkedTicket
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function unlinkTicket(Ticket $ticket, Ticket $linkedTicket)
|
||||
{
|
||||
$ticket->linkedTicket()->detach($linkedTicket->id);
|
||||
$linkedTicket->linkedTicket()->detach($ticket->id);
|
||||
|
||||
return back()->with('warning', trans('Le lien entre les tickets à été supprimé.'));
|
||||
}
|
||||
|
||||
// * PRIVATES
|
||||
|
||||
/**
|
||||
|
|
@ -504,6 +562,7 @@ class TicketController extends Controller
|
|||
Session::remove('tickets.ty');
|
||||
Session::remove('tickets.sort_col');
|
||||
Session::remove('tickets.sort_way');
|
||||
Session::remove('tickets.or');
|
||||
Session::remove('tickets.search');
|
||||
}
|
||||
if ($request->assr) {
|
||||
|
|
@ -524,6 +583,9 @@ class TicketController extends Controller
|
|||
if ($request->sort_way) {
|
||||
Session::put('tickets.sort_way', $request->sort_way);
|
||||
}
|
||||
if ($request->ord) {
|
||||
Session::remove('tickets.or');
|
||||
}
|
||||
if ($request->pr) {
|
||||
Session::put('tickets.pr', $request->pr);
|
||||
}
|
||||
|
|
@ -536,6 +598,19 @@ class TicketController extends Controller
|
|||
if ($request->ass) {
|
||||
Session::put('tickets.ass', $request->ass);
|
||||
}
|
||||
if (Session::has('tickets.or')) {
|
||||
Session::remove('tickets.ass');
|
||||
Session::remove('tickets.st');
|
||||
Session::remove('tickets.ty');
|
||||
Session::remove('tickets.sort_col');
|
||||
Session::remove('tickets.sort_way');
|
||||
Session::remove('tickets.search');
|
||||
}
|
||||
|
||||
if ($request->or && Session::has('tickets.pr')) {
|
||||
Session::put('tickets.or', $request->or);
|
||||
}
|
||||
|
||||
Session::save();
|
||||
|
||||
if (Session::has('tickets.pr')) {
|
||||
|
|
@ -556,18 +631,20 @@ class TicketController extends Controller
|
|||
$tickets->where('type', Session::get('tickets.ty'));
|
||||
}
|
||||
|
||||
if (Session::has('tickets.or')) {
|
||||
$tickets->orderBy('order', 'ASC');
|
||||
}
|
||||
|
||||
if (
|
||||
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'
|
||||
'title',
|
||||
'assigned_to',
|
||||
'date_mep',
|
||||
'created_at',
|
||||
'created_by'
|
||||
])
|
||||
) {
|
||||
$tickets->orderBy(
|
||||
|
|
@ -577,6 +654,7 @@ class TicketController extends Controller
|
|||
} else {
|
||||
$tickets->orderBy('last_activity', 'DESC');
|
||||
}
|
||||
|
||||
return $tickets;
|
||||
}
|
||||
|
||||
|
|
@ -671,7 +749,13 @@ class TicketController extends Controller
|
|||
$description = \sprintf("%s<br>", $ticket->text);
|
||||
$cLabel = match ($ticket->type) {
|
||||
TicketTypeEnum::bug => 'c-bug',
|
||||
TicketTypeEnum::evolution => 'c-feature',
|
||||
TicketTypeEnum::evolution, TicketTypeEnum::newsletter => 'c-feature',
|
||||
};
|
||||
|
||||
$assigneeId = match ($ticket->type) {
|
||||
TicketTypeEnum::bug => GitlabUsersEnum::default->value,
|
||||
TicketTypeEnum::evolution,
|
||||
TicketTypeEnum::newsletter => $ticket->site->projectManager?->gitlab_id ?? GitlabUsersEnum::default->value
|
||||
};
|
||||
|
||||
try {
|
||||
|
|
@ -683,13 +767,17 @@ class TicketController extends Controller
|
|||
}
|
||||
|
||||
$issue = GitLab::issues()->create($gitlabRepoId, [
|
||||
'title' => 'ts-' . $ticket->id,
|
||||
'title' => sprintf(
|
||||
'ts-%s : %s',
|
||||
$ticket->id,
|
||||
$ticket->title
|
||||
),
|
||||
'description' => $description,
|
||||
'labels' => \implode(",", [
|
||||
'c-support',
|
||||
$cLabel
|
||||
]),
|
||||
'assignee_id' => GitlabUsersEnum::nicolas,
|
||||
'assignee_id' => $assigneeId,
|
||||
]);
|
||||
} catch (\Exception $e) {
|
||||
\report($e);
|
||||
|
|
@ -733,4 +821,62 @@ class TicketController extends Controller
|
|||
}
|
||||
return \sprintf("<br><br> Fichier %d : <br>%s<br>", $fileNb, $file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Change order.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\UpdateChangeOrderRequest $request
|
||||
* @param mixed ...$params
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \RuntimeException Si le nom du parametre de la route ne correspond pas au params utilisé.
|
||||
*/
|
||||
public function changeOrder(UpdateChangeOrderRequest $request, mixed ...$params): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
$paramNames = collect(request()->route()->parameterNames);
|
||||
$className = Str::of($paramNames->get($paramNames->count() - 2))->lower()->studly();
|
||||
$className = "\\App\\Models\\{$className}";
|
||||
$model = Arr::get($params, $paramNames->count() - 2);
|
||||
|
||||
if (!class_exists($className)) {
|
||||
throw new \RuntimeException("The {$className} class doesn't exist.");
|
||||
}
|
||||
|
||||
if (!\is_object($model)) {
|
||||
throw new \RuntimeException("The second last param isn't an object.");
|
||||
}
|
||||
|
||||
if (get_class($model) !== (string)Str::of($className)->replaceStart('\\', '')) {
|
||||
throw new \RuntimeException("The {$className} doesn't match second last binded param.");
|
||||
}
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null */
|
||||
$model = $className::query()->where($model->getRouteKeyName(), $model->getRouteKey())->first();
|
||||
|
||||
if (!$model) {
|
||||
return back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($request, $className, $model) {
|
||||
/** @var \Illuminate\Support\Collection $models */
|
||||
$models = $className::query()
|
||||
->orderBy('order', 'ASC')
|
||||
->where('site_id', $model->site_id)
|
||||
->where('status', '!=', TicketStatusEnum::archived)
|
||||
->where('id', '!=', $model->getKey())
|
||||
->where('order', $request->direction ? '<' : '>', $model->order)
|
||||
->get();
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null $tmp */
|
||||
$tmp = $request->direction ? $models->last() : $models->first();
|
||||
|
||||
if (!$tmp) {
|
||||
return back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
$newOrder = $tmp->getOriginal('order');
|
||||
$tmp->update(['order' => $model->getOriginal('order')]);
|
||||
$model->update(['order' => $newOrder]);
|
||||
|
||||
return redirect()->back()->with('success', trans('crud.messages.order_changed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -223,10 +223,6 @@ class Controller extends BaseController
|
|||
) {
|
||||
$query = $query->orderBy(\sprintf("$table.%s", request()->sort_col), request()->sort_way);
|
||||
}
|
||||
} elseif (Schema::hasColumn($table, 'order')) {
|
||||
$query = $query->orderBy('order', 'ASC');
|
||||
Session::put("$rName.sort_col", 'order');
|
||||
Session::put("$rName.sort_way", 'asc');
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ class RedirectIfAuthenticated
|
|||
if (Auth::guard($guard)->check()) {
|
||||
switch ($guard) {
|
||||
case 'backend':
|
||||
if (!$request->routeIs('bo.*')) {
|
||||
if (!$request->routeIs('bo.*') && !$request->routeIs('login')) {
|
||||
continue;
|
||||
}
|
||||
return \redirect()->route('bo.dashboard');
|
||||
|
|
|
|||
|
|
@ -1,47 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo\Dutyhours;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class StoreDutyhourRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return Gate::allows('isAdmin');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'date' => 'required|date|after_or_equal:today',
|
||||
'person' => 'required|string|min:3|max:255',
|
||||
'place' => 'required|string|min:3|max:255',
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get custom attributes for validator errors.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function attributes(): array
|
||||
{
|
||||
return [
|
||||
'date' => trans('Date de la permanence'),
|
||||
'person' => trans('Personne associée à la permanence'),
|
||||
'place' => trans('Lieu de la permanence'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo\Dutyhours;
|
||||
|
||||
class UpdateDutyhourRequest extends StoreDutyhourRequest
|
||||
{
|
||||
}
|
||||
39
app/Http/Requests/Bo/LinkTicket.php
Normal file
39
app/Http/Requests/Bo/LinkTicket.php
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class LinkTicket extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
/** @var \App\Models\User|null $user */
|
||||
$user = Auth::user();
|
||||
return Auth::check() && $user->isAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
$ticket = $this->route('ticket');
|
||||
return [
|
||||
'linked_ticket_id' => [
|
||||
'required',
|
||||
'numeric',
|
||||
'exists:tickets,id',
|
||||
'not_in:' . $ticket->id,
|
||||
]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
@ -29,6 +29,7 @@ class StoreSiteRequest extends FormRequest
|
|||
'users' => 'nullable|array',
|
||||
'users.*.id' => 'required|exists:users,id',
|
||||
'gitlab_project_id' => 'nullable|unique:sites,gitlab_project_id',
|
||||
'project_manager_id' => 'nullable|exists:users,id',
|
||||
'url_re7' => 'nullable|url',
|
||||
'url_prod' => 'nullable|url'
|
||||
];
|
||||
|
|
@ -46,6 +47,7 @@ class StoreSiteRequest extends FormRequest
|
|||
'users' => trans('Utilisateurs associés au site'),
|
||||
'users.*.id' => trans('Élément parmis les Utilisateurs associés au site'),
|
||||
'gitlab_project_id' => trans('ID du dépôt Gitlab'),
|
||||
'project_manager_id' => trans('Chef de projet'),
|
||||
'url_re7' => trans('Url de RECETTE'),
|
||||
'url_prod' => trans('Url de prod')
|
||||
];
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ class StoreTicket extends FormRequest
|
|||
}
|
||||
}
|
||||
],
|
||||
'date_mep' => 'nullable|date',
|
||||
'text' => 'required|string|min:40',
|
||||
'title' => 'required|string|between:3,255',
|
||||
'file_tickets' => 'sometimes|array',
|
||||
|
|
|
|||
43
app/Http/Requests/Bo/UpdateChangeOrderRequest.php
Normal file
43
app/Http/Requests/Bo/UpdateChangeOrderRequest.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Requests\Bo;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class UpdateChangeOrderRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function authorize(): bool
|
||||
{
|
||||
return auth()->check();
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare the data for validation.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function prepareForValidation(): void
|
||||
{
|
||||
$this->merge([
|
||||
'direction' => $this->route('direction') === 'up' ? true : false
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
'direction' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -34,7 +34,8 @@ class StoreUserRequest extends FormRequest
|
|||
Rule::in(collect(RoleEnum::cases())->pluck('value')->all()),
|
||||
],
|
||||
'sites' => 'nullable|array',
|
||||
'sites.*.id' => 'required|exists:sites,id'
|
||||
'sites.*.id' => 'required|exists:sites,id',
|
||||
'gitlab_id' => 'nullable|integer|unique:users,gitlab_id'
|
||||
];
|
||||
}
|
||||
|
||||
|
|
@ -51,6 +52,7 @@ class StoreUserRequest extends FormRequest
|
|||
'role' => trans('Rôle de l\'utilisateur'),
|
||||
'sites' => trans('Sites associés à l\'utilisateur'),
|
||||
'sites.*.id' => trans('Élément parmis les sites associés à l\'utilisateur'),
|
||||
'gitlab_id' => trans("ID de l'utilisateur Gitlab")
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ class AddStatusMessages
|
|||
$message = new Message();
|
||||
$message->ticket_id = $event->ticket->id;
|
||||
// * Le message system est privé si demandé (eg: Assignation à une personne).
|
||||
$message->type = $event->is_private ?
|
||||
MessageTypeEnum::public : MessageTypeEnum::private;
|
||||
$message->type = $event->is_private ? MessageTypeEnum::private : MessageTypeEnum::public;
|
||||
if ($event->message) {
|
||||
$message->message = $event->message;
|
||||
} elseif ($event->user) {
|
||||
|
|
|
|||
|
|
@ -1,43 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property date $date
|
||||
* @property string $person
|
||||
* @property string $place
|
||||
*/
|
||||
class Dutyhour extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
/**
|
||||
* Indicates if the model should be timestamped.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $timestamps = true;
|
||||
|
||||
/**
|
||||
* The attributes that are fillable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'date',
|
||||
'person',
|
||||
'place'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'date' => 'date'
|
||||
];
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@ use App\Lib\Helpers\ToolboxHelper;
|
|||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
/**
|
||||
|
|
@ -29,7 +30,8 @@ class Site extends Model
|
|||
'name',
|
||||
'url_re7',
|
||||
'url_prod',
|
||||
'gitlab_project_id'
|
||||
'gitlab_project_id',
|
||||
'project_manager_id'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -109,6 +111,17 @@ class Site extends Model
|
|||
return $this->belongsTo(Brand::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo User relation
|
||||
* The project manager of the site
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function projectManager(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class, 'project_manager_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsTo Project relation
|
||||
*
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ class Ticket extends Model
|
|||
'site_id',
|
||||
'type',
|
||||
'status',
|
||||
'order',
|
||||
'date_mep',
|
||||
'text',
|
||||
'title',
|
||||
'is_internal',
|
||||
|
|
@ -47,6 +49,7 @@ class Ticket extends Model
|
|||
'is_internal' => 'bool',
|
||||
'type' => TicketTypeEnum::class,
|
||||
'status' => TicketStatusEnum::class,
|
||||
'date_mep' => 'date',
|
||||
'last_activity' => 'timestamp',
|
||||
];
|
||||
|
||||
|
|
@ -59,6 +62,7 @@ class Ticket extends Model
|
|||
{
|
||||
static::creating(function (Ticket $ticket) {
|
||||
// If bug force the ticket status on new. All the others are estimateTodo.
|
||||
self::setOrder($ticket);
|
||||
if ($ticket->type->equals(TicketTypeEnum::bug)) {
|
||||
$ticket->status = TicketStatusEnum::new;
|
||||
} else {
|
||||
|
|
@ -66,7 +70,7 @@ class Ticket extends Model
|
|||
}
|
||||
});
|
||||
static::updating(function (Ticket $ticket) {
|
||||
if (!$ticket->original['status'] !== $ticket->status->value) {
|
||||
if (!$ticket->original['status'] !== $ticket->status->value && $ticket->original['order'] === $ticket->order) {
|
||||
event(new TicketStatusChanged(
|
||||
$ticket,
|
||||
TicketStatusEnum::make($ticket->original['status']),
|
||||
|
|
@ -85,9 +89,25 @@ class Ticket extends Model
|
|||
$ticket->status->label()
|
||||
)));
|
||||
}
|
||||
if ($ticket->status->equals(TicketStatusEnum::archived)) {
|
||||
self::setOrder($ticket, true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Set order after the last element of the list.
|
||||
*
|
||||
* @param self $model
|
||||
* @param boolean $isArchived
|
||||
* @return void
|
||||
*/
|
||||
private static function setOrder(self $model, bool $isArchived = false): void
|
||||
{
|
||||
$model->order = \intval(self::query()->where('status', $isArchived ? '=' : '!=', TicketStatusEnum::archived)->max('order')) + 1;
|
||||
}
|
||||
|
||||
|
||||
// * RELATIONSHIPS
|
||||
|
||||
/**
|
||||
|
|
@ -173,6 +193,16 @@ class Ticket extends Model
|
|||
return $this->belongsTo(TicketType::class, 'type', 'type');
|
||||
}
|
||||
|
||||
/**
|
||||
* BelongsToMany Linked Ticket
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
|
||||
*/
|
||||
public function linkedTickets()
|
||||
{
|
||||
return $this->belongsToMany(Ticket::class, 'linked_tickets', 'ticket_id', 'linked_ticket_id');
|
||||
}
|
||||
|
||||
// * METHODS
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ class User extends Authenticatable
|
|||
'email',
|
||||
'password',
|
||||
'role',
|
||||
'sites'
|
||||
'sites',
|
||||
'gitlab_id'
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -148,8 +149,8 @@ class User extends Authenticatable
|
|||
*/
|
||||
public static function adminUsers(): Collection
|
||||
{
|
||||
return Cache::rememberForever('AdminUsers', function () {
|
||||
return self::whereIn('role', [RoleEnum::admin, RoleEnum::developper])->get();
|
||||
return Cache::remember('AdminUsers', 86400, function () {
|
||||
return self::whereIn('role', [RoleEnum::admin, RoleEnum::developper])->orderBy('name')->get();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ use App\Enums\Tickets\TicketTypeEnum;
|
|||
use App\Enums\Users\RoleEnum;
|
||||
use App\Models\Ticket;
|
||||
use App\Models\User;
|
||||
use Error;
|
||||
use Illuminate\Auth\Access\HandlesAuthorization;
|
||||
|
||||
class TicketPolicy
|
||||
|
|
@ -67,6 +68,17 @@ class TicketPolicy
|
|||
return $user->isAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user can link ticket .
|
||||
*
|
||||
* @param \App\Models\User $user
|
||||
* @return boolean
|
||||
*/
|
||||
public function linkTicket(User $user)
|
||||
{
|
||||
return $user->isAdmin();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user can change the internal status of a given ticket.
|
||||
*
|
||||
|
|
@ -272,8 +284,21 @@ 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::bug) || $ticket->type->equals(TicketTypeEnum::evolution) || $ticket->type->equals(TicketTypeEnum::newsletter))
|
||||
&& !\is_null($ticket->site->gitlab_project_id)
|
||||
&& \is_null($ticket->gitlab_issue);
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if the user can changeOrder
|
||||
*
|
||||
* @param User $user
|
||||
* @return bool
|
||||
* @throws Error
|
||||
*/
|
||||
public function changeOrder(User $user)
|
||||
{
|
||||
return $user->role->equals(RoleEnum::developper);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ use App\Models\Brand;
|
|||
use App\Models\Company;
|
||||
use App\Models\Credit\Account;
|
||||
use App\Models\Credit\CreditLog;
|
||||
use App\Models\Dutyhour;
|
||||
use App\Models\Information;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Label;
|
||||
|
|
@ -91,7 +90,6 @@ class RouteServiceProvider extends ServiceProvider
|
|||
Route::model('label', Label::class);
|
||||
Route::model('marker', Marker::class);
|
||||
Route::model('package', Package::class);
|
||||
Route::model('dutyhour', Dutyhour::class);
|
||||
Route::model('information', Information::class);
|
||||
Route::model('company', Company::class);
|
||||
Route::model('invoice', Invoice::class);
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class TranslationServiceProvider extends ServiceProvider
|
|||
{
|
||||
foreach ($this->collectLocalesStrings() as $locale) {
|
||||
// * Supported locales
|
||||
Cache::rememberForever(sprintf('translations.%s', $locale), function () use ($locale) {
|
||||
Cache::remember(sprintf('translations.%s', $locale), 84600, function () use ($locale) {
|
||||
$translations = [
|
||||
'php' => $this->phpTranslations($locale),
|
||||
'json' => $this->jsonTranslations($locale),
|
||||
|
|
|
|||
64
app/Traits/Controllers/ChangesModelOrder.php
Normal file
64
app/Traits/Controllers/ChangesModelOrder.php
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<?php
|
||||
|
||||
namespace App\Traits\Controllers;
|
||||
|
||||
use App\Http\Requests\Bo\UpdateChangeOrderRequest;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
trait ChangesModelOrder
|
||||
{
|
||||
/**
|
||||
* Change order.
|
||||
*
|
||||
* @param \App\Http\Requests\Bo\UpdateChangeOrderRequest $request
|
||||
* @param mixed ...$params
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
* @throws \RuntimeException Si le nom du parametre de la route ne correspond pas au params utilisé.
|
||||
*/
|
||||
public function changeOrder(UpdateChangeOrderRequest $request, mixed ...$params): \Illuminate\Http\RedirectResponse
|
||||
{
|
||||
$paramNames = collect(request()->route()->parameterNames);
|
||||
$className = Str::of($paramNames->get($paramNames->count() - 2))->lower()->studly();
|
||||
$className = "\\App\\Models\\{$className}";
|
||||
$model = Arr::get($params, $paramNames->count() - 2);
|
||||
|
||||
if (!class_exists($className)) {
|
||||
throw new \RuntimeException("The {$className} class doesn't exist.");
|
||||
}
|
||||
|
||||
if (!\is_object($model)) {
|
||||
throw new \RuntimeException("The second last param isn't an object.");
|
||||
}
|
||||
|
||||
if (get_class($model) !== (string)Str::of($className)->replaceStart('\\', '')) {
|
||||
throw new \RuntimeException("The {$className} doesn't match second last binded param.");
|
||||
}
|
||||
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null */
|
||||
$model = $className::query()->where($model->getRouteKeyName(), $model->getRouteKey())->first();
|
||||
|
||||
if (!$model) {
|
||||
return back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
return DB::transaction(function () use ($request, $className, $model) {
|
||||
/** @var \Illuminate\Database\Eloquent\Model|null */
|
||||
$tmp = $className::query()
|
||||
->where('order', $request->direction ? '<' : '>', $model->getOriginal('order'))
|
||||
->orderBy('order', $request->direction ? 'DESC' : 'ASC')
|
||||
->first();
|
||||
|
||||
if (!$tmp) {
|
||||
return back()->with('error', trans('crud.messages.order_not_changed'));
|
||||
}
|
||||
|
||||
$newOrder = $tmp->getOriginal('order');
|
||||
$tmp->update(['order' => $model->getOriginal('order')]);
|
||||
$model->update(['order' => $newOrder]);
|
||||
|
||||
return redirect()->back()->with('success', trans('crud.messages.order_changed'));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use App\Models\Site;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->integer('order')->after('status')->comment('Ticket order.');
|
||||
});
|
||||
|
||||
Site::query()->get()->map(function ($site) {
|
||||
$site->tickets->map(function ($ticket, $ticketIndex) {
|
||||
$ticket->order = $ticketIndex + 1;
|
||||
$ticket->saveQuietly();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->dropColumn('order');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?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->date('date_mep')->nullable()->after('gitlab_issue')->comment('Date MEP souhaitée');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('tickets', function (Blueprint $table) {
|
||||
$table->dropColumn('date_mep');
|
||||
});
|
||||
}
|
||||
};
|
||||
35
database/migrations/2025_03_13_151503_tickets_linking.php
Normal file
35
database/migrations/2025_03_13_151503_tickets_linking.php
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('linked_tickets', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('ticket_id')
|
||||
->constrained()->cascadeOnDelete();
|
||||
$table->unsignedBigInteger('linked_ticket_id')
|
||||
->constrained()->cascadeOnDelete();
|
||||
$table->foreign('ticket_id')->references('id')->on('tickets');
|
||||
$table->foreign('linked_ticket_id')->references('id')->on('tickets');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('linked_tickets');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::dropIfExists('dutyhours');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::create('dutyhours', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->date('date')->unique();
|
||||
$table->string('person');
|
||||
$table->string('place');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
<?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('sites', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('project_manager_id')
|
||||
->nullable()
|
||||
->after('brand_id')
|
||||
->comment('Project manager relationship');
|
||||
|
||||
$table->foreign('project_manager_id')->references('id')->on('users')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('sites', function (Blueprint $table) {
|
||||
$table->dropForeign(['project_manager_id']);
|
||||
$table->dropColumn('project_manager_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -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('users', function (Blueprint $table) {
|
||||
$table->unsignedInteger('gitlab_id')
|
||||
->unique()
|
||||
->nullable()
|
||||
->comment("ID du user Gitlab")
|
||||
->after('remember_token');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('gitlab_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
|
|
@ -10,7 +10,8 @@ data:
|
|||
APP_DEBUG: "${APP_APP_DEBUG}"
|
||||
APP_URL: "https://${APP_DOMAIN}"
|
||||
LOG_CHANNEL: "k8s"
|
||||
DB_HOST: "mariadb.common-services"
|
||||
DB_HOST: "${APP_DB_HOST}"
|
||||
DB_PORT: "${APP_DB_PORT}"
|
||||
DB_DATABASE: "${APP_DB_DATABASE}"
|
||||
DB_USERNAME: "${APP_DB_USERNAME}"
|
||||
DB_PASSWORD: "${APP_DB_PASSWORD}"
|
||||
|
|
|
|||
|
|
@ -50,5 +50,6 @@
|
|||
"Verify Your Email Address": "Verify Your Email Address",
|
||||
"Whoops!": "Whoops!",
|
||||
"You are logged in!": "You are logged in!",
|
||||
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account."
|
||||
}
|
||||
"You are receiving this email because we received a password reset request for your account.": "You are receiving this email because we received a password reset request for your account.",
|
||||
"see_mode": "see :mode mode"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@ return [
|
|||
'packages' => 'Packages',
|
||||
'invoices' => 'Invoices',
|
||||
'companies' => 'Companies',
|
||||
'dutyhours' => 'Duty Hours',
|
||||
'informations' => 'Informations',
|
||||
'ticket_types' => 'Ticket types'
|
||||
]
|
||||
|
|
|
|||
|
|
@ -214,4 +214,13 @@ return [
|
|||
'username' => 'username',
|
||||
'year' => 'year',
|
||||
],
|
||||
'custom' => [
|
||||
'type' => 'type',
|
||||
'tickets' => 'tickets',
|
||||
'assigned_to' => 'assigned to',
|
||||
'order' => 'order',
|
||||
'priority' => 'priority',
|
||||
'default' => 'default',
|
||||
'date_mep' => 'Desired Launch'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -55,5 +55,7 @@
|
|||
"Verify Your Email Address": "Vérifiez votre adresse e-mail",
|
||||
"Whoops!": "Oups !",
|
||||
"You are logged in!": "Vous êtes connecté·e !",
|
||||
"You are receiving this email because we received a password reset request for your account.": "Vous recevez cet e-mail car nous avons reçu une demande de réinitialisation de mot de passe pour votre compte."
|
||||
}
|
||||
"You are receiving this email because we received a password reset request for your account.": "Vous recevez cet e-mail car nous avons reçu une demande de réinitialisation de mot de passe pour votre compte.",
|
||||
"see_mode": "voir mode :mode",
|
||||
"Website": "Site"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,5 +89,7 @@ return [
|
|||
'sort_delete' => 'Supprimer le tri',
|
||||
'sort_arrow' => 'Ici, les flèches sont utilisées pour trier et non pour filtrer',
|
||||
'right' => 'Vous n\'avez pas les droits',
|
||||
'view_linked_ticket' => 'voir le ticket :model',
|
||||
'unlink_ticket' => 'supprimer le lien avec le ticket :model'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -13,7 +13,6 @@ return [
|
|||
'packages' => 'Forfaits',
|
||||
'invoices' => 'Devis',
|
||||
'companies' => 'Sociétés',
|
||||
'dutyhours' => 'Permanences',
|
||||
'informations' => 'Informations',
|
||||
'ticket_types' => 'Type de ticket|Types de tickets'
|
||||
]
|
||||
|
|
|
|||
|
|
@ -1,131 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Validation Language Lines
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following language lines contain the default error messages used by
|
||||
| the validator class. Some of these rules have multiple versions such
|
||||
| as the size rules. Feel free to tweak each of these messages here.
|
||||
|
|
||||
*/
|
||||
|
||||
return [
|
||||
'accepted' => 'Ce champ doit être accepté.',
|
||||
'active_url' => 'Ce n\'est pas une URL valide',
|
||||
'after' => 'La date doit être postérieure au :date.',
|
||||
'after_or_equal' => 'La date doit être postérieure ou égale au :date.',
|
||||
'alpha' => 'Ce champ doit contenir uniquement des lettres',
|
||||
'alpha_dash' => 'Ce champ doit contenir uniquement des lettres, des chiffres et des tirets.',
|
||||
'alpha_num' => 'Ce champ doit contenir uniquement des chiffres et des lettres.',
|
||||
'array' => 'Ce champ doit être un tableau.',
|
||||
'attached' => 'Ce champ est déjà attaché.',
|
||||
'before' => 'Ce champ doit être une date antérieure au :date.',
|
||||
'before_or_equal' => 'Ce champ doit être une date antérieure ou égale au :date.',
|
||||
'between' => [
|
||||
'array' => 'Le tableau doit contenir entre :min et :max éléments.',
|
||||
'file' => 'La taille du fichier doit être comprise entre :min et :max kilo-octets.',
|
||||
'numeric' => 'La valeur doit être comprise entre :min et :max.',
|
||||
'string' => 'Le texte doit contenir entre :min et :max caractères.',
|
||||
],
|
||||
'boolean' => 'Ce champ doit être vrai ou faux.',
|
||||
'confirmed' => 'Le champ de confirmation ne correspond pas.',
|
||||
'date' => 'Ce n\'est pas une date valide.',
|
||||
'date_equals' => 'La date doit être égale à :date.',
|
||||
'date_format' => 'Ce champ ne correspond pas au format :format.',
|
||||
'different' => 'Cette valeur doit être différente de :other.',
|
||||
'digits' => 'Ce champ doit contenir :digits chiffres.',
|
||||
'digits_between' => 'Ce champ doit contenir entre :min et :max chiffres.',
|
||||
'dimensions' => 'La taille de l\'image n\'est pas conforme.',
|
||||
'distinct' => 'Ce champ a une valeur en double.',
|
||||
'email' => 'Ce champ doit être une adresse email valide.',
|
||||
'ends_with' => 'Ce champ doit se terminer par une des valeurs suivantes : :values',
|
||||
'exists' => 'Ce champ sélectionné est invalide.',
|
||||
'file' => 'Ce champ doit être un fichier.',
|
||||
'filled' => 'Ce champ doit avoir une valeur.',
|
||||
'gt' => [
|
||||
'array' => 'Le tableau doit contenir plus de :value éléments.',
|
||||
'file' => 'La taille du fichier doit être supérieure à :value kilo-octets.',
|
||||
'numeric' => 'La valeur doit être supérieure à :value.',
|
||||
'string' => 'Le texte doit contenir plus de :value caractères.',
|
||||
],
|
||||
'gte' => [
|
||||
'array' => 'Le tableau doit contenir au moins :value éléments.',
|
||||
'file' => 'La taille du fichier doit être supérieure ou égale à :value kilo-octets.',
|
||||
'numeric' => 'La valeur doit être supérieure ou égale à :value.',
|
||||
'string' => 'Le texte doit contenir au moins :value caractères.',
|
||||
],
|
||||
'image' => 'Ce champ doit être une image.',
|
||||
'in' => 'Ce champ est invalide.',
|
||||
'in_array' => 'Ce champ n\'existe pas dans :other.',
|
||||
'integer' => 'Ce champ doit être un entier.',
|
||||
'ip' => 'Ce champ doit être une adresse IP valide.',
|
||||
'ipv4' => 'Ce champ doit être une adresse IPv4 valide.',
|
||||
'ipv6' => 'Ce champ doit être une adresse IPv6 valide.',
|
||||
'json' => 'Ce champ doit être un document JSON valide.',
|
||||
'lt' => [
|
||||
'array' => 'Le tableau doit contenir moins de :value éléments.',
|
||||
'file' => 'La taille du fichier doit être inférieure à :value kilo-octets.',
|
||||
'numeric' => 'La valeur doit être inférieure à :value.',
|
||||
'string' => 'Le texte doit contenir moins de :value caractères.',
|
||||
],
|
||||
'lte' => [
|
||||
'array' => 'Le tableau doit contenir au plus :value éléments.',
|
||||
'file' => 'La taille du fichier doit être inférieure ou égale à :value kilo-octets.',
|
||||
'numeric' => 'La valeur doit être inférieure ou égale à :value.',
|
||||
'string' => 'Le texte doit contenir au plus :value caractères.',
|
||||
],
|
||||
'max' => [
|
||||
'array' => 'Le tableau ne peut contenir plus de :max éléments.',
|
||||
'file' => 'La taille du fichier ne peut pas dépasser :max kilo-octets.',
|
||||
'numeric' => 'La valeur ne peut être supérieure à :max.',
|
||||
'string' => 'Le texte ne peut contenir plus de :max caractères.',
|
||||
],
|
||||
'mimes' => 'Le fichier doit être de type : :values.',
|
||||
'mimetypes' => 'Le fichier doit être de type : :values.',
|
||||
'min' => [
|
||||
'array' => 'Le tableau doit contenir au moins :min éléments.',
|
||||
'file' => 'La taille du fichier doit être supérieure à :min kilo-octets.',
|
||||
'numeric' => 'La valeur doit être supérieure ou égale à :min.',
|
||||
'string' => 'Le texte doit contenir au moins :min caractères.',
|
||||
],
|
||||
'multiple_of' => 'La valeur doit être un multiple de :value',
|
||||
'not_in' => 'Le champ sélectionné n\'est pas valide.',
|
||||
'not_regex' => 'Le format du champ n\'est pas valide.',
|
||||
'numeric' => 'Ce champ doit contenir un nombre.',
|
||||
'password' => 'Le mot de passe est incorrect',
|
||||
'present' => 'Ce champ doit être présent.',
|
||||
'prohibited' => 'Ce champ est interdit',
|
||||
'prohibited_if' => 'Ce champ est interdit quand :other a la valeur :value.',
|
||||
'prohibited_unless' => 'Ce champ est interdit à moins que :other ait l\'une des valeurs :values.',
|
||||
'regex' => 'Le format du champ est invalide.',
|
||||
'relatable' => 'Ce champ n\'est sans doute pas associé avec cette donnée.',
|
||||
'required' => 'Ce champ est obligatoire.',
|
||||
'required_if' => 'Ce champ est obligatoire quand la valeur de :other est :value.',
|
||||
'required_unless' => 'Ce champ est obligatoire sauf si :other est :values.',
|
||||
'required_with' => 'Ce champ est obligatoire quand :values est présent.',
|
||||
'required_with_all' => 'Ce champ est obligatoire quand :values sont présents.',
|
||||
'required_without' => 'Ce champ est obligatoire quand :values n\'est pas présent.',
|
||||
'required_without_all' => 'Ce champ est requis quand aucun de :values n\'est présent.',
|
||||
'same' => 'Ce champ doit être identique à :other.',
|
||||
'size' => [
|
||||
'array' => 'Le tableau doit contenir :size éléments.',
|
||||
'file' => 'La taille du fichier doit être de :size kilo-octets.',
|
||||
'numeric' => 'La valeur doit être :size.',
|
||||
'string' => 'Le texte doit contenir :size caractères.',
|
||||
],
|
||||
'starts_with' => 'Ce champ doit commencer avec une des valeurs suivantes : :values',
|
||||
'string' => 'Ce champ doit être une chaîne de caractères.',
|
||||
'timezone' => 'Ce champ doit être un fuseau horaire valide.',
|
||||
'unique' => 'La valeur est déjà utilisée.',
|
||||
'uploaded' => 'Le fichier n\'a pu être téléversé.',
|
||||
'url' => 'Le format de l\'URL n\'est pas valide.',
|
||||
'uuid' => 'Ce champ doit être un UUID valide',
|
||||
'custom' => [
|
||||
'attribute-name' => [
|
||||
'rule-name' => 'custom-message',
|
||||
],
|
||||
],
|
||||
'attributes' => [],
|
||||
];
|
||||
|
|
@ -248,5 +248,15 @@ return [
|
|||
'url_re7' => 'Url de RECETTE',
|
||||
'username' => 'nom d\'utilisateur',
|
||||
'year' => 'année',
|
||||
'id' => 'identifiant'
|
||||
],
|
||||
'custom' => [
|
||||
'type' => 'type',
|
||||
'tickets' => 'étiquettes',
|
||||
'assigned_to' => 'assigné à',
|
||||
'order' => 'ordre',
|
||||
'priority' => 'priorité',
|
||||
'default' => 'défaut',
|
||||
'date_mep' => 'MEP souhaitée'
|
||||
]
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
.container-xxl {
|
||||
max-width: 1340px !important;
|
||||
max-width: 1600px !important;
|
||||
}
|
||||
|
||||
#app {
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ import {
|
|||
faDeleteLeft,
|
||||
faDiagramProject,
|
||||
faDownload,
|
||||
faEquals,
|
||||
faEraser,
|
||||
faEye,
|
||||
faEyeSlash,
|
||||
|
|
@ -60,10 +61,12 @@ import {
|
|||
faTicket,
|
||||
faTimes,
|
||||
faTrash,
|
||||
faTriangleExclamation,
|
||||
faUndoAlt,
|
||||
faUsers,
|
||||
faWandMagic,
|
||||
faXmark
|
||||
faXmark,
|
||||
faLinkSlash
|
||||
} from "@fortawesome/free-solid-svg-icons";
|
||||
|
||||
config.autoReplaceSvg = false;
|
||||
|
|
@ -124,6 +127,7 @@ library.add(faCircleExclamation);
|
|||
library.add(faCircleInfo);
|
||||
library.add(faPaintRoller);
|
||||
library.add(faTicket);
|
||||
library.add(faLinkSlash);
|
||||
|
||||
// Front
|
||||
library.add(faChevronLeft);
|
||||
|
|
@ -137,4 +141,6 @@ library.add(faCopy);
|
|||
library.add(faClipboard);
|
||||
library.add(faXmark);
|
||||
library.add(faArrowRightFromBracket);
|
||||
library.add(faTriangleExclamation);
|
||||
library.add(faEquals);
|
||||
dom.watch();
|
||||
|
|
|
|||
40
resources/views/bo/modules/change-model-order.blade.php
Normal file
40
resources/views/bo/modules/change-model-order.blade.php
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<td class="text-center align-middle">
|
||||
<b>{{ $value ?? '' }}</b>
|
||||
@can('changeOrder', $model)
|
||||
<div class="d-flex justify-content-center align-items-center">
|
||||
<form @class(['invisible' => $loop->first and $models->onFirstPage()])
|
||||
action="{{ route('bo.' . $routeName . '.change-order', [str($routeName)->singular()->value => $model, 'direction' => 'up']) }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<button data-bs-toggle="tooltip" type="submit" title="{{ __('crud.other.up') }}" @class([
|
||||
'btn btn-sm btn-outline-secondary',
|
||||
'disabled' => $loop->first and $models->onFirstPage(),
|
||||
])>
|
||||
<i class="fas fa-arrow-up"></i>
|
||||
</button>
|
||||
</form>
|
||||
<form @class([
|
||||
'invisible' =>
|
||||
$loop->last and $models->currentPage() === $models->lastPage(),
|
||||
])
|
||||
action="{{ route('bo.' . $routeName . '.change-order', [str($routeName)->singular()->value => $model, 'direction' => 'down']) }}"
|
||||
method="POST">
|
||||
@csrf
|
||||
@method('PATCH')
|
||||
<button data-bs-toggle="tooltip" type="submit" title="{{ __('crud.other.down') }}" @class([
|
||||
'btn btn-sm btn-outline-secondary ms-1',
|
||||
'disabled' =>
|
||||
$loop->last and $models->currentPage() === $models->lastPage(),
|
||||
])>
|
||||
<i class="fas fa-arrow-down"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
@elseif(isset($noRightsVisible) && $noRightsVisible)
|
||||
<span class="text-danger" data-bs-toggle="tooltip" title="{{ __('crud.other.right') }}">
|
||||
<i class="fa-solid fa-ban"></i>
|
||||
</span>
|
||||
@endcan
|
||||
</td>
|
||||
|
||||
54
resources/views/bo/modules/table-col-sorter-cell.blade.php
Normal file
54
resources/views/bo/modules/table-col-sorter-cell.blade.php
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
@php
|
||||
$iArgs = ['sort_col' => $col];
|
||||
if (request()->search) {
|
||||
$iArgs['search'] = request()->search;
|
||||
}
|
||||
@endphp
|
||||
{{-- NO Sort for order column --}}
|
||||
@if ($col === 'order' or in_array($col, $ignore))
|
||||
<th @class([
|
||||
'h-100 text-center',
|
||||
'd-none d-md-table-cell' =>
|
||||
isset($mobileHide) and
|
||||
is_array($mobileHide) and
|
||||
in_array($col, $mobileHide),
|
||||
]) scope="col">
|
||||
<div class="d-flex justify-content-center align-items-center h-100">
|
||||
<span class="text-nowrap">{{ $colname }}</span>
|
||||
</div>
|
||||
</th>
|
||||
@else
|
||||
<th @class([
|
||||
'h-100 text-center',
|
||||
'd-none d-md-table-cell' =>
|
||||
isset($mobileHide) and
|
||||
is_array($mobileHide) and
|
||||
in_array($col, $mobileHide),
|
||||
]) scope="col">
|
||||
<div class="d-flex justify-content-center align-items-center h-100">
|
||||
<span class="text-nowrap">
|
||||
{{ $colname }}
|
||||
</span>
|
||||
@if (
|
||||
!session("$routeName.sort_way") or
|
||||
session("$routeName.sort_col") !== $col or
|
||||
session("$routeName.sort_way") === 'desc' and session("$routeName.sort_col") === $col)
|
||||
<a class="btn btn-sm btn-outline-secondary text-decoration-none ms-1" data-bs-toggle="tooltip"
|
||||
href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'asc', 'rst' => null])) }}"
|
||||
title="{{ __('crud.other.sort_descending', ['name' => str($colname)->lower()]) }}">
|
||||
<i class="fas fa-arrow-down 2xs"></i>
|
||||
</a>
|
||||
@endif
|
||||
@if (
|
||||
!session("$routeName.sort_way") or
|
||||
session("$routeName.sort_col") !== $col or
|
||||
session("$routeName.sort_way") === 'asc' and session("$routeName.sort_col") === $col)
|
||||
<a class="btn btn-sm btn-outline-secondary text-decoration-none ms-1"
|
||||
href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'desc', 'rst' => null])) }}" data-bs-toggle="tooltip"
|
||||
title="{{ __('crud.other.sort_ascending', ['name' => str($colname)->lower()]) }}">
|
||||
<i class="fas fa-arrow-up 2xs"></i>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</th>
|
||||
@endif
|
||||
|
|
@ -1,73 +1,31 @@
|
|||
@php
|
||||
$route = request()->route();
|
||||
$routeName = $route->getName();
|
||||
$rst = !is_null(request()->rst) || !Session::has("$routeName.sorted");
|
||||
$noOrder = !empty($noOrder);
|
||||
$noOrder = $noOrder || (Session::get("$routeName.sort_col") !== 'order' and (Session::has("$routeName.sort_col") or Session::has("$routeName.sort_way")));
|
||||
$noOrder = $noOrder || !empty(request()->search);
|
||||
$ignore = (isset($ignore) and is_array($ignore)) ? $ignore : [];
|
||||
$route = request()->route();
|
||||
$routeName = $route->getName();
|
||||
$rst = !is_null(request()->rst) || !session()->has("$routeName.sorted");
|
||||
$noOrder = !empty($noOrder);
|
||||
$noOrder =
|
||||
$noOrder ||
|
||||
(session()->get("$routeName.sort_col") !== 'order' and
|
||||
(session()->has("$routeName.sort_col") or session()->has("$routeName.sort_way")));
|
||||
$noOrder = $noOrder || !empty(request()->search);
|
||||
$ignore = (isset($ignore) and is_array($ignore)) ? $ignore : [];
|
||||
@endphp
|
||||
<tr class="table-col-sorter">
|
||||
@foreach($cols as $col => $colname)
|
||||
@php
|
||||
$iArgs = ['sort_col' => $col];
|
||||
if(request()->search) {
|
||||
$iArgs['search'] = request()->search;
|
||||
}
|
||||
@endphp
|
||||
{{-- NO Sort for order column --}}
|
||||
@if($col === 'order' or in_array($col, $ignore))
|
||||
@if($noOrder and !in_array($col, $ignore)) @continue @endif
|
||||
<th scope="col" class="text-center h-100 @if(isset($mobileHide) and is_array($mobileHide) and in_array($col, $mobileHide)) d-none d-md-table-cell @endif">
|
||||
<div class="d-flex justify-content-center align-items-center h-100">
|
||||
<span class="text-nowrap">{{ $colname }}</span>
|
||||
</div>
|
||||
</th>
|
||||
@continue
|
||||
@endif
|
||||
<th scope="col" class="text-center h-100 @if(isset($mobileHide) and is_array($mobileHide) and in_array($col, $mobileHide)) d-none d-md-table-cell @endif">
|
||||
<div class="d-flex justify-content-center align-items-center h-100">
|
||||
<span class="text-nowrap">
|
||||
{{ $colname }}
|
||||
</span>
|
||||
@if(!session("$routeName.sort_way") or session("$routeName.sort_col") !== $col or (session("$routeName.sort_way") === 'desc' and session("$routeName.sort_col") === $col))
|
||||
<a class="text-decoration-none ms-1"
|
||||
href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'asc', 'rst' => null])) }}">
|
||||
<button
|
||||
class="btn btn-sm btn-outline-dark"
|
||||
title="{{ __('crud.other.sort_descending', ['name' => Str::lower($colname)]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fas fa-arrow-down 2xs"></i>
|
||||
</button>
|
||||
</a>
|
||||
@endif
|
||||
@if(!session("$routeName.sort_way") or session("$routeName.sort_col") !== $col or (session("$routeName.sort_way") === 'asc' and session("$routeName.sort_col") === $col))
|
||||
<a class="text-decoration-none ms-1"
|
||||
href="{{ request()->fullUrlWithQuery(array_merge($iArgs, ['sort_way' => 'desc', 'rst' => null])) }}">
|
||||
<button
|
||||
class="btn btn-sm btn-outline-dark"
|
||||
title="{{ __('crud.other.sort_ascending', ['name' => Str::lower($colname)]) }}"
|
||||
data-bs-toggle="tooltip">
|
||||
<i class="fas fa-arrow-up 2xs"></i>
|
||||
</button>
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</th>
|
||||
<tr class="table-col-sorter border-start-0 border-end-0 border-top-0 border-secondary border border-2">
|
||||
@foreach ($cols as $col => $colname)
|
||||
@include('bo.modules.table-col-sorter-cell')
|
||||
@endforeach
|
||||
{{-- Buttons Col --}}
|
||||
<th scope="col" class="text-end">
|
||||
@if(!$rst)
|
||||
<a class="btn btn-sm btn-danger"
|
||||
href="{{ request()->fullUrlWithQuery(['sort_col' => null, 'sort_way' => null, 'rst' => true, 'search' => null]) }}"
|
||||
data-bs-toggle="tooltip"
|
||||
title="{{ __('crud.other.sort_delete') }}">
|
||||
<i class="fa fa-eraser"></i>
|
||||
</a>
|
||||
<th class="text-end" scope="col">
|
||||
@if (!$rst)
|
||||
<a class="btn btn-sm btn-danger" data-bs-toggle="tooltip"
|
||||
href="{{ request()->fullUrlWithQuery(['sort_col' => null, 'sort_way' => null, 'rst' => true, 'search' => null]) }}"
|
||||
title="{{ __('crud.other.sort_delete') }}">
|
||||
<i class="fa fa-eraser"></i>
|
||||
</a>
|
||||
@else
|
||||
<span data-bs-toggle="tooltip" data-bs-placement="top" title="{{ __('crud.other.sort_arrow') }}">
|
||||
<i class="fas fa-question-circle"></i>
|
||||
</span>
|
||||
<span data-bs-toggle="tooltip" title="{{ __('crud.other.sort_arrow') }}">
|
||||
<i class="fas fa-question-circle"></i>
|
||||
</span>
|
||||
@endif
|
||||
</th>
|
||||
</tr>
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
@extends('layout.app', ['brParam' => $dutyhourModel])
|
||||
|
||||
@section('title', __('Création d\'une :model', ['model' => Str::singular(__('models.classes.dutyhours'))]))
|
||||
@section('description', __('Création d\'une toute nouvelle :model', ['model' => Str::singular(__('models.classes.dutyhours'))]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-3">
|
||||
<div class="d-flex flex-row align-items-center">
|
||||
<a href="{{ route('bo.dutyhours.index') }}"
|
||||
class="btn btn-primary text-decoration-none m-0 me-2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.dutyhours')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('breadcrumbs.breadcrumb-body', ['brParam' => $dutyhourModel])
|
||||
</div>
|
||||
<div class="mb-2 mb-md-0">
|
||||
<button id="formSubmitClone"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.dutyhours.store') }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@include('bo.pages.dutyhours.form-inputs')
|
||||
<div class="row mt-3">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
@extends('layout.app', ['brParam' => $dutyhourModel])
|
||||
|
||||
@section('title', __('Édition d\'une :model', ['model' => Str::singular(__('models.classes.dutyhours'))]))
|
||||
@section('description', __('Édition d\'une :model déjà existante', ['model' => Str::singular(__('models.classes.dutyhours'))]))
|
||||
@section('breadcrumb', request()->route()->getName())
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pb-3">
|
||||
<div class="d-flex flex-row align-items-start">
|
||||
<a href="{{ route('bo.dutyhours.index') }}"
|
||||
class="btn btn-primary text-decoration-none m-0 me-2"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.list_all', ['model' => __('models.classes.dutyhours')]) }}">
|
||||
<i class="fa-solid fa-arrow-left"></i>
|
||||
</a>
|
||||
@include('breadcrumbs.breadcrumb-body', ['brParam' => $dutyhourModel])
|
||||
</div>
|
||||
<div class="mb-2 mb-md-0">
|
||||
<form action="{{ route('bo.dutyhours.destroy', $dutyhourModel->id) }}"
|
||||
method="POST"
|
||||
class="confirmDeleteTS">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="btn-group" role="group">
|
||||
<button id="formSubmitClone"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
<button type="submit"
|
||||
class="btn btn-danger"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.delete_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<form action="{{ route('bo.dutyhours.update', $dutyhourModel->id) }}" method="POST" enctype="multipart/form-data">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
@include('bo.pages.dutyhours.form-inputs')
|
||||
<div class="row">
|
||||
<div class="col text-center">
|
||||
<button id="formSubmit"
|
||||
type="submit"
|
||||
class="btn btn-primary"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.save_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
{{ __('crud.actions.save') }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@endsection
|
||||
|
|
@ -1,98 +0,0 @@
|
|||
<div class="row">
|
||||
{{-- DATE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.date')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.date', [
|
||||
'id' => 'dutyhourDate',
|
||||
'label' => __(':field de la :model', [
|
||||
'field' => Str::ucfirst(__('validation.attributes.date')),
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
'name' => 'date',
|
||||
'defaultValue' => true,
|
||||
'required' => true,
|
||||
'model' => $dutyhourModel ?? null,
|
||||
'helper' => __('La date doit être supérieure ou égale à aujourd\'hui.'),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- PERSON --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.person')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'dutyhourPerson',
|
||||
'label' => __('Nom de la personne présente lors de la :model', [
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'person',
|
||||
'required' => true,
|
||||
'model' => $dutyhourModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __('Nom de la personne présente lors de la :model', [
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __(':field de la personne', [
|
||||
'field' => Str::ucfirst(__('validation.attributes.name')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- PLACE --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="border h-100 bg-white p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.place')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.varchar', [
|
||||
'id' => 'dutyhourPlace',
|
||||
'label' => __('Endroit où se déroule la :model', [
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
'hasWordCounter' => true,
|
||||
'name' => 'place',
|
||||
'required' => true,
|
||||
'model' => $dutyhourModel ?? null,
|
||||
'helper' => __('validation.between.string', [
|
||||
'attribute' => __('endroit où se déroule la :model', [
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
'min' => 3,
|
||||
'max' => 255,
|
||||
]),
|
||||
'placeholder' => __('Lieu de la :model', [
|
||||
'model' => Str::singular(__('models.classes.dutyhours')),
|
||||
]),
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// Submit button clone.
|
||||
const submit = document.getElementById('formSubmit')
|
||||
submitClone = document.getElementById('formSubmitClone');
|
||||
submitClone.addEventListener('click', (event) => {
|
||||
event.preventDefault();
|
||||
submit.click('');
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('title', __('models.classes.dutyhours'))
|
||||
@section('description', __('Liste de toutes les :model', ['model' => __('models.classes.dutyhours')]))
|
||||
|
||||
@section('content')
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center">
|
||||
@include('breadcrumbs.breadcrumb-body')
|
||||
<a href="{{ route('bo.dutyhours.create') }}"
|
||||
class="btn btn-primary float-right"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.helpers.create_model', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}">
|
||||
<i class="fa-solid fa-plus"></i>
|
||||
</a>
|
||||
</div>
|
||||
@include('bo.modules.search-bar')
|
||||
<table class="table table-hover">
|
||||
@if (count($dutyhourModels) > 0)
|
||||
<thead>
|
||||
@include('bo.modules.table-col-sorter', [
|
||||
'cols' => [
|
||||
'date' => Str::ucfirst(__('validation.attributes.date')),
|
||||
'person' => Str::ucfirst(__('validation.attributes.person')),
|
||||
'place' => Str::ucfirst(__('validation.attributes.place')),
|
||||
],
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($dutyhourModels as $dutyhourModel)
|
||||
<tr class="list-item border-bottom">
|
||||
<td class="text-center align-middle">{{ $dutyhourModel->date->format('Y-m-d') }}</td>
|
||||
<td class="text-center align-middle">{{ $dutyhourModel->person }}</td>
|
||||
<td class="text-center align-middle">{{ $dutyhourModel->place }}</td>
|
||||
<td class="text-end align-middle">
|
||||
<form action="{{ route('bo.dutyhours.destroy', $dutyhourModel->id) }}"
|
||||
method="POST"
|
||||
class="btn-group confirmDeleteTS"
|
||||
novalidate>
|
||||
<a class="btn btn-sm btn-primary"
|
||||
href="{{ route('bo.dutyhours.edit', ['dutyhour' => $dutyhourModel->id]) }}"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.actions.update') }}">
|
||||
<i class="fa-solid fa-pencil"></i>
|
||||
</a>
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit"
|
||||
class="btn btn-sm btn-danger"
|
||||
data-bs-toggle="tooltip"
|
||||
data-bs-placement="top"
|
||||
title="{{ __('crud.actions.delete') }}">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
@else
|
||||
<tr>
|
||||
<td class="text-center fw-bold border-0">{{ __('crud.other.no_model_found', ['model' => Str::singular(__('models.classes.dutyhours'))]) }}</td>
|
||||
</tr>
|
||||
@endif
|
||||
</table>
|
||||
{!! $dutyhourModels->links() !!}
|
||||
@endsection
|
||||
|
|
@ -59,12 +59,14 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{{-- GITLAB_PROJECT_ID --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ Str::ucfirst(__('validation.attributes.gitlab_project_id')) }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12 mb-3">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'siteGitlabProject',
|
||||
'label' => __(':field du :model', [
|
||||
|
|
@ -86,6 +88,30 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- PROJECT MANAGER --}}
|
||||
<div class="col-12 col-md-6 pb-3">
|
||||
<fieldset class="h-100 mb-3 border bg-white p-3">
|
||||
<legend>{{ __('Chef de projet') }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<label for="project_manager" class="col-form-label">
|
||||
<b>{{ __('Chef de projet') }}</b>
|
||||
</label>
|
||||
<select class="form-select" id="project_manager" name="project_manager_id">
|
||||
<option></option>
|
||||
@foreach (\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}"
|
||||
@if (intval(old('project_manager_id', ($siteModel and $siteModel->project_manager_id) ? $siteModel->project_manager_id : 0)) == $user->id) selected="selected" @endif>
|
||||
{{ $user->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
{{-- SITE URLS --}}
|
||||
<div class="col-12 mb-3">
|
||||
<fieldset class="row w-100 h-100 mx-auto border bg-white p-3">
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
'name' => Str::ucfirst(__('validation.attributes.name')),
|
||||
'url_re7' => Str::ucfirst(__('validation.attributes.url_re7')),
|
||||
'url_prod' => Str::ucfirst(__('validation.attributes.url_prod')),
|
||||
'project_manager_id' => __("Chef de projet"),
|
||||
],
|
||||
])
|
||||
</thead>
|
||||
|
|
@ -46,6 +47,13 @@
|
|||
-
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center align-middle">
|
||||
@if ($siteModel->project_manager_id)
|
||||
{{ $siteModel->projectManager->name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
@can('isAdmin')
|
||||
<td class="text-end align-middle">
|
||||
<form action="{{ route('bo.sites.destroy', $siteModel->id) }}"
|
||||
|
|
|
|||
|
|
@ -81,6 +81,16 @@
|
|||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-item border-bottom">
|
||||
<td class="text-center align-middle">{{ __("Chef de projet") }}</td>
|
||||
<td class="text-center align-middle">
|
||||
@if ($siteModel->project_manager_id)
|
||||
{{ $siteModel->projectManager->name }}
|
||||
@else
|
||||
-
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="list-item border-bottom">
|
||||
<td class="text-center align-middle">{{ Str::ucfirst(__('validation.attributes.created_at')) }}</td>
|
||||
<td class="text-center align-middle"><span class="badge bg-info">{{ $siteModel->created_at }}</span></td>
|
||||
|
|
|
|||
|
|
@ -93,6 +93,11 @@
|
|||
|
||||
</div>
|
||||
@endcan
|
||||
|
||||
<div class="form-group col">
|
||||
<label class="col-form-label" for="date_mep">{{ __('Date de mise en production souhaitée') }}</label>
|
||||
<input class="form-control" id="date_mep" name="date_mep" type="date" min="{{ date('Y-m-j') }}" value="{{ old('date_mep') ?? (isset($ticket) && !is_null($ticket->date_mep) ? $ticket->date_mep->format('Y-m-j') : '') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
|
|
|
|||
|
|
@ -9,51 +9,56 @@
|
|||
$userPr = Auth::user()->sites ?? collect([]);
|
||||
@endphp
|
||||
<div class="container-xxl container">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h1 class="fw-bold">{{ __('Tickets') }}
|
||||
@if (Session::get('tickets.st') == \App\Enums\Tickets\TicketStatusEnum::archived->value)
|
||||
(Archivés)
|
||||
@endif
|
||||
</h1>
|
||||
@if (session('tickets.pr'))
|
||||
@php
|
||||
$projectManager = \App\Models\Site::query()->find(session('tickets.pr'))->projectManager;
|
||||
@endphp
|
||||
@if($projectManager)
|
||||
<h2>{{ __("Chef de projet") }} : {{ $projectManager->name; }}</h2>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
<div class="col">
|
||||
<a class="btn btn-primary float-end" href="{{ route('bo.ticket.create') }}">
|
||||
<i class="fa-solid fa-square-plus"></i> {{ __('ticket') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h2 class="d-inline">{{ __('Gestion des tickets') }} @if (Session::get('tickets.st') == \App\Enums\Tickets\TicketStatusEnum::archived->value)
|
||||
(Archivés)
|
||||
@endif
|
||||
</h2>
|
||||
<div class="float-end">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group float-end">
|
||||
@can('isAdmin')
|
||||
<a class="btn btn-info" href="{{ route('bo.labels.index') }}"><i class="fa-solid fa-tags"></i></a>
|
||||
@endcan
|
||||
<a class="btn btn-primary" href="{{ route('bo.ticket.create') }}"><i
|
||||
class="fa-solid fa-square-plus"></i> {{ __('ticket') }}</a>
|
||||
@if (session('tickets.st') == \App\Enums\Tickets\TicketStatusEnum::archived->value)
|
||||
<a class="btn btn-success" href="{{ route('bo.ticket.index', ['sts' => -1]) }}"><i
|
||||
class="fa-solid fa-inbox"></i></a>
|
||||
@else
|
||||
<a class="btn btn-secondary float-end"
|
||||
href="{{ route('bo.ticket.index', ['st' => \App\Enums\Tickets\TicketStatusEnum::archived]) }}"><i
|
||||
class="fa-solid fa-box-archive"></i></a>
|
||||
@endif
|
||||
<a class="btn btn-dark" href="{{ route('bo.ticket.index', ['rst' => 1]) }}"><i
|
||||
class="fa-solid fa-eraser"></i> {{ __(' le tri') }}</a>
|
||||
</div>
|
||||
<div class="float-end me-2">
|
||||
<div class="row mt-3">
|
||||
<div class="col">
|
||||
<div class="row">
|
||||
{{-- All sites --}}
|
||||
<div class="col">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectProject"><i
|
||||
class="fa-solid fa-diagram-project"></i></label>
|
||||
<label class="input-group-text" for="selectProject">
|
||||
<i class="fa-solid fa-diagram-project"></i>
|
||||
</label>
|
||||
<select class="form-select" id="selectProject">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
<option value="-1">{{ __('Tous les sites') }}</option>
|
||||
@foreach ($sites as $site)
|
||||
@if (Auth::user()->isAdmin())
|
||||
<option value="{{ $site->id }}"
|
||||
@if (intval(session('tickets.pr')) == $site->id) selected="selected" @endif>{{ $site->name }}
|
||||
@if (intval(session('tickets.pr')) == $site->id) selected="selected" @endif>
|
||||
{{ $site->name }}
|
||||
</option>
|
||||
@elseif (
|
||||
$userPr->filter(function ($pr) use ($site) {
|
||||
return $pr->id === $site->id;
|
||||
})->count())
|
||||
<option value="{{ $site->id }}"
|
||||
@if (intval(session('tickets.pr')) == $site->id) selected="selected" @endif>{{ $site->name }}
|
||||
@if (intval(session('tickets.pr')) == $site->id) selected="selected" @endif>
|
||||
{{ $site->name }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
|
|
@ -61,288 +66,389 @@
|
|||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectProject').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'prs=-1' : 'pr=' + this.value);
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'prs=-1' : 'pr=' + this
|
||||
.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</div>
|
||||
<div class="float-end me-2">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectStatus"><i class="fa-solid fa-sign-hanging"></i></label>
|
||||
<select class="form-select" id="selectStatus">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach ($status as $statut)
|
||||
<option value="{{ $statut->value }}"
|
||||
@if (intval(session('tickets.st')) == $statut->value) selected="selected" @endif>{{ $statut->label() }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectStatus').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'sts=-1' : 'st=' + this.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
@can('assignTickets', App\Models\Ticket::class)
|
||||
{{-- All types --}}
|
||||
<div class="col">
|
||||
<div class="float-end me-2 mt-3">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectAssign"><i class="fa-solid fa-hat-wizard"></i></label>
|
||||
<select class="form-select" id="selectAssign">
|
||||
<option value="-1">{{ __('Tous') }}</option>
|
||||
@foreach (\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}"
|
||||
@if (intval(session('tickets.ass')) == $user->id) selected="selected" @endif>{{ $user->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectAssign').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'assr=-1' : 'ass=' + this.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
<div class="col">
|
||||
<div class="float-end me-2 mt-3">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectType"><i class="fa-solid fa-ticket"></i></label>
|
||||
<label class="input-group-text" for="selectType"><i
|
||||
class="fa-solid fa-ticket"></i></label>
|
||||
<select class="form-select" id="selectType">
|
||||
<option value="-1">{{ __('Tous les types') }}</option>
|
||||
@foreach ($types as $type)
|
||||
<option value="{{ $type->value }}"
|
||||
@if (intval(session('tickets.ty')) == $type->value) selected="selected" @endif>{{ $type->label() }}
|
||||
@if (intval(session('tickets.ty')) == $type->value) selected="selected" @endif>
|
||||
{{ $type->label() }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectType').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'tys=-1' : 'ty=' + this.value);
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'tys=-1' : 'ty=' + this
|
||||
.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col">
|
||||
<form class="w-75 float-end mt-3" id="searchTicketForm"
|
||||
action="{{ request()->fullUrlWithQuery(['search' => '']) }}">
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control" id="searchTicket" name="search" type="text"
|
||||
value="{{ session()->get('tickets.search') }}" aria-label="{{ __('Recherche de ticket..') }}"
|
||||
aria-describedby="searchTicket" placeholder="{{ __('Recherche de ticket..') }}">
|
||||
<button class="btn btn-outline-danger" id="searchDelete" type="button"><i
|
||||
class="fa-solid fa-delete-left"></i></button>
|
||||
<button class="btn btn-outline-primary" type="submit"><i
|
||||
class="fa-solid fa-magnifying-glass"></i></button>
|
||||
{{-- All status --}}
|
||||
<div class="col">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectStatus"><i
|
||||
class="fa-solid fa-sign-hanging"></i></label>
|
||||
<select class="form-select" id="selectStatus">
|
||||
<option value="-1">{{ __('Tous les statuts') }}</option>
|
||||
@foreach ($status as $statut)
|
||||
<option value="{{ $statut->value }}"
|
||||
@if (intval(session('tickets.st')) == $statut->value) selected="selected" @endif>
|
||||
{{ $statut->label() }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectStatus').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'sts=-1' : 'st=' + this
|
||||
.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('searchDelete').addEventListener('click', function(e) {
|
||||
document.getElementById('searchTicket').value = '';
|
||||
document.getElementById('searchTicketForm').submit();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</form>
|
||||
</div>
|
||||
{{-- All assigned to --}}
|
||||
@can('assignTickets', App\Models\Ticket::class)
|
||||
<div class="col">
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="selectAssign"><i
|
||||
class="fa-solid fa-hat-wizard"></i></label>
|
||||
<select class="form-select" id="selectAssign">
|
||||
<option value="-1">{{ __("Sans filtre d'assignation") }}</option>
|
||||
@foreach (\App\Models\User::adminUsers() as $user)
|
||||
<option value="{{ $user->id }}"
|
||||
@if (intval(session('tickets.ass')) == $user->id) selected="selected" @endif>
|
||||
{{ $user->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('selectAssign').addEventListener('change', function(e) {
|
||||
window.location = '{{ route('bo.ticket.index') }}?' + (this.value == -1 ? 'assr=-1' : 'ass=' + this
|
||||
.value);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</div>
|
||||
</div>
|
||||
@endcan
|
||||
{{-- Search form --}}
|
||||
<div class="col">
|
||||
<form id="searchTicketForm"
|
||||
action="{{ request()->fullUrlWithQuery(['search' => '']) }}">
|
||||
<div class="input-group mb-3">
|
||||
<input class="form-control" id="searchTicket" name="search" type="text"
|
||||
value="{{ session()->get('tickets.search') }}"
|
||||
aria-label="{{ __('Recherche de ticket...') }}" aria-describedby="searchTicket"
|
||||
placeholder="{{ __('Recherche de ticket...') }}">
|
||||
<button class="btn btn-outline-danger" id="searchDelete" type="button"><i
|
||||
class="fa-solid fa-delete-left"></i></button>
|
||||
<button class="btn btn-outline-primary" type="submit"><i
|
||||
class="fa-solid fa-magnifying-glass"></i></button>
|
||||
</div>
|
||||
@push('scripts')
|
||||
<script nonce="{{ $nonce }}">
|
||||
document.getElementById('searchDelete').addEventListener('click', function(e) {
|
||||
document.getElementById('searchTicket').value = '';
|
||||
document.getElementById('searchTicketForm').submit();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="btn-group float-end">
|
||||
@if (session('tickets.pr') && session('tickets.st') != \App\Enums\Tickets\TicketStatusEnum::archived->value)
|
||||
@if (session('tickets.or'))
|
||||
<a class="btn btn-info float-end"
|
||||
href="{{ route('bo.ticket.index', ['ord' => -1]) }}">
|
||||
<i
|
||||
class="fa-solid fa-equals"></i> {{ __('see_mode', ['mode' => __('validation.custom.default')]) }}
|
||||
</a>
|
||||
@else
|
||||
<a class="btn btn-danger" href="{{ route('bo.ticket.index', ['or' => 1]) }}">
|
||||
<i
|
||||
class="fa-solid fa-triangle-exclamation"></i> {{ __('see_mode', ['mode' => __('validation.custom.priority')]) }}
|
||||
</a>
|
||||
@endif
|
||||
@endif
|
||||
@if (session('tickets.st') == \App\Enums\Tickets\TicketStatusEnum::archived->value)
|
||||
<a class="btn btn-success" href="{{ route('bo.ticket.index', ['sts' => -1]) }}">
|
||||
<i class="fa-solid fa-inbox"></i>
|
||||
</a>
|
||||
@else
|
||||
<a class="btn btn-secondary float-end"
|
||||
href="{{ route('bo.ticket.index', ['st' => \App\Enums\Tickets\TicketStatusEnum::archived]) }}">
|
||||
<i class="fa-solid fa-box-archive"></i>
|
||||
</a>
|
||||
@endif
|
||||
<a class="btn btn-dark" href="{{ route('bo.ticket.index', ['rst' => 1]) }}">
|
||||
<i class="fa-solid fa-eraser"></i> {{ __(' le tri') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table-hover table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">
|
||||
<span># </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'id'])</span>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<span>{{ __('Titre') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'title'])</span>
|
||||
</th>
|
||||
<th scope="col">
|
||||
<span>{{ __('Type') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'type'])</span>
|
||||
</th>
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<th scope="col">{{ __('Étiquettes') }}</th>
|
||||
@endcan
|
||||
@if (Auth::user()->isAdmin())
|
||||
<th scope="col">
|
||||
<span>{{ __('Assigné à') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'assigned_to'])</span>
|
||||
</th>
|
||||
@endif
|
||||
<th scope="col">
|
||||
<span>{{ __('Le') }} </span>
|
||||
<span>@include('modules.sorter', ['colname' => 'created_at'])</span>
|
||||
</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!count($tickets))
|
||||
<tr>
|
||||
<td class="text-center" colspan="@if (Auth::user()->isAdmin()) 6 @else 5 @endif">
|
||||
<h2>{{ __('Aucun ticket') }}</h2>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($tickets as $ticket)
|
||||
<tr class="position-relative">
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="me-1">{{ $ticket->id }} @if ($ticket->is_internal)
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
</span>
|
||||
<span class="d-flex flex-column text-end">
|
||||
@if (Auth::user()->isAdmin())
|
||||
<a href="{{ route('bo.sites.show', $ticket->site) }}"
|
||||
title="{{ __('Voir le site :sitename', [
|
||||
'sitename' => $ticket->site->name,
|
||||
]) }}">{{ $ticket->site->name }}</a>
|
||||
@else
|
||||
<span class="text-decoration-underline">{{ $ticket->site->name }}</span>
|
||||
@endif
|
||||
<span
|
||||
class="{{ $ticket->status->class() }} rounded text-center">{{ $ticket->status->label() }}</span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="me-1">{{ $ticket->title }}</span>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</td>
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<td>
|
||||
<span class="ticket-index-labels">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize"
|
||||
data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</span>
|
||||
<div class="overflow-scroll w-100">
|
||||
<table class="table-hover table">
|
||||
<thead>
|
||||
@php
|
||||
$cols = [];
|
||||
if (session('tickets.or')) {
|
||||
$cols = array_merge($cols, [
|
||||
'order' => Str::ucfirst(__('validation.custom.priority')),
|
||||
]);
|
||||
}
|
||||
$cols = array_merge($cols, [
|
||||
'id' => '#',
|
||||
]);
|
||||
if (!session()->has('tickets.pr') && !session('tickets.or')) {
|
||||
$cols = array_merge($cols, [
|
||||
'site' => Str::ucfirst(__('Website')),
|
||||
]);
|
||||
}
|
||||
$cols = array_merge($cols, [
|
||||
'type' => Str::ucfirst(__('validation.custom.type')),
|
||||
'status' => Str::ucfirst(__('validation.attributes.status')),
|
||||
'title' => Str::ucfirst(__('validation.attributes.name')),
|
||||
]);
|
||||
if (Auth::user()->isAdmin()) {
|
||||
$cols = array_merge($cols, [
|
||||
'tickets' => Str::ucfirst(__('validation.custom.tickets')),
|
||||
'assigned_to' => Str::ucfirst(__('validation.custom.assigned_to')),
|
||||
]);
|
||||
}
|
||||
$cols = array_merge($cols, [
|
||||
'date_mep' => Str::ucfirst(__('validation.custom.date_mep')),
|
||||
'created_at' => Str::ucfirst(__('validation.attributes.created_at')),
|
||||
]);
|
||||
@endphp
|
||||
@include('bo.modules.table-col-sorter', [
|
||||
'cols' => $cols,
|
||||
'ignore' => session('tickets.or')
|
||||
? array_keys($cols)
|
||||
: ['id', 'site', 'status', 'tickets'],
|
||||
])
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (!count($tickets))
|
||||
<tr>
|
||||
<td class="text-center"
|
||||
colspan="@if (Auth::user()->isAdmin()) 9 @else 6 @endif">
|
||||
<h2>{{ __('Aucun ticket') }}</h2>
|
||||
</td>
|
||||
@endcan
|
||||
@if (Auth::user()->isAdmin())
|
||||
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}</td>
|
||||
@endif
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<div>
|
||||
<div class="btn-group" role="group">
|
||||
@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
|
||||
</tr>
|
||||
@endif
|
||||
@foreach ($tickets as $key => $ticket)
|
||||
<tr class="position-relative">
|
||||
{{-- order --}}
|
||||
@if (session('tickets.or'))
|
||||
@include('bo.modules.change-model-order', [
|
||||
'routeName' => 'ticket',
|
||||
'model' => $ticket,
|
||||
'models' => $tickets,
|
||||
'value' => ($key + 1) + (($tickets->currentPage() - 1) * $tickets->perPage()),
|
||||
'noRightsVisible' => false,
|
||||
])
|
||||
@endif
|
||||
{{-- id --}}
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-center">
|
||||
<span>{{ $ticket->id }}
|
||||
@if ($ticket->is_internal)
|
||||
<i class="fa-solid fa-lock"></i>
|
||||
@endif
|
||||
@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
|
||||
@endcan
|
||||
</span>
|
||||
</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>
|
||||
</td>
|
||||
@if (!session()->has('tickets.pr') && !session('tickets.or'))
|
||||
{{-- site --}}
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-center">
|
||||
@if (Auth::user()->isAdmin())
|
||||
<a href="{{ route('bo.sites.show', $ticket->site) }}"
|
||||
title="{{ __('Voir le site :sitename', [
|
||||
'sitename' => $ticket->site->name,
|
||||
]) }}">{{ $ticket->site->name }}</a>
|
||||
@else
|
||||
<span
|
||||
class="text-decoration-underline">{{ $ticket->site->name }}</span>
|
||||
@endif
|
||||
</div>
|
||||
</td>
|
||||
@endif
|
||||
{{-- type --}}
|
||||
<td class="text-center">
|
||||
<span
|
||||
class="badge {{ $ticket->type->class() }}">{{ $ticket->type->label() }}</span>
|
||||
</td>
|
||||
{{-- status --}}
|
||||
<td scope="row">
|
||||
<div class="d-flex justify-content-between">
|
||||
<span class="d-flex flex-column">
|
||||
<span class="{{ $ticket->status->class() }} rounded text-center">
|
||||
{{ $ticket->status->label() }}
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</td>
|
||||
{{-- title --}}
|
||||
<td>
|
||||
<span class="me-1">{{ $ticket->title }}</span>
|
||||
</td>
|
||||
{{-- tag --}}
|
||||
@php
|
||||
$routeName = request()->route()->getName();
|
||||
@endphp
|
||||
@can('assignLabels', App\Models\Ticket::class)
|
||||
<td>
|
||||
<span class="ticket-index-labels">
|
||||
@foreach ($ticket->labels as $label)
|
||||
<span class="badge label colorize"
|
||||
data-color="{{ $label->color }}">{{ $label->name }}</span>
|
||||
@endforeach
|
||||
</span>
|
||||
</td>
|
||||
@endcan
|
||||
{{-- assigned_to / date_mep --}}
|
||||
@if (Auth::user()->isAdmin())
|
||||
<td>{{ $ticket->assignedUser ? $ticket->assignedUser->name : __('Personne') }}
|
||||
</td>
|
||||
@endif
|
||||
<td class="text-center">
|
||||
{{ is_null($ticket->date_mep) ? '-' : $ticket->date_mep->format('d/m/Y') }}
|
||||
</td>
|
||||
<td>{{ Carbon\Carbon::parse($ticket->created_at)->format('d/m/Y à H:i') }}</td>
|
||||
<td>
|
||||
<div class="d-flex flex-column">
|
||||
<div>
|
||||
<div class="btn-group" role="group">
|
||||
@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
|
||||
</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>
|
||||
@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
|
||||
@endcan
|
||||
</div>
|
||||
</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
|
||||
<!-- 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>
|
||||
@endcan
|
||||
<p>{!! clean(nl2br($ticket->text)) !!}</p>
|
||||
</div>
|
||||
</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() }}
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{{ $tickets->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@
|
|||
{{ $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>
|
||||
@if (auth()->user()->isAdmin())
|
||||
<a class="btn btn-primary"
|
||||
href="{{ route('bo.ticket.edit', $ticket) }}"><i
|
||||
class="fa-solid fa-pen"></i></a>
|
||||
@endif
|
||||
</h2>
|
||||
<div class="col d-flex flex-row text-end">
|
||||
@can('suscribeToTicket', $ticket)
|
||||
|
|
@ -99,7 +104,9 @@
|
|||
@endif
|
||||
<div>
|
||||
<h4>
|
||||
{{ __('Suivi') }}
|
||||
@if ($ticket->site->projectManager)
|
||||
{{ __("Chef de projet") }} : {{ $ticket->site->projectManager->name }}
|
||||
@endif
|
||||
@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') }}
|
||||
|
|
@ -272,6 +279,51 @@
|
|||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@php
|
||||
$linkedTickets = $ticket->linkedTickets;
|
||||
@endphp
|
||||
@if (!$linkedTickets->isEmpty() or auth()->user()->can('linkTicket', $ticket))
|
||||
<hr>
|
||||
<div class="flex-col">
|
||||
<div>
|
||||
<h4>{{ __('Tickets liés') }}</h4>
|
||||
</div>
|
||||
@can('linkTicket', $ticket)
|
||||
<div class="row">
|
||||
<form class="col" id="form_link_ticket" action="{{ route('bo.ticket.link', ['ticket' => $ticket]) }}" method="POST">
|
||||
@csrf
|
||||
<div class="input-group">
|
||||
<label class="input-group-text" for="link-ticket"><i class="fa-solid fa-ticket"></i></label>
|
||||
<input class="form-control" id="linked_ticket_id" name="linked_ticket_id" type="text" placeholder="Numéro du ticket">
|
||||
<button class="btn btn-sm btn-success float-end" type="submit">
|
||||
{{ __('Lier') }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@endcan
|
||||
<div class="row row-cols-auto gap-2">
|
||||
@foreach ($linkedTickets as $linked)
|
||||
<div class="col">
|
||||
@can('linkTicket', $ticket)
|
||||
<form id="form_unlink_ticket" action="{{ route('bo.ticket.unlink', ['ticket' => $ticket, 'linkedTicket' => $linked]) }}" method="POST">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<div class="input-group mt-2">
|
||||
@endcan
|
||||
<a class="btn btn-xl btn-outline-primary" target="_blank" href="{{ route('bo.ticket.show', $linked->id) }}" title="{{ Str::ucfirst(__('crud.other.view_linked_ticket', ['model' => $linked->id])) }}">
|
||||
TICKET - #{{ $linked->id }}
|
||||
</a>
|
||||
@can('linkTicket', $ticket)
|
||||
<button class="btn btn-xl btn-outline-danger" type="submit" title="{{ Str::ucfirst(__('crud.other.unlink_ticket', ['model' => $linked->id])) }}"><i class="fa-solid fa-link-slash"></i></button>
|
||||
</div>
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<hr>
|
||||
@can('createGitlabIssue', $ticket)
|
||||
<form class="col d-flex justify-content-end" id="form_issue" action="{{ route('bo.ticket.create-issue', $ticket) }}" method="POST">
|
||||
|
|
|
|||
|
|
@ -118,6 +118,25 @@
|
|||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
{{-- GITLAB_USER_ID --}}
|
||||
<div class="col-12 col-md-6 mb-3">
|
||||
<fieldset class="h-100 border bg-white p-3">
|
||||
<legend>{{ __("ID de l'utilisateur Gitlab") }}</legend>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
@include('bo.partials.inputs.int-number', [
|
||||
'id' => 'siteGitlabUserId',
|
||||
'label' => __("ID de l'utilisateur Gitlab"),
|
||||
'name' => 'gitlab_id',
|
||||
'required' => false,
|
||||
'model' => $userModel ?? null,
|
||||
'helper' => __("ID de l'utilisateur Gitlab"),
|
||||
'step' => 1,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
</select>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{{ $id }}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
value="{{ old($name, ((isset($model) and $model->{$name}) ? ($model->{$name}->format('Y-m-d') ?? ($defaultValue ? Carbon\Carbon::today() : '')) : ($defaultValue ? Carbon\Carbon::today() : ''))) }}">
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
@endif
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => '{{ $id }}Help',
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,7 @@
|
|||
<b>{{ $label }} {{ $required ? '*' : '' }}</b>
|
||||
</label>
|
||||
@endif
|
||||
@if(isset($appendText))
|
||||
<div class="input-group">
|
||||
@endif
|
||||
<input id="{{ $id }}"
|
||||
name="{{ $name }}"
|
||||
type="number"
|
||||
|
|
@ -39,6 +37,6 @@
|
|||
</div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => '{{ $id }}Help',
|
||||
'helperId' => $id.'Help',
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -16,6 +16,6 @@ $data = [
|
|||
<div class="belongs-to-many-dropdown" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper,
|
||||
])
|
||||
|
|
|
|||
|
|
@ -11,6 +11,6 @@
|
|||
value="{{ old($name, ((isset($model) and $model->{$name}) ? $model->{$name}->format('Y-m-d\TH:i') : '')) }}">
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => $id . 'Help',
|
||||
'helperId' => $id."Help",
|
||||
'helper' => (isset($model) and $model->{$name}) ? __('Leave empty for immediate display of the slider.') : __('Empty for immediate display of the slider.')
|
||||
])
|
||||
|
|
|
|||
|
|
@ -23,6 +23,6 @@ $data = [
|
|||
<div class="search-belongs-to-dropdown" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper,
|
||||
])
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ $data = [
|
|||
<div class="ck-editor" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper ?? __('crud.minicrud.text_warning', ['number' => 15]) . '. ' . __('validation.min.string', [
|
||||
'attribute' => $input['label'],
|
||||
'min' => 15
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<div class="list-item" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper,
|
||||
])
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
value="{{ old($name, ((isset($model) and $model->{$name}) ? ($model->{$name}->format('Y-m-d\TH:i') ?? ($defaultValue ? Carbon\Carbon::today() : '')) : ($defaultValue ? Carbon\Carbon::today() : ''))) }}">
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -10,5 +10,5 @@
|
|||
@if(old($name, (old('_token') ? false : ($model->{$name} ?? false)))) checked @endif>
|
||||
</div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name, 'helperId' => '{{ $id }}Help' , 'helper' => $helper
|
||||
'inputName' => $name, 'helperId' => $id."Help", 'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -10,6 +10,6 @@
|
|||
</select>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{{ $id }}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -22,6 +22,6 @@ $data = [
|
|||
<div class="input-text-auto" data-json='@json($data)'></div>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => "{$id}Help",
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -21,6 +21,6 @@
|
|||
@endif>
|
||||
@include('modules.input-error', [
|
||||
'inputName' => $name,
|
||||
'helperId' => $id.'Help',
|
||||
'helperId' => $id."Help",
|
||||
'helper' => $helper
|
||||
])
|
||||
|
|
|
|||
|
|
@ -1,58 +0,0 @@
|
|||
@extends('layout.app')
|
||||
|
||||
@section('title', __('Accueil'))
|
||||
@section('description', __('Page d\'accueil du site :site', ['site' => config('app.name')]))
|
||||
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row mt-4">
|
||||
<div class="col mb-5">
|
||||
<a href="{{ route('bo.ticket.create') }}" class="btn btn-primary">
|
||||
{{ __('Créer un ticket') }}
|
||||
</a>
|
||||
<a href="{{ route('bo.sites.index') }}" class="btn btn-primary ms-3">
|
||||
{{ __('Voir mes sites') }}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<h2 class="col h2 mb-3">
|
||||
<span class="fw-bold">{{ __('models.classes.dutyhours') . __(' à venir') }}</span>
|
||||
</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
<div class="table-responsive">
|
||||
<table class="table fix-action m-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ __('Date') }}</th>
|
||||
<th>{{ __('Personne présente') }}</th>
|
||||
<th>{{ __('Lieu de la permanence') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($dutyhourModels->count())
|
||||
@foreach ($dutyhourModels as $dutyhourModel)
|
||||
<tr>
|
||||
<td class="align-middle">{{ $dutyhourModel->date->formatLocalized('%d/%m/%Y') }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->person }}</td>
|
||||
<td class="align-middle">{{ $dutyhourModel->place }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@else
|
||||
<tr>
|
||||
<td colspan="5" class="text-center">
|
||||
<span class="h3">{{ __('Aucune :model prévue prochainement', ['model' => Str::singular(__('models.classes.dutyhours')) ])}}</span>
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
|
@ -40,14 +40,14 @@
|
|||
<a class="dropdown-item @if(Route::is('bo.packages.*'))active @endif" href="{{ route('bo.packages.index') }}">{{ __('models.classes.packages') }}</a>
|
||||
@endcan
|
||||
@can('isAdmin')
|
||||
<a class="dropdown-item @if(Route::is('bo.dutyhours.*'))active @endif" href="{{ route('bo.dutyhours.index') }}">{{ __('models.classes.dutyhours') }}</a>
|
||||
@endcan
|
||||
@can('isAdmin')
|
||||
<a class="dropdown-item @if(Route::is('bo.informations.*'))active @endif" href="{{ route('bo.informations.index') }}">{{ __('models.classes.informations') }}</a>
|
||||
@endcan
|
||||
@can('isAdmin')
|
||||
<a class="dropdown-item @if(Route::is('bo.ticket_types.*'))active @endif" href="{{ route('bo.ticket_types.index') }}">{{ trans_choice('models.classes.ticket_types', 2) }}</a>
|
||||
@endcan
|
||||
@can('isAdmin')
|
||||
<a class="dropdown-item @if(Route::is('bo.labels.*'))active @endif" href="{{ route('bo.labels.index') }}">{{ __('models.classes.labels') }}</a>
|
||||
@endcan
|
||||
</div>
|
||||
</li>
|
||||
@endcan
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
{{ __('Identifiants') }}
|
||||
</a>
|
||||
|
||||
<form id="logout-form" class="dropdown-item" action="{{route('logout')}}" method="POST" class="d-none">
|
||||
<form id="logout-form" class="dropdown-item" action="{{route('logout')}}" method="POST">
|
||||
@csrf
|
||||
<button class="btn btn-link p-0 text-decoration-none text-body-secondary text-capitalize" type="submit">{{ __('Déconnexion') }}</button>
|
||||
</form>
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
@if(!session('tickets.sort_way') or session('tickets.sort_col') !== $colname or (session('tickets.sort_way') === 'desc' and session('tickets.sort_col') === $colname))
|
||||
<a class="col_sort text-secondary lead asc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'asc']) }}"> ↓ </a>
|
||||
@endif
|
||||
@if(!session('tickets.sort_way') or session('tickets.sort_col') !== $colname or (session('tickets.sort_way') === 'asc' and session('tickets.sort_col') === $colname))
|
||||
<a class="col_sort text-secondary lead desc" href="{{ request()->fullUrlWithQuery(['sort_col' => $colname, 'sort_way' => 'desc']) }}"> ↑ </a>
|
||||
@endif
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
use App\Enums\Invoices\InvoiceStatusEnum;
|
||||
use App\Models\Brand;
|
||||
use App\Models\Company;
|
||||
use App\Models\Dutyhour;
|
||||
use App\Models\Information;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Label;
|
||||
|
|
@ -28,19 +27,6 @@ Breadcrumbs::for('bo.packages.edit', function (Generator $trail, Package $packag
|
|||
$trail->push(__('crud.actions.edit'), route('bo.packages.edit', $package->id));
|
||||
});
|
||||
|
||||
// * DUTYHOURS
|
||||
Breadcrumbs::for('bo.dutyhours.index', function (Generator $trail) {
|
||||
$trail->push(__('models.classes.dutyhours'), route('bo.dutyhours.index'));
|
||||
});
|
||||
Breadcrumbs::for('bo.dutyhours.create', function (Generator $trail) {
|
||||
$trail->parent('bo.dutyhours.index');
|
||||
$trail->push(__('crud.actions.create'), route('bo.dutyhours.create'));
|
||||
});
|
||||
Breadcrumbs::for('bo.dutyhours.edit', function (Generator $trail, Dutyhour $dutyhour) {
|
||||
$trail->parent('bo.dutyhours.index');
|
||||
$trail->push(__('crud.actions.edit'), route('bo.dutyhours.edit', $dutyhour->id));
|
||||
});
|
||||
|
||||
// * INFORMATIONS
|
||||
Breadcrumbs::for('bo.informations.index', function (Generator $trail) {
|
||||
$trail->push(__('models.classes.informations'), route('bo.informations.index'));
|
||||
|
|
|
|||
|
|
@ -5,8 +5,6 @@ use App\Http\Controllers\Bo\CompanyController;
|
|||
use App\Http\Controllers\Bo\Credit\AccountController;
|
||||
use App\Http\Controllers\Bo\Credit\CreditLogController;
|
||||
use App\Http\Controllers\Bo\Credit\EstimationController;
|
||||
use App\Http\Controllers\Bo\DashboardController;
|
||||
use App\Http\Controllers\Bo\DutyhourController;
|
||||
use App\Http\Controllers\Bo\InformationController;
|
||||
use App\Http\Controllers\Bo\InvoiceController;
|
||||
use App\Http\Controllers\Bo\LabelController;
|
||||
|
|
@ -43,7 +41,9 @@ Route::middleware('admin-secure')
|
|||
Route::middleware('auth:backend')
|
||||
->group(function () {
|
||||
// * HOME
|
||||
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
||||
Route::get('/', function(){
|
||||
return redirect()->route('bo.ticket.index');
|
||||
})->name('dashboard');
|
||||
|
||||
Route::middleware(['can:isAdmin'])
|
||||
->group(function () {
|
||||
|
|
@ -56,7 +56,6 @@ Route::middleware('admin-secure')
|
|||
->middleware('htmlsanitize:template')
|
||||
->parameters(['ticket_types' => 'ticket_type']);
|
||||
Route::resource('packages', PackageController::class)->except('show');
|
||||
Route::resource('dutyhours', DutyhourController::class)->except('show');
|
||||
Route::resource('invoices', InvoiceController::class)
|
||||
->withoutMiddleware('htmlsanitize')
|
||||
->middleware(['htmlsanitize:comment']);
|
||||
|
|
@ -95,6 +94,10 @@ Route::middleware('admin-secure')
|
|||
)
|
||||
->middleware('can:createGitlabIssue,ticket')
|
||||
->name('ticket.create-issue');
|
||||
Route::patch('/tickets/{ticket}/change-order/{direction}', [
|
||||
TicketController::class,
|
||||
'changeOrder'
|
||||
])->where('direction', 'up|down')->name('ticket.change-order');
|
||||
});
|
||||
Route::resource('credit_accounts', AccountController::class)
|
||||
->only(['index'])
|
||||
|
|
@ -150,6 +153,12 @@ Route::middleware('admin-secure')
|
|||
Route::post('/{ticket}/subscribe', [TicketController::class, 'subscribe'])
|
||||
->middleware('can:suscribeToTicket,ticket')
|
||||
->name('subscribe');
|
||||
Route::post('/{ticket}/link', [TicketController::class, 'linkTicket'])
|
||||
->middleware('can:linkTicket,ticket')
|
||||
->name('link');
|
||||
Route::delete('/{ticket}/unlink/{linkedTicket}', [TicketController::class, 'unlinkTicket'])
|
||||
->middleware('can:linkTicket,ticket')
|
||||
->name('unlink');
|
||||
Route::put('/{ticket}/archive', [TicketController::class, 'setToArchive'])
|
||||
->middleware('can:changeStatus,ticket')
|
||||
->name('archive');
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue