feat(applicants): disclose applicant emails & allow communication
This commit is contained in:
parent
99f23f2558
commit
6711173687
@ -1446,6 +1446,7 @@ RGCourseLecturers: Kursverwalter
|
|||||||
RGCourseCorrectors: Korrektoren
|
RGCourseCorrectors: Korrektoren
|
||||||
RGCourseTutors: Tutoren
|
RGCourseTutors: Tutoren
|
||||||
RGTutorialParticipants tutn@TutorialName: Tutorium-Teilnehmer (#{tutn})
|
RGTutorialParticipants tutn@TutorialName: Tutorium-Teilnehmer (#{tutn})
|
||||||
|
RGCourseUnacceptedApplicants: Nicht akzeptierte Bewerber
|
||||||
|
|
||||||
MultiSelectFieldTip: Mehrfach-Auswahl ist möglich (Umschalt bzw. Strg)
|
MultiSelectFieldTip: Mehrfach-Auswahl ist möglich (Umschalt bzw. Strg)
|
||||||
MultiEmailFieldTip: Es sind mehrere, Komma-separierte, E-Mail-Addressen möglich
|
MultiEmailFieldTip: Es sind mehrere, Komma-separierte, E-Mail-Addressen möglich
|
||||||
@ -1926,6 +1927,7 @@ CsvColumnApplicationsAllocation: Zentralanmeldung über die die Bewerbung eingeg
|
|||||||
CsvColumnApplicationsApplication: Eindeutige Nummer der Bewerbung (zur Zuordnung im ZIP-Archiv aller Bewerbungsdateien)
|
CsvColumnApplicationsApplication: Eindeutige Nummer der Bewerbung (zur Zuordnung im ZIP-Archiv aller Bewerbungsdateien)
|
||||||
CsvColumnApplicationsName: Voller Name des Bewerbers
|
CsvColumnApplicationsName: Voller Name des Bewerbers
|
||||||
CsvColumnApplicationsMatriculation: Matrikelnummer des Bewerbers
|
CsvColumnApplicationsMatriculation: Matrikelnummer des Bewerbers
|
||||||
|
CsvColumnApplicationsEmail: E-Mail Adresse des Bewerbers
|
||||||
CsvColumnApplicationsField: Studienfach, mit dem der Bewerber seine Bewerbung assoziiert hat
|
CsvColumnApplicationsField: Studienfach, mit dem der Bewerber seine Bewerbung assoziiert hat
|
||||||
CsvColumnApplicationsDegree: Abschluss, den der Bewerber im assoziierten Studienfach anstrebt
|
CsvColumnApplicationsDegree: Abschluss, den der Bewerber im assoziierten Studienfach anstrebt
|
||||||
CsvColumnApplicationsSemester: Fachsemester des Bewerbes im assoziierten Studienfach
|
CsvColumnApplicationsSemester: Fachsemester des Bewerbes im assoziierten Studienfach
|
||||||
|
|||||||
@ -1446,6 +1446,7 @@ RGCourseLecturers: Course administrators
|
|||||||
RGCourseCorrectors: Course correctors
|
RGCourseCorrectors: Course correctors
|
||||||
RGCourseTutors: Course tutors
|
RGCourseTutors: Course tutors
|
||||||
RGTutorialParticipants tutn: Tutorial participants (#{tutn})
|
RGTutorialParticipants tutn: Tutorial participants (#{tutn})
|
||||||
|
RGCourseUnacceptedApplicants: Applicants not accepted
|
||||||
|
|
||||||
MultiSelectFieldTip: Multiple selections are possible (Shift or Ctrl)
|
MultiSelectFieldTip: Multiple selections are possible (Shift or Ctrl)
|
||||||
MultiEmailFieldTip: Multiple emails addresses may be specified (comma-separated)
|
MultiEmailFieldTip: Multiple emails addresses may be specified (comma-separated)
|
||||||
@ -1925,6 +1926,7 @@ CsvColumnApplicationsAllocation: Central allocation for which this application w
|
|||||||
CsvColumnApplicationsApplication: Globally unique number of application (for matching with the ZIP archive of all application files)
|
CsvColumnApplicationsApplication: Globally unique number of application (for matching with the ZIP archive of all application files)
|
||||||
CsvColumnApplicationsName: Participant's full name
|
CsvColumnApplicationsName: Participant's full name
|
||||||
CsvColumnApplicationsMatriculation: Participant's matriculation
|
CsvColumnApplicationsMatriculation: Participant's matriculation
|
||||||
|
CsvColumnApplicationsEmail: Participant's email address
|
||||||
CsvColumnApplicationsField: Field of study the participant specified when applying
|
CsvColumnApplicationsField: Field of study the participant specified when applying
|
||||||
CsvColumnApplicationsDegree: Degree the participant pursues in their associated field of study
|
CsvColumnApplicationsDegree: Degree the participant pursues in their associated field of study
|
||||||
CsvColumnApplicationsSemester: Semester the participant is in wrt. to their associated field of study
|
CsvColumnApplicationsSemester: Semester the participant is in wrt. to their associated field of study
|
||||||
|
|||||||
@ -125,6 +125,7 @@ data CourseApplicationsTableCsv = CourseApplicationsTableCsv
|
|||||||
{ csvCAAllocation :: Maybe AllocationShorthand
|
{ csvCAAllocation :: Maybe AllocationShorthand
|
||||||
, csvCAApplication :: Maybe CryptoFileNameCourseApplication
|
, csvCAApplication :: Maybe CryptoFileNameCourseApplication
|
||||||
, csvCAName :: Maybe Text
|
, csvCAName :: Maybe Text
|
||||||
|
, csvCAEmail :: Maybe UserEmail
|
||||||
, csvCAMatriculation :: Maybe Text
|
, csvCAMatriculation :: Maybe Text
|
||||||
, csvCAField :: Maybe Text
|
, csvCAField :: Maybe Text
|
||||||
, csvCADegree :: Maybe Text
|
, csvCADegree :: Maybe Text
|
||||||
@ -149,6 +150,7 @@ instance Csv.FromNamedRecord CourseApplicationsTableCsv where
|
|||||||
<$> csv .:?? "allocation"
|
<$> csv .:?? "allocation"
|
||||||
<*> csv .:?? "application"
|
<*> csv .:?? "application"
|
||||||
<*> csv .:?? "name"
|
<*> csv .:?? "name"
|
||||||
|
<*> csv .:?? "email"
|
||||||
<*> csv .:?? "matriculation"
|
<*> csv .:?? "matriculation"
|
||||||
<*> csv .:?? "field"
|
<*> csv .:?? "field"
|
||||||
<*> csv .:?? "degree"
|
<*> csv .:?? "degree"
|
||||||
@ -167,6 +169,7 @@ instance CsvColumnsExplained CourseApplicationsTableCsv where
|
|||||||
[ ('csvCAAllocation , MsgCsvColumnApplicationsAllocation )
|
[ ('csvCAAllocation , MsgCsvColumnApplicationsAllocation )
|
||||||
, ('csvCAApplication , MsgCsvColumnApplicationsApplication )
|
, ('csvCAApplication , MsgCsvColumnApplicationsApplication )
|
||||||
, ('csvCAName , MsgCsvColumnApplicationsName )
|
, ('csvCAName , MsgCsvColumnApplicationsName )
|
||||||
|
, ('csvCAEmail , MsgCsvColumnApplicationsEmail )
|
||||||
, ('csvCAMatriculation, MsgCsvColumnApplicationsMatriculation)
|
, ('csvCAMatriculation, MsgCsvColumnApplicationsMatriculation)
|
||||||
, ('csvCAField , MsgCsvColumnApplicationsField )
|
, ('csvCAField , MsgCsvColumnApplicationsField )
|
||||||
, ('csvCADegree , MsgCsvColumnApplicationsDegree )
|
, ('csvCADegree , MsgCsvColumnApplicationsDegree )
|
||||||
@ -320,6 +323,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
, emptyOpticColonnade (resultAllocation . _entityVal) $ \l -> anchorColonnade (views l allocationLink) $ colAllocationShorthand (l . _allocationShorthand)
|
, emptyOpticColonnade (resultAllocation . _entityVal) $ \l -> anchorColonnade (views l allocationLink) $ colAllocationShorthand (l . _allocationShorthand)
|
||||||
, anchorColonnadeM (views (resultCourseApplication . _entityKey) applicationLink) $ colApplicationId (resultCourseApplication . _entityKey)
|
, anchorColonnadeM (views (resultCourseApplication . _entityKey) applicationLink) $ colApplicationId (resultCourseApplication . _entityKey)
|
||||||
, anchorColonnadeM (views (resultUser . _entityKey) participantLink) $ colUserDisplayName (resultUser . _entityVal . $(multifocusL 2) _userDisplayName _userSurname)
|
, anchorColonnadeM (views (resultUser . _entityKey) participantLink) $ colUserDisplayName (resultUser . _entityVal . $(multifocusL 2) _userDisplayName _userSurname)
|
||||||
|
, lmap (view $ resultUser . _entityVal) colUserEmail
|
||||||
, colUserMatriculation (resultUser . _entityVal . _userMatrikelnummer)
|
, colUserMatriculation (resultUser . _entityVal . _userMatrikelnummer)
|
||||||
, emptyOpticColonnade (resultStudyTerms . _entityVal) colStudyTerms
|
, emptyOpticColonnade (resultStudyTerms . _entityVal) colStudyTerms
|
||||||
, emptyOpticColonnade (resultStudyDegree . _entityVal) colStudyDegree
|
, emptyOpticColonnade (resultStudyDegree . _entityVal) colStudyDegree
|
||||||
@ -335,6 +339,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
[ singletonMap "participant" . SortColumn $ view queryIsParticipant
|
[ singletonMap "participant" . SortColumn $ view queryIsParticipant
|
||||||
, sortAllocationShorthand $ queryAllocation . to (E.?. AllocationShorthand)
|
, sortAllocationShorthand $ queryAllocation . to (E.?. AllocationShorthand)
|
||||||
, sortUserName' $ $(multifocusG 2) (queryUser . to (E.^. UserDisplayName)) (queryUser . to (E.^. UserSurname))
|
, sortUserName' $ $(multifocusG 2) (queryUser . to (E.^. UserDisplayName)) (queryUser . to (E.^. UserSurname))
|
||||||
|
, uncurry singletonMap . sortUserEmail $ view queryUser
|
||||||
, sortUserMatriculation $ queryUser . to (E.^. UserMatrikelnummer)
|
, sortUserMatriculation $ queryUser . to (E.^. UserMatrikelnummer)
|
||||||
, sortStudyTerms queryStudyTerms
|
, sortStudyTerms queryStudyTerms
|
||||||
, sortStudyDegree queryStudyDegree
|
, sortStudyDegree queryStudyDegree
|
||||||
@ -349,6 +354,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
dbtFilter = mconcat
|
dbtFilter = mconcat
|
||||||
[ fltrAllocation queryAllocation
|
[ fltrAllocation queryAllocation
|
||||||
, fltrUserName' $ queryUser . to (E.^. UserDisplayName)
|
, fltrUserName' $ queryUser . to (E.^. UserDisplayName)
|
||||||
|
, uncurry singletonMap . fltrUserEmail $ view queryUser
|
||||||
, fltrUserMatriculation $ queryUser . to (E.^. UserMatrikelnummer)
|
, fltrUserMatriculation $ queryUser . to (E.^. UserMatrikelnummer)
|
||||||
, fltrStudyTerms queryStudyTerms
|
, fltrStudyTerms queryStudyTerms
|
||||||
, fltrStudyDegree queryStudyDegree
|
, fltrStudyDegree queryStudyDegree
|
||||||
@ -363,6 +369,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
[ fltrAllocationUI
|
[ fltrAllocationUI
|
||||||
, fltrUserNameUI'
|
, fltrUserNameUI'
|
||||||
, fltrUserMatriculationUI
|
, fltrUserMatriculationUI
|
||||||
|
, fltrUserEmailUI
|
||||||
, fltrStudyTermsUI
|
, fltrStudyTermsUI
|
||||||
, fltrStudyDegreeUI
|
, fltrStudyDegreeUI
|
||||||
, fltrStudyFeaturesSemesterUI
|
, fltrStudyFeaturesSemesterUI
|
||||||
@ -382,6 +389,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
<$> preview (resultAllocation . _entityVal . _allocationShorthand)
|
<$> preview (resultAllocation . _entityVal . _allocationShorthand)
|
||||||
<*> (preview (resultCourseApplication . _entityKey) >>= traverse encrypt)
|
<*> (preview (resultCourseApplication . _entityKey) >>= traverse encrypt)
|
||||||
<*> preview (resultUser . _entityVal . _userDisplayName)
|
<*> preview (resultUser . _entityVal . _userDisplayName)
|
||||||
|
<*> preview (resultUser . _entityVal . _userEmail)
|
||||||
<*> preview (resultUser . _entityVal . _userMatrikelnummer . _Just)
|
<*> preview (resultUser . _entityVal . _userMatrikelnummer . _Just)
|
||||||
<*> preview (resultStudyTerms . _entityVal . (_studyTermsName . _Just <> _studyTermsShorthand . _Just <> to (tshow . studyTermsKey)))
|
<*> preview (resultStudyTerms . _entityVal . (_studyTermsName . _Just <> _studyTermsShorthand . _Just <> to (tshow . studyTermsKey)))
|
||||||
<*> preview (resultStudyDegree . _entityVal . (_studyDegreeName . _Just <> _studyDegreeShorthand . _Just <> to (tshow . studyDegreeKey)))
|
<*> preview (resultStudyDegree . _entityVal . (_studyDegreeName . _Just <> _studyDegreeShorthand . _Just <> to (tshow . studyDegreeKey)))
|
||||||
@ -505,6 +513,7 @@ postCApplicationsR tid ssh csh = do
|
|||||||
users <- E.select . E.from $ \user -> do
|
users <- E.select . E.from $ \user -> do
|
||||||
E.where_ . E.and $ catMaybes
|
E.where_ . E.and $ catMaybes
|
||||||
[ (user E.^. UserMatrikelnummer E.==.) . E.val . Just <$> csvCAMatriculation
|
[ (user E.^. UserMatrikelnummer E.==.) . E.val . Just <$> csvCAMatriculation
|
||||||
|
, (user E.^. UserEmail E.==.) . E.val <$> csvCAEmail
|
||||||
, (user E.^. UserDisplayName E.==.) . E.val <$> csvCAName
|
, (user E.^. UserDisplayName E.==.) . E.val <$> csvCAName
|
||||||
]
|
]
|
||||||
return $ user E.^. UserId
|
return $ user E.^. UserId
|
||||||
|
|||||||
@ -15,14 +15,25 @@ import qualified Database.Esqueleto as E
|
|||||||
getCCommR, postCCommR :: TermId -> SchoolId -> CourseShorthand -> Handler Html
|
getCCommR, postCCommR :: TermId -> SchoolId -> CourseShorthand -> Handler Html
|
||||||
getCCommR = postCCommR
|
getCCommR = postCCommR
|
||||||
postCCommR tid ssh csh = do
|
postCCommR tid ssh csh = do
|
||||||
cid <- runDB . getKeyBy404 $ TermSchoolCourseShort tid ssh csh
|
(cid, tuts) <- runDB $ do
|
||||||
|
cid <- getKeyBy404 $ TermSchoolCourseShort tid ssh csh
|
||||||
|
tuts' <- selectKeysList [TutorialCourse ==. cid] []
|
||||||
|
tuts <- forM tuts' $ \tutid -> do
|
||||||
|
cID <- encrypt tutid
|
||||||
|
return ( RGTutorialParticipants cID
|
||||||
|
, E.from $ \(user `E.InnerJoin` participant) -> do
|
||||||
|
E.on $ user E.^. UserId E.==. participant E.^. TutorialParticipantUser
|
||||||
|
E.where_ $ participant E.^. TutorialParticipantTutorial E.==. E.val tutid
|
||||||
|
return user
|
||||||
|
)
|
||||||
|
return (cid, tuts)
|
||||||
|
|
||||||
commR CommunicationRoute
|
commR CommunicationRoute
|
||||||
{ crHeading = SomeMessage . prependCourseTitle tid ssh csh $ SomeMessage MsgCommCourseHeading
|
{ crHeading = SomeMessage . prependCourseTitle tid ssh csh $ SomeMessage MsgCommCourseHeading
|
||||||
, crUltDest = SomeRoute $ CourseR tid ssh csh CCommR
|
, crUltDest = SomeRoute $ CourseR tid ssh csh CCommR
|
||||||
, crJobs = crJobsCourseCommunication cid
|
, crJobs = crJobsCourseCommunication cid
|
||||||
, crTestJobs = crTestJobsCourseCommunication cid
|
, crTestJobs = crTestJobsCourseCommunication cid
|
||||||
, crRecipients = Map.fromList
|
, crRecipients = Map.fromList $
|
||||||
[ ( RGCourseParticipants
|
[ ( RGCourseParticipants
|
||||||
, E.from $ \(user `E.InnerJoin` participant) -> do
|
, E.from $ \(user `E.InnerJoin` participant) -> do
|
||||||
E.on $ user E.^. UserId E.==. participant E.^. CourseParticipantUser
|
E.on $ user E.^. UserId E.==. participant E.^. CourseParticipantUser
|
||||||
@ -52,7 +63,18 @@ postCCommR tid ssh csh = do
|
|||||||
E.&&. user E.^. UserId E.==. tutor E.^. TutorUser
|
E.&&. user E.^. UserId E.==. tutor E.^. TutorUser
|
||||||
return user
|
return user
|
||||||
)
|
)
|
||||||
]
|
, ( RGCourseUnacceptedApplicants
|
||||||
|
, E.from $ \user -> do
|
||||||
|
E.where_ . E.exists . E.from $ \courseApplication ->
|
||||||
|
E.where_ $ courseApplication E.^. CourseApplicationCourse E.==. E.val cid
|
||||||
|
E.&&. courseApplication E.^. CourseApplicationUser E.==. user E.^. UserId
|
||||||
|
E.where_ . E.not_ . E.exists . E.from $ \courseParticipant ->
|
||||||
|
E.where_ $ courseParticipant E.^. CourseParticipantCourse E.==. E.val cid
|
||||||
|
E.&&. courseParticipant E.^. CourseParticipantUser E.==. user E.^. UserId
|
||||||
|
E.&&. courseParticipant E.^. CourseParticipantState E.==. E.val CourseParticipantActive
|
||||||
|
return user
|
||||||
|
)
|
||||||
|
] ++ tuts
|
||||||
, crRecipientAuth = Just $ \uid -> do
|
, crRecipientAuth = Just $ \uid -> do
|
||||||
cID <- encrypt uid
|
cID <- encrypt uid
|
||||||
evalAccessDB (CourseR tid ssh csh $ CUserR cID) False
|
evalAccessDB (CourseR tid ssh csh $ CUserR cID) False
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import qualified Data.Set as Set
|
|||||||
import qualified Data.Conduit.Combinators as C
|
import qualified Data.Conduit.Combinators as C
|
||||||
|
|
||||||
|
|
||||||
data RecipientGroup = RGCourseParticipants | RGCourseLecturers | RGCourseCorrectors | RGCourseTutors
|
data RecipientGroup = RGCourseParticipants | RGCourseLecturers | RGCourseCorrectors | RGCourseTutors | RGCourseUnacceptedApplicants
|
||||||
| RGTutorialParticipants CryptoUUIDTutorial
|
| RGTutorialParticipants CryptoUUIDTutorial
|
||||||
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
deriving (Eq, Ord, Read, Show, Generic, Typeable)
|
||||||
|
|
||||||
|
|||||||
@ -18,6 +18,8 @@ $if not (null activeCategories)
|
|||||||
_{MsgRGCourseTutors}
|
_{MsgRGCourseTutors}
|
||||||
$of RecipientGroup (RGTutorialParticipants tutid)
|
$of RecipientGroup (RGTutorialParticipants tutid)
|
||||||
^{rgTutorialParticipantsCaption tutid}
|
^{rgTutorialParticipantsCaption tutid}
|
||||||
|
$of RecipientGroup RGCourseUnacceptedApplicants
|
||||||
|
_{MsgRGCourseUnacceptedApplicants}
|
||||||
|
|
||||||
$if hasContent category
|
$if hasContent category
|
||||||
<fieldset .recipient-category__fieldset uw-interactive-fieldset .interactive-fieldset__target data-conditional-input=#{checkedIdent category}>
|
<fieldset .recipient-category__fieldset uw-interactive-fieldset .interactive-fieldset__target data-conditional-input=#{checkedIdent category}>
|
||||||
|
|||||||
Reference in New Issue
Block a user