Update: Job Publishing - Repair Jobs

Repair jobs can also submit attachments to repairers via Disco ICT
Online Services.
This commit is contained in:
Gary Sharp
2014-07-24 21:27:24 +10:00
parent 7cbed23a74
commit 4d8fec2ced
7 changed files with 721 additions and 82 deletions
+60 -18
View File
@@ -1,7 +1,7 @@
@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), "Log Repair");
}
@using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
@@ -16,32 +16,28 @@
<div id="repairJobForm" class="form" style="width: 650px">
<table>
<tr>
<th>
Internal Job Id:
<th>Internal Job Id:
</th>
<td>
@Model.JobId
</td>
</tr>
<tr>
<th>
Device Serial Number:
<th>Device Serial Number:
</th>
<td>
@Model.Job.Device.SerialNumber
</td>
</tr>
<tr>
<th>
Device Model:
<th>Device Model:
</th>
<td>
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
</td>
</tr>
<tr>
<th>
Technician:
<th>Technician:
</th>
<td>
@Model.TechUser.DisplayName
@@ -52,8 +48,7 @@
</td>
</tr>
<tr>
<th style="width: 150px">
Repair Address:
<th style="width: 150px">Repair Address:
</th>
<td>
<div id="organisationAddressDetails">
@@ -67,24 +62,21 @@
</td>
</tr>
<tr>
<th>
Repair Provider:
<th>Repair Provider:
</th>
<td>
@Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3)
</td>
</tr>
<tr>
<th>
Repair Description:
<th>Repair Description:
</th>
<td>
@Model.RepairDescription.ToMultilineString()
</td>
</tr>
<tr>
<th>
Disclosed Information
<th>Disclosed Information
</th>
<td>
<div id="repairDisclosedInformation">
@@ -102,9 +94,59 @@
</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>Submitting 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 type="submit" class="button" value="Submit Repair Request" />
<input id="submitJob" type="submit" class="button" value="Submit Repair Request" />
</div>
}