@model Disco.Web.Models.Job.ShowModel @using Disco.Models.Services.Jobs; @using Disco.Services.Users.UserFlags; @using Disco.Services.Devices.DeviceFlags; @{ Authorization.Require(Claims.Job.Show); } @if (Model.Job.Device != null) { } @if (Model.Job.User != null) { } @if (Model.Job.Device != null) { } @if (Model.Job.User != null) { }
@if (!Model.Job.ClosedDate.HasValue || Model.Job.ExpectedClosedDate.HasValue) { } @if (Model.Job.ClosedDate.HasValue) { }
Opened: @CommonHelpers.FriendlyDateAndTitleUser(Model.Job.OpenedDate, Model.Job.OpenedTechUser)
Expected: @if (Authorization.Has(Claims.Job.Properties.ExpectedClosedDate)) { @Html.TextBoxFor(m => m.Job.ExpectedClosedDate, "{0:yyyy/MM/dd HH:mm}", new { @class = "small discreet" }) @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader() } else { @CommonHelpers.FriendlyDate(Model.Job.ExpectedClosedDate) }
Closed: @CommonHelpers.FriendlyDateAndTitleUser(Model.Job.ClosedDate, Model.Job.ClosedTechUser)

@Model.Job.JobType.Description

@{ var jobSubTypeFirst = (int)Math.Ceiling((double)(Model.Job.JobSubTypes.Count + 1) / 2); }
    @foreach (var jobSubType in Model.Job.JobSubTypes.Take(jobSubTypeFirst)) {
  • @jobSubType.Description
  • }
    @foreach (var jobSubType in Model.Job.JobSubTypes.Skip(jobSubTypeFirst)) {
  • @jobSubType.Description
  • }
@if (Authorization.Has(Claims.Job.Actions.UpdateSubTypes) && !Model.Job.ClosedDate.HasValue) { Update Sub Types }
@if (Authorization.Has(Claims.Job.Actions.UpdateSubTypes)) {

@Model.Job.JobType.Description

@using (Html.BeginForm(MVC.API.Job.UpdateSubTypes(Model.Job.Id, redirect: true), FormMethod.Post, new { id = "formUpdateJobTypes" })) { @Html.AntiForgeryToken() @CommonHelpers.CheckBoxList("SubTypes", Model.UpdatableJobSubTypes.ToSelectListItems(Model.Job.JobSubTypes.ToList()), 3)
}
}
@if (Authorization.Has(Claims.Job.Actions.GenerateDocuments)) {
@Html.Partial(MVC.Shared.Views._GenerateDocumentControl, Model.GenerateDocumentControlModel)
}

@if (Authorization.Has(Claims.Device.Show)) {@Html.ActionLink(Model.Job.DeviceSerialNumber, MVC.Device.Show(Model.Job.DeviceSerialNumber))} else {@Model.Job.DeviceSerialNumber}

