chore(tutorial): show additional columns for #90
columns are distinguished by user and the entities given in parenthesis: - driving permit (tutorial) - eye exam (tutrial) - tutorial note (tutorial) - attendance (tutorial & day) - attendance-note (tutorial & day) - parking permit (day)
This commit is contained in:
parent
06fa34c938
commit
36a0bd9edc
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022 Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
# SPDX-FileCopyrightText: 2022-24 Winnie Ros <winnie.ros@campus.lmu.de>, Steffen Jost <s.jost@fraport.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -50,4 +50,9 @@ TutorialUserGrantQualification: Qualifikation vergeben
|
||||
TutorialUserRenewQualification: Qualifikation regulär verlängern
|
||||
TutorialUserRenewedQualification n@Int: Qualifikation für #{tshow n} Kurs-#{pluralDE n "Teilnehmer:in" "Teilnehmer:innen"} regulär verlängert
|
||||
TutorialUserGrantedQualification n@Int: Qualifikation erfolgreich an #{tshow n} Kurs-#{pluralDE n "Teilnehmer:in" "Teilnehmer:innen"} vergeben
|
||||
CommTutorial: Kursmitteilung
|
||||
CommTutorial: Kursmitteilung
|
||||
TutorialDrivingPermit: Führerschein
|
||||
TutorialEyeExam: Sehtest
|
||||
TutorialNote: Kursnotiz
|
||||
TutorialDayAttendance day@Text: Anwesenheit am #{day}
|
||||
TutorialDayNote day@Text: Anwesenheitsnotiz für #{day}
|
||||
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022 Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
# SPDX-FileCopyrightText: 2022-24 Winnie Ros <winnie.ros@campus.lmu.de>, Steffen Jost <s.jost@fraport.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -52,3 +52,8 @@ TutorialUserRenewQualification: Renew qualification
|
||||
TutorialUserRenewedQualification n@Int: Successfully renewed qualification #{tshow n} course #{pluralEN n "user" "users"}
|
||||
TutorialUserGrantedQualification n: Successfully granted qualification #{tshow n} course #{pluralEN n "user" "users"}
|
||||
CommTutorial: Course message
|
||||
TutorialDrivingPermit: Driving permit
|
||||
TutorialEyeExam: Eye exam
|
||||
TutorialNote: Course note
|
||||
TutorialDayAttendance day: Attendance #{day}
|
||||
TutorialDayNote day: Attendance note #{day}
|
||||
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
# SPDX-FileCopyrightText: 2022-24 Gregor Kleen <gregor.kleen@ifi.lmu.de>,Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>, Steffen Jost <s.jost@fraport.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -117,4 +117,5 @@ TableFilterCommaPlusShort: Unterstützt mehrere Kriterien mit Komma-Plus, siehe
|
||||
TableFilterCommaName: Mehrere Namen mit Komma trennen.
|
||||
TableFilterCommaNameNr: Mehrere Namen oder Nummern mit Komma trennen. Nummern werden nur exakt gesucht.
|
||||
TableUserEdit: Benutzer bearbeiten
|
||||
TableRows: Zeilen
|
||||
TableRows: Zeilen
|
||||
TableUserParkingToken: Parkmarke
|
||||
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022 Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>
|
||||
# SPDX-FileCopyrightText: 2022-24 Sarah Vaupel <sarah.vaupel@ifi.lmu.de>,Steffen Jost <jost@tcs.ifi.lmu.de>,Winnie Ros <winnie.ros@campus.lmu.de>, Steffen Jost <s.jost@fraport.de>
|
||||
#
|
||||
# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
|
||||
@ -117,4 +117,5 @@ TableFilterCommaPlusShort: Support multiple criteria with comma/plus, see above.
|
||||
TableFilterCommaName: Separate names by comma.
|
||||
TableFilterCommaNameNr: Separate names and numbers by comma. Numbers have to match exact.
|
||||
TableUserEdit: Edit user
|
||||
TableRows: Rows
|
||||
TableRows: Rows
|
||||
TableUserParkingToken: Parking token
|
||||
@ -138,6 +138,8 @@ type DailyTableExpr =
|
||||
`E.InnerJoin` E.SqlExpr (Entity TutorialParticipant)
|
||||
`E.InnerJoin` E.SqlExpr (Entity User)
|
||||
`E.LeftOuterJoin` E.SqlExpr (Maybe (Entity UserAvs))
|
||||
`E.LeftOuterJoin` E.SqlExpr (Maybe (Entity UserDay))
|
||||
`E.LeftOuterJoin` E.SqlExpr (Maybe (Entity TutorialParticipantDay))
|
||||
)
|
||||
|
||||
type DailyTableOutput = E.SqlQuery
|
||||
@ -146,6 +148,8 @@ type DailyTableOutput = E.SqlQuery
|
||||
, E.SqlExpr (Entity TutorialParticipant)
|
||||
, E.SqlExpr (Entity User)
|
||||
, E.SqlExpr (Maybe (Entity UserAvs))
|
||||
, E.SqlExpr (Maybe (Entity UserDay))
|
||||
, E.SqlExpr (Maybe (Entity TutorialParticipantDay))
|
||||
, E.SqlExpr (E.Value (Maybe CompanyId))
|
||||
, E.SqlExpr (E.Value (Maybe [QualificationId]))
|
||||
)
|
||||
@ -155,6 +159,8 @@ type DailyTableData = DBRow
|
||||
, Entity TutorialParticipant
|
||||
, Entity User
|
||||
, Maybe (Entity UserAvs)
|
||||
, Maybe (Entity UserDay)
|
||||
, Maybe (Entity TutorialParticipantDay)
|
||||
, E.Value (Maybe CompanyId)
|
||||
, E.Value (Maybe [QualificationId])
|
||||
)
|
||||
@ -179,6 +185,12 @@ queryUser = $(sqlMIXproj' ''DailyTableExpr 4)
|
||||
queryUserAvs :: DailyTableExpr -> E.SqlExpr (Maybe (Entity UserAvs))
|
||||
queryUserAvs = $(sqlMIXproj' ''DailyTableExpr 5)
|
||||
|
||||
queryUserDay :: DailyTableExpr -> E.SqlExpr (Maybe (Entity UserDay))
|
||||
queryUserDay = $(sqlMIXproj' ''DailyTableExpr 6)
|
||||
|
||||
queryParticipantDay :: DailyTableExpr -> E.SqlExpr (Maybe (Entity TutorialParticipantDay))
|
||||
queryParticipantDay = $(sqlMIXproj' ''DailyTableExpr 7)
|
||||
|
||||
resultCourse :: Lens' DailyTableData (Entity Course)
|
||||
resultCourse = _dbrOutput . _1
|
||||
|
||||
@ -194,11 +206,17 @@ resultUser = _dbrOutput . _4
|
||||
resultUserAvs :: Traversal' DailyTableData UserAvs
|
||||
resultUserAvs = _dbrOutput . _5 . _Just . _entityVal
|
||||
|
||||
resultUserDay :: Traversal' DailyTableData UserDay
|
||||
resultUserDay = _dbrOutput . _6 . _Just . _entityVal
|
||||
|
||||
resultParticipantDay :: Traversal' DailyTableData TutorialParticipantDay
|
||||
resultParticipantDay = _dbrOutput . _7 . _Just . _entityVal
|
||||
|
||||
resultCompanyId :: Traversal' DailyTableData CompanyId
|
||||
resultCompanyId = _dbrOutput . _6 . _unValue . _Just
|
||||
resultCompanyId = _dbrOutput . _8 . _unValue . _Just
|
||||
|
||||
resultCourseQualis :: Traversal' DailyTableData [QualificationId]
|
||||
resultCourseQualis = _dbrOutput . _7 . _unValue . _Just
|
||||
resultCourseQualis = _dbrOutput . _9 . _unValue . _Just
|
||||
|
||||
|
||||
instance HasEntity DailyTableData User where
|
||||
@ -213,21 +231,27 @@ instance HasUser DailyTableData where
|
||||
mkDailyTable :: Bool -> SchoolId -> Day -> DB (FormResult (DailyTableActionData, Set TutorialId), Widget)
|
||||
mkDailyTable isAdmin ssh nd = do
|
||||
tutLessons <- getDayTutorials' ssh (nd,nd)
|
||||
dday <- formatTime SelFormatDate nd
|
||||
let
|
||||
tutIds = Map.keys tutLessons
|
||||
dbtSQLQuery :: DailyTableExpr -> DailyTableOutput
|
||||
dbtSQLQuery (crs `E.InnerJoin` tut `E.InnerJoin` tpu `E.InnerJoin` usr `E.LeftOuterJoin` avs) = do
|
||||
EL.on $ tut E.^. TutorialCourse E.==. crs E.^. CourseId
|
||||
EL.on $ tut E.^. TutorialId E.==. tpu E.^. TutorialParticipantTutorial
|
||||
EL.on $ usr E.^. UserId E.==. tpu E.^. TutorialParticipantUser
|
||||
dbtSQLQuery (crs `E.InnerJoin` tut `E.InnerJoin` tpu `E.InnerJoin` usr `E.LeftOuterJoin` avs `E.LeftOuterJoin` udy `E.LeftOuterJoin` tdy) = do
|
||||
EL.on $ tut E.^. TutorialId E.=?. tdy E.?. TutorialParticipantDayTutorial
|
||||
E.&&. usr E.^. UserId E.=?. tdy E.?. TutorialParticipantDayUser
|
||||
E.&&. E.val nd E.=?. tdy E.?. TutorialParticipantDayDay
|
||||
EL.on $ usr E.^. UserId E.=?. udy E.?. UserDayUser
|
||||
E.&&. E.val nd E.=?. udy E.?. UserDayDay
|
||||
EL.on $ usr E.^. UserId E.=?. avs E.?. UserAvsUser
|
||||
EL.on $ usr E.^. UserId E.==. tpu E.^. TutorialParticipantUser
|
||||
EL.on $ tut E.^. TutorialId E.==. tpu E.^. TutorialParticipantTutorial
|
||||
EL.on $ tut E.^. TutorialCourse E.==. crs E.^. CourseId
|
||||
E.where_ $ tut E.^. TutorialId `E.in_` E.valList tutIds
|
||||
let associatedQualifications = E.subSelectMaybe . EL.from $ \cq -> do
|
||||
E.where_ $ cq E.^. CourseQualificationCourse E.==. crs E.^. CourseId
|
||||
let cqQual = cq E.^. CourseQualificationQualification
|
||||
cqOrder = [E.asc $ cq E.^. CourseQualificationSortOrder, E.asc cqQual]
|
||||
return $ E.arrayAggWith E.AggModeAll cqQual cqOrder
|
||||
return (crs, tut, tpu, usr, avs, selectCompanyUserPrime usr, associatedQualifications)
|
||||
return (crs, tut, tpu, usr, avs, udy, tdy, selectCompanyUserPrime usr, associatedQualifications)
|
||||
dbtRowKey = queryTutorial >>> (E.^. TutorialId)
|
||||
dbtProj = dbtProjId
|
||||
dbtColonnade = mconcat
|
||||
@ -249,6 +273,12 @@ mkDailyTable isAdmin ssh nd = do
|
||||
, colUserNameModalHdr MsgCourseParticipant ForProfileDataR
|
||||
, colUserMatriclenr isAdmin
|
||||
, sortable (Just "card-no") (i18nCell MsgAvsCardNo) $ \(preview $ resultUserAvs . _userAvsLastCardNo . _Just -> cn :: Maybe AvsFullCardNo) -> cellMaybe (textCell . tshowAvsFullCardNo) cn
|
||||
, sortable (Just "permit") (i18nCell MsgTutorialDrivingPermit) $ \(view $ resultParticipant . _entityVal . _tutorialParticipantDrivingPermit -> x) -> maybeCell x $ textCell . tshow
|
||||
, sortable (Just "eye-exam") (i18nCell MsgTutorialEyeExam) $ \(view $ resultParticipant . _entityVal . _tutorialParticipantEyeExam -> x) -> maybeCell x $ textCell . tshow
|
||||
, sortable (Just "note-tutorial") (i18nCell MsgTutorialNote) $ \(view $ resultParticipant . _entityVal . _tutorialParticipantNote -> x) -> maybeCell x textCell
|
||||
, sortable (Just "attendance") (i18nCell $ MsgTutorialDayAttendance dday) $ \(preview $ resultParticipantDay . _tutorialParticipantDayAttendance -> x) -> maybeCell x tickmarkCell
|
||||
, sortable (Just "note-attend") (i18nCell $ MsgTutorialDayNote dday) $ \(preview $ resultParticipantDay . _tutorialParticipantDayNote . _Just -> x) -> maybeCell x textCell
|
||||
, sortable (Just "parking") (i18nCell MsgTableUserParkingToken) $ \(preview $ resultUserDay . _userDayParkingToken -> x) -> maybeCell x tickmarkCell
|
||||
]
|
||||
dbtSorting = Map.fromList
|
||||
[ sortUserNameLink queryUser
|
||||
@ -258,6 +288,12 @@ mkDailyTable isAdmin ssh nd = do
|
||||
, ("user-company" , SortColumn $ queryUser >>> selectCompanyUserPrime)
|
||||
, ("booking-company", SortColumn $ queryParticipant >>> (E.^. TutorialParticipantCompany))
|
||||
, ("card-no" , SortColumn $ queryUserAvs >>> (E.?. UserAvsLastCardNo))
|
||||
, ("permit" , SortColumnNullsInv $ queryParticipant >>> (E.^. TutorialParticipantDrivingPermit))
|
||||
, ("eye-exam" , SortColumnNullsInv $ queryParticipant >>> (E.^. TutorialParticipantEyeExam))
|
||||
, ("note-tutorial" , SortColumn $ queryParticipant >>> (E.^. TutorialParticipantNote))
|
||||
, ("attendance" , SortColumnNullsInv $ queryParticipantDay >>> (E.?. TutorialParticipantDayAttendance))
|
||||
, ("note-attend" , SortColumn $ queryParticipantDay >>> (E.?. TutorialParticipantDayNote))
|
||||
, ("parking" , SortColumnNullsInv $ queryUserDay >>> (E.?. UserDayParkingToken))
|
||||
]
|
||||
dbtFilter = Map.fromList
|
||||
[ fltrUserNameEmail queryUser
|
||||
|
||||
@ -1256,6 +1256,8 @@ fillDb = do
|
||||
, examStaff = Just "Jost"
|
||||
, examAuthorshipStatement = Nothing
|
||||
}
|
||||
insert_ $ UserDay svaupel nowaday True
|
||||
insert_ $ UserDay fhamann nowaday False
|
||||
|
||||
testMsg <- insert SystemMessage
|
||||
{ systemMessageNewsOnly = False
|
||||
|
||||
Loading…
Reference in New Issue
Block a user