Skip to content

Commit 5c71d21

Browse files
committed
Merge branch 'DLS-Release-v1.1.1' into UAT
2 parents 5a428b7 + bff182c commit 5c71d21

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

DigitalLearningSolutions.Data/DataServices/FrameworkDataService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ bool zeroBased
130130

131131
int InsertFrameworkCompetency(int competencyId, int? frameworkCompetencyGroupID, int adminId, int frameworkId);
132132

133-
int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify);
133+
int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify, int? centreID);
134134
void AddCustomFlagToFramework(int frameworkId, string flagName, string flagGroup, string flagTagClass);
135135
void UpdateFrameworkCustomFlag(int frameworkId, int id, string flagName, string flagGroup, string flagTagClass);
136136

@@ -751,7 +751,7 @@ FROM FrameworkCollaborators fc
751751
);
752752
}
753753

754-
public int AddCollaboratorToFramework(int frameworkId, string? userEmail, bool canModify)
754+
public int AddCollaboratorToFramework(int frameworkId, string? userEmail, bool canModify, int? centreID)
755755
{
756756
if (userEmail is null || userEmail.Length == 0)
757757
{
@@ -774,8 +774,8 @@ FROM FrameworkCollaborators
774774
}
775775

776776
var adminId = (int?)connection.ExecuteScalar(
777-
@"SELECT AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1",
778-
new { userEmail }
777+
@"SELECT AdminID FROM AdminUsers WHERE Email = @userEmail AND Active = 1 AND CentreID = @centreID",
778+
new { userEmail, centreID }
779779
);
780780
if (adminId is null)
781781
{

DigitalLearningSolutions.Web/Controllers/FrameworksController/Frameworks.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public IActionResult CreateNewFramework(string actionname, int frameworkId = 0)
166166
var sessionNewFramework = multiPageFormService.GetMultiPageFormData<SessionNewFramework>(
167167
MultiPageFormDataFeature.AddNewFramework,
168168
TempData
169-
).GetAwaiter().GetResult();
169+
).GetAwaiter().GetResult();
170170
multiPageFormService.SetMultiPageFormData(sessionNewFramework, MultiPageFormDataFeature.AddNewFramework, TempData);
171171
detailFramework = sessionNewFramework.DetailFramework;
172172
}
@@ -252,7 +252,7 @@ public IActionResult SaveNewFramework(string frameworkname, string actionname)
252252
{
253253
return StatusCode(500);
254254
}
255-
var sessionNewFramework = multiPageFormService.GetMultiPageFormData<SessionNewFramework>(MultiPageFormDataFeature.AddNewFramework, TempData).GetAwaiter().GetResult();
255+
var sessionNewFramework = multiPageFormService.GetMultiPageFormData<SessionNewFramework>(MultiPageFormDataFeature.AddNewFramework, TempData).GetAwaiter().GetResult();
256256
multiPageFormService.SetMultiPageFormData(
257257
sessionNewFramework,
258258
MultiPageFormDataFeature.AddNewFramework,
@@ -641,7 +641,8 @@ public IActionResult AddCollaborators(string actionname, int frameworkId, bool e
641641
[Route("/Frameworks/Collaborators/{actionname}/{frameworkId}/")]
642642
public IActionResult AddCollaborator(string actionname, string userEmail, bool canModify, int frameworkId)
643643
{
644-
var collaboratorId = frameworkService.AddCollaboratorToFramework(frameworkId, userEmail, canModify);
644+
int? centreID = GetCentreId();
645+
var collaboratorId = frameworkService.AddCollaboratorToFramework(frameworkId, userEmail, canModify, centreID);
645646
if (collaboratorId > 0)
646647
{
647648
frameworkNotificationService.SendFrameworkCollaboratorInvite(collaboratorId, GetAdminId());

DigitalLearningSolutions.Web/Services/FrameworkService.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ bool zeroBased
124124

125125
int InsertFrameworkCompetency(int competencyId, int? frameworkCompetencyGroupID, int adminId, int frameworkId);
126126

127-
int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify);
127+
int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify, int? centreID);
128128
void AddCustomFlagToFramework(int frameworkId, string flagName, string flagGroup, string flagTagClass);
129129
void UpdateFrameworkCustomFlag(int frameworkId, int id, string flagName, string flagGroup, string flagTagClass);
130130

@@ -264,9 +264,9 @@ public FrameworkService(IFrameworkDataService frameworkDataService)
264264
this.frameworkDataService = frameworkDataService;
265265
}
266266

267-
public int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify)
267+
public int AddCollaboratorToFramework(int frameworkId, string userEmail, bool canModify, int? centreID)
268268
{
269-
return frameworkDataService.AddCollaboratorToFramework(frameworkId, userEmail, canModify);
269+
return frameworkDataService.AddCollaboratorToFramework(frameworkId, userEmail, canModify, centreID);
270270
}
271271

272272
public void AddCompetencyAssessmentQuestion(int frameworkCompetencyId, int assessmentQuestionId, int adminId)

0 commit comments

Comments
 (0)