Model Image
@Model.Job.Device.ComputerName
@Html.ActionLink(Model.Job.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Job.Device.DeviceModelId))
@if (Model.Job.Device.DeviceBatch != null) {
@Html.ActionLink(Model.Job.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Job.Device.DeviceBatchId))
} @if (Model.Job.Device.DeviceBatch != null) { if (Model.Job.JobTypeId == JobType.JobTypeIds.HWar) {
DEVICE WARRANTY
Until: @Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToFullDateTime("Unknown")
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.WarrantyDetails)) { Show Details
@(new HtmlString(Model.Job.Device.DeviceBatch.WarrantyDetails))
}
} if (Model.Job.JobTypeId == JobType.JobTypeIds.HNWar) {
INSURANCE
@Model.Job.Device.DeviceBatch.InsuranceSupplier
Until: @Model.Job.Device.DeviceBatch.InsuredUntil.ToFullDateTime("Unknown")
@if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.InsuranceDetails)) { Show Details
@(new HtmlString(Model.Job.Device.DeviceBatch.InsuranceDetails))
}
} } @if (Model.Job.Device.DeviceFlagAssignments.CanShowAny()) {
@foreach (var flag in Model.Job.Device.DeviceFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, DeviceFlagService.GetDeviceFlag(f.DeviceFlagId)))) { if (flag.Item2.permission.CanShow()) { @flag.Item2.flag.Name @if (flag.Item1.Comments != null) {@flag.Item1.Comments.ToHtmlComment()} @CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId) } }
}
@if (Model.Job.DeviceHeld.HasValue) { var canEditLocation = Authorization.Has(Claims.Job.Properties.DeviceHeldLocation);
@if (Model.Job.DeviceReadyForReturn.HasValue) { } @if (Model.Job.DeviceReturnedDate.HasValue) { }
Location: @if (canEditLocation) { switch (Model.LocationMode) { case LocationModes.Unrestricted: case LocationModes.OptionalList: @Html.TextBoxFor(m => m.Job.DeviceHeldLocation, new { @class = "small discreet" }) break; case LocationModes.RestrictedList: List listOptions = new List() { new SelectListItem() { Value = "", Text = "" } }; if (!string.IsNullOrWhiteSpace(Model.Job.DeviceHeldLocation) && !Model.LocationOptions.Any(l => l.Location.Equals(Model.Job.DeviceHeldLocation))) { listOptions.Add(new SelectListItem() { Value = Model.Job.DeviceHeldLocation, Text = string.Format("Custom: {0}", Model.Job.DeviceHeldLocation) }); } listOptions.AddRange(Model.LocationOptions.Select(l => new SelectListItem() { Value = l.Location, Text = (l.References.Count == 0 ? l.Location : (l.References.Count == 1 ? string.Format("{0} [Job {1}]", l.Location, l.References[0].JobId) : string.Format("{0} [{1} jobs]", l.Location, l.References.Count))) })); @Html.DropDownListFor(m => m.Job.DeviceHeldLocation, listOptions, new { @class = "small discreet" }); break; } @AjaxHelpers.AjaxSave() @AjaxHelpers.AjaxLoader() } else if (string.IsNullOrEmpty(Model.Job.DeviceHeldLocation)) { <None/Unknown> } else { @Model.Job.DeviceHeldLocation }
Held Since: @CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceHeld, Model.Job.DeviceHeldTechUser)
Ready: @CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReadyForReturn, Model.Job.DeviceReadyForReturnTechUser)
Returned: @CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReturnedDate, Model.Job.DeviceReturnedTechUser)
@if (canEditLocation) { }
}
@if (Model.HasUserPhoto) {
}

@if (Authorization.Has(Claims.User.Show)) {@Html.ActionLink(Model.Job.User.DisplayName, MVC.User.Show(Model.Job.UserId))} else {@Model.Job.User.DisplayName}

