Skip to content

Commit b07feae

Browse files
committed
Merge branch 'Release-2024.32' into Release-2024.38
2 parents 0aeac45 + 53c570f commit b07feae

File tree

6 files changed

+171
-5
lines changed

6 files changed

+171
-5
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace DigitalLearningSolutions.Data.Migrations
2+
{
3+
using FluentMigrator;
4+
5+
[Migration(202407221645)]
6+
public class AlterGetCurrentCoursesForCandidate_V3 : Migration
7+
{
8+
public override void Up()
9+
{
10+
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up);
11+
}
12+
public override void Down()
13+
{
14+
Execute.Sql(Properties.Resources.TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down);
15+
}
16+
}
17+
}

DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs

Lines changed: 47 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,4 +406,10 @@
406406
<data name="TD_4223_Alter_GroupCustomisation_Add_V2_Up" type="System.Resources.ResXFileRef, System.Windows.Forms">
407407
<value>..\Scripts\TD-4223-Alter_GroupCustomisation_Add_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16</value>
408408
</data>
409-
</root>
409+
<data name="TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
410+
<value>..\Resources\TD-4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
411+
</data>
412+
<data name="TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up" type="System.Resources.ResXFileRef, System.Windows.Forms">
413+
<value>..\Resources\TD-4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252</value>
414+
</data>
415+
</root>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
/****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/
3+
SET ANSI_NULLS ON
4+
GO
5+
6+
SET QUOTED_IDENTIFIER ON
7+
GO
8+
9+
-- =============================================
10+
-- Author: Kevin Whittaker
11+
-- Create date: 16/12/2016
12+
-- Description: Returns a list of active progress records for the candidate.
13+
-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results.
14+
-- =============================================
15+
ALTER PROCEDURE [dbo].[GetCurrentCoursesForCandidate_V2]
16+
-- Add the parameters for the stored procedure here
17+
@CandidateID int
18+
AS
19+
BEGIN
20+
-- SET NOCOUNT ON added to prevent extra result sets from
21+
-- interfering with SELECT statements.
22+
SET NOCOUNT ON;
23+
24+
-- Insert statements for procedure here
25+
SELECT p.ProgressID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed,
26+
p.FirstSubmittedTime AS StartedDate, p.DiagnosticScore, p.PLLocked, cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(p.CustomisationID, 0)
27+
AS HasDiagnostic, dbo.CheckCustomisationSectionHasLearning(p.CustomisationID, 0) AS HasLearning,
28+
COALESCE
29+
((SELECT COUNT(Passes) AS Passes
30+
FROM (SELECT COUNT(AssessAttemptID) AS Passes
31+
FROM AssessAttempts AS aa
32+
WHERE (CandidateID = p.CandidateID) AND (CustomisationID = p.CustomisationID) AND (Status = 1)
33+
GROUP BY SectionNumber) AS derivedtbl_2), 0) AS Passes,
34+
(SELECT COUNT(SectionID) AS Sections
35+
FROM Sections AS s
36+
WHERE (ApplicationID = cu.ApplicationID)) AS Sections, p.CompleteByDate, CAST(CASE WHEN p.CompleteByDate IS NULL THEN 0 WHEN p.CompleteByDate < getDate()
37+
THEN 2 WHEN p.CompleteByDate < DATEADD(M, + 1, getDate()) THEN 1 ELSE 0 END AS INT) AS OverDue, p.EnrollmentMethodID, dbo.GetCohortGroupCustomisationID(p.ProgressID) AS GroupCustomisationID, p.SupervisorAdminID
38+
39+
FROM Progress AS p INNER JOIN
40+
Customisations AS cu ON p.CustomisationID = cu.CustomisationID INNER JOIN
41+
Applications AS a ON cu.ApplicationID = a.ApplicationID
42+
WHERE (p.Completed IS NULL) AND (p.RemovedDate IS NULL) AND (p.CandidateID = @CandidateID)AND (cu.CustomisationName <> 'ESR') AND (a.ArchivedDate IS NULL) AND(cu.Active = 1) AND
43+
((p.SubmittedTime > DATEADD(M, -6, getDate()) OR (EnrollmentMethodID <> 1)) OR NOT (p.CompleteByDate IS NULL) AND NOT
44+
(p.SubmittedTime < DATEADD(MONTH, -6, GETDATE()) AND (p.EnrollmentMethodID = 1) AND (p.CompleteByDate < GETDATE())))
45+
ORDER BY p.SubmittedTime Desc
46+
END
47+
GO
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
3+
/****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/
4+
SET ANSI_NULLS ON
5+
GO
6+
7+
SET QUOTED_IDENTIFIER ON
8+
GO
9+
10+
-- =============================================
11+
-- Author: Kevin Whittaker
12+
-- Create date: 16/12/2016
13+
-- Description: Returns a list of active progress records for the candidate.
14+
-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results.
15+
-- =============================================
16+
ALTER PROCEDURE [dbo].[GetCurrentCoursesForCandidate_V2]
17+
-- Add the parameters for the stored procedure here
18+
@CandidateID int
19+
AS
20+
BEGIN
21+
-- SET NOCOUNT ON added to prevent extra result sets from
22+
-- interfering with SELECT statements.
23+
SET NOCOUNT ON;
24+
25+
-- Insert statements for procedure here
26+
SELECT p.ProgressID, (CASE WHEN cu.CustomisationName <> '' THEN a.ApplicationName + ' - ' + cu.CustomisationName ELSE a.ApplicationName END) AS CourseName, p.CustomisationID, p.SubmittedTime AS LastAccessed,
27+
p.FirstSubmittedTime AS StartedDate, p.DiagnosticScore, p.PLLocked, cu.IsAssessed, dbo.CheckCustomisationSectionHasDiagnostic(p.CustomisationID, 0)
28+
AS HasDiagnostic, dbo.CheckCustomisationSectionHasLearning(p.CustomisationID, 0) AS HasLearning,
29+
COALESCE
30+
((SELECT COUNT(Passes) AS Passes
31+
FROM (SELECT COUNT(AssessAttemptID) AS Passes
32+
FROM AssessAttempts AS aa
33+
WHERE (CandidateID = p.CandidateID) AND (CustomisationID = p.CustomisationID) AND (Status = 1)
34+
GROUP BY SectionNumber) AS derivedtbl_2), 0) AS Passes,
35+
(SELECT COUNT(SectionID) AS Sections
36+
FROM Sections AS s
37+
WHERE (ApplicationID = cu.ApplicationID)) AS Sections, p.CompleteByDate, CAST(CASE WHEN p.CompleteByDate IS NULL THEN 0 WHEN p.CompleteByDate < getDate()
38+
THEN 2 WHEN p.CompleteByDate < DATEADD(M, + 1, getDate()) THEN 1 ELSE 0 END AS INT) AS OverDue, p.EnrollmentMethodID, dbo.GetCohortGroupCustomisationID(p.ProgressID) AS GroupCustomisationID, p.SupervisorAdminID
39+
40+
FROM Progress AS p INNER JOIN
41+
Customisations AS cu ON p.CustomisationID = cu.CustomisationID INNER JOIN
42+
Applications AS a ON cu.ApplicationID = a.ApplicationID INNER JOIN
43+
CentreApplications AS ca ON ca.ApplicationID = a.ApplicationID AND ca.CentreID = cu.CentreID
44+
WHERE (p.Completed IS NULL) AND (p.RemovedDate IS NULL) AND (p.CandidateID = @CandidateID)AND (cu.CustomisationName <> 'ESR') AND (a.ArchivedDate IS NULL) AND(cu.Active = 1) AND
45+
((p.SubmittedTime > DATEADD(M, -6, getDate()) OR (EnrollmentMethodID <> 1)) OR NOT (p.CompleteByDate IS NULL) AND NOT
46+
(p.SubmittedTime < DATEADD(MONTH, -6, GETDATE()) AND (p.EnrollmentMethodID = 1) AND (p.CompleteByDate < GETDATE())))
47+
ORDER BY p.SubmittedTime Desc
48+
END
49+
GO

DigitalLearningSolutions.Data/DataServices/CentresDataService.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ ORDER BY CentreName"
179179
c.ContactSurname,
180180
c.ContactEmail,
181181
c.ContactTelephone,
182-
c.pwEmail AS CentreEmail,
182+
c.AutoRegisterManagerEmail AS CentreEmail,
183183
c.ShowOnMap,
184184
c.CMSAdministrators AS CmsAdministratorSpots,
185185
c.CMSManagers AS CmsManagerSpots,
@@ -231,7 +231,7 @@ FROM Centres AS c
231231
c.ContactEmail,
232232
c.ContactTelephone,
233233
c.pwTelephone AS CentreTelephone,
234-
c.pwEmail AS CentreEmail,
234+
c.AutoRegisterManagerEmail AS CentreEmail,
235235
c.pwPostCode AS CentrePostcode,
236236
c.ShowOnMap,
237237
c.Long AS Longitude,
@@ -460,7 +460,7 @@ bool showOnMap
460460
CentreName = @centreName,
461461
CentreTypeId = @centreTypeId,
462462
RegionId = @regionId,
463-
pwEmail = @centreEmail,
463+
AutoRegisterManagerEmail = @centreEmail,
464464
IPPrefix = @ipPrefix,
465465
ShowOnMap = @showOnMap
466466
WHERE CentreId = @centreId",
@@ -504,7 +504,7 @@ bool AddITSPcourses
504504
ContactTelephone,
505505
CentreTypeID,
506506
RegionID,
507-
pwEmail,
507+
AutoRegisterManagerEmail,
508508
IPPrefix,
509509
ShowOnMap
510510
)

0 commit comments

Comments
 (0)