diff --git a/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs b/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs new file mode 100644 index 0000000000..da53fa6ded --- /dev/null +++ b/DigitalLearningSolutions.Data.Migrations/202409051645_Alter_GetCompletedCoursesForCandidate_CourseActive.cs @@ -0,0 +1,19 @@ + + +namespace DigitalLearningSolutions.Data.Migrations +{ + using FluentMigrator; + + [Migration(202409051645)] + public class Alter_GetCompletedCoursesForCandidate_CourseActive : Migration + { + public override void Up() + { + Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_UP); + } + public override void Down() + { + Execute.Sql(Properties.Resources.TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN); + } + } +} diff --git a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs index a20af7d334..79d378b42e 100644 --- a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs +++ b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.Designer.cs @@ -2036,22 +2036,22 @@ internal static string TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_down } /// - /// Looks up a localized string similar to - /// - ////****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/ - ///SET ANSI_NULLS ON - ///GO - /// - ///SET QUOTED_IDENTIFIER ON - ///GO - /// - ///-- ============================================= - ///-- Author: Kevin Whittaker - ///-- Create date: 16/12/2016 - ///-- Description: Returns a list of active progress records for the candidate. - ///-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results. - ///-- ============================================= - ///ALTER PROCEDURE [dbo].[Ge [rest of string was truncated]";. + /// Looks up a localized string similar to + /// + ////****** Object: StoredProcedure [dbo].[GetCurrentCoursesForCandidate_V2] Script Date: 22/07/2024 10:11:35 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of active progress records for the candidate. + ///-- Change 18/09/2018: Adds logic to exclude Removed courses from returned results. + ///-- ============================================= + ///ALTER PROC [rest of string was truncated]";. /// internal static string TD_4243_Alter_GetCurrentCoursesForCandidate_V2_proc_up { get { @@ -2193,6 +2193,50 @@ internal static string TD_4436_Alter_uspCreateProgressRecordWithCompleteWithinMo } } + /// + /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 05/09/2024 16:24:49 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of completed courses for the candidate. + ///-- 21/06/2021: Adds Applications.ArchivedDate field to output. + ///-- ============================================= + ///ALTER PROCEDURE [dbo].[GetCompletedCoursesFo [rest of string was truncated]";. + /// + internal static string TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN { + get { + return ResourceManager.GetString("TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetCompletedCoursesForCandidate] Script Date: 05/09/2024 16:24:49 ******/ + ///SET ANSI_NULLS ON + ///GO + /// + ///SET QUOTED_IDENTIFIER ON + ///GO + /// + ///-- ============================================= + ///-- Author: Kevin Whittaker + ///-- Create date: 16/12/2016 + ///-- Description: Returns a list of completed courses for the candidate. + ///-- 21/06/2021: Adds Applications.ArchivedDate field to output. + ///-- ============================================= + ///ALTER PROCEDURE [dbo].[GetCompletedCoursesFo [rest of string was truncated]";. + /// + internal static string TD_4634_Alter_GetCompletedCoursesForCandidate_UP { + get { + return ResourceManager.GetString("TD_4634_Alter_GetCompletedCoursesForCandidate_UP", resourceCulture); + } + } + /// /// Looks up a localized string similar to /****** Object: StoredProcedure [dbo].[GetActiveAvailableCustomisationsForCentreFiltered_V6] Script Date: 29/09/2022 19:11:04 ******/ ///SET ANSI_NULLS ON diff --git a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx index 9cb68a023c..cf95b25f1e 100644 --- a/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx +++ b/DigitalLearningSolutions.Data.Migrations/Properties/Resources.resx @@ -442,4 +442,10 @@ ..\Scripts\TD-4436-Alter_uspCreateProgressRecordWithCompleteWithinMonths_Quiet_V2_Up.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 - + + ..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 + + + ..\Scripts\TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-16 + + \ No newline at end of file diff --git a/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql new file mode 100644 index 0000000000..55b1405eec Binary files /dev/null and b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_DOWN.sql differ diff --git a/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql new file mode 100644 index 0000000000..3e81b198c0 Binary files /dev/null and b/DigitalLearningSolutions.Data.Migrations/Scripts/TD_4634_Alter_GetCompletedCoursesForCandidate_UP.sql differ diff --git a/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs b/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs index 8364077728..5fb3037ba5 100644 --- a/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs +++ b/DigitalLearningSolutions.Data/Models/BaseLearningItem.cs @@ -12,6 +12,7 @@ public abstract class BaseLearningItem : BaseSearchableItem public bool IsSelfAssessment { get; set; } public bool SelfRegister { get; set; } public bool IncludesSignposting { get; set; } + public bool Active { get; set; } public int? CurrentVersion { get; set; } public override string SearchableName { diff --git a/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs b/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs index f5b8337830..838e054765 100644 --- a/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs +++ b/DigitalLearningSolutions.Web/ViewModels/LearningPortal/BaseLearningItemViewModel.cs @@ -14,6 +14,7 @@ protected BaseLearningItemViewModel(BaseLearningItem course) IsSelfAssessment = course.IsSelfAssessment; SelfRegister = course.SelfRegister; IncludesSignposting = course.IncludesSignposting; + Active = course.Active; } public string Name { get; set; } @@ -24,5 +25,6 @@ protected BaseLearningItemViewModel(BaseLearningItem course) public bool IsSelfAssessment { get; } public bool SelfRegister { get; } public bool IncludesSignposting { get; } + public bool Active { get; } } } diff --git a/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml b/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml index 319dd1fa76..bbca9c6251 100644 --- a/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml +++ b/DigitalLearningSolutions.Web/Views/LearningPortal/Completed/CompletedCourseCard/_CompletedCourseCard.cshtml @@ -31,7 +31,7 @@ - @if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0) + @if (Model.ArchivedDate == null && Model.RemovedDate == null && Model.CheckUnpublishedCourse > 0 && Model.Active) {