diff --git a/src/Application.hs b/src/Application.hs index 80662f3ed..6615324f3 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Audit.hs b/src/Audit.hs index 8bff261b3..25bc3ccb5 100644 --- a/src/Audit.hs +++ b/src/Audit.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-24 Gregor Kleen ,Steffen Jost +-- SPDX-FileCopyrightText: 2023-2024 Gregor Kleen ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Audit/Types.hs b/src/Audit/Types.hs index 25809967d..1535b06ea 100644 --- a/src/Audit/Types.hs +++ b/src/Audit/Types.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Database/Esqueleto/Utils.hs b/src/Database/Esqueleto/Utils.hs index c22b2eb0c..c510bbb6c 100644 --- a/src/Database/Esqueleto/Utils.hs +++ b/src/Database/Esqueleto/Utils.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Database/Esqueleto/Utils/TH.hs b/src/Database/Esqueleto/Utils/TH.hs index 6623220a6..7f423cc48 100644 --- a/src/Database/Esqueleto/Utils/TH.hs +++ b/src/Database/Esqueleto/Utils/TH.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Foundation/I18n.hs b/src/Foundation/I18n.hs index 7526d3a76..e02273f68 100644 --- a/src/Foundation/I18n.hs +++ b/src/Foundation/I18n.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Foundation/Navigation.hs b/src/Foundation/Navigation.hs index 87fba1772..c7d1b36db 100644 --- a/src/Foundation/Navigation.hs +++ b/src/Foundation/Navigation.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Admin.hs b/src/Handler/Admin.hs index 8f31f69bb..fa00065aa 100644 --- a/src/Handler/Admin.hs +++ b/src/Handler/Admin.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Admin/Avs.hs b/src/Handler/Admin/Avs.hs index 5b7083309..76b04c6a5 100644 --- a/src/Handler/Admin/Avs.hs +++ b/src/Handler/Admin/Avs.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Course/Edit.hs b/src/Handler/Course/Edit.hs index 2837f1d84..2c07a6dd9 100644 --- a/src/Handler/Course/Edit.hs +++ b/src/Handler/Course/Edit.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Course/ParticipantInvite.hs b/src/Handler/Course/ParticipantInvite.hs index 25fbca7e0..bec66ce04 100644 --- a/src/Handler/Course/ParticipantInvite.hs +++ b/src/Handler/Course/ParticipantInvite.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Sarah Vaupel , Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Sarah Vaupel , Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Course/Show.hs b/src/Handler/Course/Show.hs index 8b5de3739..5d1de7131 100644 --- a/src/Handler/Course/Show.hs +++ b/src/Handler/Course/Show.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Course/Users.hs b/src/Handler/Course/Users.hs index 5b923c924..a4ca26ea4 100644 --- a/src/Handler/Course/Users.hs +++ b/src/Handler/Course/Users.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Exam/Correct.hs b/src/Handler/Exam/Correct.hs index a8f1e2494..78bf77d06 100644 --- a/src/Handler/Exam/Correct.hs +++ b/src/Handler/Exam/Correct.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Exam/Users.hs b/src/Handler/Exam/Users.hs index c9a73459b..86224f894 100644 --- a/src/Handler/Exam/Users.hs +++ b/src/Handler/Exam/Users.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Firm.hs b/src/Handler/Firm.hs index ba64f041e..783f5f445 100644 --- a/src/Handler/Firm.hs +++ b/src/Handler/Firm.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-25 Steffen Jost +-- SPDX-FileCopyrightText: 2023-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Firm/Supervision.hs b/src/Handler/Firm/Supervision.hs index fe5c6721e..3d91ba641 100644 --- a/src/Handler/Firm/Supervision.hs +++ b/src/Handler/Firm/Supervision.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-25 Steffen Jost +-- SPDX-FileCopyrightText: 2023-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Health.hs b/src/Handler/Health.hs index a92d88270..7e50f8239 100644 --- a/src/Handler/Health.hs +++ b/src/Handler/Health.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/LMS.hs b/src/Handler/LMS.hs index b8e72abd7..d882c1d82 100644 --- a/src/Handler/LMS.hs +++ b/src/Handler/LMS.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/LMS/Fake.hs b/src/Handler/LMS/Fake.hs index ee48a96cf..4b21b35c0 100644 --- a/src/Handler/LMS/Fake.hs +++ b/src/Handler/LMS/Fake.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/LMS/Learners.hs b/src/Handler/LMS/Learners.hs index 293eeea5e..2088872a2 100644 --- a/src/Handler/LMS/Learners.hs +++ b/src/Handler/LMS/Learners.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-25 Steffen Jost +-- SPDX-FileCopyrightText: 2023-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/LMS/Users.hs b/src/Handler/LMS/Users.hs index a3caa5ac5..d97278a24 100644 --- a/src/Handler/LMS/Users.hs +++ b/src/Handler/LMS/Users.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/PrintCenter.hs b/src/Handler/PrintCenter.hs index eb35c85ec..ecb5c143d 100644 --- a/src/Handler/PrintCenter.hs +++ b/src/Handler/PrintCenter.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Profile.hs b/src/Handler/Profile.hs index 9f39b8cf7..d3bc54b3c 100644 --- a/src/Handler/Profile.hs +++ b/src/Handler/Profile.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Qualification.hs b/src/Handler/Qualification.hs index a5aeb2c30..0c0970a26 100644 --- a/src/Handler/Qualification.hs +++ b/src/Handler/Qualification.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/School/DayTasks.hs b/src/Handler/School/DayTasks.hs index 7655eb6f4..e968e2022 100644 --- a/src/Handler/School/DayTasks.hs +++ b/src/Handler/School/DayTasks.hs @@ -1,5 +1,5 @@ --- SPDX-FileCopyrightText: 2024-25 Steffen Jost +-- SPDX-FileCopyrightText: 2024-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Tutorial/Users.hs b/src/Handler/Tutorial/Users.hs index 429882852..8fab438e9 100644 --- a/src/Handler/Tutorial/Users.hs +++ b/src/Handler/Tutorial/Users.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Users.hs b/src/Handler/Users.hs index 34b420fbc..d41b00a11 100644 --- a/src/Handler/Users.hs +++ b/src/Handler/Users.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros +-- SPDX-FileCopyrightText: 2022-2023 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils.hs b/src/Handler/Utils.hs index 029762ee4..c11651123 100644 --- a/src/Handler/Utils.hs +++ b/src/Handler/Utils.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-25 Gregor Kleen ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2023-2025 Gregor Kleen ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Avs.hs b/src/Handler/Utils/Avs.hs index bf7c35b34..04ae1989e 100644 --- a/src/Handler/Utils/Avs.hs +++ b/src/Handler/Utils/Avs.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/AvsUpdate.hs b/src/Handler/Utils/AvsUpdate.hs index 0d0f226a9..76b7f4a91 100644 --- a/src/Handler/Utils/AvsUpdate.hs +++ b/src/Handler/Utils/AvsUpdate.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2024-25 Steffen Jost +-- SPDX-FileCopyrightText: 2024-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later {-# OPTIONS_GHC -fno-warn-unused-top-binds -fno-warn-orphans #-} diff --git a/src/Handler/Utils/Company.hs b/src/Handler/Utils/Company.hs index 58276cdb4..f4053e2f3 100644 --- a/src/Handler/Utils/Company.hs +++ b/src/Handler/Utils/Company.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/DateTime.hs b/src/Handler/Utils/DateTime.hs index 662ae529b..e955044b0 100644 --- a/src/Handler/Utils/DateTime.hs +++ b/src/Handler/Utils/DateTime.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Files.hs b/src/Handler/Utils/Files.hs index 29cf40204..1644c91cf 100644 --- a/src/Handler/Utils/Files.hs +++ b/src/Handler/Utils/Files.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel , Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel , Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Form.hs b/src/Handler/Utils/Form.hs index 041a317b6..e5ec7d61b 100644 --- a/src/Handler/Utils/Form.hs +++ b/src/Handler/Utils/Form.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Form/Occurrences.hs b/src/Handler/Utils/Form/Occurrences.hs index c37368891..f43849ae3 100644 --- a/src/Handler/Utils/Form/Occurrences.hs +++ b/src/Handler/Utils/Form/Occurrences.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/LMS.hs b/src/Handler/Utils/LMS.hs index 268d2d73d..59aca7859 100644 --- a/src/Handler/Utils/LMS.hs +++ b/src/Handler/Utils/LMS.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Pandoc.hs b/src/Handler/Utils/Pandoc.hs index c138f0a76..279e37970 100644 --- a/src/Handler/Utils/Pandoc.hs +++ b/src/Handler/Utils/Pandoc.hs @@ -1,11 +1,11 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen , Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen , Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later module Handler.Utils.Pandoc ( module Utils.Pandoc , htmlField, htmlFieldSmall - , renderMarkdownWith, parseMarkdownWith + , renderMarkdownWith, parseMarkdownWith ) where import Import.NoFoundation @@ -58,7 +58,7 @@ htmlField' fieldKind = Field{..} MarkupHtml -> renderMarkdown markupOutput MarkupPlaintext -> plaintextToMarkdown $ toStrict markupInput in either return (maybeT (return mempty) . toMarkdown) val - + let markdownExplanation = $(i18nWidgetFile "markdown-explanation") $(widgetFile "widgets/html-field") diff --git a/src/Handler/Utils/Profile.hs b/src/Handler/Utils/Profile.hs index 782cd02b1..51706cf8b 100644 --- a/src/Handler/Utils/Profile.hs +++ b/src/Handler/Utils/Profile.hs @@ -1,8 +1,8 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later --- TODO: why is this Handler.Utils.Profile instead of Utils.Profile? +-- TODO: why is this Handler.Utils.Profile instead of Utils.Profile? -- TODO: consider merging with Handler.Utils.Users? module Handler.Utils.Profile ( module Utils.Mail @@ -17,14 +17,14 @@ import qualified Data.Text as Text import qualified Data.MultiSet as MultiSet import qualified Data.Set as Set -import Utils.Mail +import Utils.Mail import Utils.Postal -- | remove last comma and swap order of the two parts, ie. transforming "surname, givennames" into "givennames surname". -- Input "givennames surname" is left unchanged, except for removing excess whitespace -fixDisplayName :: UserDisplayName -> UserDisplayName -fixDisplayName udn = - let (Text.strip . Text.dropEnd 1 -> surname, Text.strip -> firstnames) = Text.breakOnEnd "," udn +fixDisplayName :: UserDisplayName -> UserDisplayName +fixDisplayName udn = + let (Text.strip . Text.dropEnd 1 -> surname, Text.strip -> firstnames) = Text.breakOnEnd "," udn in Text.toTitle $ Text.strip $ firstnames <> Text.cons ' ' surname -- | Like `validDisplayName` but may return an automatically corrected name @@ -59,10 +59,10 @@ validDisplayName (fmap stripFold -> mTitle) (stripFold -> fName) (stripFold -> s isAdd = (`Set.member` addLetters) splitAdd = Text.split isAdd makeMultiSet = MultiSet.fromList . filter (not . Text.null) . splitAdd - + validFraportPersonalNumber :: Maybe Text -> Bool validFraportPersonalNumber Nothing = False validFraportPersonalNumber (Just t) | (Just pn) <- readMay t - = pn >= (10000::Int) && pn <= (99999::Int) -- used to filter for SAP export + = pn >= (10000::Int) && pn <= (99999::Int) -- used to filter for SAP export | otherwise = False diff --git a/src/Handler/Utils/Qualification.hs b/src/Handler/Utils/Qualification.hs index 8921c8936..b90220c1e 100644 --- a/src/Handler/Utils/Qualification.hs +++ b/src/Handler/Utils/Qualification.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Table/Cells.hs b/src/Handler/Utils/Table/Cells.hs index 3e6ff7337..7da28cb0d 100644 --- a/src/Handler/Utils/Table/Cells.hs +++ b/src/Handler/Utils/Table/Cells.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Table/Pagination.hs b/src/Handler/Utils/Table/Pagination.hs index 54df04a3c..434c1fba0 100644 --- a/src/Handler/Utils/Table/Pagination.hs +++ b/src/Handler/Utils/Table/Pagination.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Handler/Utils/Widgets.hs b/src/Handler/Utils/Widgets.hs index 9012262e6..dd251dfaa 100644 --- a/src/Handler/Utils/Widgets.hs +++ b/src/Handler/Utils/Widgets.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Winnie Ros ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Winnie Ros ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Jobs/Handler/LMS.hs b/src/Jobs/Handler/LMS.hs index ac69bf126..766ac38bd 100644 --- a/src/Jobs/Handler/LMS.hs +++ b/src/Jobs/Handler/LMS.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Jobs/Handler/SendNotification/Qualification.hs b/src/Jobs/Handler/SendNotification/Qualification.hs index ecd749288..6dec183fe 100644 --- a/src/Jobs/Handler/SendNotification/Qualification.hs +++ b/src/Jobs/Handler/SendNotification/Qualification.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Jobs/Handler/SynchroniseAvs.hs b/src/Jobs/Handler/SynchroniseAvs.hs index a65ac5f37..b2f5b344f 100644 --- a/src/Jobs/Handler/SynchroniseAvs.hs +++ b/src/Jobs/Handler/SynchroniseAvs.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Jobs/Types.hs b/src/Jobs/Types.hs index ee48fc99a..7b7ddd5e7 100644 --- a/src/Jobs/Types.hs +++ b/src/Jobs/Types.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Model/Migration.hs b/src/Model/Migration.hs index 42bd22236..acb3aec0e 100644 --- a/src/Model/Migration.hs +++ b/src/Model/Migration.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Gregor Kleen ,Steffen Jost ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Gregor Kleen ,Steffen Jost ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later @@ -30,7 +30,7 @@ import qualified Database.Esqueleto.Legacy as E import Control.Monad.Except (MonadError(..)) import Web.ServerSession.Backend.Persistent.Memcached (migrateMemcachedSqlStorage) - + -- import qualified Control.Monad.State.Class as State @@ -141,11 +141,11 @@ getMissingMigrations :: forall m m'. => ReaderT SqlBackend m (Map ManualMigration (ReaderT SqlBackend m' ())) getMissingMigrations = do $logDebugS "Migration" "Retrieve applied migrations" - appliedMigrations <- fmap (map E.unValue) . E.select . E.from $ \appliedMigration -> do + appliedMigrations <- fmap (map E.unValue) . E.select . E.from $ \appliedMigration -> do return $ appliedMigration E.^. AppliedMigrationMigration let migNotDone m _ = toPathPiece m `Set.notMember` Set.fromList appliedMigrations return $ Map.filterWithKey migNotDone customMigrations - + getMigrationTime :: ( MonadIO m , BaseBackend backend ~ SqlBackend diff --git a/src/Model/Migration/Definitions.hs b/src/Model/Migration/Definitions.hs index d51e23d2b..708cefb92 100644 --- a/src/Model/Migration/Definitions.hs +++ b/src/Model/Migration/Definitions.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Model/Types/Avs.hs b/src/Model/Types/Avs.hs index 9911d748c..615dce2f3 100644 --- a/src/Model/Types/Avs.hs +++ b/src/Model/Types/Avs.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Model/Types/Common.hs b/src/Model/Types/Common.hs index d98422be7..c86c55f6d 100644 --- a/src/Model/Types/Common.hs +++ b/src/Model/Types/Common.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Model/Types/DateTime.hs b/src/Model/Types/DateTime.hs index abc157295..a95b39ee9 100644 --- a/src/Model/Types/DateTime.hs +++ b/src/Model/Types/DateTime.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Model/Types/User.hs b/src/Model/Types/User.hs index 4c106917c..0966162e9 100644 --- a/src/Model/Types/User.hs +++ b/src/Model/Types/User.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Avs.hs b/src/Utils/Avs.hs index d7f4d32dd..087aa5fcc 100644 --- a/src/Utils/Avs.hs +++ b/src/Utils/Avs.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/DB.hs b/src/Utils/DB.hs index 4399e5176..ccd067a04 100644 --- a/src/Utils/DB.hs +++ b/src/Utils/DB.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Form.hs b/src/Utils/Form.hs index c2ddc1bb4..150d0b7f5 100644 --- a/src/Utils/Form.hs +++ b/src/Utils/Form.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2023-25 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Wolfgang Witt ,Steffen Jost +-- SPDX-FileCopyrightText: 2023-2025 Felix Hamann ,Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Wolfgang Witt ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Lens.hs b/src/Utils/Lens.hs index bbd38c090..5050cf254 100644 --- a/src/Utils/Lens.hs +++ b/src/Utils/Lens.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Message.hs b/src/Utils/Message.hs index 394ec653d..f6deb3acc 100644 --- a/src/Utils/Message.hs +++ b/src/Utils/Message.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-25 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2025 Gregor Kleen ,Sarah Vaupel ,Sarah Vaupel ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Metrics.hs b/src/Utils/Metrics.hs index 31f29e6c6..1a0801c5e 100644 --- a/src/Utils/Metrics.hs +++ b/src/Utils/Metrics.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen , Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen , Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Persist.hs b/src/Utils/Persist.hs index 154a8346c..964ffc8f9 100644 --- a/src/Utils/Persist.hs +++ b/src/Utils/Persist.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen , Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen , Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/src/Utils/Print.hs b/src/Utils/Print.hs index 931b2d312..9f69b2d7a 100644 --- a/src/Utils/Print.hs +++ b/src/Utils/Print.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later @@ -131,9 +131,9 @@ mdTemplating template meta = runExceptT $ do , P.writerTemplate = Just tmpl } ExceptT . pure . over _Left P.renderError . P.runPure $ do - md_txt <- P.writeMarkdown writerOpts $ appMeta setIsDeFromLang $ addMeta meta doc + md_txt <- P.writeMarkdown writerOpts $ appMeta setIsDeFromLang $ addMeta meta doc addMeta meta <$> P.readMarkdown readerOpts md_txt -- NOTE: meta is lost along the way somehow, despite P.pandocExtensions containing Ext_yaml_metadata_block - + -- | creates a PDF using a LaTeX template @@ -143,17 +143,17 @@ pdfLaTeX lk doc = do e_tmpl <- memcachedBy (Just . Right $ 6 * diffHour) ("LetterKind-latex: \n" <> tshow lk) (fmap (over _Left P.renderError) . liftIO . P.runIO $ compileTemplate $ templateLatex lk) actRight e_tmpl $ \tmpl -> fmap (over _Left P.renderError) . liftIO . P.runIO $ do let writerOpts = def { P.writerExtensions = P.pandocExtensions - , P.writerTemplate = Just tmpl } + , P.writerTemplate = Just tmpl } makePDF writerOpts $ appMeta setIsDeFromLang doc letterTemplate :: (MDLetter l) => Entity User -> l -> Text -> Maybe [Text] -> Handler (Either Text P.Pandoc) letterTemplate rcvrEnt@Entity{entityVal=rcvr} mdl apcIdent rcvrPostalRaw = do - now <- liftIO getCurrentTime + now <- liftIO getCurrentTime formatter@DateTimeFormatter{ format } <- getDateTimeFormatterUser' rcvr rcvrPostal <- altM (return rcvrPostalRaw) $ runDB $ getPostalAddress rcvrEnt -- (_,rcvrPostal, rcvrEmail) <- runDB $ getPostalPreferenceAndAddress - let lang = selectDeEn $ rcvr & userLanguages -- select either German or English only, default de; see Utils.Lang + let lang = selectDeEn $ rcvr & userLanguages -- select either German or English only, default de; see Utils.Lang tmpl = getTemplate mdl meta = addApcIdent apcIdent <> letterMeta mdl formatter lang rcvrEnt @@ -161,7 +161,7 @@ letterTemplate rcvrEnt@Entity{entityVal=rcvr} mdl apcIdent rcvrPostalRaw = do [ -- toMeta "lang" lang -- receiver language is decided in MDLetter instance, since some letters have fixed languages toMeta "date" $ format SelFormatDate now , toMeta "rcvr-name" $ rcvr & userDisplayName - , toMeta "address" $ fromMaybe [rcvr & userDisplayName] $ canonical rcvrPostal + , toMeta "address" $ fromMaybe [rcvr & userDisplayName] $ canonical rcvrPostal --, toMeta "rcvr-email" $ fromMaybe [rcvr & userDisplayEmail] rcvrEmail -- note that some templates use "email" already otherwise ] mdTemplating tmpl meta @@ -174,24 +174,24 @@ renderLetterPDF rcvrEnt mdl apcIdent rcvrPostal = do renderLetterHtml :: (MDLetter l) => Entity User -> l -> Text -> Maybe [Text] -> Handler (Either Text Html) renderLetterHtml rcvrEnt mdl apcIdent rcvrPostal = do e_md <- letterTemplate rcvrEnt mdl apcIdent rcvrPostal - actRight e_md $ \md -> pure . over _Left P.renderError . P.runPure $ do + actRight e_md $ \md -> pure . over _Left P.renderError . P.runPure $ do html_tmpl <- compileTemplate $ templateHtml $ getLetterKind mdl -- html_tmpl <- ExceptT $ memcachedBy (Just . Right $ 6 * diffHour) ("LetterKind-Html: \n" <> tshow lk) (pure . over _Left P.renderError . P.runPure $ compileTemplate $ templateHtml lk) let writerOpts = def { P.writerExtensions = P.pandocExtensions , P.writerTemplate = Just html_tmpl } P.writeHtml5 writerOpts $ appMeta setIsDeFromLang md --- TODO: apcIdent does not make sense for multiple letters +-- TODO: apcIdent does not make sense for multiple letters renderLetters :: (MDLetter l, Foldable f) => Entity User -> f l -> Text -> Handler (Either Text LBS.ByteString) -renderLetters rcvrEnt@Entity{entityVal=rcvr} mdls apcIdent +renderLetters rcvrEnt@Entity{entityVal=rcvr} mdls apcIdent | Just l <- anyone mdls = do - now <- liftIO getCurrentTime + now <- liftIO getCurrentTime formatter@DateTimeFormatter{ format } <- getDateTimeFormatterUser' rcvr rcvrPostal <- runDB $ getPostalAddress rcvrEnt -- (_,rcvrPostal, rcvrEmail) <- runDB $ getPostalPreferenceAndAddress - let lang = selectDeEn $ rcvr & userLanguages -- select either German or English only, default de; see Utils.Lang + let lang = selectDeEn $ rcvr & userLanguages -- select either German or English only, default de; see Utils.Lang kind = getLetterKind l - + templateCombine _ err@Left{} = pure err templateCombine mdl (Right doc1) = let tmpl = getTemplate mdl @@ -202,9 +202,9 @@ renderLetters rcvrEnt@Entity{entityVal=rcvr} mdls apcIdent toMeta "date" $ format SelFormatDate now , toMeta "rcvr-name" $ rcvr & userDisplayName , toMeta "address" $ fromMaybe [rcvr & userDisplayName] rcvrPostal - --, toMeta "rcvr-email" $ fromMaybe [rcvr & userDisplayEmail] rcvrEmail -- note that some templates use "email" already otherwise + --, toMeta "rcvr-email" $ fromMaybe [rcvr & userDisplayEmail] rcvrEmail -- note that some templates use "email" already otherwise ] - in mdTemplating tmpl meta <&> \case + in mdTemplating tmpl meta <&> \case err@Left{} -> err Right doc2 -> Right $ doc1 <> doc2 @@ -227,7 +227,7 @@ printHtml _senderId (rcvr, letter) = do now <- liftIO getCurrentTime apcIdent <- letterApcIdent letter encRecipient now renderLetterHtml rcvr letter apcIdent Nothing - + -- Only used in print-test-handler for PrintSendR printLetter :: (MDLetter l) => Maybe UserId -> (Entity User, l) -> Handler (Either Text (Text, FilePath)) printLetter senderId (rcvr, letter) = do @@ -236,8 +236,8 @@ printLetter senderId (rcvr, letter) = do now <- liftIO getCurrentTime apcIdent <- letterApcIdent letter encRecipient now pdf <- renderLetterPDF rcvr letter apcIdent Nothing - let protoPji = getPJId letter - pji = protoPji + let protoPji = getPJId letter + pji = protoPji { pjiRecipient = Just rcvrId , pjiSender = senderId , pjiName = "TEST_" <> pjiName protoPji @@ -277,18 +277,18 @@ printLetter' pji pdf = do reprintPDF :: Bool -> PrintJobId -> DB (Either Text Text) reprintPDF ignoreReroute pjid = maybeM (return $ Left "Print job id is unknown.") reprint $ get pjid - where + where reprint :: PrintJob -> DB (Either Text Text) - reprint pj@PrintJob{..} = do - qshort <- ifNothingM printJobQualification "-" $ fmap (maybe "_" $ CI.original . qualificationShorthand ) . get + reprint pj@PrintJob{..} = do + qshort <- ifNothingM printJobQualification "-" $ fmap (maybe "_" $ CI.original . qualificationShorthand ) . get let logInter = flip (logInterface "Printer" qshort) (Just 1) result <- lprPDF' ignoreReroute printJobFilename $ LBS.fromStrict printJobFile case result of - Left err -> + Left err -> logInter False err Right m -> do logInter True m - now <- liftIO getCurrentTime + now <- liftIO getCurrentTime insert_ pj{ printJobAcknowledged = Nothing , printJobCreated = now -- , printJobApcIdent = ??? cannot be modified here, since it is included inside the PDF @@ -306,16 +306,16 @@ printLetter'' _ = do -} sendEmailOrLetter :: (MDLetter l) => UserId -> l -> Handler Bool -sendEmailOrLetter recipient letter = do +sendEmailOrLetter recipient letter = do (underling, receivers, undercopy) <- updateReceivers recipient -- TODO: check to avoid this almost circular dependency now <- liftIO getCurrentTime mr <- getMessageRender let pjid = getPJId letter fName = letterFileName letter - -- these are only needed if sent by email, but we're lazy anyway + -- these are only needed if sent by email, but we're lazy anyway undername = underling ^. _userDisplayName -- nameHtml' underling - undermail = CI.original $ underling ^. _userEmail - mailSubjectRaw = getMailSubject letter + undermail = CI.original $ underling ^. _userEmail + mailSubjectRaw = getMailSubject letter mailSubjectSuper = SomeMessage $ "[SUPERVISOR] " <> mr mailSubjectRaw mkMailSubject = bool mailSubjectRaw mailSubjectSuper mkMailBody = getMailBody letter @@ -326,19 +326,19 @@ sendEmailOrLetter recipient letter = do encRecipient :: CryptoUUIDUser <- encrypt svr apcIdent <- letterApcIdent letter encRecipient now postalPrefs <- runDB $ getPostalPreferenceAndAddress rcvrEnt - case postalPrefs of + case postalPrefs of (_, Nothing, Nothing) -> do -- neither email nor postal is known let msg = "Notification failed for " <> tshow encRecipient <> ", who has neither a known email nor postal address. Notification: " <> tshow pjid $logErrorS "LETTER" msg return False (True, postal@(Just _), _) -> renderLetterPDF rcvrEnt letter apcIdent postal >>= \case -- send printed letter - Left err -> do -- pdf generation failed + Left err -> do -- pdf generation failed let msg = "Notification failed for " <> tshow encRecipient <> ". PDF generation failed: "<> cropText err <> "For Notification: " <> tshow pjid $logErrorS "LETTER" msg - return False + return False Right pdf -> runDB (printLetter' pjid{pjiRecipient = Just svr, pjiApcAcknowledge = apcIdent} pdf) >>= \case - Left err -> do + Left err -> do let msg = "Notification failed for " <> tshow encRecipient <> ". PDF printing failed. The print job could not be sent: " <> cropText err $logErrorS "LETTER" msg return False @@ -348,13 +348,13 @@ sendEmailOrLetter recipient letter = do $logWarnS "LETTER" $ "PDF printing to send letter with lpr returned ExitSuccess and the following message: " <> msg return True - (_, postal, _email) | Just mkMail <- mkMailBody -> renderLetterPDF rcvrEnt letter apcIdent postal >>= \case -- send Email with pdf attached - Left err -> do -- pdf generation failed + (_, postal, _email) | Just mkMail <- mkMailBody -> renderLetterPDF rcvrEnt letter apcIdent postal >>= \case -- send Email with pdf attached + Left err -> do -- pdf generation failed let msg = "Notification failed for " <> tshow encRecipient <> ". PDF attachment generation failed: "<> cropText err <> "For Notification: " <> tshow pjid $logErrorS "LETTER" msg - return False + return False Right pdf -> do -- pdf generated, send as email attachment now - let pdfPass = case encryptPDFfor letter of + let pdfPass = case encryptPDFfor letter of NoPassword -> Nothing PasswordSupervisor -> rcvrUsr ^. _userPinPassword PasswordUnderling -> underling ^. _userPinPassword @@ -362,7 +362,7 @@ sendEmailOrLetter recipient letter = do Nothing -> return pdf Just passwd -> encryptPDF passwd pdf >>= \case Right encPdf -> return encPdf - Left err -> do + Left err -> do let msg = "Notification for " <> tshow encRecipient <> " has unencrypted attachment. Encrypting PDF failed: " <> cropText err $logWarnS "LETTER" msg return pdf @@ -381,14 +381,14 @@ sendEmailOrLetter recipient letter = do return True (_, postal, _email) -> renderLetterHtml rcvrEnt letter apcIdent postal >>= \case -- send Email, render letter directly to html - Left err -> do -- html generation failed + Left err -> do -- html generation failed let msg = "Notification failed for " <> tshow encRecipient <> ". HTML generation failed: "<> cropText err <> "For Notification: " <> tshow pjid $logErrorS "LETTER" msg - return False - Right html -> do -- html generated, send directly now + return False + Right html -> do -- html generated, send directly now userMailTdirect svr $ do replaceMailHeader "Auto-Submitted" $ Just "auto-generated" - setSubjectI mailSubject + setSubjectI mailSubject addHtmlMarkdownAlternatives html return True return $ or oks @@ -469,9 +469,9 @@ lprPDF = lprPDF' False lprPDF' :: (MonadHandler m, HasAppSettings (HandlerSite m)) => Bool -> FilePath -> LBS.ByteString -> m (Either Text Text) lprPDF' ignoreReroute (sanitizeCmdArg' -> jb) bs = maybeM hdlFail hdlLpr getLprServerArg - where + where hdlFail = return $ Right "Print command ignored due to setting 'mail-reroute-to' being set." - + hdlLpr lprServerArg = do let pc = setStdin (byteStringInput bs) $ proc "lpr" $ @@ -480,9 +480,9 @@ lprPDF' ignoreReroute (sanitizeCmdArg' -> jb) bs = maybeM hdlFail hdlLpr getLprS , "-" -- read from stdin ] jobname | null jb = [] - | otherwise = ["-J " <> jb] + | otherwise = ["-J " <> jb] exit2either <$> readProcess' pc - + getLprServerArg = do rerouteMail <- getsYesod $ view _appMailRerouteTo case (ignoreReroute, rerouteMail) of diff --git a/src/Utils/Print/Instances.hs b/src/Utils/Print/Instances.hs index 2d469021c..2bf407d00 100644 --- a/src/Utils/Print/Instances.hs +++ b/src/Utils/Print/Instances.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later @@ -25,7 +25,7 @@ import qualified Text.Pandoc as P -- required for memcaching compiled markdown and LaTeX templates instance Binary P.RowHeadColumns -instance Binary P.RowSpan +instance Binary P.RowSpan instance Binary P.ColWidth instance Binary P.ColSpan instance Binary P.Alignment diff --git a/src/Utils/Print/Letters.hs b/src/Utils/Print/Letters.hs index 902282fc5..7858e2b57 100644 --- a/src/Utils/Print/Letters.hs +++ b/src/Utils/Print/Letters.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-23 Steffen Jost +-- SPDX-FileCopyrightText: 2022-2023 Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later @@ -128,7 +128,7 @@ defWriterOpts t = def { P.writerExtensions = P.pandocExtensions, P.writerTemplat data LetterKind = Din5008 -- scrlttr2: Standard postal letter with address field, expects peprinted FraportLogo - | PinLetter -- Like Din5008, but for special paper with a protected pin field + | PinLetter -- Like Din5008, but for special paper with a protected pin field | Plain -- scrartcl: Empty, expects empty paper with no preprints | PlainLogo -- Like plain, but expects to be printed on paper with Logo -- | Logo -- Like plain, but prints Fraport Logo in the upper right corner @@ -138,10 +138,10 @@ templateLatex :: LetterKind -> Text templateLatex = let tDin5008 = decodeUtf8 $(Data.FileEmbed.embedFile "templates/letter/din5008.latex") - tPinLetter = decodeUtf8 $(Data.FileEmbed.embedFile "templates/letter/din5008with_pin.latex") + tPinLetter = decodeUtf8 $(Data.FileEmbed.embedFile "templates/letter/din5008with_pin.latex") tPlain = decodeUtf8 $(Data.FileEmbed.embedFile "templates/letter/plain_article.latex") in \case - PinLetter -> tPinLetter + PinLetter -> tPinLetter Din5008 -> tDin5008 PlainLogo -> tPlain Plain -> tPlain @@ -179,13 +179,13 @@ data PrintJobIdentification = PrintJobIdentification -- Note: that all letters to the same UUID within 24h are collated in one envelope -- Example: 9ad8de3f-0a7e-ede5-bd8b-6d0ed85c1049-f___a4pin___230322-10___lms-stuvwxyz mkApcIdent :: CryptoUUIDUser -> Char -> LetterKind -> Text -> Text -> Text -mkApcIdent uuid envelope lk tnow apcAck = Text.filter apcAcceptedChars $ Text.intercalate apcIdentSeparator +mkApcIdent uuid envelope lk tnow apcAck = Text.filter apcAcceptedChars $ Text.intercalate apcIdentSeparator [ ensureLength 38 $ tshow (ciphertext uuid) <> Text.cons '-' (Text.singleton envelope) , ensureLength 5 $ paperKind lk , ensureLength 9 tnow , Text.take 32 apcAck -- length of last part may be arbitrary, but more than 32 symbols do not fit into the line ] - where + where ensureLength :: Int -> Text -> Text ensureLength n = Text.take n . Text.justifyLeft n 'x' @@ -193,7 +193,7 @@ formatApcIdentTime :: (HasLocalTime t, MonadHandler m) => t -> m Text formatApcIdentTime = formatTime' "%y%m%d-%H" -- updateApcIdentTime :: UTCTime -> Text -> Text --- updateApcIdentTime now oldapcident = do +-- updateApcIdentTime now oldapcident = do -- tnow <- formatApcIdentTime now -- let (st,en') = Text.splitAt (38 + 3 + 5 + 3) oldapcident -- TODO: ensure that the numbers are correct -- en = Text.drop 9 en' @@ -227,7 +227,7 @@ convertProto _ (IsMeta v) = v convertProto f (IsTime t) = P.toMetaValue $ f t -} -data EncryptPDFfor = NoPassword | PasswordSupervisor | PasswordUnderling +data EncryptPDFfor = NoPassword | PasswordSupervisor | PasswordUnderling deriving (Eq, Show) class MDLetter l where diff --git a/src/Utils/TH.hs b/src/Utils/TH.hs index 394f2ebb1..8f4e26ae0 100644 --- a/src/Utils/TH.hs +++ b/src/Utils/TH.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/test/Database/Fill.hs b/test/Database/Fill.hs index 13bbbcab6..c08ebbb3c 100644 --- a/test/Database/Fill.hs +++ b/test/Database/Fill.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/test/Handler/Utils/SubmissionSpec.hs b/test/Handler/Utils/SubmissionSpec.hs index f1ef2ba5e..59f158ae5 100644 --- a/test/Handler/Utils/SubmissionSpec.hs +++ b/test/Handler/Utils/SubmissionSpec.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/test/Model/TypesSpec.hs b/test/Model/TypesSpec.hs index 4939b4f2f..81d153d36 100644 --- a/test/Model/TypesSpec.hs +++ b/test/Model/TypesSpec.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later diff --git a/test/ModelSpec.hs b/test/ModelSpec.hs index 5d9e3a969..03539cfad 100644 --- a/test/ModelSpec.hs +++ b/test/ModelSpec.hs @@ -1,4 +1,4 @@ --- SPDX-FileCopyrightText: 2022-24 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost +-- SPDX-FileCopyrightText: 2022-2024 Gregor Kleen ,Sarah Vaupel ,Steffen Jost ,Steffen Jost ,Steffen Jost -- -- SPDX-License-Identifier: AGPL-3.0-or-later