127 lines
9.3 KiB
PHP
127 lines
9.3 KiB
PHP
<div class="space-y-6" dusk="helpdesk-ticket-edit">
|
|
@include('helpdesk::partials.page-header', [
|
|
'eyebrow' => 'Helpdesk',
|
|
'title' => 'Edit Ticket',
|
|
'subtitle' => 'Update assignment, status, priority, category, team, project, due date and ticket details.',
|
|
])
|
|
|
|
<form wire:submit.prevent="save" class="space-y-6">
|
|
<div class="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-sm dark:border-zinc-700 dark:bg-zinc-900">
|
|
<div class="border-b border-zinc-200 bg-zinc-50 px-6 py-4 dark:border-zinc-700 dark:bg-zinc-900/80">
|
|
<div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
|
|
<div>
|
|
<h2 class="text-lg font-semibold text-zinc-900 dark:text-zinc-100">{{ $ticket->reference }}</h2>
|
|
<p class="mt-1 text-sm text-zinc-500 dark:text-zinc-400">Fields marked <span class="font-semibold text-red-600">*</span> are mandatory.</p>
|
|
</div>
|
|
<div class="flex flex-wrap gap-2">
|
|
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate class="inline-flex items-center rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white shadow-sm hover:bg-blue-700">
|
|
<i class="fa-solid fa-arrow-left mr-2" aria-hidden="true"></i> Back
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="grid gap-6 p-6 lg:grid-cols-2">
|
|
<div class="lg:col-span-2">
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="subject">Subject <span class="text-red-600">*</span></label>
|
|
<input id="subject" type="text" wire:model.defer="subject" class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100" data-dusk="ticket-edit-subject">
|
|
@error('subject') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
@if($companies->isNotEmpty())
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="company_id">Company</label>
|
|
<select id="company_id" wire:model.defer="company_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
|
|
<option value="">Global / no company</option>
|
|
@foreach ($companies as $company)
|
|
<option value="{{ $company->id }}">{{ $company->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('company_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
@endif
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="agent_id">Assigned agent</label>
|
|
<select id="agent_id" wire:model.defer="agent_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100" data-dusk="ticket-edit-agent">
|
|
<option value="">Unassigned</option>
|
|
@foreach ($agents as $agent)
|
|
<option value="{{ $agent->id }}">{{ $agent->name }} — {{ $agent->email }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('agent_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="status_id">Status <span class="text-red-600">*</span></label>
|
|
<select id="status_id" wire:model.defer="status_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100" data-dusk="ticket-edit-status">
|
|
@foreach ($statuses as $status)
|
|
<option value="{{ $status->id }}">{{ $status->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('status_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="priority_id">Priority <span class="text-red-600">*</span></label>
|
|
<select id="priority_id" wire:model.defer="priority_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100" data-dusk="ticket-edit-priority">
|
|
@foreach ($priorities as $priority)
|
|
<option value="{{ $priority->id }}">{{ $priority->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('priority_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="category_id">Category</label>
|
|
<select id="category_id" wire:model.defer="category_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
|
|
<option value="">No category</option>
|
|
@foreach ($categories as $category)
|
|
<option value="{{ $category->id }}">{{ $category->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('category_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="project_id">Project</label>
|
|
<select id="project_id" wire:model.defer="project_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
|
|
<option value="">No project</option>
|
|
@foreach ($projects as $project)
|
|
<option value="{{ $project->id }}">{{ $project->title }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('project_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="team_id">Team</label>
|
|
<select id="team_id" wire:model.defer="team_id" data-helpdesk-select class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
|
|
<option value="">No team</option>
|
|
@foreach ($teams as $team)
|
|
<option value="{{ $team->id }}">{{ $team->name }}</option>
|
|
@endforeach
|
|
</select>
|
|
@error('team_id') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-semibold text-zinc-700 dark:text-zinc-200" for="due_at">Due date</label>
|
|
<input id="due_at" type="date" wire:model.defer="due_at" class="mt-2 block w-full rounded-xl border-zinc-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-100">
|
|
@error('due_at') <p class="mt-2 text-sm text-red-600">{{ $message }}</p> @enderror
|
|
</div>
|
|
|
|
<div class="lg:col-span-2">
|
|
<x-helpdesk::html-editor dusk="ticket-edit-body-editor" wire:model="body" label="Details *" rows="12" placeholder="Update the ticket details, current issue, expected outcome and useful context..." />
|
|
</div>
|
|
</div>
|
|
|
|
<div class="flex flex-wrap items-center justify-end gap-3 border-t border-zinc-200 px-6 py-4 dark:border-zinc-700">
|
|
<a href="{{ route('helpdesk.tickets.show', $ticket) }}" wire:navigate class="rounded-xl border border-zinc-300 px-4 py-2 text-sm font-semibold text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800">Cancel</a>
|
|
<button type="submit" class="rounded-xl bg-emerald-600 px-5 py-2 text-sm font-semibold text-white shadow-sm hover:bg-emerald-700" data-dusk="ticket-edit-submit">Save Ticket</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
@include('helpdesk::partials.select2-loader')
|
|
</div>
|