@model Disco.Models.Services.Jobs.JobLists.JobTableModel @using Disco.Models.Services.Jobs.JobLists; @{ Html.BundleDeferred("~/ClientScripts/Modules/Disco-DataTableHelpers"); }
@if (Model != null && Model.Items.Count() > 0) { @if (Model.ShowId) { } @if (Model.ShowStatus) { } @if (Model.ShowLastActivityDate) { } @if (Model.ShowDates) { } @if (Model.ShowType) { } @if (Model.ShowDevice) { } @if (Model.ShowUser) { } @if (Model.ShowTechnician) { } @if (Model.ShowLocation) { } @foreach (var item in Model.Items) { string statusSlaClass = null; if (Model.ShowStatus) { var statusItem = (JobTableStatusItemModel)item; if (statusItem.ActiveJobQueues != null) { var slaRemaining = statusItem.ActiveJobQueues.UsersQueueItems(Authorization).SlaPrecentageRemaining(); if (slaRemaining.HasValue && (slaRemaining <= 0)) { statusSlaClass = "statusSlaExpired"; } else if (slaRemaining.HasValue && (slaRemaining < .3)) { statusSlaClass = "statusSlaWarning"; } } } @if (Model.ShowId) {} @if (Model.ShowStatus) { var statusItem = (JobTableStatusItemModel)item; } @if (Model.ShowLastActivityDate) {} @if (Model.ShowDates) {} @if (Model.ShowType) {} @if (Model.ShowDevice) {} @if (Model.ShowUser) {} @if (Model.ShowTechnician) {} @if (Model.ShowLocation) {} }
Ref Status Last Active When Type Device User Technician Location
@if (Authorization.Has(Claims.Job.Show)) {@Html.ActionLink(item.JobId.ToString(), MVC.Job.Show(item.JobId))} else {@item.JobId.ToString()} @item.StatusDescription @if (statusItem.ActiveJobQueues != null) {
@foreach (var jqToken in ((JobTableStatusItemModel)item).ActiveJobQueues.Select(jqj => new Tuple(jqj, Disco.Services.Jobs.JobQueues.JobQueueService.GetQueue(jqj.QueueId)))) { }
}
@CommonHelpers.FriendlyDate(item.LastActivityDate)@if (item.ClosedDate.HasValue) {@CommonHelpers.FriendlyDate(item.ClosedDate.Value)} else {@CommonHelpers.FriendlyDate(item.OpenedDate)}@item.JobTypeId @if (item.DeviceSerialNumber != null) { if (Authorization.Has(Claims.Device.Show)) {@Html.ActionLink(item.DeviceSerialNumber, MVC.Device.Show(item.DeviceSerialNumber), new { Title = item.DeviceModelDescription })} else {@item.DeviceSerialNumber} } else {N/A} @if (item.UserId != null) { if (Authorization.Has(Claims.User.Show)) {@Html.ActionLink(string.Format("{0} ({1})", item.UserDisplayName, item.UserId), MVC.User.Show(item.UserId))} else {@(string.Format("{0} ({1})", item.UserDisplayName, item.UserId))} } else {N/A}@item.OpenedTechUserId@(item.DeviceHeldLocation ?? "Unknown")
if (Model.HideClosedJobs && Model.Items.All(j => j.ClosedDate.HasValue)) {

No open jobs

Show Closed Jobs (@(Model.Items.Count()))
} } else {

No jobs to display

}