feature: lodge insurance

This commit is contained in:
Gary Sharp
2024-09-25 16:21:51 +10:00
parent 78b7b059ea
commit e0d620bf67
61 changed files with 5861 additions and 1808 deletions
+7
View File
@@ -179,6 +179,10 @@
<Compile Include="Migrations\202401130531317_DBv23.Designer.cs"> <Compile Include="Migrations\202401130531317_DBv23.Designer.cs">
<DependentUpon>202401130531317_DBv23.cs</DependentUpon> <DependentUpon>202401130531317_DBv23.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="Migrations\202403030134280_DBv24.cs" />
<Compile Include="Migrations\202403030134280_DBv24.Designer.cs">
<DependentUpon>202403030134280_DBv24.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" /> <Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" /> <Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
@@ -263,6 +267,9 @@
<EmbeddedResource Include="Migrations\202401130531317_DBv23.resx"> <EmbeddedResource Include="Migrations\202401130531317_DBv23.resx">
<DependentUpon>202401130531317_DBv23.cs</DependentUpon> <DependentUpon>202401130531317_DBv23.cs</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Migrations\202403030134280_DBv24.resx">
<DependentUpon>202403030134280_DBv24.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx"> <EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator> <Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+27
View File
@@ -0,0 +1,27 @@
// <auto-generated />
namespace Disco.Data.Migrations
{
using System.Data.Entity.Migrations;
using System.Data.Entity.Migrations.Infrastructure;
using System.Resources;
public sealed partial class DBv24 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv24));
string IMigrationMetadata.Id
{
get { return "202403030134280_DBv24"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,20 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv24 : DbMigration
{
public override void Up()
{
AddColumn("dbo.JobMetaInsurances", "Insurer", c => c.String(maxLength: 200));
AddColumn("dbo.JobMetaInsurances", "InsurerReference", c => c.String(maxLength: 200));
}
public override void Down()
{
DropColumn("dbo.JobMetaInsurances", "InsurerReference");
DropColumn("dbo.JobMetaInsurances", "Insurer");
}
}
}
File diff suppressed because one or more lines are too long
@@ -1,7 +1,4 @@
using System; using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
@@ -58,6 +55,10 @@ namespace Disco.Models.Repository
[DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd hh:mm tt}", HtmlEncode = false)] [DisplayFormat(ApplyFormatInEditMode = true, ConvertEmptyStringToNull = true, DataFormatString = "{0:yyyy/MM/dd hh:mm tt}", HtmlEncode = false)]
public DateTime? ClaimFormSentDate { get; set; } public DateTime? ClaimFormSentDate { get; set; }
public string ClaimFormSentUserId { get; set; } public string ClaimFormSentUserId { get; set; }
[StringLength(200)]
public string Insurer { get; set; }
[StringLength(200)]
public string InsurerReference { get; set; }
[Required, ForeignKey("JobId")] [Required, ForeignKey("JobId")]
public virtual Job Job { get; set; } public virtual Job Job { get; set; }
@@ -19,6 +19,10 @@ namespace Disco.Models.Services.Users.Contact
User = user; User = user;
ContactType = contactType; ContactType = contactType;
Source = source; Source = source;
if (name != null && name.IndexOf(',') >= 0)
name = name.Replace(',', ' ');
Name = name; Name = name;
} }
+10 -2
View File
@@ -109,6 +109,7 @@ namespace Disco.Services.Authorization
{ "Job.Actions.Delete", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.Delete, (c, v) => c.Job.Actions.Delete = v, "Delete Jobs", "Can delete jobs", false) }, { "Job.Actions.Delete", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.Delete, (c, v) => c.Job.Actions.Delete = v, "Delete Jobs", "Can delete jobs", false) },
{ "Job.Actions.ForceClose", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.ForceClose, (c, v) => c.Job.Actions.ForceClose = v, "Force Close Jobs", "Can force close jobs", false) }, { "Job.Actions.ForceClose", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.ForceClose, (c, v) => c.Job.Actions.ForceClose = v, "Force Close Jobs", "Can force close jobs", false) },
{ "Job.Actions.GenerateDocuments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.GenerateDocuments, (c, v) => c.Job.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for jobs", false) }, { "Job.Actions.GenerateDocuments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.GenerateDocuments, (c, v) => c.Job.Actions.GenerateDocuments = v, "Generate Documents", "Can generate documents for jobs", false) },
{ "Job.Actions.LogInsurance", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.LogInsurance, (c, v) => c.Job.Actions.LogInsurance = v, "Log Insurance", "Can log insurance for non-warranty jobs", false) },
{ "Job.Actions.LogRepair", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.LogRepair, (c, v) => c.Job.Actions.LogRepair = v, "Log Repair", "Can log repair for non-warranty jobs", false) }, { "Job.Actions.LogRepair", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.LogRepair, (c, v) => c.Job.Actions.LogRepair = v, "Log Repair", "Can log repair for non-warranty jobs", false) },
{ "Job.Actions.LogWarranty", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.LogWarranty, (c, v) => c.Job.Actions.LogWarranty = v, "Log Warranty", "Can log warranty for jobs", false) }, { "Job.Actions.LogWarranty", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.LogWarranty, (c, v) => c.Job.Actions.LogWarranty = v, "Log Warranty", "Can log warranty for jobs", false) },
{ "Job.Actions.RemoveAnyAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.RemoveAnyAttachments, (c, v) => c.Job.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from jobs", false) }, { "Job.Actions.RemoveAnyAttachments", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Actions.RemoveAnyAttachments, (c, v) => c.Job.Actions.RemoveAnyAttachments = v, "Remove Any Attachments", "Can remove any attachments from jobs", false) },
@@ -133,7 +134,7 @@ namespace Disco.Services.Authorization
{ "Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent = v, "Insurance Claim Form Sent Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent = v, "Insurance Claim Form Sent Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.InsuranceDetails", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceDetails, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceDetails = v, "Insurance Detail Properties", "Can update insurance detail properties", false) }, { "Job.Properties.NonWarrantyProperties.InsuranceDetails", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InsuranceDetails, (c, v) => c.Job.Properties.NonWarrantyProperties.InsuranceDetails = v, "Insurance Detail Properties", "Can update insurance detail properties", false) },
{ "Job.Properties.NonWarrantyProperties.InvoiceReceived", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InvoiceReceived, (c, v) => c.Job.Properties.NonWarrantyProperties.InvoiceReceived = v, "Invoice Received Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.InvoiceReceived", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.InvoiceReceived, (c, v) => c.Job.Properties.NonWarrantyProperties.InvoiceReceived = v, "Invoice Received Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.IsInsuranceClaim", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim, (c, v) => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim = v, "Is Insurance Claim Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.IsInsuranceClaim", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim, (c, v) => c.Job.Properties.NonWarrantyProperties.IsInsuranceClaim = v, "Is Insurance Claim Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.PurchaseOrderRaised", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = v, "Purchase Order Raised Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderRaised", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = v, "Purchase Order Raised Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.PurchaseOrderReference", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = v, "Purchase Order Reference Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderReference", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = v, "Purchase Order Reference Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.PurchaseOrderSent", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = v, "Purchase Order Sent Property", "Can update property", false) }, { "Job.Properties.NonWarrantyProperties.PurchaseOrderSent", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent, (c, v) => c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = v, "Purchase Order Sent Property", "Can update property", false) },
@@ -337,6 +338,7 @@ namespace Disco.Services.Authorization
new ClaimNavigatorItem("Job.Actions.Delete", false), new ClaimNavigatorItem("Job.Actions.Delete", false),
new ClaimNavigatorItem("Job.Actions.ForceClose", false), new ClaimNavigatorItem("Job.Actions.ForceClose", false),
new ClaimNavigatorItem("Job.Actions.GenerateDocuments", false), new ClaimNavigatorItem("Job.Actions.GenerateDocuments", false),
new ClaimNavigatorItem("Job.Actions.LogInsurance", false),
new ClaimNavigatorItem("Job.Actions.LogRepair", false), new ClaimNavigatorItem("Job.Actions.LogRepair", false),
new ClaimNavigatorItem("Job.Actions.LogWarranty", false), new ClaimNavigatorItem("Job.Actions.LogWarranty", false),
new ClaimNavigatorItem("Job.Actions.RemoveAnyAttachments", false), new ClaimNavigatorItem("Job.Actions.RemoveAnyAttachments", false),
@@ -647,6 +649,7 @@ namespace Disco.Services.Authorization
c.Job.Actions.Delete = true; c.Job.Actions.Delete = true;
c.Job.Actions.ForceClose = true; c.Job.Actions.ForceClose = true;
c.Job.Actions.GenerateDocuments = true; c.Job.Actions.GenerateDocuments = true;
c.Job.Actions.LogInsurance = true;
c.Job.Actions.LogRepair = true; c.Job.Actions.LogRepair = true;
c.Job.Actions.LogWarranty = true; c.Job.Actions.LogWarranty = true;
c.Job.Actions.RemoveAnyAttachments = true; c.Job.Actions.RemoveAnyAttachments = true;
@@ -1341,6 +1344,11 @@ namespace Disco.Services.Authorization
/// </summary> /// </summary>
public const string GenerateDocuments = "Job.Actions.GenerateDocuments"; public const string GenerateDocuments = "Job.Actions.GenerateDocuments";
/// <summary>Log Insurance
/// <para>Can log insurance for non-warranty jobs</para>
/// </summary>
public const string LogInsurance = "Job.Actions.LogInsurance";
/// <summary>Log Repair /// <summary>Log Repair
/// <para>Can log repair for non-warranty jobs</para> /// <para>Can log repair for non-warranty jobs</para>
/// </summary> /// </summary>
@@ -1481,7 +1489,7 @@ namespace Disco.Services.Authorization
/// </summary> /// </summary>
public const string InvoiceReceived = "Job.Properties.NonWarrantyProperties.InvoiceReceived"; public const string InvoiceReceived = "Job.Properties.NonWarrantyProperties.InvoiceReceived";
/// <summary>Is Insurance Claim Property /// <summary>Is Insurance Claim Property
/// <para>Can update property</para> /// <para>Can update property</para>
/// </summary> /// </summary>
public const string IsInsuranceClaim = "Job.Properties.NonWarrantyProperties.IsInsuranceClaim"; public const string IsInsuranceClaim = "Job.Properties.NonWarrantyProperties.IsInsuranceClaim";
@@ -23,10 +23,12 @@
[ClaimDetails("Remove from Any Queues", "Can remove from any job queues")] [ClaimDetails("Remove from Any Queues", "Can remove from any job queues")]
public bool RemoveAnyQueues { get; set; } public bool RemoveAnyQueues { get; set; }
[ClaimDetails("Log Warranty", "Can log warranty for jobs")] [ClaimDetails("Lodge Warranty", "Can lodge warranty for jobs")]
public bool LogWarranty { get; set; } public bool LogWarranty { get; set; }
[ClaimDetails("Log Repair", "Can log repair for non-warranty jobs")] [ClaimDetails("Lodge Repair", "Can lodge repair for non-warranty jobs")]
public bool LogRepair { get; set; } public bool LogRepair { get; set; }
[ClaimDetails("Lodge Insurance", "Can lodge insurance for non-warranty jobs")]
public bool LogInsurance { get; set; }
[ClaimDetails("Convert HWar Jobs To HNWar", "Can convert warranty jobs to non-warranty jobs")] [ClaimDetails("Convert HWar Jobs To HNWar", "Can convert warranty jobs to non-warranty jobs")]
public bool ConvertHWarToHNWar { get; set; } public bool ConvertHWarToHNWar { get; set; }
@@ -8,7 +8,7 @@
[ClaimDetails("Edit Components", "Can edit and remove job components")] [ClaimDetails("Edit Components", "Can edit and remove job components")]
public bool EditComponents { get; set; } public bool EditComponents { get; set; }
[ClaimDetails("Is Insurance Claim Property", "Can update property")] [ClaimDetails("Is Insurance Claim Property", "Can update property")]
public bool IsInsuranceClaim { get; set; } public bool IsInsuranceClaim { get; set; }
[ClaimDetails("Insurance Claim Form Sent Property", "Can update property")] [ClaimDetails("Insurance Claim Form Sent Property", "Can update property")]
+6
View File
@@ -324,6 +324,7 @@
<Compile Include="Expressions\ExpressionTypeMemberDescriptor.cs" /> <Compile Include="Expressions\ExpressionTypeMemberDescriptor.cs" />
<Compile Include="Expressions\Extensions\DataExt.cs" /> <Compile Include="Expressions\Extensions\DataExt.cs" />
<Compile Include="Expressions\Extensions\DeviceExt.cs" /> <Compile Include="Expressions\Extensions\DeviceExt.cs" />
<Compile Include="Expressions\Extensions\EmailExt.cs" />
<Compile Include="Expressions\Extensions\ImageExt.cs" /> <Compile Include="Expressions\Extensions\ImageExt.cs" />
<Compile Include="Expressions\Extensions\ImageResultImplementations\BaseImageExpressionResult.cs" /> <Compile Include="Expressions\Extensions\ImageResultImplementations\BaseImageExpressionResult.cs" />
<Compile Include="Expressions\Extensions\ImageResultImplementations\BitmapImageExpressionResult.cs" /> <Compile Include="Expressions\Extensions\ImageResultImplementations\BitmapImageExpressionResult.cs" />
@@ -412,6 +413,10 @@
<Compile Include="Plugins\Features\DetailsProvider\DetailsProviderService.cs" /> <Compile Include="Plugins\Features\DetailsProvider\DetailsProviderService.cs" />
<Compile Include="Plugins\Features\DetailsProvider\UserContactFeature.cs" /> <Compile Include="Plugins\Features\DetailsProvider\UserContactFeature.cs" />
<Compile Include="Plugins\Features\DocumentHandlerProvider\DocumentHandlerProviderFeature.cs" /> <Compile Include="Plugins\Features\DocumentHandlerProvider\DocumentHandlerProviderFeature.cs" />
<Compile Include="Plugins\Features\InsuranceProvider\InsuranceProviderFeature.cs" />
<Compile Include="Plugins\Features\InsuranceProvider\InsuranceProviderSubmitJobException.cs" />
<Compile Include="Plugins\Features\RepairProvider\RepairProvider2Feature.cs" />
<Compile Include="Plugins\Features\WarrantyProvider\WarrantyProvider2Feature.cs" />
<Compile Include="Plugins\Features\WirelessProfileProvider\ProvisionWirelessProfilesResult.cs" /> <Compile Include="Plugins\Features\WirelessProfileProvider\ProvisionWirelessProfilesResult.cs" />
<Compile Include="Plugins\Features\WirelessProfileProvider\WirelessProfile.cs" /> <Compile Include="Plugins\Features\WirelessProfileProvider\WirelessProfile.cs" />
<Compile Include="Plugins\Features\WirelessProfileProvider\WirelessProfileTransformation.cs" /> <Compile Include="Plugins\Features\WirelessProfileProvider\WirelessProfileTransformation.cs" />
@@ -540,6 +545,7 @@
<LastGenOutput>Resources.Designer.cs</LastGenOutput> <LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource> </EmbeddedResource>
</ItemGroup> </ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup> <PropertyGroup>
<PostBuildEvent> <PostBuildEvent>
+97 -17
View File
@@ -4,6 +4,7 @@ using Disco.Models.Repository;
using Disco.Services.Authorization; using Disco.Services.Authorization;
using Disco.Services.Logging; using Disco.Services.Logging;
using Disco.Services.Plugins; using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.InsuranceProvider;
using Disco.Services.Plugins.Features.RepairProvider; using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Plugins.Features.WarrantyProvider; using Disco.Services.Plugins.Features.WarrantyProvider;
using Disco.Services.Users; using Disco.Services.Users;
@@ -63,7 +64,6 @@ namespace Disco.Services
return (!j.ClosedDate.HasValue) && j.DeviceHeld.HasValue && return (!j.ClosedDate.HasValue) && j.DeviceHeld.HasValue &&
!j.DeviceReadyForReturn.HasValue && !j.DeviceReturnedDate.HasValue; !j.DeviceReadyForReturn.HasValue && !j.DeviceReturnedDate.HasValue;
} }
public static void OnDeviceReadyForReturn(this Job j, User Technician)
public static void OnDeviceReadyForReturn(this Job j, DiscoDataContext Database, User Technician) public static void OnDeviceReadyForReturn(this Job j, DiscoDataContext Database, User Technician)
{ {
if (!j.CanDeviceReadyForReturn()) if (!j.CanDeviceReadyForReturn())
@@ -182,19 +182,21 @@ namespace Disco.Services
public static void OnLogWarranty(this Job j, DiscoDataContext Database, string FaultDescription, List<JobAttachment> SendAttachments, PluginFeatureManifest WarrantyProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> WarrantyProviderProperties) public static void OnLogWarranty(this Job j, DiscoDataContext Database, string FaultDescription, List<JobAttachment> SendAttachments, PluginFeatureManifest WarrantyProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> WarrantyProviderProperties)
{ {
if (!j.CanLogWarranty()) if (!j.CanLogWarranty())
throw new InvalidOperationException("Log Warranty was Denied"); throw new InvalidOperationException("Lodge Warranty was Denied");
PublishJobResult publishJobResult = null; PublishJobResult publishJobResult = null;
using (WarrantyProviderFeature WarrantyProvider = WarrantyProviderDefinition.CreateInstance<WarrantyProviderFeature>()) using (WarrantyProviderFeature warrantyProvider = WarrantyProviderDefinition.CreateInstance<WarrantyProviderFeature>())
{ {
if (SendAttachments != null && SendAttachments.Count > 0) var warrantyProvider2 = warrantyProvider as WarrantyProvider2Feature;
if (warrantyProvider2 == null && SendAttachments != null && SendAttachments.Count > 0)
{ {
publishJobResult = DiscoServicesJobs.Publish( publishJobResult = DiscoServicesJobs.Publish(
Database, Database,
j, j,
TechUser, TechUser,
WarrantyProvider.WarrantyProviderId, warrantyProvider.WarrantyProviderId,
null, null,
FaultDescription, FaultDescription,
SendAttachments, SendAttachments,
@@ -216,10 +218,14 @@ namespace Disco.Services
else else
submitDescription = string.Concat(FaultDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, WarrantyProviderDefinition)); submitDescription = string.Concat(FaultDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, WarrantyProviderDefinition));
string providerRef = WarrantyProvider.SubmitJob(Database, j, Address, TechUser, submitDescription, WarrantyProviderProperties); string providerRef;
if (warrantyProvider2 != null)
providerRef = warrantyProvider2.SubmitJob(Database, j, Address, TechUser, FaultDescription, SendAttachments, WarrantyProviderProperties);
else
providerRef = warrantyProvider.SubmitJob(Database, j, Address, TechUser, submitDescription, WarrantyProviderProperties);
j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now; j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now;
j.JobMetaWarranty.ExternalName = WarrantyProvider.WarrantyProviderId; j.JobMetaWarranty.ExternalName = warrantyProvider.WarrantyProviderId;
if (providerRef != null && providerRef.Length > 100) if (providerRef != null && providerRef.Length > 100)
j.JobMetaWarranty.ExternalReference = providerRef.Substring(0, 100); j.JobMetaWarranty.ExternalReference = providerRef.Substring(0, 100);
@@ -232,7 +238,7 @@ namespace Disco.Services
JobId = j.Id, JobId = j.Id,
TechUserId = TechUser.UserId, TechUserId = TechUser.UserId,
Timestamp = DateTime.Now, Timestamp = DateTime.Now,
Comments = string.Format("# Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", WarrantyProvider.Manifest.Name, Address.Name, providerRef, FaultDescription) Comments = string.Format("# Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n```{3}```", warrantyProvider.Manifest.Name, Address.Name, providerRef, FaultDescription)
}; };
Database.JobLogs.Add(jobLog); Database.JobLogs.Add(jobLog);
@@ -249,7 +255,7 @@ namespace Disco.Services
public static void OnLogWarranty(this Job j, DiscoDataContext Database, string FaultDescription, string ManualProviderName, string ManualProviderReference, OrganisationAddress Address, User TechUser) public static void OnLogWarranty(this Job j, DiscoDataContext Database, string FaultDescription, string ManualProviderName, string ManualProviderReference, OrganisationAddress Address, User TechUser)
{ {
if (!j.CanLogWarranty()) if (!j.CanLogWarranty())
throw new InvalidOperationException("Log Warranty was Denied"); throw new InvalidOperationException("Lodge Warranty was Denied");
j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now; j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now;
j.JobMetaWarranty.ExternalName = ManualProviderName; j.JobMetaWarranty.ExternalName = ManualProviderName;
@@ -369,6 +375,7 @@ namespace Disco.Services
#endregion #endregion
#region Insurance Claim Form Sent #region Insurance Claim Form Sent
[Obsolete("Use Log Insurance instead")]
public static bool CanInsuranceClaimFormSent(this Job j) public static bool CanInsuranceClaimFormSent(this Job j)
{ {
if (!UserService.CurrentAuthorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent)) if (!UserService.CurrentAuthorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent))
@@ -378,6 +385,7 @@ namespace Disco.Services
j.JobMetaNonWarranty.IsInsuranceClaim && j.JobMetaNonWarranty.IsInsuranceClaim &&
!j.JobMetaInsurance.ClaimFormSentDate.HasValue; !j.JobMetaInsurance.ClaimFormSentDate.HasValue;
} }
[Obsolete("Use Log Insurance instead")]
public static void OnInsuranceClaimFormSent(this Job j) public static void OnInsuranceClaimFormSent(this Job j)
{ {
if (!j.CanInsuranceClaimFormSent()) if (!j.CanInsuranceClaimFormSent())
@@ -404,19 +412,21 @@ namespace Disco.Services
public static void OnLogRepair(this Job j, DiscoDataContext Database, string RepairDescription, List<JobAttachment> SendAttachments, 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("Lodge Repair was Denied");
PublishJobResult publishJobResult = null; PublishJobResult publishJobResult = null;
using (RepairProviderFeature RepairProvider = RepairProviderDefinition.CreateInstance<RepairProviderFeature>()) using (RepairProviderFeature repairProvider = RepairProviderDefinition.CreateInstance<RepairProviderFeature>())
{ {
if (SendAttachments != null && SendAttachments.Count > 0) var repairProvider2 = repairProvider as RepairProvider2Feature;
if (repairProvider2 == null && SendAttachments != null && SendAttachments.Count > 0)
{ {
publishJobResult = DiscoServicesJobs.Publish( publishJobResult = DiscoServicesJobs.Publish(
Database, Database,
j, j,
TechUser, TechUser,
RepairProvider.ProviderId, repairProvider.ProviderId,
null, null,
RepairDescription, RepairDescription,
SendAttachments, SendAttachments,
@@ -438,10 +448,14 @@ namespace Disco.Services
else else
submitDescription = string.Concat(RepairDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition)); submitDescription = string.Concat(RepairDescription, Environment.NewLine, Environment.NewLine, j.GenerateFaultDescriptionFooter(Database, RepairProviderDefinition));
string providerRef = RepairProvider.SubmitJob(Database, j, Address, TechUser, submitDescription, RepairProviderProperties); string providerRef;
if (repairProvider2 != null)
providerRef = repairProvider2.SubmitJob(Database, j, Address, TechUser, submitDescription, SendAttachments, RepairProviderProperties);
else
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;
if (providerRef != null && providerRef.Length > 100) if (providerRef != null && providerRef.Length > 100)
j.JobMetaNonWarranty.RepairerReference = providerRef.Substring(0, 100); j.JobMetaNonWarranty.RepairerReference = providerRef.Substring(0, 100);
@@ -454,7 +468,7 @@ namespace Disco.Services
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___\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);
@@ -471,7 +485,7 @@ namespace Disco.Services
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)
{ {
if (!j.CanLogRepair()) if (!j.CanLogRepair())
throw new InvalidOperationException("Log Repair was Denied"); throw new InvalidOperationException("Lodge Repair was Denied");
j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now; j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now;
j.JobMetaNonWarranty.RepairerName = ManualProviderName; j.JobMetaNonWarranty.RepairerName = ManualProviderName;
@@ -512,6 +526,72 @@ namespace Disco.Services
} }
#endregion #endregion
#region Log Insurance
public static bool CanLogInsurance(this Job j)
{
if (!UserService.CurrentAuthorization.HasAny(Claims.Job.Actions.LogInsurance, Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent))
return false;
return j.JobTypeId == JobType.JobTypeIds.HNWar &&
j.DeviceSerialNumber != null &&
j.JobMetaNonWarranty.IsInsuranceClaim &&
!j.JobMetaInsurance.ClaimFormSentDate.HasValue;
}
public static void OnLogInsurance(this Job j, DiscoDataContext database, List<JobAttachment> attachments, PluginFeatureManifest providerDefinition, OrganisationAddress address, User techUser, Dictionary<string, string> providerProperties)
{
if (!j.CanLogInsurance())
throw new InvalidOperationException("Lodge Insurance was Denied");
using (var provider = providerDefinition.CreateInstance<InsuranceProviderFeature>())
{
var providerRef = provider.SubmitJob(database, j, address, techUser, attachments, providerProperties);
j.JobMetaInsurance.Insurer = provider.ProviderId;
j.JobMetaInsurance.ClaimFormSentDate = DateTime.Now;
j.JobMetaInsurance.ClaimFormSentUserId = techUser.UserId;
if (providerRef != null && providerRef.Length > 200)
j.JobMetaInsurance.InsurerReference = providerRef.Substring(0, 200);
else
j.JobMetaInsurance.InsurerReference = providerRef;
// Write Log
var jobLog = new JobLog()
{
JobId = j.Id,
TechUserId = techUser.UserId,
Timestamp = DateTime.Now,
Comments = $"# Insurance Claim Submitted\r\nProvider: **{provider.Manifest.Name}**\r\nAddress: **{address.Name}**\r\nReference: **{providerRef}**",
};
database.JobLogs.Add(jobLog);
}
}
public static void OnLogInsurance(this Job j, DiscoDataContext database, string manualProviderName, string manualProviderReference, OrganisationAddress address, User techUser)
{
if (!j.CanLogInsurance())
throw new InvalidOperationException("Lodge Insurance was Denied");
j.JobMetaInsurance.Insurer = manualProviderName;
j.JobMetaInsurance.ClaimFormSentDate = DateTime.Now;
j.JobMetaInsurance.ClaimFormSentUserId = techUser.UserId;
if (manualProviderReference != null && manualProviderReference.Length > 200)
j.JobMetaInsurance.InsurerReference = manualProviderReference.Substring(0, 200);
else
j.JobMetaInsurance.InsurerReference = manualProviderReference;
// Write Log
JobLog jobLog = new JobLog()
{
JobId = j.Id,
TechUserId = techUser.UserId,
Timestamp = DateTime.Now,
Comments = $"# Manual Insurance Request Submitted\r\nProvider: **{manualProviderName}**\r\nAddress: **{address.Name}**\r\nReference: **{manualProviderReference ?? "<none>"}**",
};
database.JobLogs.Add(jobLog);
}
#endregion
#region Close #region Close
public static void OnCloseNormally(this Job j, DiscoDataContext Database, User Technician) public static void OnCloseNormally(this Job j, DiscoDataContext Database, User Technician)
{ {
@@ -0,0 +1,92 @@
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web.Mvc;
namespace Disco.Services.Plugins.Features.InsuranceProvider
{
[PluginFeatureCategory(DisplayName = "Insurance Providers")]
public abstract class InsuranceProviderFeature : PluginFeature
{
/// <summary>
/// The insurer identifier. Used to link this provider to any <see cref="JobMetaInsurance.Insurer"/>. This identifier is used to automatically set the Insurer when a job is submitted using this plugin.
/// </summary>
public abstract string ProviderId { get; }
#region Job Submission
/// <summary>
/// Called when a user selects this plugin to submit the insurance claim and allows a plugin to inject a View to collect additional information.
/// </summary>
/// <returns>A Tuple consisting of the Razor View type and a View Model</returns>
public virtual Tuple<Type, dynamic> SubmitJobBegin(DiscoDataContext database, Controller controller, Job job, OrganisationAddress address, User techUser)
{
return null;
}
/// <summary>
/// Called after the RepairDescription is completed and allows the plugin to parse any data collected from SubmitJobBegin.
/// </summary>
/// <returns>A Dictionary of key/value items which are persisted throughout the submission and passed into the final SubmitJob method.</returns>
public virtual Dictionary<string, string> SubmitJobParseProperties(DiscoDataContext database, FormCollection form, Controller controller, Job job, OrganisationAddress address, User techUser)
{
return null;
}
/// <summary>
/// Plugins are required to disclose any information that will be transmitted to any external party. This method is expected to return a clear list all data which will be transmitted.
/// </summary>
/// <returns>A Dictionary of key/value items which contain all information which will be disclosed to the plugin provider.</returns>
public abstract Dictionary<string, string> SubmitJobDiscloseInfo(DiscoDataContext database, Job job, OrganisationAddress address, User techUser, Dictionary<string, string> providerProperties);
/// <summary>
/// Called when the plugin should submit the job to the external party.
/// </summary>
/// <returns>A reference number/identifier from the external party which is stored in <see cref="JobMetaInsurance.InsurerReference"/></returns>
public abstract string SubmitJob(DiscoDataContext database, Job job, OrganisationAddress address, User techUser, List<JobAttachment> attachments, Dictionary<string, string> providerProperties);
#endregion
#region Job Details
/// <summary>
/// <see cref="true"/> when additional Job Details are supported by the external party. When <see cref="true"/>, JobDetailsViewModel must be implemented.
/// </summary>
public abstract bool JobDetailsSupported { get; }
/// <summary>
/// Called when a job's insurance information is shown. Allows a plugin to inject a View to display additional information.
/// </summary>
/// <returns>A Tuple consisting of the Razor View type and a View Model</returns>
public virtual Tuple<Type, dynamic> JobDetails(DiscoDataContext database, Controller controller, Job job)
{
return null;
}
#endregion
public static PluginFeatureManifest FindPluginFeature(string pluginIdOrInsuranceProviderId)
{
var defs = Plugins.GetPluginFeatures(typeof(InsuranceProviderFeature));
var def = defs.FirstOrDefault(d => d.PluginManifest.Id.Equals(pluginIdOrInsuranceProviderId, StringComparison.OrdinalIgnoreCase));
if (def != null)
return def;
else
foreach (var d in defs)
{
using (var providerInstance = d.CreateInstance<InsuranceProviderFeature>())
{
if (providerInstance.ProviderId != null && providerInstance.ProviderId.Equals(pluginIdOrInsuranceProviderId, StringComparison.OrdinalIgnoreCase))
{
return d;
}
}
}
return null;
}
}
}
@@ -0,0 +1,12 @@
using System;
namespace Disco.Services.Plugins.Features.InsuranceProvider
{
public class InsuranceProviderSubmitJobException : Exception
{
public InsuranceProviderSubmitJobException(string message)
: base(message)
{
}
}
}
@@ -0,0 +1,20 @@
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
using System;
using System.Collections.Generic;
namespace Disco.Services.Plugins.Features.RepairProvider
{
[PluginFeatureCategory(DisplayName = "Repair Providers")]
public abstract class RepairProvider2Feature : RepairProviderFeature
{
public override sealed string SubmitJob(DiscoDataContext Database, Job Job, OrganisationAddress Address, User TechUser, string RepairDescription, Dictionary<string, string> ProviderProperties)
{
throw new NotSupportedException();
}
public abstract string SubmitJob(DiscoDataContext database, Job job, OrganisationAddress address, User techUser, string description, List<JobAttachment> attachments, Dictionary<string, string> providerProperties);
}
}
@@ -0,0 +1,19 @@
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
using System;
using System.Collections.Generic;
namespace Disco.Services.Plugins.Features.WarrantyProvider
{
[PluginFeatureCategory(DisplayName = "Warranty Providers")]
public abstract class WarrantyProvider2Feature : WarrantyProviderFeature
{
public override sealed string SubmitJob(DiscoDataContext Database, Job Job, OrganisationAddress Address, User TechUser, string FaultDescription, Dictionary<string, string> WarrantyProviderProperties)
{
throw new NotSupportedException();
}
public abstract string SubmitJob(DiscoDataContext database, Job job, OrganisationAddress address, User techUser, string description, List<JobAttachment> attachments, Dictionary<string, string> providerProperties);
}
}
+2 -1
View File
@@ -530,6 +530,7 @@ namespace Disco.Services.Plugins
public void LogWarning(string Message) public void LogWarning(string Message)
{ {
LogWarning(Message, null); LogWarning(Message, null);
PluginsLog.LogPluginWarning(this, Message);
} }
public void LogWarning(string MessageFormat, params object[] Args) public void LogWarning(string MessageFormat, params object[] Args)
{ {
@@ -537,7 +538,7 @@ namespace Disco.Services.Plugins
} }
public void LogMessage(string Message) public void LogMessage(string Message)
{ {
LogMessage(Message, null); PluginsLog.LogPluginMessage(this, Message);
} }
public void LogMessage(string MessageFormat, params object[] Args) public void LogMessage(string MessageFormat, params object[] Args)
{ {
+19 -4
View File
@@ -179,6 +179,15 @@ namespace Disco.Services.Plugins
return new HttpStatusCodeResult(System.Net.HttpStatusCode.OK, description); return new HttpStatusCodeResult(System.Net.HttpStatusCode.OK, description);
} }
public ActionResult BadRequest()
{
return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest);
}
public ActionResult BadRequest(string description)
{
return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest, description);
}
#endregion #endregion
#region Content #region Content
@@ -262,11 +271,17 @@ namespace Disco.Services.Plugins
} }
public ActionResult RedirectToPluginAction(string PluginAction) public ActionResult RedirectToPluginAction(string PluginAction)
{ {
if (string.IsNullOrEmpty(PluginAction)) return RedirectToPluginAction(PluginAction, null);
throw new ArgumentNullException("PluginAction"); }
public ActionResult RedirectToPluginAction(string pluginAction, object routeValues)
{
if (string.IsNullOrEmpty(pluginAction))
throw new ArgumentNullException(nameof(pluginAction));
var routeValues = new RouteValueDictionary(new { PluginId = Manifest.Id, PluginAction = PluginAction }); var routeValueDictionary = new RouteValueDictionary(routeValues);
string pluginActionUrl = UrlHelper.GenerateUrl("Plugin", null, null, routeValues, RouteTable.Routes, HostController.Request.RequestContext, false); routeValueDictionary.Add("PluginId", Manifest.Id);
routeValueDictionary.Add("PluginAction", pluginAction);
string pluginActionUrl = UrlHelper.GenerateUrl("Plugin", null, null, routeValueDictionary, RouteTable.Routes, HostController.Request.RequestContext, false);
return new RedirectResult(pluginActionUrl, false); return new RedirectResult(pluginActionUrl, false);
} }
@@ -134,6 +134,7 @@ namespace Disco.Services.Plugins
private readonly PluginControllerDescription controllerDescription; private readonly PluginControllerDescription controllerDescription;
private readonly MethodInfo methodInfo; private readonly MethodInfo methodInfo;
private readonly IAuthorizationFilter[] authorizationFilters; private readonly IAuthorizationFilter[] authorizationFilters;
private readonly ActionMethodSelectorAttribute methodSelector;
private readonly PluginParameterDescriptor[] parameterDescriptors; private readonly PluginParameterDescriptor[] parameterDescriptors;
public override string UniqueId { get; } public override string UniqueId { get; }
public override string ActionName { get; } public override string ActionName { get; }
@@ -146,6 +147,7 @@ namespace Disco.Services.Plugins
UniqueId = $"{ControllerDescriptor.UniqueId}_{methodName}"; UniqueId = $"{ControllerDescriptor.UniqueId}_{methodName}";
ActionName = methodName; ActionName = methodName;
authorizationFilters = DiscoverAuthorizationFilters(); authorizationFilters = DiscoverAuthorizationFilters();
methodSelector = DiscoverMethodSelector();
parameterDescriptors = DiscoverParameters(); parameterDescriptors = DiscoverParameters();
} }
@@ -159,6 +161,11 @@ namespace Disco.Services.Plugins
return filters.ToArray(); return filters.ToArray();
} }
private ActionMethodSelectorAttribute DiscoverMethodSelector()
{
return methodInfo.GetCustomAttributes<ActionMethodSelectorAttribute>(true).FirstOrDefault();
}
private PluginParameterDescriptor[] DiscoverParameters() private PluginParameterDescriptor[] DiscoverParameters()
{ {
var methodParams = methodInfo.GetParameters(); var methodParams = methodInfo.GetParameters();
@@ -187,6 +194,9 @@ namespace Disco.Services.Plugins
public ActionResult Execute(PluginWebHandlerController pluginController, ControllerContext controllerContext) public ActionResult Execute(PluginWebHandlerController pluginController, ControllerContext controllerContext)
{ {
if (methodSelector != null && !methodSelector.IsValidForRequest(controllerContext, methodInfo))
return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest);
var methodParameters = BuildMethodParameters(methodInfo, controllerContext.Controller); var methodParameters = BuildMethodParameters(methodInfo, controllerContext.Controller);
return (ActionResult)methodInfo.Invoke(pluginController, methodParameters); return (ActionResult)methodInfo.Invoke(pluginController, methodParameters);
+1 -1
View File
@@ -237,7 +237,7 @@ namespace Disco.Services.Plugins
if (_PluginManifests == null) if (_PluginManifests == null)
throw new InvalidOperationException("Plugins have not been initialized"); throw new InvalidOperationException("Plugins have not been initialized");
return _PluginManifests.Values.SelectMany(pm => pm.Features).Where(fm => fm.CategoryType.IsAssignableFrom(FeatureCategoryType)).OrderBy(fm => fm.PluginManifest.Name).ToList(); return _PluginManifests.Values.SelectMany(pm => pm.Features).Where(fm => FeatureCategoryType.IsAssignableFrom(fm.CategoryType)).OrderBy(fm => fm.PluginManifest.Name).ToList();
} }
public static List<PluginFeatureManifest> GetPluginFeatures() public static List<PluginFeatureManifest> GetPluginFeatures()
{ {
@@ -44,15 +44,14 @@ namespace Disco.Web.Areas.Config.Models.Plugins
} }
} }
public List<Tuple<Type, List<PluginManifest>>> PluginManifestsByCategory public Dictionary<string, List<PluginManifest>> PluginManifestsByCategory
{ {
get get
{ {
if (PluginManifests.Count == 0) if (PluginManifests.Count == 0)
return null; return null;
var pluginsByCategory = new Dictionary<string, List<PluginManifest>>(StringComparer.Ordinal);
List<Tuple<Type, PluginManifest>> pluginsByCategory = new List<Tuple<Type, PluginManifest>>();
foreach (var pluginManifest in PluginManifests) foreach (var pluginManifest in PluginManifests)
{ {
@@ -68,12 +67,17 @@ namespace Disco.Web.Areas.Config.Models.Plugins
else else
categoryType = primaryFeature.CategoryType; categoryType = primaryFeature.CategoryType;
pluginsByCategory.Add(new Tuple<Type, PluginManifest>(categoryType, pluginManifest)); var categoryName = Disco.Services.Plugins.Plugins.PluginFeatureCategoryDisplayName(categoryType);
if (!pluginsByCategory.TryGetValue(categoryName, out var categoryPlugins))
{
categoryPlugins = new List<PluginManifest>();
pluginsByCategory.Add(categoryName, categoryPlugins);
}
categoryPlugins.Add(pluginManifest);
} }
return pluginsByCategory.GroupBy(p => p.Item1) return pluginsByCategory;
.OrderBy(g => g.Key.Name)
.Select(g => new Tuple<Type, List<PluginManifest>>(g.Key, g.Select(pg => pg.Item2).OrderBy(p => p.Name).ToList())).ToList();
} }
} }
} }
@@ -1,5 +1,4 @@
@model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel @model Disco.Web.Areas.Config.Models.Plugins.IndexViewModel
@using Disco.Services.Plugins;
@{ @{
Authorization.Require(Claims.Config.Plugin.Show); Authorization.Require(Claims.Config.Plugin.Show);
@@ -19,7 +18,7 @@
} }
else else
{ {
var pluginGroups = Model.PluginManifestsByCategory; var pluginGroups = Model.PluginManifestsByCategory.OrderBy(c => c.Key).ToList();
int itemsPerColumn = pluginGroups.Count / 3; int itemsPerColumn = pluginGroups.Count / 3;
@@ -37,8 +36,8 @@
var pluginGroup = pluginGroups[itemNextId]; var pluginGroup = pluginGroups[itemNextId];
itemNextId++; itemNextId++;
<div class="pageMenuArea"> <div class="pageMenuArea">
<h2>@Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)</h2> <h2>@pluginGroup.Key</h2>
@foreach (var pluginDefinition in pluginGroup.Item2) @foreach (var pluginDefinition in pluginGroup.Value.OrderBy(p => p.Name))
{ {
if (canConfig) if (canConfig)
{ {
@@ -30,12 +30,6 @@ namespace Disco.Web.Areas.Config.Views.Plugins
using Disco.Models.Repository; using Disco.Models.Repository;
using Disco.Services; using Disco.Services;
using Disco.Services.Authorization; using Disco.Services.Authorization;
#line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
using Disco.Services.Plugins;
#line default
#line hidden
using Disco.Services.Web; using Disco.Services.Web;
using Disco.Web; using Disco.Web;
using Disco.Web.Extensions; using Disco.Web.Extensions;
@@ -50,7 +44,7 @@ namespace Disco.Web.Areas.Config.Views.Plugins
public override void Execute() public override void Execute()
{ {
#line 3 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 2 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Authorization.Require(Claims.Config.Plugin.Show); Authorization.Require(Claims.Config.Plugin.Show);
@@ -70,13 +64,13 @@ WriteLiteral(" id=\"plugins\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 13 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 13 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 12 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (Model.PluginManifests.Count == 0) if (Model.PluginManifests.Count == 0)
{ {
@@ -93,11 +87,11 @@ WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
WriteLiteral(">\r\n <h2>No Plugins are Installed</h2>\r\n </div> \r\n"); WriteLiteral(">\r\n <h2>No Plugins are Installed</h2>\r\n </div> \r\n");
#line 19 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 18 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
else else
{ {
var pluginGroups = Model.PluginManifestsByCategory; var pluginGroups = Model.PluginManifestsByCategory.OrderBy(c => c.Key).ToList();
int itemsPerColumn = pluginGroups.Count / 3; int itemsPerColumn = pluginGroups.Count / 3;
@@ -114,13 +108,13 @@ WriteLiteral(" id=\"pageMenu\"");
WriteLiteral(">\r\n <tr>\r\n"); WriteLiteral(">\r\n <tr>\r\n");
#line 30 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 29 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 30 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 29 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
{ {
@@ -130,13 +124,13 @@ WriteLiteral(">\r\n <tr>\r\n");
WriteLiteral(" <td>\r\n"); WriteLiteral(" <td>\r\n");
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 32 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 33 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 32 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0); int itemsForThisColumn = itemsPerColumn + (pluginGroups.Count % 3 > i ? 1 : 0);
for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++) for (int i2 = 0; i2 < itemsForThisColumn && itemNextId < pluginGroups.Count; i2++)
@@ -154,8 +148,8 @@ WriteLiteral(" class=\"pageMenuArea\"");
WriteLiteral(">\r\n <h2>"); WriteLiteral(">\r\n <h2>");
#line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 39 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Plugins.PluginFeatureCategoryDisplayName(pluginGroup.Item1)); Write(pluginGroup.Key);
#line default #line default
@@ -163,14 +157,14 @@ WriteLiteral(">\r\n <h2>");
WriteLiteral("</h2>\r\n"); WriteLiteral("</h2>\r\n");
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 41 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 40 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
foreach (var pluginDefinition in pluginGroup.Item2) foreach (var pluginDefinition in pluginGroup.Value.OrderBy(p => p.Name))
{ {
if (canConfig) if (canConfig)
{ {
@@ -180,14 +174,14 @@ WriteLiteral("</h2>\r\n");
#line hidden #line hidden
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 1807), Tuple.Create("\"", 1876) WriteAttribute("href", Tuple.Create(" href=\"", 1781), Tuple.Create("\"", 1850)
#line 45 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 44 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 1814), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(pluginDefinition.Id)) , Tuple.Create(Tuple.Create("", 1788), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(pluginDefinition.Id))
#line default #line default
#line hidden #line hidden
, 1814), false) , 1788), false)
); );
WriteLiteral(">\r\n <i"); WriteLiteral(">\r\n <i");
@@ -197,7 +191,7 @@ WriteLiteral(" class=\"fa fa-cogs\"");
WriteLiteral("></i>\r\n <h3>"); WriteLiteral("></i>\r\n <h3>");
#line 47 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 46 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Name); Write(pluginDefinition.Name);
@@ -206,7 +200,7 @@ WriteLiteral("></i>\r\n <h3>");
WriteLiteral("</h3>\r\n </a>\r\n"); WriteLiteral("</h3>\r\n </a>\r\n");
#line 49 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 48 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
else else
{ {
@@ -217,7 +211,7 @@ WriteLiteral("</h3>\r\n </a>\r\n");
WriteLiteral(" <h3>"); WriteLiteral(" <h3>");
#line 52 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 51 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Name); Write(pluginDefinition.Name);
@@ -226,7 +220,7 @@ WriteLiteral(" <h3>");
WriteLiteral("</h3>\r\n"); WriteLiteral("</h3>\r\n");
#line 53 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 52 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -243,7 +237,7 @@ WriteLiteral(" class=\"pluginVersion\"");
WriteLiteral(">v"); WriteLiteral(">v");
#line 55 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.VersionFormatted); Write(pluginDefinition.VersionFormatted);
@@ -252,7 +246,7 @@ WriteLiteral(">v");
WriteLiteral("</span> | "); WriteLiteral("</span> | ");
#line 55 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(pluginDefinition.Author); Write(pluginDefinition.Author);
@@ -260,14 +254,14 @@ WriteLiteral("</span> | ");
#line hidden #line hidden
WriteLiteral(" | <a"); WriteLiteral(" | <a");
WriteAttribute("href", Tuple.Create(" href=\"", 2500), Tuple.Create("\"", 2528) WriteAttribute("href", Tuple.Create(" href=\"", 2474), Tuple.Create("\"", 2502)
#line 55 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 54 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
, Tuple.Create(Tuple.Create("", 2507), Tuple.Create<System.Object, System.Int32>(pluginDefinition.Url , Tuple.Create(Tuple.Create("", 2481), Tuple.Create<System.Object, System.Int32>(pluginDefinition.Url
#line default #line default
#line hidden #line hidden
, 2507), false) , 2481), false)
); );
WriteLiteral(" title=\"More Information\""); WriteLiteral(" title=\"More Information\"");
@@ -281,7 +275,7 @@ WriteLiteral(" class=\"fa fa-external-link\"");
WriteLiteral("></i></a>\r\n </div>\r\n"); WriteLiteral("></i></a>\r\n </div>\r\n");
#line 57 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 56 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -290,7 +284,7 @@ WriteLiteral("></i></a>\r\n </div>\r\n");
WriteLiteral(" </div>\r\n"); WriteLiteral(" </div>\r\n");
#line 59 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 58 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -299,7 +293,7 @@ WriteLiteral(" </div>\r\n");
WriteLiteral("\r\n </td>\r\n"); WriteLiteral("\r\n </td>\r\n");
#line 62 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 61 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -308,7 +302,7 @@ WriteLiteral("\r\n </td>\r\n");
WriteLiteral(" </tr>\r\n </table>\r\n"); WriteLiteral(" </tr>\r\n </table>\r\n");
#line 65 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 64 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canUninstall) if (canUninstall)
{ {
@@ -326,7 +320,7 @@ WriteLiteral(">\r\n <div>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 69 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 68 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall"))); Write(Html.DropDownList("uninstallPlugin", Model.PluginManifests.ToSelectListItems(null, true, "Select a Plugin to Uninstall")));
@@ -407,7 +401,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
" var uninstallUrl = \'"); " var uninstallUrl = \'");
#line 96 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 95 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Url.Action(MVC.API.Plugin.Uninstall())); Write(Url.Action(MVC.API.Plugin.Uninstall()));
@@ -460,7 +454,7 @@ WriteLiteral("/\';\r\n var uninstallPlugin, uninstallPluginData,
"}\r\n });\r\n });\r\n </script>\r\n"); "}\r\n });\r\n });\r\n </script>\r\n");
#line 176 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 175 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
if (Model.PluginUpdates.Count > 0) if (Model.PluginUpdates.Count > 0)
{ {
@@ -479,7 +473,7 @@ WriteLiteral(" class=\"fa fa-cloud-download\"");
WriteLiteral("></i>\r\n <div>"); WriteLiteral("></i>\r\n <div>");
#line 181 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 180 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Model.PluginUpdates.Count); Write(Model.PluginUpdates.Count);
@@ -488,7 +482,7 @@ WriteLiteral("></i>\r\n <div>");
WriteLiteral(" plugin update"); WriteLiteral(" plugin update");
#line 181 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 180 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Model.PluginUpdates.Count == 1 ? " is" : "s are"); Write(Model.PluginUpdates.Count == 1 ? " is" : "s are");
@@ -497,13 +491,13 @@ WriteLiteral(" plugin update");
WriteLiteral(" available</div>\r\n"); WriteLiteral(" available</div>\r\n");
#line 182 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 181 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 182 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 181 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canInstall) if (canInstall)
{ {
@@ -511,14 +505,14 @@ WriteLiteral(" available</div>\r\n");
#line default #line default
#line hidden #line hidden
#line 184 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 183 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkSmallButton("Update Now", MVC.API.Plugin.UpdateAll(), null, "alert")); Write(Html.ActionLinkSmallButton("Update Now", MVC.API.Plugin.UpdateAll(), null, "alert"));
#line default #line default
#line hidden #line hidden
#line 184 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 183 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
else else
@@ -534,7 +528,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">You do not have sufficient permission to install these updates.</div>\r\n"); WriteLiteral(">You do not have sufficient permission to install these updates.</div>\r\n");
#line 189 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 188 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -554,7 +548,7 @@ WriteLiteral(@" <script>
"); ");
#line 200 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 199 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
} }
@@ -568,13 +562,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 205 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 204 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
#line default #line default
#line hidden #line hidden
#line 205 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 204 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canUninstall && Model.PluginManifests.Count > 0) if (canUninstall && Model.PluginManifests.Count > 0)
{ {
@@ -582,14 +576,14 @@ WriteLiteral(">\r\n");
#line default #line default
#line hidden #line hidden
#line 207 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 206 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall")); Write(Html.ActionLinkButton("Uninstall Plugins", MVC.Config.Plugins.Index(), "buttonUninstall"));
#line default #line default
#line hidden #line hidden
#line 207 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 206 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -599,7 +593,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 209 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 208 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
if (canInstall) if (canInstall)
{ {
@@ -607,14 +601,14 @@ WriteLiteral(" ");
#line default #line default
#line hidden #line hidden
#line 211 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 210 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install())); Write(Html.ActionLinkButton("Install Plugins", MVC.Config.Plugins.Install()));
#line default #line default
#line hidden #line hidden
#line 211 "..\..\Areas\Config\Views\Plugins\Index.cshtml" #line 210 "..\..\Areas\Config\Views\Plugins\Index.cshtml"
} }
@@ -41,7 +41,7 @@
{ {
if (Version.Parse(plugin.Item2.Version) > installedPlugin.Version) if (Version.Parse(plugin.Item2.Version) > installedPlugin.Version)
{ {
<a class="pluginUpdateLink button" href="@(Url.Action(MVC.API.Plugin.Update(plugin.Item1.Id)))">Update</a> <a class="pluginUpdateLink button alert" href="@(Url.Action(MVC.API.Plugin.Update(plugin.Item1.Id)))">Update</a>
} }
else else
{ {
@@ -243,16 +243,16 @@ WriteLiteral(">Install</a>\r\n");
#line hidden #line hidden
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteLiteral(" class=\"pluginUpdateLink button\""); WriteLiteral(" class=\"pluginUpdateLink button alert\"");
WriteAttribute("href", Tuple.Create(" href=\"", 2412), Tuple.Create("\"", 2472) WriteAttribute("href", Tuple.Create(" href=\"", 2418), Tuple.Create("\"", 2478)
#line 44 "..\..\Areas\Config\Views\Plugins\Install.cshtml" #line 44 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 2419), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Update(plugin.Item1.Id)) , Tuple.Create(Tuple.Create("", 2425), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Plugin.Update(plugin.Item1.Id))
#line default #line default
#line hidden #line hidden
, 2419), false) , 2425), false)
); );
WriteLiteral(">Update</a>\r\n"); WriteLiteral(">Update</a>\r\n");
@@ -270,14 +270,14 @@ WriteLiteral(" <a");
WriteLiteral(" class=\"button\""); WriteLiteral(" class=\"button\"");
WriteAttribute("href", Tuple.Create(" href=\"", 2711), Tuple.Create("\"", 2778) WriteAttribute("href", Tuple.Create(" href=\"", 2717), Tuple.Create("\"", 2784)
#line 48 "..\..\Areas\Config\Views\Plugins\Install.cshtml" #line 48 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 2718), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(plugin.Item1.Id)) , Tuple.Create(Tuple.Create("", 2724), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Configure(plugin.Item1.Id))
#line default #line default
#line hidden #line hidden
, 2718), false) , 2724), false)
); );
WriteLiteral(">Configure</a>\r\n"); WriteLiteral(">Configure</a>\r\n");
@@ -345,14 +345,14 @@ WriteLiteral("</span> | ");
#line hidden #line hidden
WriteLiteral(" | <a"); WriteLiteral(" | <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3309), Tuple.Create("\"", 3344) WriteAttribute("href", Tuple.Create(" href=\"", 3315), Tuple.Create("\"", 3350)
#line 54 "..\..\Areas\Config\Views\Plugins\Install.cshtml" #line 54 "..\..\Areas\Config\Views\Plugins\Install.cshtml"
, Tuple.Create(Tuple.Create("", 3316), Tuple.Create<System.Object, System.Int32>(plugin.Item1.InformationUrl , Tuple.Create(Tuple.Create("", 3322), Tuple.Create<System.Object, System.Int32>(plugin.Item1.InformationUrl
#line default #line default
#line hidden #line hidden
, 3316), false) , 3322), false)
); );
WriteLiteral(" title=\"More Information\""); WriteLiteral(" title=\"More Information\"");
+8 -4
View File
@@ -879,18 +879,22 @@
margin-right: 10px; margin-right: 10px;
color: #1e6dab; color: #1e6dab;
} }
#repairJobForm #repairDisclosedInformation table { #repairJobForm #disclosedInformation table,
#insuranceJobForm #disclosedInformation table {
font-size: 0.9em; font-size: 0.9em;
} }
#repairJobForm #repairDisclosedInformation table tr:not(:last-child) { #repairJobForm #disclosedInformation table tr:not(:last-child),
#insuranceJobForm #disclosedInformation table tr:not(:last-child) {
border-bottom: 1px dashed #aaa; border-bottom: 1px dashed #aaa;
} }
#repairJobForm #repairDisclosedInformation table th { #repairJobForm #disclosedInformation table th,
#insuranceJobForm #disclosedInformation table th {
padding: 2px; padding: 2px;
font-weight: 600; font-weight: 600;
width: 200px; width: 200px;
} }
#repairJobForm #repairDisclosedInformation table td { #repairJobForm #disclosedInformation table td,
#insuranceJobForm #disclosedInformation table td {
padding: 2px; padding: 2px;
} }
#repairJobRepairDescription #RepairDescription { #repairJobRepairDescription #RepairDescription {
+2 -2
View File
@@ -940,8 +940,8 @@
} }
} }
#repairJobForm { #repairJobForm, #insuranceJobForm {
#repairDisclosedInformation { #disclosedInformation {
table { table {
font-size: 0.9em; font-size: 0.9em;
File diff suppressed because one or more lines are too long
+187 -7
View File
@@ -11,6 +11,7 @@ using Disco.Services.Jobs.JobQueues;
using Disco.Services.Jobs.Statistics; using Disco.Services.Jobs.Statistics;
using Disco.Services.Logging; using Disco.Services.Logging;
using Disco.Services.Plugins.Features.DetailsProvider; using Disco.Services.Plugins.Features.DetailsProvider;
using Disco.Services.Plugins.Features.InsuranceProvider;
using Disco.Services.Plugins.Features.RepairProvider; using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Plugins.Features.UIExtension; using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Plugins.Features.WarrantyProvider; using Disco.Services.Plugins.Features.WarrantyProvider;
@@ -553,7 +554,7 @@ namespace Disco.Web.Controllers
return View(m); return View(m);
} }
[HttpPost, DiscoAuthorize(Claims.Job.Actions.LogWarranty)] [HttpPost, ValidateAntiForgeryToken, DiscoAuthorize(Claims.Job.Actions.LogWarranty), ValidateInput(false)]
public virtual ActionResult LogWarranty(Models.Job.LogWarrantyModel m, FormCollection form) public virtual ActionResult LogWarranty(Models.Job.LogWarrantyModel m, FormCollection form)
{ {
m.UpdateModel(Database, true); m.UpdateModel(Database, true);
@@ -736,7 +737,7 @@ namespace Disco.Web.Controllers
return View(m); return View(m);
} }
[HttpPost, DiscoAuthorize(Claims.Job.Actions.LogRepair)] [HttpPost, ValidateAntiForgeryToken, DiscoAuthorize(Claims.Job.Actions.LogRepair), ValidateInput(false)]
public virtual ActionResult LogRepair(Models.Job.LogRepairModel m, FormCollection form) public virtual ActionResult LogRepair(Models.Job.LogRepairModel m, FormCollection form)
{ {
m.UpdateModel(Database, true); m.UpdateModel(Database, true);
@@ -759,12 +760,9 @@ namespace Disco.Web.Controllers
if (updatedModel.RepairProvider != null) if (updatedModel.RepairProvider != null)
{ {
using (var wp = updatedModel.RepairProvider.CreateInstance<RepairProviderFeature>()) using (var rp = m.RepairProvider.CreateInstance<RepairProviderFeature>())
{ {
using (var rp = m.RepairProvider.CreateInstance<RepairProviderFeature>()) updatedModel.RepairProviderSubmitJobBeginResult = rp.SubmitJobBegin(Database, this, updatedModel.Job, updatedModel.OrganisationAddress, updatedModel.TechUser);
{
m.RepairProviderSubmitJobBeginResult = rp.SubmitJobBegin(Database, this, updatedModel.Job, updatedModel.OrganisationAddress, updatedModel.TechUser);
}
} }
} }
@@ -895,5 +893,187 @@ namespace Disco.Web.Controllers
} }
#endregion #endregion
#region Log Insurance
[DiscoAuthorizeAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance)]
public virtual ActionResult LogInsurance(int id, string providerId, int? organisationAddressId)
{
var m = new Models.Job.LogInsuranceModel()
{
JobId = id,
ProviderId = providerId,
OrganisationAddressId = organisationAddressId
};
m.UpdateModel(Database, false);
if (m.Provider != null)
{
using (var rp = m.Provider.CreateInstance<InsuranceProviderFeature>())
{
m.ProviderSubmitJobBeginResult = rp.SubmitJobBegin(Database, this, m.Job, m.OrganisationAddress, m.TechUser);
}
}
return View(m);
}
[HttpPost, ValidateAntiForgeryToken, DiscoAuthorizeAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance), ValidateInput(false)]
public virtual ActionResult LogInsurance(Models.Job.LogInsuranceModel m, FormCollection form)
{
m.UpdateModel(Database, true);
if (ModelState.IsValid)
{
switch (m.SubmissionAction)
{
case "Update":
var updatedModel = new Models.Job.LogInsuranceModel()
{
JobId = m.JobId,
ProviderId = m.ProviderId,
OrganisationAddressId = m.OrganisationAddressId,
AttachmentIds = m.AttachmentIds,
Attachments = m.Attachments
};
updatedModel.UpdateModel(Database, false);
if (updatedModel.Provider != null)
{
using (var ip = updatedModel.Provider.CreateInstance<InsuranceProviderFeature>())
{
updatedModel.ProviderSubmitJobBeginResult = ip.SubmitJobBegin(Database, this, updatedModel.Job, updatedModel.OrganisationAddress, updatedModel.TechUser);
}
}
return View(updatedModel);
case "Manual":
if (string.IsNullOrWhiteSpace(m.ManualProviderName))
{
ModelState.AddModelError("ManualProviderName", "The Provider Name is required");
return View(m);
}
try
{
m.Job.OnLogInsurance(Database, m.ManualProviderName, m.ManualProviderReference, m.OrganisationAddress, m.TechUser);
Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId));
}
catch (Exception ex)
{
m.Error = ex;
return View(Views.LogInsuranceError, m);
throw;
}
case "Disclose":
using (var p = m.Provider.CreateInstance<InsuranceProviderFeature>())
{
Dictionary<string, string> providerProperties;
try
{
providerProperties = p.SubmitJobParseProperties(Database, form, this, m.Job, m.OrganisationAddress, m.TechUser);
}
catch (Exception ex)
{
m.Error = ex;
return View(Views.LogInsuranceError, m);
}
if (!ModelState.IsValid)
return View(Views.LogInsurance, m);
if (providerProperties != null)
{
m.ProviderPropertiesJson = JsonConvert.SerializeObject(providerProperties);
}
m.DiscloseProperties = p.SubmitJobDiscloseInfo(Database, m.Job, m.OrganisationAddress, m.TechUser, providerProperties);
return View(Views.LogInsuranceDisclose, m);
}
case "Submit":
try
{
m.Job.OnLogInsurance(Database, m.Attachments, m.Provider, m.OrganisationAddress, m.TechUser, m.ProviderProperties());
Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId));
}
catch (Exception ex)
{
m.Error = ex;
return View(Views.LogInsuranceError, m);
throw;
}
default:
return RedirectToAction(MVC.Job.Show(m.JobId));
}
}
else
{
return View(m);
}
}
[DiscoAuthorize(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails)]
public virtual ActionResult InsuranceProviderJobDetails(int id)
{
var model = new Models.Job.ProviderJobDetailsModel();
Job job = Database.Jobs
.Include(j => j.Device.DeviceModel)
.Include(j => j.JobMetaNonWarranty)
.Include(j => j.JobMetaInsurance)
.Include(j => j.JobSubTypes)
.Where(j => j.Id == id).FirstOrDefault();
if (job != null)
{
if (job.JobMetaInsurance != null && !string.IsNullOrEmpty(job.JobMetaInsurance.Insurer))
{
var providerDef = InsuranceProviderFeature.FindPluginFeature(job.JobMetaInsurance.Insurer);
if (providerDef != null)
{
using (var providerInstance = providerDef.CreateInstance<InsuranceProviderFeature>())
{
if (providerInstance.JobDetailsSupported)
{
try
{
Tuple<Type, dynamic> details = providerInstance.JobDetails(Database, this, job);
model.JobDetailsSupported = true;
model.ViewType = details.Item1;
model.ViewModel = details.Item2;
return View(model);
}
catch (Exception ex)
{
model.JobDetailsSupported = false;
model.JobDetailsException = ex;
return View(model);
}
}
else
{
model.JobDetailsSupported = false;
model.JobDetailsNotSupportedMessage = $"Plugin '{providerInstance.Manifest.Name} ({providerInstance.Manifest.Id})' (Insurance Provider for '{providerInstance.ProviderId}') doesn't support Job Details";
return View(model);
}
}
}
model.JobDetailsSupported = false;
model.JobDetailsNotSupportedMessage = $"Repair Provider '{job.JobMetaNonWarranty.RepairerName}' is not integrated with Disco ICT";
return View(model);
}
else
{
model.JobDetailsSupported = false;
model.JobDetailsNotSupportedMessage = "Job not in the correct state";
return View(model);
}
}
else
{
return HttpNotFound("Invalid Job Id");
}
}
#endregion
} }
} }
+37
View File
@@ -833,6 +833,7 @@
<Compile Include="Models\Device\ExportModel.cs" /> <Compile Include="Models\Device\ExportModel.cs" />
<Compile Include="Models\Device\ImportHeadersModel.cs" /> <Compile Include="Models\Device\ImportHeadersModel.cs" />
<Compile Include="Models\InitialConfig\AdministratorsModel.cs" /> <Compile Include="Models\InitialConfig\AdministratorsModel.cs" />
<Compile Include="Models\Job\LogInsuranceModel.cs" />
<Compile Include="Models\Job\LogRepairModel.cs" /> <Compile Include="Models\Job\LogRepairModel.cs" />
<Compile Include="Extensions\T4MVC\T4MVC.cs"> <Compile Include="Extensions\T4MVC\T4MVC.cs">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@@ -860,21 +861,41 @@
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Views\Job\LogInsurance.generated.cs">
<DependentUpon>LogInsurance.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepair.generated.cs"> <Compile Include="Views\Job\LogRepair.generated.cs">
<DependentUpon>LogRepair.cshtml</DependentUpon> <DependentUpon>LogRepair.cshtml</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Views\Job\LogInsuranceDisclose.generated.cs">
<DependentUpon>LogInsuranceDisclose.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepairDisclose.generated.cs"> <Compile Include="Views\Job\LogRepairDisclose.generated.cs">
<DependentUpon>LogRepairDisclose.cshtml</DependentUpon> <DependentUpon>LogRepairDisclose.cshtml</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Views\Job\LogInsuranceError.generated.cs">
<DependentUpon>LogInsuranceError.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepairError.generated.cs"> <Compile Include="Views\Job\LogRepairError.generated.cs">
<DependentUpon>LogRepairError.cshtml</DependentUpon> <DependentUpon>LogRepairError.cshtml</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
<DesignTime>True</DesignTime> <DesignTime>True</DesignTime>
</Compile> </Compile>
<Compile Include="Views\Job\InsuranceProviderJobDetails.generated.cs">
<DependentUpon>InsuranceProviderJobDetails.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\RepairProviderJobDetails.generated.cs"> <Compile Include="Views\Job\RepairProviderJobDetails.generated.cs">
<DependentUpon>RepairProviderJobDetails.cshtml</DependentUpon> <DependentUpon>RepairProviderJobDetails.cshtml</DependentUpon>
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@@ -2043,6 +2064,22 @@
<None Include="ClientSource\Scripts\Modules\tinymce\themes\modern\theme.min.js" /> <None Include="ClientSource\Scripts\Modules\tinymce\themes\modern\theme.min.js" />
<None Include="ClientSource\Scripts\Modules\tinymce\tinymce.js" /> <None Include="ClientSource\Scripts\Modules\tinymce\tinymce.js" />
<None Include="ClientSource\Scripts\Modules\tinymce\tinymce.min.js" /> <None Include="ClientSource\Scripts\Modules\tinymce\tinymce.min.js" />
<None Include="Views\Job\LogInsurance.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogInsurance.generated.cs</LastGenOutput>
</None>
<None Include="Views\Job\LogInsuranceError.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogInsuranceError.generated.cs</LastGenOutput>
</None>
<None Include="Views\Job\LogInsuranceDisclose.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogInsuranceDisclose.generated.cs</LastGenOutput>
</None>
<None Include="Views\Job\InsuranceProviderJobDetails.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>InsuranceProviderJobDetails.generated.cs</LastGenOutput>
</None>
<None Include="Views\Job\RepairProviderJobDetails.cshtml"> <None Include="Views\Job\RepairProviderJobDetails.cshtml">
<Generator>RazorGenerator</Generator> <Generator>RazorGenerator</Generator>
<LastGenOutput>RepairProviderJobDetails.generated.cs</LastGenOutput> <LastGenOutput>RepairProviderJobDetails.generated.cs</LastGenOutput>
@@ -101,6 +101,18 @@ namespace Disco.Web.Controllers
{ {
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RepairProviderJobDetails); return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RepairProviderJobDetails);
} }
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult LogInsurance()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogInsurance);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult InsuranceProviderJobDetails()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InsuranceProviderJobDetails);
}
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public JobController Actions { get { return MVC.Job; } } public JobController Actions { get { return MVC.Job; } }
@@ -139,6 +151,8 @@ namespace Disco.Web.Controllers
public readonly string WarrantyProviderJobDetails = "WarrantyProviderJobDetails"; public readonly string WarrantyProviderJobDetails = "WarrantyProviderJobDetails";
public readonly string LogRepair = "LogRepair"; public readonly string LogRepair = "LogRepair";
public readonly string RepairProviderJobDetails = "RepairProviderJobDetails"; public readonly string RepairProviderJobDetails = "RepairProviderJobDetails";
public readonly string LogInsurance = "LogInsurance";
public readonly string InsuranceProviderJobDetails = "InsuranceProviderJobDetails";
} }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
@@ -166,6 +180,8 @@ namespace Disco.Web.Controllers
public const string WarrantyProviderJobDetails = "WarrantyProviderJobDetails"; public const string WarrantyProviderJobDetails = "WarrantyProviderJobDetails";
public const string LogRepair = "LogRepair"; public const string LogRepair = "LogRepair";
public const string RepairProviderJobDetails = "RepairProviderJobDetails"; public const string RepairProviderJobDetails = "RepairProviderJobDetails";
public const string LogInsurance = "LogInsurance";
public const string InsuranceProviderJobDetails = "InsuranceProviderJobDetails";
} }
@@ -235,6 +251,26 @@ namespace Disco.Web.Controllers
{ {
public readonly string id = "id"; public readonly string id = "id";
} }
static readonly ActionParamsClass_LogInsurance s_params_LogInsurance = new ActionParamsClass_LogInsurance();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_LogInsurance LogInsuranceParams { get { return s_params_LogInsurance; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_LogInsurance
{
public readonly string id = "id";
public readonly string providerId = "providerId";
public readonly string organisationAddressId = "organisationAddressId";
public readonly string m = "m";
public readonly string form = "form";
}
static readonly ActionParamsClass_InsuranceProviderJobDetails s_params_InsuranceProviderJobDetails = new ActionParamsClass_InsuranceProviderJobDetails();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_InsuranceProviderJobDetails InsuranceProviderJobDetailsParams { get { return s_params_InsuranceProviderJobDetails; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_InsuranceProviderJobDetails
{
public readonly string id = "id";
}
static readonly ViewsClass s_views = new ViewsClass(); static readonly ViewsClass s_views = new ViewsClass();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewsClass Views { get { return s_views; } } public ViewsClass Views { get { return s_views; } }
@@ -250,7 +286,11 @@ namespace Disco.Web.Controllers
public readonly string Create = "Create"; public readonly string Create = "Create";
public readonly string Create_Redirect = "Create_Redirect"; public readonly string Create_Redirect = "Create_Redirect";
public readonly string Index = "Index"; public readonly string Index = "Index";
public readonly string InsuranceProviderJobDetails = "InsuranceProviderJobDetails";
public readonly string List = "List"; public readonly string List = "List";
public readonly string LogInsurance = "LogInsurance";
public readonly string LogInsuranceDisclose = "LogInsuranceDisclose";
public readonly string LogInsuranceError = "LogInsuranceError";
public readonly string LogRepair = "LogRepair"; public readonly string LogRepair = "LogRepair";
public readonly string LogRepairDisclose = "LogRepairDisclose"; public readonly string LogRepairDisclose = "LogRepairDisclose";
public readonly string LogRepairError = "LogRepairError"; public readonly string LogRepairError = "LogRepairError";
@@ -266,7 +306,11 @@ namespace Disco.Web.Controllers
public readonly string Create = "~/Views/Job/Create.cshtml"; public readonly string Create = "~/Views/Job/Create.cshtml";
public readonly string Create_Redirect = "~/Views/Job/Create_Redirect.cshtml"; public readonly string Create_Redirect = "~/Views/Job/Create_Redirect.cshtml";
public readonly string Index = "~/Views/Job/Index.cshtml"; public readonly string Index = "~/Views/Job/Index.cshtml";
public readonly string InsuranceProviderJobDetails = "~/Views/Job/InsuranceProviderJobDetails.cshtml";
public readonly string List = "~/Views/Job/List.cshtml"; public readonly string List = "~/Views/Job/List.cshtml";
public readonly string LogInsurance = "~/Views/Job/LogInsurance.cshtml";
public readonly string LogInsuranceDisclose = "~/Views/Job/LogInsuranceDisclose.cshtml";
public readonly string LogInsuranceError = "~/Views/Job/LogInsuranceError.cshtml";
public readonly string LogRepair = "~/Views/Job/LogRepair.cshtml"; public readonly string LogRepair = "~/Views/Job/LogRepair.cshtml";
public readonly string LogRepairDisclose = "~/Views/Job/LogRepairDisclose.cshtml"; public readonly string LogRepairDisclose = "~/Views/Job/LogRepairDisclose.cshtml";
public readonly string LogRepairError = "~/Views/Job/LogRepairError.cshtml"; public readonly string LogRepairError = "~/Views/Job/LogRepairError.cshtml";
@@ -609,6 +653,45 @@ namespace Disco.Web.Controllers
return callInfo; return callInfo;
} }
[NonAction]
partial void LogInsuranceOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string providerId, int? organisationAddressId);
[NonAction]
public override System.Web.Mvc.ActionResult LogInsurance(int id, string providerId, int? organisationAddressId)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogInsurance);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "providerId", providerId);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "organisationAddressId", organisationAddressId);
LogInsuranceOverride(callInfo, id, providerId, organisationAddressId);
return callInfo;
}
[NonAction]
partial void LogInsuranceOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Models.Job.LogInsuranceModel m, System.Web.Mvc.FormCollection form);
[NonAction]
public override System.Web.Mvc.ActionResult LogInsurance(Disco.Web.Models.Job.LogInsuranceModel m, System.Web.Mvc.FormCollection form)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogInsurance);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "m", m);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "form", form);
LogInsuranceOverride(callInfo, m, form);
return callInfo;
}
[NonAction]
partial void InsuranceProviderJobDetailsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
[NonAction]
public override System.Web.Mvc.ActionResult InsuranceProviderJobDetails(int id)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.InsuranceProviderJobDetails);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
InsuranceProviderJobDetailsOverride(callInfo, id);
return callInfo;
}
} }
} }
+125
View File
@@ -0,0 +1,125 @@
using Disco.Data.Repository;
using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.InsuranceProvider;
using Disco.Services.Users;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Data.Entity;
namespace Disco.Web.Models.Job
{
public class LogInsuranceModel
{
public Disco.Models.Repository.Job Job { get; set; }
public List<PluginFeatureManifest> Providers { get; set; }
public PluginFeatureManifest Provider { get; set; }
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
public Disco.Models.BI.Config.OrganisationAddress OrganisationAddress { get; set; }
public List<Disco.Models.Repository.JobAttachment> Attachments { get; set; }
public Disco.Models.Repository.User TechUser { get; set; }
[Required]
public int JobId { get; set; }
[Required(ErrorMessage = "Please specify a Address")]
public int? OrganisationAddressId { get; set; }
[Required(ErrorMessage = "Please specify a Provider")]
public string ProviderId { get; set; }
public List<int> AttachmentIds { get; set; }
[Required]
public string SubmissionAction { get; set; }
public bool IsManualProvider =>
ProviderId == "MANUAL";
public string ManualProviderName { get; set; }
public string ManualProviderReference { get; set; }
public Tuple<Type, object> ProviderSubmitJobBeginResult { get; set; }
public string ProviderPropertiesJson { get; set; }
public Dictionary<string, string> ProviderProperties()
{
var p = default(Dictionary<string, string>);
if (!string.IsNullOrEmpty(ProviderPropertiesJson))
{
try
{
p = JsonConvert.DeserializeObject<Dictionary<string, string>>(ProviderPropertiesJson);
}
catch (Exception)
{
// Ignore Errors
}
}
return p;
}
public Dictionary<string, string> DiscloseProperties { get; set; }
public Exception Error { get; set; }
public void UpdateModel(DiscoDataContext Database, bool IsPostBack)
{
Database.Configuration.LazyLoadingEnabled = true;
if (Job == null)
{
string jobUserId = Database.Jobs.Where(j => j.Id == JobId).Select(j => j.UserId).FirstOrDefault();
if (jobUserId != null)
{
// Ignore update errors (Most commonly when the User Id no longer exists in AD)
try
{
UserService.GetUser(jobUserId, Database, true);
}
catch (Exception) { }
}
Job = Database.Jobs
.Include(j => j.Device.DeviceModel)
.Include(j => j.JobMetaNonWarranty)
.Include(j => j.JobMetaInsurance)
.Include(j => j.JobSubTypes)
.Include(j => j.JobAttachments)
.Where(j => j.Id == JobId)
.FirstOrDefault();
if (Job == null)
throw new ArgumentException("Invalid Job Number Specified", "JobId");
}
TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true);
Providers = Plugins.GetPluginFeatures(typeof(InsuranceProviderFeature));
if (!IsPostBack && string.IsNullOrEmpty(ProviderId))
ProviderId = "MANUAL";
if (!string.IsNullOrEmpty(ProviderId) && ProviderId != "MANUAL")
Provider = Plugins.GetPluginFeature(ProviderId, typeof(InsuranceProviderFeature));
OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
if (!IsPostBack && !OrganisationAddressId.HasValue)
{
OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress;
if (!OrganisationAddressId.HasValue && OrganisationAddresses.Count == 1)
OrganisationAddressId = OrganisationAddresses[0].Id;
}
if (OrganisationAddressId.HasValue)
OrganisationAddress = OrganisationAddresses.FirstOrDefault(oa => oa.Id == OrganisationAddressId.Value);
if (AttachmentIds == null)
{
AttachmentIds = new List<int>();
Attachments = new List<Disco.Models.Repository.JobAttachment>();
}
else
{
Attachments = Job.JobAttachments.Where(ja => AttachmentIds.Contains(ja.Id)).ToList();
}
}
}
}
+8 -1
View File
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq; using System.Linq;
namespace Disco.Web.Models.Job namespace Disco.Web.Models.Job
@@ -84,7 +85,11 @@ namespace Disco.Web.Models.Job
catch (Exception) { } catch (Exception) { }
} }
Job = Database.Jobs.Include("Device.DeviceModel").Include("JobMetaWarranty").Include("JobSubTypes").Include("JobAttachments") Job = Database.Jobs
.Include(j => j.Device.DeviceModel)
.Include(j => j.JobMetaNonWarranty)
.Include(j => j.JobSubTypes)
.Include(j => j.JobAttachments)
.Where(j => j.Id == JobId) .Where(j => j.Id == JobId)
.FirstOrDefault(); .FirstOrDefault();
@@ -113,6 +118,8 @@ namespace Disco.Web.Models.Job
if (!IsPostBack && !this.OrganisationAddressId.HasValue) if (!IsPostBack && !this.OrganisationAddressId.HasValue)
{ {
OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress; OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress;
if (!OrganisationAddressId.HasValue && OrganisationAddresses.Count == 1)
OrganisationAddressId = OrganisationAddresses[0].Id;
} }
if (this.OrganisationAddressId.HasValue) if (this.OrganisationAddressId.HasValue)
this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value); this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value);
+8 -1
View File
@@ -6,6 +6,7 @@ using Newtonsoft.Json;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Data.Entity;
using System.Linq; using System.Linq;
namespace Disco.Web.Models.Job namespace Disco.Web.Models.Job
@@ -84,7 +85,11 @@ namespace Disco.Web.Models.Job
} catch (Exception) {} } catch (Exception) {}
} }
Job = Database.Jobs.Include("Device.DeviceModel").Include("JobMetaWarranty").Include("JobSubTypes").Include("JobAttachments") Job = Database.Jobs
.Include(j => j.Device.DeviceModel)
.Include(j => j.JobMetaWarranty)
.Include(j => j.JobSubTypes)
.Include(j => j.JobAttachments)
.Where(j => j.Id == JobId) .Where(j => j.Id == JobId)
.FirstOrDefault(); .FirstOrDefault();
@@ -113,6 +118,8 @@ namespace Disco.Web.Models.Job
if (!IsPostBack && !this.OrganisationAddressId.HasValue) if (!IsPostBack && !this.OrganisationAddressId.HasValue)
{ {
OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress; OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress;
if (!OrganisationAddressId.HasValue && OrganisationAddresses.Count == 1)
OrganisationAddressId = OrganisationAddresses[0].Id;
} }
if (this.OrganisationAddressId.HasValue) if (this.OrganisationAddressId.HasValue)
this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value); this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value);
@@ -0,0 +1,55 @@
@model Disco.Web.Models.Job.ProviderJobDetailsModel
@{ Layout = null;
Authorization.Require(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails);
if (Model.JobDetailsException != null)
{
<h3>
Error:</h3>
<div>
<strong>@Model.JobDetailsException.Message</strong>
</div>
<a href="#" id="errorShow" class="smallMessage">(show more)</a>
<div id="errorMore" style="display: none">
<br />
<strong>Error Type: </strong>@Model.JobDetailsException.GetType().Name
<br />
<strong>Stack Trace:</strong>
<div class="code">
@Model.JobDetailsException.StackTrace.ToMultilineString()
</div>
@if (Model.JobDetailsException.InnerException != null)
{
<hr />
<div>
<strong>Inner Exception:</strong> @Model.JobDetailsException.InnerException.Message<br />
<strong>Error Type:</strong> @Model.JobDetailsException.GetType().Name<br />
<strong>Stack Trace:</strong>
<div class="code">
@Model.JobDetailsException.InnerException.StackTrace
</div>
</div>
}
<script type="text/javascript">
$(function () {
$('#errorShow').click(function () {
$(this).hide();
$('#errorMore').slideDown();
});
});
</script>
</div>
}
else
{
if (Model.JobDetailsSupported)
{
@Html.PartialCompiled(Model.ViewType, Model.ViewModel)
}
else
{
<span class="smallMessage">@Model.JobDetailsNotSupportedMessage</span>
}
}
}
@@ -0,0 +1,236 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/InsuranceProviderJobDetails.cshtml")]
public partial class InsuranceProviderJobDetails : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ProviderJobDetailsModel>
{
public InsuranceProviderJobDetails()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Layout = null;
Authorization.Require(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails);
if (Model.JobDetailsException != null)
{
#line default
#line hidden
WriteLiteral(" <h3>\r\n Error:</h3>\r\n");
WriteLiteral(" <div>\r\n <strong>");
#line 11 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.Message);
#line default
#line hidden
WriteLiteral("</strong>\r\n </div>\r\n");
WriteLiteral(" <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"errorShow\"");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">(show more)</a>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"errorMore\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 16 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.GetType().Name);
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n <strong>Stack Trace:</strong>\r\n <div");
WriteLiteral(" class=\"code\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 20 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.StackTrace.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 22 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
#line default
#line hidden
#line 22 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
if (Model.JobDetailsException.InnerException != null)
{
#line default
#line hidden
WriteLiteral(" <hr />\r\n");
WriteLiteral(" <div>\r\n <strong>Inner Exception:</strong> ");
#line 26 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.Message);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 27 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.GetType().Name);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Stack Trace:</strong>\r\n <div");
WriteLiteral(" class=\"code\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 30 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.StackTrace);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 33 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n $(\'#errorShow\').click(function ()" +
" {\r\n $(this).hide();\r\n $(\'#errorMore\').sli" +
"deDown();\r\n });\r\n });\r\n </script>\r\n </div>\r\n" +
"");
#line 43 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
}
else
{
if (Model.JobDetailsSupported)
{
#line default
#line hidden
#line 48 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Html.PartialCompiled(Model.ViewType, Model.ViewModel));
#line default
#line hidden
#line 48 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 52 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
Write(Model.JobDetailsNotSupportedMessage);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 53 "..\..\Views\Job\InsuranceProviderJobDetails.cshtml"
}
}
#line default
#line hidden
WriteLiteral("\r\n");
}
}
}
#pragma warning restore 1591
+449 -357
View File
@@ -8,13 +8,14 @@
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails)) if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceDetails))
{ {
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
<tr> <tr>
<th style="width: 230px;">Date of Loss or Damage <th style="width: 230px;">
</th> Date of Loss or Damage
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.LossOrDamageDate) <td>
@AjaxHelpers.AjaxLoader() @Html.EditorFor(m => m.Job.JobMetaInsurance.LossOrDamageDate)
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
var dateField = $('#Job_JobMetaInsurance_LossOrDamageDate'); var dateField = $('#Job_JobMetaInsurance_LossOrDamageDate');
document.DiscoFunctions.DateChangeHelper( document.DiscoFunctions.DateChangeHelper(
@@ -25,17 +26,18 @@
null null
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Event Location <th>
</th> Event Location
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.EventLocation) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.EventLocation)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_EventLocation'), $('#Job_JobMetaInsurance_EventLocation'),
@@ -44,17 +46,18 @@
'EventLocation' 'EventLocation'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Description <th>
</th> Description
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.Description) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.Description)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_Description'), $('#Job_JobMetaInsurance_Description'),
@@ -63,31 +66,32 @@
'Description' 'Description'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;">&nbsp; <th style="width: 200px;">
</th> &nbsp;
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)@Html.LabelFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)@Html.LabelFor(m => m.Job.JobMetaInsurance.ThirdPartyCaused)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;"> @AjaxHelpers.AjaxLoader()
<div> <div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;">
<h5>Third Party Name</h5> <div>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedName) <h5>Third Party Name</h5>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedName)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>Why Third Parties Fault</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedWhy)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div> </div>
<div> <script type="text/javascript">
<h5>Why Third Parties Fault</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.ThirdPartyCausedWhy)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div>
<script type="text/javascript">
$(function () { $(function () {
var thirdPartyField = $('#Job_JobMetaInsurance_ThirdPartyCaused'); var thirdPartyField = $('#Job_JobMetaInsurance_ThirdPartyCaused');
var thirdPartyDetails = $('#Job_JobMetaInsurance_ThirdPartyCaused_Details'); var thirdPartyDetails = $('#Job_JobMetaInsurance_ThirdPartyCaused_Details');
@@ -128,17 +132,18 @@
'ThirdPartyCausedWhy' 'ThirdPartyCausedWhy'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Witnessed by (Name/Address) <th>
</th> Witnessed by (Name/Address)
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.WitnessesNamesAddresses) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.WitnessesNamesAddresses)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_WitnessesNamesAddresses'), $('#Job_JobMetaInsurance_WitnessesNamesAddresses'),
@@ -147,17 +152,18 @@
'WitnessesNamesAddresses' 'WitnessesNamesAddresses'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Burglary/Theft - Method of Entry <th>
</th> Burglary/Theft - Method of Entry
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_BurglaryTheftMethodOfEntry'), $('#Job_JobMetaInsurance_BurglaryTheftMethodOfEntry'),
@@ -166,16 +172,17 @@
'BurglaryTheftMethodOfEntry' 'BurglaryTheftMethodOfEntry'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;">Property Last Seen <th style="width: 200px;">
</th> Property Last Seen
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PropertyLastSeenDate) <td>
@AjaxHelpers.AjaxLoader() @Html.EditorFor(m => m.Job.JobMetaInsurance.PropertyLastSeenDate)
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
var dateField = $('#Job_JobMetaInsurance_PropertyLastSeenDate'); var dateField = $('#Job_JobMetaInsurance_PropertyLastSeenDate');
document.DiscoFunctions.DateChangeHelper( document.DiscoFunctions.DateChangeHelper(
@@ -186,36 +193,37 @@
null null
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;">&nbsp; <th style="width: 200px;">
</th> &nbsp;
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotified)@Html.LabelFor(m => m.Job.JobMetaInsurance.PoliceNotified) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotified)@Html.LabelFor(m => m.Job.JobMetaInsurance.PoliceNotified)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;"> @AjaxHelpers.AjaxLoader()
<div> <div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<h5>Station</h5> <div>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedStation) <h5>Station</h5>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedStation)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>Date</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedDate)
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>Crime Report #</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div> </div>
<div> <script type="text/javascript">
<h5>Date</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedDate)
@AjaxHelpers.AjaxLoader()
</div>
<div>
<h5>Crime Report #</h5>
@Html.EditorFor(m => m.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
</div>
</div>
<script type="text/javascript">
$(function () { $(function () {
var policeNotifiedField = $('#Job_JobMetaInsurance_PoliceNotified'); var policeNotifiedField = $('#Job_JobMetaInsurance_PoliceNotified');
var policeNotifiedDetails = $('#Job_JobMetaInsurance_PoliceNotified_Details'); var policeNotifiedDetails = $('#Job_JobMetaInsurance_PoliceNotified_Details');
@@ -265,17 +273,18 @@
'PoliceNotifiedCrimeReportNo' 'PoliceNotifiedCrimeReportNo'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Action to Recover/Reduce Loss <th>
</th> Action to Recover/Reduce Loss
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.RecoverReduceAction) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.RecoverReduceAction)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_RecoverReduceAction'), $('#Job_JobMetaInsurance_RecoverReduceAction'),
@@ -284,17 +293,18 @@
'RecoverReduceAction' 'RecoverReduceAction'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Other Interested Parties <th>
</th> Other Interested Parties
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.OtherInterestedParties) <td>
@AjaxHelpers.AjaxSave() @Html.EditorFor(m => m.Job.JobMetaInsurance.OtherInterestedParties)
@AjaxHelpers.AjaxLoader() @AjaxHelpers.AjaxSave()
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
document.DiscoFunctions.PropertyChangeHelper( document.DiscoFunctions.PropertyChangeHelper(
$('#Job_JobMetaInsurance_OtherInterestedParties'), $('#Job_JobMetaInsurance_OtherInterestedParties'),
@@ -303,16 +313,17 @@
'OtherInterestedParties' 'OtherInterestedParties'
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 200px;">Date of Purchase <th style="width: 200px;">
</th> Date of Purchase
<td> </th>
@Html.EditorFor(m => m.Job.JobMetaInsurance.DateOfPurchase) <td>
@AjaxHelpers.AjaxLoader() @Html.EditorFor(m => m.Job.JobMetaInsurance.DateOfPurchase)
<script type="text/javascript"> @AjaxHelpers.AjaxLoader()
<script type="text/javascript">
$(function () { $(function () {
var dateField = $('#Job_JobMetaInsurance_DateOfPurchase'); var dateField = $('#Job_JobMetaInsurance_DateOfPurchase');
document.DiscoFunctions.DateChangeHelper( document.DiscoFunctions.DateChangeHelper(
@@ -324,232 +335,313 @@
true true
); );
}); });
</script> </script>
</td> </td>
</tr> </tr>
} }
else else
{ {
<tr> <tr>
<th style="width: 230px;">Date of Loss or Damage <th style="width: 230px;">
</th> Date of Loss or Damage
<td> </th>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.LossOrDamageDate, "Unknown", null) <td>
</td> @CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.LossOrDamageDate, "Unknown", null)
</tr> </td>
<tr> </tr>
<th>Event Location <tr>
</th> <th>
<td> Event Location
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.EventLocation)) </th>
{ <td>
<span class="smallMessage">&lt;Unknown/None&gt;</span> @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.EventLocation))
} {
else <span class="smallMessage">&lt;Unknown/None&gt;</span>
{ }
@Model.Job.JobMetaInsurance.EventLocation else
} {
</td> @Model.Job.JobMetaInsurance.EventLocation
</tr> }
<tr> </td>
<th>Description </tr>
</th> <tr>
<td> <th>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.Description)) Description
{ </th>
<span class="smallMessage">&lt;None&gt;</span> <td>
} @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.Description))
else {
{ <span class="smallMessage">&lt;None&gt;</span>
@Model.Job.JobMetaInsurance.Description }
} else
</td> {
</tr> @Model.Job.JobMetaInsurance.Description
<tr> }
<th style="width: 200px;">Caused by Third Party </td>
</th> </tr>
<td> <tr>
@if (Model.Job.JobMetaInsurance.ThirdPartyCaused) <th style="width: 200px;">
{ Caused by Third Party
<div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;"> </th>
<div> <td>
<h5>Third Party Name</h5> @if (Model.Job.JobMetaInsurance.ThirdPartyCaused)
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedName)) {
{ <div id="Job_JobMetaInsurance_ThirdPartyCaused_Details" style="padding-left: 25px;">
<span class="smallMessage">&lt;Unknown&gt;</span> <div>
} <h5>Third Party Name</h5>
else @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedName))
{ {
@Model.Job.JobMetaInsurance.ThirdPartyCausedName <span class="smallMessage">&lt;Unknown&gt;</span>
} }
else
{
@Model.Job.JobMetaInsurance.ThirdPartyCausedName
}
</div>
<div>
<h5>Why Third Parties Fault</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedWhy))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.ThirdPartyCausedWhy
}
</div>
</div> </div>
<div> }
<h5>Why Third Parties Fault</h5> else
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.ThirdPartyCausedWhy)) {
{ <span class="smallMessage">&lt;Not Caused by Third Party&gt;</span>
<span class="smallMessage">&lt;Unknown&gt;</span> }
} </td>
else </tr>
{ <tr>
@Model.Job.JobMetaInsurance.ThirdPartyCausedWhy <th>
} Witnessed by (Name/Address)
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.WitnessesNamesAddresses))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.WitnessesNamesAddresses
}
</td>
</tr>
<tr>
<th>
Burglary/Theft - Method of Entry
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry
}
</td>
</tr>
<tr>
<th style="width: 200px;">
Property Last Seen
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PropertyLastSeenDate, "Unknown", null)
</td>
</tr>
<tr>
<th style="width: 200px;">
&nbsp;
Police Notified
</th>
<td>
@if (Model.Job.JobMetaInsurance.PoliceNotified)
{
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<div>
<h5>Station</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedStation))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedStation
}
</div>
<div>
<h5>Date</h5>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PoliceNotifiedDate, "Unknown", null)
</div>
<div>
<h5>Crime Report #</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo
}
</div>
</div> </div>
</div> }
} else
else {
{ <span class="smallMessage">&lt;Not Notified&gt;</span>
<span class="smallMessage">&lt;Not Caused by Third Party&gt;</span> }
} </td>
</td> </tr>
</tr> <tr>
<tr> <th>
<th>Witnessed by (Name/Address) Action to Recover/Reduce Loss
</th> </th>
<td> <td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.WitnessesNamesAddresses)) @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.RecoverReduceAction))
{ {
<span class="smallMessage">&lt;Unknown/None&gt;</span> <span class="smallMessage">&lt;Unknown/None&gt;</span>
} }
else else
{ {
@Model.Job.JobMetaInsurance.WitnessesNamesAddresses @Model.Job.JobMetaInsurance.RecoverReduceAction
} }
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Burglary/Theft - Method of Entry <th>
</th> Other Interested Parties
<td> </th>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry)) <td>
{ @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.OtherInterestedParties))
<span class="smallMessage">&lt;Unknown/None&gt;</span> {
} <span class="smallMessage">&lt;Unknown/None&gt;</span>
else }
{ else
@Model.Job.JobMetaInsurance.BurglaryTheftMethodOfEntry {
} @Model.Job.JobMetaInsurance.OtherInterestedParties
</td> }
</tr> </td>
<tr> </tr>
<th style="width: 200px;">Property Last Seen <tr>
</th> <th style="width: 200px;">
<td> Date of Purchase
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PropertyLastSeenDate, "Unknown", null) </th>
</td> <td>
</tr> @CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.DateOfPurchase, "Unknown", null)
<tr> </td>
<th style="width: 200px;">&nbsp; </tr>
Police Notified
</th>
<td>
@if (Model.Job.JobMetaInsurance.PoliceNotified)
{
<div id="Job_JobMetaInsurance_PoliceNotified_Details" style="padding-left: 25px;">
<div>
<h5>Station</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedStation))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedStation
}
</div>
<div>
<h5>Date</h5>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.PoliceNotifiedDate, "Unknown", null)
</div>
<div>
<h5>Crime Report #</h5>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo))
{
<span class="smallMessage">&lt;Unknown&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.PoliceNotifiedCrimeReportNo
}
</div>
</div>
}
else
{
<span class="smallMessage">&lt;Not Notified&gt;</span>
}
</td>
</tr>
<tr>
<th>Action to Recover/Reduce Loss
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.RecoverReduceAction))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.RecoverReduceAction
}
</td>
</tr>
<tr>
<th>Other Interested Parties
</th>
<td>
@if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.OtherInterestedParties))
{
<span class="smallMessage">&lt;Unknown/None&gt;</span>
}
else
{
@Model.Job.JobMetaInsurance.OtherInterestedParties
}
</td>
</tr>
<tr>
<th style="width: 200px;">Date of Purchase
</th>
<td>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.DateOfPurchase, "Unknown", null)
</td>
</tr>
} }
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent)) if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent))
{ {
<tr> <tr>
<th>Claim Form Sent Date <th>
</th> Claim Form Sent Date
<td> </th>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate") <td>
<span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span> @CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
<script> <span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span>
$(function () { </td>
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))'; </tr>
var jobOpenDate = '@(Model.Job.OpenedDate.ToISO8601())'; <tr>
<th>
document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Claim Form Sent Date', 'Job_JobMetaInsurance_ClaimFormSentDate', 'Job_JobMetaInsurance_ClaimFormSentUserId', 'InsuranceClaimFormSentDate', 'Not Sent', jobOpenDate, false); Insurer
}); </th>
</script> <td>
</td> @if (string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.Insurer) && !Model.Job.JobMetaInsurance.ClaimFormSentDate.HasValue)
</tr> {
if (Model.Job.CanLogInsurance())
{
@Html.ActionLinkButton("Lodge Insurance Claim", MVC.Job.LogInsurance(Model.Job.Id, null, null))
}
else
{
<span>Not Logged</span>
}
}
else
{
<span id="Job_JobMetaInsurance_Insurer">@Model.Job.JobMetaInsurance.Insurer</span>
if (!string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.InsurerReference))
{
<span>(reference: <span id="Job_JobMetaInsurance_InsurerReference">@Model.Job.JobMetaInsurance.InsurerReference</span>)</span>
}
}
</td>
</tr>
} }
else else
{ {
<tr> <tr>
<th>Claim Form Sent Date <th>
</th> Claim Form Sent Date
<td> </th>
@CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate") <td>
<span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span> @CommonHelpers.FriendlyDate(Model.Job.JobMetaInsurance.ClaimFormSentDate, "Not Sent", "Job_JobMetaInsurance_ClaimFormSentDate")
</td> <span id="Job_JobMetaInsurance_ClaimFormSentUserId">@(string.IsNullOrEmpty(Model.Job.JobMetaInsurance.ClaimFormSentUserId) ? string.Empty : string.Format("by {0}", Model.Job.JobMetaInsurance.ClaimFormSentUser.ToString()))</span>
</tr> </td>
</tr>
<tr>
<th>
Insurer
</th>
<td>
<span id="Job_JobMetaInsurance_Insurer">@Model.Job.JobMetaInsurance.Insurer</span>
@if (!string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.InsurerReference))
{
<span>(reference: <span id="Job_JobMetaInsurance_InsurerReference">@Model.Job.JobMetaInsurance.InsurerReference</span>)</span>
}
</td>
</tr>
}
if (!string.IsNullOrEmpty(Model.Job.JobMetaInsurance.Insurer))
{
<tr id="jobInsuranceProviderDetailContainer" style="display: none">
<th style="width: 200px;">
Provider Details
</th>
<td>
<div id="jobInsuranceProviderDetailLoading">
<span class="ajaxLoading" title="Loading..."></span>Loading...
</div>
<div id="jobInsuranceProviderDetailHost" class="clearfix" style="display: none">
</div>
</td>
</tr>
<script type="text/javascript">
$(function () {
let providerDetailLoaded = false;
$('#jobDetailTabs').on('tabsactivate', function (e, ui) {
if ($(ui.newPanel).is('#jobDetailTab-NonWarrantyInsurance')) {
if (!providerDetailLoaded) {
$('#jobInsuranceProviderDetailContainer').show();
$('#jobRepairProviderDetailLoading span').show();
$('#jobInsuranceProviderDetailHost').load(
'@(Url.Action(MVC.Job.InsuranceProviderJobDetails(Model.Job.Id)))',
function () {
$('#jobInsuranceProviderDetailLoading').hide();
$(this).slideDown();
}
);
providerDetailLoaded = true;
}
}
});
});
</script>
} }
} }
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.IsInsuranceClaim)) @if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.IsInsuranceClaim) && Model.Job.JobMetaInsurance == null || string.IsNullOrWhiteSpace(Model.Job.JobMetaInsurance.Insurer))
{ {
<tr> <tr>
<th>Insurance Claim <th>
Insurance Claim
</th> </th>
<td> <td>
<div style="padding: 8px; text-align: center"> <div style="padding: 8px; text-align: center">
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -128,7 +128,7 @@
<td> <td>
@if (Model.Job.CanLogRepair()) @if (Model.Job.CanLogRepair())
{ {
@Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Repair_Actions_LogRepair_Button") @Html.ActionLinkSmallButton("Lodge Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Repair_Actions_LogRepair_Button")
} }
else else
{ {
@@ -599,14 +599,14 @@ WriteLiteral(">Actions\r\n </th>\r\n <td>\r\n");
#line hidden #line hidden
#line 131 "..\..\Views\Job\JobParts\Repairs.cshtml" #line 131 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Repair_Actions_LogRepair_Button")); Write(Html.ActionLinkSmallButton("Lodge Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Repair_Actions_LogRepair_Button"));
#line default #line default
#line hidden #line hidden
#line 131 "..\..\Views\Job\JobParts\Repairs.cshtml" #line 131 "..\..\Views\Job\JobParts\Repairs.cshtml"
} }
else else
{ {
+1 -1
View File
@@ -127,7 +127,7 @@
<td> <td>
@if (Model.Job.CanLogWarranty()) @if (Model.Job.CanLogWarranty())
{ {
@Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Warranty_Actions_LogWarranty_Button") @Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Warranty_Actions_LogWarranty_Button")
} }
else else
{ {
@@ -612,14 +612,14 @@ WriteLiteral(">Actions\r\n </th>\r\n <td>\r\n");
#line hidden #line hidden
#line 130 "..\..\Views\Job\JobParts\Warranty.cshtml" #line 130 "..\..\Views\Job\JobParts\Warranty.cshtml"
Write(Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Warranty_Actions_LogWarranty_Button")); Write(Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Warranty_Actions_LogWarranty_Button"));
#line default #line default
#line hidden #line hidden
#line 130 "..\..\Views\Job\JobParts\Warranty.cshtml" #line 130 "..\..\Views\Job\JobParts\Warranty.cshtml"
} }
else else
{ {
+4 -4
View File
@@ -882,19 +882,19 @@
} }
@if (Model.Job.CanLogWarranty()) @if (Model.Job.CanLogWarranty())
{ {
@Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button") @Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button")
} }
@if (Model.Job.CanWarrantyCompleted()) @if (Model.Job.CanWarrantyCompleted())
{ {
@Html.ActionLinkSmallButton("Warranty Complete", MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_WarrantyComplete_Button", "alert") @Html.ActionLinkSmallButton("Warranty Complete", MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_WarrantyComplete_Button", "alert")
} }
@if (Model.Job.CanInsuranceClaimFormSent()) @if (Model.Job.CanLogInsurance())
{ {
@Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert") @Html.ActionLinkSmallButton("Lodge Insurance", MVC.Job.LogInsurance(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogInsurance_Button", "alert")
} }
@if (Model.Job.CanLogRepair()) @if (Model.Job.CanLogRepair())
{ {
@Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button") @Html.ActionLinkSmallButton("Lodge Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button")
} }
@if (Model.Job.CanRepairComplete()) @if (Model.Job.CanRepairComplete())
{ {
@@ -2980,14 +2980,14 @@ WriteLiteral(" ");
#line hidden #line hidden
#line 885 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 885 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button")); Write(Html.ActionLinkSmallButton("Lodge Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button"));
#line default #line default
#line hidden #line hidden
#line 885 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 885 "..\..\Views\Job\JobParts\_Subject.cshtml"
} }
@@ -3022,7 +3022,7 @@ WriteLiteral(" ");
#line 891 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 891 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanInsuranceClaimFormSent()) if (Model.Job.CanLogInsurance())
{ {
@@ -3030,14 +3030,14 @@ WriteLiteral(" ");
#line hidden #line hidden
#line 893 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 893 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert")); Write(Html.ActionLinkSmallButton("Lodge Insurance", MVC.Job.LogInsurance(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogInsurance_Button", "alert"));
#line default #line default
#line hidden #line hidden
#line 893 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 893 "..\..\Views\Job\JobParts\_Subject.cshtml"
} }
@@ -3055,14 +3055,14 @@ WriteLiteral(" ");
#line hidden #line hidden
#line 897 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 897 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button")); Write(Html.ActionLinkSmallButton("Lodge Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button"));
#line default #line default
#line hidden #line hidden
#line 897 "..\..\Views\Job\JobParts\_Subject.cshtml" #line 897 "..\..\Views\Job\JobParts\_Subject.cshtml"
} }
+185
View File
@@ -0,0 +1,185 @@
@model Disco.Web.Models.Job.LogInsuranceModel
@{
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim");
}
@using (Html.BeginForm(MVC.Job.LogInsurance(), FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId)
@Html.ValidationMessageFor(m => m.JobId)
<input type="hidden" name="SubmissionAction" value="@(Model.IsManualProvider ? "Manual" : "Disclose")" />
<div id="insuranceJobForm" 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">Address:
</th>
<td>
@Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br />
@Html.ValidationMessageFor(m => m.OrganisationAddressId)
<div id="organisationAddressDetails">
@{
var oa = Model.OrganisationAddress;
if (oa != null)
{
<span>@oa.Address</span>
<br />
<span>@oa.Suburb, @oa.Postcode</span>
<br />
<span>@oa.State, @oa.Country</span>
}
}
</div>
</td>
</tr>
<tr>
<th>Insurance Provider:
</th>
<td>
@Html.DropDownListFor(model => model.ProviderId, Model.Providers.ToSelectListItems(Model.ProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } }))<br />
@Html.ValidationMessageFor(m => m.ProviderId)
@if (Model.Providers.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install))
{
<div class="info-box">
<p class="fa-p">
<i class="fa fa-info-circle"></i>View the <a href="@(Url.Action(MVC.Config.Plugins.Install()))">Plugin Catalogue</a> to discover and install provider plugins.
</p>
</div>
}
</td>
</tr>
@if (Model.IsManualProvider)
{
<tr>
<th>Insurer Name:</th>
<td>
@Html.EditorFor(model => model.ManualProviderName)<br />
@Html.ValidationMessageFor(m => m.ManualProviderName)
</td>
</tr>
<tr>
<th>Insurer Reference:</th>
<td>
@Html.EditorFor(model => model.ManualProviderReference)<br />
@Html.ValidationMessageFor(m => m.ManualProviderReference)
</td>
</tr>
}
</table>
</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="AttachmentIds" value="@ja.Id" @(Model.AttachmentIds.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.Provider != null && Model.ProviderSubmitJobBeginResult != null)
{
<div id="providerProperties">
@Html.PartialCompiled(Model.ProviderSubmitJobBeginResult.Item1, Model.ProviderSubmitJobBeginResult.Item2)
</div>
}
<div class="actionBar">
@if (Model.IsManualProvider)
{
<input type="submit" class="button" value="Save Insurance Claim" />
}
else
{
<input type="submit" class="button" value="Preview Insurance Claim" />
}
</div>
}
<script type="text/javascript">
$(function () {
var $providerId = $('#ProviderId');
var $addressId = $('#OrganisationAddressId');
function updateDetails() {
$('<form>').attr({
action: $providerId.closest('form').attr('action'),
method: 'post'
}).append(
$('<input>').attr({ type: 'hidden', name: 'SubmissionAction', value: 'Update' })
).append(
$('<input>').attr({ type: 'hidden', name: 'JobId', value: $('#JobId').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'ProviderId', value: $providerId.val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'OrganisationAddressId', value: $addressId.val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() })
).append(
$('<input>').attr({ type: 'hidden', name: '__RequestVerificationToken', value: $providerId.closest('form').find('input[name="__RequestVerificationToken"]').val() })
).appendTo('body').submit();
}
$providerId.change(updateDetails);
$addressId.change(updateDetails);
var manualProvider = $('#ManualProviderName');
if (manualProvider.length > 0 && !manualProvider.val()) {
manualProvider.focus();
} else {
$('#ProviderId').focus();
}
});
</script>
@@ -0,0 +1,855 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/LogInsurance.cshtml")]
public partial class LogInsurance : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogInsuranceModel>
{
public LogInsurance()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogInsurance.cshtml"
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Views\Job\LogInsurance.cshtml"
using (Html.BeginForm(MVC.Job.LogInsurance(), FormMethod.Post))
{
#line default
#line hidden
#line 9 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
#line 9 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#line default
#line hidden
#line 11 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationMessageFor(m => m.JobId));
#line default
#line hidden
#line 12 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteAttribute("value", Tuple.Create(" value=\"", 610), Tuple.Create("\"", 667)
#line 13 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 618), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose"
#line default
#line hidden
, 618), false)
);
WriteLiteral(" />\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"insuranceJobForm\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 20 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.JobId);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Device Serial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 27 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.Job.Device.SerialNumber);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Device Model:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 34 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 34 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Technician:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 41 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.TechUser.DisplayName);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 43 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 44 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.TechUser.PhoneNumber);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 52 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null))));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 53 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationMessageFor(m => m.OrganisationAddressId));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
#line 55 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 55 "..\..\Views\Job\LogInsurance.cshtml"
var oa = Model.OrganisationAddress;
if (oa != null)
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 59 "..\..\Views\Job\LogInsurance.cshtml"
Write(oa.Address);
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 61 "..\..\Views\Job\LogInsurance.cshtml"
Write(oa.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 61 "..\..\Views\Job\LogInsurance.cshtml"
Write(oa.Postcode);
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 63 "..\..\Views\Job\LogInsurance.cshtml"
Write(oa.State);
#line default
#line hidden
WriteLiteral(", ");
#line 63 "..\..\Views\Job\LogInsurance.cshtml"
Write(oa.Country);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 64 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th>Insurance Provider:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.DropDownListFor(model => model.ProviderId, Model.Providers.ToSelectListItems(Model.ProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } })));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 74 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationMessageFor(m => m.ProviderId));
#line default
#line hidden
WriteLiteral("\r\n");
#line 75 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 75 "..\..\Views\Job\LogInsurance.cshtml"
if (Model.Providers.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install))
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"info-box\"");
WriteLiteral(">\r\n <p");
WriteLiteral(" class=\"fa-p\"");
WriteLiteral(">\r\n <i");
WriteLiteral(" class=\"fa fa-info-circle\"");
WriteLiteral("></i>View the <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3387), Tuple.Create("\"", 3437)
#line 79 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 3394), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default
#line hidden
, 3394), false)
);
WriteLiteral(">Plugin Catalogue</a> to discover and install provider plugins.\r\n " +
" </p>\r\n </div>\r\n");
#line 82 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 85 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 85 "..\..\Views\Job\LogInsurance.cshtml"
if (Model.IsManualProvider)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Insurer Name:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.EditorFor(model => model.ManualProviderName));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 91 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderName));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" <tr>\r\n <th>Insurer Reference:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 97 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.EditorFor(model => model.ManualProviderReference));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 98 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderReference));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 101 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n </div>\r\n");
#line 104 "..\..\Views\Job\LogInsurance.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 112 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 112 "..\..\Views\Job\LogInsurance.cshtml"
foreach (var ja in Model.Job.JobAttachments)
{
#line default
#line hidden
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 4839), Tuple.Create("\"", 4896)
#line 114 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 4846), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 4846), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 114 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 114 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"checkbox\"");
WriteLiteral(" class=\"select\"");
WriteLiteral(" name=\"AttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 5046), Tuple.Create("\"", 5060)
#line 115 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 5054), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default
#line hidden
, 5054), false)
);
WriteLiteral(" ");
#line 115 "..\..\Views\Job\LogInsurance.cshtml"
Write(Model.AttachmentIds.Contains(ja.Id) ? "checked" : null);
#line default
#line hidden
WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5174), Tuple.Create("\"", 5194)
#line 116 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 5182), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 5182), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 5265), Tuple.Create("\"", 5324)
#line 117 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 5271), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 5271), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5391), Tuple.Create("\"", 5411)
#line 118 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 5399), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 5399), false)
);
WriteLiteral(">\r\n");
#line 119 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 119 "..\..\Views\Job\LogInsurance.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 120 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 120 "..\..\Views\Job\LogInsurance.cshtml"
}
else
{
#line default
#line hidden
#line 122 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 122 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 123 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.TechUser.ToStringFriendly());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 123 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.Timestamp.ToUnixEpoc());
#line default
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5847), Tuple.Create("\"", 5885)
#line 123 "..\..\Views\Job\LogInsurance.cshtml"
, Tuple.Create(Tuple.Create("", 5855), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 5855), false)
);
WriteLiteral(">");
#line 123 "..\..\Views\Job\LogInsurance.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 125 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r\n </t" +
"able>\r\n </div>\r\n");
#line 131 "..\..\Views\Job\LogInsurance.cshtml"
}
if (Model.Provider != null && Model.ProviderSubmitJobBeginResult != null)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"providerProperties\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 135 "..\..\Views\Job\LogInsurance.cshtml"
Write(Html.PartialCompiled(Model.ProviderSubmitJobBeginResult.Item1, Model.ProviderSubmitJobBeginResult.Item2));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 137 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 139 "..\..\Views\Job\LogInsurance.cshtml"
#line default
#line hidden
#line 139 "..\..\Views\Job\LogInsurance.cshtml"
if (Model.IsManualProvider)
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Save Insurance Claim\"");
WriteLiteral(" />\r\n");
#line 142 "..\..\Views\Job\LogInsurance.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Preview Insurance Claim\"");
WriteLiteral(" />\r\n");
#line 146 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 148 "..\..\Views\Job\LogInsurance.cshtml"
}
#line default
#line hidden
WriteLiteral("<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $providerId = $(\'#ProviderId\');\r\n var " +
"$addressId = $(\'#OrganisationAddressId\');\r\n\r\n function updateDetails() {\r" +
"\n $(\'<form>\').attr({\r\n action: $providerId.closest(\'fo" +
"rm\').attr(\'action\'),\r\n method: \'post\'\r\n }).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'SubmissionAction\', valu" +
"e: \'Update\' })\r\n ).append(\r\n $(\'<input>\').attr({ type:" +
" \'hidden\', name: \'JobId\', value: $(\'#JobId\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'ProviderId\', value: $pr" +
"oviderId.val() })\r\n ).append(\r\n $(\'<input>\').attr({ ty" +
"pe: \'hidden\', name: \'OrganisationAddressId\', value: $addressId.val() })\r\n " +
" ).append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'Manua" +
"lProviderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r" +
"\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderRefere" +
"nce\', value: $(\'#ManualProviderReference\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'__RequestVerificationToke" +
"n\', value: $providerId.closest(\'form\').find(\'input[name=\"__RequestVerificationTo" +
"ken\"]\').val() })\r\n ).appendTo(\'body\').submit();\r\n }\r\n\r\n " +
" $providerId.change(updateDetails);\r\n $addressId.change(updateDetails);\r\n" +
"\r\n var manualProvider = $(\'#ManualProviderName\');\r\n if (manualProv" +
"ider.length > 0 && !manualProvider.val()) {\r\n manualProvider.focus();" +
"\r\n } else {\r\n $(\'#ProviderId\').focus();\r\n }\r\n });\r\n<" +
"/script>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,145 @@
@model Disco.Web.Models.Job.LogInsuranceModel
@{
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim");
}
@using (Html.BeginForm(MVC.Job.LogInsurance(), FormMethod.Post))
{
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId)
@Html.HiddenFor(m => m.OrganisationAddressId)
@Html.HiddenFor(m => m.ProviderId)
@Html.HiddenFor(m => m.ProviderPropertiesJson)
<input type="hidden" name="SubmissionAction" value="Submit" />
<div id="insuranceJobForm" 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">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>Provider:
</th>
<td>
@Model.Provider.Name (@Model.Provider.Id) @Model.Provider.PluginManifest.Version.ToString(3)
</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.Attachments.Count > 0)
{
<tr>
<th>Sending Attachments</th>
<td>
<div>
<div id="publishJobAttachments">
@foreach (var ja in Model.Attachments)
{
<input type="hidden" name="AttachmentIds" 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 Insurance Claim...</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">
<button id="submitJob" type="submit" class="button">Lodge Insurance Claim</button>
</div>
}
@@ -0,0 +1,704 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/LogInsuranceDisclose.cshtml")]
public partial class LogInsuranceDisclose : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogInsuranceModel>
{
public LogInsuranceDisclose()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
using (Html.BeginForm(MVC.Job.LogInsurance(), FormMethod.Post))
{
#line default
#line hidden
#line 9 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.AntiForgeryToken());
#line default
#line hidden
#line 9 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#line default
#line hidden
#line 11 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.HiddenFor(m => m.OrganisationAddressId));
#line default
#line hidden
#line 12 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 13 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.HiddenFor(m => m.ProviderId));
#line default
#line hidden
#line 13 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Html.HiddenFor(m => m.ProviderPropertiesJson));
#line default
#line hidden
#line 14 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteLiteral(" value=\"Submit\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"insuranceJobForm\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 22 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.JobId);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Device Serial Number:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 29 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Job.Device.SerialNumber);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Device Model:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Technician:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 43 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.TechUser.DisplayName);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 45 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 46 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.TechUser.PhoneNumber);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 55 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.Name);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 57 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.Address);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 58 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 58 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 59 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.State);
#line default
#line hidden
WriteLiteral(", ");
#line 59 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.OrganisationAddress.Country);
#line default
#line hidden
WriteLiteral("</span>\r\n </div>\r\n </div>\r\n " +
" </td>\r\n </tr>\r\n <tr>\r\n <th>Provider:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 68 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Provider.Name);
#line default
#line hidden
WriteLiteral(" (");
#line 68 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Provider.Id);
#line default
#line hidden
WriteLiteral(") ");
#line 68 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(Model.Provider.PluginManifest.Version.ToString(3));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">Disclosed Information\r\n </th>\r\n <td>\r\n " +
" <div");
WriteLiteral(" id=\"disclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n");
#line 77 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 77 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>");
#line 80 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(dp.Key);
#line default
#line hidden
WriteLiteral(":\r\n </th>\r\n " +
" <td>");
#line 82 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(dp.Value);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr" +
"> \r\n");
#line 85 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n </div>\r\n </t" +
"d>\r\n </tr>\r\n");
#line 90 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 90 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
if (Model.Attachments.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 97 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 97 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
foreach (var ja in Model.Attachments)
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"AttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 3917), Tuple.Create("\"", 3931)
#line 99 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 3925), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default
#line hidden
, 3925), false)
);
WriteLiteral(" />\r\n");
WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3975), Tuple.Create("\"", 4032)
#line 100 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 3982), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default
#line hidden
, 3982), false)
);
WriteLiteral(" data-attachmentid=\"");
#line 100 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.Id);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(" data-mimetype=\"");
#line 100 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.MimeType);
#line default
#line hidden
WriteLiteral("\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4150), Tuple.Create("\"", 4170)
#line 101 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4158), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default
#line hidden
, 4158), false)
);
WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 4249), Tuple.Create("\"", 4308)
#line 102 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4255), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default
#line hidden
, 4255), false)
);
WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4383), Tuple.Create("\"", 4403)
#line 103 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4391), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default
#line hidden
, 4391), false)
);
WriteLiteral(">\r\n");
#line 104 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
#line default
#line hidden
#line 104 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{
#line default
#line hidden
#line 105 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.DocumentTemplate.Description);
#line default
#line hidden
#line 105 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
}
else
{
#line default
#line hidden
#line 107 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.Comments);
#line default
#line hidden
#line 107 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\"");
WriteLiteral(">");
#line 108 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.TechUser.ToStringFriendly());
#line default
#line hidden
WriteLiteral("</span><span");
WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\"");
#line 108 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.Timestamp.ToUnixEpoc());
#line default
#line hidden
WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4879), Tuple.Create("\"", 4917)
#line 108 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4887), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default
#line hidden
, 4887), false)
);
WriteLiteral(">");
#line 108 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 110 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </div>\r\n " +
" </td>\r\n </tr>\r\n");
#line 115 "..\..\Views\Job\LogInsuranceDisclose.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>Lodging Insurance Claim...</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(" class=\"actionBar\"");
WriteLiteral(">\r\n <button");
WriteLiteral(" id=\"submitJob\"");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(">Lodge Insurance Claim</button>\r\n </div>\r\n");
#line 145 "..\..\Views\Job\LogInsuranceDisclose.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,120 @@
@model Disco.Web.Models.Job.LogInsuranceModel
@{
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim Error");
}
<div class="form" style="width: 650px">
<h2>Submission Error</h2>
<table>
<tr>
<td>
<div>
<strong>@Model.Error.Message</strong>
</div>
<a href="#" id="errorShow" class="smallMessage">(show more)</a>
<div id="errorMore" style="display: none">
<br />
<strong>Error Type: </strong>@Model.Error.GetType().Name
<br />
<strong>Stack Trace:</strong>
<div class="code">
@Model.Error.StackTrace.ToMultilineString()
</div>
@if (Model.Error.InnerException != null)
{
<hr />
<div>
<strong>Inner Exception:</strong> @Model.Error.InnerException.Message<br />
<strong>Error Type:</strong> @Model.Error.GetType().Name<br />
<strong>Stack Trace:</strong>
<div class="code">
@Model.Error.InnerException.StackTrace
</div>
</div>
}
</div>
<script type="text/javascript">
$(function () {
$('#errorShow').click(function () {
$(this).hide();
$('#errorMore').slideDown();
return false;
});
});
</script>
</td>
</tr>
</table>
</div>
<div id="insuranceJobForm" class="form" style="width: 650px; margin-top: 15px;">
<h2>Insurance Submission Details</h2>
<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">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>Provider:
</th>
<td>
@if (Model.Provider != null)
{
<span>
@Model.Provider.Name (@Model.Provider.Id) @Model.Provider.PluginManifest.Version.ToString(3)
</span>
}
else
{
<span class="smallMessage">None Selected</span>
}
</td>
</tr>
</table>
</div>
<div class="actionBar">
@Html.ActionLinkButton("Try Again", MVC.Job.LogInsurance(Model.JobId, null, null))
@Html.ActionLinkButton("Return to Job", MVC.Job.Show(Model.JobId))
</div>
@@ -0,0 +1,448 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace Disco.Web.Views.Job
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
using System.Web.Helpers;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using System.Web.Mvc.Html;
using System.Web.Routing;
using System.Web.Security;
using System.Web.UI;
using System.Web.WebPages;
using Disco;
using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Web;
using Disco.Web;
using Disco.Web.Extensions;
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/LogInsuranceError.cshtml")]
public partial class LogInsuranceError : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogInsuranceModel>
{
public LogInsuranceError()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogInsuranceError.cshtml"
Authorization.RequireAny(Claims.Job.Properties.NonWarrantyProperties.InsuranceClaimFormSent, Claims.Job.Actions.LogInsurance);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Insurance Claim Error");
#line default
#line hidden
WriteLiteral("\r\n<div");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <h2>Submission Error</h2>\r\n <table>\r\n <tr>\r\n <td>\r\n " +
" <div>\r\n <strong>");
#line 13 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.Message);
#line default
#line hidden
WriteLiteral("</strong>\r\n </div>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"errorShow\"");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">(show more)</a>\r\n <div");
WriteLiteral(" id=\"errorMore\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 18 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.GetType().Name);
#line default
#line hidden
WriteLiteral("\r\n <br />\r\n <strong>Stack Trace:</strong>\r\n" +
" <div");
WriteLiteral(" class=\"code\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 22 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.StackTrace.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 24 "..\..\Views\Job\LogInsuranceError.cshtml"
#line default
#line hidden
#line 24 "..\..\Views\Job\LogInsuranceError.cshtml"
if (Model.Error.InnerException != null)
{
#line default
#line hidden
WriteLiteral(" <hr />\r\n");
WriteLiteral(" <div>\r\n <strong>Inner Exceptio" +
"n:</strong> ");
#line 28 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.InnerException.Message);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 29 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.GetType().Name);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Stack Trace:</strong>\r\n " +
" <div");
WriteLiteral(" class=\"code\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 32 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Error.InnerException.StackTrace);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 35 "..\..\Views\Job\LogInsuranceError.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#errorShow').click(function () {
$(this).hide();
$('#errorMore').slideDown();
return false;
});
});
</script>
</td>
</tr>
</table>
</div>
<div");
WriteLiteral(" id=\"insuranceJobForm\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Insurance Submission Details</h2>\r\n <table>\r\n <tr>\r\n " +
" <th>Internal Job Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 57 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.JobId);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Device Serial N" +
"umber:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 64 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Job.Device.SerialNumber);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Device Model:\r\n" +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 71 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 71 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th>Technician:\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 78 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.TechUser.DisplayName);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 80 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 81 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.TechUser.PhoneNumber);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
" <th");
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Address:\r\n </th>\r\n <td>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.Name);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 92 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.Address);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 93 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 93 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.Postcode);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 94 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.State);
#line default
#line hidden
WriteLiteral(", ");
#line 94 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.OrganisationAddress.Country);
#line default
#line hidden
WriteLiteral("</span>\r\n </div>\r\n </div>\r\n </td>\r\n " +
" </tr>\r\n <tr>\r\n <th>Provider:\r\n </th>\r\n " +
" <td>\r\n");
#line 103 "..\..\Views\Job\LogInsuranceError.cshtml"
#line default
#line hidden
#line 103 "..\..\Views\Job\LogInsuranceError.cshtml"
if (Model.Provider != null)
{
#line default
#line hidden
WriteLiteral(" <span>\r\n");
WriteLiteral(" ");
#line 106 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Provider.Name);
#line default
#line hidden
WriteLiteral(" (");
#line 106 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Provider.Id);
#line default
#line hidden
WriteLiteral(") ");
#line 106 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Model.Provider.PluginManifest.Version.ToString(3));
#line default
#line hidden
WriteLiteral("\r\n </span>\r\n");
#line 108 "..\..\Views\Job\LogInsuranceError.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">None Selected</span>\r\n");
#line 112 "..\..\Views\Job\LogInsuranceError.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 118 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Html.ActionLinkButton("Try Again", MVC.Job.LogInsurance(Model.JobId, null, null)));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 119 "..\..\Views\Job\LogInsuranceError.cshtml"
Write(Html.ActionLinkButton("Return to Job", MVC.Job.Show(Model.JobId)));
#line default
#line hidden
WriteLiteral("\r\n</div>\r\n");
}
}
}
#pragma warning restore 1591
+25 -16
View File
@@ -2,10 +2,11 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogRepair); 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"); 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(), FormMethod.Post)) @using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{ {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true) @Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId) @Html.HiddenFor(m => m.JobId)
@Html.ValidationMessageFor(m => m.JobId) @Html.ValidationMessageFor(m => m.JobId)
@@ -13,28 +14,32 @@
<div id="repairJobForm" class="form" style="width: 650px"> <div id="repairJobForm" class="form" style="width: 650px">
<table> <table>
<tr> <tr>
<th>Internal Job Id: <th>
Internal Job Id:
</th> </th>
<td> <td>
@Model.JobId @Model.JobId
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Serial Number: <th>
Device Serial Number:
</th> </th>
<td> <td>
@Model.Job.Device.SerialNumber @Model.Job.Device.SerialNumber
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Model: <th>
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>Technician: <th>
Technician:
</th> </th>
<td> <td>
@Model.TechUser.DisplayName @Model.TechUser.DisplayName
@@ -45,28 +50,30 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 150px">Repair Address: <th style="width: 150px">
Repair Address:
</th> </th>
<td> <td>
@Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br /> @Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br />
@Html.ValidationMessageFor(m => m.OrganisationAddressId) @Html.ValidationMessageFor(m => m.OrganisationAddressId)
<div id="organisationAddressDetails"> <div id="organisationAddressDetails">
@{ @{
var oa = Model.OrganisationAddress; var oa = Model.OrganisationAddress;
if (oa != null) if (oa != null)
{ {
<span>@oa.Address</span> <span>@oa.Address</span>
<br /> <br />
<span>@oa.Suburb, @oa.Postcode</span> <span>@oa.Suburb, @oa.Postcode</span>
<br /> <br />
<span>@oa.State, @oa.Country</span> <span>@oa.State, @oa.Country</span>
} }
} }
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Repair Provider: <th>
Repair Provider:
</th> </th>
<td> <td>
@Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } }))<br /> @Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } }))<br />
@@ -179,6 +186,8 @@
$('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() }) $('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() })
).append( ).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() }) $('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() })
).append(
$('<input>').attr({ type: 'hidden', name: '__RequestVerificationToken', value: $providerId.closest('form').find('input[name="__RequestVerificationToken"]').val() })
).appendTo('body').submit(); ).appendTo('body').submit();
} }
+142 -121
View File
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogRepair); 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"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Repair");
#line default #line default
@@ -65,41 +65,55 @@ WriteLiteral("\r\n");
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogRepair.cshtml" #line 9 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationSummary(true)); Write(Html.AntiForgeryToken());
#line default #line default
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogRepair.cshtml" #line 9 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogRepair.cshtml" #line 10 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.HiddenFor(m => m.JobId)); Write(Html.HiddenFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogRepair.cshtml" #line 11 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogRepair.cshtml" #line 12 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.JobId)); Write(Html.ValidationMessageFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogRepair.cshtml" #line 12 "..\..\Views\Job\LogRepair.cshtml"
@@ -111,14 +125,14 @@ WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\""); WriteLiteral(" name=\"SubmissionAction\"");
WriteAttribute("value", Tuple.Create(" value=\"", 489), Tuple.Create("\"", 546) WriteAttribute("value", Tuple.Create(" value=\"", 521), Tuple.Create("\"", 578)
#line 12 "..\..\Views\Job\LogRepair.cshtml" #line 13 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 497), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose" , Tuple.Create(Tuple.Create("", 529), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose"
#line default #line default
#line hidden #line hidden
, 497), false) , 529), false)
); );
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
@@ -131,37 +145,39 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\""); WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " + WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
" </th>\r\n <td>\r\n"); "nternal Job Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 19 "..\..\Views\Job\LogRepair.cshtml" #line 21 "..\..\Views\Job\LogRepair.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" +
">Device Serial Number:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Serial Number:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 26 "..\..\Views\Job\LogRepair.cshtml" #line 29 "..\..\Views\Job\LogRepair.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" +
">Device Model:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Model:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 33 "..\..\Views\Job\LogRepair.cshtml" #line 37 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer); Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -170,19 +186,20 @@ WriteLiteral(" ");
WriteLiteral(" "); WriteLiteral(" ");
#line 33 "..\..\Views\Job\LogRepair.cshtml" #line 37 "..\..\Views\Job\LogRepair.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" +
">Technician:\r\n </th>\r\n <td>\r\n"); ">\r\n Technician:\r\n </th>\r\n <td>\r" +
"\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 40 "..\..\Views\Job\LogRepair.cshtml" #line 45 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.TechUser.DisplayName); Write(Model.TechUser.DisplayName);
@@ -195,7 +212,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: "); WriteLiteral(">\r\n Email Address: ");
#line 42 "..\..\Views\Job\LogRepair.cshtml" #line 47 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.TechUser.EmailAddress); Write(Model.TechUser.EmailAddress);
@@ -204,7 +221,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: "); WriteLiteral("<br />\r\n Phone Number: ");
#line 43 "..\..\Views\Job\LogRepair.cshtml" #line 48 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.TechUser.PhoneNumber); Write(Model.TechUser.PhoneNumber);
@@ -215,12 +232,13 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" style=\"width: 150px\""); WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Repair Address:\r\n </th>\r\n <td>\r\n"); WriteLiteral(">\r\n Repair Address:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 51 "..\..\Views\Job\LogRepair.cshtml" #line 57 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))); Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null))));
@@ -231,7 +249,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 52 "..\..\Views\Job\LogRepair.cshtml" #line 58 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.OrganisationAddressId)); Write(Html.ValidationMessageFor(m => m.OrganisationAddressId));
@@ -244,39 +262,39 @@ WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 54 "..\..\Views\Job\LogRepair.cshtml" #line 60 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 54 "..\..\Views\Job\LogRepair.cshtml" #line 60 "..\..\Views\Job\LogRepair.cshtml"
var oa = Model.OrganisationAddress; var oa = Model.OrganisationAddress;
if (oa != null) if (oa != null)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 58 "..\..\Views\Job\LogRepair.cshtml" #line 64 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Address); Write(oa.Address);
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n"); WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 60 "..\..\Views\Job\LogRepair.cshtml" #line 66 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Suburb); Write(oa.Suburb);
#line default #line default
@@ -284,21 +302,21 @@ WriteLiteral(" <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 60 "..\..\Views\Job\LogRepair.cshtml" #line 66 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Postcode); Write(oa.Postcode);
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n"); WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 62 "..\..\Views\Job\LogRepair.cshtml" #line 68 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.State); Write(oa.State);
#line default #line default
@@ -306,8 +324,8 @@ WriteLiteral(" <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 62 "..\..\Views\Job\LogRepair.cshtml" #line 68 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Country); Write(oa.Country);
#line default #line default
@@ -315,20 +333,20 @@ WriteLiteral(", ");
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
#line 63 "..\..\Views\Job\LogRepair.cshtml" #line 69 "..\..\Views\Job\LogRepair.cshtml"
} }
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " + WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th>Repair Provider:\r\n </th>\r\n " + " <tr>\r\n <th>\r\n Repair Provider:\r\n " +
" <td>\r\n"); " </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 72 "..\..\Views\Job\LogRepair.cshtml" #line 79 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } }))); Write(Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } })));
@@ -339,7 +357,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogRepair.cshtml" #line 80 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.RepairProviderId)); Write(Html.ValidationMessageFor(m => m.RepairProviderId));
@@ -348,13 +366,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n"); WriteLiteral("\r\n");
#line 74 "..\..\Views\Job\LogRepair.cshtml" #line 81 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 74 "..\..\Views\Job\LogRepair.cshtml" #line 81 "..\..\Views\Job\LogRepair.cshtml"
if (Model.RepairProviders.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install)) if (Model.RepairProviders.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install))
{ {
@@ -375,21 +393,21 @@ WriteLiteral(" class=\"fa fa-info-circle\"");
WriteLiteral("></i>View the <a"); WriteLiteral("></i>View the <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3297), Tuple.Create("\"", 3347) WriteAttribute("href", Tuple.Create(" href=\"", 3577), Tuple.Create("\"", 3627)
#line 78 "..\..\Views\Job\LogRepair.cshtml" #line 85 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 3304), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install()) , Tuple.Create(Tuple.Create("", 3584), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default #line default
#line hidden #line hidden
, 3304), false) , 3584), false)
); );
WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plugins.\r\n " + WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plugins.\r\n " +
" </p>\r\n </div>\r\n"); " </p>\r\n </div>\r\n");
#line 81 "..\..\Views\Job\LogRepair.cshtml" #line 88 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -398,13 +416,13 @@ WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plug
WriteLiteral(" </td>\r\n </tr>\r\n"); WriteLiteral(" </td>\r\n </tr>\r\n");
#line 84 "..\..\Views\Job\LogRepair.cshtml" #line 91 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 84 "..\..\Views\Job\LogRepair.cshtml" #line 91 "..\..\Views\Job\LogRepair.cshtml"
if (Model.IsManualProvider) if (Model.IsManualProvider)
{ {
@@ -417,7 +435,7 @@ WriteLiteral(" <tr>\r\n <th>Provider Name:</th
WriteLiteral(" "); WriteLiteral(" ");
#line 89 "..\..\Views\Job\LogRepair.cshtml" #line 96 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.ManualProviderName)); Write(Html.EditorFor(model => model.ManualProviderName));
@@ -428,7 +446,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogRepair.cshtml" #line 97 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderName)); Write(Html.ValidationMessageFor(m => m.ManualProviderName));
@@ -442,7 +460,7 @@ WriteLiteral(" <tr>\r\n <th>Provider Job Refer
WriteLiteral(" "); WriteLiteral(" ");
#line 96 "..\..\Views\Job\LogRepair.cshtml" #line 103 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.ManualProviderReference)); Write(Html.EditorFor(model => model.ManualProviderReference));
@@ -453,7 +471,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 97 "..\..\Views\Job\LogRepair.cshtml" #line 104 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderReference)); Write(Html.ValidationMessageFor(m => m.ManualProviderReference));
@@ -462,7 +480,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n"); WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 100 "..\..\Views\Job\LogRepair.cshtml" #line 107 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -484,7 +502,7 @@ WriteLiteral(">\r\n <h2>Repair Description</h2>\r\n <table>\r\n
WriteLiteral(" "); WriteLiteral(" ");
#line 108 "..\..\Views\Job\LogRepair.cshtml" #line 115 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.RepairDescription)); Write(Html.EditorFor(model => model.RepairDescription));
@@ -495,7 +513,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 109 "..\..\Views\Job\LogRepair.cshtml" #line 116 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.RepairDescription)); Write(Html.ValidationMessageFor(m => m.RepairDescription));
@@ -504,7 +522,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n"); WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 114 "..\..\Views\Job\LogRepair.cshtml" #line 121 "..\..\Views\Job\LogRepair.cshtml"
if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0) if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0)
{ {
@@ -525,13 +543,13 @@ WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 122 "..\..\Views\Job\LogRepair.cshtml" #line 129 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 122 "..\..\Views\Job\LogRepair.cshtml" #line 129 "..\..\Views\Job\LogRepair.cshtml"
foreach (var ja in Model.Job.JobAttachments) foreach (var ja in Model.Job.JobAttachments)
{ {
@@ -540,20 +558,20 @@ WriteLiteral(">\r\n");
#line hidden #line hidden
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 5175), Tuple.Create("\"", 5232) WriteAttribute("href", Tuple.Create(" href=\"", 5455), Tuple.Create("\"", 5512)
#line 124 "..\..\Views\Job\LogRepair.cshtml" #line 131 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5182), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id)) , Tuple.Create(Tuple.Create("", 5462), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default #line default
#line hidden #line hidden
, 5182), false) , 5462), false)
); );
WriteLiteral(" data-attachmentid=\""); WriteLiteral(" data-attachmentid=\"");
#line 124 "..\..\Views\Job\LogRepair.cshtml" #line 131 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Id); Write(ja.Id);
@@ -564,7 +582,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\""); WriteLiteral(" data-mimetype=\"");
#line 124 "..\..\Views\Job\LogRepair.cshtml" #line 131 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.MimeType); Write(ja.MimeType);
@@ -580,20 +598,20 @@ WriteLiteral(" class=\"select\"");
WriteLiteral(" name=\"PublishAttachmentIds\""); WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 5389), Tuple.Create("\"", 5403) WriteAttribute("value", Tuple.Create(" value=\"", 5669), Tuple.Create("\"", 5683)
#line 125 "..\..\Views\Job\LogRepair.cshtml" #line 132 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5397), Tuple.Create<System.Object, System.Int32>(ja.Id , Tuple.Create(Tuple.Create("", 5677), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default #line default
#line hidden #line hidden
, 5397), false) , 5677), false)
); );
WriteLiteral(" "); WriteLiteral(" ");
#line 125 "..\..\Views\Job\LogRepair.cshtml" #line 132 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null); Write(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null);
@@ -603,68 +621,68 @@ WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"icon\""); WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5524), Tuple.Create("\"", 5544) WriteAttribute("title", Tuple.Create(" title=\"", 5804), Tuple.Create("\"", 5824)
#line 126 "..\..\Views\Job\LogRepair.cshtml" #line 133 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5532), Tuple.Create<System.Object, System.Int32>(ja.Filename , Tuple.Create(Tuple.Create("", 5812), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default #line default
#line hidden #line hidden
, 5532), false) , 5812), false)
); );
WriteLiteral(">\r\n <img"); WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\""); WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 5615), Tuple.Create("\"", 5674) WriteAttribute("src", Tuple.Create(" src=\"", 5895), Tuple.Create("\"", 5954)
#line 127 "..\..\Views\Job\LogRepair.cshtml" #line 134 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5621), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)) , Tuple.Create(Tuple.Create("", 5901), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default #line default
#line hidden #line hidden
, 5621), false) , 5901), false)
); );
WriteLiteral(" /></span>\r\n <span"); WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\""); WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5741), Tuple.Create("\"", 5761) WriteAttribute("title", Tuple.Create(" title=\"", 6021), Tuple.Create("\"", 6041)
#line 128 "..\..\Views\Job\LogRepair.cshtml" #line 135 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 5749), Tuple.Create<System.Object, System.Int32>(ja.Comments , Tuple.Create(Tuple.Create("", 6029), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default #line default
#line hidden #line hidden
, 5749), false) , 6029), false)
); );
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 129 "..\..\Views\Job\LogRepair.cshtml" #line 136 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 129 "..\..\Views\Job\LogRepair.cshtml" #line 136 "..\..\Views\Job\LogRepair.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ {
#line default #line default
#line hidden #line hidden
#line 130 "..\..\Views\Job\LogRepair.cshtml" #line 137 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.DocumentTemplate.Description); Write(ja.DocumentTemplate.Description);
#line default #line default
#line hidden #line hidden
#line 130 "..\..\Views\Job\LogRepair.cshtml" #line 137 "..\..\Views\Job\LogRepair.cshtml"
} }
else else
{ {
@@ -672,14 +690,14 @@ WriteLiteral(">\r\n");
#line default #line default
#line hidden #line hidden
#line 132 "..\..\Views\Job\LogRepair.cshtml" #line 139 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Comments); Write(ja.Comments);
#line default #line default
#line hidden #line hidden
#line 132 "..\..\Views\Job\LogRepair.cshtml" #line 139 "..\..\Views\Job\LogRepair.cshtml"
} }
#line default #line default
@@ -691,7 +709,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">"); WriteLiteral(">");
#line 133 "..\..\Views\Job\LogRepair.cshtml" #line 140 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.TechUser.ToStringFriendly()); Write(ja.TechUser.ToStringFriendly());
@@ -704,7 +722,7 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\""); WriteLiteral(" data-livestamp=\"");
#line 133 "..\..\Views\Job\LogRepair.cshtml" #line 140 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Timestamp.ToUnixEpoc()); Write(ja.Timestamp.ToUnixEpoc());
@@ -712,20 +730,20 @@ WriteLiteral(" data-livestamp=\"");
#line hidden #line hidden
WriteLiteral("\""); WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 6197), Tuple.Create("\"", 6235) WriteAttribute("title", Tuple.Create(" title=\"", 6477), Tuple.Create("\"", 6515)
#line 133 "..\..\Views\Job\LogRepair.cshtml" #line 140 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 6205), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime() , Tuple.Create(Tuple.Create("", 6485), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default #line default
#line hidden #line hidden
, 6205), false) , 6485), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 133 "..\..\Views\Job\LogRepair.cshtml" #line 140 "..\..\Views\Job\LogRepair.cshtml"
Write(ja.Timestamp.ToFullDateTime()); Write(ja.Timestamp.ToFullDateTime());
@@ -734,7 +752,7 @@ WriteLiteral(">");
WriteLiteral("</span>\r\n </a> \r\n"); WriteLiteral("</span>\r\n </a> \r\n");
#line 135 "..\..\Views\Job\LogRepair.cshtml" #line 142 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -744,7 +762,7 @@ WriteLiteral(" </div>\r\n </td>\r\n
"able>\r\n </div>\r\n"); "able>\r\n </div>\r\n");
#line 141 "..\..\Views\Job\LogRepair.cshtml" #line 148 "..\..\Views\Job\LogRepair.cshtml"
} }
if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null) if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null)
{ {
@@ -761,7 +779,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 145 "..\..\Views\Job\LogRepair.cshtml" #line 152 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2)); Write(Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2));
@@ -770,7 +788,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n"); WriteLiteral("\r\n </div>\r\n");
#line 147 "..\..\Views\Job\LogRepair.cshtml" #line 154 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -783,13 +801,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 149 "..\..\Views\Job\LogRepair.cshtml" #line 156 "..\..\Views\Job\LogRepair.cshtml"
#line default #line default
#line hidden #line hidden
#line 149 "..\..\Views\Job\LogRepair.cshtml" #line 156 "..\..\Views\Job\LogRepair.cshtml"
if (Model.IsManualProvider) if (Model.IsManualProvider)
{ {
@@ -807,7 +825,7 @@ WriteLiteral(" value=\"Save Repair Request\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 152 "..\..\Views\Job\LogRepair.cshtml" #line 159 "..\..\Views\Job\LogRepair.cshtml"
} }
else else
{ {
@@ -826,7 +844,7 @@ WriteLiteral(" value=\"Preview Repair Request\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 156 "..\..\Views\Job\LogRepair.cshtml" #line 163 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -835,7 +853,7 @@ WriteLiteral(" />\r\n");
WriteLiteral(" </div>\r\n"); WriteLiteral(" </div>\r\n");
#line 158 "..\..\Views\Job\LogRepair.cshtml" #line 165 "..\..\Views\Job\LogRepair.cshtml"
} }
@@ -860,12 +878,15 @@ WriteLiteral(">\r\n $(function () {\r\n var $providerId = $(\'#RepairP
").append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProv" + ").append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProv" +
"iderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " + "iderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference\'," + " $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference\'," +
" value: $(\'#ManualProviderReference\').val() })\r\n ).appendTo(\'body\').s" + " value: $(\'#ManualProviderReference\').val() })\r\n ).append(\r\n " +
"ubmit();\r\n }\r\n\r\n $providerId.change(updateDetails);\r\n $addr" + " $(\'<input>\').attr({ type: \'hidden\', name: \'__RequestVerificationToken\', v" +
"essId.change(updateDetails);\r\n\r\n var manualProvider = $(\'#ManualProviderN" + "alue: $providerId.closest(\'form\').find(\'input[name=\"__RequestVerificationToken\"]" +
"ame\');\r\n if (manualProvider.length > 0 && !manualProvider.val()) {\r\n " + "\').val() })\r\n ).appendTo(\'body\').submit();\r\n }\r\n\r\n $pro" +
" manualProvider.focus();\r\n } else {\r\n $(\'#RepairDescript" + "viderId.change(updateDetails);\r\n $addressId.change(updateDetails);\r\n\r\n " +
"ion\').focus();\r\n }\r\n });\r\n</script>\r\n"); " var manualProvider = $(\'#ManualProviderName\');\r\n if (manualProvider." +
"length > 0 && !manualProvider.val()) {\r\n manualProvider.focus();\r\n " +
" } else {\r\n $(\'#RepairDescription\').focus();\r\n }\r\n });\r" +
"\n</script>\r\n");
} }
} }
+5 -4
View File
@@ -2,10 +2,11 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogRepair); 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"); 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(), FormMethod.Post)) @using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{ {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true) @Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId) @Html.HiddenFor(m => m.JobId)
@Html.HiddenFor(m => m.OrganisationAddressId) @Html.HiddenFor(m => m.OrganisationAddressId)
@@ -79,7 +80,7 @@
<th>Disclosed Information <th>Disclosed Information
</th> </th>
<td> <td>
<div id="repairDisclosedInformation"> <div id="disclosedInformation">
<table> <table>
@foreach (var dp in Model.DiscloseProperties) @foreach (var dp in Model.DiscloseProperties)
{ {
@@ -123,7 +124,7 @@
</table> </table>
</div> </div>
<div id="submitDialog" class="dialog" title="Please Wait"> <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> <h4><i class="fa fa-lg fa-cog fa-spin" title="Please Wait"></i>Lodging Repair Request...</h4>
</div> </div>
<script> <script>
$(function () { $(function () {
@@ -147,6 +148,6 @@
}); });
</script> </script>
<div class="actionBar"> <div class="actionBar">
<input id="submitJob" type="submit" class="button" value="Submit Repair Request" /> <input id="submitJob" type="submit" class="button" value="Lodge Repair Request" />
</div> </div>
} }
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogRepair); 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"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Repair");
#line default #line default
@@ -65,83 +65,97 @@ WriteLiteral("\r\n");
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 9 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.ValidationSummary(true)); Write(Html.AntiForgeryToken());
#line default #line default
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 9 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 10 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.JobId)); Write(Html.HiddenFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 11 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 12 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.OrganisationAddressId)); Write(Html.HiddenFor(m => m.OrganisationAddressId));
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 12 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 12 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 13 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.RepairProviderId)); Write(Html.HiddenFor(m => m.RepairProviderId));
#line default #line default
#line hidden #line hidden
#line 12 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 13 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 13 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 14 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.RepairDescription)); Write(Html.HiddenFor(m => m.RepairDescription));
#line default #line default
#line hidden #line hidden
#line 13 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 14 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 14 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 15 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.ProviderPropertiesJson)); Write(Html.HiddenFor(m => m.ProviderPropertiesJson));
#line default #line default
#line hidden #line hidden
#line 14 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 15 "..\..\Views\Job\LogRepairDisclose.cshtml"
@@ -171,7 +185,7 @@ WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>In
WriteLiteral(" "); WriteLiteral(" ");
#line 22 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 23 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.JobId); Write(Model.JobId);
@@ -183,7 +197,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" "); WriteLiteral(" ");
#line 29 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 30 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.SerialNumber); Write(Model.Job.Device.SerialNumber);
@@ -195,7 +209,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" "); WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 37 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer); Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -204,7 +218,7 @@ WriteLiteral(" ");
WriteLiteral(" "); WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 37 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Model); Write(Model.Job.Device.DeviceModel.Model);
@@ -216,7 +230,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" "); WriteLiteral(" ");
#line 43 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 44 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.DisplayName); Write(Model.TechUser.DisplayName);
@@ -229,7 +243,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: "); WriteLiteral(">\r\n Email Address: ");
#line 45 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 46 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.EmailAddress); Write(Model.TechUser.EmailAddress);
@@ -238,7 +252,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: "); WriteLiteral("<br />\r\n Phone Number: ");
#line 46 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 47 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.PhoneNumber); Write(Model.TechUser.PhoneNumber);
@@ -259,7 +273,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 55 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 56 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Name); Write(Model.OrganisationAddress.Name);
@@ -272,7 +286,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>"); WriteLiteral(">\r\n <span>");
#line 57 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 58 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Address); Write(Model.OrganisationAddress.Address);
@@ -281,7 +295,7 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 58 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 59 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb); Write(Model.OrganisationAddress.Suburb);
@@ -290,7 +304,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 58 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 59 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode); Write(Model.OrganisationAddress.Postcode);
@@ -299,7 +313,7 @@ WriteLiteral(", ");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 59 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 60 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.State); Write(Model.OrganisationAddress.State);
@@ -308,7 +322,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 59 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 60 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Country); Write(Model.OrganisationAddress.Country);
@@ -321,7 +335,7 @@ WriteLiteral("</span>\r\n </div>\r\n <
WriteLiteral(" "); WriteLiteral(" ");
#line 68 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 69 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Name); Write(Model.RepairProvider.Name);
@@ -330,7 +344,7 @@ WriteLiteral(" ");
WriteLiteral(" ("); WriteLiteral(" (");
#line 68 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 69 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Id); Write(Model.RepairProvider.Id);
@@ -339,7 +353,7 @@ WriteLiteral(" (");
WriteLiteral(") "); WriteLiteral(") ");
#line 68 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 69 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.PluginManifest.Version.ToString(3)); Write(Model.RepairProvider.PluginManifest.Version.ToString(3));
@@ -351,7 +365,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
WriteLiteral(" "); WriteLiteral(" ");
#line 75 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 76 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairDescription.ToMultilineString()); Write(Model.RepairDescription.ToMultilineString());
@@ -361,18 +375,18 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>
">Disclosed Information\r\n </th>\r\n <td>\r\n " + ">Disclosed Information\r\n </th>\r\n <td>\r\n " +
" <div"); " <div");
WriteLiteral(" id=\"repairDisclosedInformation\""); WriteLiteral(" id=\"disclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n"); WriteLiteral(">\r\n <table>\r\n");
#line 84 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 85 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 84 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 85 "..\..\Views\Job\LogRepairDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties) foreach (var dp in Model.DiscloseProperties)
{ {
@@ -382,7 +396,7 @@ WriteLiteral(">\r\n <table>\r\n");
WriteLiteral(" <tr>\r\n <th>"); WriteLiteral(" <tr>\r\n <th>");
#line 87 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 88 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Key); Write(dp.Key);
@@ -392,7 +406,7 @@ WriteLiteral(":\r\n </th>\r\n
" <td>"); " <td>");
#line 89 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 90 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Value); Write(dp.Value);
@@ -402,7 +416,7 @@ WriteLiteral("\r\n </td>\r\n
"> \r\n"); "> \r\n");
#line 92 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 93 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
@@ -412,13 +426,13 @@ WriteLiteral(" </table>\r\n </div>\r\n
"d>\r\n </tr>\r\n"); "d>\r\n </tr>\r\n");
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 98 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 98 "..\..\Views\Job\LogRepairDisclose.cshtml"
if (Model.PublishAttachments.Count > 0) if (Model.PublishAttachments.Count > 0)
{ {
@@ -434,13 +448,13 @@ WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 104 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 105 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 104 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 105 "..\..\Views\Job\LogRepairDisclose.cshtml"
foreach (var ja in Model.PublishAttachments) foreach (var ja in Model.PublishAttachments)
{ {
@@ -453,34 +467,34 @@ WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"PublishAttachmentIds\""); WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 4117), Tuple.Create("\"", 4131) WriteAttribute("value", Tuple.Create(" value=\"", 4143), Tuple.Create("\"", 4157)
#line 106 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 107 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4125), Tuple.Create<System.Object, System.Int32>(ja.Id , Tuple.Create(Tuple.Create("", 4151), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default #line default
#line hidden #line hidden
, 4125), false) , 4151), false)
); );
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 4175), Tuple.Create("\"", 4232) WriteAttribute("href", Tuple.Create(" href=\"", 4201), Tuple.Create("\"", 4258)
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 108 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4182), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id)) , Tuple.Create(Tuple.Create("", 4208), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default #line default
#line hidden #line hidden
, 4182), false) , 4208), false)
); );
WriteLiteral(" data-attachmentid=\""); WriteLiteral(" data-attachmentid=\"");
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 108 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Id); Write(ja.Id);
@@ -491,7 +505,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\""); WriteLiteral(" data-mimetype=\"");
#line 107 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 108 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.MimeType); Write(ja.MimeType);
@@ -503,68 +517,68 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\""); WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4350), Tuple.Create("\"", 4370) WriteAttribute("title", Tuple.Create(" title=\"", 4376), Tuple.Create("\"", 4396)
#line 108 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 109 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4358), Tuple.Create<System.Object, System.Int32>(ja.Filename , Tuple.Create(Tuple.Create("", 4384), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default #line default
#line hidden #line hidden
, 4358), false) , 4384), false)
); );
WriteLiteral(">\r\n <img"); WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\""); WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 4449), Tuple.Create("\"", 4508) WriteAttribute("src", Tuple.Create(" src=\"", 4475), Tuple.Create("\"", 4534)
#line 109 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 110 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4455), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)) , Tuple.Create(Tuple.Create("", 4481), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default #line default
#line hidden #line hidden
, 4455), false) , 4481), false)
); );
WriteLiteral(" /></span>\r\n <span"); WriteLiteral(" /></span>\r\n <span");
WriteLiteral(" class=\"comments\""); WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4583), Tuple.Create("\"", 4603) WriteAttribute("title", Tuple.Create(" title=\"", 4609), Tuple.Create("\"", 4629)
#line 110 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 111 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4591), Tuple.Create<System.Object, System.Int32>(ja.Comments , Tuple.Create(Tuple.Create("", 4617), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default #line default
#line hidden #line hidden
, 4591), false) , 4617), false)
); );
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 111 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 112 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 111 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 112 "..\..\Views\Job\LogRepairDisclose.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ {
#line default #line default
#line hidden #line hidden
#line 112 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 113 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.DocumentTemplate.Description); Write(ja.DocumentTemplate.Description);
#line default #line default
#line hidden #line hidden
#line 112 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 113 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
else else
{ {
@@ -572,14 +586,14 @@ WriteLiteral(">\r\n");
#line default #line default
#line hidden #line hidden
#line 114 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Comments); Write(ja.Comments);
#line default #line default
#line hidden #line hidden
#line 114 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 115 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
#line default #line default
@@ -591,7 +605,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">"); WriteLiteral(">");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 116 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.TechUser.ToStringFriendly()); Write(ja.TechUser.ToStringFriendly());
@@ -604,7 +618,7 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\""); WriteLiteral(" data-livestamp=\"");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 116 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Timestamp.ToUnixEpoc()); Write(ja.Timestamp.ToUnixEpoc());
@@ -612,20 +626,20 @@ WriteLiteral(" data-livestamp=\"");
#line hidden #line hidden
WriteLiteral("\""); WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5079), Tuple.Create("\"", 5117) WriteAttribute("title", Tuple.Create(" title=\"", 5105), Tuple.Create("\"", 5143)
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 116 "..\..\Views\Job\LogRepairDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 5087), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime() , Tuple.Create(Tuple.Create("", 5113), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default #line default
#line hidden #line hidden
, 5087), false) , 5113), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 115 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 116 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(ja.Timestamp.ToFullDateTime()); Write(ja.Timestamp.ToFullDateTime());
@@ -634,7 +648,7 @@ WriteLiteral(">");
WriteLiteral("</span>\r\n </a> \r\n"); WriteLiteral("</span>\r\n </a> \r\n");
#line 117 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 118 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
@@ -644,7 +658,7 @@ WriteLiteral(" </div>\r\n </di
" </td>\r\n </tr>\r\n"); " </td>\r\n </tr>\r\n");
#line 122 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 123 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
@@ -666,7 +680,7 @@ WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");
WriteLiteral(" title=\"Please Wait\""); WriteLiteral(" title=\"Please Wait\"");
WriteLiteral("></i>Submitting Repair Request...</h4>\r\n </div>\r\n"); WriteLiteral("></i>Lodging Repair Request...</h4>\r\n </div>\r\n");
WriteLiteral(@" <script> WriteLiteral(@" <script>
$(function () { $(function () {
@@ -703,12 +717,12 @@ WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\""); WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Submit Repair Request\""); WriteLiteral(" value=\"Lodge Repair Request\"");
WriteLiteral(" />\r\n </div>\r\n"); WriteLiteral(" />\r\n </div>\r\n");
#line 152 "..\..\Views\Job\LogRepairDisclose.cshtml" #line 153 "..\..\Views\Job\LogRepairDisclose.cshtml"
} }
#line default #line default
+1 -1
View File
@@ -2,7 +2,7 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogRepair); 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 Error"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Repair Error");
} }
<div class="form" style="width: 650px"> <div class="form" style="width: 650px">
<h2>Submission Error</h2> <h2>Submission Error</h2>
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogRepair); 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 Error"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Repair Error");
#line default #line default
+60 -50
View File
@@ -2,10 +2,11 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty");
} }
@using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post)) @using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
{ {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true) @Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId) @Html.HiddenFor(m => m.JobId)
@Html.ValidationMessageFor(m => m.JobId) @Html.ValidationMessageFor(m => m.JobId)
@@ -13,28 +14,32 @@
<div id="warrantyJobForm" class="form" style="width: 650px"> <div id="warrantyJobForm" class="form" style="width: 650px">
<table> <table>
<tr> <tr>
<th>Internal Job Id: <th>
Internal Job Id:
</th> </th>
<td> <td>
@Model.JobId @Model.JobId
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Serial Number: <th>
Device Serial Number:
</th> </th>
<td> <td>
@Model.Job.Device.SerialNumber @Model.Job.Device.SerialNumber
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Model: <th>
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>Technician: <th>
Technician:
</th> </th>
<td> <td>
@Model.TechUser.DisplayName @Model.TechUser.DisplayName
@@ -45,28 +50,30 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 150px">Repair Address: <th style="width: 150px">
Repair Address:
</th> </th>
<td> <td>
@Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br /> @Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))<br />
@Html.ValidationMessageFor(m => m.OrganisationAddressId) @Html.ValidationMessageFor(m => m.OrganisationAddressId)
<div id="organisationAddressDetails"> <div id="organisationAddressDetails">
@{ @{
var oa = Model.OrganisationAddress; var oa = Model.OrganisationAddress;
if (oa != null) if (oa != null)
{ {
<span>@oa.Address</span> <span>@oa.Address</span>
<br /> <br />
<span>@oa.Suburb, @oa.Postcode</span> <span>@oa.Suburb, @oa.Postcode</span>
<br /> <br />
<span>@oa.State, @oa.Country</span> <span>@oa.State, @oa.Country</span>
} }
} }
</div> </div>
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Warranty Provider: <th>
Warranty Provider:
</th> </th>
<td> <td>
@Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } }))<br /> @Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } }))<br />
@@ -111,40 +118,41 @@
</tr> </tr>
</table> </table>
</div> </div>
if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0) if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0)
{ {
<div class="form" style="width: 650px; margin-top: 15px;"> <div class="form" style="width: 650px; margin-top: 15px;">
<h2>Send Attachments</h2> <h2>Send Attachments</h2>
<table> <table>
<tr> <tr>
<td> <td>
<div id="publishJobAttachments"> <div id="publishJobAttachments">
@foreach (var ja in Model.Job.JobAttachments) @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"> <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) /> <input type="checkbox" class="select" name="PublishAttachmentIds" value="@ja.Id" @(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null) />
<span class="icon" title="@ja.Filename"> <span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span> <img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" />
<span class="comments" title="@ja.Comments"> </span>
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) <span class="comments" title="@ja.Comments">
{ @ja.DocumentTemplate.Description} @{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
else { @ja.DocumentTemplate.Description}
{ @ja.Comments }} else
</span><span class="author">@ja.TechUser.ToStringFriendly()</span><span class="timestamp" data-livestamp="@(ja.Timestamp.ToUnixEpoc())" title="@ja.Timestamp.ToFullDateTime()">@ja.Timestamp.ToFullDateTime()</span> { @ja.Comments }}
</a> </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> </div>
</tr> </td>
</table> </tr>
</div> </table>
} </div>
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null) }
{ if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
<div id="warrantyJobProviderProperties"> {
@Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel) <div id="warrantyJobProviderProperties">
</div> @Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel)
} </div>
}
<div class="actionBar"> <div class="actionBar">
@if (Model.IsManualProvider) @if (Model.IsManualProvider)
{ {
@@ -179,6 +187,8 @@
$('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() }) $('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() })
).append( ).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() }) $('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() })
).append(
$('<input>').attr({ type: 'hidden', name: '__RequestVerificationToken', value: $providerId.closest('form').find('input[name="__RequestVerificationToken"]').val() })
).appendTo('body').submit(); ).appendTo('body').submit();
} }
+199 -177
View File
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty");
#line default #line default
@@ -65,41 +65,55 @@ WriteLiteral("\r\n");
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogWarranty.cshtml" #line 9 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationSummary(true)); Write(Html.AntiForgeryToken());
#line default #line default
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogWarranty.cshtml" #line 9 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogWarranty.cshtml" #line 10 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.HiddenFor(m => m.JobId)); Write(Html.HiddenFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogWarranty.cshtml" #line 11 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogWarranty.cshtml" #line 12 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.JobId)); Write(Html.ValidationMessageFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogWarranty.cshtml" #line 12 "..\..\Views\Job\LogWarranty.cshtml"
@@ -111,14 +125,14 @@ WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\""); WriteLiteral(" name=\"SubmissionAction\"");
WriteAttribute("value", Tuple.Create(" value=\"", 497), Tuple.Create("\"", 554) WriteAttribute("value", Tuple.Create(" value=\"", 529), Tuple.Create("\"", 586)
#line 12 "..\..\Views\Job\LogWarranty.cshtml" #line 13 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 505), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose" , Tuple.Create(Tuple.Create("", 537), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose"
#line default #line default
#line hidden #line hidden
, 505), false) , 537), false)
); );
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
@@ -131,37 +145,39 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\""); WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " + WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
" </th>\r\n <td>\r\n"); "nternal Job Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 19 "..\..\Views\Job\LogWarranty.cshtml" #line 21 "..\..\Views\Job\LogWarranty.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" +
">Device Serial Number:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Serial Number:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 26 "..\..\Views\Job\LogWarranty.cshtml" #line 29 "..\..\Views\Job\LogWarranty.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" +
">Device Model:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Model:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 33 "..\..\Views\Job\LogWarranty.cshtml" #line 37 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer); Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -170,19 +186,20 @@ WriteLiteral(" ");
WriteLiteral(" "); WriteLiteral(" ");
#line 33 "..\..\Views\Job\LogWarranty.cshtml" #line 37 "..\..\Views\Job\LogWarranty.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" +
">Technician:\r\n </th>\r\n <td>\r\n"); ">\r\n Technician:\r\n </th>\r\n <td>\r" +
"\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 40 "..\..\Views\Job\LogWarranty.cshtml" #line 45 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.DisplayName); Write(Model.TechUser.DisplayName);
@@ -195,7 +212,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: "); WriteLiteral(">\r\n Email Address: ");
#line 42 "..\..\Views\Job\LogWarranty.cshtml" #line 47 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.EmailAddress); Write(Model.TechUser.EmailAddress);
@@ -204,7 +221,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: "); WriteLiteral("<br />\r\n Phone Number: ");
#line 43 "..\..\Views\Job\LogWarranty.cshtml" #line 48 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.TechUser.PhoneNumber); Write(Model.TechUser.PhoneNumber);
@@ -215,12 +232,13 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" style=\"width: 150px\""); WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Repair Address:\r\n </th>\r\n <td>\r\n"); WriteLiteral(">\r\n Repair Address:\r\n </th>\r\n <t" +
"d>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 51 "..\..\Views\Job\LogWarranty.cshtml" #line 57 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null)))); Write(Html.DropDownListFor(model => model.OrganisationAddressId, Model.OrganisationAddresses.ToSelectListItems(Model.OrganisationAddressId, (Model.OrganisationAddress == null))));
@@ -231,7 +249,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 52 "..\..\Views\Job\LogWarranty.cshtml" #line 58 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.OrganisationAddressId)); Write(Html.ValidationMessageFor(m => m.OrganisationAddressId));
@@ -244,39 +262,39 @@ WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 54 "..\..\Views\Job\LogWarranty.cshtml" #line 60 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 54 "..\..\Views\Job\LogWarranty.cshtml" #line 60 "..\..\Views\Job\LogWarranty.cshtml"
var oa = Model.OrganisationAddress; var oa = Model.OrganisationAddress;
if (oa != null) if (oa != null)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 58 "..\..\Views\Job\LogWarranty.cshtml" #line 64 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Address); Write(oa.Address);
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n"); WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 60 "..\..\Views\Job\LogWarranty.cshtml" #line 66 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Suburb); Write(oa.Suburb);
#line default #line default
@@ -284,21 +302,21 @@ WriteLiteral(" <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 60 "..\..\Views\Job\LogWarranty.cshtml" #line 66 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Postcode); Write(oa.Postcode);
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n"); WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>"); WriteLiteral(" <span>");
#line 62 "..\..\Views\Job\LogWarranty.cshtml" #line 68 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.State); Write(oa.State);
#line default #line default
@@ -306,8 +324,8 @@ WriteLiteral(" <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 62 "..\..\Views\Job\LogWarranty.cshtml" #line 68 "..\..\Views\Job\LogWarranty.cshtml"
Write(oa.Country); Write(oa.Country);
#line default #line default
@@ -315,20 +333,20 @@ WriteLiteral(", ");
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
#line 63 "..\..\Views\Job\LogWarranty.cshtml" #line 69 "..\..\Views\Job\LogWarranty.cshtml"
} }
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " + WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th>Warranty Provider:\r\n </th>\r\n " + " <tr>\r\n <th>\r\n Warranty Provider:\r\n " +
" <td>\r\n"); " </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 72 "..\..\Views\Job\LogWarranty.cshtml" #line 79 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } }))); Write(Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } })));
@@ -339,7 +357,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogWarranty.cshtml" #line 80 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.WarrantyProviderId)); Write(Html.ValidationMessageFor(m => m.WarrantyProviderId));
@@ -348,13 +366,13 @@ WriteLiteral(" ");
WriteLiteral("\r\n"); WriteLiteral("\r\n");
#line 74 "..\..\Views\Job\LogWarranty.cshtml" #line 81 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 74 "..\..\Views\Job\LogWarranty.cshtml" #line 81 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.WarrantyProviders.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install)) if (Model.WarrantyProviders.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install))
{ {
@@ -375,21 +393,21 @@ WriteLiteral(" class=\"fa fa-info-circle\"");
WriteLiteral("></i>View the <a"); WriteLiteral("></i>View the <a");
WriteAttribute("href", Tuple.Create(" href=\"", 3317), Tuple.Create("\"", 3367) WriteAttribute("href", Tuple.Create(" href=\"", 3597), Tuple.Create("\"", 3647)
#line 78 "..\..\Views\Job\LogWarranty.cshtml" #line 85 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 3324), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install()) , Tuple.Create(Tuple.Create("", 3604), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default #line default
#line hidden #line hidden
, 3324), false) , 3604), false)
); );
WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider plugins.\r\n " + WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider plugins.\r\n " +
" </p>\r\n </div>\r\n"); " </p>\r\n </div>\r\n");
#line 81 "..\..\Views\Job\LogWarranty.cshtml" #line 88 "..\..\Views\Job\LogWarranty.cshtml"
} }
@@ -398,13 +416,13 @@ WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider pl
WriteLiteral(" </td>\r\n </tr>\r\n"); WriteLiteral(" </td>\r\n </tr>\r\n");
#line 84 "..\..\Views\Job\LogWarranty.cshtml" #line 91 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 84 "..\..\Views\Job\LogWarranty.cshtml" #line 91 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsManualProvider) if (Model.IsManualProvider)
{ {
@@ -417,7 +435,7 @@ WriteLiteral(" <tr>\r\n <th>Provider Name:</th
WriteLiteral(" "); WriteLiteral(" ");
#line 89 "..\..\Views\Job\LogWarranty.cshtml" #line 96 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.ManualProviderName)); Write(Html.EditorFor(model => model.ManualProviderName));
@@ -428,7 +446,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogWarranty.cshtml" #line 97 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderName)); Write(Html.ValidationMessageFor(m => m.ManualProviderName));
@@ -442,7 +460,7 @@ WriteLiteral(" <tr>\r\n <th>Provider Job Refer
WriteLiteral(" "); WriteLiteral(" ");
#line 96 "..\..\Views\Job\LogWarranty.cshtml" #line 103 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.ManualProviderReference)); Write(Html.EditorFor(model => model.ManualProviderReference));
@@ -453,7 +471,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 97 "..\..\Views\Job\LogWarranty.cshtml" #line 104 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderReference)); Write(Html.ValidationMessageFor(m => m.ManualProviderReference));
@@ -462,7 +480,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n"); WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 100 "..\..\Views\Job\LogWarranty.cshtml" #line 107 "..\..\Views\Job\LogWarranty.cshtml"
} }
@@ -484,7 +502,7 @@ WriteLiteral(">\r\n <h2>Fault Description</h2>\r\n <table>\r\n
WriteLiteral(" "); WriteLiteral(" ");
#line 108 "..\..\Views\Job\LogWarranty.cshtml" #line 115 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.FaultDescription)); Write(Html.EditorFor(model => model.FaultDescription));
@@ -495,7 +513,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 109 "..\..\Views\Job\LogWarranty.cshtml" #line 116 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.FaultDescription)); Write(Html.ValidationMessageFor(m => m.FaultDescription));
@@ -504,57 +522,57 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n"); WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 114 "..\..\Views\Job\LogWarranty.cshtml" #line 121 "..\..\Views\Job\LogWarranty.cshtml"
if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0) if (!Model.IsManualProvider && Authorization.Has(Claims.Job.ShowAttachments) && Model.Job.JobAttachments.Count > 0)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <div"); WriteLiteral(" <div");
WriteLiteral(" class=\"form\""); WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px; margin-top: 15px;\""); WriteLiteral(" style=\"width: 650px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Send Attachments</h2>\r\n <table>\r\n <tr>\r\n " + WriteLiteral(">\r\n <h2>Send Attachments</h2>\r\n <table>\r\n <t" +
" <td>\r\n <div"); "r>\r\n <td>\r\n <div");
WriteLiteral(" id=\"publishJobAttachments\""); WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 122 "..\..\Views\Job\LogWarranty.cshtml" #line 129 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 122 "..\..\Views\Job\LogWarranty.cshtml" #line 129 "..\..\Views\Job\LogWarranty.cshtml"
foreach (var ja in Model.Job.JobAttachments) foreach (var ja in Model.Job.JobAttachments)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 5195), Tuple.Create("\"", 5252) WriteAttribute("href", Tuple.Create(" href=\"", 5495), Tuple.Create("\"", 5552)
#line 124 "..\..\Views\Job\LogWarranty.cshtml" #line 131 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 5202), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id)) , Tuple.Create(Tuple.Create("", 5502), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default #line default
#line hidden #line hidden
, 5202), false) , 5502), false)
); );
WriteLiteral(" data-attachmentid=\""); WriteLiteral(" data-attachmentid=\"");
#line 124 "..\..\Views\Job\LogWarranty.cshtml" #line 131 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.Id); Write(ja.Id);
#line default #line default
@@ -564,15 +582,15 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\""); WriteLiteral(" data-mimetype=\"");
#line 124 "..\..\Views\Job\LogWarranty.cshtml" #line 131 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.MimeType); Write(ja.MimeType);
#line default #line default
#line hidden #line hidden
WriteLiteral("\""); WriteLiteral("\"");
WriteLiteral(">\r\n <input"); WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"checkbox\""); WriteLiteral(" type=\"checkbox\"");
@@ -580,119 +598,120 @@ WriteLiteral(" class=\"select\"");
WriteLiteral(" name=\"PublishAttachmentIds\""); WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 5409), Tuple.Create("\"", 5423) WriteAttribute("value", Tuple.Create(" value=\"", 5713), Tuple.Create("\"", 5727)
#line 125 "..\..\Views\Job\LogWarranty.cshtml" #line 132 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 5417), Tuple.Create<System.Object, System.Int32>(ja.Id , Tuple.Create(Tuple.Create("", 5721), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default #line default
#line hidden #line hidden
, 5417), false) , 5721), false)
); );
WriteLiteral(" "); WriteLiteral(" ");
#line 125 "..\..\Views\Job\LogWarranty.cshtml" #line 132 "..\..\Views\Job\LogWarranty.cshtml"
Write(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null); Write(Model.PublishAttachmentIds.Contains(ja.Id) ? "checked" : null);
#line default #line default
#line hidden #line hidden
WriteLiteral(" />\r\n <span"); WriteLiteral(" />\r\n <span");
WriteLiteral(" class=\"icon\""); WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5544), Tuple.Create("\"", 5564) WriteAttribute("title", Tuple.Create(" title=\"", 5852), Tuple.Create("\"", 5872)
#line 126 "..\..\Views\Job\LogWarranty.cshtml" #line 133 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 5552), Tuple.Create<System.Object, System.Int32>(ja.Filename , Tuple.Create(Tuple.Create("", 5860), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default #line default
#line hidden #line hidden
, 5552), false) , 5860), false)
); );
WriteLiteral(">\r\n <img"); WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\""); WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 5635), Tuple.Create("\"", 5694) WriteAttribute("src", Tuple.Create(" src=\"", 5947), Tuple.Create("\"", 6006)
#line 127 "..\..\Views\Job\LogWarranty.cshtml" #line 134 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 5641), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)) , Tuple.Create(Tuple.Create("", 5953), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default #line default
#line hidden #line hidden
, 5641), false) , 5953), false)
); );
WriteLiteral(" /></span>\r\n <span"); WriteLiteral(" />\r\n </span>\r\n " +
" <span");
WriteLiteral(" class=\"comments\""); WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5761), Tuple.Create("\"", 5781) WriteAttribute("title", Tuple.Create(" title=\"", 6115), Tuple.Create("\"", 6135)
#line 128 "..\..\Views\Job\LogWarranty.cshtml" #line 136 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 5769), Tuple.Create<System.Object, System.Int32>(ja.Comments , Tuple.Create(Tuple.Create("", 6123), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default #line default
#line hidden #line hidden
, 5769), false) , 6123), false)
); );
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 129 "..\..\Views\Job\LogWarranty.cshtml" #line 137 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 129 "..\..\Views\Job\LogWarranty.cshtml" #line 137 "..\..\Views\Job\LogWarranty.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ {
#line default #line default
#line hidden #line hidden
#line 130 "..\..\Views\Job\LogWarranty.cshtml" #line 138 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.DocumentTemplate.Description); Write(ja.DocumentTemplate.Description);
#line default #line default
#line hidden #line hidden
#line 130 "..\..\Views\Job\LogWarranty.cshtml" #line 138 "..\..\Views\Job\LogWarranty.cshtml"
} }
else else
{ {
#line default #line default
#line hidden #line hidden
#line 132 "..\..\Views\Job\LogWarranty.cshtml" #line 140 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.Comments); Write(ja.Comments);
#line default #line default
#line hidden #line hidden
#line 132 "..\..\Views\Job\LogWarranty.cshtml" #line 140 "..\..\Views\Job\LogWarranty.cshtml"
} }
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </span><span"); WriteLiteral("\r\n </span><span");
WriteLiteral(" class=\"author\""); WriteLiteral(" class=\"author\"");
WriteLiteral(">"); WriteLiteral(">");
#line 133 "..\..\Views\Job\LogWarranty.cshtml" #line 141 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.TechUser.ToStringFriendly()); Write(ja.TechUser.ToStringFriendly());
#line default #line default
@@ -704,74 +723,74 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\""); WriteLiteral(" data-livestamp=\"");
#line 133 "..\..\Views\Job\LogWarranty.cshtml" #line 141 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.Timestamp.ToUnixEpoc()); Write(ja.Timestamp.ToUnixEpoc());
#line default #line default
#line hidden #line hidden
WriteLiteral("\""); WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 6217), Tuple.Create("\"", 6255) WriteAttribute("title", Tuple.Create(" title=\"", 6589), Tuple.Create("\"", 6627)
#line 133 "..\..\Views\Job\LogWarranty.cshtml" #line 141 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 6225), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime() , Tuple.Create(Tuple.Create("", 6597), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default #line default
#line hidden #line hidden
, 6225), false) , 6597), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 133 "..\..\Views\Job\LogWarranty.cshtml"
Write(ja.Timestamp.ToFullDateTime());
#line default
#line hidden
WriteLiteral("</span>\r\n </a> \r\n");
#line 135 "..\..\Views\Job\LogWarranty.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\LogWarranty.cshtml" #line 141 "..\..\Views\Job\LogWarranty.cshtml"
} Write(ja.Timestamp.ToFullDateTime());
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
{
#line default #line default
#line hidden #line hidden
WriteLiteral(" <div"); WriteLiteral("</span>\r\n </a>\r\n");
#line 143 "..\..\Views\Job\LogWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n </td>\r\n </tr>\r" +
"\n </table>\r\n </div>\r\n");
#line 149 "..\..\Views\Job\LogWarranty.cshtml"
}
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"warrantyJobProviderProperties\""); WriteLiteral(" id=\"warrantyJobProviderProperties\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 145 "..\..\Views\Job\LogWarranty.cshtml" #line 153 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel)); Write(Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel));
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </div>\r\n"); WriteLiteral("\r\n </div>\r\n");
#line 147 "..\..\Views\Job\LogWarranty.cshtml" #line 155 "..\..\Views\Job\LogWarranty.cshtml"
} }
#line default #line default
@@ -783,13 +802,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 149 "..\..\Views\Job\LogWarranty.cshtml" #line 157 "..\..\Views\Job\LogWarranty.cshtml"
#line default #line default
#line hidden #line hidden
#line 149 "..\..\Views\Job\LogWarranty.cshtml" #line 157 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsManualProvider) if (Model.IsManualProvider)
{ {
@@ -807,7 +826,7 @@ WriteLiteral(" value=\"Save Warranty Claim\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 152 "..\..\Views\Job\LogWarranty.cshtml" #line 160 "..\..\Views\Job\LogWarranty.cshtml"
} }
else else
{ {
@@ -826,7 +845,7 @@ WriteLiteral(" value=\"Preview Warranty Claim\"");
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
#line 156 "..\..\Views\Job\LogWarranty.cshtml" #line 164 "..\..\Views\Job\LogWarranty.cshtml"
} }
@@ -835,7 +854,7 @@ WriteLiteral(" />\r\n");
WriteLiteral(" </div>\r\n"); WriteLiteral(" </div>\r\n");
#line 158 "..\..\Views\Job\LogWarranty.cshtml" #line 166 "..\..\Views\Job\LogWarranty.cshtml"
} }
@@ -860,16 +879,19 @@ WriteLiteral(">\r\n $(function () {\r\n var $providerId = $(\'#Warrant
" ).append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualPr" + " ).append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualPr" +
"oviderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " + "oviderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference" + " $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference" +
"\', value: $(\'#ManualProviderReference\').val() })\r\n ).appendTo(\'body\')" + "\', value: $(\'#ManualProviderReference\').val() })\r\n ).append(\r\n " +
".submit();\r\n }\r\n\r\n $providerId.change(updateDetails);\r\n $ad" + " $(\'<input>\').attr({ type: \'hidden\', name: \'__RequestVerificationToken\'," +
"dressId.change(updateDetails);\r\n\r\n var manualProvider = $(\'#ManualProvide" + " value: $providerId.closest(\'form\').find(\'input[name=\"__RequestVerificationToken" +
"rName\');\r\n if (manualProvider.length > 0 && !manualProvider.val()) {\r\n " + "\"]\').val() })\r\n ).appendTo(\'body\').submit();\r\n }\r\n\r\n $p" +
" manualProvider.focus();\r\n } else {\r\n $(\'#FaultDescrip" + "roviderId.change(updateDetails);\r\n $addressId.change(updateDetails);\r\n\r\n " +
"tion\').focus();\r\n }\r\n\r\n $(\'#publishJobAttachments\').on(\'click\', \'i" + " var manualProvider = $(\'#ManualProviderName\');\r\n if (manualProvide" +
"nput\', function (e) {\r\n e.preventDefault();\r\n setTimeout(f" + "r.length > 0 && !manualProvider.val()) {\r\n manualProvider.focus();\r\n " +
"unction () {\r\n var $i = $(e.currentTarget);\r\n $i.p" + " } else {\r\n $(\'#FaultDescription\').focus();\r\n }\r\n\r\n " +
"rop(\'checked\', !$i.prop(\'checked\'));\r\n }, 0);\r\n return fal" + " $(\'#publishJobAttachments\').on(\'click\', \'input\', function (e) {\r\n " +
"se;\r\n });\r\n });\r\n</script>\r\n"); "e.preventDefault();\r\n setTimeout(function () {\r\n var $" +
"i = $(e.currentTarget);\r\n $i.prop(\'checked\', !$i.prop(\'checked\'))" +
";\r\n }, 0);\r\n return false;\r\n });\r\n });\r\n</script" +
">\r\n");
} }
} }
+35 -22
View File
@@ -2,10 +2,11 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty");
} }
@using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post)) @using (Html.BeginForm(MVC.Job.LogWarranty(), FormMethod.Post))
{ {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true) @Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId) @Html.HiddenFor(m => m.JobId)
@Html.HiddenFor(m => m.OrganisationAddressId) @Html.HiddenFor(m => m.OrganisationAddressId)
@@ -16,28 +17,32 @@
<div id="warrantyJobForm" class="form" style="width: 650px"> <div id="warrantyJobForm" class="form" style="width: 650px">
<table> <table>
<tr> <tr>
<th>Internal Job Id: <th>
Internal Job Id:
</th> </th>
<td> <td>
@Model.JobId @Model.JobId
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Serial Number: <th>
Device Serial Number:
</th> </th>
<td> <td>
@Model.Job.Device.SerialNumber @Model.Job.Device.SerialNumber
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Device Model: <th>
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>Technician: <th>
Technician:
</th> </th>
<td> <td>
@Model.TechUser.DisplayName @Model.TechUser.DisplayName
@@ -48,7 +53,8 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th style="width: 150px">Warranty Address: <th style="width: 150px">
Warranty Address:
</th> </th>
<td> <td>
<div id="organisationAddressDetails"> <div id="organisationAddressDetails">
@@ -62,21 +68,24 @@
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Warranty Provider: <th>
Warranty Provider:
</th> </th>
<td> <td>
@Model.WarrantyProvider.Name (@Model.WarrantyProvider.Id) @Model.WarrantyProvider.PluginManifest.Version.ToString(3) @Model.WarrantyProvider.Name (@Model.WarrantyProvider.Id) @Model.WarrantyProvider.PluginManifest.Version.ToString(3)
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Fault Description: <th>
Fault Description:
</th> </th>
<td> <td>
@Model.FaultDescription.ToMultilineString() @Model.FaultDescription.ToMultilineString()
</td> </td>
</tr> </tr>
<tr> <tr>
<th>Disclosed Information <th>
Disclosed Information
</th> </th>
<td> <td>
<div id="warrantyDisclosedInformation"> <div id="warrantyDisclosedInformation">
@@ -84,12 +93,15 @@
@foreach (var dp in Model.DiscloseProperties) @foreach (var dp in Model.DiscloseProperties)
{ {
<tr> <tr>
<th>@dp.Key: <th>
</th> @dp.Key:
<td>@dp.Value </th>
</td> <td>
</tr> @dp.Value
} </td>
</tr>
}
</table> </table>
</div> </div>
</td> </td>
@@ -106,14 +118,15 @@
<input type="hidden" name="PublishAttachmentIds" value="@ja.Id" /> <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"> <a href="@Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))" data-attachmentid="@ja.Id" data-mimetype="@ja.MimeType">
<span class="icon" title="@ja.Filename"> <span class="icon" title="@ja.Filename">
<img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" /></span> <img alt="Attachment Thumbnail" src="@(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)))" />
</span>
<span class="comments" title="@ja.Comments"> <span class="comments" title="@ja.Comments">
@{if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) @{if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ @ja.DocumentTemplate.Description} { @ja.DocumentTemplate.Description}
else else
{ @ja.Comments }} { @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> </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> </a>
} }
</div> </div>
</div> </div>
@@ -123,7 +136,7 @@
</table> </table>
</div> </div>
<div id="submitDialog" class="dialog" title="Please Wait"> <div id="submitDialog" class="dialog" title="Please Wait">
<h4><i class="fa fa-lg fa-cog fa-spin" title="Please Wait"></i>Submitting Warranty Job...</h4> <h4><i class="fa fa-lg fa-cog fa-spin" title="Please Wait"></i>Lodging Warranty Claim...</h4>
</div> </div>
<script> <script>
$(function () { $(function () {
@@ -147,6 +160,6 @@
}); });
</script> </script>
<div class="actionBar"> <div class="actionBar">
<input id="submitJob" type="submit" class="button" value="Submit Warranty Claim" /> <input id="submitJob" type="submit" class="button" value="Lodge Warranty Claim" />
</div> </div>
} }
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty");
#line default #line default
@@ -65,83 +65,97 @@ WriteLiteral("\r\n");
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.ValidationSummary(true)); Write(Html.AntiForgeryToken());
#line default #line default
#line hidden #line hidden
#line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 9 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.JobId)); Write(Html.HiddenFor(m => m.JobId));
#line default #line default
#line hidden #line hidden
#line 10 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.OrganisationAddressId)); Write(Html.HiddenFor(m => m.OrganisationAddressId));
#line default #line default
#line hidden #line hidden
#line 11 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.WarrantyProviderId)); Write(Html.HiddenFor(m => m.WarrantyProviderId));
#line default #line default
#line hidden #line hidden
#line 12 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.FaultDescription)); Write(Html.HiddenFor(m => m.FaultDescription));
#line default #line default
#line hidden #line hidden
#line 13 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 15 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.ProviderPropertiesJson)); Write(Html.HiddenFor(m => m.ProviderPropertiesJson));
#line default #line default
#line hidden #line hidden
#line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 15 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
@@ -165,37 +179,39 @@ WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\""); WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>Internal Job Id:\r\n " + WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
" </th>\r\n <td>\r\n"); "nternal Job Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 22 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 24 "..\..\Views\Job\LogWarrantyDisclose.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" +
">Device Serial Number:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Serial Number:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 29 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 32 "..\..\Views\Job\LogWarrantyDisclose.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" +
">Device Model:\r\n </th>\r\n <td>\r\n"); ">\r\n Device Model:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 40 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer); Write(Model.Job.Device.DeviceModel.Manufacturer);
@@ -204,19 +220,20 @@ WriteLiteral(" ");
WriteLiteral(" "); WriteLiteral(" ");
#line 36 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 40 "..\..\Views\Job\LogWarrantyDisclose.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" +
">Technician:\r\n </th>\r\n <td>\r\n"); ">\r\n Technician:\r\n </th>\r\n <td>\r" +
"\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 43 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 48 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.DisplayName); Write(Model.TechUser.DisplayName);
@@ -229,7 +246,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: "); WriteLiteral(">\r\n Email Address: ");
#line 45 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 50 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.EmailAddress); Write(Model.TechUser.EmailAddress);
@@ -238,7 +255,7 @@ WriteLiteral(">\r\n Email Address: ");
WriteLiteral("<br />\r\n Phone Number: "); WriteLiteral("<br />\r\n Phone Number: ");
#line 46 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 51 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.TechUser.PhoneNumber); Write(Model.TechUser.PhoneNumber);
@@ -249,8 +266,8 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" style=\"width: 150px\""); WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">Warranty Address:\r\n </th>\r\n <td>\r\n " + WriteLiteral(">\r\n Warranty Address:\r\n </th>\r\n " +
" <div"); "<td>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\""); WriteLiteral(" id=\"organisationAddressDetails\"");
@@ -259,7 +276,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 55 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 61 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Name); Write(Model.OrganisationAddress.Name);
@@ -272,7 +289,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>"); WriteLiteral(">\r\n <span>");
#line 57 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 63 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Address); Write(Model.OrganisationAddress.Address);
@@ -281,7 +298,7 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 58 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 64 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb); Write(Model.OrganisationAddress.Suburb);
@@ -290,7 +307,7 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 58 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 64 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode); Write(Model.OrganisationAddress.Postcode);
@@ -299,7 +316,7 @@ WriteLiteral(", ");
WriteLiteral("</span><br />\r\n <span>"); WriteLiteral("</span><br />\r\n <span>");
#line 59 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 65 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.OrganisationAddress.State); Write(Model.OrganisationAddress.State);
@@ -308,20 +325,20 @@ WriteLiteral("</span><br />\r\n <span>");
WriteLiteral(", "); WriteLiteral(", ");
#line 59 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 65 "..\..\Views\Job\LogWarrantyDisclose.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>Warranty Pro" + " </td>\r\n </tr>\r\n <tr>\r\n <th>\r\n " +
"vider:\r\n </th>\r\n <td>\r\n"); " Warranty Provider:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 68 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 75 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.Name); Write(Model.WarrantyProvider.Name);
@@ -330,7 +347,7 @@ WriteLiteral(" ");
WriteLiteral(" ("); WriteLiteral(" (");
#line 68 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 75 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.Id); Write(Model.WarrantyProvider.Id);
@@ -339,71 +356,75 @@ WriteLiteral(" (");
WriteLiteral(") "); WriteLiteral(") ");
#line 68 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 75 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.WarrantyProvider.PluginManifest.Version.ToString(3)); Write(Model.WarrantyProvider.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" +
">Fault Description:\r\n </th>\r\n <td>\r\n"); ">\r\n Fault Description:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 75 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 83 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Model.FaultDescription.ToMultilineString()); Write(Model.FaultDescription.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" +
">Disclosed Information\r\n </th>\r\n <td>\r\n " + ">\r\n Disclosed Information\r\n </th>\r\n " +
" <div"); " <td>\r\n <div");
WriteLiteral(" id=\"warrantyDisclosedInformation\""); WriteLiteral(" id=\"warrantyDisclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n"); WriteLiteral(">\r\n <table>\r\n");
#line 84 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 93 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 84 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 93 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties) foreach (var dp in Model.DiscloseProperties)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <tr>\r\n <th>"); WriteLiteral(" <tr>\r\n <th>\r\n");
WriteLiteral(" ");
#line 87 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 97 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(dp.Key); Write(dp.Key);
#line default #line default
#line hidden #line hidden
WriteLiteral(":\r\n </th>\r\n " + WriteLiteral(":\r\n </th>\r\n <td>\r\n");
" <td>");
WriteLiteral(" ");
#line 89 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 100 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(dp.Value); Write(dp.Value);
#line default #line default
#line hidden #line hidden
WriteLiteral("\r\n </td>\r\n </tr" + WriteLiteral("\r\n </td>\r\n </tr>\r\n");
"> \r\n");
#line 92 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 103 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
}
}
#line default #line default
@@ -412,13 +433,13 @@ WriteLiteral(" </table>\r\n </div>\r\n
"d>\r\n </tr>\r\n"); "d>\r\n </tr>\r\n");
#line 97 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 109 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 97 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 109 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
if (Model.PublishAttachments.Count > 0) if (Model.PublishAttachments.Count > 0)
{ {
@@ -434,13 +455,13 @@ WriteLiteral(" id=\"publishJobAttachments\"");
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 104 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 116 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 104 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 116 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
foreach (var ja in Model.PublishAttachments) foreach (var ja in Model.PublishAttachments)
{ {
@@ -453,34 +474,34 @@ WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"PublishAttachmentIds\""); WriteLiteral(" name=\"PublishAttachmentIds\"");
WriteAttribute("value", Tuple.Create(" value=\"", 4138), Tuple.Create("\"", 4152) WriteAttribute("value", Tuple.Create(" value=\"", 4393), Tuple.Create("\"", 4407)
#line 106 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 118 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4146), Tuple.Create<System.Object, System.Int32>(ja.Id , Tuple.Create(Tuple.Create("", 4401), Tuple.Create<System.Object, System.Int32>(ja.Id
#line default #line default
#line hidden #line hidden
, 4146), false) , 4401), false)
); );
WriteLiteral(" />\r\n"); WriteLiteral(" />\r\n");
WriteLiteral(" <a"); WriteLiteral(" <a");
WriteAttribute("href", Tuple.Create(" href=\"", 4196), Tuple.Create("\"", 4253) WriteAttribute("href", Tuple.Create(" href=\"", 4451), Tuple.Create("\"", 4508)
#line 107 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 119 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4203), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id)) , Tuple.Create(Tuple.Create("", 4458), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentDownload(ja.Id))
#line default #line default
#line hidden #line hidden
, 4203), false) , 4458), false)
); );
WriteLiteral(" data-attachmentid=\""); WriteLiteral(" data-attachmentid=\"");
#line 107 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 119 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.Id); Write(ja.Id);
@@ -491,7 +512,7 @@ WriteLiteral("\"");
WriteLiteral(" data-mimetype=\""); WriteLiteral(" data-mimetype=\"");
#line 107 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 119 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.MimeType); Write(ja.MimeType);
@@ -503,84 +524,85 @@ WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"icon\""); WriteLiteral(" class=\"icon\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4371), Tuple.Create("\"", 4391) WriteAttribute("title", Tuple.Create(" title=\"", 4626), Tuple.Create("\"", 4646)
#line 108 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 120 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4379), Tuple.Create<System.Object, System.Int32>(ja.Filename , Tuple.Create(Tuple.Create("", 4634), Tuple.Create<System.Object, System.Int32>(ja.Filename
#line default #line default
#line hidden #line hidden
, 4379), false) , 4634), false)
); );
WriteLiteral(">\r\n <img"); WriteLiteral(">\r\n <img");
WriteLiteral(" alt=\"Attachment Thumbnail\""); WriteLiteral(" alt=\"Attachment Thumbnail\"");
WriteAttribute("src", Tuple.Create(" src=\"", 4470), Tuple.Create("\"", 4529) WriteAttribute("src", Tuple.Create(" src=\"", 4725), Tuple.Create("\"", 4784)
#line 109 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 121 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4476), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id)) , Tuple.Create(Tuple.Create("", 4731), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Job.AttachmentThumbnail(ja.Id))
#line default #line default
#line hidden #line hidden
, 4476), false) , 4731), false)
); );
WriteLiteral(" /></span>\r\n <span"); WriteLiteral(" />\r\n </span>\r\n " +
" <span");
WriteLiteral(" class=\"comments\""); WriteLiteral(" class=\"comments\"");
WriteAttribute("title", Tuple.Create(" title=\"", 4604), Tuple.Create("\"", 4624) WriteAttribute("title", Tuple.Create(" title=\"", 4901), Tuple.Create("\"", 4921)
#line 110 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 123 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 4612), Tuple.Create<System.Object, System.Int32>(ja.Comments , Tuple.Create(Tuple.Create("", 4909), Tuple.Create<System.Object, System.Int32>(ja.Comments
#line default #line default
#line hidden #line hidden
, 4612), false) , 4909), false)
); );
WriteLiteral(">\r\n"); WriteLiteral(">\r\n");
#line 111 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 124 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
#line default #line default
#line hidden #line hidden
#line 111 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 124 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
if (!string.IsNullOrEmpty(ja.DocumentTemplateId)) if (!string.IsNullOrEmpty(ja.DocumentTemplateId))
{ {
#line default #line default
#line hidden #line hidden
#line 112 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 125 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.DocumentTemplate.Description); Write(ja.DocumentTemplate.Description);
#line default #line default
#line hidden #line hidden
#line 112 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 125 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
} }
else else
{ {
#line default #line default
#line hidden #line hidden
#line 114 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 127 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.Comments); Write(ja.Comments);
#line default #line default
#line hidden #line hidden
#line 114 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 127 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
} }
#line default #line default
#line hidden #line hidden
@@ -591,7 +613,7 @@ WriteLiteral(" class=\"author\"");
WriteLiteral(">"); WriteLiteral(">");
#line 115 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 128 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.TechUser.ToStringFriendly()); Write(ja.TechUser.ToStringFriendly());
@@ -604,7 +626,7 @@ WriteLiteral(" class=\"timestamp\"");
WriteLiteral(" data-livestamp=\""); WriteLiteral(" data-livestamp=\"");
#line 115 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 128 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.Timestamp.ToUnixEpoc()); Write(ja.Timestamp.ToUnixEpoc());
@@ -612,29 +634,29 @@ WriteLiteral(" data-livestamp=\"");
#line hidden #line hidden
WriteLiteral("\""); WriteLiteral("\"");
WriteAttribute("title", Tuple.Create(" title=\"", 5100), Tuple.Create("\"", 5138) WriteAttribute("title", Tuple.Create(" title=\"", 5395), Tuple.Create("\"", 5433)
#line 115 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 128 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
, Tuple.Create(Tuple.Create("", 5108), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime() , Tuple.Create(Tuple.Create("", 5403), Tuple.Create<System.Object, System.Int32>(ja.Timestamp.ToFullDateTime()
#line default #line default
#line hidden #line hidden
, 5108), false) , 5403), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 115 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 128 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(ja.Timestamp.ToFullDateTime()); Write(ja.Timestamp.ToFullDateTime());
#line default #line default
#line hidden #line hidden
WriteLiteral("</span>\r\n </a> \r\n"); WriteLiteral("</span>\r\n </a>\r\n");
#line 117 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 130 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
} }
@@ -644,7 +666,7 @@ WriteLiteral(" </div>\r\n </di
" </td>\r\n </tr>\r\n"); " </td>\r\n </tr>\r\n");
#line 122 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 135 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
} }
@@ -666,7 +688,7 @@ WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");
WriteLiteral(" title=\"Please Wait\""); WriteLiteral(" title=\"Please Wait\"");
WriteLiteral("></i>Submitting Warranty Job...</h4>\r\n </div>\r\n"); WriteLiteral("></i>Lodging Warranty Claim...</h4>\r\n </div>\r\n");
WriteLiteral(@" <script> WriteLiteral(@" <script>
$(function () { $(function () {
@@ -703,12 +725,12 @@ WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\""); WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Submit Warranty Claim\""); WriteLiteral(" value=\"Lodge Warranty Claim\"");
WriteLiteral(" />\r\n </div>\r\n"); WriteLiteral(" />\r\n </div>\r\n");
#line 152 "..\..\Views\Job\LogWarrantyDisclose.cshtml" #line 165 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
} }
#line default #line default
+1 -1
View File
@@ -2,7 +2,7 @@
@{ @{
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty Error"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty Error");
} }
<div class="form" style="width: 650px"> <div class="form" style="width: 650px">
<h2>Submission Error</h2> <h2>Submission Error</h2>
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Job
Authorization.Require(Claims.Job.Actions.LogWarranty); Authorization.Require(Claims.Job.Actions.LogWarranty);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Warranty Error"); ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Lodge Warranty Error");
#line default #line default