refactor(routes): hapus route destroy untuk jenis lampiran
- Menghapus route untuk menghapus jenis lampiran dari file routes/web.php. - Memperbarui query pada PenilaianController untuk memuat relasi lampiran dokumen dan jenis lampiran.
This commit is contained in:
@@ -437,10 +437,10 @@ class PenilaianController extends Controller
|
|||||||
$header = $headers[$type] ?? 'Pelaporan';
|
$header = $headers[$type] ?? 'Pelaporan';
|
||||||
$authorization = null;
|
$authorization = null;
|
||||||
if ($header === 'SLA') {
|
if ($header === 'SLA') {
|
||||||
$authorization = Authorization::with(['user'])->find($id);
|
$authorization = Authorization::with(['user','permohonan.lampiranDokumen.jenisLampiran'])->find($id);
|
||||||
$permohonan = Permohonan::find($authorization->permohonan_id);
|
$permohonan = Permohonan::with(['lampiranDokumen.jenisLampiran'])->find($authorization->permohonan_id);
|
||||||
} else {
|
} else {
|
||||||
$permohonan = Permohonan::find($id);
|
$permohonan = Permohonan::with(['lampiranDokumen.jenisLampiran'])->find($id);
|
||||||
}
|
}
|
||||||
if ($header === 'SLA') {
|
if ($header === 'SLA') {
|
||||||
return view('lpj::penilaian.otorisator.sla', compact('permohonan', 'header', 'authorization'));
|
return view('lpj::penilaian.otorisator.sla', compact('permohonan', 'header', 'authorization'));
|
||||||
|
|||||||
@@ -199,12 +199,30 @@
|
|||||||
(Auth::user()->hasAnyRole(['administrator', 'senior-officer']) &&
|
(Auth::user()->hasAnyRole(['administrator', 'senior-officer']) &&
|
||||||
$authorization->approve_so != null &&
|
$authorization->approve_so != null &&
|
||||||
$authorization->approve_eo != null) ||
|
$authorization->approve_eo != null) ||
|
||||||
$authorization->approve_dd != null)
|
$authorization->approve_dd != null
|
||||||
|
)
|
||||||
|
@php
|
||||||
|
$memoDeviasiExists = false;
|
||||||
|
if ($authorization->permohonan && $authorization->permohonan->lampiranDokumen) {
|
||||||
|
$memoDeviasiExists = $authorization->permohonan->lampiranDokumen()
|
||||||
|
->whereHas('jenisLampiran', function($query) {
|
||||||
|
$query->where('nama', 'memo-deviasi');
|
||||||
|
})
|
||||||
|
->exists();
|
||||||
|
}
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if ($memoDeviasiExists)
|
||||||
<button onclick="otorisatorData({{ $authorization->id }}, 'UNFREZE')" type="button"
|
<button onclick="otorisatorData({{ $authorization->id }}, 'UNFREZE')" type="button"
|
||||||
class="btn btn-primary">
|
class="btn btn-primary">
|
||||||
<i class="ki-filled ki-double-check"></i>
|
<i class="ki-filled ki-double-check"></i>
|
||||||
Otorisasi Un{{ $header ?? '' }}
|
Otorisasi Un{{ $header ?? '' }}
|
||||||
</button>
|
</button>
|
||||||
|
@else
|
||||||
|
<span class="badge badge-warning">
|
||||||
|
Memo Deviasi Belum Ada
|
||||||
|
</span>
|
||||||
|
@endif
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -60,7 +60,6 @@ Route::middleware(['auth'])->group(function () {
|
|||||||
Route::get('datatables', [JenisLampiranController::class, 'dataForDatatables'])->name('datatables');
|
Route::get('datatables', [JenisLampiranController::class, 'dataForDatatables'])->name('datatables');
|
||||||
Route::get('export', [JenisLampiranController::class, 'export'])->name('export');
|
Route::get('export', [JenisLampiranController::class, 'export'])->name('export');
|
||||||
});
|
});
|
||||||
Route::delete('jenis-lampiran/{id}', [JenisLampiranController::class, 'destroy'])->name('jenis-lampiran.destroy');
|
|
||||||
Route::resource('jenis-lampiran', JenisLampiranController::class);
|
Route::resource('jenis-lampiran', JenisLampiranController::class);
|
||||||
|
|
||||||
Route::name('custom-field.')->prefix('custom-field')->group(function () {
|
Route::name('custom-field.')->prefix('custom-field')->group(function () {
|
||||||
|
|||||||
Reference in New Issue
Block a user