Feature #2: Implement Repair Provider

Logging Repair for Non-Warranty jobs has been brought into line with
Logging Warranty. RepairProviderFeature implemented which allows plugins
to be used in submitting jobs to third-parties for repair.
This commit is contained in:
Gary Sharp
2014-07-10 17:45:13 +10:00
parent 5ba9fde10f
commit f4394fe2a0
47 changed files with 4471 additions and 1163 deletions
+33 -10
View File
@@ -170,7 +170,7 @@ namespace Disco.BI.Extensions
j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now;
j.JobMetaWarranty.ExternalName = WarrantyProvider.WarrantyProviderId;
if (providerRef.Length > 100)
if (providerRef != null && providerRef.Length > 100)
j.JobMetaWarranty.ExternalReference = providerRef.Substring(0, 100);
else
j.JobMetaWarranty.ExternalReference = providerRef;
@@ -186,18 +186,18 @@ namespace Disco.BI.Extensions
Database.JobLogs.Add(jobLog);
}
}
public static void OnLogWarranty(this Job j, DiscoDataContext Database, string FaultDescription, string CustomProviderName, string CustomProviderReference, 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())
throw new InvalidOperationException("Log Warranty was Denied");
j.JobMetaWarranty.ExternalLoggedDate = DateTime.Now;
j.JobMetaWarranty.ExternalName = CustomProviderName;
j.JobMetaWarranty.ExternalName = ManualProviderName;
if (CustomProviderReference != null && CustomProviderReference.Length > 100)
j.JobMetaWarranty.ExternalReference = CustomProviderReference.Substring(0, 100);
if (ManualProviderReference != null && ManualProviderReference.Length > 100)
j.JobMetaWarranty.ExternalReference = ManualProviderReference.Substring(0, 100);
else
j.JobMetaWarranty.ExternalReference = CustomProviderReference;
j.JobMetaWarranty.ExternalReference = ManualProviderReference;
// Write Log
JobLog jobLog = new JobLog()
@@ -205,7 +205,7 @@ namespace Disco.BI.Extensions
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Custom Warranty Claim Submitted\r\nCustom Provider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", CustomProviderName, Address.Name, CustomProviderReference ?? "<None>", FaultDescription)
Comments = string.Format("####Manual Warranty Claim Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", ManualProviderName, Address.Name, ManualProviderReference ?? "<None>", FaultDescription)
};
Database.JobLogs.Add(jobLog);
}
@@ -341,7 +341,7 @@ namespace Disco.BI.Extensions
!j.JobMetaNonWarranty.RepairerLoggedDate.HasValue &&
!j.JobMetaNonWarranty.RepairerCompletedDate.HasValue;
}
public static void OnLogRepair(this Job j, DiscoDataContext Database, string RepairDescription, PluginFeatureManifest RepairProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> ProviderProperties)
public static void OnLogRepair(this Job j, DiscoDataContext Database, string RepairDescription, PluginFeatureManifest RepairProviderDefinition, OrganisationAddress Address, User TechUser, Dictionary<string, string> RepairProviderProperties)
{
if (!j.CanLogRepair())
throw new InvalidOperationException("Log Repair was Denied");
@@ -353,12 +353,12 @@ namespace Disco.BI.Extensions
using (RepairProviderFeature RepairProvider = RepairProviderDefinition.CreateInstance<RepairProviderFeature>())
{
string providerRef = RepairProvider.SubmitJob(Database, j, Address, TechUser, RepairDescription, ProviderProperties);
string providerRef = RepairProvider.SubmitJob(Database, j, Address, TechUser, RepairDescription, RepairProviderProperties);
j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now;
j.JobMetaNonWarranty.RepairerName = RepairProvider.ProviderId;
if (providerRef.Length > 100)
if (providerRef != null && providerRef.Length > 100)
j.JobMetaNonWarranty.RepairerReference = providerRef.Substring(0, 100);
else
j.JobMetaNonWarranty.RepairerReference = providerRef;
@@ -374,6 +374,29 @@ namespace Disco.BI.Extensions
Database.JobLogs.Add(jobLog);
}
}
public static void OnLogRepair(this Job j, DiscoDataContext Database, string FaultDescription, string ManualProviderName, string ManualProviderReference, OrganisationAddress Address, User TechUser)
{
if (!j.CanLogRepair())
throw new InvalidOperationException("Log Repair was Denied");
j.JobMetaNonWarranty.RepairerLoggedDate = DateTime.Now;
j.JobMetaNonWarranty.RepairerName = ManualProviderName;
if (ManualProviderReference != null && ManualProviderReference.Length > 100)
j.JobMetaNonWarranty.RepairerReference = ManualProviderReference.Substring(0, 100);
else
j.JobMetaNonWarranty.RepairerReference = ManualProviderReference;
// Write Log
JobLog jobLog = new JobLog()
{
JobId = j.Id,
TechUserId = TechUser.UserId,
Timestamp = DateTime.Now,
Comments = string.Format("####Manual Repair Request Submitted\r\nProvider: **{0}**\r\nAddress: **{1}**\r\nReference: **{2}**\r\n___\r\n{3}", ManualProviderName, Address.Name, ManualProviderReference ?? "<None>", FaultDescription)
};
Database.JobLogs.Add(jobLog);
}
#endregion
#region Repair Complete
+8 -1
View File
@@ -143,6 +143,10 @@
<Compile Include="Migrations\201406160912525_DBv14.Designer.cs">
<DependentUpon>201406160912525_DBv14.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\201407100413342_DBv15.cs" />
<Compile Include="Migrations\201407100413342_DBv15.Designer.cs">
<DependentUpon>201407100413342_DBv15.cs</DependentUpon>
</Compile>
<Compile Include="Migrations\Configuration.cs" />
<Compile Include="Migrations\DiscoDataMigrator.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
@@ -200,6 +204,9 @@
<EmbeddedResource Include="Migrations\201406160912525_DBv14.resx">
<DependentUpon>201406160912525_DBv14.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Migrations\201407100413342_DBv15.resx">
<DependentUpon>201407100413342_DBv15.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
@@ -213,7 +220,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<VisualStudio>
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2014/6/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2014/6/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
</VisualStudio>
</ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+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 DBv15 : IMigrationMetadata
{
private readonly ResourceManager Resources = new ResourceManager(typeof(DBv15));
string IMigrationMetadata.Id
{
get { return "201407100413342_DBv15"; }
}
string IMigrationMetadata.Source
{
get { return null; }
}
string IMigrationMetadata.Target
{
get { return Resources.GetString("Target"); }
}
}
}
@@ -0,0 +1,18 @@
namespace Disco.Data.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class DBv15 : DbMigration
{
public override void Up()
{
AddColumn("dbo.DeviceModels", "DefaultRepairProvider", c => c.String(maxLength: 40));
}
public override void Down()
{
DropColumn("dbo.DeviceModels", "DefaultRepairProvider");
}
}
}
File diff suppressed because one or more lines are too long
@@ -33,6 +33,9 @@ namespace Disco.Models.Repository
[StringLength(40)]
public string DefaultWarrantyProvider { get; set; }
[StringLength(40)]
public string DefaultRepairProvider { get; set; }
public virtual IList<DeviceComponent> DeviceComponents { get; set; }
public virtual IList<Device> Devices { get; set; }
+8
View File
@@ -133,6 +133,7 @@ namespace Disco.Services.Authorization
{ "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.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.RepairProviderDetails", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairProviderDetails, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairProviderDetails = v, "Repair Provider Details", "Can access repair provider details", false) },
{ "Job.Properties.NonWarrantyProperties.RepairerCompletedDate", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate = v, "Repairer Completed Date Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.RepairerLoggedDate", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate = v, "Repairer Logged Date Property", "Can update property", false) },
{ "Job.Properties.NonWarrantyProperties.RepairerName", new Tuple<Func<RoleClaims, bool>, Action<RoleClaims, bool>, string, string, bool>(c => c.Job.Properties.NonWarrantyProperties.RepairerName, (c, v) => c.Job.Properties.NonWarrantyProperties.RepairerName = v, "Repairer Name Property", "Can update property", false) },
@@ -352,6 +353,7 @@ namespace Disco.Services.Authorization
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderRaised", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderReference", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.PurchaseOrderSent", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairProviderDetails", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerCompletedDate", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerLoggedDate", false),
new ClaimNavigatorItem("Job.Properties.NonWarrantyProperties.RepairerName", false),
@@ -645,6 +647,7 @@ namespace Disco.Services.Authorization
c.Job.Properties.NonWarrantyProperties.PurchaseOrderRaised = true;
c.Job.Properties.NonWarrantyProperties.PurchaseOrderReference = true;
c.Job.Properties.NonWarrantyProperties.PurchaseOrderSent = true;
c.Job.Properties.NonWarrantyProperties.RepairProviderDetails = true;
c.Job.Properties.NonWarrantyProperties.RepairerCompletedDate = true;
c.Job.Properties.NonWarrantyProperties.RepairerLoggedDate = true;
c.Job.Properties.NonWarrantyProperties.RepairerName = true;
@@ -1424,6 +1427,11 @@ namespace Disco.Services.Authorization
/// </summary>
public const string PurchaseOrderSent = "Job.Properties.NonWarrantyProperties.PurchaseOrderSent";
/// <summary>Repair Provider Details
/// <para>Can access repair provider details</para>
/// </summary>
public const string RepairProviderDetails = "Job.Properties.NonWarrantyProperties.RepairProviderDetails";
/// <summary>Repairer Completed Date Property
/// <para>Can update property</para>
/// </summary>
@@ -44,6 +44,9 @@ namespace Disco.Services.Authorization.Roles.ClaimGroups.Job
[ClaimDetails("Repairer Reference Property", "Can update property")]
public bool RepairerReference { get; set; }
[ClaimDetails("Repair Provider Details", "Can access repair provider details")]
public bool RepairProviderDetails { get; set; }
[ClaimDetails("Insurance Detail Properties", "Can update insurance detail properties")]
public bool InsuranceDetails { get; set; }
}
@@ -157,12 +157,15 @@ namespace Disco.Services.Authorization.Roles
/// </summary>
private static void MigrateAuthorizationRoles(DiscoDataContext Database)
{
// Use 'MyJobs' (A new claim) to detect if the Role hasn't been migrated yet
var affectedRoles = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("MyJobs")).ToList();
// Determine roles which need migration from DBv11 -> DBv14
var affectedRoles_DBv14 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("MyJobs")).ToList();
if (affectedRoles.Count > 0)
// Determine roles which need migration from DBv14 -> DBv15
var affectedRoles_DBv15 = Database.AuthorizationRoles.Where(r => !r.ClaimsJson.Contains("RepairProviderDetails")).ToList();
if (affectedRoles_DBv14.Count > 0)
{
foreach (var role in affectedRoles)
foreach (var role in affectedRoles_DBv14)
{
var claims = JsonConvert.DeserializeObject<RoleClaims>(role.ClaimsJson);
@@ -204,6 +207,24 @@ namespace Disco.Services.Authorization.Roles
Database.SaveChanges();
}
if (affectedRoles_DBv15.Count > 0)
{
foreach (var role in affectedRoles_DBv15)
{
var claims = JsonConvert.DeserializeObject<RoleClaims>(role.ClaimsJson);
// If the user previously had the ability to view warranty provider details, they probably should be able to view repair provider details (new feature).
if (claims.Job.Properties.WarrantyProperties.ProviderDetails)
{
claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails = true;
}
role.ClaimsJson = Newtonsoft.Json.JsonConvert.SerializeObject(claims);
}
Database.SaveChanges();
}
}
}
}
+2
View File
@@ -261,6 +261,8 @@
<Compile Include="Logging\Persistance\LogPersistContextInitializer.cs" />
<Compile Include="Logging\Utilities.cs" />
<Compile Include="Plugins\CommunityInterop\PluginLibraryUpdateTask.cs" />
<Compile Include="Plugins\Features\RepairProvider\RepairProviderFeature.cs" />
<Compile Include="Plugins\Features\RepairProvider\RepairProviderSubmitJobException.cs" />
<Compile Include="Plugins\Features\UIExtension\Results\LiteralResult.cs" />
<Compile Include="Plugins\Features\UIExtension\Results\MultipleResult.cs" />
<Compile Include="Plugins\Features\UIExtension\Results\PluginResourceCssResult.cs" />
@@ -0,0 +1,94 @@
using Disco.Data.Repository;
using Disco.Models.BI.Config;
using Disco.Models.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;
namespace Disco.Services.Plugins.Features.RepairProvider
{
[PluginFeatureCategory(DisplayName = "Repair Providers")]
public abstract class RepairProviderFeature : PluginFeature
{
/// <summary>
/// The repairer identifier. Used to link this provider to any <see cref="Disco.Models.Repository.RepairerName"/>. This identifier is used to automatically set the RepairerName 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 repair 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, string RepairDescription)
{
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, string RepairDescription, 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="Disco.Models.Repository.RepairerReference"/></returns>
public abstract string SubmitJob(DiscoDataContext Database, Job Job, OrganisationAddress Address, User TechUser, string RepairDescription, 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 repair 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 PluginIdOrRepairProviderId)
{
var defs = Plugins.GetPluginFeatures(typeof(RepairProviderFeature));
var def = defs.FirstOrDefault(d => d.PluginManifest.Id.Equals(PluginIdOrRepairProviderId, StringComparison.OrdinalIgnoreCase));
if (def != null)
return def;
else
foreach (var d in defs)
{
using (var providerInstance = d.CreateInstance<RepairProviderFeature>())
{
if (providerInstance.ProviderId != null && providerInstance.ProviderId.Equals(PluginIdOrRepairProviderId, StringComparison.OrdinalIgnoreCase))
{
return d;
}
}
}
return null;
}
}
}
@@ -0,0 +1,12 @@
using System;
namespace Disco.Services.Plugins.Features.RepairProvider
{
public class RepairProviderSubmitJobException : Exception
{
public RepairProviderSubmitJobException(string Message)
: base(Message)
{
}
}
}
@@ -26,12 +26,13 @@ namespace Disco.Web.Extensions
public static List<SelectListItem> ToSelectListItems(this IEnumerable<PluginFeatureManifest> PluginDefinitions, string SelectedId = null, bool IncludeInstructionFirst = false, string InstructionMessage = "Select a Plugin", Dictionary<string, string> AdditionalItems = null)
{
List<SelectListItem> selectItems;
var items = PluginDefinitions
.Select(wpd => new SelectListItem { Value = wpd.Id, Text = wpd.Name, Selected = (SelectedId != null && SelectedId.Equals(wpd.Id)) });
selectItems = PluginDefinitions
.Select(wpd => new SelectListItem { Value = wpd.Id, Text = wpd.Name, Selected = (SelectedId != null && SelectedId.Equals(wpd.Id)) })
.Concat(AdditionalItems.Select(i => new SelectListItem { Value = i.Key, Text = i.Value, Selected = (SelectedId != null && SelectedId.Equals(i.Key)) }))
.OrderBy(i => i.Text).ToList();
if (AdditionalItems != null)
items = items.Concat(AdditionalItems.Select(i => new SelectListItem { Value = i.Key, Text = i.Value, Selected = (SelectedId != null && SelectedId.Equals(i.Key)) }));
var selectItems = items.OrderBy(i => i.Text).ToList();
if (IncludeInstructionFirst)
selectItems.Insert(0, new SelectListItem() { Value = String.Empty, Text = String.Format("<{0}>", InstructionMessage), Selected = String.IsNullOrEmpty(SelectedId) });
@@ -2,6 +2,7 @@
using Disco.Models.Repository;
using Disco.Services.Authorization;
using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Plugins.Features.WarrantyProvider;
using Disco.Services.Web;
using System;
@@ -18,6 +19,7 @@ namespace Disco.Web.Areas.API.Controllers
const string pDescription = "description";
const string pDefaultPurchaseDate = "defaultpurchasedate";
const string pDefaultWarrantyProvider = "defaultwarrantyprovider";
const string pDefaultRepairProvider = "defaultrepairprovider";
[DiscoAuthorize(Claims.Config.DeviceModel.Configure)]
public virtual ActionResult Update(int id, string key, string value = null, bool redirect = false)
@@ -44,6 +46,9 @@ namespace Disco.Web.Areas.API.Controllers
case pDefaultWarrantyProvider:
UpdateDefaultWarrantyProvider(deviceModel, value);
break;
case pDefaultRepairProvider:
UpdateDefaultRepairProvider(deviceModel, value);
break;
default:
throw new Exception("Invalid Update Key");
}
@@ -86,6 +91,12 @@ namespace Disco.Web.Areas.API.Controllers
return Update(id, pDefaultWarrantyProvider, DefaultWarrantyProvider, redirect);
}
[DiscoAuthorize(Claims.Config.DeviceModel.Configure)]
public virtual ActionResult UpdateDefaultRepairProvider(int id, string DefaultRepairProvider = null, bool redirect = false)
{
return Update(id, pDefaultRepairProvider, DefaultRepairProvider, redirect);
}
#endregion
#region Update Properties
@@ -131,6 +142,20 @@ namespace Disco.Web.Areas.API.Controllers
}
Database.SaveChanges();
}
private void UpdateDefaultRepairProvider(Disco.Models.Repository.DeviceModel deviceModel, string DefaultRepairProvider)
{
if (string.IsNullOrEmpty(DefaultRepairProvider))
{
deviceModel.DefaultRepairProvider = null;
}
else
{
// Validate
var RepairProvider = Plugins.GetPluginFeature(DefaultRepairProvider, typeof(RepairProviderFeature));
deviceModel.DefaultRepairProvider = RepairProvider.Id;
}
Database.SaveChanges();
}
#endregion
#region ModelImage
@@ -1599,31 +1599,6 @@ namespace Disco.Web.Areas.API.Controllers
}
}
[DiscoAuthorize(Claims.Job.Actions.LogRepair)]
public virtual ActionResult LogRepair(int id, string RepairerName, string RepairerReference, bool? redirect = null)
{
var j = Database.Jobs.Include("JobMetaNonWarranty").Where(job => job.Id == id).FirstOrDefault();
if (j != null)
{
if (j.CanLogRepair())
{
j.OnLogRepair(RepairerName, RepairerReference);
Database.SaveChanges();
if (redirect.HasValue && redirect.Value)
return RedirectToAction(MVC.Job.Show(id));
else
return Json("OK", JsonRequestBehavior.AllowGet);
}
else
{
return Json("Job's state doesn't allow this action", JsonRequestBehavior.AllowGet);
}
}
return Json("Invalid Job Number", JsonRequestBehavior.AllowGet);
}
[DiscoAuthorize(Claims.Job.Properties.DeviceReadyForReturn)]
public virtual ActionResult DeviceReadyForReturn(int id, bool redirect)
{
@@ -2,6 +2,7 @@
using Disco.Models.UI.Config.DeviceModel;
using Disco.Services.Authorization;
using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Plugins.Features.WarrantyProvider;
using Disco.Services.Web;
@@ -29,6 +30,7 @@ namespace Disco.Web.Areas.Config.Controllers
throw new ArgumentException("Invalid Device Model Id", "id");
m.WarrantyProviders = Plugins.GetPluginFeatures(typeof(WarrantyProviderFeature));
m.RepairProviders = Plugins.GetPluginFeatures(typeof(RepairProviderFeature));
m.DeviceComponentsModel = new Models.DeviceModel.ComponentsModel()
{
@@ -14,6 +14,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceModel
public ConfigDeviceModelComponentsModel DeviceComponentsModel { get; set; }
public List<PluginFeatureManifest> WarrantyProviders { get; set; }
public List<PluginFeatureManifest> RepairProviders { get; set; }
public int DeviceCount { get; set; }
public int DeviceDecommissionedCount { get; set; }
@@ -3,6 +3,12 @@
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.Configure);
var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install);
if (canConfig)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
}
@@ -23,6 +29,16 @@
@Html.EditorFor(model => model.DeviceModel.Description)
@AjaxHelpers.AjaxSave()
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_Description'),
'Model Description',
'@Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id))',
'Description'
);
});
</script>
}
else
{
@@ -61,6 +77,19 @@
{
@Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate)
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
var dateField = $('#DeviceModel_DefaultPurchaseDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'None',
'@(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)))',
'DefaultPurchaseDate',
null,
true
);
});
</script>
}
else
{
@@ -72,9 +101,34 @@
<th>Default Warranty Provider:
</th>
<td>@if (canConfig)
{
if (Model.WarrantyProviders.Count > 0)
{
@Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None"))
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_DefaultWarrantyProvider'),
null,
'@Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))',
'DefaultWarrantyProvider'
);
});
</script>
}
else
{
<span class="smallMessage">No warranty provider plugins installed</span>
}
if (canViewPlugins)
{
<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 warranty provider plugins.
</p>
</div>
}
}
else
{
@@ -97,6 +151,60 @@
}
</td>
</tr>
<tr>
<th>Default Repair Provider:
</th>
<td>@if (canConfig)
{
if (Model.RepairProviders.Count > 0)
{
@Html.DropDownListFor(model => model.DeviceModel.DefaultRepairProvider, Model.RepairProviders.ToSelectListItems(Model.DeviceModel.DefaultRepairProvider, true, "None"))
@AjaxHelpers.AjaxLoader()
<script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_DefaultRepairProvider'),
null,
'@Url.Action(MVC.API.DeviceModel.UpdateDefaultRepairProvider(Model.DeviceModel.Id))',
'DefaultRepairProvider'
);
});
</script>
}
else
{
<div>No repair provider plugins installed</div>
}
if (canViewPlugins)
{
<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 repair provider plugins.
</p>
</div>
}
}
else
{
if (Model.DeviceModel.DefaultRepairProvider == null)
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider);
if (provider == null)
{
<span class="smallMessage">&lt;None Specified&gt;</span>
}
else
{
@provider.Name
}
}
}
</td>
</tr>
<tr>
<th>Type:
</th>
@@ -109,135 +217,18 @@
</th>
<td>
<img alt="Model Image" src="@Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))" />
</td>
</tr>
@if (canConfig)
{
<tr>
<th>
<label for="DeviceModel_Image">
Update Image:
</label>
</th>
<td>
@using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
<hr />
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="file" name="Image" id="Image" style="width: 250px;" />
<input class="button" type="submit" value="Update" />
<input type="file" name="Image" id="Image" style="width: 220px;" />
<input class="button small" type="submit" value="Upload Image" />
}
}
</td>
</tr>
}
</table>
@if (canConfig)
{
<script type="text/javascript">
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
<script type="text/javascript">
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('@(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)))', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
<script type="text/javascript">
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '@Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id))',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
}
</div>
<h2>Components</h2>
@Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel)
@@ -50,6 +50,12 @@ namespace Disco.Web.Areas.Config.Views.DeviceModel
Authorization.Require(Claims.Config.DeviceModel.Show);
var canConfig = Authorization.Has(Claims.Config.DeviceModel.Configure);
var canViewPlugins = Authorization.Has(Claims.Config.Plugin.Install);
if (canConfig)
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Models", MVC.Config.DeviceModel.Index(null), Model.DeviceModel.ToString());
@@ -71,7 +77,7 @@ WriteLiteral(">Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 15 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Id));
@@ -81,7 +87,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
" </th>\r\n <td>");
#line 21 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 27 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
@@ -89,43 +95,66 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
#line default
#line hidden
#line 23 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceModel.Description));
#line default
#line hidden
#line 23 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 24 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 30 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 25 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 25 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 31 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_Description'),
'Model Description',
'");
#line 37 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'Description\'\r\n );\r\n " +
" });\r\n </script>\r\n");
#line 42 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
@@ -134,14 +163,14 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
#line default
#line hidden
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Description));
#line default
#line hidden
#line 29 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 45 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
@@ -154,7 +183,7 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 37 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Manufacturer));
@@ -166,7 +195,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 44 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.Model));
@@ -176,7 +205,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
"\r\n <td>\r\n <div><strong>");
#line 50 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 66 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceCount.ToString("n0"));
@@ -185,7 +214,7 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral("</strong> ");
#line 50 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 66 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceCount == 1 ? "devices is" : "devices are");
@@ -194,13 +223,13 @@ WriteLiteral("</strong> ");
WriteLiteral(" of this model type.</div>\r\n");
#line 51 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 51 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.DeviceDecommissionedCount > 0)
{
@@ -214,7 +243,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 69 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceDecommissionedCount.ToString("n0"));
@@ -223,7 +252,7 @@ WriteLiteral(">");
WriteLiteral(" ");
#line 53 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 69 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Model.DeviceDecommissionedCount == 1 ? "device is" : "devices are");
@@ -232,7 +261,7 @@ WriteLiteral(" ");
WriteLiteral(" decommissioned.</div>\r\n");
#line 54 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 70 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
@@ -242,7 +271,7 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
"Date:\r\n </th>\r\n <td>");
#line 60 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
@@ -250,29 +279,54 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
#line default
#line hidden
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 78 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.EditorFor(model => model.DeviceModel.DefaultPurchaseDate));
#line default
#line hidden
#line 62 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 78 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 63 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 79 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 63 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 79 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
var dateField = $('#DeviceModel_DefaultPurchaseDate');
document.DiscoFunctions.DateChangeHelper(
dateField,
'None',
'");
#line 86 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'DefaultPurchaseDate\',\r\n null," +
"\r\n true\r\n );\r\n " +
"});\r\n </script>\r\n");
#line 93 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
@@ -281,14 +335,14 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 96 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(CommonHelpers.FriendlyDate(Model.DeviceModel.DefaultPurchaseDate, "Unknown"));
#line default
#line hidden
#line 67 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 96 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
@@ -299,37 +353,114 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
"Provider:\r\n </th>\r\n <td>");
#line 74 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 103 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
if (Model.WarrantyProviders.Count > 0)
{
#line default
#line hidden
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 107 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultWarrantyProvider, Model.WarrantyProviders.ToSelectListItems(Model.DeviceModel.DefaultWarrantyProvider, true, "None")));
#line default
#line hidden
#line 76 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 107 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 77 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 108 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 77 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 108 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_DefaultWarrantyProvider'),
null,
'");
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'DefaultWarrantyProvider\'\r\n " +
" );\r\n });\r\n </script>\r\n");
#line 119 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">No warranty provider plugins installed</span>\r\n");
#line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
if (canViewPlugins)
{
#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=\"", 5025), Tuple.Create("\"", 5075)
#line 128 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 5032), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default
#line hidden
, 5032), false)
);
WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider plugins.\r\n " +
" </p>\r\n </div>\r\n");
#line 131 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
else
{
@@ -346,7 +477,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 84 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 138 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
@@ -364,7 +495,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 91 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 145 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
@@ -373,14 +504,181 @@ WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line default
#line hidden
#line 94 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 148 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(provider.Name);
#line default
#line hidden
#line 94 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 148 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Default Repair Pr" +
"ovider:\r\n </th>\r\n <td>");
#line 157 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
if (Model.RepairProviders.Count > 0)
{
#line default
#line hidden
#line 161 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DropDownListFor(model => model.DeviceModel.DefaultRepairProvider, Model.RepairProviders.ToSelectListItems(Model.DeviceModel.DefaultRepairProvider, true, "None")));
#line default
#line hidden
#line 161 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 162 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 162 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
WriteLiteral(@" <script>
$(function () {
document.DiscoFunctions.PropertyChangeHelper(
$('#DeviceModel_DefaultRepairProvider'),
null,
'");
#line 168 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultRepairProvider(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral("\',\r\n \'DefaultRepairProvider\'\r\n " +
");\r\n });\r\n </script>\r\n");
#line 173 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <div>No repair provider plugins installed</div>\r\n");
#line 177 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
if (canViewPlugins)
{
#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=\"", 7326), Tuple.Create("\"", 7376)
#line 182 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 7333), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default
#line hidden
, 7333), false)
);
WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plugins.\r\n " +
" </p>\r\n </div>\r\n");
#line 185 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
else
{
if (Model.DeviceModel.DefaultRepairProvider == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 192 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
var provider = Model.RepairProviders.FirstOrDefault(wp => wp.Id == Model.DeviceModel.DefaultRepairProvider);
if (provider == null)
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None Specified&gt;</span>\r\n");
#line 199 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
else
{
#line default
#line hidden
#line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(provider.Name);
#line default
#line hidden
#line 202 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
@@ -395,7 +693,7 @@ WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" ");
#line 104 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 212 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.DisplayFor(model => model.DeviceModel.ModelType));
@@ -406,47 +704,36 @@ WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n
WriteLiteral(" alt=\"Model Image\"");
WriteAttribute("src", Tuple.Create(" src=\"", 3910), Tuple.Create("\"", 4007)
WriteAttribute("src", Tuple.Create(" src=\"", 8619), Tuple.Create("\"", 8716)
#line 111 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 3916), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
#line 219 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
, Tuple.Create(Tuple.Create("", 8625), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, Model.DeviceModel.ImageHash()))
#line default
#line hidden
, 3916), false)
, 8625), false)
);
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n");
WriteLiteral(" />\r\n");
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 220 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 114 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 220 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>\r\n <label");
WriteLiteral(" for=\"DeviceModel_Image\"");
WriteLiteral(">\r\n Update Image:\r\n </label>\r\n " +
" </th>\r\n <td>\r\n");
WriteLiteral(" <hr />\r\n");
#line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 123 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 223 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
using (Html.BeginForm(MVC.API.DeviceModel.Image(Model.DeviceModel.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
{
@@ -461,214 +748,32 @@ WriteLiteral(" name=\"Image\"");
WriteLiteral(" id=\"Image\"");
WriteLiteral(" style=\"width: 250px;\"");
WriteLiteral(" style=\"width: 220px;\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <input");
WriteLiteral(" class=\"button\"");
WriteLiteral(" class=\"button small\"");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" value=\"Update\"");
WriteLiteral(" value=\"Upload Image\"");
WriteLiteral(" />\r\n");
#line 127 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 227 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<h2>Components</h2>\r\n");
#line 130 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n");
#line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 132 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (canConfig)
{
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $Description = $('#DeviceModel_Description');
var $DescriptionAjaxSave = $Description.next('.ajaxSave');
$Description
.watermark('Model Description')
.focus(function () { $Description.select() })
.keydown(function (e) {
$DescriptionAjaxSave.show();
if (e.which == 13) {
$(this).blur();
}
}).blur(function () {
$DescriptionAjaxSave.hide();
})
.change(function () {
$DescriptionAjaxSave.hide();
var $ajaxLoading = $DescriptionAjaxSave.next('.ajaxLoading').show();
var data = { Description: $Description.val() };
$.ajax({
url: '");
#line 154 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDescription(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to update description: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to update description: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $dataField = $('#DeviceModel_DefaultPurchaseDate');
var $ajaxLoading = $dataField.next('.ajaxLoading');
var dateFieldValue = $dataField.val();
var dateFieldChangeToken = null;
$dataField
.watermark('None')
.datepicker({
changeYear: true,
changeMonth: true,
dateFormat: 'yy/mm/dd'
})
.change(function () {
var dateText = $dataField.val();
if (dateFieldValue.toLowerCase() != dateText.toLowerCase()) {
dateFieldValue = dateText;
if (dateFieldChangeToken)
window.clearTimeout(dateFieldChangeToken);
dateFieldChangeToken = window.setTimeout(function () {
$ajaxLoading.show();
var data = {};
data['DefaultPurchaseDate'] = dateFieldValue;
$.getJSON('");
#line 196 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultPurchaseDate(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"', data, function (response, result) {
if (result != 'success' || response != 'OK') {
alert('Unable to change Date:\n' + response);
$ajaxLoading.hide();
} else {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
}
})
dateFieldChangeToken = null;
}, 500);
}
}).focus(function () {
$(this).select();
});
});
</script>
");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
var $DefaultWarrantyProvider = $('#DeviceModel_DefaultWarrantyProvider');
var $ajaxLoading = $DefaultWarrantyProvider.next('.ajaxLoading');
$DefaultWarrantyProvider
.change(function () {
$ajaxLoading.show();
var data = { DefaultWarrantyProvider: $DefaultWarrantyProvider.val() };
$.ajax({
url: '");
#line 221 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Url.Action(MVC.API.DeviceModel.UpdateDefaultWarrantyProvider(Model.DeviceModel.Id)));
#line default
#line hidden
WriteLiteral(@"',
dataType: 'json',
data: data,
success: function (d) {
if (d == 'OK') {
$ajaxLoading.hide().next('.ajaxOk').show().delay('fast').fadeOut('slow');
} else {
$ajaxLoading.hide();
alert('Unable to default warranty provider: ' + d);
}
},
error: function (jqXHR, textStatus, errorThrown) {
alert('Unable to default warranty provider: ' + textStatus);
$ajaxLoading.hide();
}
});
});
});
</script>
");
#line 240 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
#line default
#line hidden
WriteLiteral("</div>\r\n<h2>Components</h2>\r\n");
#line 243 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 234 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.Partial(MVC.Config.DeviceModel.Views._DeviceComponentsTable, Model.DeviceComponentsModel));
@@ -681,13 +786,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 245 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 236 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line default
#line hidden
#line 245 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 236 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.CanDelete)
{
@@ -695,14 +800,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 247 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 238 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("Delete", MVC.API.DeviceModel.Delete(Model.DeviceModel.Id, true), "buttonDelete"));
#line default
#line hidden
#line 247 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 238 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
@@ -712,7 +817,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 249 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 240 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
if (Model.DeviceCount > 0)
{
if (Authorization.Has(Claims.Device.Actions.Export))
@@ -722,14 +827,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 253 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 244 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Model, Model.DeviceModel.Id)));
#line default
#line hidden
#line 253 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 244 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0)
@@ -739,14 +844,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 257 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 248 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceModel.Id.ToString(), "DeviceModel")));
#line default
#line hidden
#line 257 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
#line 248 "..\..\Areas\Config\Views\DeviceModel\Show.cshtml"
}
}
+18
View File
@@ -706,6 +706,24 @@
width: 600px;
height: 250px;
}
#repairJobForm #repairDisclosedInformation table {
font-size: 0.9em;
}
#repairJobForm #repairDisclosedInformation table tr:not(:last-child) {
border-bottom: 1px dashed #aaa;
}
#repairJobForm #repairDisclosedInformation table th {
padding: 2px;
font-weight: bold;
width: 200px;
}
#repairJobForm #repairDisclosedInformation table td {
padding: 2px;
}
#repairJobRepairDescription #RepairDescription {
width: 600px;
height: 250px;
}
#createJob_Container {
margin: 0 -20px;
}
+29
View File
@@ -735,6 +735,35 @@
}
}
#repairJobForm {
#repairDisclosedInformation {
table {
font-size: 0.9em;
tr:not(:last-child) {
border-bottom: 1px dashed #aaa;
}
th {
padding: 2px;
font-weight: bold;
width: 200px;
}
td {
padding: 2px;
}
}
}
}
#repairJobRepairDescription {
#RepairDescription {
width: 600px;
height: 250px;
}
}
#createJob_Container {
margin: 0 -20px;
File diff suppressed because one or more lines are too long
+189 -9
View File
@@ -1,5 +1,4 @@
using Disco.BI.Extensions;
using Disco.Data.Repository;
using Disco.Models.BI.Job;
using Disco.Models.Repository;
using Disco.Models.Services.Jobs.JobLists;
@@ -8,6 +7,7 @@ using Disco.Services;
using Disco.Services.Authorization;
using Disco.Services.Jobs.JobLists;
using Disco.Services.Jobs.JobQueues;
using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Plugins.Features.UIExtension;
using Disco.Services.Plugins.Features.WarrantyProvider;
using Disco.Services.Users;
@@ -503,7 +503,7 @@ namespace Disco.Web.Controllers
if (ModelState.IsValid)
{
switch (m.WarrantyAction)
switch (m.SubmissionAction)
{
case "Update":
var updatedModel = new Models.Job.LogWarrantyModel()
@@ -528,15 +528,15 @@ namespace Disco.Web.Controllers
}
return View(updatedModel);
case "Custom":
if (string.IsNullOrWhiteSpace(m.CustomProviderName))
case "Manual":
if (string.IsNullOrWhiteSpace(m.ManualProviderName))
{
ModelState.AddModelError("CustomProviderName", "The Custom Warranty Provider Name is required");
ModelState.AddModelError("ManualProviderName", "The Warranty Provider Name is required");
return View(Views.LogWarranty, m);
}
try
{
m.Job.OnLogWarranty(Database, m.FaultDescription, m.CustomProviderName, m.CustomProviderReference, m.OrganisationAddress, m.TechUser);
m.Job.OnLogWarranty(Database, m.FaultDescription, m.ManualProviderName, m.ManualProviderReference, m.OrganisationAddress, m.TechUser);
Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId));
}
@@ -564,7 +564,7 @@ namespace Disco.Web.Controllers
if (warrantyProviderProperties != null)
{
m.WarrantyProviderPropertiesJson = JsonConvert.SerializeObject(warrantyProviderProperties);
m.ProviderPropertiesJson = JsonConvert.SerializeObject(warrantyProviderProperties);
}
m.DiscloseProperties = p.SubmitJobDiscloseInfo(Database, m.Job, m.OrganisationAddress, m.TechUser, m.FaultDescription, warrantyProviderProperties);
return View(Views.LogWarrantyDisclose, m);
@@ -572,7 +572,7 @@ namespace Disco.Web.Controllers
case "Submit":
try
{
m.Job.OnLogWarranty(Database, m.FaultDescription, m.WarrantyProvider, m.OrganisationAddress, m.TechUser, m.WarrantyProviderProperties());
m.Job.OnLogWarranty(Database, m.FaultDescription, m.WarrantyProvider, m.OrganisationAddress, m.TechUser, m.ProviderProperties());
Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId));
}
@@ -596,7 +596,7 @@ namespace Disco.Web.Controllers
[DiscoAuthorize(Claims.Job.Properties.WarrantyProperties.ProviderDetails)]
public virtual ActionResult WarrantyProviderJobDetails(int id)
{
Models.Job.WarrantyProviderJobDetailsModel model = new Models.Job.WarrantyProviderJobDetailsModel();
Models.Job.ProviderJobDetailsModel model = new Models.Job.ProviderJobDetailsModel();
Job job = Database.Jobs.Include("Device.DeviceModel").Include("JobMetaWarranty").Include("JobSubTypes").Where(j => j.Id == id).FirstOrDefault();
if (job != null)
@@ -654,5 +654,185 @@ namespace Disco.Web.Controllers
}
#endregion
#region Log Repair
[DiscoAuthorize(Claims.Job.Actions.LogRepair)]
public virtual ActionResult LogRepair(int id, string RepairProviderId, int? OrganisationAddressId)
{
var m = new Models.Job.LogRepairModel()
{
JobId = id,
RepairProviderId = RepairProviderId,
OrganisationAddressId = OrganisationAddressId
};
m.UpdateModel(Database, false);
m.RepairDescription = m.Job.GenerateFaultDescription(Database);
if (m.RepairProvider != null)
{
using (var rp = m.RepairProvider.CreateInstance<RepairProviderFeature>())
{
m.RepairProviderSubmitJobBeginResult = rp.SubmitJobBegin(Database, this, m.Job, m.OrganisationAddress, m.TechUser);
}
}
return View(m);
}
[HttpPost, DiscoAuthorize(Claims.Job.Actions.LogRepair)]
public virtual ActionResult LogRepair(Models.Job.LogRepairModel m, FormCollection form)
{
m.UpdateModel(Database, true);
if (ModelState.IsValid)
{
switch (m.SubmissionAction)
{
case "Update":
var updatedModel = new Models.Job.LogRepairModel()
{
JobId = m.JobId,
RepairProviderId = m.RepairProviderId,
OrganisationAddressId = m.OrganisationAddressId,
RepairDescription = m.RepairDescription
};
updatedModel.UpdateModel(Database, false);
if (updatedModel.RepairProvider != null)
{
using (var wp = updatedModel.RepairProvider.CreateInstance<RepairProviderFeature>())
{
using (var rp = m.RepairProvider.CreateInstance<RepairProviderFeature>())
{
m.RepairProviderSubmitJobBeginResult = rp.SubmitJobBegin(Database, this, updatedModel.Job, updatedModel.OrganisationAddress, updatedModel.TechUser);
}
}
}
return View(updatedModel);
case "Manual":
if (string.IsNullOrWhiteSpace(m.ManualProviderName))
{
ModelState.AddModelError("ManualProviderName", "The Repair Provider Name is required");
return View(Views.LogRepair, m);
}
try
{
m.Job.OnLogRepair(Database, m.RepairDescription, 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.LogRepairError, m);
throw;
}
case "Disclose":
using (var p = m.RepairProvider.CreateInstance<RepairProviderFeature>())
{
Dictionary<string, string> warrantyProviderProperties;
try
{
warrantyProviderProperties = p.SubmitJobParseProperties(Database, form, this, m.Job, m.OrganisationAddress, m.TechUser, m.RepairDescription);
}
catch (Exception ex)
{
m.Error = ex;
return View(Views.LogRepairError, m);
}
if (!ModelState.IsValid)
return View(Views.LogRepair, m);
if (warrantyProviderProperties != null)
{
m.ProviderPropertiesJson = JsonConvert.SerializeObject(warrantyProviderProperties);
}
m.DiscloseProperties = p.SubmitJobDiscloseInfo(Database, m.Job, m.OrganisationAddress, m.TechUser, m.RepairDescription, warrantyProviderProperties);
return View(Views.LogRepairDisclose, m);
}
case "Submit":
try
{
m.Job.OnLogRepair(Database, m.RepairDescription, m.RepairProvider, m.OrganisationAddress, m.TechUser, m.ProviderProperties());
Database.SaveChanges();
return RedirectToAction(MVC.Job.Show(m.JobId));
}
catch (Exception ex)
{
m.Error = ex;
return View(Views.LogRepairError, m);
throw;
}
default:
return RedirectToAction(MVC.Job.Show(m.JobId));
}
}
else
{
return View(Views.LogRepair, m);
}
}
[DiscoAuthorize(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails)]
public virtual ActionResult RepairProviderJobDetails(int id)
{
Models.Job.ProviderJobDetailsModel model = new Models.Job.ProviderJobDetailsModel();
Job job = Database.Jobs.Include("Device.DeviceModel").Include("JobMetaNonWarranty").Include("JobSubTypes").Where(j => j.Id == id).FirstOrDefault();
if (job != null)
{
if (job.JobMetaNonWarranty != null && !string.IsNullOrEmpty(job.JobMetaNonWarranty.RepairerName))
{
var providerDef = RepairProviderFeature.FindPluginFeature(job.JobMetaNonWarranty.RepairerName);
if (providerDef != null)
{
using (RepairProviderFeature providerInstance = providerDef.CreateInstance<RepairProviderFeature>())
{
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 = string.Format("Plugin '{0} ({1})' (Repair Provider for '{2}') doesn't support Job Details", providerInstance.Manifest.Name, providerInstance.Manifest.Id, providerInstance.ProviderId);
return View(model);
}
}
}
model.JobDetailsSupported = false;
model.JobDetailsNotSupportedMessage = string.Format("Repair Provider '{0}' is not integrated with Disco", job.JobMetaNonWarranty.RepairerName);
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
}
}
+38 -1
View File
@@ -594,6 +594,7 @@
<Compile Include="Models\Device\ExportModel.cs" />
<Compile Include="Models\Device\ImportHeadersModel.cs" />
<Compile Include="Models\InitialConfig\AdministratorsModel.cs" />
<Compile Include="Models\Job\LogRepairModel.cs" />
<Compile Include="T4MVC.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -614,6 +615,26 @@
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepair.generated.cs">
<DependentUpon>LogRepair.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepairDisclose.generated.cs">
<DependentUpon>LogRepairDisclose.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\LogRepairError.generated.cs">
<DependentUpon>LogRepairError.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\RepairProviderJobDetails.generated.cs">
<DependentUpon>RepairProviderJobDetails.cshtml</DependentUpon>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
</Compile>
<Compile Include="Views\Job\JobParts\Queues.generated.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -674,7 +695,7 @@
<Compile Include="Models\Job\CreateModel.cs" />
<Compile Include="Models\Job\CreateRedirectModel.cs" />
<Compile Include="Models\Job\ShowModel.cs" />
<Compile Include="Models\Job\WarrantyProviderJobDetailsModel.cs" />
<Compile Include="Models\Job\ProviderJobDetailsModel.cs" />
<Compile Include="Models\Search\QueryModel.cs" />
<Compile Include="Models\Shared\FancyTreeNode.cs" />
<Compile Include="Models\Update\IndexModel.cs" />
@@ -1712,6 +1733,22 @@
<Generator>RazorGenerator</Generator>
<LastGenOutput>Welcome.generated.cs</LastGenOutput>
</None>
<Content Include="Views\Job\RepairProviderJobDetails.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>RepairProviderJobDetails.generated.cs</LastGenOutput>
</Content>
<Content Include="Views\Job\LogRepair.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogRepair.generated.cs</LastGenOutput>
</Content>
<Content Include="Views\Job\LogRepairDisclose.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogRepairDisclose.generated.cs</LastGenOutput>
</Content>
<Content Include="Views\Job\LogRepairError.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>LogRepairError.generated.cs</LastGenOutput>
</Content>
<None Include="Views\Job\Create_Redirect.cshtml">
<Generator>RazorGenerator</Generator>
<LastGenOutput>Create_Redirect.generated.cs</LastGenOutput>
-154
View File
@@ -1,154 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Models;
using System.ComponentModel.DataAnnotations;
using Disco.Data.Repository;
namespace Disco.Web.Models.Job
{
[CustomValidation(typeof(CreateModelValidation), "ValidateCreateModel")]
public class CreateModelOld
{
private Disco.Models.Repository.Device _Device;
private Disco.Models.Repository.User _User;
public Disco.Models.Repository.Device Device
{
get
{
return _Device;
}
set
{
_Device = value;
DeviceSerialNumber = value.SerialNumber;
}
}
public Disco.Models.Repository.User User
{
get
{
return _User;
}
set
{
_User = value;
UserId = value.Id;
}
}
public string DeviceSerialNumber { get; set; }
public string UserId { get; set; }
[Required]
public string Type { get; set; }
[Required]
public List<string> SubTypes { get; set; }
public List<Disco.Models.Repository.JobType> JobTypes { get; set; }
public List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
public Disco.Models.Repository.JobType GetJobType
{
get
{
if (!string.IsNullOrEmpty(this.Type))
{
return this.JobTypes.FirstOrDefault(m => m.Id == this.Type);
}
return null;
}
}
public List<Disco.Models.Repository.JobSubType> GetJobSubTypes
{
get
{
if (SubTypes != null)
{
var subTypes = this.SubTypes;
return this.JobSubTypes.Where(m => subTypes.Contains(String.Format("{0}_{1}", m.JobTypeId, m.Id))).ToList();
}
return null;
}
}
public void UpdateModel(DiscoDataContext dbContext)
{
if (this.JobTypes == null)
JobTypes = dbContext.JobTypes.ToList();
if (this.JobSubTypes == null)
JobSubTypes = dbContext.JobSubTypes.ToList();
if (!string.IsNullOrEmpty(DeviceSerialNumber))
{
this.Device = dbContext.Devices.Include("DeviceModel").Where(d => d.SerialNumber == DeviceSerialNumber).FirstOrDefault();
if (this.Device == null)
{
throw new ArgumentException("Invalid Device Serial Number Specified", "DeviceSerialNumber");
}
if (string.IsNullOrEmpty(this.UserId) && !string.IsNullOrEmpty(this.Device.AssignedUserId))
{
this.UserId = this.Device.AssignedUserId;
}
if (string.IsNullOrEmpty(this.Type))
this.Type = this.JobTypes.First(jt => jt.Id == "HWar").Id;
}
else
{
// No Device - Remove Hardware Types
foreach (var jobType in JobTypes.ToArray())
{
if (jobType.Id != Disco.Models.Repository.JobType.JobTypeIds.SApp)
{
JobTypes.Remove(jobType);
JobSubTypes.RemoveAll(jst => jst.JobType == jobType);
}
}
}
if (!string.IsNullOrEmpty(UserId))
{
this.User = dbContext.Users.Find(UserId);
if (this.User == null)
{
throw new ArgumentException("Invalid User Id Specified", "UserId");
}
if (string.IsNullOrEmpty(this.Type))
this.Type = Disco.Models.Repository.JobType.JobTypeIds.SApp;
}
if (this.User == null && this.Device == null)
{
throw new InvalidOperationException("A Job must reference a Device and/or a User");
}
}
}
public class CreateModelValidation
{
public static ValidationResult ValidateCreateModel(CreateModelOld model)
{
// Device && User both can't be null
if (string.IsNullOrEmpty(model.DeviceSerialNumber) && string.IsNullOrEmpty(model.UserId))
return new ValidationResult("A Job must reference a Device and/or a User");
if (!string.IsNullOrEmpty(model.Type) && model.SubTypes != null)
{
var typeId = string.Format("{0}_", model.Type);
model.SubTypes = model.SubTypes.Where(m => m.StartsWith(typeId)).ToList();
if (model.SubTypes.Count == 0)
{
model.SubTypes = null;
return new ValidationResult("At least one Sub Type is required", new string[] { "SubTypes" });
}
}
return ValidationResult.Success;
}
}
}
+121
View File
@@ -0,0 +1,121 @@
using Disco.Data.Repository;
using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.RepairProvider;
using Disco.Services.Users;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace Disco.Web.Models.Job
{
public class LogRepairModel
{
public Disco.Models.Repository.Job Job { get; set; }
public List<PluginFeatureManifest> RepairProviders { get; set; }
public PluginFeatureManifest RepairProvider { get; set; }
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
public Disco.Models.BI.Config.OrganisationAddress OrganisationAddress { get; set; }
public Disco.Models.Repository.User TechUser { get; set; }
[Required]
public int JobId { get; set; }
[Required(ErrorMessage = "Please specify a Repair Address")]
public Nullable<int> OrganisationAddressId { get; set; }
[Required(ErrorMessage = "Please specify a Repair Provider")]
public string RepairProviderId { get; set; }
[Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
public string RepairDescription { get; set; }
[Required]
public string SubmissionAction { get; set; }
public bool IsManualProvider
{
get
{
return RepairProviderId == "MANUAL";
}
}
public string ManualProviderName { get; set; }
public string ManualProviderReference { get; set; }
public Tuple<Type, object> RepairProviderSubmitJobBeginResult { get; set; }
public string ProviderPropertiesJson { get; set; }
public Dictionary<string, string> ProviderProperties()
{
Dictionary<string, string> p = default(Dictionary<string, string>);
if (!string.IsNullOrEmpty(this.ProviderPropertiesJson))
{
try
{
p = JsonConvert.DeserializeObject<Dictionary<string, string>>(this.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)
{
// Update Job User's Details [#12]
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 = (from j in Database.Jobs.Include("Device.DeviceModel").Include("JobMetaNonWarranty").Include("JobSubTypes")
where (j.Id == JobId)
select j).FirstOrDefault();
if (Job == null)
{
throw new ArgumentException("Invalid Job Number Specified", "JobId");
}
}
// Update TechUser's Details [#12]
this.TechUser = UserService.GetUser(UserService.CurrentUserId, Database, true);
RepairProviders = Plugins.GetPluginFeatures(typeof(RepairProviderFeature));
if (!IsPostBack && string.IsNullOrEmpty(RepairProviderId))
{
RepairProviderId = Job.Device.DeviceModel.DefaultRepairProvider;
if (string.IsNullOrEmpty(RepairProviderId))
RepairProviderId = "MANUAL";
}
if (!string.IsNullOrEmpty(RepairProviderId) && RepairProviderId != "MANUAL")
RepairProvider = Plugins.GetPluginFeature(RepairProviderId, typeof(RepairProviderFeature));
this.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
if (!IsPostBack && !this.OrganisationAddressId.HasValue)
{
OrganisationAddressId = Job.Device.DeviceProfile.DefaultOrganisationAddress;
}
if (this.OrganisationAddressId.HasValue)
this.OrganisationAddress = this.OrganisationAddresses.FirstOrDefault(oa => oa.Id == this.OrganisationAddressId.Value);
if (!string.IsNullOrEmpty(RepairDescription))
RepairDescription = RepairDescription.Trim();
}
}
}
+19 -19
View File
@@ -1,15 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Disco.Data.Repository;
using System.ComponentModel.DataAnnotations;
using Disco.BI;
using System.Web.Script.Serialization;
using Disco.Data.Repository;
using Disco.Services.Plugins;
using Disco.Services.Plugins.Features.WarrantyProvider;
using Newtonsoft.Json;
using Disco.Services.Users;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
namespace Disco.Web.Models.Job
{
@@ -32,29 +29,29 @@ namespace Disco.Web.Models.Job
[Required(ErrorMessage = "A fault description is required"), DataType(System.ComponentModel.DataAnnotations.DataType.MultilineText)]
public string FaultDescription { get; set; }
[Required]
public string WarrantyAction { get; set; }
public string SubmissionAction { get; set; }
public bool IsCustomProvider
public bool IsManualProvider
{
get
{
return WarrantyProviderId == "CUSTOM";
return WarrantyProviderId == "MANUAL";
}
}
public string CustomProviderName { get; set; }
public string CustomProviderReference { get; set; }
public string ManualProviderName { get; set; }
public string ManualProviderReference { get; set; }
public Type WarrantyProviderSubmitJobViewType { get; set; }
public object WarrantyProviderSubmitJobModel { get; set; }
public string WarrantyProviderPropertiesJson { get; set; }
public Dictionary<string, string> WarrantyProviderProperties()
public string ProviderPropertiesJson { get; set; }
public Dictionary<string, string> ProviderProperties()
{
Dictionary<string, string> p = default(Dictionary<string, string>);
if (!string.IsNullOrEmpty(this.WarrantyProviderPropertiesJson))
if (!string.IsNullOrEmpty(this.ProviderPropertiesJson))
{
try
{
p = JsonConvert.DeserializeObject<Dictionary<string, string>>(this.WarrantyProviderPropertiesJson);
p = JsonConvert.DeserializeObject<Dictionary<string, string>>(this.ProviderPropertiesJson);
}
catch (Exception)
{
@@ -101,9 +98,12 @@ namespace Disco.Web.Models.Job
if (!IsPostBack && string.IsNullOrEmpty(WarrantyProviderId))
{
WarrantyProviderId = Job.Device.DeviceModel.DefaultWarrantyProvider;
if (string.IsNullOrEmpty(WarrantyProviderId))
WarrantyProviderId = "MANUAL";
}
if (!string.IsNullOrEmpty(WarrantyProviderId) && WarrantyProviderId != "CUSTOM")
if (!string.IsNullOrEmpty(WarrantyProviderId) && WarrantyProviderId != "MANUAL")
WarrantyProvider = Plugins.GetPluginFeature(WarrantyProviderId, typeof(WarrantyProviderFeature));
this.OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
@@ -5,7 +5,7 @@ using System.Web;
namespace Disco.Web.Models.Job
{
public class WarrantyProviderJobDetailsModel
public class ProviderJobDetailsModel
{
public Type ViewType { get; set; }
public object ViewModel { get; set; }
+116 -35
View File
@@ -319,7 +319,7 @@ namespace Links
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
public static readonly string disco_hubs_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/disco-hubs.min.js") ? Url("disco-hubs.min.js") : Url("disco-hubs.js");
public static readonly string jquery_signalR_2_0_3_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jquery.signalR-2.0.3.min.js") ? Url("jquery.signalR-2.0.3.min.js") : Url("jquery.signalR-2.0.3.js");
public static readonly string jquery_signalR_2_1_0_js = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jquery.signalR-2.1.0.min.js") ? Url("jquery.signalR-2.1.0.min.js") : Url("jquery.signalR-2.1.0.js");
}
public static readonly string jQuery_SignalR_js_bundle = Url("jQuery-SignalR.js.bundle");
@@ -1612,6 +1612,18 @@ namespace Disco.Web.Controllers
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.WarrantyProviderJobDetails);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult LogRepair()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogRepair);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult RepairProviderJobDetails()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RepairProviderJobDetails);
}
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public JobController Actions { get { return MVC.Job; } }
@@ -1648,6 +1660,8 @@ namespace Disco.Web.Controllers
public readonly string Create = "Create";
public readonly string LogWarranty = "LogWarranty";
public readonly string WarrantyProviderJobDetails = "WarrantyProviderJobDetails";
public readonly string LogRepair = "LogRepair";
public readonly string RepairProviderJobDetails = "RepairProviderJobDetails";
}
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
@@ -1673,6 +1687,8 @@ namespace Disco.Web.Controllers
public const string Create = "Create";
public const string LogWarranty = "LogWarranty";
public const string WarrantyProviderJobDetails = "WarrantyProviderJobDetails";
public const string LogRepair = "LogRepair";
public const string RepairProviderJobDetails = "RepairProviderJobDetails";
}
@@ -1722,6 +1738,26 @@ namespace Disco.Web.Controllers
{
public readonly string id = "id";
}
static readonly ActionParamsClass_LogRepair s_params_LogRepair = new ActionParamsClass_LogRepair();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_LogRepair LogRepairParams { get { return s_params_LogRepair; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_LogRepair
{
public readonly string id = "id";
public readonly string RepairProviderId = "RepairProviderId";
public readonly string OrganisationAddressId = "OrganisationAddressId";
public readonly string m = "m";
public readonly string form = "form";
}
static readonly ActionParamsClass_RepairProviderJobDetails s_params_RepairProviderJobDetails = new ActionParamsClass_RepairProviderJobDetails();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_RepairProviderJobDetails RepairProviderJobDetailsParams { get { return s_params_RepairProviderJobDetails; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_RepairProviderJobDetails
{
public readonly string id = "id";
}
static readonly ViewsClass s_views = new ViewsClass();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ViewsClass Views { get { return s_views; } }
@@ -1738,9 +1774,13 @@ namespace Disco.Web.Controllers
public readonly string Create_Redirect = "Create_Redirect";
public readonly string Index = "Index";
public readonly string List = "List";
public readonly string LogRepair = "LogRepair";
public readonly string LogRepairDisclose = "LogRepairDisclose";
public readonly string LogRepairError = "LogRepairError";
public readonly string LogWarranty = "LogWarranty";
public readonly string LogWarrantyDisclose = "LogWarrantyDisclose";
public readonly string LogWarrantyError = "LogWarrantyError";
public readonly string RepairProviderJobDetails = "RepairProviderJobDetails";
public readonly string Show = "Show";
public readonly string WarrantyProviderJobDetails = "WarrantyProviderJobDetails";
}
@@ -1750,9 +1790,13 @@ namespace Disco.Web.Controllers
public readonly string Create_Redirect = "~/Views/Job/Create_Redirect.cshtml";
public readonly string Index = "~/Views/Job/Index.cshtml";
public readonly string List = "~/Views/Job/List.cshtml";
public readonly string LogRepair = "~/Views/Job/LogRepair.cshtml";
public readonly string LogRepairDisclose = "~/Views/Job/LogRepairDisclose.cshtml";
public readonly string LogRepairError = "~/Views/Job/LogRepairError.cshtml";
public readonly string LogWarranty = "~/Views/Job/LogWarranty.cshtml";
public readonly string LogWarrantyDisclose = "~/Views/Job/LogWarrantyDisclose.cshtml";
public readonly string LogWarrantyError = "~/Views/Job/LogWarrantyError.cshtml";
public readonly string RepairProviderJobDetails = "~/Views/Job/RepairProviderJobDetails.cshtml";
public readonly string Show = "~/Views/Job/Show.cshtml";
public readonly string WarrantyProviderJobDetails = "~/Views/Job/WarrantyProviderJobDetails.cshtml";
static readonly _JobPartsClass s_JobParts = new _JobPartsClass();
@@ -2049,6 +2093,45 @@ namespace Disco.Web.Controllers
return callInfo;
}
[NonAction]
partial void LogRepairOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string RepairProviderId, int? OrganisationAddressId);
[NonAction]
public override System.Web.Mvc.ActionResult LogRepair(int id, string RepairProviderId, int? OrganisationAddressId)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogRepair);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "RepairProviderId", RepairProviderId);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "OrganisationAddressId", OrganisationAddressId);
LogRepairOverride(callInfo, id, RepairProviderId, OrganisationAddressId);
return callInfo;
}
[NonAction]
partial void LogRepairOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Models.Job.LogRepairModel m, System.Web.Mvc.FormCollection form);
[NonAction]
public override System.Web.Mvc.ActionResult LogRepair(Disco.Web.Models.Job.LogRepairModel m, System.Web.Mvc.FormCollection form)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogRepair);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "m", m);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "form", form);
LogRepairOverride(callInfo, m, form);
return callInfo;
}
[NonAction]
partial void RepairProviderJobDetailsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id);
[NonAction]
public override System.Web.Mvc.ActionResult RepairProviderJobDetails(int id)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.RepairProviderJobDetails);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
RepairProviderJobDetailsOverride(callInfo, id);
return callInfo;
}
}
}
@@ -4774,6 +4857,12 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult UpdateDefaultRepairProvider()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultRepairProvider);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult Image()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Image);
@@ -4834,6 +4923,7 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string UpdateDescription = "UpdateDescription";
public readonly string UpdateDefaultPurchaseDate = "UpdateDefaultPurchaseDate";
public readonly string UpdateDefaultWarrantyProvider = "UpdateDefaultWarrantyProvider";
public readonly string UpdateDefaultRepairProvider = "UpdateDefaultRepairProvider";
public readonly string Image = "Image";
public readonly string Delete = "Delete";
public readonly string Component = "Component";
@@ -4851,6 +4941,7 @@ namespace Disco.Web.Areas.API.Controllers
public const string UpdateDescription = "UpdateDescription";
public const string UpdateDefaultPurchaseDate = "UpdateDefaultPurchaseDate";
public const string UpdateDefaultWarrantyProvider = "UpdateDefaultWarrantyProvider";
public const string UpdateDefaultRepairProvider = "UpdateDefaultRepairProvider";
public const string Image = "Image";
public const string Delete = "Delete";
public const string Component = "Component";
@@ -4903,6 +4994,16 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string DefaultWarrantyProvider = "DefaultWarrantyProvider";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_UpdateDefaultRepairProvider s_params_UpdateDefaultRepairProvider = new ActionParamsClass_UpdateDefaultRepairProvider();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_UpdateDefaultRepairProvider UpdateDefaultRepairProviderParams { get { return s_params_UpdateDefaultRepairProvider; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_UpdateDefaultRepairProvider
{
public readonly string id = "id";
public readonly string DefaultRepairProvider = "DefaultRepairProvider";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_Image s_params_Image = new ActionParamsClass_Image();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_Image ImageParams { get { return s_params_Image; } }
@@ -5044,6 +5145,20 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
partial void UpdateDefaultRepairProviderOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string DefaultRepairProvider, bool redirect);
[NonAction]
public override System.Web.Mvc.ActionResult UpdateDefaultRepairProvider(int id, string DefaultRepairProvider, bool redirect)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDefaultRepairProvider);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DefaultRepairProvider", DefaultRepairProvider);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
UpdateDefaultRepairProviderOverride(callInfo, id, DefaultRepairProvider, redirect);
return callInfo;
}
[NonAction]
partial void ImageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int? id, string v);
@@ -6864,12 +6979,6 @@ namespace Disco.Web.Areas.API.Controllers
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult LogRepair()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogRepair);
}
[NonAction]
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public virtual System.Web.Mvc.ActionResult DeviceReadyForReturn()
{
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DeviceReadyForReturn);
@@ -7058,7 +7167,6 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string UpdateFlag = "UpdateFlag";
public readonly string WaitingForUserAction = "WaitingForUserAction";
public readonly string NotWaitingForUserAction = "NotWaitingForUserAction";
public readonly string LogRepair = "LogRepair";
public readonly string DeviceReadyForReturn = "DeviceReadyForReturn";
public readonly string DeviceHeld = "DeviceHeld";
public readonly string DeviceReturned = "DeviceReturned";
@@ -7130,7 +7238,6 @@ namespace Disco.Web.Areas.API.Controllers
public const string UpdateFlag = "UpdateFlag";
public const string WaitingForUserAction = "WaitingForUserAction";
public const string NotWaitingForUserAction = "NotWaitingForUserAction";
public const string LogRepair = "LogRepair";
public const string DeviceReadyForReturn = "DeviceReadyForReturn";
public const string DeviceHeld = "DeviceHeld";
public const string DeviceReturned = "DeviceReturned";
@@ -7581,17 +7688,6 @@ namespace Disco.Web.Areas.API.Controllers
public readonly string Resolution = "Resolution";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_LogRepair s_params_LogRepair = new ActionParamsClass_LogRepair();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_LogRepair LogRepairParams { get { return s_params_LogRepair; } }
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public class ActionParamsClass_LogRepair
{
public readonly string id = "id";
public readonly string RepairerName = "RepairerName";
public readonly string RepairerReference = "RepairerReference";
public readonly string redirect = "redirect";
}
static readonly ActionParamsClass_DeviceReadyForReturn s_params_DeviceReadyForReturn = new ActionParamsClass_DeviceReadyForReturn();
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public ActionParamsClass_DeviceReadyForReturn DeviceReadyForReturnParams { get { return s_params_DeviceReadyForReturn; } }
@@ -8394,21 +8490,6 @@ namespace Disco.Web.Areas.API.Controllers
return callInfo;
}
[NonAction]
partial void LogRepairOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string RepairerName, string RepairerReference, bool? redirect);
[NonAction]
public override System.Web.Mvc.ActionResult LogRepair(int id, string RepairerName, string RepairerReference, bool? redirect)
{
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LogRepair);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "RepairerName", RepairerName);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "RepairerReference", RepairerReference);
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
LogRepairOverride(callInfo, id, RepairerName, RepairerReference, redirect);
return callInfo;
}
[NonAction]
partial void DeviceReadyForReturnOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, bool redirect);
+94 -8
View File
@@ -1,10 +1,12 @@
@model Disco.Web.Models.Job.ShowModel
@{
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
Authorization.Require(Claims.Job.ShowNonWarrantyRepairs);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
}
<table id="jobNonWarrantyRepairs">
@if (Model.Job.JobMetaNonWarranty.RepairerName != null || Model.Job.JobMetaNonWarranty.RepairerLoggedDate.HasValue || Model.Job.JobMetaNonWarranty.RepairerReference != null)
{
<tr>
<th style="width: 200px;">Repairer Name
</th>
@@ -38,7 +40,18 @@
<th style="width: 200px;">Repair Logged
</th>
<td>
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "Job_JobMetaNonWarranty_RepairerLoggedDate")
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
document.DiscoFunctions.DateDialogCreateUpdater('@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))', 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', '@(Model.Job.OpenedDate.ToISO8601())', false);
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", null)
}
</td>
</tr>
<tr>
@@ -70,22 +83,95 @@
}
</td>
</tr>
if (Model.Job.JobMetaNonWarranty.RepairerLoggedDate.HasValue)
{
<tr>
<th style="width: 200px;">Repair Completed
</th>
<td>
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate")
@AjaxHelpers.AjaxLoader()
<script type="text/javascript">
document.DiscoFunctions.DateDialogCreateUpdater('@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))', 'Repairer Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', '@(Model.Job.OpenedDate.ToISO8601())', false);
</script>
}
else
{
@CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", null)
}
</td>
</tr>
}
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails))
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
<tr id="jobRepairProviderDetailContainer" style="display: none">
<th style="width: 200px;">Provider Details
</th>
<td>
<div id="jobRepairProviderDetailLoading">
<span class="ajaxLoading" title="Loading..."></span>Loading...
</div>
<div id="jobRepairProviderDetailHost" class="clearfix" style="display: none">
</div>
</td>
</tr>
}
}
else
{
<tr>
<th style="width: 200px;">Actions
</th>
<td>
@if (Model.Job.CanLogRepair())
{
@Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Repair_Actions_LogRepair_Button")
}
else
{
<span class="smallMessage">&lt;None&gt;</span>
}
</td>
</tr>
}
</table>
<script>
<script type="text/javascript">
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails) && Model.Job.JobMetaNonWarranty.RepairerName != null)
{<text>
$(function () {
var updateUrl = '@(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)))';
var jobOpenDate = '@(Model.Job.OpenedDate.ToISO8601())';
var repairProviderDetailLoaded = false;
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repairer Name', 'Job_JobMetaNonWarranty_RepairerLoggedDate', null, 'NonWarrantyRepairerLoggedDate', 'Not Logged', jobOpenDate, false);</text>}
@if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
{<text>document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, 'Repair Completed', 'Job_JobMetaNonWarranty_RepairerCompletedDate', null, 'NonWarrantyRepairerCompletedDate', 'Not Completed', jobOpenDate, false);</text>}
$('#jobDetailTabs').on('tabsactivate', function (e, ui) {
if ($(ui.newPanel).is('#jobDetailTab-NonWarrantyRepairs')) {
if (!repairProviderDetailLoaded) {
var repairerName;
var $repairerName = $('#Job_JobMetaNonWarranty_RepairerName');
if ($repairerName.length > 0) {
if ($repairerName[0].nodeName === 'INPUT')
repairerName = $repairerName.val();
else
repairerName = $repairerName.text();
if (repairerName) {
$('#jobRepairProviderDetailContainer').show();
$('#jobRepairProviderDetailLoading span').show();
$('#jobRepairProviderDetailHost').load(
'@(Url.Action(MVC.Job.RepairProviderJobDetails()))',
{ id: '@(Model.Job.Id)' },
function () {
$('#jobRepairProviderDetailLoading').hide();
$(this).slideDown();
}
);
repairProviderDetailLoaded = true;
}
}
}
}
});
});
</text>}
</script>
+379 -61
View File
@@ -47,7 +47,7 @@ namespace Disco.Web.Views.Job.JobParts
#line 2 "..\..\Views\Job\JobParts\Repairs.cshtml"
Authorization.Require(Claims.Job.ShowNonWarrantyFinance);
Authorization.Require(Claims.Job.ShowNonWarrantyRepairs);
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
@@ -58,20 +58,36 @@ WriteLiteral("\r\n<table");
WriteLiteral(" id=\"jobNonWarrantyRepairs\"");
WriteLiteral(">\r\n <tr>\r\n <th");
WriteLiteral(">\r\n");
#line 8 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 8 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Model.Job.JobMetaNonWarranty.RepairerName != null || Model.Job.JobMetaNonWarranty.RepairerLoggedDate.HasValue || Model.Job.JobMetaNonWarranty.RepairerReference != null)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Repairer Name\r\n </th>\r\n <td>\r\n");
#line 12 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerName))
{
@@ -79,42 +95,42 @@ WriteLiteral(">Repairer Name\r\n </th>\r\n <td>\r\n");
#line default
#line hidden
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerName));
#line default
#line hidden
#line 14 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 17 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 15 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 17 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 18 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 16 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 18 "..\..\Views\Job\JobParts\Repairs.cshtml"
@@ -132,7 +148,7 @@ WriteLiteral(@">
'");
#line 22 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 24 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerName(Model.Job.Id, null)));
@@ -142,7 +158,7 @@ WriteLiteral("\',\r\n \'RepairerName\'\r\n
" });\r\n </script>\r\n");
#line 27 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 29 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
@@ -158,7 +174,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 31 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 33 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
@@ -166,49 +182,135 @@ WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line default
#line hidden
#line 33 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 35 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.JobMetaNonWarranty.RepairerName);
#line default
#line hidden
#line 33 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 35 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" </td>\r\n </tr>\r\n");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Repair Logged\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 43 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 41 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 43 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
{
#line default
#line hidden
#line 45 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", "Job_JobMetaNonWarranty_RepairerLoggedDate"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th");
#line 45 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 46 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 46 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n document.DiscoFunctions.DateDialogCreateUpdater(\'");
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\', \'Repairer Name\', \'Job_JobMetaNonWarranty_RepairerLoggedDate\', null, \'NonWarran" +
"tyRepairerLoggedDate\', \'Not Logged\', \'");
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.OpenedDate.ToISO8601());
#line default
#line hidden
WriteLiteral("\', false);\r\n </script>\r\n");
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
#line default
#line hidden
#line 53 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerLoggedDate, "Not Logged", null));
#line default
#line hidden
#line 53 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Repair Reference\r\n </th>\r\n <td>\r\n");
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 61 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 48 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 61 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerReference))
{
@@ -216,42 +318,42 @@ WriteLiteral(">Repair Reference\r\n </th>\r\n <td>\r\n");
#line default
#line hidden
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 63 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Html.EditorFor(m => m.Job.JobMetaNonWarranty.RepairerReference));
#line default
#line hidden
#line 50 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 63 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 64 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 51 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 64 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 52 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 65 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 52 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 65 "..\..\Views\Job\JobParts\Repairs.cshtml"
@@ -269,7 +371,7 @@ WriteLiteral(@">
'");
#line 58 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 71 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.UpdateNonWarrantyRepairerReference(Model.Job.Id, null)));
@@ -279,7 +381,7 @@ WriteLiteral("\',\r\n \'RepairerReference\'\r\n
" });\r\n </script>\r\n");
#line 63 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 76 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
@@ -295,7 +397,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line 67 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 80 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
@@ -303,101 +405,317 @@ WriteLiteral(">&lt;Unknown/None&gt;</span>");
#line default
#line hidden
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 82 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.JobMetaNonWarranty.RepairerReference);
#line default
#line hidden
#line 69 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 82 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 86 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Model.Job.JobMetaNonWarranty.RepairerLoggedDate.HasValue)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Repair Completed\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 92 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 77 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 92 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
{
#line default
#line hidden
#line 94 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", "Job_JobMetaNonWarranty_RepairerCompletedDate"));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n</table>\r\n<script>\r\n $(function () {\r\n var " +
"updateUrl = \'");
#line 94 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 83 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 95 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 95 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n document.DiscoFunctions.DateDialogCreateUpdater(\'");
#line 97 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.API.Job.Update(Model.Job.Id, null)));
#line default
#line hidden
WriteLiteral("\';\r\n var jobOpenDate = \'");
WriteLiteral("\', \'Repairer Completed\', \'Job_JobMetaNonWarranty_RepairerCompletedDate\', null, \'N" +
"onWarrantyRepairerCompletedDate\', \'Not Completed\', \'");
#line 84 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 97 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.OpenedDate.ToISO8601());
#line default
#line hidden
WriteLiteral("\';\r\n\r\n");
WriteLiteral("\', false);\r\n </script>\r\n");
#line 86 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 86 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerLoggedDate))
#line 99 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Repairer Name\', \'Job_" +
"JobMetaNonWarranty_RepairerLoggedDate\', null, \'NonWarrantyRepairerLoggedDate\', \'" +
"Not Logged\', jobOpenDate, false);");
#line 102 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(CommonHelpers.FriendlyDate(Model.Job.JobMetaNonWarranty.RepairerCompletedDate, "Not Completed", null));
#line 87 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 102 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral(" ");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 88 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairerCompletedDate))
#line 106 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails))
{
Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons");
#line default
#line hidden
WriteLiteral("document.DiscoFunctions.DateDialogCreateUpdater(updateUrl, \'Repair Completed\', \'J" +
"ob_JobMetaNonWarranty_RepairerCompletedDate\', null, \'NonWarrantyRepairerComplete" +
"dDate\', \'Not Completed\', jobOpenDate, false);");
WriteLiteral(" <tr");
WriteLiteral(" id=\"jobRepairProviderDetailContainer\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Provider Details\r\n </th>\r\n <td>\r\n <div");
WriteLiteral(" id=\"jobRepairProviderDetailLoading\"");
WriteLiteral(">\r\n <span");
WriteLiteral(" class=\"ajaxLoading\"");
WriteLiteral(" title=\"Loading...\"");
WriteLiteral("></span>Loading...\r\n </div>\r\n <div");
WriteLiteral(" id=\"jobRepairProviderDetailHost\"");
WriteLiteral(" class=\"clearfix\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n </div>\r\n </td>\r\n </tr>\r\n");
#line 89 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line 121 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
}
else
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th");
WriteLiteral(" style=\"width: 200px;\"");
WriteLiteral(">Actions\r\n </th>\r\n <td>\r\n");
#line 129 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 129 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Model.Job.CanLogRepair())
{
#line default
#line hidden
#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"));
#line default
#line hidden
#line 131 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">&lt;None&gt;</span>\r\n");
#line 136 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral(" });\r\n</script>\r\n");
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 139 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral("</table>\r\n<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n");
#line 142 "..\..\Views\Job\JobParts\Repairs.cshtml"
#line default
#line hidden
#line 142 "..\..\Views\Job\JobParts\Repairs.cshtml"
if (Authorization.Has(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails) && Model.Job.JobMetaNonWarranty.RepairerName != null)
{
#line default
#line hidden
WriteLiteral(@"
$(function () {
var repairProviderDetailLoaded = false;
$('#jobDetailTabs').on('tabsactivate', function (e, ui) {
if ($(ui.newPanel).is('#jobDetailTab-NonWarrantyRepairs')) {
if (!repairProviderDetailLoaded) {
var repairerName;
var $repairerName = $('#Job_JobMetaNonWarranty_RepairerName');
if ($repairerName.length > 0) {
if ($repairerName[0].nodeName === 'INPUT')
repairerName = $repairerName.val();
else
repairerName = $repairerName.text();
if (repairerName) {
$('#jobRepairProviderDetailContainer').show();
$('#jobRepairProviderDetailLoading span').show();
$('#jobRepairProviderDetailHost').load(
'");
#line 161 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Url.Action(MVC.Job.RepairProviderJobDetails()));
#line default
#line hidden
WriteLiteral("\',\r\n { id: \'");
#line 162 "..\..\Views\Job\JobParts\Repairs.cshtml"
Write(Model.Job.Id);
#line default
#line hidden
WriteLiteral(@"' },
function () {
$('#jobRepairProviderDetailLoading').hide();
$(this).slideDown();
}
);
repairProviderDetailLoaded = true;
}
}
}
}
});
});
");
#line 176 "..\..\Views\Job\JobParts\Repairs.cshtml"
}
#line default
#line hidden
WriteLiteral("</script>\r\n");
}
}
+1 -50
View File
@@ -820,56 +820,7 @@
}
@if (Model.Job.CanLogRepair())
{
@Html.ActionLinkSmallButton("Repairs Logged", MVC.API.Job.LogRepair(Model.Job.Id, null, null, true), "Job_Show_Job_Actions_LogRepair_Button")
<div id="Job_Show_Job_Actions_LogRepair_Dialog" class="dialog" title="Repairs Logged">
@using (Html.BeginForm(MVC.API.Job.LogRepair(Model.Job.Id, null, null, true)))
{
<h3>Repairer Name:</h3>
<p>
<input type="text" id="Job_Show_Job_Actions_LogRepair_Dialog_RepairerName" name="RepairerName" />
</p>
<h3>Repairer Reference:</h3>
<p>
<input type="text" id="Job_Show_Job_Actions_LogRepair_Dialog_RepairerReference" name="RepairerReference" />
</p>
}
</div>
<script type="text/javascript">
$(function () {
var button = $('#Job_Show_Job_Actions_LogRepair_Button');
var buttonDialog = null;
button.attr('href', '#');
button.click(function () {
if (!buttonDialog){
buttonDialog = $('#Job_Show_Job_Actions_LogRepair_Dialog');
buttonDialog.dialog({
resizable: false,
height: 240,
modal: true,
autoOpen: false,
buttons: {
"Log Repairs": function () {
var $this = $(this);
$this.dialog("disable");
$this.dialog("option", "buttons", null);
$this.find('form').submit();
},
Cancel: function () {
$(this).dialog("close");
}
}
});
}
buttonDialog.dialog('open');
$('#Job_Show_Job_Actions_LogRepair_Dialog_RepairerName').val($('#Job_JobMetaNonWarranty_RepairerName').val()).focus();
$('#Job_Show_Job_Actions_LogRepair_Dialog_RepairerReference').val($('#Job_JobMetaNonWarranty_RepairerReference').val());
return false;
});
});
</script>
@Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button")
}
@if (Model.Job.CanRepairComplete())
{
@@ -2663,7 +2663,7 @@ WriteLiteral(" ");
#line hidden
#line 823 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Repairs Logged", MVC.API.Job.LogRepair(Model.Job.Id, null, null, true), "Job_Show_Job_Actions_LogRepair_Button"));
Write(Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button"));
#line default
@@ -2671,98 +2671,6 @@ WriteLiteral(" ");
#line 823 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"Job_Show_Job_Actions_LogRepair_Dialog\"");
WriteLiteral(" class=\"dialog\"");
WriteLiteral(" title=\"Repairs Logged\"");
WriteLiteral(">\r\n");
#line 825 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 825 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.LogRepair(Model.Job.Id, null, null, true)))
{
#line default
#line hidden
WriteLiteral(" <h3>Repairer Name:</h3>\r\n");
WriteLiteral(" <p>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" id=\"Job_Show_Job_Actions_LogRepair_Dialog_RepairerName\"");
WriteLiteral(" name=\"RepairerName\"");
WriteLiteral(" />\r\n </p>\r\n");
WriteLiteral(" <h3>Repairer Reference:</h3>\r\n");
WriteLiteral(" <p>\r\n <input");
WriteLiteral(" type=\"text\"");
WriteLiteral(" id=\"Job_Show_Job_Actions_LogRepair_Dialog_RepairerReference\"");
WriteLiteral(" name=\"RepairerReference\"");
WriteLiteral(" />\r\n </p>\r\n");
#line 835 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
"Job_Show_Job_Actions_LogRepair_Button\');\r\n var buttonDial" +
"og = null;\r\n button.attr(\'href\', \'#\');\r\n " +
" button.click(function () {\r\n if (!buttonDialog" +
"){\r\n buttonDialog = $(\'#Job_Show_Job_Actions_LogR" +
"epair_Dialog\');\r\n buttonDialog.dialog({\r\n " +
" resizable: false,\r\n " +
" height: 240,\r\n modal: true,\r\n " +
" autoOpen: false,\r\n but" +
"tons: {\r\n \"Log Repairs\": function () {\r\n " +
" var $this = $(this);\r\n " +
" $this.dialog(\"disable\");\r\n " +
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
" $this.find(\'form\').submit();\r\n " +
" },\r\n Cancel: function () {" +
"\r\n $(this).dialog(\"close\");\r\n " +
" }\r\n }\r\n " +
" });\r\n }\r\n\r\n " +
" buttonDialog.dialog(\'open\');\r\n\r\n $(\'#Job_" +
"Show_Job_Actions_LogRepair_Dialog_RepairerName\').val($(\'#Job_JobMetaNonWarranty_" +
"RepairerName\').val()).focus();\r\n $(\'#Job_Show_Job_Act" +
"ions_LogRepair_Dialog_RepairerReference\').val($(\'#Job_JobMetaNonWarranty_Repaire" +
"rReference\').val());\r\n\r\n return false;\r\n " +
" });\r\n });\r\n </script>\r\n");
#line 873 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2771,7 +2679,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
#line 874 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 825 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanRepairComplete())
{
@@ -2779,14 +2687,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 876 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 827 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Repairs Complete", MVC.API.Job.UpdateNonWarrantyRepairerCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_RepairComplete_Button", "alert"));
#line default
#line hidden
#line 876 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 827 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2796,7 +2704,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 878 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 829 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanConvertHWarToHNWar())
{
@@ -2804,14 +2712,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 880 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 831 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Convert to Non-Warranty", MVC.API.Job.ConvertHWarToHNWar(Model.Job.Id, true), "Job_Show_Job_Actions_ConvertToHNWar_Button"));
#line default
#line hidden
#line 880 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 831 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2859,7 +2767,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \r\n });\r\n </script>\r\n");
#line 920 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 871 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2868,13 +2776,13 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" </td>\r\n");
#line 922 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 873 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 922 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 873 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.Device != null)
{
@@ -2888,13 +2796,13 @@ WriteLiteral(" id=\"Job_Show_Device_Actions\"");
WriteLiteral(">\r\n");
#line 925 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 876 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 925 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 876 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceHeld())
{
@@ -2902,14 +2810,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
#line 927 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 878 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Device Held", MVC.API.Job.DeviceHeld(Model.Job.Id, true), "Job_Show_Device_Actions_Held_Button"));
#line default
#line hidden
#line 927 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 878 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2919,7 +2827,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 929 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 880 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceReadyForReturn())
{
@@ -2927,14 +2835,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 931 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 882 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Device Ready For Return", MVC.API.Job.DeviceReadyForReturn(Model.Job.Id, true), "Job_Show_Device_Actions_DeviceReadyForReturn_Button", "alert"));
#line default
#line hidden
#line 931 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 882 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2944,7 +2852,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
#line 933 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 884 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceReturned())
{
@@ -2952,14 +2860,14 @@ WriteLiteral(" ");
#line default
#line hidden
#line 935 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 886 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Device Returned", MVC.API.Job.DeviceReturned(Model.Job.Id, true), "Job_Show_Device_Actions_DeviceReturned_Button", Model.Job.CanDeviceReadyForReturn() ? null : "alert"));
#line default
#line hidden
#line 935 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 886 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2969,7 +2877,7 @@ WriteLiteral(" ");
WriteLiteral(" </td>\r\n");
#line 938 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 889 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2978,7 +2886,7 @@ WriteLiteral(" </td>\r\n");
WriteLiteral(" ");
#line 939 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 890 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.User != null)
{
@@ -2992,13 +2900,13 @@ WriteLiteral(" id=\"Job_Show_User_Actions\"");
WriteLiteral(">\r\n\r\n\r\n");
#line 944 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 895 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 944 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 895 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanWaitingForUserAction())
{
@@ -3026,13 +2934,13 @@ WriteLiteral(" title=\"Waiting for User Action\"");
WriteLiteral(">\r\n");
#line 948 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 899 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 948 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 899 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.WaitingForUserAction(Model.Job.Id, null, true)))
{
@@ -3050,7 +2958,7 @@ WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 954 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 905 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3085,7 +2993,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n </script>\r\n");
#line 987 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 938 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3094,7 +3002,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
#line 988 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 939 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanNotWaitingForUserAction())
{
@@ -3122,13 +3030,13 @@ WriteLiteral(" title=\"Not Waiting for User Action\"");
WriteLiteral(">\r\n");
#line 992 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 943 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
#line 992 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 943 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.NotWaitingForUserAction(Model.Job.Id, null, true)))
{
@@ -3146,7 +3054,7 @@ WriteLiteral(" class=\"block\"");
WriteLiteral("></textarea>\r\n </p>\r\n");
#line 998 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 949 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3182,7 +3090,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n </script>\r\n");
#line 1032 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 983 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3191,7 +3099,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral("\r\n </td>\r\n");
#line 1035 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line 986 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
+167
View File
@@ -0,0 +1,167 @@
@model Disco.Web.Models.Job.LogRepairModel
@{
Authorization.Require(Claims.Job.Actions.LogRepair);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Repair");
}
@using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{
@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="repairJobForm" class="form" style="width: 650px">
<table>
<tr>
<th>Internal Job Id:
</th>
<td>
@Model.JobId
</td>
</tr>
<tr>
<th>Device Serial Number:
</th>
<td>
@Model.Job.Device.SerialNumber
</td>
</tr>
<tr>
<th>Device Model:
</th>
<td>
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
</td>
</tr>
<tr>
<th>Technician:
</th>
<td>
@Model.TechUser.DisplayName
<div class="smallMessage">
Email Address: @Model.TechUser.EmailAddress<br />
Phone Number: @Model.TechUser.PhoneNumber
</div>
</td>
</tr>
<tr>
<th style="width: 150px">Repair Address:
</th>
<td>
@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>Repair Provider:
</th>
<td>
@Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } }))<br />
@Html.ValidationMessageFor(m => m.RepairProviderId)
@if (Model.RepairProviders.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 repair provider plugins.
</p>
</div>
}
</td>
</tr>
@if (Model.IsManualProvider)
{
<tr>
<th>Provider Name:</th>
<td>
@Html.EditorFor(model => model.ManualProviderName)<br />
@Html.ValidationMessageFor(m => m.ManualProviderName)
</td>
</tr>
<tr>
<th>Provider Job Reference:</th>
<td>
@Html.EditorFor(model => model.ManualProviderReference)<br />
@Html.ValidationMessageFor(m => m.ManualProviderReference)
</td>
</tr>
}
</table>
</div>
<div id="repairJobRepairDescription" class="form" style="width: 650px; margin-top: 15px;">
<h2>Repair Description</h2>
<table>
<tr>
<td>
@Html.EditorFor(model => model.RepairDescription)<br />
@Html.ValidationMessageFor(m => m.RepairDescription)
</td>
</tr>
</table>
</div>
if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null)
{
<div id="repairJobProviderProperties">
@Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2)
</div>
}
<div class="actionBar">
@if (Model.IsManualProvider)
{
<input type="submit" class="button" value="Save Repair Request" />
}
else
{
<input type="submit" class="button" value="Preview Repair Request" />
}
</div>
}
<script type="text/javascript">
$(function () {
var $providerId = $('#RepairProviderId');
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: 'RepairProviderId', value: $providerId.val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'OrganisationAddressId', value: $addressId.val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'RepairDescription', value: $('#RepairDescription').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() })
).appendTo('body').submit();
}
$providerId.change(updateDetails);
$addressId.change(updateDetails);
var manualProvider = $('#ManualProviderName');
if (manualProvider.length > 0 && !manualProvider.val()) {
manualProvider.focus();
} else {
$('#RepairDescription').focus();
}
});
</script>
+633
View File
@@ -0,0 +1,633 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// 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.BI.Extensions;
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/LogRepair.cshtml")]
public partial class LogRepair : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogRepairModel>
{
public LogRepair()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogRepair.cshtml"
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");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Views\Job\LogRepair.cshtml"
using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{
#line default
#line hidden
#line 9 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 9 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#line default
#line hidden
#line 10 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 11 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.JobId));
#line default
#line hidden
#line 11 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteAttribute("value", Tuple.Create(" value=\"", 489), Tuple.Create("\"", 546)
#line 12 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 497), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose"
#line default
#line hidden
, 497), false)
);
WriteLiteral(" />\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"repairJobForm\"");
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 19 "..\..\Views\Job\LogRepair.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 26 "..\..\Views\Job\LogRepair.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 33 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 33 "..\..\Views\Job\LogRepair.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 40 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.TechUser.DisplayName);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 42 "..\..\Views\Job\LogRepair.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 43 "..\..\Views\Job\LogRepair.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(">Repair Address:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 51 "..\..\Views\Job\LogRepair.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 52 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.OrganisationAddressId));
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
#line 54 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 54 "..\..\Views\Job\LogRepair.cshtml"
var oa = Model.OrganisationAddress;
if (oa != null)
{
#line default
#line hidden
WriteLiteral(" <span>");
#line 58 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Address);
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 60 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 60 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Postcode);
#line default
#line hidden
WriteLiteral("</span>\r\n");
WriteLiteral(" <br />\r\n");
WriteLiteral(" <span>");
#line 62 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.State);
#line default
#line hidden
WriteLiteral(", ");
#line 62 "..\..\Views\Job\LogRepair.cshtml"
Write(oa.Country);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 63 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </td>\r\n </tr>\r\n " +
" <tr>\r\n <th>Repair Provider:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 72 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.DropDownListFor(model => model.RepairProviderId, Model.RepairProviders.ToSelectListItems(Model.RepairProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Request>" } })));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 73 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.RepairProviderId));
#line default
#line hidden
WriteLiteral("\r\n");
#line 74 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 74 "..\..\Views\Job\LogRepair.cshtml"
if (Model.RepairProviders.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=\"", 3297), Tuple.Create("\"", 3347)
#line 78 "..\..\Views\Job\LogRepair.cshtml"
, Tuple.Create(Tuple.Create("", 3304), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default
#line hidden
, 3304), false)
);
WriteLiteral(">Plugin Catalogue</a> to discover and install repair provider plugins.\r\n " +
" </p>\r\n </div>\r\n");
#line 81 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 84 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 84 "..\..\Views\Job\LogRepair.cshtml"
if (Model.IsManualProvider)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Provider Name:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 89 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.ManualProviderName));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogRepair.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>Provider Job Reference:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 96 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.ManualProviderReference));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 97 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderReference));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 100 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"repairJobRepairDescription\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Repair Description</h2>\r\n <table>\r\n <tr>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 108 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.EditorFor(model => model.RepairDescription));
#line default
#line hidden
WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 109 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.ValidationMessageFor(m => m.RepairDescription));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 114 "..\..\Views\Job\LogRepair.cshtml"
if (Model.RepairProvider != null && Model.RepairProviderSubmitJobBeginResult != null)
{
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" id=\"repairJobProviderProperties\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 117 "..\..\Views\Job\LogRepair.cshtml"
Write(Html.PartialCompiled(Model.RepairProviderSubmitJobBeginResult.Item1, Model.RepairProviderSubmitJobBeginResult.Item2));
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 119 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 121 "..\..\Views\Job\LogRepair.cshtml"
#line default
#line hidden
#line 121 "..\..\Views\Job\LogRepair.cshtml"
if (Model.IsManualProvider)
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Save Repair Request\"");
WriteLiteral(" />\r\n");
#line 124 "..\..\Views\Job\LogRepair.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Preview Repair Request\"");
WriteLiteral(" />\r\n");
#line 128 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n");
#line 130 "..\..\Views\Job\LogRepair.cshtml"
}
#line default
#line hidden
WriteLiteral("<script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n var $providerId = $(\'#RepairProviderId\');\r\n " +
" var $addressId = $(\'#OrganisationAddressId\');\r\n\r\n function updateDetail" +
"s() {\r\n $(\'<form>\').attr({\r\n action: $providerId.close" +
"st(\'form\').attr(\'action\'),\r\n method: \'post\'\r\n }).appen" +
"d(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'SubmissionAction\'" +
", value: \'Update\' })\r\n ).append(\r\n $(\'<input>\').attr({" +
" type: \'hidden\', name: \'JobId\', value: $(\'#JobId\').val() })\r\n ).appen" +
"d(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'RepairProviderId\'" +
", value: $providerId.val() })\r\n ).append(\r\n $(\'<input>" +
"\').attr({ type: \'hidden\', name: \'OrganisationAddressId\', value: $addressId.val()" +
" })\r\n ).append(\r\n $(\'<input>\').attr({ type: \'hidden\', " +
"name: \'RepairDescription\', value: $(\'#RepairDescription\').val() })\r\n " +
").append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProv" +
"iderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference\'," +
" value: $(\'#ManualProviderReference\').val() })\r\n ).appendTo(\'body\').s" +
"ubmit();\r\n }\r\n\r\n $providerId.change(updateDetails);\r\n $addr" +
"essId.change(updateDetails);\r\n\r\n var manualProvider = $(\'#ManualProviderN" +
"ame\');\r\n if (manualProvider.length > 0 && !manualProvider.val()) {\r\n " +
" manualProvider.focus();\r\n } else {\r\n $(\'#RepairDescript" +
"ion\').focus();\r\n }\r\n });\r\n</script>\r\n");
}
}
}
#pragma warning restore 1591
@@ -0,0 +1,110 @@
@model Disco.Web.Models.Job.LogRepairModel
@{
Authorization.Require(Claims.Job.Actions.LogRepair);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Repair");
}
@using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId)
@Html.HiddenFor(m => m.OrganisationAddressId)
@Html.HiddenFor(m => m.RepairProviderId)
@Html.HiddenFor(m => m.RepairDescription)
@Html.HiddenFor(m => m.ProviderPropertiesJson)
<input type="hidden" name="SubmissionAction" value="Submit" />
<div id="repairJobForm" class="form" style="width: 650px">
<table>
<tr>
<th>
Internal Job Id:
</th>
<td>
@Model.JobId
</td>
</tr>
<tr>
<th>
Device Serial Number:
</th>
<td>
@Model.Job.Device.SerialNumber
</td>
</tr>
<tr>
<th>
Device Model:
</th>
<td>
@Model.Job.Device.DeviceModel.Manufacturer @Model.Job.Device.DeviceModel.Model
</td>
</tr>
<tr>
<th>
Technician:
</th>
<td>
@Model.TechUser.DisplayName
<div class="smallMessage">
Email Address: @Model.TechUser.EmailAddress<br />
Phone Number: @Model.TechUser.PhoneNumber
</div>
</td>
</tr>
<tr>
<th style="width: 150px">
Repair Address:
</th>
<td>
<div id="organisationAddressDetails">
@Model.OrganisationAddress.Name
<div class="smallMessage">
<span>@Model.OrganisationAddress.Address</span><br />
<span>@Model.OrganisationAddress.Suburb, @Model.OrganisationAddress.Postcode</span><br />
<span>@Model.OrganisationAddress.State, @Model.OrganisationAddress.Country</span>
</div>
</div>
</td>
</tr>
<tr>
<th>
Repair Provider:
</th>
<td>
@Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3)
</td>
</tr>
<tr>
<th>
Repair Description:
</th>
<td>
@Model.RepairDescription.ToMultilineString()
</td>
</tr>
<tr>
<th>
Disclosed Information
</th>
<td>
<div id="repairDisclosedInformation">
<table>
@foreach (var dp in Model.DiscloseProperties)
{
<tr>
<th>@dp.Key:
</th>
<td>@dp.Value
</td>
</tr>
}
</table>
</div>
</td>
</tr>
</table>
</div>
<div class="actionBar">
<input type="submit" class="button" value="Submit Repair Request" />
</div>
}
@@ -0,0 +1,442 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// 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.BI.Extensions;
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/LogRepairDisclose.cshtml")]
public partial class LogRepairDisclose : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogRepairModel>
{
public LogRepairDisclose()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogRepairDisclose.cshtml"
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");
#line default
#line hidden
WriteLiteral("\r\n");
#line 7 "..\..\Views\Job\LogRepairDisclose.cshtml"
using (Html.BeginForm(MVC.Job.LogRepair(), FormMethod.Post))
{
#line default
#line hidden
#line 9 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.ValidationSummary(true));
#line default
#line hidden
#line 9 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 10 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.JobId));
#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.OrganisationAddressId));
#line default
#line hidden
#line 11 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 12 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.RepairProviderId));
#line default
#line hidden
#line 12 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 13 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.RepairDescription));
#line default
#line hidden
#line 13 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 14 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Html.HiddenFor(m => m.ProviderPropertiesJson));
#line default
#line hidden
#line 14 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteLiteral(" value=\"Submit\"");
WriteLiteral(" />\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"repairJobForm\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px\"");
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
"nternal Job Id:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 23 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.JobId);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Serial Number:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 31 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.SerialNumber);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Device Model:\r\n </th>\r\n <td" +
">\r\n");
WriteLiteral(" ");
#line 39 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 39 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.Job.Device.DeviceModel.Model);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Technician:\r\n </th>\r\n <td>\r" +
"\n");
WriteLiteral(" ");
#line 47 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.DisplayName);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n Email Address: ");
#line 49 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 50 "..\..\Views\Job\LogRepairDisclose.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(">\r\n Repair Address:\r\n </th>\r\n <t" +
"d>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 60 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Name);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 62 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Address);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 63 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 63 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.Postcode);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 64 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.OrganisationAddress.State);
#line default
#line hidden
WriteLiteral(", ");
#line 64 "..\..\Views\Job\LogRepairDisclose.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>\r\n " +
" Repair Provider:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Name);
#line default
#line hidden
WriteLiteral(" (");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.Id);
#line default
#line hidden
WriteLiteral(") ");
#line 74 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairProvider.PluginManifest.Version.ToString(3));
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Repair Description:\r\n </th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 82 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(Model.RepairDescription.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
">\r\n Disclosed Information\r\n </th>\r\n " +
" <td>\r\n <div");
WriteLiteral(" id=\"repairDisclosedInformation\"");
WriteLiteral(">\r\n <table>\r\n");
#line 92 "..\..\Views\Job\LogRepairDisclose.cshtml"
#line default
#line hidden
#line 92 "..\..\Views\Job\LogRepairDisclose.cshtml"
foreach (var dp in Model.DiscloseProperties)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>");
#line 95 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Key);
#line default
#line hidden
WriteLiteral(":\r\n </th>\r\n " +
" <td>");
#line 97 "..\..\Views\Job\LogRepairDisclose.cshtml"
Write(dp.Value);
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr" +
"> \r\n");
#line 100 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
#line default
#line hidden
WriteLiteral(" </table>\r\n </div>\r\n </t" +
"d>\r\n </tr>\r\n </table>\r\n </div>\r\n");
WriteLiteral(" <div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n <input");
WriteLiteral(" type=\"submit\"");
WriteLiteral(" class=\"button\"");
WriteLiteral(" value=\"Submit Repair Request\"");
WriteLiteral(" />\r\n </div>\r\n");
#line 110 "..\..\Views\Job\LogRepairDisclose.cshtml"
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
+127
View File
@@ -0,0 +1,127 @@
@model Disco.Web.Models.Job.LogRepairModel
@{
Authorization.Require(Claims.Job.Actions.LogRepair);
ViewBag.Title = Html.ToBreadcrumb("Jobs", MVC.Job.Index(), string.Format("Job: {0}", Model.Job.Id), MVC.Job.Show(Model.Job.Id), "Log Repair Error");
}
<div class="form" style="width: 650px">
<h2>Submission Error</h2>
<table>
<tr>
<td>
<div>
<strong>@Model.Error.Message</strong>
</div>
<a href="#" id="repairJobErrorShow" class="smallMessage">(show more)</a>
<div id="repairJobErrorMore" 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 () {
$('#repairJobErrorShow').click(function () {
$(this).hide();
$('#repairJobErrorMore').slideDown();
return false;
});
});
</script>
</td>
</tr>
</table>
</div>
<div id="repairJobForm" class="form" style="width: 650px; margin-top: 15px;">
<h2>Repair 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">Repair Address:
</th>
<td>
<div id="organisationAddressDetails">
@Model.OrganisationAddress.Name
<div class="smallMessage">
<span>@Model.OrganisationAddress.Address</span><br />
<span>@Model.OrganisationAddress.Suburb, @Model.OrganisationAddress.Postcode</span><br />
<span>@Model.OrganisationAddress.State, @Model.OrganisationAddress.Country</span>
</div>
</div>
</td>
</tr>
<tr>
<th>Repair Provider:
</th>
<td>
@if (Model.RepairProvider != null)
{
<span>
@Model.RepairProvider.Name (@Model.RepairProvider.Id) @Model.RepairProvider.PluginManifest.Version.ToString(3)
</span>
}
else
{
<span class="smallMessage">None Selected</span>
}
</td>
</tr>
<tr>
<th>Repair Description:
</th>
<td>
@Model.RepairDescription.ToMultilineString()
</td>
</tr>
</table>
</div>
<div class="actionBar">
@Html.ActionLinkButton("Try Again", MVC.Job.LogRepair(Model.JobId, null, null))
@Html.ActionLinkButton("Return to Job", MVC.Job.Show(Model.JobId))
</div>
@@ -0,0 +1,461 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// 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.BI.Extensions;
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/LogRepairError.cshtml")]
public partial class LogRepairError : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.LogRepairModel>
{
public LogRepairError()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\LogRepairError.cshtml"
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");
#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\LogRepairError.cshtml"
Write(Model.Error.Message);
#line default
#line hidden
WriteLiteral("</strong>\r\n </div>\r\n <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"repairJobErrorShow\"");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">(show more)</a>\r\n <div");
WriteLiteral(" id=\"repairJobErrorMore\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 18 "..\..\Views\Job\LogRepairError.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\LogRepairError.cshtml"
Write(Model.Error.StackTrace.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 24 "..\..\Views\Job\LogRepairError.cshtml"
#line default
#line hidden
#line 24 "..\..\Views\Job\LogRepairError.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\LogRepairError.cshtml"
Write(Model.Error.InnerException.Message);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 29 "..\..\Views\Job\LogRepairError.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\LogRepairError.cshtml"
Write(Model.Error.InnerException.StackTrace);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 35 "..\..\Views\Job\LogRepairError.cshtml"
}
#line default
#line hidden
WriteLiteral(" </div>\r\n <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#repairJobErrorShow').click(function () {
$(this).hide();
$('#repairJobErrorMore').slideDown();
return false;
});
});
</script>
</td>
</tr>
</table>
</div>
<div");
WriteLiteral(" id=\"repairJobForm\"");
WriteLiteral(" class=\"form\"");
WriteLiteral(" style=\"width: 650px; margin-top: 15px;\"");
WriteLiteral(">\r\n <h2>Repair 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\LogRepairError.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\LogRepairError.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\LogRepairError.cshtml"
Write(Model.Job.Device.DeviceModel.Manufacturer);
#line default
#line hidden
WriteLiteral(" ");
#line 71 "..\..\Views\Job\LogRepairError.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\LogRepairError.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\LogRepairError.cshtml"
Write(Model.TechUser.EmailAddress);
#line default
#line hidden
WriteLiteral("<br />\r\n Phone Number: ");
#line 81 "..\..\Views\Job\LogRepairError.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(">Repair Address:\r\n </th>\r\n <td>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 90 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.OrganisationAddress.Name);
#line default
#line hidden
WriteLiteral("\r\n <div");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">\r\n <span>");
#line 92 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.OrganisationAddress.Address);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 93 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.OrganisationAddress.Suburb);
#line default
#line hidden
WriteLiteral(", ");
#line 93 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.OrganisationAddress.Postcode);
#line default
#line hidden
WriteLiteral("</span><br />\r\n <span>");
#line 94 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.OrganisationAddress.State);
#line default
#line hidden
WriteLiteral(", ");
#line 94 "..\..\Views\Job\LogRepairError.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>Repair Provider:\r\n </th>\r" +
"\n <td>\r\n");
#line 103 "..\..\Views\Job\LogRepairError.cshtml"
#line default
#line hidden
#line 103 "..\..\Views\Job\LogRepairError.cshtml"
if (Model.RepairProvider != null)
{
#line default
#line hidden
WriteLiteral(" <span>\r\n");
WriteLiteral(" ");
#line 106 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.RepairProvider.Name);
#line default
#line hidden
WriteLiteral(" (");
#line 106 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.RepairProvider.Id);
#line default
#line hidden
WriteLiteral(") ");
#line 106 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.RepairProvider.PluginManifest.Version.ToString(3));
#line default
#line hidden
WriteLiteral("\r\n </span>\r\n");
#line 108 "..\..\Views\Job\LogRepairError.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">None Selected</span>\r\n");
#line 112 "..\..\Views\Job\LogRepairError.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n <tr>\r\n <th>Repair Descriptio" +
"n:\r\n </th>\r\n <td>\r\n");
WriteLiteral(" ");
#line 119 "..\..\Views\Job\LogRepairError.cshtml"
Write(Model.RepairDescription.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n</div>\r\n<div");
WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 125 "..\..\Views\Job\LogRepairError.cshtml"
Write(Html.ActionLinkButton("Try Again", MVC.Job.LogRepair(Model.JobId, null, null)));
#line default
#line hidden
WriteLiteral("\r\n");
WriteLiteral(" ");
#line 126 "..\..\Views\Job\LogRepairError.cshtml"
Write(Html.ActionLinkButton("Return to Job", MVC.Job.Show(Model.JobId)));
#line default
#line hidden
WriteLiteral("\r\n</div>");
}
}
}
#pragma warning restore 1591
+23 -15
View File
@@ -9,7 +9,7 @@
@Html.ValidationSummary(true)
@Html.HiddenFor(m => m.JobId)
@Html.ValidationMessageFor(m => m.JobId)
<input type="hidden" name="WarrantyAction" value="@(Model.IsCustomProvider ? "Custom" : "Disclose")" />
<input type="hidden" name="SubmissionAction" value="@(Model.IsManualProvider ? "Manual" : "Disclose")" />
<div id="warrantyJobForm" class="form" style="width: 650px">
<table>
<tr>
@@ -69,24 +69,32 @@
<th>Warranty Provider:
</th>
<td>
@Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, true, InstructionMessage: "Select a Provider", AdditionalItems: new Dictionary<string, string>() { { "CUSTOM", "<Custom Provider>" } }))<br />
@Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } }))<br />
@Html.ValidationMessageFor(m => m.WarrantyProviderId)
@if (Model.WarrantyProviders.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 warranty provider plugins.
</p>
</div>
}
</td>
</tr>
@if (Model.IsCustomProvider)
@if (Model.IsManualProvider)
{
<tr>
<th>Custom Provider:</th>
<th>Provider Name:</th>
<td>
@Html.EditorFor(model => model.CustomProviderName)<br />
@Html.ValidationMessageFor(m => m.CustomProviderName)
@Html.EditorFor(model => model.ManualProviderName)<br />
@Html.ValidationMessageFor(m => m.ManualProviderName)
</td>
</tr>
<tr>
<th>Provider Job Reference:</th>
<td>
@Html.EditorFor(model => model.CustomProviderReference)<br />
@Html.ValidationMessageFor(m => m.CustomProviderReference)
@Html.EditorFor(model => model.ManualProviderReference)<br />
@Html.ValidationMessageFor(m => m.ManualProviderReference)
</td>
</tr>
}
@@ -110,7 +118,7 @@
</div>
}
<div class="actionBar">
@if (Model.IsCustomProvider)
@if (Model.IsManualProvider)
{
<input type="submit" class="button" value="Save Warranty Claim" />
}
@@ -130,7 +138,7 @@
action: $providerId.closest('form').attr('action'),
method: 'post'
}).append(
$('<input>').attr({ type: 'hidden', name: 'WarrantyAction', value: 'Update' })
$('<input>').attr({ type: 'hidden', name: 'SubmissionAction', value: 'Update' })
).append(
$('<input>').attr({ type: 'hidden', name: 'JobId', value: $('#JobId').val() })
).append(
@@ -140,18 +148,18 @@
).append(
$('<input>').attr({ type: 'hidden', name: 'FaultDescription', value: $('#FaultDescription').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'CustomProviderName', value: $('#CustomProviderName').val() })
$('<input>').attr({ type: 'hidden', name: 'ManualProviderName', value: $('#ManualProviderName').val() })
).append(
$('<input>').attr({ type: 'hidden', name: 'CustomProviderReference', value: $('#CustomProviderReference').val() })
$('<input>').attr({ type: 'hidden', name: 'ManualProviderReference', value: $('#ManualProviderReference').val() })
).appendTo('body').submit();
}
$providerId.change(updateDetails);
$addressId.change(updateDetails);
var customProvider = $('#CustomProviderName');
if (customProvider.length > 0 && !customProvider.val()) {
customProvider.focus();
var manualProvider = $('#ManualProviderName');
if (manualProvider.length > 0 && !manualProvider.val()) {
manualProvider.focus();
} else {
$('#FaultDescription').focus();
}
+97 -47
View File
@@ -110,16 +110,16 @@ WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"WarrantyAction\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteAttribute("value", Tuple.Create(" value=\"", 495), Tuple.Create("\"", 552)
WriteAttribute("value", Tuple.Create(" value=\"", 497), Tuple.Create("\"", 554)
#line 12 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 503), Tuple.Create<System.Object, System.Int32>(Model.IsCustomProvider ? "Custom" : "Disclose"
, Tuple.Create(Tuple.Create("", 505), Tuple.Create<System.Object, System.Int32>(Model.IsManualProvider ? "Manual" : "Disclose"
#line default
#line hidden
, 503), false)
, 505), false)
);
WriteLiteral(" />\r\n");
@@ -330,7 +330,7 @@ WriteLiteral(" ");
#line 72 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, true, InstructionMessage: "Select a Provider", AdditionalItems: new Dictionary<string, string>() { { "CUSTOM", "<Custom Provider>" } })));
Write(Html.DropDownListFor(model => model.WarrantyProviderId, Model.WarrantyProviders.ToSelectListItems(Model.WarrantyProviderId, AdditionalItems: new Dictionary<string, string>() { { "MANUAL", "<Manually Submitted Claim>" } })));
#line default
@@ -346,30 +346,80 @@ WriteLiteral(" ");
#line default
#line hidden
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
WriteLiteral("\r\n");
#line 76 "..\..\Views\Job\LogWarranty.cshtml"
#line 74 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 76 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsCustomProvider)
#line 74 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.WarrantyProviders.Count == 0 && Authorization.Has(Claims.Config.Plugin.Install))
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Custom Provider:</th>\r\n " +
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=\"", 3317), Tuple.Create("\"", 3367)
#line 78 "..\..\Views\Job\LogWarranty.cshtml"
, Tuple.Create(Tuple.Create("", 3324), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Config.Plugins.Install())
#line default
#line hidden
, 3324), false)
);
WriteLiteral(">Plugin Catalogue</a> to discover and install warranty provider plugins.\r\n " +
" </p>\r\n </div>\r\n");
#line 81 "..\..\Views\Job\LogWarranty.cshtml"
}
#line default
#line hidden
WriteLiteral(" </td>\r\n </tr>\r\n");
#line 84 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 84 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsManualProvider)
{
#line default
#line hidden
WriteLiteral(" <tr>\r\n <th>Provider Name:</th>\r\n " +
" <td>\r\n");
WriteLiteral(" ");
#line 81 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.CustomProviderName));
#line 89 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.ManualProviderName));
#line default
@@ -379,8 +429,8 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 82 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.CustomProviderName));
#line 90 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderName));
#line default
@@ -393,8 +443,8 @@ WriteLiteral(" <tr>\r\n <th>Provider Job Refer
WriteLiteral(" ");
#line 88 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.CustomProviderReference));
#line 96 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.ManualProviderReference));
#line default
@@ -404,8 +454,8 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 89 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.CustomProviderReference));
#line 97 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.ManualProviderReference));
#line default
@@ -413,7 +463,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n");
#line 92 "..\..\Views\Job\LogWarranty.cshtml"
#line 100 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -435,7 +485,7 @@ WriteLiteral(">\r\n <h2>Fault Description</h2>\r\n <table>\r\n
WriteLiteral(" ");
#line 100 "..\..\Views\Job\LogWarranty.cshtml"
#line 108 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.EditorFor(model => model.FaultDescription));
@@ -446,7 +496,7 @@ WriteLiteral("<br />\r\n");
WriteLiteral(" ");
#line 101 "..\..\Views\Job\LogWarranty.cshtml"
#line 109 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.ValidationMessageFor(m => m.FaultDescription));
@@ -455,7 +505,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n </div>\r\n");
#line 106 "..\..\Views\Job\LogWarranty.cshtml"
#line 114 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.WarrantyProvider != null && Model.WarrantyProviderSubmitJobViewType != null)
{
@@ -471,7 +521,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
#line 109 "..\..\Views\Job\LogWarranty.cshtml"
#line 117 "..\..\Views\Job\LogWarranty.cshtml"
Write(Html.PartialCompiled(Model.WarrantyProviderSubmitJobViewType, Model.WarrantyProviderSubmitJobModel));
@@ -480,7 +530,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </div>\r\n");
#line 111 "..\..\Views\Job\LogWarranty.cshtml"
#line 119 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -493,14 +543,14 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
#line 113 "..\..\Views\Job\LogWarranty.cshtml"
#line 121 "..\..\Views\Job\LogWarranty.cshtml"
#line default
#line hidden
#line 113 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsCustomProvider)
#line 121 "..\..\Views\Job\LogWarranty.cshtml"
if (Model.IsManualProvider)
{
@@ -517,7 +567,7 @@ WriteLiteral(" value=\"Save Warranty Claim\"");
WriteLiteral(" />\r\n");
#line 116 "..\..\Views\Job\LogWarranty.cshtml"
#line 124 "..\..\Views\Job\LogWarranty.cshtml"
}
else
{
@@ -536,7 +586,7 @@ WriteLiteral(" value=\"Preview Warranty Claim\"");
WriteLiteral(" />\r\n");
#line 120 "..\..\Views\Job\LogWarranty.cshtml"
#line 128 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -545,7 +595,7 @@ WriteLiteral(" />\r\n");
WriteLiteral(" </div>\r\n");
#line 122 "..\..\Views\Job\LogWarranty.cshtml"
#line 130 "..\..\Views\Job\LogWarranty.cshtml"
}
@@ -559,23 +609,23 @@ WriteLiteral(">\r\n $(function () {\r\n var $providerId = $(\'#Warrant
" var $addressId = $(\'#OrganisationAddressId\');\r\n\r\n function updateDeta" +
"ils() {\r\n $(\'<form>\').attr({\r\n action: $providerId.clo" +
"sest(\'form\').attr(\'action\'),\r\n method: \'post\'\r\n }).app" +
"end(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'WarrantyAction\'" +
", value: \'Update\' })\r\n ).append(\r\n $(\'<input>\').attr({" +
" type: \'hidden\', name: \'JobId\', value: $(\'#JobId\').val() })\r\n ).appen" +
"d(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'WarrantyProviderI" +
"d\', value: $providerId.val() })\r\n ).append(\r\n $(\'<inpu" +
"t>\').attr({ type: \'hidden\', name: \'OrganisationAddressId\', value: $addressId.val" +
"() })\r\n ).append(\r\n $(\'<input>\').attr({ type: \'hidden\'" +
", name: \'FaultDescription\', value: $(\'#FaultDescription\').val() })\r\n " +
").append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'CustomProv" +
"iderName\', value: $(\'#CustomProviderName\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'CustomProviderReference\'," +
" value: $(\'#CustomProviderReference\').val() })\r\n ).appendTo(\'body\').s" +
"ubmit();\r\n }\r\n\r\n $providerId.change(updateDetails);\r\n $addr" +
"essId.change(updateDetails);\r\n\r\n var customProvider = $(\'#CustomProviderN" +
"ame\');\r\n if (customProvider.length > 0 && !customProvider.val()) {\r\n " +
" customProvider.focus();\r\n } else {\r\n $(\'#FaultDescripti" +
"on\').focus();\r\n }\r\n });\r\n</script>\r\n");
"end(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'SubmissionActio" +
"n\', value: \'Update\' })\r\n ).append(\r\n $(\'<input>\').attr" +
"({ type: \'hidden\', name: \'JobId\', value: $(\'#JobId\').val() })\r\n ).app" +
"end(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'WarrantyProvide" +
"rId\', value: $providerId.val() })\r\n ).append(\r\n $(\'<in" +
"put>\').attr({ type: \'hidden\', name: \'OrganisationAddressId\', value: $addressId.v" +
"al() })\r\n ).append(\r\n $(\'<input>\').attr({ type: \'hidde" +
"n\', name: \'FaultDescription\', value: $(\'#FaultDescription\').val() })\r\n " +
" ).append(\r\n $(\'<input>\').attr({ type: \'hidden\', name: \'ManualPr" +
"oviderName\', value: $(\'#ManualProviderName\').val() })\r\n ).append(\r\n " +
" $(\'<input>\').attr({ type: \'hidden\', name: \'ManualProviderReference" +
"\', value: $(\'#ManualProviderReference\').val() })\r\n ).appendTo(\'body\')" +
".submit();\r\n }\r\n\r\n $providerId.change(updateDetails);\r\n $ad" +
"dressId.change(updateDetails);\r\n\r\n var manualProvider = $(\'#ManualProvide" +
"rName\');\r\n if (manualProvider.length > 0 && !manualProvider.val()) {\r\n " +
" manualProvider.focus();\r\n } else {\r\n $(\'#FaultDescrip" +
"tion\').focus();\r\n }\r\n });\r\n</script>\r\n");
}
}
@@ -11,8 +11,8 @@
@Html.HiddenFor(m => m.OrganisationAddressId)
@Html.HiddenFor(m => m.WarrantyProviderId)
@Html.HiddenFor(m => m.FaultDescription)
@Html.HiddenFor(m => m.WarrantyProviderPropertiesJson)
<input type="hidden" name="WarrantyAction" value="Submit" />
@Html.HiddenFor(m => m.ProviderPropertiesJson)
<input type="hidden" name="SubmissionAction" value="Submit" />
<div id="warrantyJobForm" class="form" style="width: 650px">
<table>
<tr>
@@ -53,7 +53,7 @@
</tr>
<tr>
<th style="width: 150px">
Repair Address:
Warranty Address:
</th>
<td>
<div id="organisationAddressDetails">
@@ -136,7 +136,7 @@ Write(Html.HiddenFor(m => m.FaultDescription));
#line hidden
#line 14 "..\..\Views\Job\LogWarrantyDisclose.cshtml"
Write(Html.HiddenFor(m => m.WarrantyProviderPropertiesJson));
Write(Html.HiddenFor(m => m.ProviderPropertiesJson));
#line default
@@ -152,7 +152,7 @@ WriteLiteral(" <input");
WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"WarrantyAction\"");
WriteLiteral(" name=\"SubmissionAction\"");
WriteLiteral(" value=\"Submit\"");
@@ -253,8 +253,8 @@ WriteLiteral("\r\n </div>\r\n </td>\r\n
WriteLiteral(" style=\"width: 150px\"");
WriteLiteral(">\r\n Repair Address:\r\n </th>\r\n <t" +
"d>\r\n <div");
WriteLiteral(">\r\n Warranty Address:\r\n </th>\r\n " +
"<td>\r\n <div");
WriteLiteral(" id=\"organisationAddressDetails\"");
@@ -0,0 +1,55 @@
@model Disco.Web.Models.Job.ProviderJobDetailsModel
@{ Layout = null;
Authorization.Require(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails);
if (Model.JobDetailsException != null)
{
<h3>
Error:</h3>
<div>
<strong>@Model.JobDetailsException.Message</strong>
</div>
<a href="#" id="repairJobDetailsErrorShow" class="smallMessage">(show more)</a>
<div id="repairJobDetailsErrorMore" 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 () {
$('#repairJobDetailsErrorShow').click(function () {
$(this).hide();
$('#repairJobDetailsErrorMore').slideDown();
});
});
</script>
</div>
}
else
{
if (Model.JobDetailsSupported)
{
@Html.PartialCompiled(Model.ViewType, Model.ViewModel)
}
else
{
<span class="smallMessage">@Model.JobDetailsNotSupportedMessage</span>
}
}
}
@@ -0,0 +1,241 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34014
//
// 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.BI.Extensions;
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/RepairProviderJobDetails.cshtml")]
public partial class RepairProviderJobDetails : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ProviderJobDetailsModel>
{
public RepairProviderJobDetails()
{
}
public override void Execute()
{
#line 2 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
Layout = null;
Authorization.Require(Claims.Job.Properties.NonWarrantyProperties.RepairProviderDetails);
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\RepairProviderJobDetails.cshtml"
Write(Model.JobDetailsException.Message);
#line default
#line hidden
WriteLiteral("</strong>\r\n </div>\r\n");
WriteLiteral(" <a");
WriteLiteral(" href=\"#\"");
WriteLiteral(" id=\"repairJobDetailsErrorShow\"");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">(show more)</a>\r\n");
WriteLiteral(" <div");
WriteLiteral(" id=\"repairJobDetailsErrorMore\"");
WriteLiteral(" style=\"display: none\"");
WriteLiteral(">\r\n <br />\r\n <strong>Error Type: </strong>");
#line 16 "..\..\Views\Job\RepairProviderJobDetails.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\RepairProviderJobDetails.cshtml"
Write(Model.JobDetailsException.StackTrace.ToMultilineString());
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n");
#line 22 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
#line default
#line hidden
#line 22 "..\..\Views\Job\RepairProviderJobDetails.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\RepairProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.Message);
#line default
#line hidden
WriteLiteral("<br />\r\n <strong>Error Type:</strong> ");
#line 27 "..\..\Views\Job\RepairProviderJobDetails.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\RepairProviderJobDetails.cshtml"
Write(Model.JobDetailsException.InnerException.StackTrace);
#line default
#line hidden
WriteLiteral("\r\n </div>\r\n </div>\r\n");
#line 33 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
}
#line default
#line hidden
WriteLiteral(" <script");
WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(@">
$(function () {
$('#repairJobDetailsErrorShow').click(function () {
$(this).hide();
$('#repairJobDetailsErrorMore').slideDown();
});
});
</script>
</div>
");
#line 43 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
}
else
{
if (Model.JobDetailsSupported)
{
#line default
#line hidden
#line 48 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
Write(Html.PartialCompiled(Model.ViewType, Model.ViewModel));
#line default
#line hidden
#line 48 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
}
else
{
#line default
#line hidden
WriteLiteral(" <span");
WriteLiteral(" class=\"smallMessage\"");
WriteLiteral(">");
#line 52 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
Write(Model.JobDetailsNotSupportedMessage);
#line default
#line hidden
WriteLiteral("</span>\r\n");
#line 53 "..\..\Views\Job\RepairProviderJobDetails.cshtml"
}
}
#line default
#line hidden
}
}
}
#pragma warning restore 1591
@@ -1,4 +1,4 @@
@model Disco.Web.Models.Job.WarrantyProviderJobDetailsModel
@model Disco.Web.Models.Job.ProviderJobDetailsModel
@{ Layout = null;
Authorization.Require(Claims.Job.Properties.WarrantyProperties.ProviderDetails);
@@ -37,7 +37,7 @@ namespace Disco.Web.Views.Job
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Job/WarrantyProviderJobDetails.cshtml")]
public partial class WarrantyProviderJobDetails : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.WarrantyProviderJobDetailsModel>
public partial class WarrantyProviderJobDetails : Disco.Services.Web.WebViewPage<Disco.Web.Models.Job.ProviderJobDetailsModel>
{
public WarrantyProviderJobDetails()
{
@@ -235,8 +235,6 @@ WriteLiteral("</span>\r\n");
#line default
#line hidden
WriteLiteral("\r\n");
}
}
}