chore(company): attempt to debug company column
This commit is contained in:
parent
589617351f
commit
6339e71efd
@ -378,8 +378,8 @@ mkLmsTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
-- lookup all companies
|
-- lookup all companies
|
||||||
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
||||||
cmps <- selectList [] [Asc CompanyId]
|
cmps <- selectList [] [Asc CompanyShorthand]
|
||||||
return $ Map.fromAscList $ fmap (\c -> (entityKey c, entityVal c)) cmps
|
return $ Map.fromList $ fmap (\c -> (entityKey c, entityVal c)) cmps
|
||||||
let
|
let
|
||||||
nowaday = utctDay now
|
nowaday = utctDay now
|
||||||
-- mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
-- mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
||||||
@ -556,7 +556,7 @@ postLmsR sid qsh = do
|
|||||||
let icnSuper = text2markup " " <> icon IconSupervisor
|
let icnSuper = text2markup " " <> icon IconSupervisor
|
||||||
cs = [ (cmpName, cmpSpr)
|
cs = [ (cmpName, cmpSpr)
|
||||||
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
||||||
, let cmpName = maybe cmpId companyName $ Map.lookup cmpId cmpMap
|
, let cmpName = maybe (unCompanyKey cmpId) companyName $ Map.lookup cmpId cmpMap
|
||||||
]
|
]
|
||||||
companies = intercalate (text2markup ", ") $
|
companies = intercalate (text2markup ", ") $
|
||||||
(\(cmpName, cmpSpr) -> text2markup (CI.original cmpName) <> bool mempty icnSuper cmpSpr) <$> cs
|
(\(cmpName, cmpSpr) -> text2markup (CI.original cmpName) <> bool mempty icnSuper cmpSpr) <$> cs
|
||||||
|
|||||||
@ -314,8 +314,8 @@ mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
-- lookup all companies
|
-- lookup all companies
|
||||||
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
||||||
cmps <- selectList [] [Asc CompanyId]
|
cmps <- selectList [] [Asc CompanyShorthand]
|
||||||
return $ Map.fromAscList $ fmap (\c -> (entityKey c, entityVal c)) cmps
|
return $ Map.fromList $ fmap (\c -> (entityKey c, entityVal c)) cmps
|
||||||
let
|
let
|
||||||
nowaday = utctDay now
|
nowaday = utctDay now
|
||||||
mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
||||||
@ -505,7 +505,7 @@ postQualificationR sid qsh = do
|
|||||||
let icnSuper = text2markup " " <> icon IconSupervisor
|
let icnSuper = text2markup " " <> icon IconSupervisor
|
||||||
cs = [ (cmpName, cmpSpr)
|
cs = [ (cmpName, cmpSpr)
|
||||||
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
||||||
, let cmpName = maybe cmpId companyName $ Map.lookup cmpId cmpMap
|
, let cmpName = maybe (unCompanyKey cmpId) companyName $ Map.lookup cmpId cmpMap
|
||||||
]
|
]
|
||||||
companies = intercalate (text2markup ", ") $
|
companies = intercalate (text2markup ", ") $
|
||||||
(\(cmpName, cmpSpr) -> text2markup (CI.original cmpName) <> bool mempty icnSuper cmpSpr) <$> cs
|
(\(cmpName, cmpSpr) -> text2markup (CI.original cmpName) <> bool mempty icnSuper cmpSpr) <$> cs
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user