✨(Roles): Tambahkan role EO Appraisal ke berbagai komponen LPJ
## Perubahan Utama: - 🔧 **Role Management**: Menambahkan role 'EO Appraisal' ke berbagai komponen untuk akses tombol simpan - 🐛 **Fix Kondisi**: Memperbaiki logika kondisi untuk data MIG (Migrasi) di print-out-sederhana - 💅 **UI Enhancement**: Konversi table ke div untuk bagian keterangan dengan format yang lebih rapi - 🎨 **Code Style**: Fix indentation dan whitespace di PermohonanController ## Detail Perubahan: ### File yang Dimodifikasi: 1. **`resources/views/penilai/components/call-report.blade.php`** (Line 507): - Menambahkan `'EO Appraisal'` ke array role yang memiliki akses tombol simpan - Sebelumnya: `['senior-officer', 'surveyor', 'administrator']` - Sekarang: `['senior-officer', 'surveyor', 'administrator','EO Appraisal']` 2. **`resources/views/penilai/components/lpj-sederhana-standar.blade.php`** (Line 47): - Menambahkan `'EO Appraisal'` dan `'penilai'` ke role yang dapat menyimpan data - Memperluas akses untuk role penilai dan EO Appraisal 3. **`resources/views/penilai/components/memo.blade.php`** (Line 318): - Menambahkan `'EO Appraisal'` ke role yang dapat menyimpan memo - Memastikan konsistensi akses antar komponen 4. **`resources/views/penilai/components/print-out-sederhana.blade.php`**: - **Line 558-580**: Memperbaiki urutan kondisi pengecekan data MIG - Memindahkan fallback data tanah dan bangunan ke atas - Menambahkan kondisi `@if(!$permohonan->is_mig)` untuk data non-MIG - Menjaga data `npw_tambahan` tetap diproses setelahnya - **Line 647-700**: Konversi table ke div untuk bagian keterangan - Mengganti struktur `<table><tr><td>` menjadi `<div>` dengan styling yang lebih rapi - Menambahkan handling untuk berbagai format data (array, string, quoted) - Implementasi bullet points yang lebih konsisten - Menambahkan fallback message "Tidak ada catatan khusus" 5. **`resources/views/penilai/components/rap-penilai.blade.php`** (Line 72 & 115): - Menambahkan `'EO Appraisal'` ke role yang dapat menyimpan data RAP - Fix whitespace yang tidak perlu 6. **`resources/views/penilai/components/signature-approval.blade.php`** (Line 117): - Fix whitespace dan formatting 7. **`app/Http/Controllers/PermohonanController.php`** (Line 55): - Fix indentation yang tidak konsisten - Memperbaiki format kode untuk better readability
This commit is contained in:
@@ -52,7 +52,7 @@
|
||||
if ($validate) {
|
||||
if(auth()->user()->hasRole('admin')){
|
||||
$validate['status'] = "preregister";
|
||||
}
|
||||
}
|
||||
try {
|
||||
// Process file upload
|
||||
$filePath = null;
|
||||
|
||||
@@ -504,7 +504,7 @@
|
||||
</div>
|
||||
|
||||
<div class="flex gap-2 justify-end" style="margin-right: 20px; margin-top: 20px">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator','EO Appraisal']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Simpan</span>
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex gap-5 justify-end card-footer">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator','penilai']))
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator','penilai','EO Appraisal']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="saveLpjSederhanadanStandard()" {{ $permohonan->status == 'proses-paparan' || $permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor']) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
<span id="saveButtonText">Simpan</span>
|
||||
|
||||
@@ -315,7 +315,7 @@
|
||||
{{-- @include('lpj::penilai.components.foto-lampiran') --}}
|
||||
|
||||
<div class="flex gap-5 justify-end card-footer">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator']))
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'surveyor', 'administrator','EO Appraisal']))
|
||||
<a class="btn btn-primary" onclick="saveMemo()"
|
||||
{{ $permohonan->status == 'proses-paparan' || ($permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor'])) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
|
||||
@@ -555,30 +555,8 @@
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td width="30%" style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }}</sup>
|
||||
</td>
|
||||
<td width="10%" style="padding: 3px; text-align: right;">
|
||||
{{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
||||
<td width="25%" style="padding: 3px; text-align:right">
|
||||
{{ formatRupiah($npw['nilai_1'] ?? 0, 0, false) ?? '' }}
|
||||
</td>
|
||||
<td width="5" style="padding: 3px; text-align: center;">
|
||||
=
|
||||
</td>
|
||||
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
||||
{{ formatRupiah($npw['nilai_2'] ?? 0, 0, false) ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $totalNilaiPasarWajar += str_replace(['Rp', '.'], '', $npw['nilai_2']); @endphp
|
||||
@endforeach
|
||||
@else
|
||||
{{-- Fallback untuk data tanpa npw_tambahan --}}
|
||||
{{-- Fallback untuk data tanpa npw_tambahan --}}
|
||||
@if(!$permohonan->is_mig)
|
||||
@if (isset($lpjData['luas_tanah']))
|
||||
<tr>
|
||||
<td width="30%" style="padding: 3px; text-align: right;">Tanah</td>
|
||||
@@ -602,6 +580,29 @@
|
||||
@php $totalNilaiPasarWajar += str_replace(['Rp', '.'], '', $lpjData['nilai_bangunan_2']); @endphp
|
||||
@endif
|
||||
@endif
|
||||
@if (isset($lpjData['npw_tambahan']))
|
||||
@foreach ($lpjData['npw_tambahan'] as $npw)
|
||||
<tr>
|
||||
<td width="30%" style="padding: 3px; text-align: right;">
|
||||
{{ $npw['name'] }}</sup>
|
||||
</td>
|
||||
<td width="10%" style="padding: 3px; text-align: right;">
|
||||
{{ $npw['luas'] }} m<sup>2</sup>
|
||||
</td>
|
||||
<td width="5%" style="padding: 3px; text-align: center;">X</td>
|
||||
<td width="25%" style="padding: 3px; text-align:right">
|
||||
{{ formatRupiah($npw['nilai_1'] ?? 0, 0, false) ?? '' }}
|
||||
</td>
|
||||
<td width="5" style="padding: 3px; text-align: center;">
|
||||
=
|
||||
</td>
|
||||
<td width="25%" style="padding: 3px; text-align: left; text-align: right;">
|
||||
{{ formatRupiah($npw['nilai_2'] ?? 0, 0, false) ?? '' }}
|
||||
</td>
|
||||
</tr>
|
||||
@php $totalNilaiPasarWajar += str_replace(['Rp', '.'], '', $npw['nilai_2']); @endphp
|
||||
@endforeach
|
||||
@endif
|
||||
<tr>
|
||||
<td style="padding: 3px; text-align: right; font-weight: bold; width:10%;" colspan="4">Total Nilai Pasar Wajar</td>
|
||||
<td style="padding: 3px; text-align: center; width:5%;font-weight: bold;" >=</td>
|
||||
@@ -643,36 +644,64 @@
|
||||
|
||||
@if (!empty($keterangan))
|
||||
@if (is_array($keterangan))
|
||||
@foreach ($keterangan as $item)
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>
|
||||
@php
|
||||
$items_ = explode('- ', $item);
|
||||
@endphp
|
||||
@foreach ($items_ as $item_)
|
||||
@if(!empty($item_))
|
||||
- {{ trim($item_) }}<br>
|
||||
@endif
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@endforeach
|
||||
<div style="margin: 0; padding: 0;">
|
||||
@foreach ($keterangan as $index => $item)
|
||||
@php
|
||||
$cleanItem = trim($item);
|
||||
$isNumbered = preg_match('/^\d+\./', $cleanItem);
|
||||
$isBullet = preg_match('/^[-•]/', $cleanItem);
|
||||
@endphp
|
||||
<div style="margin-bottom: 8px; line-height: 1.4;">
|
||||
@if ($isNumbered || $isBullet)
|
||||
{{ $cleanItem }}
|
||||
@else
|
||||
@if ($index > 0 && !empty($cleanItem))- @endif{{ $cleanItem }}
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@else
|
||||
<table style="width: 100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td>
|
||||
@php
|
||||
$items = explode('- ', $keterangan);
|
||||
@endphp
|
||||
@foreach ($items as $item)
|
||||
- {{ trim($item) }}<br>
|
||||
@endforeach
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
@php
|
||||
// Handle string format - normalize line endings first
|
||||
$keterangan = str_replace(["\r\n", "\r"], "\n", $keterangan);
|
||||
$items = [];
|
||||
|
||||
if (strpos($keterangan, '"') !== false) {
|
||||
// Handle quoted strings (array format)
|
||||
preg_match_all('/"([^"]*)"/', $keterangan, $matches);
|
||||
$items = $matches[1];
|
||||
} else {
|
||||
// Handle line-separated items
|
||||
$rawItems = explode("\n", $keterangan);
|
||||
foreach ($rawItems as $item) {
|
||||
$cleanItem = trim($item);
|
||||
// Skip empty items
|
||||
if (!empty($cleanItem)) {
|
||||
$items[] = $cleanItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
<div style="margin: 0; padding: 0;">
|
||||
@foreach ($items as $index => $item)
|
||||
@php
|
||||
$cleanItem = trim($item);
|
||||
if (!empty($cleanItem))
|
||||
@endphp
|
||||
<div style="margin-bottom: 8px; line-height: 1.4;">
|
||||
@if (preg_match('/^\d+\./', $cleanItem))
|
||||
{{ $cleanItem }}
|
||||
@elseif (preg_match('/^[-•]/', $cleanItem))
|
||||
{{ $cleanItem }}
|
||||
@else
|
||||
- {{ $cleanItem }}
|
||||
@endif
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div style="color: #666; font-style: italic;">Tidak ada catatan khusus</div>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
@include('lpj::surveyor.components.header')
|
||||
@include('lpj::surveyor.components.rap')
|
||||
<div class="flex gap-2 justify-end" style="margin-right: 20px; margin-top: 20px">
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'penilai', 'administrator']))
|
||||
@if (Auth::user()->hasAnyRole(['senior-officer', 'penilai', 'administrator','EO Appraisal']))
|
||||
<button type="button" class="btn btn-primary" id="saveButton" onclick="submitData()"
|
||||
{{ $permohonan->status == 'proses-paparan' || ($permohonan->status == 'proses-laporan' && Auth::user()->hasAnyRole(['surveyor'])) ? 'disabled' : '' }}>
|
||||
<i class="ki-filled ki-save-2"></i>
|
||||
@@ -111,7 +111,7 @@
|
||||
|
||||
if (status === 'sesuai') {
|
||||
addressInput.value = {!! json_encode($dokumen->address ?? '') !!};
|
||||
|
||||
|
||||
inputs.forEach(element => {
|
||||
if (element.tagName === 'INPUT') {
|
||||
element.setAttribute('readonly', true);
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
<span>
|
||||
@php
|
||||
$tgl = $permohonan_migrasi->mig_mst_jaminan_tgl_laporan ?? null;
|
||||
@endphp
|
||||
@endphp
|
||||
|
||||
{{ $tgl ? formatTanggalIndonesia(parseTimestamp($tgl)) : '' }}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user