From a6c250c13e2de857494ec69a9370616b1c8358ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=9Cmit=20Tun=C3=A7?= Date: Wed, 1 Jul 2026 22:37:08 +0300 Subject: [PATCH] refactor: simplify internship approval process by removing unit approval and adding supervisor name tracking --- .../InternApplicationResource.php | 69 ++---- app/Http/Controllers/CareerController.php | 77 ++++-- app/Models/InternshipJournalEntry.php | 1 + ...sor_name_to_internship_journal_entries.php | 28 +++ .../front/career/partials/gantt.blade.php | 226 ++++++++++++++++++ resources/views/front/career/print.blade.php | 19 +- resources/views/front/career/verify.blade.php | 12 +- routes/web.php | 1 + 8 files changed, 337 insertions(+), 96 deletions(-) create mode 100644 database/migrations/2026_07_01_191610_add_supervisor_name_to_internship_journal_entries.php diff --git a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php index 3477523..6da7b63 100644 --- a/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php +++ b/app/Filament/Admin/Resources/InternApplications/InternApplicationResource.php @@ -232,30 +232,20 @@ class InternApplicationResource extends Resource if ($entry && trim($content) !== '') { $supApproved = $entry->supervisor_approved; - $unitApproved = $entry->unit_approved; + $supName = $entry->supervisor_name; $html .= '
'; // Supervisor approval $supBg = $supApproved ? '#d1fae5' : '#f1f5f9'; $supColor = $supApproved ? '#065f46' : '#64748b'; - $supText = $supApproved ? 'Sorumlu Onayladı' : 'Sorumlu Onayı Bekliyor'; + $supText = $supApproved ? 'Sorumlu Onayladı' . ($supName ? ' (Onaylayan: ' . e($supName) . ')' : '') : 'Sorumlu Onayı Bekliyor'; $html .= ' ' . $supText . ''; - // Unit approval - $unitBg = $unitApproved ? '#d1fae5' : '#f1f5f9'; - $unitColor = $unitApproved ? '#065f46' : '#64748b'; - $unitText = $unitApproved ? 'Birim Yetkilisi Onayladı' : 'Birim Yetkilisi Onayı Bekliyor'; - $html .= ' ' . $unitText . ''; - // Buttons $supBtnText = $supApproved ? 'Onayı Kaldır' : 'Onayla'; $supBtnBg = $supApproved ? '#ef4444' : '#2563eb'; - $html .= ' '; - - $unitBtnText = $unitApproved ? 'Onayı Kaldır' : 'Onayla'; - $unitBtnBg = $unitApproved ? '#ef4444' : '#2563eb'; - $html .= ' '; + $html .= ' '; $html .= '
'; } @@ -268,7 +258,7 @@ class InternApplicationResource extends Resource $html .= ' @endif @endpush diff --git a/resources/views/front/career/print.blade.php b/resources/views/front/career/print.blade.php index 742ce60..50ba1a6 100644 --- a/resources/views/front/career/print.blade.php +++ b/resources/views/front/career/print.blade.php @@ -425,24 +425,7 @@ E-ONAYLI -
{{ $intern->notebook_supervisor_name ?: 'Alperen Trunç' }}
- @else -
- İMZA BEKLENİYOR -
-
 
- @endif - - - -
-
Birim Yetkilisi
- @if($entry && $entry->unit_approved) -
- - E-ONAYLI -
-
{{ $intern->notebook_unit_name ?: 'Yetkili Birim Amiri' }}
+
{{ $entry->supervisor_name ?: ($intern->notebook_supervisor_name ?: 'Alperen Trunç') }}
@else
İMZA BEKLENİYOR diff --git a/resources/views/front/career/verify.blade.php b/resources/views/front/career/verify.blade.php index a58fb59..5dbd486 100644 --- a/resources/views/front/career/verify.blade.php +++ b/resources/views/front/career/verify.blade.php @@ -165,7 +165,7 @@
- @if($application->notebook_approved || $application->notebook_supervisor_signed || $application->notebook_unit_signed) + @if($application->notebook_approved || $application->notebook_supervisor_signed)
@@ -195,11 +195,6 @@ Sorumlu: {{ $application->notebook_supervisor_name ?: 'Alperen Trunç' }} @endif - @if($application->notebook_unit_signed) - - Yetkili: {{ $application->notebook_unit_name ?: 'Birim Yetkilisi' }} - - @endif
@@ -215,10 +210,7 @@ {{ $day['day_number'] }}. Gün Raporu @if($entry->supervisor_approved) - Sorumlu Onaylı - @endif - @if($entry->unit_approved) - Yetkili Onaylı + Sorumlu Onaylı{{ $entry->supervisor_name ? ' (' . $entry->supervisor_name . ')' : '' }} @endif {{ $day['formatted_date'] }} diff --git a/routes/web.php b/routes/web.php index 802ac3e..19d6465 100644 --- a/routes/web.php +++ b/routes/web.php @@ -131,6 +131,7 @@ Route::post('/stajyer/cikis', [\App\Http\Controllers\CareerController::class, 'i Route::get('/stajyer/admin/giris', [\App\Http\Controllers\CareerController::class, 'internAdminLoginForm'])->name('intern.admin.login'); Route::post('/stajyer/admin/giris', [\App\Http\Controllers\CareerController::class, 'internAdminLogin'])->name('intern.admin.login.submit'); Route::get('/stajyer/admin/panel', [\App\Http\Controllers\CareerController::class, 'internAdminDashboard'])->name('intern.admin.dashboard'); +Route::get('/stajyer/admin/journal-entry', [\App\Http\Controllers\CareerController::class, 'getJournalEntry'])->name('intern.admin.get-journal-entry'); Route::post('/stajyer/admin/toggle-approval', [\App\Http\Controllers\CareerController::class, 'toggleJournalApproval'])->name('intern.admin.toggle-journal-approval'); Route::post('/stajyer/admin/cikis', [\App\Http\Controllers\CareerController::class, 'internAdminLogout'])->name('intern.admin.logout');