@Model.Job.User.FriendlyId()
@if (Authorization.Has(Claims.User.ShowDetails)) { if (!string.IsNullOrWhiteSpace(Model.Job.User.PhoneNumber)) {} if (!string.IsNullOrWhiteSpace(Model.Job.User.EmailAddress)) {} } @if (Model.Job.User.UserFlagAssignments.CanShowAny()) {
@foreach (var flag in Model.Job.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId)))) { if (flag.Item2.permission.CanShow()) { @flag.Item2.flag.Name @if (flag.Item1.Comments != null) {@flag.Item1.Comments.ToHtmlComment()} @CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId) } }
} @if (Model.Job.WaitingForUserAction.HasValue) {

Awaiting Action

Since: @Model.Job.WaitingForUserAction.ToFullDateTime()
} @if (Model.UserDetails != null && Model.UserDetails.Count(d => !d.Key.EndsWith("&")) > 0) {
@foreach (var detail in Model.UserDetails.Where(d => !d.Key.EndsWith("&"))) {
@detail.Key.TrimEnd('*'): @if (detail.Key.EndsWith("*")) { [reveal] } else { @Html.Partial(MVC.Shared.Views._CustomDetailValueRender, detail) }
}
}
@{ List CanCloseForcedReasons; if (Model.Job.CanCloseForced(out CanCloseForcedReasons)) {

Are you sure?

    @foreach (var reason in CanCloseForcedReasons) {
  • @reason
  • }
@using (Html.BeginForm(MVC.API.Job.ForceClose(Model.Job.Id, null, true))) { @Html.AntiForgeryToken()

Reason:

}
} } @if (Model.Job.CanCloseNormally()) {
@using (Html.BeginForm(MVC.API.Job.Close(Model.Job.Id, true))) { @Html.AntiForgeryToken() }

 Are you sure?

} @if (Model.Job.CanReopen()) {
@using (Html.BeginForm(MVC.API.Job.Reopen(Model.Job.Id, true))) { @Html.AntiForgeryToken() }

 Are you sure?

} @if (Model.Job.CanDelete()) {
@using (Html.BeginForm(MVC.API.Job.Delete(Model.Job.Id, true))) { @Html.AntiForgeryToken() }

 This item will be permanently deleted and cannot be recovered. Are you sure?

} @if (Model.Job.CanAddQueues() && Model.AvailableQueues != null && Model.AvailableQueues.Count > 0) { var priorityValue = JobQueuePriority.Normal.ToString(); var priorityItems = Enum.GetNames(typeof(JobQueuePriority)).Select(i => new SelectListItem() { Text = i, Value = i, Selected = (i == priorityValue) }).ToList(); var slaOptions = Disco.Services.Jobs.JobQueues.JobQueueService.SlaOptions.Select(o => new SelectListItem() { Text = o.Value, Value = o.Key.ToString() }).ToList();
@using (Html.BeginForm(MVC.API.JobQueueJob.AddJob())) { @Html.AntiForgeryToken()
@foreach (var jobQueue in Model.AvailableQueues.OrderBy(jq => jq.Name)) {
@jobQueue.Name
}

Job Priority

@Html.DropDownList("Priority", priorityItems, new { id = "Job_Show_Job_Actions_AddQueue_Priority" })

SLA Target

@Html.DropDownList("SLAExpiresMinutes", slaOptions, new { id = "Job_Show_Job_Actions_AddQueue_SLAExpiresMinutes" })

Tasks/Comment

}
} @if (Model.Job.CanLogWarranty()) { @Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button") } @if (Model.Job.CanWarrantyCompleted()) { using (Html.BeginForm(MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, "Now", true))) { @Html.AntiForgeryToken() } } @if (Model.Job.CanLogInsurance()) { @Html.ActionLinkSmallButton("Lodge Insurance", MVC.Job.LogInsurance(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogInsurance_Button", "alert") } @if (Model.Job.CanLogRepair()) { @Html.ActionLinkSmallButton("Lodge Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button") } @if (Model.Job.CanRepairComplete()) { using (Html.BeginForm(MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, "Now", true))) { @Html.AntiForgeryToken() } } @if (Model.Job.CanConvertHWarToHNWar()) {
@using (Html.BeginForm(MVC.API.Job.ConvertHWarToHNWar(Model.Job.Id, true))) { @Html.AntiForgeryToken() }

 This process is not reversible.
Are you sure?

}
@if (Model.Job.CanDeviceHeld()) { using (Html.BeginForm(MVC.API.Job.DeviceHeld(Model.Job.Id, true))) { @Html.AntiForgeryToken() } } @if (Model.Job.CanDeviceReadyForReturn()) { using (Html.BeginForm(MVC.API.Job.DeviceReadyForReturn(Model.Job.Id, true))) { @Html.AntiForgeryToken() } } @if (Model.Job.CanDeviceReturned()) { using (Html.BeginForm(MVC.API.Job.DeviceReturned(Model.Job.Id, true))) { @Html.AntiForgeryToken() } } @if (Model.Job.CanWaitingForUserAction()) { Awaiting User Action
@using (Html.BeginForm(MVC.API.Job.WaitingForUserAction(Model.Job.Id, null, true))) { @Html.AntiForgeryToken()

Reason:

}
} @if (Model.Job.CanNotWaitingForUserAction()) { User Action Resolved
@using (Html.BeginForm(MVC.API.Job.NotWaitingForUserAction(Model.Job.Id, null, true))) { @Html.AntiForgeryToken()

Resolution:

}
}