Skip to content

Commit a764719

Browse files
authored
Merge pull request #2784 from TechnologyEnhancedLearning/Develop/Fix/TD-4590-Choose-Supervisor-sort-order'
TD-4590- Sorted supervisor list, added email address and removed centre name
2 parents f0e2c92 + 8bbc69c commit a764719

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

DigitalLearningSolutions.Data/DataServices/SupervisorDataService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ LEFT JOIN UserCentreDetails ucd
393393
public IEnumerable<SupervisorForEnrolDelegate> GetSupervisorForEnrolDelegate(int CustomisationID, int CentreID)
394394
{
395395
return connection.Query<SupervisorForEnrolDelegate>(
396-
$@"SELECT AdminID, Forename + ' ' + Surname + ' (' + Email +'),' + ' ' + CentreName AS Name, Email FROM AdminUsers AS au
396+
$@"SELECT AdminID, Forename + ' ' + Surname + ' (' + Email +')' AS Name, Email FROM AdminUsers AS au
397397
WHERE (Supervisor = 1) AND (CentreID = @CentreID) AND (CategoryID = 0 OR
398398
CategoryID = (SELECT au.CategoryID FROM Applications AS a INNER JOIN
399399
Customisations AS c ON a.ApplicationID = c.ApplicationID

DigitalLearningSolutions.Data/DataServices/UserDataService/AdminUserDataService.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ public List<AdminUser> GetAdminUsersByCentreId(int centreId)
218218
{
219219
var users = connection.Query<AdminUser>(
220220
@$"{BaseSelectAdminQuery}
221-
WHERE au.Active = 1 AND au.Approved = 1 AND au.CentreId = @centreId",
221+
WHERE au.Active = 1 AND au.Approved = 1 AND au.CentreId = @centreId
222+
ORDER BY au.Forename, au.Surname",
222223
new { centreId }
223224
).ToList();
224225

@@ -227,10 +228,10 @@ public List<AdminUser> GetAdminUsersByCentreId(int centreId)
227228

228229
public int GetNumberOfAdminsAtCentre(int centreId)
229230
{
230-
var count = connection.ExecuteScalar(
231-
@"SELECT COUNT(*) FROM AdminUsers WHERE CentreID = @centreId",
232-
new { centreId }
233-
);
231+
var count = connection.ExecuteScalar(
232+
@"SELECT COUNT(*) FROM AdminUsers WHERE CentreID = @centreId",
233+
new { centreId }
234+
);
234235
return Convert.ToInt32(count);
235236
}
236237

DigitalLearningSolutions.Web/ViewModels/TrackingSystem/Delegates/DelegateProgress/EditSupervisorViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private static IEnumerable<SelectListItem> PopulateSupervisors(
4747
IEnumerable<AdminUser> supervisors
4848
)
4949
{
50-
var supervisorIdNames = supervisors.Select(s => (s.Id, s.FullName));
50+
var supervisorIdNames = supervisors.Select(s => (s.Id, s.FullName + " (" + s.EmailAddress + ")"));
5151
return SelectListHelper.MapOptionsToSelectListItems(
5252
supervisorIdNames,
5353
supervisorId

0 commit comments

Comments
 (0)