Skip to content

Commit 424f492

Browse files
Merge pull request #7057 from christianbeeznest/GH-7050
Attendance: Add tablet/fullscreen view and routing; wire icon action; single-date save flow - refs #7050
2 parents 18d9ed2 + eeff6ac commit 424f492

File tree

5 files changed

+569
-2
lines changed

5 files changed

+569
-2
lines changed

assets/vue/router/attendance.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,11 @@ export default {
4444
path: ":id?/export/pdf",
4545
component: () => import("../views/attendance/AttendanceExport.vue"),
4646
},
47+
{
48+
name: "AttendanceSheetTablet",
49+
path: ":id/sheet/:calendarId/tablet",
50+
component: () => import("../views/attendance/AttendanceSheetTablet.vue"),
51+
meta: { breadcrumb: "Tablet view" },
52+
},
4753
],
4854
}

assets/vue/services/attendanceService.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,4 +269,11 @@ export default {
269269
throw error
270270
}
271271
},
272+
273+
getDateSheet: async (attendanceId, calendarId, { cid, sid, gid }) => {
274+
const res = await axios.get(`/attendance/${attendanceId}/date/${calendarId}/sheet`, {
275+
params: { cid, sid, gid },
276+
})
277+
return res.data
278+
},
272279
}

assets/vue/views/attendance/AttendanceSheetList.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ const initializeColumnLocks = (dates) => {
784784
filteredAttendanceSheets.value.forEach((user) => {
785785
const key = `${user.id}-${date.id}`
786786
if (attendanceData.value[key] === undefined) {
787-
attendanceData.value[key] = 1
787+
attendanceData.value[key] = null
788788
}
789789
})
790790
})
@@ -974,7 +974,25 @@ const closeSignatureDialog = () => {
974974
}
975975
976976
const viewForTablet = (dateId) => {
977-
console.log(`View for tablet clicked for date ID: ${dateId}`)
977+
if (!router.hasRoute("AttendanceSheetTablet")) {
978+
console.error("[Attendance] Missing route: AttendanceSheetTablet")
979+
alert("Tablet route is not registered. Check router config.")
980+
return
981+
}
982+
983+
const isLockedForDate = isColumnLocked(dateId)
984+
985+
router.push({
986+
name: "AttendanceSheetTablet",
987+
params: { node: route.params.node, id: route.params.id, calendarId: dateId },
988+
query: {
989+
cid,
990+
sid,
991+
gid,
992+
readonly: route.query.readonly ?? "0",
993+
locked: isLockedForDate ? "1" : "0",
994+
},
995+
})
978996
}
979997
980998
const exportToPdf = async () => {

0 commit comments

Comments
 (0)