Add the task calendar, holidays, workflow templates and customer removal
Task calendar (/jobs/calendar) replaces per-unit task Kanban columns (K34): a two-week Gantt of tasks per person. Bars move, resize and change person by dragging or through a keyboard dialog. Each task's estimate is booked evenly over working days into task_bookings, and what exceeds the daily maximum (jobs.daily_capacity_hours, 8 h) moves to the next working day. Tasks get planned_from/planned_to on the form. Holidays (/settings/holidays): Finnish public holidays calculated per year, which the admin can take out of use, plus company days off. Also includes the earlier uncommitted work: workflow templates with adding tasks from a template, and removing customers no module refers to. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -13,6 +13,7 @@ use App\Modules\Jobs\Presentation\Livewire\Forms\TaskForm;
|
||||
use App\Modules\Shared\Domain\Exceptions\DomainException;
|
||||
use App\Modules\Users\Application\Contracts\UserAccountQueries;
|
||||
use App\Modules\Users\Domain\Enums\Role;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Livewire\Attributes\Computed;
|
||||
use Livewire\Attributes\Locked;
|
||||
use Livewire\Component;
|
||||
@@ -130,11 +131,12 @@ new class extends Component
|
||||
|
||||
try {
|
||||
if ($this->taskId === null) {
|
||||
$addTask->execute($this->jobId, $data, (int) auth()->id());
|
||||
session()->flash('status', __('jobs.tasks.created', ['title' => trim($data->title)]));
|
||||
$taskId = $addTask->execute($this->jobId, $data, (int) auth()->id());
|
||||
$message = __('jobs.tasks.created', ['title' => trim($data->title)]);
|
||||
} else {
|
||||
$updateTask->execute($this->jobId, $this->taskId, $data);
|
||||
session()->flash('status', __('jobs.tasks.updated', ['title' => trim($data->title)]));
|
||||
$taskId = $this->taskId;
|
||||
$updateTask->execute($this->jobId, $taskId, $data);
|
||||
$message = __('jobs.tasks.updated', ['title' => trim($data->title)]);
|
||||
}
|
||||
} catch (CustomerJobNotFound|TaskNotFound) {
|
||||
abort(404);
|
||||
@@ -144,6 +146,14 @@ new class extends Component
|
||||
return;
|
||||
}
|
||||
|
||||
$plannedTo = app(TaskQueries::class)->findTask($this->jobId, $taskId)?->plannedTo;
|
||||
|
||||
if ($data->plannedFrom !== null && $plannedTo !== null && $plannedTo !== ($data->plannedTo ?? $data->plannedFrom)) {
|
||||
$message .= ' '.__('jobs.tasks.extended', ['to' => CarbonImmutable::parse($plannedTo)->format('j.n.Y')]);
|
||||
}
|
||||
|
||||
session()->flash('status', $message);
|
||||
|
||||
$this->redirect(route('jobs.show', $this->jobId).'#tasks', navigate: true);
|
||||
}
|
||||
|
||||
@@ -208,6 +218,15 @@ new class extends Component
|
||||
/>
|
||||
</div>
|
||||
|
||||
<fieldset class="space-y-2">
|
||||
<legend class="text-sm font-semibold">{{ __('jobs.tasks.schedule') }}</legend>
|
||||
<p class="text-sm text-zinc-600 dark:text-zinc-300">{{ __('jobs.tasks.fields.planned_hint') }}</p>
|
||||
<div class="grid gap-6 sm:grid-cols-2">
|
||||
<x-input wire:model="form.planned_from" type="date" :label="__('jobs.tasks.fields.planned_from')" />
|
||||
<x-input wire:model="form.planned_to" type="date" :label="__('jobs.tasks.fields.planned_to')" />
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<x-textarea wire:model="form.description" :label="__('jobs.tasks.fields.description')" resize-auto />
|
||||
|
||||
<div class="flex flex-wrap gap-3">
|
||||
|
||||
Reference in New Issue
Block a user