@extends('layouts.app') @section('title', 'Talepler Görev Yönetimi') @section('content') @php $boardStyleClass = ($boardStyle ?? 'kanban_default') === 'kanban_compact' ? 'board-compact' : 'board-default'; @endphp

Görev Yönetimi

Talepleri tek ekrandan yönetin ve takip edin

@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif @if ($errors->any())
@endif @if (!$ready)
Talepler görev tabloları hazır değil. Veritabanı geçişlerini çalıştırın.
@else {{-- Filtre Alani --}}
@if (($units->count() ?? 0) <= 1)
{{ (string) ($units->first()->unit_name ?? 'Birim Yok') }}
@else @endif
@php $unitScopeParams = array_filter([ 'unit_id' => (int) ($selectedUnitId ?? 0) ?: null, 'category_id' => (int) ($selectedCategoryId ?? 0) ?: null, 'status' => $activeStatus ?? 'all', 'priority' => ($activePriority ?? 'all') !== 'all' ? ($activePriority ?? 'all') : null, 'scope' => 'unit', 'q' => $search !== '' ? $search : null, ], static fn ($value) => $value !== null && $value !== ''); $mineScopeParams = array_filter([ 'unit_id' => (int) ($selectedUnitId ?? 0) ?: null, 'category_id' => (int) ($selectedCategoryId ?? 0) ?: null, 'status' => $activeStatus ?? 'all', 'priority' => ($activePriority ?? 'all') !== 'all' ? ($activePriority ?? 'all') : null, 'scope' => 'mine', 'q' => $search !== '' ? $search : null, ], static fn ($value) => $value !== null && $value !== ''); @endphp
@php $selectedUnitName = $selectedUnitId > 0 ? (string) (($units->firstWhere('id', $selectedUnitId)->unit_name ?? 'Bilinmeyen Birim')) : 'Tüm Birimler'; $selectedCategoryName = $selectedCategoryId > 0 ? (string) (($categories->firstWhere('id', $selectedCategoryId)->category_name ?? 'Bilinmeyen Kategori')) : 'Tüm Kategoriler'; $selectedStatusName = (string) ((($statusFilterOptions ?? $statusOptions)[$activeStatus] ?? $activeStatus)); $selectedScopeName = ($scopeFilter ?? 'unit') === 'mine' ? 'Bana Ait Olanlar' : 'Birime Ait Olanlar'; $shownCount = (int) ($requests->count()); $canQuickCreateFromBoard = ($quickCreateUnits->isNotEmpty() ?? false) && ($quickCreateCategories->isNotEmpty() ?? false); @endphp
Birim: {{ $selectedUnitName }} Kategori: {{ $selectedCategoryName }} Durum: {{ $selectedStatusName }} Öncelik: {{ ($priorityOptions[$activePriority ?? 'all'] ?? 'Tüm Öncelikler') }} Gösterim: {{ $selectedScopeName }} Arama: {{ $search !== '' ? $search : 'Yok' }} Görünen Kayıt: {{ $shownCount }}
{{-- Kanban Board Alani --}} @php $laneClassMap = ['todo' => 'lane-todo', 'doing' => 'lane-doing', 'done' => 'lane-done']; $laneIconMap = ['todo' => 'bi-circle', 'doing' => 'bi-arrow-repeat', 'done' => 'bi-check-circle-fill']; @endphp
@foreach (($boardLaneOrder ?? ['todo', 'doing', 'done']) as $laneStatus) @php $laneRows = $requestsByLane->get($laneStatus, collect()); $laneGroup = $laneStatus; $laneClass = $laneClassMap[$laneGroup] ?? 'lane-doing'; $laneIcon = $laneIconMap[$laneGroup] ?? 'bi-circle'; $laneLabel = $boardLaneLabels[$laneStatus] ?? ucfirst($laneStatus); @endphp
{{ $laneLabel }}
{{ $laneRows->count() }}
@forelse ($laneRows as $row) @php $allowedActionsJson = json_encode($row->allowed_actions ?? [], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $actionToStatusMapJson = json_encode($row->action_to_status_map ?? [], JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $rowActionMeta = (array) ($row->action_meta ?? []); $rowActionLabels = (array) ($row->action_labels ?? []); $rowActionUserOptions = (array) ($row->action_user_options ?? []); $rowStatusLaneMap = (array) ($row->status_lane_map ?? []); $rowStatusOptions = (array) ($row->status_options ?? []); $actionMetaJson = json_encode($rowActionMeta, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $actionLabelsJson = json_encode($rowActionLabels, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $actionUserOptionsJson = json_encode($rowActionUserOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $statusLaneMapJson = json_encode($rowStatusLaneMap, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $statusOptionsJson = json_encode($rowStatusOptions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); $searchHaystack = strtolower(trim((string) (($row->request_key ?? '') . ' ' . ($row->title ?? '') . ' ' . ($row->description ?? '') . ' ' . ($row->unit_name ?? '') . ' ' . ($row->category_name ?? '')))); $priorityClass = match (strtolower((string) ($row->priority ?? 'medium'))) { 'critical' => 'bg-danger-subtle text-danger border-danger', 'high' => 'bg-warning-subtle text-warning-emphasis border-warning', 'low' => 'bg-info-subtle text-info-emphasis border-info', default => 'bg-secondary-subtle text-secondary-emphasis border-secondary', }; $priorityIcon = match (strtolower((string) ($row->priority ?? 'medium'))) { 'critical' => 'bi-exclamation-triangle-fill', 'high' => 'bi-arrow-up-circle-fill', 'low' => 'bi-arrow-down-circle', default => 'bi-dash-circle', }; $priorityLabel = match (strtolower((string) ($row->priority ?? 'medium'))) { 'critical' => 'Kritik', 'high' => 'Yüksek', 'low' => 'Düşük', default => 'Orta', }; $statusKey = strtolower(trim((string) ($row->status ?? ''))); $stageLabelDisplay = trim((string) ($row->status_label ?? '')); $stageLabelFallbackMap = [ 'unassigned' => 'Ortak Havuz', 'assigned' => 'Atandı', 'in_progress' => 'İşlemde', 'solution_center' => 'Çözüm Merkezi', 'control' => 'Kontrol', 'customer_review_reporter' => 'Talep Sahibi Kontrolü', 'customer_review_approver' => 'Final Onay', 'done' => 'Tamamlandı', 'cancelled' => 'İptal', 'todo' => 'Yapılacaklar', 'doing' => 'İşlemdekiler', ]; if ($stageLabelDisplay === '' || str_contains($stageLabelDisplay, '_')) { $stageLabelDisplay = (string) ($stageLabelFallbackMap[$statusKey] ?? str_replace('_', ' ', $stageLabelDisplay)); } if ($stageLabelDisplay === '') { $stageLabelDisplay = '-'; } $reporterSourceName = trim((string) ($row->reporter_name ?? '')); $reporterInitials = 'U'; if ($reporterSourceName !== '') { $reporterParts = preg_split('/[\s]+/u', $reporterSourceName, -1, PREG_SPLIT_NO_EMPTY) ?: []; if (count($reporterParts) >= 2) { $reporterInitials = mb_strtoupper( mb_substr((string) $reporterParts[0], 0, 1, 'UTF-8') . mb_substr((string) end($reporterParts), 0, 1, 'UTF-8'), 'UTF-8' ); } else { $singleReporterPart = (string) ($reporterParts[0] ?? $reporterSourceName); $reporterInitials = mb_strtoupper(mb_substr($singleReporterPart, 0, 2, 'UTF-8'), 'UTF-8'); } } $avatarSourceName = trim((string) ($row->assignee_name ?? '')); $avatarInitials = '-'; if ($avatarSourceName !== '') { $avatarParts = preg_split('/[\s]+/u', $avatarSourceName, -1, PREG_SPLIT_NO_EMPTY) ?: []; if (count($avatarParts) >= 2) { $avatarInitials = mb_strtoupper( mb_substr((string) $avatarParts[0], 0, 1, 'UTF-8') . mb_substr((string) end($avatarParts), 0, 1, 'UTF-8'), 'UTF-8' ); } else { $singlePart = (string) ($avatarParts[0] ?? $avatarSourceName); $avatarInitials = mb_strtoupper(mb_substr($singlePart, 0, 2, 'UTF-8'), 'UTF-8'); } } $assigneeFullName = trim((string) ($row->assignee_name ?? '')); $assigneeShortName = $assigneeFullName !== '' ? $avatarInitials : 'Atanmadı'; @endphp
#{{ $row->request_key }} {{ $priorityLabel }}
{{ $row->title }}
{{ $row->unit_name }} {{ $row->category_name }} Aşama: {{ $stageLabelDisplay }}
Aktif İş Akışı Adımı: {{ $row->active_step_label ?? '' }}
{{ $reporterInitials }}
Talep Sahibi {{ $reporterSourceName !== '' ? $reporterSourceName : '-' }}
{{ $avatarInitials }}
Sorumlu {{ $assigneeShortName }}
@if($row->due_date)
Bitiş {{ \Carbon\Carbon::parse($row->due_date)->format('d.m.Y') }}
@endif
@if ($laneStatus === 'done' && !empty($row->can_archive))
@csrf
@endif @if ($laneStatus === 'done' && !empty($row->can_delete))
@csrf
@endif
@empty

Bu kolonda talep bulunmuyor

@endforelse
@endforeach
@if ($canQuickCreateFromBoard) @endif @endif
@endsection @push('styles') @endpush @push('scripts') @endpush