|
- @if ((Platforms)p.PlatformType == Platforms.iPhone || (Platforms)p.PlatformType == Platforms.iPad)
+ @if ((Platforms)p.PlatformType == Platforms.iOS)
{
iOS
}
@@ -74,4 +74,4 @@
@section Scripts
{
-}
\ No newline at end of file
+}
diff --git a/Workers/Resgrid.Workers.Framework/Logic/CalendarNotifierLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/CalendarNotifierLogic.cs
index dedb509e..1c6a18b0 100644
--- a/Workers/Resgrid.Workers.Framework/Logic/CalendarNotifierLogic.cs
+++ b/Workers/Resgrid.Workers.Framework/Logic/CalendarNotifierLogic.cs
@@ -57,7 +57,7 @@ public async Task> Process(CalendarNotifierQueueItem item)
foreach (var person in item.CalendarItem.Attendees)
{
var profile = profiles.FirstOrDefault(x => x.UserId == person.UserId);
- await _communicationService.SendNotificationAsync(person.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, title, profile);
+ await _communicationService.SendNotificationAsync(person.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, department, title, profile);
}
}
}
@@ -96,7 +96,7 @@ public async Task> Process(CalendarNotifierQueueItem item)
// Notify the entire department
foreach (var profile in profiles)
{
- await _communicationService.SendNotificationAsync(profile.Key, item.CalendarItem.DepartmentId, message, departmentNumber, title, profile.Value);
+ await _communicationService.SendNotificationAsync(profile.Key, item.CalendarItem.DepartmentId, message, departmentNumber, department, title, profile.Value);
}
}
else
@@ -114,9 +114,9 @@ public async Task> Process(CalendarNotifierQueueItem item)
foreach (var member in group.Members)
{
if (profiles.ContainsKey(member.UserId))
- await _communicationService.SendNotificationAsync(member.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, title, profiles[member.UserId]);
+ await _communicationService.SendNotificationAsync(member.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, department, title, profiles[member.UserId]);
else
- await _communicationService.SendNotificationAsync(member.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, title, null);
+ await _communicationService.SendNotificationAsync(member.UserId, item.CalendarItem.DepartmentId, message, departmentNumber, department, title, null);
}
}
}
diff --git a/Workers/Resgrid.Workers.Framework/Logic/NotificationBroadcastLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/NotificationBroadcastLogic.cs
index 672f3fef..fa18bd75 100644
--- a/Workers/Resgrid.Workers.Framework/Logic/NotificationBroadcastLogic.cs
+++ b/Workers/Resgrid.Workers.Framework/Logic/NotificationBroadcastLogic.cs
@@ -70,7 +70,7 @@ public static async Task ProcessNotificationItem(NotificationItem ni, stri
if (!_notificationService.AllowToSendViaSms(notification.Type))
profile.SendNotificationSms = false;
- await _communicationService.SendNotificationAsync(user, notification.DepartmentId, text, queueItem.DepartmentTextNumber, "Notification", profile);
+ await _communicationService.SendNotificationAsync(user, notification.DepartmentId, text, queueItem.DepartmentTextNumber, queueItem.Department, "Notification", profile);
}
}
}
diff --git a/Workers/Resgrid.Workers.Framework/Logic/ShiftNotificationLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/ShiftNotificationLogic.cs
index 9990d4a4..2a5c8a2e 100644
--- a/Workers/Resgrid.Workers.Framework/Logic/ShiftNotificationLogic.cs
+++ b/Workers/Resgrid.Workers.Framework/Logic/ShiftNotificationLogic.cs
@@ -17,6 +17,9 @@ public static async Task ProcessShiftQueueItem(ShiftQueueItem sqi)
var _shiftsService = Bootstrapper.GetKernel().Resolve();
var _communicationService = Bootstrapper.GetKernel().Resolve();
var _userProfileService = Bootstrapper.GetKernel().Resolve();
+ var _departmentService = Bootstrapper.GetKernel().Resolve();
+
+ var department = await _departmentService.GetDepartmentByIdAsync(sqi.DepartmentId, false);
if (sqi.Type == (int)ShiftQueueTypes.TradeRequested)
{
@@ -28,7 +31,7 @@ public static async Task ProcessShiftQueueItem(ShiftQueueItem sqi)
foreach (var user in tradeRequest.Users)
{
UserProfile profile = userProfiles.FirstOrDefault(x => x.UserId == user.UserId);
- await _communicationService.SendNotificationAsync(user.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber,
+ await _communicationService.SendNotificationAsync(user.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber, department,
tradeRequest.SourceShiftSignup.Shift.Name, profile);
}
}
@@ -40,7 +43,7 @@ await _communicationService.SendNotificationAsync(user.UserId, tradeRequest.Sour
var text = _shiftsService.GenerateShiftTradeRejectionText(targetUserProfile, tradeRequest);
- await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber,
+ await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber, department,
tradeRequest.SourceShiftSignup.Shift.Name, sourceUserProfile);
}
else if (sqi.Type == (int)ShiftQueueTypes.TradeProposed && !String.IsNullOrWhiteSpace(sqi.SourceUserId))
@@ -51,7 +54,7 @@ await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, trad
var text = _shiftsService.GenerateShiftTradeProposedText(proposedUserProfile, tradeRequest);
- await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber,
+ await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber, department,
tradeRequest.SourceShiftSignup.Shift.Name, sourceUserProfile);
}
else if (sqi.Type == (int)ShiftQueueTypes.TradeFilled && !String.IsNullOrWhiteSpace(sqi.SourceUserId))
@@ -62,7 +65,7 @@ await _communicationService.SendNotificationAsync(sourceUserProfile.UserId, trad
var text = _shiftsService.GenerateShiftTradeFilledText(sourceUserProfile, tradeRequest);
- await _communicationService.SendNotificationAsync(proposedUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber,
+ await _communicationService.SendNotificationAsync(proposedUserProfile.UserId, tradeRequest.SourceShiftSignup.Shift.DepartmentId, text, sqi.DepartmentNumber, department,
tradeRequest.SourceShiftSignup.Shift.Name, proposedUserProfile);
}
else if (sqi.Type == (int)ShiftQueueTypes.ShiftCreated)
@@ -74,7 +77,7 @@ await _communicationService.SendNotificationAsync(proposedUserProfile.UserId, tr
foreach (var profile in profiles.Select(x => x.Value))
{
- await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, "New Shift", profile);
+ await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, department, "New Shift", profile);
}
}
else if (sqi.Type == (int)ShiftQueueTypes.ShiftUpdated)
@@ -87,9 +90,9 @@ await _communicationService.SendNotificationAsync(proposedUserProfile.UserId, tr
foreach (var profile in shift.Personnel)
{
if (profiles.ContainsKey(profile.UserId))
- await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, shift.Name, profiles[profile.UserId]);
+ await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, department, shift.Name, profiles[profile.UserId]);
else
- await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, shift.Name);
+ await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, department, shift.Name);
}
}
else if (sqi.Type == (int)ShiftQueueTypes.ShiftDaysAdded)
@@ -104,9 +107,9 @@ await _communicationService.SendNotificationAsync(proposedUserProfile.UserId, tr
foreach (var profile in shift.Personnel)
{
if (profiles.ContainsKey(profile.UserId))
- await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, shift.Name, profiles[profile.UserId]);
+ await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, department, shift.Name, profiles[profile.UserId]);
else
- await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, shift.Name);
+ await _communicationService.SendNotificationAsync(profile.UserId, sqi.DepartmentId, text, sqi.DepartmentNumber, department, shift.Name);
}
}
}
diff --git a/Workers/Resgrid.Workers.Framework/Logic/ShiftNotifierLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/ShiftNotifierLogic.cs
index 5f385401..cb57d4df 100644
--- a/Workers/Resgrid.Workers.Framework/Logic/ShiftNotifierLogic.cs
+++ b/Workers/Resgrid.Workers.Framework/Logic/ShiftNotifierLogic.cs
@@ -14,12 +14,14 @@ public class ShiftNotifierLogic
private IShiftsService _shiftsService;
private ICommunicationService _communicationService;
private IDepartmentSettingsService _departmentSettingsService;
+ private IDepartmentsService _departmentsService;
public ShiftNotifierLogic()
{
_shiftsService = Bootstrapper.GetKernel().Resolve();
_communicationService = Bootstrapper.GetKernel().Resolve();
_departmentSettingsService = Bootstrapper.GetKernel().Resolve();
+ _departmentsService = Bootstrapper.GetKernel().Resolve();
}
public async Task> Process(ShiftNotifierQueueItem item)
@@ -31,6 +33,7 @@ public async Task> Process(ShiftNotifierQueueItem item)
{
var text = _shiftsService.GenerateShiftNotificationText(item.Shift);
string departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(item.Shift.DepartmentId);
+ var department = await _departmentsService.GetDepartmentByIdAsync(item.Shift.DepartmentId, false);
if (ConfigHelper.CanTransmit(item.Shift.DepartmentId))
{
@@ -39,7 +42,7 @@ public async Task> Process(ShiftNotifierQueueItem item)
foreach (var person in item.Shift.Personnel)
{
UserProfile profile = item.Profiles.FirstOrDefault(x => x.UserId == person.UserId);
- await _communicationService.SendNotificationAsync(person.UserId, item.Shift.DepartmentId, text, departmentNumber,
+ await _communicationService.SendNotificationAsync(person.UserId, item.Shift.DepartmentId, text, departmentNumber, department,
item.Shift.Name, profile);
}
}
@@ -53,26 +56,26 @@ await _communicationService.SendNotificationAsync(person.UserId, item.Shift.Depa
if (!String.IsNullOrWhiteSpace(signup.Trade.UserId))
{
UserProfile profile = item.Profiles.FirstOrDefault(x => x.UserId == signup.Trade.UserId);
- await _communicationService.SendNotificationAsync(signup.Trade.UserId, item.Shift.DepartmentId, text, departmentNumber,
+ await _communicationService.SendNotificationAsync(signup.Trade.UserId, item.Shift.DepartmentId, text, departmentNumber, department,
item.Shift.Name, profile);
}
else if (signup.GetTradeType() == ShiftTradeTypes.Source)
{
UserProfile profile = item.Profiles.FirstOrDefault(x => x.UserId == signup.Trade.TargetShiftSignup.UserId);
- await _communicationService.SendNotificationAsync(signup.Trade.TargetShiftSignup.UserId, item.Shift.DepartmentId, text, departmentNumber,
+ await _communicationService.SendNotificationAsync(signup.Trade.TargetShiftSignup.UserId, item.Shift.DepartmentId, text, departmentNumber, department,
item.Shift.Name, profile);
}
else if (signup.GetTradeType() == ShiftTradeTypes.Target)
{
UserProfile profile = item.Profiles.FirstOrDefault(x => x.UserId == signup.Trade.SourceShiftSignup.UserId);
- await _communicationService.SendNotificationAsync(signup.Trade.SourceShiftSignup.UserId, item.Shift.DepartmentId, text, departmentNumber,
+ await _communicationService.SendNotificationAsync(signup.Trade.SourceShiftSignup.UserId, item.Shift.DepartmentId, text, departmentNumber, department,
item.Shift.Name, profile);
}
}
else
{
UserProfile profile = item.Profiles.FirstOrDefault(x => x.UserId == signup.UserId);
- await _communicationService.SendNotificationAsync(signup.UserId, item.Shift.DepartmentId, text, departmentNumber,
+ await _communicationService.SendNotificationAsync(signup.UserId, item.Shift.DepartmentId, text, departmentNumber, department,
item.Shift.Name, profile);
}
}
diff --git a/Workers/Resgrid.Workers.Framework/Logic/TrainingNotifierLogic.cs b/Workers/Resgrid.Workers.Framework/Logic/TrainingNotifierLogic.cs
index ef6f9eff..076cd24e 100644
--- a/Workers/Resgrid.Workers.Framework/Logic/TrainingNotifierLogic.cs
+++ b/Workers/Resgrid.Workers.Framework/Logic/TrainingNotifierLogic.cs
@@ -14,6 +14,7 @@ public class TrainingNotifierLogic
private ICommunicationService _communicationService;
private IUserProfileService _userProfileService;
private IDepartmentSettingsService _departmentSettingsService;
+ private IDepartmentsService _departmentsService;
public TrainingNotifierLogic()
{
@@ -21,6 +22,7 @@ public TrainingNotifierLogic()
_communicationService = Bootstrapper.GetKernel().Resolve();
_userProfileService = Bootstrapper.GetKernel().Resolve();
_departmentSettingsService = Bootstrapper.GetKernel().Resolve();
+ _departmentsService = Bootstrapper.GetKernel().Resolve();
}
public async Task> Process(TrainingNotifierQueueItem item)
@@ -34,6 +36,7 @@ public async Task> Process(TrainingNotifierQueueItem item)
var title = String.Empty;
var profiles = await _userProfileService.GetSelectedUserProfilesAsync(item.Training.Users.Select(x => x.UserId).ToList());
var departmentNumber = await _departmentSettingsService.GetTextToCallNumberForDepartmentAsync(item.Training.DepartmentId);
+ var department = await _departmentsService.GetDepartmentByIdAsync(item.Training.DepartmentId, false);
if (ConfigHelper.CanTransmit(item.Training.DepartmentId))
{
@@ -57,7 +60,7 @@ public async Task> Process(TrainingNotifierQueueItem item)
var profile = profiles.FirstOrDefault(x => x.UserId == person.UserId);
if (!item.Training.Notified.HasValue || !person.Complete)
- await _communicationService.SendNotificationAsync(person.UserId, item.Training.DepartmentId, message, departmentNumber, title, profile);
+ await _communicationService.SendNotificationAsync(person.UserId, item.Training.DepartmentId, message, departmentNumber, department, title, profile);
title = "Training Due Notice";
}
|