Skip to content

Commit 183a279

Browse files
authored
Merge pull request #212 from Resgrid/develop
CU-868dmcr4g Minor bug fixes for inbound text messaging and module names
2 parents 257211f + c0e73bd commit 183a279

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

Core/Resgrid.Localization/Areas/User/Department/Department.en.resx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -439,34 +439,34 @@
439439
<value>Here you can control high level information about every Module in the Resgrid system. New high level module options will be added here. These settings are in the early stages and may not yet propagate to all parts of the Resgrid system. So for example if you Disable the Training module it may appear in a screen deep in another feature. We will be working on in the future to ensure it's consistent.</value>
440440
</data>
441441
<data name="DisabledCalendarLabel" xml:space="preserve">
442-
<value>Disable Calendar</value>
442+
<value>Calendar</value>
443443
</data>
444444
<data name="DisabledInventoryLabel" xml:space="preserve">
445-
<value>Disable Inventory</value>
445+
<value>Inventory</value>
446446
</data>
447447
<data name="DisabledLogsLabel" xml:space="preserve">
448-
<value>Disable Logs</value>
448+
<value>Logs</value>
449449
</data>
450450
<data name="DisabledMaintenanceLabel" xml:space="preserve">
451-
<value>Disable Maintenance</value>
451+
<value>Maintenance</value>
452452
</data>
453453
<data name="DisabledNotesLabel" xml:space="preserve">
454-
<value>Disable Notes</value>
454+
<value>Notes</value>
455455
</data>
456456
<data name="DisabledReportsLabel" xml:space="preserve">
457-
<value>Disable Reports</value>
457+
<value>Reports</value>
458458
</data>
459459
<data name="DisabledTrainingLabel" xml:space="preserve">
460-
<value>Disable Training</value>
460+
<value>Training</value>
461461
</data>
462462
<data name="DisableMappingLabel" xml:space="preserve">
463-
<value>Disable Mapping</value>
463+
<value>Mapping</value>
464464
</data>
465465
<data name="DisableMessagingLabel" xml:space="preserve">
466-
<value>Disable Messaging</value>
466+
<value>Messaging</value>
467467
</data>
468468
<data name="DisableShiftsLabel" xml:space="preserve">
469-
<value>Disable Shifts</value>
469+
<value>Shifts</value>
470470
</data>
471471
<data name="DispatchSettingsModuleHeader" xml:space="preserve">
472472
<value>Department Modules</value>

