piccoli fix

This commit is contained in:
2026-04-20 20:37:37 +02:00
parent 104ad53a9a
commit 5d30434dd5
13 changed files with 727 additions and 838 deletions

View File

@@ -26,7 +26,6 @@ document.addEventListener('DOMContentLoaded', async () => {
await loadOffices();
await loadTeamData();
await loadTeamData();
// Initialize Modal Logic
ModalLogic.init({
@@ -79,7 +78,10 @@ async function loadOffices() {
if (currentUser.role !== 'admin') {
select.style.display = 'none';
// Employees stop here, Managers continue to allow auto-selection logic below
if (currentUser.role === 'employee') return;
if (currentUser.role === 'employee') {
updateOfficeDisplay();
return;
}
}
// Cache offices list
@@ -312,7 +314,9 @@ function renderCalendar() {
// Build header row
const dayNames = ['Dom', 'Lun', 'Mar', 'Mer', 'Gio', 'Ven', 'Sab'];
let headerHtml = '<th>Nome</th><th>Gruppo</th>';
const showGroup = currentUser.role === 'admin';
let headerHtml = '<th>Nome</th>';
if (showGroup) headerHtml += '<th>Gruppo</th>';
for (let i = 0; i < dayCount; i++) {
const date = new Date(startDate);
@@ -342,7 +346,7 @@ function renderCalendar() {
// Build body rows
if (teamData.length === 0) {
body.innerHTML = `<tr><td colspan="${dayCount + 2}" class="text-center">Nessun membro del team trovato</td></tr>`;
body.innerHTML = `<tr><td colspan="${dayCount + (showGroup ? 2 : 1)}" class="text-center">Nessun membro del team trovato</td></tr>`;
return;
}
@@ -361,8 +365,11 @@ function renderCalendar() {
}
bodyHtml += `<tr>
<td class="member-name" style="text-align: left; padding-left: 1rem;">${nameHtml}</td>
<td class="member-manager">${member.office_name || '-'}</td>`;
<td class="member-name" style="text-align: left; padding-left: 1rem;">${nameHtml}</td>`;
if (showGroup) {
bodyHtml += `<td class="member-manager">${member.office_name || '-'}</td>`;
}
for (let i = 0; i < dayCount; i++) {
const date = new Date(startDate);