revisi progress 80%
This commit is contained in:
parent
a3fe338530
commit
15eb0f3904
@ -1776,7 +1776,7 @@ class DashboardController extends Controller
|
||||
return [
|
||||
'file_directory_id' => $item->file_directory_id,
|
||||
'pegawai_nama_entry' => $item->pegawai_nama_entry,
|
||||
'part' => $dataSlice[0] . '/' . $dataSlice[1],
|
||||
'part' => $dataSlice[0],
|
||||
'folder' => $dataSlice[2],
|
||||
'fileName' =>$dataSlice[3],
|
||||
'file' => $item->file,
|
||||
|
||||
@ -47,10 +47,19 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
let tanggalTerbit = item.tanggal_terbit ? formatTanggal(item.tanggal_terbit) : '-';
|
||||
const aksi = `
|
||||
<div class="d-flex gap-1">
|
||||
<button class="btn btn-sm btn-info" onclick="infoReject('${item.file_directory_id}', '${item.fileName || ''}')">
|
||||
<button href="#" class="btn btn-sm btn-primary" onclick="infoDok(this)"
|
||||
data-file="${item.file}"
|
||||
data-fileName="${item.nama_dokumen}"
|
||||
data-id="${item.file_directory_id}"
|
||||
data-no_dokumen="${item.no_dokumen || '-'}"
|
||||
data-tanggal_terbit="${item.tanggal_terbit || '-'}"
|
||||
data-permission_file="${item.permission_file || '-'}">
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-info" onclick="infoReject('${item.file_directory_id}')">
|
||||
<i class="fa-solid fa-circle-info"></i>
|
||||
</button>
|
||||
<button class="btn btn-sm btn-primary" onclick="editFileReject('${item.file_directory_id}', '${item.fileName || ''}')">
|
||||
<button class="btn btn-sm btn-primary" onclick="editFileReject('${item.file_directory_id}')">
|
||||
<i class="fa-solid fa-pen-to-square"></i>
|
||||
</button>
|
||||
|
||||
@ -206,7 +215,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
}
|
||||
|
||||
window.infoReject = function(id, fileName){
|
||||
window.infoReject = function(id){
|
||||
const item = getItemById(id);
|
||||
const revision = item?.revision ? String(item.revision) : 'Tidak ada catatan revisi.';
|
||||
Swal.fire({
|
||||
@ -216,6 +225,39 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
confirmButtonText: 'Tutup'
|
||||
});
|
||||
}
|
||||
window.infoDok = function(e){
|
||||
let fileUrl = $(e).data('file');
|
||||
let noDokumen = $(e).data('no_dokumen')
|
||||
let tanggalTerbit = $(e).data('tanggal_terbit')
|
||||
let permissionFile = $(e).data('permission_file')
|
||||
let fileName = $(e).data('fileName')
|
||||
currentFile = fileUrl;
|
||||
idDirectory = $(e).data('id');
|
||||
|
||||
|
||||
const titleEl = document.getElementById('confirm_preview_file');
|
||||
if (titleEl) titleEl.textContent = fileName;
|
||||
|
||||
|
||||
const noEl = document.getElementById('confirm-upload-dokumen');
|
||||
if (noEl) noEl.textContent = noDokumen;
|
||||
|
||||
const tglEl = document.getElementById('confirm-time-dokumen');
|
||||
if (tglEl) tglEl.textContent = tanggalTerbit;
|
||||
|
||||
const permEl = document.getElementById('confirm-permission');
|
||||
if (permEl) {
|
||||
const publicDoc = isPublic(permissionFile);
|
||||
permEl.textContent = publicDoc ? 'Umum' : 'Internal Unit';
|
||||
permEl.className = 'badge ' + (publicDoc ? 'bg-success' : 'bg-secondary');
|
||||
}
|
||||
let previewBox = document.getElementById('file-preview');
|
||||
previewBox.innerHTML = `<div id="pdfWrap" style="height:500px; overflow:auto; background:#f7f7f7; padding:8px;">
|
||||
<div id="pdfPages"></div>`;
|
||||
openPreview(idDirectory);
|
||||
$("#previewModal").modal('show')
|
||||
|
||||
}
|
||||
|
||||
function initEditSelects(){
|
||||
if (editUnitSelect.length) {
|
||||
@ -285,7 +327,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
});
|
||||
}
|
||||
|
||||
window.editFileReject = function(id, fileName){
|
||||
window.editFileReject = function(id){
|
||||
const item = getItemById(id);
|
||||
if (!item) {
|
||||
Swal.fire({ icon: 'error', title: 'Gagal', text: 'Data tidak ditemukan.' });
|
||||
@ -319,7 +361,8 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
expiredFieldEl.classList.toggle('d-none', !hasExpired);
|
||||
}
|
||||
if (currentFileEl) {
|
||||
currentFileEl.textContent = fileName ? `File saat ini: ${fileName}` : '';
|
||||
const displayName = item.fileName || (item.file ? String(item.file).split('/').pop() : '');
|
||||
currentFileEl.textContent = displayName ? `File saat ini: ${displayName}` : '';
|
||||
}
|
||||
|
||||
const parts = (item.file || '').split('/');
|
||||
|
||||
@ -45,16 +45,16 @@
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane fade show active">
|
||||
<div class="d-flex justify-content-between align-items-start mb-3">
|
||||
<h4 class="mb-0">Data Umum</h4>
|
||||
<h4 class="mb-0">Dokumen Umum</h4>
|
||||
<div class="d-flex align-items-start gap-3">
|
||||
<!-- DOWNLOAD + COUNT -->
|
||||
<a
|
||||
{{-- <a
|
||||
href="/download-excel/data-umum"
|
||||
class="btn btn-success btn-sm"
|
||||
>
|
||||
<i class="ti ti-download me-1"></i>
|
||||
Download Excel
|
||||
</a>
|
||||
</a> --}}
|
||||
<div class="d-flex flex-column align-items-start">
|
||||
<button
|
||||
type="button"
|
||||
@ -74,7 +74,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<!-- TAMBAH FILE -->
|
||||
<button
|
||||
{{-- <button
|
||||
type="button"
|
||||
class="btn btn-success btn-sm"
|
||||
data-bs-toggle="modal"
|
||||
@ -82,7 +82,7 @@
|
||||
>
|
||||
<i class="ti ti-plus me-1"></i>
|
||||
Tambah File
|
||||
</button>
|
||||
</button> --}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex flex-column flex-md-row align-items-md-center gap-2 mb-3">
|
||||
@ -113,11 +113,12 @@
|
||||
<th class="text-center" style="width: 36px;">
|
||||
<input type="checkbox" id="checkAllRows" class="form-check-input">
|
||||
</th>
|
||||
<th>Aksi</th>
|
||||
<th>No Dokumen</th>
|
||||
<th>Nama Dokumen</th>
|
||||
<th>Kategori</th>
|
||||
<th>Unit</th>
|
||||
<th>Tanggal Upload</th>
|
||||
<th>Tanggal Unggah</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableDataUmum">
|
||||
@ -299,23 +300,49 @@
|
||||
: (expiryStatus === 'soon' ? `<span class="badge bg-warning text-dark" style="font-size:10px;">Akan Expired</span>` : '');
|
||||
return `
|
||||
<tr class="${rowClass}">
|
||||
|
||||
<td class="text-center">
|
||||
<input type="checkbox"
|
||||
class="form-check-input row-check"
|
||||
data-id="${item.file_directory_id}"
|
||||
${checked}>
|
||||
</td>
|
||||
<td class="text-nowrap">
|
||||
<div class="d-inline-flex gap-1">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
onclick="infoDok(this)"
|
||||
title="Detail Dokumen"
|
||||
data-filename="${item.nama_dokumen || '-'}"
|
||||
data-id="${item.file_directory_id}"
|
||||
data-no_dokumen="${item.no_dokumen || '-'}"
|
||||
data-tanggal_terbit="${item.tanggal_terbit || '-'}"
|
||||
data-permission_file="${item.permission_file || '-'}"
|
||||
data-pegawai_id_entry="${item.pegawai_id_entry || '-'}"
|
||||
>
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
|
||||
<a
|
||||
href="/file-download/${item.file_directory_id}"
|
||||
target="_blank"
|
||||
class="btn btn-primary btn-sm"
|
||||
title="Download Dokumen"
|
||||
>
|
||||
<i class="fa-solid fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="text-nowrap">${item.no_dokumen || '-'}</td>
|
||||
<td class="file-cell">
|
||||
<div style="display:flex; flex-direction:column; gap:4px;">
|
||||
|
||||
<!-- BARIS ATAS -->
|
||||
<div style="display:flex; align-items:center; gap:6px;">
|
||||
|
||||
<i class="ti ti-file-text" style="font-size:18px; color:#4f46e5;"></i>
|
||||
|
||||
<a href="#"
|
||||
class="file-link ${statusLabel === "Pending" ? 'file-pending' : ''}"
|
||||
class="file-link"
|
||||
data-file="${item.file}"
|
||||
data-fileName="${item.nama_dokumen || '-'}"
|
||||
data-id="${item.file_directory_id}"
|
||||
@ -1057,5 +1084,53 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function infoDok(e){
|
||||
let fileUrl = $(e).data('file');
|
||||
let noDokumen = $(e).data('no_dokumen')
|
||||
let tanggalTerbit = $(e).data('tanggal_terbit')
|
||||
let permissionFile = $(e).data('permission_file')
|
||||
let fileName = $(e).data('fileName')
|
||||
let pegawai_id_entry = $(e).data('pegawai_id_entry')
|
||||
|
||||
currentFile = fileUrl;
|
||||
idDirectory = $(e).data('id');
|
||||
|
||||
|
||||
const titleEl = document.getElementById('confirm_preview_file');
|
||||
if (titleEl) titleEl.textContent = fileName;
|
||||
|
||||
// set footer info
|
||||
const noEl = document.getElementById('confirm-upload-dokumen');
|
||||
if (noEl) noEl.textContent = noDokumen;
|
||||
|
||||
const tglEl = document.getElementById('confirm-time-dokumen');
|
||||
if (tglEl) tglEl.textContent = tanggalTerbit;
|
||||
|
||||
const permEl = document.getElementById('confirm-permission');
|
||||
if (permEl) {
|
||||
const publicDoc = isPublic(permissionFile);
|
||||
permEl.textContent = publicDoc ? 'Umum' : 'Internal Unit';
|
||||
permEl.className = 'badge ' + (publicDoc ? 'bg-success' : 'bg-secondary');
|
||||
}
|
||||
const downloadBtn = document.getElementById('btn-download');
|
||||
if (downloadBtn) {
|
||||
downloadBtn.setAttribute('href', `/file-download/${idDirectory}`);
|
||||
}
|
||||
let previewBox = document.getElementById('file-preview');
|
||||
previewBox.innerHTML = `<div id="pdfWrap" style="height:500px; overflow:auto; background:#f7f7f7; padding:8px;">
|
||||
<div id="pdfPages"></div>
|
||||
</div>
|
||||
`;
|
||||
openPreview(idDirectory);
|
||||
const deleteWrapper = document.getElementById('deleteData');
|
||||
|
||||
if (Number(pegawai_id_entry) === Number(authPegawai)) {
|
||||
deleteWrapper.classList.remove('d-none');
|
||||
} else {
|
||||
deleteWrapper.classList.add('d-none');
|
||||
}
|
||||
$("#previewModal").modal('show')
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@ -42,7 +42,7 @@
|
||||
<div class="card">
|
||||
<div class="card-body p-3">
|
||||
<div class="d-flex justify-content-between align-items-start mb-3">
|
||||
<h4 class="mb-0">Data Unit</h4>
|
||||
<h4 class="mb-0">Dokumen Unit</h4>
|
||||
<div class="d-flex align-items-start gap-3">
|
||||
<!-- DOWNLOAD + COUNT -->
|
||||
<a
|
||||
@ -108,11 +108,12 @@
|
||||
<th class="text-center" style="width: 36px;">
|
||||
<input type="checkbox" id="checkAllRows" class="form-check-input">
|
||||
</th>
|
||||
<th>Aksi</th>
|
||||
<th>No Dokumen</th>
|
||||
<th>Nama Dokumen</th>
|
||||
<th>Kategori</th>
|
||||
<th>Unit</th>
|
||||
<th>Tanggal Upload</th>
|
||||
<th>Tanggal Unggah</th>
|
||||
<th>Pengunggah</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -214,7 +215,7 @@
|
||||
selectionCssClass: 'select2-filter-selection',
|
||||
dropdownCssClass: 'select2-filter-dropdown',
|
||||
ajax: {
|
||||
url: '/select-unit-kerja-option',
|
||||
url: '/select-unit-kerja-mapping',
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
@ -310,12 +311,38 @@
|
||||
data-id="${item.file_directory_id}"
|
||||
${checked}>
|
||||
</td>
|
||||
<td class="text-nowrap">
|
||||
<div class="d-inline-flex gap-1">
|
||||
<button
|
||||
type="button"
|
||||
class="btn btn-primary btn-sm"
|
||||
onclick="infoDok(this)"
|
||||
title="Detail Dokumen"
|
||||
data-filename="${item.nama_dokumen || '-'}"
|
||||
data-id="${item.file_directory_id}"
|
||||
data-no_dokumen="${item.no_dokumen || '-'}"
|
||||
data-tanggal_terbit="${item.tanggal_terbit || '-'}"
|
||||
data-permission_file="${item.permission_file || '-'}"
|
||||
data-pegawai_id_entry="${item.pegawai_id_entry || '-'}"
|
||||
>
|
||||
<i class="fa-solid fa-file-pdf"></i>
|
||||
</button>
|
||||
|
||||
<a
|
||||
href="/file-download/${item.file_directory_id}"
|
||||
target="_blank"
|
||||
class="btn btn-primary btn-sm"
|
||||
title="Download Dokumen"
|
||||
>
|
||||
<i class="fa-solid fa-download"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
<td class="text-nowrap">${item.no_dokumen || '-'}</td>
|
||||
<td class="file-cell">
|
||||
<div class="file-title">
|
||||
<i class="ti ti-file-text"></i>
|
||||
<a href="#"
|
||||
class="file-link ${statusLabel === "Pending" ? 'file-pending' : ''}"
|
||||
class="file-link"
|
||||
data-file="${item.file}"
|
||||
data-fileName="${item.nama_dokumen || '-'}"
|
||||
data-id="${item.file_directory_id}"
|
||||
@ -761,7 +788,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-5 d-none" id="expiredField_${colCount}">
|
||||
<div class="col-md-5" id="expiredField_${colCount}">
|
||||
<label class="form-label fw-semibold">Tanggal Expired</label>
|
||||
<input class="form-control"
|
||||
type="date"
|
||||
@ -1057,5 +1084,53 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function infoDok(e){
|
||||
let fileUrl = $(e).data('file');
|
||||
let noDokumen = $(e).data('no_dokumen')
|
||||
let tanggalTerbit = $(e).data('tanggal_terbit')
|
||||
let permissionFile = $(e).data('permission_file')
|
||||
let fileName = $(e).data('fileName')
|
||||
let pegawai_id_entry = $(e).data('pegawai_id_entry')
|
||||
|
||||
currentFile = fileUrl;
|
||||
idDirectory = $(e).data('id');
|
||||
|
||||
|
||||
const titleEl = document.getElementById('confirm_preview_file');
|
||||
if (titleEl) titleEl.textContent = fileName;
|
||||
|
||||
// set footer info
|
||||
const noEl = document.getElementById('confirm-upload-dokumen');
|
||||
if (noEl) noEl.textContent = noDokumen;
|
||||
|
||||
const tglEl = document.getElementById('confirm-time-dokumen');
|
||||
if (tglEl) tglEl.textContent = tanggalTerbit;
|
||||
|
||||
const permEl = document.getElementById('confirm-permission');
|
||||
if (permEl) {
|
||||
const publicDoc = isPublic(permissionFile);
|
||||
permEl.textContent = publicDoc ? 'Umum' : 'Internal Unit';
|
||||
permEl.className = 'badge ' + (publicDoc ? 'bg-success' : 'bg-secondary');
|
||||
}
|
||||
const downloadBtn = document.getElementById('btn-download');
|
||||
if (downloadBtn) {
|
||||
downloadBtn.setAttribute('href', `/file-download/${idDirectory}`);
|
||||
}
|
||||
let previewBox = document.getElementById('file-preview');
|
||||
previewBox.innerHTML = `<div id="pdfWrap" style="height:500px; overflow:auto; background:#f7f7f7; padding:8px;">
|
||||
<div id="pdfPages"></div>
|
||||
</div>
|
||||
`;
|
||||
openPreview(idDirectory);
|
||||
const deleteWrapper = document.getElementById('deleteData');
|
||||
|
||||
if (Number(pegawai_id_entry) === Number(authPegawai)) {
|
||||
deleteWrapper.classList.remove('d-none');
|
||||
} else {
|
||||
deleteWrapper.classList.add('d-none');
|
||||
}
|
||||
$("#previewModal").modal('show')
|
||||
}
|
||||
</script>
|
||||
@endsection
|
||||
|
||||
@ -63,7 +63,7 @@
|
||||
<label class="form-check-label" for="hasExpired0">Ada Expired?</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 d-none" id="expiredField_0">
|
||||
<div class="col-md-5" id="expiredField_0">
|
||||
<label class="form-label fw-semibold">Tanggal Expired</label>
|
||||
<input class="form-control" type="date" name="data[0][tgl_expired]">
|
||||
|
||||
|
||||
@ -25,7 +25,7 @@
|
||||
.modal-content,
|
||||
.modal-body,
|
||||
.message-body {
|
||||
color-scheme: black;
|
||||
color-scheme: light;
|
||||
scrollbar-color: auto;
|
||||
scrollbar-width: auto;
|
||||
}
|
||||
|
||||
@ -31,14 +31,14 @@
|
||||
<li class="sidebar-item">
|
||||
<a class="sidebar-link" href="{{ url('/') }}" aria-expanded="false">
|
||||
<i class="ti ti-dashboard"></i>
|
||||
<span class="hide-menu">Data Unit</span>
|
||||
<span class="hide-menu">Dokumen Unit</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="sidebar-item">
|
||||
<a class="sidebar-link" href="{{ url('/data-umum') }}" aria-expanded="false">
|
||||
<i class="ti ti-layout-dashboard"></i>
|
||||
<span class="hide-menu">Data Umum</span>
|
||||
<span class="hide-menu">Dokumen Umum</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
|
||||
@ -48,10 +48,9 @@
|
||||
<th>File</th>
|
||||
<th>Kategori</th>
|
||||
<th>Unit</th>
|
||||
<th>Sub Unit</th>
|
||||
<th>Pengunggah</th>
|
||||
<th class="text-center">Jumlah Pegawai Melihat</th>
|
||||
<th class="text-center">Jumlah Pegawai Mengunduh</th>
|
||||
<th class="text-center">Jumlah User Melihat</th>
|
||||
<th class="text-center">Jumlah User Mengunduh</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tableLogAktivityDocument">
|
||||
@ -106,7 +105,6 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
<td>${item.nama_dokumen || '-'}</td>
|
||||
<td>${item.kategori || '-'}</td>
|
||||
<td>${item.unit || '-'}</td>
|
||||
<td>${item.sub_unit || '-'}</td>
|
||||
<td>${item.pengunggah || '-'}</td>
|
||||
<td class="text-center fw-semibold">${totalViews}</td>
|
||||
<td class="text-center fw-semibold">${item.total_download}</td>
|
||||
|
||||
@ -50,7 +50,7 @@
|
||||
<th>Akses</th>
|
||||
<th>Nama</th>
|
||||
<th>Kategori</th>
|
||||
<th>Unit/Sub Unit</th>
|
||||
<th>Unit</th>
|
||||
<th>Tanggal Terbit</th>
|
||||
<th>Tanggal Expired</th>
|
||||
<th>Tanggal Upload</th>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user