Web/Resgrid.Web.Services/Controllers/TwilioController.cs

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ public async Task<ActionResult> IncomingMessage([FromQuery] TwilioMessage reques
119119
if (departmentId.HasValue)
120120
{
121121
var department = await _departmentsService.GetDepartmentByIdAsync(departmentId.Value);
122-
var textToCallEnabled = await _departmentSettingsService.GetDepartmentIsTextCallImportEnabledAsync(departmentId.Value);
123-
var textCommandEnabled = await _departmentSettingsService.GetDepartmentIsTextCommandEnabledAsync(departmentId.Value);
122+
//var textToCallEnabled = await _departmentSettingsService.GetDepartmentIsTextCallImportEnabledAsync(departmentId.Value);
123+
//var textCommandEnabled = await _departmentSettingsService.GetDepartmentIsTextCommandEnabledAsync(departmentId.Value);
124124
var dispatchNumbers = await _departmentSettingsService.GetTextToCallSourceNumbersForDepartmentAsync(departmentId.Value);
125125
var authroized = await _limitsService.CanDepartmentProvisionNumberAsync(departmentId.Value);
126126
var customStates = await _customStateService.GetAllActiveCustomStatesForDepartmentAsync(departmentId.Value);
@@ -134,11 +134,7 @@ public async Task<ActionResult> IncomingMessage([FromQuery] TwilioMessage reques
134134
if (!String.IsNullOrWhiteSpace(dispatchNumbers))
135135
isDispatchSource = _numbersService.DoesNumberMatchAnyPattern(dispatchNumbers.Split(Char.Parse(",")).ToList(), textMessage.Msisdn);
136136

137-
// If we don't have dispatchNumbers and Text Command isn't enabled it's a dispatch text
138-
if (!isDispatchSource && !textCommandEnabled)
139-
isDispatchSource = true;
140-
141-
if (isDispatchSource && textToCallEnabled)
137+
if (isDispatchSource)
142138
{
143139
var c = new Call();
144140
c.Notes = textMessage.Text;
@@ -173,7 +169,7 @@ public async Task<ActionResult> IncomingMessage([FromQuery] TwilioMessage reques
173169
messageEvent.Processed = true;
174170
}
175171

176-
if (!isDispatchSource && textCommandEnabled)
172+
if (!isDispatchSource)
177173
{
178174
var profile = await _userProfileService.GetProfileByMobileNumberAsync(textMessage.Msisdn);
179175

@@ -383,7 +379,7 @@ public async Task<ActionResult> IncomingMessage([FromQuery] TwilioMessage reques
383379
}
384380
}
385381
}
386-
else if (textMessage.To == Config.NumberProviderConfig.TwilioResgridNumber) //"17753765253") // Resgrid master text number
382+
else if (textMessage.To == Config.NumberProviderConfig.TwilioResgridNumber) // Resgrid master text number
387383
{
388384
var profile = await _userProfileService.GetProfileByMobileNumberAsync(textMessage.Msisdn);
389385
var payload = _textCommandService.DetermineType(textMessage.Text);
@@ -425,12 +421,6 @@ public async Task<ActionResult> IncomingMessage([FromQuery] TwilioMessage reques
425421
await _numbersService.SaveInboundMessageEventAsync(messageEvent);
426422
}
427423

428-
//Ok();
429-
430-
//var response = new TwilioResponse();
431-
432-
//return Request.CreateResponse(HttpStatusCode.OK, response.Element, new XmlMediaTypeFormatter());
433-
//return Ok(new StringContent(response.ToString(), Encoding.UTF8, "application/xml"));
434424
return new ContentResult
435425
{
436426
Content = response.ToString(),

Web/Resgrid.Web/Areas/User/Controllers/ContactsController.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -849,12 +849,20 @@ public async Task<IActionResult> GetCallsJson(string contactId)
849849
callJson.CallName = call.Name;
850850
callJson.CallNature = call.NatureOfCall;
851851
callJson.LoggedOn = call.LoggedOn.FormatForDepartment(department);
852+
callJson.Priority = call.Priority;
852853

853854
var priority = await _callsService.GetCallPrioritiesByIdAsync(call.Priority, DepartmentId);
854855

855-
callJson.Priority = call.Priority;
856-
callJson.PriorityName = priority.Name;
857-
callJson.PriorityColor = priority.Color;
856+
if (priority != null)
857+
{
858+
callJson.PriorityName = priority.Name;
859+
callJson.PriorityColor = priority.Color;
860+
}
861+
else
862+
{
863+
callJson.PriorityName = "Unknown Priority";
864+
callJson.PriorityColor = "#000000";
865+
}
858866

859867
callsJson.Add(callJson);
860868
}

Web/Resgrid.Web/Areas/User/Controllers/DispatchController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1771,7 +1771,7 @@ public async Task<IActionResult> CallsTypesInRange(string startDate, string endD
17711771

17721772
if (!String.IsNullOrWhiteSpace(startDate) && !String.IsNullOrWhiteSpace(endDate))
17731773
{
1774-
var calls = await _callsService.GetAllCallsByDepartmentDateRangeAsync(DepartmentId, DateTime.Parse(System.Net.WebUtility.UrlDecode((startDate))), DateTime.Parse(System.Net.WebUtility.UrlDecode(endDate)));
1774+
var calls = await _callsService.GetAllCallsByDepartmentDateRangeAsync(DepartmentId, DateTime.Parse(System.Net.WebUtility.UrlDecode((startDate.Replace("&#x202F;", " ")))), DateTime.Parse(System.Net.WebUtility.UrlDecode(endDate.Replace("&#x202F;", " "))));
17751775

17761776
var groupedCalls = calls.GroupBy(x => x.Type);
17771777
foreach (var grouppedCall in groupedCalls)

0 commit comments

Comments
 (0)