Skip to content

Commit a540f39

Browse files
authored
Merge pull request #2968 from TechnologyEnhancedLearning/DLS-Release-v1.1.0
DLS release v1.1.0 to DEV
2 parents 2598e17 + d836e4b commit a540f39

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

DigitalLearningSolutions.Data/DataServices/SelfAssessmentDataService/SelfAssessmentSupervisorDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ int delegateUserId
153153
AND (sd.SupervisorAdminID IS NOT NULL) AND (coalesce(sasr.SelfAssessmentReview, 1) = 1)
154154
AND (cas.ID NOT IN (SELECT CandidateAssessmentSupervisorID FROM CandidateAssessmentSupervisorVerifications WHERE Verified IS NULL))
155155
AND au.Active = 1
156-
AND (au.CategoryID = 0 OR CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
156+
AND (au.CategoryID = 0 OR au.CategoryID IN (select CategoryID from SelfAssessments where ID = @selfAssessmentId))
157157
ORDER BY SupervisorName",
158158
new { selfAssessmentId, delegateUserId }
159159
);

DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,7 @@ FROM CandidateAssessmentSupervisors AS cas INNER JOIN
690690
NRPSubGroups AS sg ON sa.NRPSubGroupID = sg.ID LEFT OUTER JOIN
691691
NRPRoles AS r ON sa.NRPRoleID = r.ID
692692
LEFT OUTER JOIN SelfAssessmentSupervisorRoles AS sasr ON cas.SelfAssessmentSupervisorRoleID = sasr.ID
693-
WHERE (ca.ID = @candidateAssessmentId) AND (cas.Removed IS NULL) AND (sd.SupervisorAdminID = @adminId) AND (sa.CategoryID = @adminIdCategoryId)",
693+
WHERE (ca.ID = @candidateAssessmentId) AND (cas.Removed IS NULL) AND (sd.SupervisorAdminID = @adminId) AND (ISNULL(@adminIdCategoryID, 0) = 0 OR sa.CategoryID = @adminIdCategoryId)",
694694
new { candidateAssessmentId, adminId, adminIdCategoryId }
695695
).FirstOrDefault();
696696
}

DigitalLearningSolutions.Web/Controllers/SupervisorController/Supervisor.cs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public IActionResult MyStaffList(
5858
var centreId = GetCentreId();
5959
var supervisorEmail = GetUserEmail();
6060
var loggedInAdminUser = userService.GetAdminUserById(adminId);
61-
var centreRegistrationPrompts = centreRegistrationPromptsService.GetCentreRegistrationPromptsByCentreId(centreId);
61+
var centreRegistrationPrompts = centreRegistrationPromptsService.GetCentreRegistrationPromptsByCentreId(centreId);
6262
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId, loggedInAdminUser.CategoryId);
6363
if (!supervisorDelegateDetails.Any())
6464
{
@@ -343,7 +343,7 @@ public IActionResult AllStaffList()
343343
var loggedInUserId = User.GetUserId();
344344
var loggedInAdminUser = userService.GetAdminUserById(adminId);
345345
var centreCustomPrompts = centreRegistrationPromptsService.GetCentreRegistrationPromptsByCentreId(centreId);
346-
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId,loggedInAdminUser.CategoryId)
346+
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId, loggedInAdminUser.CategoryId)
347347
.Select(supervisor =>
348348
{
349349
return supervisor;
@@ -362,6 +362,7 @@ public IActionResult ReviewDelegateSelfAssessment(int supervisorDelegateId, int
362362
var loggedInAdminUser = userService.GetAdminUserById(adminId);
363363
var superviseDelegate =
364364
supervisorService.GetSupervisorDelegateDetailsById(supervisorDelegateId, GetAdminId(), 0);
365+
if (superviseDelegate == null) return RedirectToAction("StatusCode", "LearningSolutions", new { code = 403 });
365366
var reviewedCompetencies = PopulateCompetencyLevelDescriptors(
366367
selfAssessmentService.GetCandidateAssessmentResultsById(candidateAssessmentId, adminId, selfAssessmentResultId).ToList()
367368
);
@@ -1310,7 +1311,7 @@ public IActionResult ConfirmNominateSupervisor(SupervisorDelegateViewModel super
13101311
supervisorDelegateDetail.DelegateUserID,
13111312
(int)User.GetCentreId()
13121313
);
1313-
supervisorDelegate.SelfAssessmentCategory = supervisorDelegate.SelfAssessmentCategory == 0 ? adminUser.CategoryId.Value : supervisorDelegate.SelfAssessmentCategory;
1314+
supervisorDelegate.SelfAssessmentCategory = supervisorDelegate.SelfAssessmentCategory == 0 ? adminUser.CategoryId.Value : supervisorDelegate.SelfAssessmentCategory;
13141315
var centreName = adminUser.CentreName;
13151316

13161317
var adminRoles = new AdminRoles(false, false, true, false, false, false, false, false);
@@ -1399,7 +1400,7 @@ public IActionResult CompetencySelfAssessmentCertificatesupervisor(int candidate
13991400
{
14001401
return RedirectToAction("StatusCode", "LearningSolutions", new { code = 403 });
14011402
}
1402-
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId.Value,loggedInAdminUser.CategoryId);
1403+
var supervisorDelegateDetails = supervisorService.GetSupervisorDelegateDetailsForAdminId(adminId.Value, loggedInAdminUser.CategoryId);
14031404
var checkSupervisorDelegate = supervisorDelegateDetails.Where(x => x.DelegateUserID == competencymaindata.LearnerId).FirstOrDefault();
14041405
if ((checkSupervisorDelegate == null))
14051406
{

0 commit comments

Comments
 (0)