Skip to content

Commit 3b92eea

Browse files
committed
TD-4975-Todo items for requested signoffs/confirmation are filtered by admin category
1 parent b269b70 commit 3b92eea

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,11 @@ public IEnumerable<SupervisorDashboardToDoItem> GetSupervisorDashboardToDoItemsF
540540
SelfAssessments AS sa ON ca.SelfAssessmentID = sa.ID INNER JOIN
541541
SupervisorDelegates AS sd ON cas.SupervisorDelegateId = sd.ID INNER JOIN
542542
CandidateAssessmentSupervisorVerifications AS casv ON cas.ID = casv.CandidateAssessmentSupervisorID INNER JOIN
543-
Users AS u ON ca.DelegateUserID = u.ID
544-
WHERE (sd.SupervisorAdminID = @adminId) AND (casv.Verified IS NULL) AND (cas.Removed IS NULL) AND (sd.Removed IS NULL)", new { adminId }
543+
Users AS u ON ca.DelegateUserID = u.ID INNER JOIN
544+
AdminAccounts As aa ON sd.SupervisorAdminID = aa.ID
545+
WHERE (sd.SupervisorAdminID = @adminId) AND (casv.Verified IS NULL) AND (cas.Removed IS NULL)
546+
AND (sd.Removed IS NULL)
547+
AND (aa.CategoryID is null or sa.CategoryID = aa.CategoryID)", new { adminId }
545548
);
546549
}
547550
public IEnumerable<SupervisorDashboardToDoItem> GetSupervisorDashboardToDoItemsForRequestedReviews(int adminId)
@@ -559,8 +562,10 @@ public IEnumerable<SupervisorDashboardToDoItem> GetSupervisorDashboardToDoItemsF
559562
SELECT TOP 1 sar2.DateTime
560563
FROM SelfAssessmentResults AS sar2
561564
WHERE sar2.ID = sar.ID AND sar2.SelfAssessmentID = sar.SelfAssessmentID AND sar2.CompetencyID = co.ID AND sar2.Result != 0 ORDER BY sar2.ID DESC
562-
)
565+
) INNER JOIN
566+
AdminAccounts AS aa ON sd.SupervisorAdminID = aa.ID
563567
WHERE (sd.SupervisorAdminID = @adminId) AND (cas.Removed IS NULL) AND (sasv.Verified IS NULL) AND (sd.Removed IS NULL)
568+
AND (aa.CategoryID is null or sa.CategoryID = aa.CategoryID)
564569
GROUP BY sa.ID, ca.ID, sd.ID, u.FirstName, u.LastName, sa.Name,cast(sasv.Requested as date)", new { adminId }
565570
);
566571
}

0 commit comments

Comments
 (0)