Files
Disco/Disco.Web/Views/Job/LogRepairDisclose.cshtml
2025-07-31 16:18:32 +10:00

153 lines
6.1 KiB
Plaintext

@model Disco.Web.Models.Job.LogRepairModel
@{
Authorization.Require(Claims.Job.Actions.LogRepair);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Repair");
}
@using (Html.BeginForm(MVC.Job.LogRepair()))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId)
@Html.HiddenFor(m => m.OrganisationAddressId)
@Html.HiddenFor(m => m.RepairProviderId)
@Html.HiddenFor(m => m.RepairDescription)
@Html.HiddenFor(m => m.ProviderPropertiesJson)
<input type="hidden" name="SubmissionAction" value="Submit" />
<div id="repairJobForm" class="form" style="width: 650px">
<table>
<tr>
<th>Internal Job Id:
</th>
<td>
@Model.JobId
</td>
</tr>
<tr>
<th>Device Serial Number:
</th>
<td>
@Model.Job.Device.SerialNumber
</td>
</tr>
<tr>
<th>Device Model:
</th>
<td>
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
</td>
</tr>
<tr>
<th>Technician:
</th>
<td>
@Model.TechUser.DisplayName
<div class="smallMessage">
Email Address: @Model.TechUser.EmailAddress<br />
Phone Number: @Model.TechUser.PhoneNumber
</div>
</td>
</tr>
<tr>
<th style="width: 150px">Repair Address:
</th>
<td>
<div id="organisationAddressDetails">
@Model.OrganisationAddress.Name
<div class="smallMessage">
<span>@Model.OrganisationAddress.Address</span><br />
<span>@Model.OrganisationAddress.Suburb, @Model.OrganisationAddress.Postcode</span><br />
<span>@Model.OrganisationAddress.State, @Model.OrganisationAddress.Country</span>
</div>
</div>
</td>
</tr>
<tr>
<th>Repair Provider:
</th>
<td>
@Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3)
</td>
</tr>
<tr>
<th>Repair Description:
</th>
<td>
@Model.RepairDescription.ToMultilineString()
</td>
</tr>
<tr>
<th>Disclosed Information
</th>
<td>
<div id="disclosedInformation">
<table>
@foreach (var dp in Model.DiscloseProperties)
{
<tr>
<th>@dp.Key:
</th>
<td>@dp.Value
</td>
</tr>
}
</table>
</div>
</td>
</tr>
@if (Model.PublishAttachments.Count > 0)
{
<tr>
<th>Sending Attachments</th>
<td>
<div>
<div id="publishJobAttachments">
@foreach (var ja in Model.PublishAttachments)
{
<input type="hidden" name="PublishAttachmentIds" value="@ja.Id" />
<a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span>
<span class="comments" title="@ja.Comments">
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ @ja.DocumentTemplate.Description}
else
{ @ja.Comments }}
</span><span class="author">@ja.TechUser.ToStringFriendly()</span><span class="timestamp" data-livestamp="@(ja.Timestamp.ToUnixEpoc())" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFullDateTime()</span>
</a>
}
</div>
</div>
</td>
</tr>
}
</table>
</div>
<div id="submitDialog" class="dialog" title="Please Wait">
<h4><i class="fa fa-lg fa-cog fa-spin" title="Please Wait"></i>Lodging Repair Request...</h4>
</div>
<script>
$(function () {
var dialog = null;
$('#submitJob').closest('form').submit(function () {
if (dialog == null) {
dialog = $('#submitDialog').dialog({
width: 400,
height: 160,
resizable: false,
modal: true,
autoOpen: false
});
}
window.setTimeout(function () {
dialog.dialog('open');
}, 100);
});
});
</script>
<div class="actionBar">
<input id="submitJob" type="submit" class="button" value="Lodge Repair Request" />
</div>
}