@extends('layouts.app') @section('title', 'Planning équipe · ' . $organization->name) @section('eyebrow', 'Organiser') @section('heading', 'Planning équipe') @section('content') @php $previousMonth = $month->copy()->subMonth()->format('Y-m'); $nextMonth = $month->copy()->addMonth()->format('Y-m'); $dayNames = [ 1 => 'Lundi', 2 => 'Mardi', 3 => 'Mercredi', 4 => 'Jeudi', 5 => 'Vendredi', ]; $shiftByName = $shifts->keyBy('name'); $entryCode = function ($entry) use ($shiftByName) { if (!$entry) { return '—'; } if ($entry->entry_type === 'Formation') { return 'FO'; } if ($entry->entry_type === 'Absence') { return str_contains((string) $entry->comment, '[LEAVE]') || $entry->slot === 'CP' ? 'CP' : 'ABS'; } $shift = $shiftByName->get($entry->slot); if ($shift) { return $shift->code; } if (preg_match('/\[CUSTOM:([^\]]+)\]/', (string) $entry->comment)) { return $entry->slot; } return mb_strtoupper(mb_substr($entry->slot, 0, 3)); }; $entryKind = function ($entry) { if (!$entry) { return 'off'; } if ($entry->entry_type === 'Formation') { return 'formation'; } if ($entry->entry_type === 'Absence') { return str_contains((string) $entry->comment, '[LEAVE]') || $entry->slot === 'CP' ? 'leave' : 'absence'; } return str_contains((string) $entry->comment, '[CUSTOM:') ? 'custom' : 'shift'; }; $closureForDate = function ($date) use ($closures) { return $closures->first(function ($closure) use ($date) { return \Carbon\Carbon::parse($date)->betweenIncluded( \Carbon\Carbon::parse($closure->start_date), \Carbon\Carbon::parse($closure->end_date) ); }); }; @endphp
Cliquez sur une cellule pour modifier le poste ou enregistrer une exception individuelle.
Sélectionnez une semaine puis filtrez éventuellement par section.