From fd6a5384d3517958a3c7726e32eed3bad197a591 Mon Sep 17 00:00:00 2001 From: Steffen Date: Mon, 22 Apr 2024 11:50:13 +0200 Subject: [PATCH] fix(qualification): fix #159 by removing an misleadingly named column for user qualification table The columns QualificationUserLastNotified is misleading, since it only reflects notifications due to actual validity changes. This is necessary for the notification mechanism. In case this column is reinstatiated, a better column name and a proper tooltip was added to the column. --- messages/uniworx/categories/qualification/de-de-formal.msg | 3 ++- messages/uniworx/categories/qualification/en-eu.msg | 3 ++- models/lms.model | 2 +- src/Handler/Qualification.hs | 5 ++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/messages/uniworx/categories/qualification/de-de-formal.msg b/messages/uniworx/categories/qualification/de-de-formal.msg index e0fee7cb8..9c72b28ee 100644 --- a/messages/uniworx/categories/qualification/de-de-formal.msg +++ b/messages/uniworx/categories/qualification/de-de-formal.msg @@ -25,7 +25,8 @@ TableQualificationSapExport: SAP TableQualificationSapExportTooltip: Wird die Qualifikation an das SAP übermittelt? Betrifft nur Benutzer mit Fraport Personalnummer. LmsQualificationValidUntil: Gültig bis TableQualificationLastRefresh: Zuletzt erneuert -TableQualificationLastNotified: Letzte Benachrichtigung +TableQualificationLastNotified: Letzte Benachrichtigung über erfolgte Gültigkeitsänderung +TableQualificationLastNotifiedTooltip: Hier werden ausschließlich Benachrichtigungen berücksichtigt, die über einen bereits erfolgten Ablauf/Entzug/Wiedererteilung informieren. Dies ignoriert insbesondere reguläre Verlängerung, z.B. durch E-Learning. TableQualificationFirstHeld: Erstmalig TableQualificationBlockedDue: Entzug TableQualificationBlockedTooltip: Wann wurde die Qualifikation vorübergehend außer Kraft gesetzt und warum wurde dies veranlasst? diff --git a/messages/uniworx/categories/qualification/en-eu.msg b/messages/uniworx/categories/qualification/en-eu.msg index c886cb843..3779c22a0 100644 --- a/messages/uniworx/categories/qualification/en-eu.msg +++ b/messages/uniworx/categories/qualification/en-eu.msg @@ -25,7 +25,8 @@ TableQualificationSapExport: Sent to SAP TableQualificationSapExportTooltip: Is this qualification transmitted to SAP? Only applies to qualification holder having a Fraport AG personnel number. LmsQualificationValidUntil: Valid until TableQualificationLastRefresh: Last renewed -TableQualificationLastNotified: Last notified +TableQualificationLastNotified: Last notified about validity change +TableQualificationLastNotifiedTooltip: The date of the last notification about any already effective change in validity due to revocation or reissue. This does not entail regular validity extensions, e.g. due to e-learning. TableQualificationFirstHeld: First held TableQualificationBlockedDue: Revocations TableQualificationBlockedTooltip: Why and when was this qualification temporarily suspended? diff --git a/models/lms.model b/models/lms.model index 9e96df730..95a6d8a06 100644 --- a/models/lms.model +++ b/models/lms.model @@ -69,7 +69,7 @@ QualificationUser lastRefresh Day -- lastRefresh > validUntil possible, if Qualification^elearningOnly == False firstHeld Day -- first time the qualification was earned, should never change scheduleRenewal Bool default=true -- if false, no automatic renewal is scheduled and the qualification expires - lastNotified UTCTime default=now() -- last notficiation about being invalid + lastNotified UTCTime default=now() -- last notficiation about actual licence validity changes (does not entail e-learning notifications) -- Reasons and temporary revocations are implemented through QualificationUserBlock -- TODO: adjust SAP interface to transmit end dates UniqueQualificationUser qualification user diff --git a/src/Handler/Qualification.hs b/src/Handler/Qualification.hs index 5b2c315af..35e7560cc 100644 --- a/src/Handler/Qualification.hs +++ b/src/Handler/Qualification.hs @@ -602,7 +602,10 @@ postQualificationR sid qsh = do ) $ \( view $ resultQualUser . _entityVal . _qualificationUserScheduleRenewal -> b) -> ifIconCell (not b) IconNoNotification , sortable (Just "lms-status-plus")(i18nCell MsgTableLmsStatus & cellTooltipWgt Nothing (lmsStatusInfoCell isAdmin auditMonths)) $ \(preview $ resultLmsUser . _entityVal -> lu) -> foldMap (lmsStatusCell isAdmin linkLmsUser) lu - , sortable (Just "last-notified") (i18nCell MsgTableQualificationLastNotified) $ \( view $ resultQualUser . _entityVal . _qualificationUserLastNotified -> d) -> dateTimeCell d + -- QualificationUserLastNotified is about notification on actual validity changes. If a user's licence is about to expire and renewed before expiry via e-learning, this value does not change. + -- NOTE: If this column is reinstatiated, header and tooltip were already updated to avoid any confusion! + -- , sortable (Just "last-notified") (i18nCell MsgTableQualificationLastNotified & cellTooltip MsgTableQualificationLastNotifiedTooltip) + -- $ \( view $ resultQualUser . _entityVal . _qualificationUserLastNotified -> d) -> dateTimeCell d ] psValidator = def & defaultSorting [SortDescBy "last-refresh"] tbl <- mkQualificationTable isAdmin qent acts colChoices psValidator