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
+41 -7
View File
@@ -378,19 +378,44 @@ namespace Disco.BI.Extensions
!j.JobMetaNonWarranty.RepairerLoggedDate.HasValue && !j.JobMetaNonWarranty.RepairerLoggedDate.HasValue &&
!j.JobMetaNonWarranty.RepairerCompletedDate.HasValue; !j.JobMetaNonWarranty.RepairerCompletedDate.HasValue;
} }
public static void OnLogRepair(this Job j, DiscoDataContext Database, string RepairDescription, PluginFeatureManifest RepairProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> RepairProviderProperties) public static void OnLogRepair(this Job j, DiscoDataContext Database, string RepairDescription, List<JobAttachment> SendAttachments, PluginFeatureManifest RepairProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> RepairProviderProperties)
{ {
if (!j.CanLogRepair()) if (!j.CanLogRepair())
throw new InvalidOperationException("Log Repair was Denied"); throw new InvalidOperationException("Log Repair was Denied");
if (string.IsNullOrWhiteSpace(RepairDescription)) PublishJobResult publishJobResult = null;
RepairDescription = j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition);
else
RepairDescription = string.Concat(RepairDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition));
using (RepairProviderFeature RepairProvider = RepairProviderDefinition.CreateInstance<RepairProviderFeature>()) using (RepairProviderFeature RepairProvider = RepairProviderDefinition.CreateInstance<RepairProviderFeature>())
{ {
string providerRef = RepairProvider.SubmitJob(Database, j, Address, TechUser, RepairDescription, RepairProviderProperties); if (SendAttachments != null && SendAttachments.Count > 0)
{
publishJobResult = DiscoServicesJobs.Publish(
Database,
j,
TechUser,
RepairProvider.ProviderId,
null,
RepairDescription,
SendAttachments,
Disco.BI.Extensions.AttachmentExtensions.RepositoryFilename);
if (!publishJobResult.Success)
throw new Exception(string.Format("Disco ICT Online Services failed with the following message: ", publishJobResult.ErrorMessage));
if (string.IsNullOrWhiteSpace(RepairDescription))
RepairDescription = publishJobResult.PublishMessage;
else
RepairDescription = string.Concat(RepairDescription, Environment.NewLine, "___", Environment.NewLine, publishJobResult.PublishMessage);
}
string submitDescription;
if (string.IsNullOrWhiteSpace(RepairDescription))
submitDescription = j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition);
else
submitDescription = string.Concat(RepairDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition));
string providerRef = RepairProvider.SubmitJob(Database, j, Address, TechUser, submitDescription, RepairProviderProperties);
j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now; j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now;
j.JobMetaNonWarranty.RepairerName = RepairProvider.ProviderId; j.JobMetaNonWarranty.RepairerName = RepairProvider.ProviderId;
@@ -406,9 +431,18 @@ namespace Disco.BI.Extensions
JobId = j.Id, JobId = j.Id,
TechUserId = TechUser.UserId, TechUserId = TechUser.UserId,
Timestamp = DateTime.Now, Timestamp = DateTime.Now,
Comments = string.Format("####Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n{3}", RepairProvider.Manifest.Name, Address.Name, providerRef, RepairDescription) Comments = string.Format("####Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", RepairProvider.Manifest.Name, Address.Name, providerRef, RepairDescription)
}; };
Database.JobLogs.Add(jobLog); Database.JobLogs.Add(jobLog);
if (publishJobResult != null)
{
try
{
DiscoServicesJobs.UpdateRecipientReference(Database, j, publishJobResult.Id, publishJobResult.Secret, j.JobMetaNonWarranty.RepairerReference);
}
catch (Exception) { } // Ignore Errors as this is not completely necessary
}
} }
} }
public static void OnLogRepair(this Job j, DiscoDataContext Database, string FaultDescription, string ManualProviderName, string ManualProviderReference, OrganisationAddress Address, User TechUser) public static void OnLogRepair(this Job j, DiscoDataContext Database, string FaultDescription, string ManualProviderName, string ManualProviderReference, OrganisationAddress Address, User TechUser)
+5 -2
View File
@@ -512,6 +512,7 @@ namespace Disco.Web.Controllers
WarrantyProviderId = m.WarrantyProviderId, WarrantyProviderId = m.WarrantyProviderId,
OrganisationAddressId = m.OrganisationAddressId, OrganisationAddressId = m.OrganisationAddressId,
FaultDescription = m.FaultDescription, FaultDescription = m.FaultDescription,
PublishAttachmentIds = m.PublishAttachmentIds,
PublishAttachments = m.PublishAttachments PublishAttachments = m.PublishAttachments
}; };
updatedModel.UpdateModel(Database, false); updatedModel.UpdateModel(Database, false);
@@ -693,7 +694,9 @@ namespace Disco.Web.Controllers
JobId = m.JobId, JobId = m.JobId,
RepairProviderId = m.RepairProviderId, RepairProviderId = m.RepairProviderId,
OrganisationAddressId = m.OrganisationAddressId, OrganisationAddressId = m.OrganisationAddressId,
RepairDescription = m.RepairDescription RepairDescription = m.RepairDescription,
PublishAttachmentIds = m.PublishAttachmentIds,
PublishAttachments = m.PublishAttachments
}; };
updatedModel.UpdateModel(Database, false); updatedModel.UpdateModel(Database, false);
@@ -753,7 +756,7 @@ namespace Disco.Web.Controllers
case "Submit": case "Submit":
try try
{ {
m.Job.OnLogRepair(Database, m.RepairDescription, m.RepairProvider, m.OrganisationAddress, m.TechUser, m.ProviderProperties()); m.Job.OnLogRepair(Database, m.RepairDescription, m.PublishAttachments, m.RepairProvider, m.OrganisationAddress, m.TechUser, m.ProviderProperties());
Database.SaveChanges(); Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId)); return RedirectToAction(MVC.Job.Show(m.JobId));
} }
+19 -6
View File
@@ -18,6 +18,8 @@ namespace Disco.Web.Models.Job
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; } public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
public Disco.Models.BI.Config.OrganisationAddress OrganisationAddress { get; set; } public Disco.Models.BI.Config.OrganisationAddress OrganisationAddress { get; set; }
public List<Disco.Models.Repository.JobAttachment> PublishAttachments { get; set; }
public Disco.Models.Repository.User TechUser { get; set; } public Disco.Models.Repository.User TechUser { get; set; }
[Required] [Required]
@@ -28,6 +30,7 @@ namespace Disco.Web.Models.Job
public string RepairProviderId { get; set; } public string RepairProviderId { get; set; }
[Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)] [Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
public string RepairDescription { get; set; } public string RepairDescription { get; set; }
public List<int> PublishAttachmentIds { get; set; }
[Required] [Required]
public string SubmissionAction { get; set; } public string SubmissionAction { get; set; }
@@ -77,17 +80,17 @@ namespace Disco.Web.Models.Job
try try
{ {
UserService.GetUser(jobUserId, Database, true); UserService.GetUser(jobUserId, Database, true);
} catch (Exception) {} }
catch (Exception) { }
} }
Job = (from j in Database.Jobs.Include("Device.DeviceModel").Include("JobMetaNonWarranty").Include("JobSubTypes") Job = Database.Jobs.Include("Device.DeviceModel").Include("JobMetaWarranty").Include("JobSubTypes").Include("JobAttachments")
where (j.Id == JobId) .Where(j => j.Id == JobId)
select j).FirstOrDefault(); .FirstOrDefault();
if (Job == null) if (Job == null)
{
throw new ArgumentException("Invalid Job Number Specified", "JobId"); throw new ArgumentException("Invalid Job Number Specified", "JobId");
} }
}
// Update TechUser's Details [#12] // Update TechUser's Details [#12]
this.TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true); this.TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true);
@@ -116,6 +119,16 @@ namespace Disco.Web.Models.Job
if (!string.IsNullOrEmpty(RepairDescription)) if (!string.IsNullOrEmpty(RepairDescription))
RepairDescription = RepairDescription.Trim(); RepairDescription = RepairDescription.Trim();
if (PublishAttachmentIds == null)
{
PublishAttachmentIds = new List<int>();
PublishAttachments = new List<Disco.Models.Repository.JobAttachment>();
}
else
{
PublishAttachments = Job.JobAttachments.Where(ja => PublishAttachmentIds.Contains(ja.Id)).ToList();
}
} }
} }
} }
+28
View File
@@ -111,6 +111,34 @@
</tr> </tr>
</table> </table>
</div> </div>
if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0)
{
<div class="form" style="width: 650px; margin-top: 15px;">
<h2>Send Attachments</h2>
<table>
<tr>
<td>
<div id="publishJobAttachments">
@foreach (var ja in Model.Job.JobAttachments)
{
<a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<input type="checkbox" class="select" name="PublishAttachmentIds" value="@ja.Id" @(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null) />
<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>
</td>
</tr>
</table>
</div>
}
if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null) if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null)
{ {
<div id="repairJobProviderProperties"> <div id="repairJobProviderProperties">
+248 -7
View File
@@ -506,6 +506,247 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>
#line 114 "..\..\Views\Job\LogRepair.cshtml" #line 114 "..\..\Views\Job\LogRepair.cshtml"
if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Send Attachments</h2>\r\n <table>\r\n <tr>\r\n " +
" <td>\r\n <div");
WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n");
#line 122 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 122 "..\..\Views\Job\LogRepair.cshtml"
foreach (var ja in Model.Job.JobAttachments)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 5175), Tuple.Create("\"", 5232)
#line 124 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5182), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 5182), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 124 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 124 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteLiteral(" class=\"select\"");
WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 5389), Tuple.Create("\"", 5403)
#line 125 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5397), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default
#line hidden
, 5397), false)
);
WriteLiteral(" ");
#line 125 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null);
#line default
#line hidden
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5524), Tuple.Create("\"", 5544)
#line 126 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5532), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 5532), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 5615), Tuple.Create("\"", 5674)
#line 127 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5621), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 5621), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5741), Tuple.Create("\"", 5761)
#line 128 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5749), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 5749), false)
);
WriteLiteral(">\r\n");
#line 129 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 129 "..\..\Views\Job\LogRepair.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 130 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 130 "..\..\Views\Job\LogRepair.cshtml"
}
else
{
#line default
#line hidden
#line 132 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 132 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 133 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.TechUser.ToStringFriendly());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 133 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Timestamp.ToUnixEpoc());
#line default
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 6197), Tuple.Create("\"", 6235)
#line 133 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 6205), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 6205), false)
);
WriteLiteral(">");
#line 133 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 135 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n </t" +
"able>\r\n </div>\r\n");
#line 141 "..\..\Views\Job\LogRepair.cshtml"
}
if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null) if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null)
{ {
@@ -521,7 +762,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 117 "..\..\Views\Job\LogRepair.cshtml" #line 145 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2)); Write(Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2));
@@ -530,7 +771,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n"); WriteLiteral("\r\n </div>\r\n");
#line 119 "..\..\Views\Job\LogRepair.cshtml" #line 147 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -543,13 +784,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 121 "..\..\Views\Job\LogRepair.cshtml" #line 149 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 121 "..\..\Views\Job\LogRepair.cshtml" #line 149 "..\..\Views\Job\LogRepair.cshtml"
if (Model.IsManualProvider) if (Model.IsManualProvider)
{ {
@@ -567,7 +808,7 @@ WriteLiteral(" value=\"Save Repair Request\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 124 "..\..\Views\Job\LogRepair.cshtml" #line 152 "..\..\Views\Job\LogRepair.cshtml"
} }
else else
{ {
@@ -586,7 +827,7 @@ WriteLiteral(" value=\"Preview Repair Request\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 128 "..\..\Views\Job\LogRepair.cshtml" #line 156 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -595,7 +836,7 @@ WriteLiteral(" />\r\n");
WriteLiteral(" </div>\r\n"); WriteLiteral(" </div>\r\n");
#line 130 "..\..\Views\Job\LogRepair.cshtml" #line 158 "..\..\Views\Job\LogRepair.cshtml"
} }
+59 -17
View File
@@ -16,32 +16,28 @@
<div id="repairJobForm" class="form" style="width: 650px"> <div id="repairJobForm" class="form" style="width: 650px">
<table> <table>
<tr> <tr>
<th> <th>Internal Job Id:
Internal Job Id:
</th> </th>
<td> <td>
@Model.JobId @Model.JobId
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Device Serial Number:
Device Serial Number:
</th> </th>
<td> <td>
@Model.Job.Device.SerialNumber @Model.Job.Device.SerialNumber
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Device Model:
Device Model:
</th> </th>
<td> <td>
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model @Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Technician:
Technician:
</th> </th>
<td> <td>
@Model.TechUser.DisplayName @Model.TechUser.DisplayName
@@ -52,8 +48,7 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 150px"> <th style="width: 150px">Repair Address:
Repair Address:
</th> </th>
<td> <td>
<div id="organisationAddressDetails"> <div id="organisationAddressDetails">
@@ -67,24 +62,21 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Repair Provider:
Repair Provider:
</th> </th>
<td> <td>
@Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3) @Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3)
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Repair Description:
Repair Description:
</th> </th>
<td> <td>
@Model.RepairDescription.ToMultilineString() @Model.RepairDescription.ToMultilineString()
</td> </td>
</tr> </tr>
<tr> <tr>
<th> <th>Disclosed Information
Disclosed Information
</th> </th>
<td> <td>
<div id="repairDisclosedInformation"> <div id="repairDisclosedInformation">
@@ -102,9 +94,59 @@
</div> </div>
</td> </td>
</tr> </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> </table>
</div> </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"> <div class="actionBar">
<input type="submit" class="button" value="Submit Repair Request" /> <input id="submitJob" type="submit" class="button" value="Submit Repair Request" />
</div> </div>
} }
@@ -166,39 +166,37 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\""); WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" + WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " +
"nternal Job Id:\r\n </th>\r\n <td>\r\n"); " </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 23 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 22 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.JobId); Write(Model.JobId);
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" + WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Serial Number:\r\n </th>\r\n " + ">Device Serial Number:\r\n </th>\r\n <td>\r\n");
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 31 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 29 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.SerialNumber); Write(Model.Job.Device.SerialNumber);
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" + WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Model:\r\n </th>\r\n <td" + ">Device Model:\r\n </th>\r\n <td>\r\n");
">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 39 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 36 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer); Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -207,20 +205,19 @@ WriteLiteral(" ");
WriteLiteral(" "); WriteLiteral(" ");
#line 39 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 36 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Model); Write(Model.Job.Device.DeviceModel.Model);
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" + WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Technician:\r\n </th>\r\n <td>\r" + ">Technician:\r\n </th>\r\n <td>\r\n");
"\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 47 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 43 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.DisplayName); Write(Model.TechUser.DisplayName);
@@ -233,7 +230,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: "); WriteLiteral(">\r\n Email Address: ");
#line 49 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 45 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.EmailAddress); Write(Model.TechUser.EmailAddress);
@@ -242,7 +239,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: "); WriteLiteral("<br />\r\n Phone Number: ");
#line 50 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 46 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.PhoneNumber); Write(Model.TechUser.PhoneNumber);
@@ -253,8 +250,8 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" style=\"width: 150px\""); WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">\r\n Repair Address:\r\n </th>\r\n <t" + WriteLiteral(">Repair Address:\r\n </th>\r\n <td>\r\n " +
"d>\r\n <div"); " <div");
WriteLiteral(" id=\"organisationAddressDetails\""); WriteLiteral(" id=\"organisationAddressDetails\"");
@@ -263,7 +260,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 60 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 55 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Name); Write(Model.OrganisationAddress.Name);
@@ -276,7 +273,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>"); WriteLiteral(">\r\n <span>");
#line 62 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 57 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Address); Write(Model.OrganisationAddress.Address);
@@ -285,7 +282,7 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 63 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 58 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb); Write(Model.OrganisationAddress.Suburb);
@@ -294,7 +291,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 63 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 58 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode); Write(Model.OrganisationAddress.Postcode);
@@ -303,7 +300,7 @@ WriteLiteral(", ");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 64 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 59 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.State); Write(Model.OrganisationAddress.State);
@@ -312,20 +309,20 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 64 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 59 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Country); Write(Model.OrganisationAddress.Country);
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n </div>\r\n </div>\r\n " + WriteLiteral("</span>\r\n </div>\r\n </div>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " + " </td>\r\n </tr>\r\n <tr>\r\n <th>Repair Provi" +
" Repair Provider:\r\n </th>\r\n <td>\r\n"); "der:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 68 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Name); Write(Model.RepairProvider.Name);
@@ -334,7 +331,7 @@ WriteLiteral(" ");
WriteLiteral(" ("); WriteLiteral(" (");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 68 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Id); Write(Model.RepairProvider.Id);
@@ -343,41 +340,40 @@ WriteLiteral(" (");
WriteLiteral(") "); WriteLiteral(") ");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 68 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.PluginManifest.Version.ToString(3)); Write(Model.RepairProvider.PluginManifest.Version.ToString(3));
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" + WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Repair Description:\r\n </th>\r\n " + ">Repair Description:\r\n </th>\r\n <td>\r\n");
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 82 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 75 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairDescription.ToMultilineString()); Write(Model.RepairDescription.ToMultilineString());
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" + WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Disclosed Information\r\n </th>\r\n " + ">Disclosed Information\r\n </th>\r\n <td>\r\n " +
" <td>\r\n <div"); " <div");
WriteLiteral(" id=\"repairDisclosedInformation\""); WriteLiteral(" id=\"repairDisclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n"); WriteLiteral(">\r\n <table>\r\n");
#line 92 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 84 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 92 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 84 "..\..\Views\Job\LogRepairDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties) foreach (var dp in Model.DiscloseProperties)
{ {
@@ -387,7 +383,7 @@ WriteLiteral(">\r\n <table>\r\n");
WriteLiteral(" <tr>\r\n <th>"); WriteLiteral(" <tr>\r\n <th>");
#line 95 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 87 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Key); Write(dp.Key);
@@ -397,7 +393,7 @@ WriteLiteral(":\r\n </th>\r\n
" <td>"); " <td>");
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 89 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Value); Write(dp.Value);
@@ -407,14 +403,294 @@ WriteLiteral("\r\n </td>\r\n
"> \r\n"); "> \r\n");
#line 100 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 92 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
#line default #line default
#line hidden #line hidden
WriteLiteral(" </table>\r\n </div>\r\n </t" + WriteLiteral(" </table>\r\n </div>\r\n </t" +
"d>\r\n </tr>\r\n </table>\r\n </div>\r\n"); "d>\r\n </tr>\r\n");
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml"
if (Model.PublishAttachments.Count > 0)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Sending Attachments</th>\r\n " +
" <td>\r\n <div>\r\n <div" +
"");
WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n");
#line 104 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 104 "..\..\Views\Job\LogRepairDisclose.cshtml"
foreach (var ja in Model.PublishAttachments)
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 4117), Tuple.Create("\"", 4131)
#line 106 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4125), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default
#line hidden
, 4125), false)
);
WriteLiteral(" />\r\n");
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 4175), Tuple.Create("\"", 4232)
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4182), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 4182), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4350), Tuple.Create("\"", 4370)
#line 108 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4358), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 4358), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 4449), Tuple.Create("\"", 4508)
#line 109 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4455), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 4455), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4583), Tuple.Create("\"", 4603)
#line 110 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4591), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 4591), false)
);
WriteLiteral(">\r\n");
#line 111 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 111 "..\..\Views\Job\LogRepairDisclose.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 112 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 112 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
else
{
#line default
#line hidden
#line 114 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 114 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.TechUser.ToStringFriendly());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Timestamp.ToUnixEpoc());
#line default
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5079), Tuple.Create("\"", 5117)
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 5087), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 5087), false)
);
WriteLiteral(">");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 117 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </div>\r\n " +
" </td>\r\n </tr>\r\n");
#line 122 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"submitDialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Please Wait\"");
WriteLiteral(">\r\n <h4><i");
WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");
WriteLiteral(" title=\"Please Wait\"");
WriteLiteral("></i>Submitting Repair Request...</h4>\r\n </div>\r\n");
WriteLiteral(@" <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>
");
WriteLiteral(" <div"); WriteLiteral(" <div");
@@ -422,6 +698,8 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n <input"); WriteLiteral(">\r\n <input");
WriteLiteral(" id=\"submitJob\"");
WriteLiteral(" type=\"submit\""); WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\""); WriteLiteral(" class=\"button\"");
@@ -431,7 +709,7 @@ WriteLiteral(" value=\"Submit Repair Request\"");
WriteLiteral(" />\r\n </div>\r\n"); WriteLiteral(" />\r\n </div>\r\n");
#line 110 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 152 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
#line default #line default