fix: 캘린더 모달 중복 카드 문제 및 삭제 권한 개선

- monthly_worker_status 조회 시 GROUP BY로 중복 데이터 합산
- 작업보고서 삭제 권한을 그룹장 이상으로 제한 (admin, system, group_leader)
- 중복 데이터 정리를 위한 마이그레이션 SQL 추가 (009_fix_duplicate_monthly_status.sql)
- synology_deployment 버전에도 동일 수정 적용
This commit is contained in:
Hyungi Ahn
2025-12-02 13:08:44 +09:00
parent beaffcad49
commit a9bce9d20b
419 changed files with 275129 additions and 394 deletions

View File

@@ -25,7 +25,7 @@ function filterMenuByRole(doc, userRole) {
selectors.forEach(({ role, selector }) => {
// 사용자가 해당 역할을 가지고 있지 않으면 메뉴 항목을 제거
if (userRole !== role) {
if (userRole !== role && userRole !== 'system') { // system 권한도 admin 메뉴 접근 가능
doc.querySelectorAll(selector).forEach(el => el.remove());
}
});
@@ -56,11 +56,7 @@ function populateUserInfo(doc, user) {
const dropdownIdEl = doc.getElementById('dropdown-user-id');
if (dropdownIdEl) dropdownIdEl.textContent = `@${user.username}`;
// Admin 버튼 표시 여부 결정 (admin 권한만)
const adminBtn = doc.getElementById('adminBtn');
if (adminBtn && user.role === 'admin') {
adminBtn.style.display = 'flex';
}
// Admin 버튼 제거됨
// System 버튼 표시 여부 결정 (system 권한만)
const systemBtn = doc.getElementById('systemBtn');
@@ -96,13 +92,7 @@ function setupNavbarEvents() {
});
}
// Admin 버튼 클릭 이벤트
const adminButton = document.getElementById('adminBtn');
if (adminButton) {
adminButton.addEventListener('click', () => {
window.location.href = '/pages/dashboard/admin.html';
});
}
// Admin 버튼 제거됨
// System 버튼 클릭 이벤트
const systemButton = document.getElementById('systemBtn');
@@ -111,6 +101,14 @@ function setupNavbarEvents() {
window.location.href = '/pages/dashboard/system.html';
});
}
// Dashboard 버튼 클릭 이벤트
const dashboardButton = document.querySelector('.dashboard-btn');
if (dashboardButton) {
dashboardButton.addEventListener('click', () => {
window.location.href = '/pages/dashboard/group-leader.html';
});
}
// 외부 클릭 시 드롭다운 닫기
document.addEventListener('click', (e) => {