From aca037ecf836733aca8b478eac55c7389aa5f252 Mon Sep 17 00:00:00 2001
From: Gary Sharp
Date: Mon, 14 Nov 2016 01:21:23 +1100
Subject: [PATCH] Feature: Document Template Packages
Document Templates can be grouped into a package and generated on-demand
in the same was as individual document templates. Packages can be
generated in bulk.
---
.../Extensions/DocumentTemplateExtensions.cs | 43 +-
Disco.BI/BI/Interop/Pdf/PdfGenerator.cs | 108 +-
Disco.BI/BI/Interop/Pdf/Utilities.cs | 37 +-
.../Modules/DocumentsConfiguration.cs | 19 +
.../Configuration/SystemConfiguration.cs | 78 +-
Disco.Data/Disco.Data.csproj | 1 +
Disco.Models/Disco.Models.csproj | 3 +
.../DocumentTemplate/DocumentTemplate.cs | 2 -
.../Documents/DocumentTemplatePackage.cs | 31 +
.../ConfigDocumentTemplateCreateModel.cs | 16 +-
...onfigDocumentTemplateCreatePackageModel.cs | 12 +
.../ConfigDocumentTemplateIndexModel.cs | 5 +-
.../ConfigDocumentTemplateShowModel.cs | 12 +-
.../ConfigDocumentTemplateShowPackageModel.cs | 18 +
Disco.Models/UI/Device/DeviceShowModel.cs | 2 +
Disco.Models/UI/Job/JobShowModel.cs | 4 +-
Disco.Models/UI/User/UserShowModel.cs | 2 +
Disco.Services/Devices/DeviceExtensions.cs | 5 +
Disco.Services/Disco.Services.csproj | 2 +
.../DocumentTemplateExpressionExtensions.cs | 46 +-
.../Documents/DocumentTemplateExtensions.cs | 5 +-
.../DocumentTemplatePackageExtensions.cs | 143 +
.../Documents/DocumentTemplatePackages.cs | 187 ++
Disco.Services/Documents/DocumentsLog.cs | 123 +-
Disco.Services/Jobs/JobExtensions.cs | 5 +
Disco.Services/Users/UserExtensions.cs | 6 +
.../DocumentTemplateExtensions.cs | 13 +-
.../Areas/API/Controllers/DeviceController.cs | 47 +-
.../Controllers/DocumentTemplateController.cs | 8 +-
.../DocumentTemplatePackageController.cs | 422 +++
.../Areas/API/Controllers/JobController.cs | 49 +-
.../Areas/API/Controllers/UserController.cs | 44 +-
.../Areas/Config/ConfigAreaRegistration.cs | 12 +-
.../Controllers/DocumentTemplateController.cs | 77 +-
.../DocumentTemplate/CreatePackageModel.cs | 21 +
.../Models/DocumentTemplate/IndexModel.cs | 5 +-
.../Models/DocumentTemplate/ShowModel.cs | 2 +
.../DocumentTemplate/ShowPackageModel.cs | 24 +
.../DocumentTemplate/CreatePackage.cshtml | 38 +
.../CreatePackage.generated.cs | 146 +
.../Views/DocumentTemplate/Index.cshtml | 69 +-
.../Views/DocumentTemplate/Index.generated.cs | 332 ++-
.../Config/Views/DocumentTemplate/Show.cshtml | 1009 +++----
.../Views/DocumentTemplate/Show.generated.cs | 1536 ++++++-----
.../Views/DocumentTemplate/ShowPackage.cshtml | 767 ++++++
.../ShowPackage1.generated.cs | 2379 +++++++++++++++++
Disco.Web/ClientSource/Style/BundleSite.css | 6 +-
.../ClientSource/Style/BundleSite.min.css | 2 +-
Disco.Web/ClientSource/Style/Config.css | 101 +
Disco.Web/ClientSource/Style/Config.less | 138 +-
Disco.Web/ClientSource/Style/Config.min.css | 2 +-
Disco.Web/ClientSource/Style/Site.css | 6 +-
Disco.Web/ClientSource/Style/Site.less | 2 +-
Disco.Web/ClientSource/Style/Site.min.css | 2 +-
Disco.Web/Controllers/DeviceController.cs | 3 +
Disco.Web/Controllers/JobController.cs | 3 +
Disco.Web/Controllers/UserController.cs | 3 +
Disco.Web/Disco.Web.csproj | 24 +
.../T4MVC/API.DeviceController.generated.cs | 30 +
...PI.DocumentTemplateController.generated.cs | 8 +-
...mentTemplatePackageController.generated.cs | 459 ++++
.../T4MVC/API.JobController.generated.cs | 34 +-
.../T4MVC/API.UserController.generated.cs | 32 +
...ig.DocumentTemplateController.generated.cs | 65 +
Disco.Web/Extensions/T4MVC/T4MVC.cs | 1 +
Disco.Web/Extensions/T4MVC/T4MVCExtensions.cs | 11 +
Disco.Web/Models/Device/ShowModel.cs | 7 +-
Disco.Web/Models/Job/ShowModel.cs | 7 +-
Disco.Web/Models/User/ShowModel.cs | 7 +-
.../Views/Device/DeviceParts/_Subject.cshtml | 10 +-
.../Device/DeviceParts/_Subject.generated.cs | 374 +--
Disco.Web/Views/Job/JobParts/_Subject.cshtml | 10 +-
.../Views/Job/JobParts/_Subject.generated.cs | 550 ++--
.../Views/User/UserParts/_Subject.cshtml | 8 +-
.../User/UserParts/_Subject.generated.cs | 266 +-
75 files changed, 8008 insertions(+), 2078 deletions(-)
create mode 100644 Disco.Data/Configuration/Modules/DocumentsConfiguration.cs
create mode 100644 Disco.Models/Services/Documents/DocumentTemplatePackage.cs
create mode 100644 Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreatePackageModel.cs
create mode 100644 Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowPackageModel.cs
create mode 100644 Disco.Services/Documents/DocumentTemplatePackageExtensions.cs
create mode 100644 Disco.Services/Documents/DocumentTemplatePackages.cs
create mode 100644 Disco.Web/Areas/API/Controllers/DocumentTemplatePackageController.cs
create mode 100644 Disco.Web/Areas/Config/Models/DocumentTemplate/CreatePackageModel.cs
create mode 100644 Disco.Web/Areas/Config/Models/DocumentTemplate/ShowPackageModel.cs
create mode 100644 Disco.Web/Areas/Config/Views/DocumentTemplate/CreatePackage.cshtml
create mode 100644 Disco.Web/Areas/Config/Views/DocumentTemplate/CreatePackage.generated.cs
create mode 100644 Disco.Web/Areas/Config/Views/DocumentTemplate/ShowPackage.cshtml
create mode 100644 Disco.Web/Areas/Config/Views/DocumentTemplate/ShowPackage1.generated.cs
create mode 100644 Disco.Web/Extensions/T4MVC/API.DocumentTemplatePackageController.generated.cs
diff --git a/Disco.BI/BI/Extensions/DocumentTemplateExtensions.cs b/Disco.BI/BI/Extensions/DocumentTemplateExtensions.cs
index 0e8db1d4..53740fd9 100644
--- a/Disco.BI/BI/Extensions/DocumentTemplateExtensions.cs
+++ b/Disco.BI/BI/Extensions/DocumentTemplateExtensions.cs
@@ -10,6 +10,7 @@ using iTextSharp.text.pdf;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+using System.IO;
using System.Linq;
namespace Disco.BI.Extensions
@@ -45,15 +46,15 @@ namespace Disco.BI.Extensions
return dt.PdfExpressionsFromCache(Database).Values.OrderBy(e => e.Ordinal).ToList();
}
- public static System.IO.Stream GeneratePdfBulk(this DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, params string[] DataObjectsIds)
+ public static Stream GeneratePdfBulk(this DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, params string[] DataObjectsIds)
{
- return Interop.Pdf.PdfGenerator.GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, DataObjectsIds);
+ return Interop.Pdf.PdfGenerator.GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjectsIds);
}
- public static System.IO.Stream GeneratePdfBulk(this DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, params IAttachmentTarget[] DataObjects)
+ public static Stream GeneratePdfBulk(this DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, params IAttachmentTarget[] DataObjects)
{
- return Interop.Pdf.PdfGenerator.GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, DataObjects);
+ return Interop.Pdf.PdfGenerator.GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjects);
}
- public static System.IO.Stream GeneratePdf(this DocumentTemplate dt, DiscoDataContext Database, IAttachmentTarget Target, User CreatorUser, DateTime TimeStamp, DocumentState State, bool FlattenFields = false)
+ public static Stream GeneratePdf(this DocumentTemplate dt, DiscoDataContext Database, IAttachmentTarget Target, User CreatorUser, DateTime TimeStamp, DocumentState State, bool FlattenFields = false)
{
bool generateExpression = !string.IsNullOrEmpty(dt.OnGenerateExpression);
string generateExpressionResult = null;
@@ -70,7 +71,37 @@ namespace Disco.BI.Extensions
return pdfStream;
}
-
+ public static Stream GeneratePdfPackage(this DocumentTemplatePackage package, DiscoDataContext Database, IAttachmentTarget Target, User CreatorUser, DateTime TimeStamp, DocumentState State)
+ {
+ return Interop.Pdf.PdfGenerator.GenerateFromPackage(package, Database, Target, CreatorUser, TimeStamp, State);
+ }
+ public static Stream GeneratePdfPackageBulk(this DocumentTemplatePackage package, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, List DataObjectsIds)
+ {
+ return Interop.Pdf.PdfGenerator.GenerateBulkFromPackage(package, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjectsIds);
+ }
+ public static Stream GeneratePdfPackageBulk(this DocumentTemplatePackage package, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, List DataObjects)
+ {
+ return Interop.Pdf.PdfGenerator.GenerateBulkFromPackage(package, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjects);
+ }
+
+ public static List PdfPageHasAttachmentId(this DocumentTemplate dt, DiscoDataContext Database)
+ {
+ string templateFilename = dt.RepositoryFilename(Database);
+ if (!File.Exists(templateFilename))
+ throw new FileNotFoundException("PDF template not found", templateFilename);
+
+ PdfReader pdfReader = new PdfReader(templateFilename);
+ var result = new bool[pdfReader.NumberOfPages];
+ var fieldNames = pdfReader.AcroFields.Fields.Keys.Where(key => key.Equals("DiscoAttachmentId", StringComparison.OrdinalIgnoreCase)).ToList();
+ var fieldPositions = fieldNames.SelectMany(name => pdfReader.AcroFields.GetFieldPositions(name));
+ foreach (var fieldPosition in fieldPositions)
+ {
+ result[fieldPosition.page - 1] = true;
+ }
+ pdfReader.Close();
+ return result.ToList();
+ }
+
public static void Delete(this DocumentTemplate dt, DiscoDataContext Database)
{
// Find & Rename all references
diff --git a/Disco.BI/BI/Interop/Pdf/PdfGenerator.cs b/Disco.BI/BI/Interop/Pdf/PdfGenerator.cs
index d1a664e5..178be17c 100644
--- a/Disco.BI/BI/Interop/Pdf/PdfGenerator.cs
+++ b/Disco.BI/BI/Interop/Pdf/PdfGenerator.cs
@@ -21,8 +21,106 @@ namespace Disco.BI.Interop.Pdf
{
public static class PdfGenerator
{
+ public static Stream GenerateBulkFromPackage(DocumentTemplatePackage package, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, List DataObjects)
+ {
+ if (DataObjects.Count > 0)
+ {
+ List generatedPdfs = new List(DataObjects.Count);
+ using (var state = DocumentState.DefaultState())
+ {
+ foreach (var d in DataObjects)
+ {
+ generatedPdfs.Add(package.GeneratePdfPackage(Database, d, CreatorUser, Timestamp, state));
+ state.SequenceNumber++;
+ state.FlushScopeCache();
+ }
+ }
+ if (generatedPdfs.Count == 1)
+ {
+ return generatedPdfs[0];
+ }
+ else
+ {
+ Stream bulkPdf = Utilities.JoinPdfs(InsertBlankPages, generatedPdfs);
+ foreach (Stream singlePdf in generatedPdfs)
+ singlePdf.Dispose();
+ return bulkPdf;
+ }
+ }
+ return null;
+ }
- public static Stream GenerateBulkFromTemplate(DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, System.DateTime Timestamp, params IAttachmentTarget[] DataObjects)
+ public static Stream GenerateBulkFromPackage(DocumentTemplatePackage package, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, List DataObjectsIds)
+ {
+ List DataObjects;
+
+ switch (package.Scope)
+ {
+ case AttachmentTypes.Device:
+ DataObjects = Database.Devices.Where(d => DataObjectsIds.Contains(d.SerialNumber)).ToList();
+ break;
+ case AttachmentTypes.Job:
+ int[] intDataObjectsIds = DataObjectsIds.Select(i => int.Parse(i)).ToArray();
+ DataObjects = Database.Jobs.Where(j => intDataObjectsIds.Contains(j.Id)).ToList();
+ break;
+ case AttachmentTypes.User:
+ DataObjects = new List(DataObjectsIds.Count);
+ for (int idIndex = 0; idIndex < DataObjectsIds.Count; idIndex++)
+ {
+ string dataObjectId = DataObjectsIds[idIndex];
+ var user = UserService.GetUser(ActiveDirectory.ParseDomainAccountId(dataObjectId), Database, true);
+ if (user == null)
+ throw new Exception($"Unknown Username specified: {dataObjectId}");
+ DataObjects.Add(user);
+ }
+ break;
+ default:
+ throw new InvalidOperationException("Invalid DocumentType Scope");
+ }
+
+ return GenerateBulkFromPackage(package, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjects);
+ }
+
+ public static Stream GenerateFromPackage(DocumentTemplatePackage package, DiscoDataContext Database, IAttachmentTarget Data, User CreatorUser, DateTime Timestamp, DocumentState State)
+ {
+ var templates = package.GetDocumentTemplates(Database);
+
+ if (templates.Count == 0)
+ return null;
+
+ bool generateExpression = !string.IsNullOrEmpty(package.OnGenerateExpression);
+ string generateExpressionResult = null;
+
+ if (generateExpression)
+ generateExpressionResult = package.EvaluateOnGenerateExpression(Data, Database, CreatorUser, Timestamp, State);
+
+ List generatedPdfs = new List(templates.Count);
+ foreach (var template in templates)
+ {
+ generatedPdfs.Add(template.GeneratePdf(Database, Data, CreatorUser, Timestamp, State, true));
+
+ State.SequenceNumber++;
+ State.FlushScopeCache();
+ }
+
+ if (generateExpression)
+ DocumentsLog.LogDocumentPackageGenerated(package, Data, CreatorUser, generateExpressionResult);
+ else
+ DocumentsLog.LogDocumentPackageGenerated(package, Data, CreatorUser);
+
+ if (generatedPdfs.Count == 1)
+ {
+ return generatedPdfs[0];
+ }
+ else
+ {
+ Stream bulkPdf = Utilities.JoinPdfs(package.InsertBlankPages, generatedPdfs);
+ foreach (Stream singlePdf in generatedPdfs)
+ singlePdf.Dispose();
+ return bulkPdf;
+ }
+ }
+ public static Stream GenerateBulkFromTemplate(DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, params IAttachmentTarget[] DataObjects)
{
if (DataObjects.Length > 0)
{
@@ -42,7 +140,7 @@ namespace Disco.BI.Interop.Pdf
}
else
{
- Stream bulkPdf = Utilities.JoinPdfs(generatedPdfs.ToArray());
+ Stream bulkPdf = Utilities.JoinPdfs(InsertBlankPages, generatedPdfs);
foreach (Stream singlePdf in generatedPdfs)
singlePdf.Dispose();
return bulkPdf;
@@ -51,7 +149,7 @@ namespace Disco.BI.Interop.Pdf
return null;
}
- public static Stream GenerateBulkFromTemplate(DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, params string[] DataObjectsIds)
+ public static Stream GenerateBulkFromTemplate(DocumentTemplate dt, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, params string[] DataObjectsIds)
{
IAttachmentTarget[] DataObjects;
@@ -72,14 +170,14 @@ namespace Disco.BI.Interop.Pdf
DataObjects[idIndex] = UserService.GetUser(ActiveDirectory.ParseDomainAccountId(dataObjectId), Database, true);
if (DataObjects[idIndex] == null)
- throw new Exception(string.Format("Unknown Username specified: {0}", dataObjectId));
+ throw new Exception($"Unknown Username specified: {dataObjectId}");
}
break;
default:
throw new InvalidOperationException("Invalid DocumentType Scope");
}
- return GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, DataObjects);
+ return GenerateBulkFromTemplate(dt, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjects);
}
public static Stream GenerateFromTemplate(DocumentTemplate dt, DiscoDataContext Database, IAttachmentTarget Data, User CreatorUser, DateTime TimeStamp, DocumentState State, bool FlattenFields = false)
diff --git a/Disco.BI/BI/Interop/Pdf/Utilities.cs b/Disco.BI/BI/Interop/Pdf/Utilities.cs
index 3a46edbf..e2e4c8bd 100644
--- a/Disco.BI/BI/Interop/Pdf/Utilities.cs
+++ b/Disco.BI/BI/Interop/Pdf/Utilities.cs
@@ -1,41 +1,50 @@
using iTextSharp.text;
using iTextSharp.text.pdf;
+using System.Collections.Generic;
+using System.IO;
namespace Disco.BI.Interop.Pdf
{
public static class Utilities
{
- public static System.IO.Stream JoinPdfs(params System.IO.Stream[] Pdfs)
+ public static Stream JoinPdfs(bool InsertBlankPages, List Pdfs)
{
- if (Pdfs.Length == 0)
- throw new System.ArgumentNullException("Pdfs");
+ if (Pdfs.Count == 0)
+ throw new System.ArgumentNullException(nameof(Pdfs));
// Only One PDF - Possible Reference Bug v's Memory/Speed (Returning Param Memory Stream)
- if (Pdfs.Length == 1)
+ if (Pdfs.Count == 1)
return Pdfs[0];
// Join Pdfs
- System.IO.MemoryStream msBuilder = new System.IO.MemoryStream();
-
- Document pdfDoc = new Document();
- PdfCopy pdfCopy = new PdfCopy(pdfDoc, msBuilder);
+ var msBuilder = new MemoryStream();
+
+ var pdfLastPageSize = PageSize.A4;
+ var pdfDoc = new Document();
+ var pdfCopy = new PdfSmartCopy(pdfDoc, msBuilder);
pdfDoc.Open();
pdfCopy.CloseStream = false;
- for (int i = 0; i < Pdfs.Length; i++)
+ for (int i = 0; i < Pdfs.Count; i++)
{
- System.IO.Stream pdf = Pdfs[i];
- PdfReader pdfReader = new PdfReader(pdf);
+ var pdf = Pdfs[i];
+ var pdfReader = new PdfReader(pdf);
for (int indexPage = 1; indexPage <= pdfReader.NumberOfPages; indexPage++)
{
- iTextSharp.text.Rectangle pageSize = pdfReader.GetPageSizeWithRotation(indexPage);
- PdfImportedPage page = pdfCopy.GetImportedPage(pdfReader, indexPage);
- pdfDoc.SetPageSize(pageSize);
+ pdfLastPageSize = pdfReader.GetPageSizeWithRotation(indexPage);
+ var page = pdfCopy.GetImportedPage(pdfReader, indexPage);
+ pdfDoc.SetPageSize(pdfLastPageSize);
pdfDoc.NewPage();
pdfCopy.AddPage(page);
}
+ if (InsertBlankPages && (pdfCopy.PageNumber % 2) != 0)
+ {
+ pdfDoc.NewPage();
+ pdfCopy.AddPage(pdfLastPageSize, 0);
+ }
+
pdfReader.Close();
}
diff --git a/Disco.Data/Configuration/Modules/DocumentsConfiguration.cs b/Disco.Data/Configuration/Modules/DocumentsConfiguration.cs
new file mode 100644
index 00000000..e8cd960c
--- /dev/null
+++ b/Disco.Data/Configuration/Modules/DocumentsConfiguration.cs
@@ -0,0 +1,19 @@
+using Disco.Data.Repository;
+using Disco.Models.Services.Documents;
+using System.Collections.Generic;
+
+namespace Disco.Data.Configuration.Modules
+{
+ public class DocumentsConfiguration : ConfigurationBase
+ {
+ public DocumentsConfiguration(DiscoDataContext Database) : base(Database) { }
+
+ public override string Scope { get { return "Documents"; } }
+
+ public List Packages
+ {
+ get { return Get>(null); }
+ set { Set(value); }
+ }
+ }
+}
diff --git a/Disco.Data/Configuration/SystemConfiguration.cs b/Disco.Data/Configuration/SystemConfiguration.cs
index 60b6d7e1..8b2bb1f9 100644
--- a/Disco.Data/Configuration/SystemConfiguration.cs
+++ b/Disco.Data/Configuration/SystemConfiguration.cs
@@ -11,12 +11,13 @@ namespace Disco.Data.Configuration
: base(Database)
{
// Init Modules
- this.moduleBootstrapperConfiguration = new Lazy(() => new Modules.BootstrapperConfiguration(Database));
- this.moduleDeviceProfilesConfiguration = new Lazy(() => new Modules.DeviceProfilesConfiguration(Database));
- this.moduleOrganisationAddressesConfiguration = new Lazy(() => new Modules.OrganisationAddressesConfiguration(Database));
- this.moduleJobPreferencesConfiguration = new Lazy(() => new Modules.JobPreferencesConfiguration(Database));
- this.moduleActiveDirectoryConfiguration = new Lazy(() => new Modules.ActiveDirectoryConfiguration(Database));
- this.moduleDevicesConfiguration = new Lazy(() => new Modules.DevicesConfiguration(Database));
+ moduleBootstrapperConfiguration = new Lazy(() => new Modules.BootstrapperConfiguration(Database));
+ moduleDeviceProfilesConfiguration = new Lazy(() => new Modules.DeviceProfilesConfiguration(Database));
+ moduleOrganisationAddressesConfiguration = new Lazy(() => new Modules.OrganisationAddressesConfiguration(Database));
+ moduleJobPreferencesConfiguration = new Lazy(() => new Modules.JobPreferencesConfiguration(Database));
+ moduleActiveDirectoryConfiguration = new Lazy(() => new Modules.ActiveDirectoryConfiguration(Database));
+ moduleDevicesConfiguration = new Lazy(() => new Modules.DevicesConfiguration(Database));
+ moduleDocumentsConfiguration = new Lazy(() => new Modules.DocumentsConfiguration(Database));
}
#region Configuration Modules
@@ -27,6 +28,7 @@ namespace Disco.Data.Configuration
private Lazy moduleJobPreferencesConfiguration;
private Lazy moduleActiveDirectoryConfiguration;
private Lazy moduleDevicesConfiguration;
+ private Lazy moduleDocumentsConfiguration;
public Modules.BootstrapperConfiguration Bootstrapper
{
@@ -71,6 +73,14 @@ namespace Disco.Data.Configuration
}
}
+ public Modules.DocumentsConfiguration Documents
+ {
+ get
+ {
+ return moduleDocumentsConfiguration.Value;
+ }
+ }
+
#endregion
public override string Scope { get { return "System"; } }
@@ -79,7 +89,7 @@ namespace Disco.Data.Configuration
{
get
{
- var result = this.Get(null);
+ var result = Get(null);
if (result == null)
{
var appDataPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");
@@ -102,7 +112,7 @@ namespace Disco.Data.Configuration
storePath = value;
else
storePath = string.Concat(value, '\\');
- this.Set(storePath);
+ Set(storePath);
}
}
@@ -110,7 +120,7 @@ namespace Disco.Data.Configuration
{
get
{
- return this.Get("Domain Admins,Disco Admins");
+ return Get("Domain Admins,Disco Admins");
}
set
{
@@ -123,21 +133,21 @@ namespace Disco.Data.Configuration
{
get
{
- return System.IO.Path.Combine(this.DataStoreLocation, @"Plugins\");
+ return System.IO.Path.Combine(DataStoreLocation, @"Plugins\");
}
}
public string PluginStorageLocation
{
get
{
- return System.IO.Path.Combine(this.DataStoreLocation, @"PluginStorage\");
+ return System.IO.Path.Combine(DataStoreLocation, @"PluginStorage\");
}
}
public string PluginPackagesLocation
{
get
{
- return System.IO.Path.Combine(this.DataStoreLocation, @"PluginPackages\");
+ return System.IO.Path.Combine(DataStoreLocation, @"PluginPackages\");
}
}
#endregion
@@ -155,7 +165,7 @@ namespace Disco.Data.Configuration
{
get
{
- var path = this.OrganisationLogoPath;
+ var path = OrganisationLogoPath;
if (File.Exists(path))
return File.GetLastWriteTimeUtc(path).ToBinary().ToString();
else
@@ -166,7 +176,7 @@ namespace Disco.Data.Configuration
{
get
{
- var path = this.OrganisationLogoPath;
+ var path = OrganisationLogoPath;
if (File.Exists(path))
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
else
@@ -174,7 +184,7 @@ namespace Disco.Data.Configuration
}
set
{
- string organisationLogoPath = this.OrganisationLogoPath;
+ string organisationLogoPath = OrganisationLogoPath;
if (value == null)
{
if (System.IO.File.Exists(organisationLogoPath))
@@ -194,22 +204,22 @@ namespace Disco.Data.Configuration
{
get
{
- return this.Get(null);
+ return Get(null);
}
set
{
- this.Set(value);
+ Set(value);
}
}
public bool MultiSiteMode
{
get
{
- return this.Get(false);
+ return Get(false);
}
set
{
- this.Set(value);
+ Set(value);
}
}
#endregion
@@ -219,44 +229,44 @@ namespace Disco.Data.Configuration
{
get
{
- return this.Get(null);
+ return Get(null);
}
set
{
- this.Set(value);
+ Set(value);
}
}
public int ProxyPort
{
get
{
- return this.Get(8080);
+ return Get(8080);
}
set
{
- this.Set(value);
+ Set(value);
}
}
public string ProxyUsername
{
get
{
- return this.Get(null);
+ return Get(null);
}
set
{
- this.Set(value);
+ Set(value);
}
}
public string ProxyPassword
{
get
{
- return this.GetDeobsfucated(null);
+ return GetDeobsfucated(null);
}
set
{
- this.SetObsfucated(value);
+ SetObsfucated(value);
}
}
#endregion
@@ -266,14 +276,14 @@ namespace Disco.Data.Configuration
{
get
{
- return this.Get(null);
+ return Get(null);
}
}
public string DeploymentSecret
{
get
{
- return this.Get(null);
+ return Get(null);
}
}
public short DeploymentChecksum
@@ -296,25 +306,25 @@ namespace Disco.Data.Configuration
{
get
{
- return this.Get(null);
+ return Get(null);
}
set
{
- this.Set(value);
+ Set(value);
}
}
public bool UpdateBetaDeployment
{
get
{
- return this.Get(false);
+ return Get(false);
}
}
public Version InstalledDatabaseVersion
{
get
{
- var versionString = this.Get(null);
+ var versionString = Get(null);
if (string.IsNullOrEmpty(versionString))
return null;
else
@@ -322,7 +332,7 @@ namespace Disco.Data.Configuration
}
set
{
- this.Set(value.ToString(4));
+ Set(value.ToString(4));
}
}
#endregion
diff --git a/Disco.Data/Disco.Data.csproj b/Disco.Data/Disco.Data.csproj
index f1445a74..338ae8b6 100644
--- a/Disco.Data/Disco.Data.csproj
+++ b/Disco.Data/Disco.Data.csproj
@@ -77,6 +77,7 @@
+
diff --git a/Disco.Models/Disco.Models.csproj b/Disco.Models/Disco.Models.csproj
index c1d8b420..82d54838 100644
--- a/Disco.Models/Disco.Models.csproj
+++ b/Disco.Models/Disco.Models.csproj
@@ -60,6 +60,7 @@
+
@@ -157,10 +158,12 @@
+
+
diff --git a/Disco.Models/Repository/DocumentTemplate/DocumentTemplate.cs b/Disco.Models/Repository/DocumentTemplate/DocumentTemplate.cs
index cdc2cdf6..9e2611bf 100644
--- a/Disco.Models/Repository/DocumentTemplate/DocumentTemplate.cs
+++ b/Disco.Models/Repository/DocumentTemplate/DocumentTemplate.cs
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Text;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
diff --git a/Disco.Models/Services/Documents/DocumentTemplatePackage.cs b/Disco.Models/Services/Documents/DocumentTemplatePackage.cs
new file mode 100644
index 00000000..15c6c1e3
--- /dev/null
+++ b/Disco.Models/Services/Documents/DocumentTemplatePackage.cs
@@ -0,0 +1,31 @@
+using Disco.Models.Repository;
+using System.Collections.Generic;
+using System.ComponentModel.DataAnnotations;
+
+namespace Disco.Models.Services.Documents
+{
+ public class DocumentTemplatePackage
+ {
+ [Key, StringLength(30), Required]
+ public string Id { get; set; }
+ [StringLength(250), Required]
+ public string Description { get; set; }
+ [Required]
+ public AttachmentTypes Scope { get; set; }
+ public List JobSubTypes { get; set; }
+
+ public List DocumentTemplateIds { get; set; }
+
+ [DataType(DataType.MultilineText)]
+ public string FilterExpression { get; set; }
+ [DataType(DataType.MultilineText)]
+ public string OnGenerateExpression { get; set; }
+
+ public bool IsHidden { get; set; }
+
+ ///
+ /// Indicates blank pages should be added so that documents will be separated when duplex printed.
+ ///
+ public bool InsertBlankPages { get; set; }
+ }
+}
diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreateModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreateModel.cs
index bede3e76..68fb7615 100644
--- a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreateModel.cs
+++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreateModel.cs
@@ -1,24 +1,20 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
namespace Disco.Models.UI.Config.DocumentTemplate
{
public interface ConfigDocumentTemplateCreateModel : BaseUIModel
{
- Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
+ Repository.DocumentTemplate DocumentTemplate { get; set; }
List Types { get; set; }
List SubTypes { get; set; }
- List JobTypes { get; set; }
- List JobSubTypes { get; set; }
+ List JobTypes { get; set; }
+ List JobSubTypes { get; set; }
List Scopes { get; }
- List GetJobTypes { get; }
- List GetJobSubTypes { get; }
+ List GetJobTypes { get; }
+ List GetJobSubTypes { get; }
}
}
diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreatePackageModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreatePackageModel.cs
new file mode 100644
index 00000000..86f1c795
--- /dev/null
+++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateCreatePackageModel.cs
@@ -0,0 +1,12 @@
+using Disco.Models.Services.Documents;
+using System.Collections.Generic;
+
+namespace Disco.Models.UI.Config.DocumentTemplate
+{
+ public interface ConfigDocumentTemplateCreatePackageModel : BaseUIModel
+ {
+ DocumentTemplatePackage Package { get; set; }
+
+ List Scopes { get; }
+ }
+}
diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateIndexModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateIndexModel.cs
index 25502fe6..14580800 100644
--- a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateIndexModel.cs
+++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateIndexModel.cs
@@ -1,9 +1,12 @@
-using System.Collections.Generic;
+using Disco.Models.Services.Documents;
+using System.Collections.Generic;
namespace Disco.Models.UI.Config.DocumentTemplate
{
public interface ConfigDocumentTemplateIndexModel : BaseUIModel
{
Dictionary DocumentTemplates { get; set; }
+
+ List Packages { get; set; }
}
}
diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowModel.cs
index e91fe8b5..70c41456 100644
--- a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowModel.cs
+++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowModel.cs
@@ -1,17 +1,15 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Collections.Generic;
namespace Disco.Models.UI.Config.DocumentTemplate
{
public interface ConfigDocumentTemplateShowModel : BaseUIModel
{
- Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
+ Repository.DocumentTemplate DocumentTemplate { get; set; }
int StoredInstanceCount { get; set; }
+ List TemplatePagesHaveAttachmentId { get; set; }
+ int TemplatePageCount { get; }
- List JobTypes { get; set; }
+ List JobTypes { get; set; }
List Scopes { get; }
}
diff --git a/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowPackageModel.cs b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowPackageModel.cs
new file mode 100644
index 00000000..d0f722ea
--- /dev/null
+++ b/Disco.Models/UI/Config/DocumentTemplate/ConfigDocumentTemplateShowPackageModel.cs
@@ -0,0 +1,18 @@
+using Disco.Models.Repository;
+using Disco.Models.Services.Documents;
+using System.Collections.Generic;
+
+namespace Disco.Models.UI.Config.DocumentTemplate
+{
+ public interface ConfigDocumentTemplateShowPackageModel : BaseUIModel
+ {
+ DocumentTemplatePackage Package { get; set; }
+ List JobSubTypesSelected { get; set; }
+ List DocumentTemplates { get; set; }
+ List DocumentTemplatesSelected { get; set; }
+
+ List JobTypes { get; set; }
+
+ List Scopes { get; }
+ }
+}
diff --git a/Disco.Models/UI/Device/DeviceShowModel.cs b/Disco.Models/UI/Device/DeviceShowModel.cs
index 3a7abaab..bfa52840 100644
--- a/Disco.Models/UI/Device/DeviceShowModel.cs
+++ b/Disco.Models/UI/Device/DeviceShowModel.cs
@@ -1,4 +1,5 @@
using Disco.Models.BI.Config;
+using Disco.Models.Services.Documents;
using Disco.Models.Services.Jobs.JobLists;
using System.Collections.Generic;
@@ -18,5 +19,6 @@ namespace Disco.Models.UI.Device
List Certificates { get; set; }
List DocumentTemplates { get; set; }
+ List DocumentTemplatePackages { get; set; }
}
}
diff --git a/Disco.Models/UI/Job/JobShowModel.cs b/Disco.Models/UI/Job/JobShowModel.cs
index 229a3002..ab20c850 100644
--- a/Disco.Models/UI/Job/JobShowModel.cs
+++ b/Disco.Models/UI/Job/JobShowModel.cs
@@ -1,4 +1,5 @@
-using Disco.Models.Services.Job;
+using Disco.Models.Services.Documents;
+using Disco.Models.Services.Job;
using Disco.Models.Services.Jobs.JobLists;
using System;
using System.Collections.Generic;
@@ -10,6 +11,7 @@ namespace Disco.Models.UI.Job
Repository.Job Job { get; set; }
TimeSpan? LongRunning { get; set; }
List AvailableDocumentTemplates { get; set; }
+ List AvailableDocumentTemplatePackages { get; set; }
List UpdatableJobSubTypes { get; set; }
List AvailableQueues { get; set; }
diff --git a/Disco.Models/UI/User/UserShowModel.cs b/Disco.Models/UI/User/UserShowModel.cs
index fbd7c607..acd25af8 100644
--- a/Disco.Models/UI/User/UserShowModel.cs
+++ b/Disco.Models/UI/User/UserShowModel.cs
@@ -1,5 +1,6 @@
using Disco.Models.Repository;
using Disco.Models.Services.Authorization;
+using Disco.Models.Services.Documents;
using Disco.Models.Services.Jobs.JobLists;
using System.Collections.Generic;
@@ -10,6 +11,7 @@ namespace Disco.Models.UI.User
Disco.Models.Repository.User User { get; set; }
JobTableModel Jobs { get; set; }
List DocumentTemplates { get; set; }
+ List DocumentTemplatePackages { get; set; }
List AvailableUserFlags { get; set; }
diff --git a/Disco.Services/Devices/DeviceExtensions.cs b/Disco.Services/Devices/DeviceExtensions.cs
index 69ef9714..d330f5f7 100644
--- a/Disco.Services/Devices/DeviceExtensions.cs
+++ b/Disco.Services/Devices/DeviceExtensions.cs
@@ -2,6 +2,7 @@
using Disco.Models.Repository;
using Disco.Models.Services.Documents;
using Disco.Services.Authorization;
+using Disco.Services.Documents;
using Disco.Services.Expressions;
using Disco.Services.Interop.ActiveDirectory;
using Disco.Services.Users;
@@ -54,6 +55,10 @@ namespace Disco.Services
return ats.Where(at => at.FilterExpressionMatches(d, Database, User, TimeStamp, DocumentState.DefaultState())).ToList();
}
+ public static List AvailableDocumentTemplatePackages(this Device d, DiscoDataContext Database, User TechnicianUser)
+ {
+ return DocumentTemplatePackages.AvailablePackages(d, Database, TechnicianUser);
+ }
public static bool UpdateLastNetworkLogonDate(this Device Device)
{
diff --git a/Disco.Services/Disco.Services.csproj b/Disco.Services/Disco.Services.csproj
index 6764e439..d42a2af0 100644
--- a/Disco.Services/Disco.Services.csproj
+++ b/Disco.Services/Disco.Services.csproj
@@ -281,9 +281,11 @@
+
+
diff --git a/Disco.Services/Documents/DocumentTemplateExpressionExtensions.cs b/Disco.Services/Documents/DocumentTemplateExpressionExtensions.cs
index 3bf5c757..9a8d2f0e 100644
--- a/Disco.Services/Documents/DocumentTemplateExpressionExtensions.cs
+++ b/Disco.Services/Documents/DocumentTemplateExpressionExtensions.cs
@@ -4,7 +4,6 @@ using Disco.Models.Services.Documents;
using Disco.Services.Documents;
using Disco.Services.Expressions;
using System;
-using System.Collections;
using System.Collections.Generic;
namespace Disco.Services
@@ -27,11 +26,11 @@ namespace Disco.Services
{
if (!string.IsNullOrEmpty(dt.FilterExpression))
{
- Expression compiledExpression = dt.FilterExpressionFromCache();
- System.Collections.IDictionary evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
+ var compiledExpression = dt.FilterExpressionFromCache();
+ var evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
try
{
- object er = compiledExpression.EvaluateFirst
\r\n");
- #line 14 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 15 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
else
{
- if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden))
+ if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden) || Model.Packages.Any(p => p.IsHidden))
{
@@ -95,27 +96,28 @@ WriteLiteral(" class=\"button small\"");
WriteLiteral(">Show Hidden (");
- #line 19 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
- Write(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden));
+ #line 20 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ Write(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden) + Model.Packages.Count(p => p.IsHidden));
#line default
#line hidden
WriteLiteral(")\r\n");
-WriteLiteral(@"
+WriteLiteral(@"
");
- #line 29 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 31 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -131,13 +133,13 @@ WriteLiteral(">\r\n \r\n | Id | \r\n De
" | Scope | \r\n Stored Instances | \r\n");
- #line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 38 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
- #line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 38 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (showTags)
{
@@ -147,7 +149,7 @@ WriteLiteral(">\r\n
\r\n | Id | \r\n De
WriteLiteral(" | | \r\n");
- #line 39 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -156,13 +158,13 @@ WriteLiteral(" | \r\n");
WriteLiteral("
\r\n");
- #line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
- #line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
foreach (var pair in Model.DocumentTemplates)
{
var item = pair.Key;
@@ -173,20 +175,20 @@ WriteLiteral(" \r\n");
#line hidden
WriteLiteral(" (item.IsHidden ? "hidden" : null
+ #line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+, Tuple.Create(Tuple.Create("", 2065), Tuple.Create(item.IsHidden ? "hidden" : null
#line default
#line hidden
-, 1806), false)
+, 2065), false)
);
WriteLiteral(">\r\n | ");
- #line 46 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 48 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id)));
@@ -195,7 +197,7 @@ WriteLiteral(">\r\n | ");
WriteLiteral(" | \r\n ");
- #line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 49 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Description));
@@ -204,7 +206,7 @@ WriteLiteral(" | \r\n ");
WriteLiteral(" | \r\n ");
- #line 48 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.DisplayFor(modelItem => item.Scope));
@@ -213,7 +215,7 @@ WriteLiteral(" | \r\n ");
WriteLiteral(" | \r\n ");
- #line 49 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 51 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(storedCount.ToString("N0"));
@@ -222,13 +224,13 @@ WriteLiteral(" | \r\n ");
WriteLiteral(" | \r\n");
- #line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 52 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
- #line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 52 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (showTags)
{
@@ -238,13 +240,13 @@ WriteLiteral("\r\n");
WriteLiteral(" \r\n");
- #line 53 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 55 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
- #line 53 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 55 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (item.DevicesLinkedGroup != null || item.UsersLinkedGroup != null)
{
@@ -260,7 +262,7 @@ WriteLiteral(" title=\"Is Linked\"");
WriteLiteral(">\r\n");
- #line 56 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 58 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -269,7 +271,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
- #line 57 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 59 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (item.FilterExpression != null || item.OnGenerateExpression != null || item.OnImportAttachmentExpression != null)
{
@@ -285,7 +287,7 @@ WriteLiteral(" title=\"Has Expressions\"");
WriteLiteral(">\r\n");
- #line 60 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 62 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -294,7 +296,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
- #line 61 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 63 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (item.IsHidden)
{
@@ -310,7 +312,7 @@ WriteLiteral(" title=\"Is Hidden\"");
WriteLiteral(">\r\n");
- #line 64 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 66 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -319,7 +321,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" | \r\n");
- #line 66 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 68 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -328,7 +330,7 @@ WriteLiteral(" \r\n");
WriteLiteral("
\r\n");
- #line 68 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 70 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -337,7 +339,202 @@ WriteLiteral(" \r\n");
WriteLiteral(" \r\n");
- #line 70 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 72 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (Model.Packages.Count > 0)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" Document Template Packages
\r\n");
+
+WriteLiteral(" \r\n \r\n | Id | \r\n Description" +
+" | \r\n Scope | \r\n Document Templates\r\n");
+
+
+ #line 81 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+
+
+ #line default
+ #line hidden
+
+ #line 81 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (showTags)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | | \r\n");
+
+
+ #line 84 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral("
\r\n");
+
+
+ #line 86 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+
+
+ #line default
+ #line hidden
+
+ #line 86 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ foreach (var package in Model.Packages.OrderBy(p => p.Id))
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" (package.IsHidden ? "hidden" : null
+
+ #line default
+ #line hidden
+, 3897), false)
+);
+
+WriteLiteral(">\r\n | ");
+
+
+ #line 89 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ Write(Html.ActionLink(package.Id.ToString(), MVC.Config.DocumentTemplate.ShowPackage(package.Id)));
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | \r\n ");
+
+
+ #line 90 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ Write(Html.DisplayFor(modelItem => package.Description));
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | \r\n ");
+
+
+ #line 91 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ Write(Html.DisplayFor(modelItem => package.Scope));
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | \r\n");
+
+
+ #line 92 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+
+
+ #line default
+ #line hidden
+
+ #line 92 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (showTags)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" \r\n");
+
+
+ #line 95 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+
+
+ #line default
+ #line hidden
+
+ #line 95 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (package.FilterExpression != null || package.OnGenerateExpression != null)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" \r\n");
+
+
+ #line 98 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral(" ");
+
+
+ #line 99 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (package.IsHidden)
+ {
+
+
+ #line default
+ #line hidden
+WriteLiteral(" \r\n");
+
+
+ #line 102 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral(" | \r\n");
+
+
+ #line 104 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral("
\r\n");
+
+
+ #line 106 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral("
\r\n");
+
+
+ #line 108 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ }
}
@@ -350,13 +547,13 @@ WriteLiteral(" class=\"actionBar\"");
WriteLiteral(">\r\n");
- #line 72 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 111 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
#line default
#line hidden
- #line 72 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 111 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
{
@@ -364,14 +561,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 74 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 113 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages()));
#line default
#line hidden
- #line 74 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 113 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -381,7 +578,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
- #line 76 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 115 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
{
@@ -389,14 +586,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 78 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 117 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus()));
#line default
#line hidden
- #line 78 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 117 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -406,7 +603,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 80 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 119 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.Has(Claims.Config.Show))
{
@@ -414,14 +611,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 82 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 121 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
#line default
#line hidden
- #line 82 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 121 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
@@ -431,7 +628,32 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 84 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 123 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ if (Model.DocumentTemplates.Count > 2 && Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
+ {
+
+
+ #line default
+ #line hidden
+
+ #line 125 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ Write(Html.ActionLinkButton("Create Package", MVC.Config.DocumentTemplate.CreatePackage()));
+
+
+ #line default
+ #line hidden
+
+ #line 125 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral(" ");
+
+
+ #line 127 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
{
@@ -439,14 +661,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 86 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 129 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
#line default
#line hidden
- #line 86 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
+ #line 129 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
}
diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.cshtml b/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.cshtml
index 9d320807..e4320c39 100644
--- a/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.cshtml
+++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.cshtml
@@ -52,7 +52,7 @@
Id:
- @Html.DisplayFor(model => model.DocumentTemplate.Id)
+ @Html.DisplayFor(model => model.DocumentTemplate.Id)
|
@@ -70,30 +70,30 @@
|
@if (canConfig)
{
- @Html.TextBoxFor(model => model.DocumentTemplate.Description)
- @AjaxHelpers.AjaxSave()
- @AjaxHelpers.AjaxLoader()
-
+ @Html.TextBoxFor(model => model.DocumentTemplate.Description)
+ @AjaxHelpers.AjaxSave()
+ @AjaxHelpers.AjaxLoader()
+
}
else
{
- if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
- {
- <None Specified>
- }
- else
- {
- @Model.DocumentTemplate.Description
- }
+ if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
+ {
+ <None Specified>
+ }
+ else
+ {
+ @Model.DocumentTemplate.Description
+ }
}
|
@@ -105,24 +105,24 @@
@if (canConfig)
{
-
-
- @AjaxHelpers.AjaxLoader()
-
+
+
+ @AjaxHelpers.AjaxLoader()
+
}
else
{
-
-
+
+
}
@@ -148,150 +148,55 @@
@if (canConfig)
{
-
- @using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id, redirect: true)))
- {
-
-
-
-
- }
-
-
- Expressions within the Template PDF may need to be updated to reflect any changes to the Document Template Scope.
-
-
- @if (Model.DocumentTemplate.UsersLinkedGroup != null || Model.DocumentTemplate.DevicesLinkedGroup != null)
- {
-
-
- Warning: This Document Template contains Linked Groups, these will be automatically updated to reflect the new Document Template Scope which may result in undesired behaviour.
-
-
- }
-
-
- }
- @if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
- {
-
- Job Type Filters:
-
-
- @if (Model.DocumentTemplate.JobSubTypes.Count > 0)
+
+ @using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateScope(Model.DocumentTemplate.Id, redirect: true)))
{
-
- @foreach (var jobType in Model.DocumentTemplate.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
- {
- -
- @jobType.Key.Description
-
- @if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
+
+
+
- @if (canConfig)
- {
- Update
-
- @using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateJobSubTypes(Model.DocumentTemplate.Id, null, true)))
- {
- var selectedTypes = Model.DocumentTemplate.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
- foreach (var jt in Model.JobTypes)
- {
-
-
-
-
-
- @CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div")
- @CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.DocumentTemplate.JobSubTypes), 2)
+
-
}
+
+
+ Expressions within the Template PDF may need to be updated to reflect any changes to the Document Template Scope.
+
+
+ @if (Model.DocumentTemplate.UsersLinkedGroup != null || Model.DocumentTemplate.DevicesLinkedGroup != null)
+ {
+
+
+ Warning: This Document Template contains Linked Groups, these will be automatically updated to reflect the new Document Template Scope which may result in undesired behaviour.
+
+
}
-
- }
-
+ }
+ @if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.Job)
+ {
+
+
Job Type Filters:
+
+
+ @if (Model.DocumentTemplate.JobSubTypes.Count > 0)
+ {
+
+ @foreach (var jobType in Model.DocumentTemplate.JobSubTypes.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
+ {
+ -
+ @jobType.Key.Description
+
+ @if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
+ {
+ - [All Sub Types]
+ }
+ else
+ {
+ foreach (var jobSubType in jobType)
+ {
+ - @jobSubType.Description
+ }
+ }
+
+
+ }
+
+ }
+ else
+ {
+
<No Filter>
+ }
+
+ @if (canConfig)
+ {
+
Update
+
+ @using (Html.BeginForm(MVC.API.DocumentTemplate.UpdateJobSubTypes(Model.DocumentTemplate.Id, null, true)))
+ {
+ var selectedTypes = Model.DocumentTemplate.JobSubTypes.Select(jst => jst.JobType).Distinct().ToList();
+ foreach (var jt in Model.JobTypes)
+ {
+
+
+
+
+
+ @CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div")
+ @CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.DocumentTemplate.JobSubTypes), 2)
+
+
+ }
+ }
+
+
+ }
+
}
@@ -343,14 +343,14 @@
@AjaxHelpers.AjaxLoader()
}
else
@@ -383,62 +383,81 @@
@if (canConfig)
{
-
-
- @Html.ActionLinkSmallButton("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
- @if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
- {
-
-
- Select a PDF Template to upload:
-
- @using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
+
+
+ @if (Model.TemplatePagesHaveAttachmentId.Any(i => !i))
+ {
+
+ @for (int i = 0; i < Model.TemplatePagesHaveAttachmentId.Count; i++)
+ {
+ if (!Model.TemplatePagesHaveAttachmentId[i])
+ {
+
+ Note: Page @(i + 1) does not have a DiscoAttachmentId field.
+
+ }
+ }
+
+ The DiscoAttachmentId field is replaced with a unique QR Code which identifies the page when it is imported back into Disco ICT.
+
+
+ }
+
+ @Html.ActionLinkSmallButton("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
+ @if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
{
-
+
+
+ Select a PDF Template to upload:
+
+ @using (Html.BeginForm(MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id, true, null), FormMethod.Post, new { enctype = "multipart/form-data" }))
+ {
+
+ }
+
+
+
}
-
-
- }
- |
-
+ |
+
}
@@ -455,61 +474,61 @@
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
{
- @Html.EditorFor(model => model.DocumentTemplate.FilterExpression)
- @AjaxHelpers.AjaxRemove()
- @AjaxHelpers.AjaxSave()
- @AjaxHelpers.AjaxLoader()
-
+
}
else
{
- if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.FilterExpression))
- {
- <None Specified>
- }
- else
- {
-
- @Model.DocumentTemplate.FilterExpression
-
- }
+ if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.FilterExpression))
+ {
+ <None Specified>
+ }
+ else
+ {
+
+ @Model.DocumentTemplate.FilterExpression
+
+ }
}
@@ -525,61 +544,61 @@
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
{
- @Html.EditorFor(model => model.DocumentTemplate.OnGenerateExpression)
- @AjaxHelpers.AjaxRemove()
- @AjaxHelpers.AjaxSave()
- @AjaxHelpers.AjaxLoader()
-
+
}
else
{
- if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.OnGenerateExpression))
- {
- <None Specified>
- }
- else
- {
-
- @Model.DocumentTemplate.OnGenerateExpression
-
- }
+ if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.OnGenerateExpression))
+ {
+ <None Specified>
+ }
+ else
+ {
+
+ @Model.DocumentTemplate.OnGenerateExpression
+
+ }
}
@@ -595,61 +614,61 @@
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
{
- @Html.EditorFor(model => model.DocumentTemplate.OnImportAttachmentExpression)
- @AjaxHelpers.AjaxRemove()
- @AjaxHelpers.AjaxSave()
- @AjaxHelpers.AjaxLoader()
-
+
}
else
{
- if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.OnImportAttachmentExpression))
- {
- <None Specified>
- }
- else
- {
-
- @Model.DocumentTemplate.OnImportAttachmentExpression
-
- }
+ if (string.IsNullOrWhiteSpace(Model.DocumentTemplate.OnImportAttachmentExpression))
+ {
+ <None Specified>
+ }
+ else
+ {
+
+ @Model.DocumentTemplate.OnImportAttachmentExpression
+
+ }
}
@@ -665,26 +684,26 @@
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
- {
- CanConfigure = canConfig,
- CategoryDescription = DocumentTemplateUsersManagedGroup.GetCategoryDescription(Model.DocumentTemplate),
- Description = DocumentTemplateUsersManagedGroup.GetDescription(Model.DocumentTemplate),
- ManagedGroup = Model.UsersLinkedGroup,
- IncludeFilterBeginDate = true,
- UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateUsersLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
- })
+ {
+ CanConfigure = canConfig,
+ CategoryDescription = DocumentTemplateUsersManagedGroup.GetCategoryDescription(Model.DocumentTemplate),
+ Description = DocumentTemplateUsersManagedGroup.GetDescription(Model.DocumentTemplate),
+ ManagedGroup = Model.UsersLinkedGroup,
+ IncludeFilterBeginDate = true,
+ UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateUsersLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
+ })
@Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel()
- {
- CanConfigure = canConfig,
- CategoryDescription = DocumentTemplateDevicesManagedGroup.GetCategoryDescription(Model.DocumentTemplate),
- Description = DocumentTemplateDevicesManagedGroup.GetDescription(Model.DocumentTemplate),
- ManagedGroup = Model.DevicesLinkedGroup,
- IncludeFilterBeginDate = true,
- UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateDevicesLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
- })
+ {
+ CanConfigure = canConfig,
+ CategoryDescription = DocumentTemplateDevicesManagedGroup.GetCategoryDescription(Model.DocumentTemplate),
+ Description = DocumentTemplateDevicesManagedGroup.GetDescription(Model.DocumentTemplate),
+ ManagedGroup = Model.DevicesLinkedGroup,
+ IncludeFilterBeginDate = true,
+ UpdateUrl = Url.Action(MVC.API.DocumentTemplate.UpdateDevicesLinkedGroup(Model.DocumentTemplate.Id, redirect: true))
+ })
@if (canConfig)
{
- @Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)
+ @Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)
}
|
@@ -739,113 +758,119 @@
@if (hideAdvanced)
{
-
-
+
}
@if (Authorization.Has(Claims.Config.Show))
{
- @Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
+ @Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
}
@if (canBulkGenerate)
{
- Bulk Generate
-
-
- @switch (Model.DocumentTemplate.Scope)
+ Bulk Generate
+
+
+ @switch (Model.DocumentTemplate.Scope)
+ {
+ case "Device":
+
+ Enter multiple Device Serial Numbers separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ 01234567
+ ABCD9876
+ 8VQ6G2R
+
+ 01234567,ABCD9876,8VQ6G2R
+ 01234567;ABCD9876;8VQ6G2R
+
+ break;
+ case "Job":
+
+ Enter multiple Job Ids separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ 86
+ 99
+ 44
+
+ 86,99,44
+ 86;99;44
+
+ break;
+ case "User":
+
+ Enter multiple User Ids separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ user6
+ smi0099 @(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+
+ user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+ user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+
+ break;
+ }
+
+ @using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
{
- case "Device":
-
- Enter multiple Device Serial Numbers separated by <new line>, commas (,) or semicolons (;).
-
-
- Examples:
-
- 01234567
- ABCD9876
- 8VQ6G2R
-
- 01234567,ABCD9876,8VQ6G2R
- 01234567;ABCD9876;8VQ6G2R
-
- break;
- case "Job":
-
- Enter multiple Job Ids separated by <new line>, commas (,) or semicolons (;).
-
-
- Examples:
-
- 86
- 99
- 44
-
- 86,99,44
- 86;99;44
-
- break;
- case "User":
-
- Enter multiple User Ids separated by <new line>, commas (,) or semicolons (;).
-
-
- Examples:
-
- user6
- smi0099 @(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
-
- user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
- user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
-
- break;
+
+
+ if (Model.TemplatePageCount > 1 && Model.TemplatePageCount % 2 != 0)
+ {
+
+
+
+ }
}
- @using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
- {
-
-
- }
-
-
+
}
@if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
{
- @Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
+ @Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete")
}
diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.generated.cs b/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.generated.cs
index b1d8bad9..534588e4 100644
--- a/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.generated.cs
+++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/Show.generated.cs
@@ -129,20 +129,18 @@ WriteLiteral(" style=\"width: 650px; margin: 10px auto 20px;\"");
WriteLiteral(">\r\n \r\n \r\n \r\n " +
" | \r\n Id:\r\n | \r\n " +
-" \r\n");
-
-WriteLiteral(" ");
+" | \r\n ");
#line 55 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(Html.DisplayFor(model => model.DocumentTemplate.Id));
+ Write(Html.DisplayFor(model => model.DocumentTemplate.Id));
#line default
#line hidden
-WriteLiteral("\r\n | \r\n \r\n \r\n " +
-" | \r\n Statistics:\r\n | \r\n \r\n ");
+WriteLiteral("\r\n | \r\n \r\n \r\n" +
+" | \r\n Statistics:\r\n " +
+" | \r\n \r\n ");
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
@@ -174,85 +172,86 @@ WriteLiteral("\r\n | \r\n \r\n
#line 71 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
if (canConfig)
{
-
+
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));
+ Write(Html.TextBoxFor(model => model.DocumentTemplate.Description));
#line default
#line hidden
#line 73 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
-
+
+
#line default
#line hidden
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(AjaxHelpers.AjaxSave());
+ Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
-
+
+
#line default
#line hidden
#line 75 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(AjaxHelpers.AjaxLoader());
+ Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 75 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
+
#line default
#line hidden
-WriteLiteral(" \r\n");
+WriteLiteral("\',\r\n \'Description\'\r\n " +
+" );\r\n });\r\n " +
+" \r\n");
#line 86 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
}
else
{
- if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
- {
+ if (string.IsNullOrEmpty(Model.DocumentTemplate.Description))
+ {
#line default
#line hidden
-WriteLiteral(" <None Specified>\r\n");
#line 92 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- }
- else
- {
-
+ }
+ else
+ {
+
#line default
#line hidden
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(Model.DocumentTemplate.Description);
+ Write(Model.DocumentTemplate.Description);
#line default
#line hidden
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
- }
+
+ }
}
@@ -301,7 +300,7 @@ WriteLiteral(" \r\n \r\n
#line default
#line hidden
-WriteLiteral(" \r\n");
+WriteLiteral(" />\r\n");
-WriteLiteral(" \r\n");
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
+
#line default
#line hidden
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
- Write(AjaxHelpers.AjaxLoader());
+ Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
#line 110 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
-
+
#line default
#line hidden
-WriteLiteral(" \r\n");
+WriteLiteral("\',\r\n \'IsHidden\'\r\n " +
+" );\r\n });\r\n " +
+" \r\n");
#line 121 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
@@ -375,7 +374,7 @@ WriteLiteral("\',\r\n \'IsHidden\'\r\n
#line default
#line hidden
-WriteLiteral(" \r\n");
-WriteLiteral("
+
+
+
+
+
+
+
+ This item will be permanently deleted.
+ Are you sure?
+
+
+
+
+ @if (hideAdvanced)
+ {
+
+
+ }
+ @if (canBulkGenerate)
+ {
+ Bulk Generate
+
+
+ @switch (Model.Package.Scope)
+ {
+ case AttachmentTypes.Device:
+
+ Enter multiple Device Serial Numbers separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ 01234567
+ ABCD9876
+ 8VQ6G2R
+
+ 01234567,ABCD9876,8VQ6G2R
+ 01234567;ABCD9876;8VQ6G2R
+
+ break;
+ case AttachmentTypes.Job:
+
+ Enter multiple Job Ids separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ 86
+ 99
+ 44
+
+ 86,99,44
+ 86;99;44
+
+ break;
+ case AttachmentTypes.User:
+
+ Enter multiple User Ids separated by <new line>, commas (,) or semicolons (;).
+
+
+ Examples:
+
+ user6
+ smi0099 @(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+
+ user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+ user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
+
+ break;
+ }
+
+ @using (Html.BeginForm(MVC.API.DocumentTemplatePackage.BulkGenerate(Model.Package.Id), FormMethod.Post))
+ {
+
+
+
+ Insert Blank Pages for Double-Sided Printing
+
+ }
+
+
+
+ }
+ @if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
+ {
+ @Html.ActionLinkButton("Delete", MVC.API.DocumentTemplatePackage.Delete(Model.Package.Id, true), "buttonDelete")
+ }
+
diff --git a/Disco.Web/Areas/Config/Views/DocumentTemplate/ShowPackage1.generated.cs b/Disco.Web/Areas/Config/Views/DocumentTemplate/ShowPackage1.generated.cs
new file mode 100644
index 00000000..aeb3455b
--- /dev/null
+++ b/Disco.Web/Areas/Config/Views/DocumentTemplate/ShowPackage1.generated.cs
@@ -0,0 +1,2379 @@
+#pragma warning disable 1591
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace Disco.Web.Areas.Config.Views.DocumentTemplate
+{
+ using System;
+ using System.Collections.Generic;
+ using System.IO;
+ using System.Linq;
+ using System.Net;
+ using System.Text;
+ using System.Web;
+ using System.Web.Helpers;
+ using System.Web.Mvc;
+ using System.Web.Mvc.Ajax;
+ using System.Web.Mvc.Html;
+ using System.Web.Routing;
+ using System.Web.Security;
+ using System.Web.UI;
+ using System.Web.WebPages;
+ using Disco;
+ using Disco.Models.Repository;
+ using Disco.Services;
+ using Disco.Services.Authorization;
+
+ #line 2 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
+ using Disco.Services.Interop.ActiveDirectory;
+
+ #line default
+ #line hidden
+ using Disco.Services.Web;
+ using Disco.Web;
+ using Disco.Web.Extensions;
+
+ [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
+ [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/ShowPackage.cshtml")]
+ public partial class ShowPackage : Disco.Services.Web.WebViewPage
+ {
+ public ShowPackage()
+ {
+ }
+ public override void Execute()
+ {
+
+ #line 3 "..\..\Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml"
+
+ Authorization.Require(Claims.Config.DocumentTemplate.Show);
+
+ var canConfig = Authorization.Has(Claims.Config.DocumentTemplate.Configure);
+
+ var hideAdvanced =
+ Model.Package.FilterExpression == null &&
+ Model.Package.OnGenerateExpression == null;
+
+ #region Can Bulk Generate
+ var canBulkGenerate = Authorization.Has(Claims.Config.DocumentTemplate.BulkGenerate);
+ if (canBulkGenerate)
+ {
+ switch (Model.Package.Scope)
+ {
+ case AttachmentTypes.Device:
+ canBulkGenerate = Authorization.Has(Claims.Device.Actions.GenerateDocuments);
+ break;
+ case AttachmentTypes.Job:
+ canBulkGenerate = Authorization.Has(Claims.Job.Actions.GenerateDocuments);
+ break;
+ case AttachmentTypes.User:
+ canBulkGenerate = Authorization.Has(Claims.User.Actions.GenerateDocuments);
+ break;
+ default:
+ throw new InvalidOperationException("Invalid Package Scope");
+ }
+ }
+ #endregion
+
+ ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Package: " + Model.Package.Description);
+
+ if (canConfig)
+ {
+ Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
+ }
+
+
+ #line default
+ #line hidden
+WriteLiteral("\r\n(hideAdvanced ? " Config_HideAdvanced" : null
+
+ #line default
+ #line hidden
+, 1585), false)
+);
+
+WriteLiteral(">\r\n | \r\n <
#line default
#line hidden
- #line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 391 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true), "Device_Show_Policies_Profile_Actions_Update_Button"));
#line default
#line hidden
- #line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 391 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
@@ -1492,13 +1506,13 @@ WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
- #line 390 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 396 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
#line default
#line hidden
- #line 390 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 396 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
{
@@ -1513,7 +1527,7 @@ WriteLiteral(" type=\"radio\"");
WriteLiteral(" data-deviceprofileid=\"");
- #line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(dp.Id);
@@ -1523,45 +1537,45 @@ WriteLiteral("\"");
WriteLiteral(" name=\"DeviceProfile\"");
-WriteAttribute("id", Tuple.Create(" id=\"", 24364), Tuple.Create("\"", 24391)
-, Tuple.Create(Tuple.Create("", 24369), Tuple.Create("DeviceProfile_", 24369), true)
+WriteAttribute("id", Tuple.Create(" id=\"", 24835), Tuple.Create("\"", 24862)
+, Tuple.Create(Tuple.Create("", 24840), Tuple.Create("DeviceProfile_", 24840), true)
- #line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 24383), Tuple.Create (dp.Id
+ #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 24854), Tuple.Create(dp.Id
#line default
#line hidden
-, 24383), false)
+, 24854), false)
);
WriteLiteral(" />(dp.Id
+ #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 24892), Tuple.Create(dp.Id
#line default
#line hidden
-, 24421), false)
+, 24892), false)
);
-WriteAttribute("title", Tuple.Create(" title=\"", 24430), Tuple.Create("\"", 24474)
-, Tuple.Create(Tuple.Create("", 24438), Tuple.Create("Distribution:", 24438), true)
+WriteAttribute("title", Tuple.Create(" title=\"", 24901), Tuple.Create("\"", 24945)
+, Tuple.Create(Tuple.Create("", 24909), Tuple.Create("Distribution:", 24909), true)
- #line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create(" ", 24451), Tuple.Create(dp.DistributionType
+ #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create(" ", 24922), Tuple.Create(dp.DistributionType
#line default
#line hidden
-, 24452), false)
+, 24923), false)
);
WriteLiteral(">");
- #line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 399 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(dp.Name);
@@ -1570,7 +1584,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 395 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 401 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -1583,7 +1597,7 @@ WriteLiteral(" \r\n");
- #line 748 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 754 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -2456,7 +2470,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 749 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
if (Model.Device.CanUpdateUntrustEnrol())
{
@@ -2464,14 +2478,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 751 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 757 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button"));
#line default
#line hidden
- #line 751 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 757 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
@@ -2542,7 +2556,7 @@ WriteLiteral(@">
");
- #line 791 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 797 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -2551,7 +2565,7 @@ WriteLiteral(@">
WriteLiteral(" ");
- #line 792 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 798 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
if (Model.Device.CanDecommission())
{
@@ -2559,14 +2573,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 794 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 800 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));
#line default
#line hidden
- #line 794 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 800 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
@@ -2598,13 +2612,13 @@ WriteLiteral(" class=\"none\"");
WriteLiteral(">\r\n");
- #line 801 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 807 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
#line default
#line hidden
- #line 801 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 807 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString()))
{
@@ -2615,34 +2629,34 @@ WriteLiteral(" \r\n
WriteLiteral(" type=\"radio\"");
-WriteAttribute("id", Tuple.Create(" id=\"", 48980), Tuple.Create("\"", 49058)
-, Tuple.Create(Tuple.Create("", 48985), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 48985), true)
+WriteAttribute("id", Tuple.Create(" id=\"", 49451), Tuple.Create("\"", 49529)
+, Tuple.Create(Tuple.Create("", 49456), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 49456), true)
- #line 804 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 49032), Tuple.Create((int)decommissionReason
+ #line 810 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 49503), Tuple.Create((int)decommissionReason
#line default
#line hidden
-, 49032), false)
+, 49503), false)
);
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" +
"ommission_Reason\"");
-WriteAttribute("value", Tuple.Create(" value=\"", 49157), Tuple.Create("\"", 49191)
+WriteAttribute("value", Tuple.Create(" value=\"", 49628), Tuple.Create("\"", 49662)
- #line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 49165), Tuple.Create((int)decommissionReason
+ #line 811 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 49636), Tuple.Create((int)decommissionReason
#line default
#line hidden
-, 49165), false)
+, 49636), false)
);
WriteLiteral(" ");
- #line 805 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 811 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
@@ -2650,21 +2664,21 @@ WriteLiteral(" ");
#line hidden
WriteLiteral(" />\r\n ((int)decommissionReason
+ #line 812 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 49859), Tuple.Create((int)decommissionReason
#line default
#line hidden
-, 49388), false)
+, 49859), false)
);
WriteLiteral(">");
- #line 806 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 812 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(decommissionReason.ReasonMessage());
@@ -2673,7 +2687,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 808 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 814 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -2691,7 +2705,7 @@ WriteLiteral(">\r\n $(function () {\r\n
"uttonDialog = null;\r\n var deviceSerialNumber = \'");
- #line 816 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 822 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Model.Device.SerialNumber);
@@ -2724,7 +2738,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\
" });\r\n \r\n");
- #line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 858 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -2733,7 +2747,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\
WriteLiteral(" ");
- #line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
if (Model.Device.CanRecommission())
{
@@ -2741,14 +2755,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 855 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 861 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
#line default
#line hidden
- #line 855 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 861 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
@@ -2802,7 +2816,7 @@ WriteLiteral(@">
");
- #line 890 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 896 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
@@ -2811,7 +2825,7 @@ WriteLiteral(@">
WriteLiteral(" ");
- #line 891 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 897 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
if (Model.Device.CanDelete())
{
@@ -2819,14 +2833,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 893 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 899 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
#line default
#line hidden
- #line 893 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 899 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
@@ -2886,7 +2900,7 @@ WriteLiteral(@">
");
- #line 931 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
+ #line 937 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
}
diff --git a/Disco.Web/Views/Job/JobParts/_Subject.cshtml b/Disco.Web/Views/Job/JobParts/_Subject.cshtml
index 9442ae0c..05f065bb 100644
--- a/Disco.Web/Views/Job/JobParts/_Subject.cshtml
+++ b/Disco.Web/Views/Job/JobParts/_Subject.cshtml
@@ -165,14 +165,20 @@
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
\r\n \r\n");
+WriteLiteral("?DocumentTemplateId=\';\r\n var generatePackageUrl = " +
+"\'");
- #line 200 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 169 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ Write(Url.Action(MVC.API.Job.GeneratePdfPackage(Model.Job.Id, null)));
+
+
+ #line default
+ #line hidden
+WriteLiteral("?DocumentTemplatePackageId=\';\r\n var $documentTempl" +
+"ates = $(\'#Job_Show_GenerateDocument\');\r\n var $ge" +
+"nerationHost;\r\n\r\n $documentTemplates.change(funct" +
+"ion () {\r\n var v = $documentTemplates.val();\r" +
+"\n if (v) {\r\n " +
+" var url;\r\n if (v.lastIndexOf(\'Pack" +
+"age:\', 0) === 0) {\r\n url = generatePa" +
+"ckageUrl + v.substring(8);\r\n } else {\r\n " +
+" url = generatePdfUrl + v;\r\n " +
+" }\r\n\r\n if ($." +
+"connection && $.connection.hub && $.connection.hub.transport &&\r\n " +
+" $.connection.hub.transport.name == \'foreverFram" +
+"e\') {\r\n // SignalR active with foreve" +
+"rFrame transport - use popup window\r\n " +
+" window.open(url, \'_blank\', \'height=150,width=250,location=no,menubar=no,resizab" +
+"le=no,scrollbars=no,status=no,toolbar=no\');\r\n " +
+" } else {\r\n // use iFrame\r\n " +
+" if (!$generationHost) {\r\n " +
+" $generationHost = $(\' | \r\n");
- #line 203 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 209 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 203 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 209 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.Device != null)
{
@@ -708,21 +722,21 @@ WriteLiteral(" title=\"Serial Number\"");
WriteLiteral(">");
- #line 207 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 213 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Authorization.Has(Claims.Device.Show))
{
#line default
#line hidden
- #line 208 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 214 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLink(Model.Job.DeviceSerialNumber, MVC.Device.Show(Model.Job.DeviceSerialNumber)));
#line default
#line hidden
- #line 208 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 214 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
else
{
@@ -730,14 +744,14 @@ WriteLiteral(">");
#line default
#line hidden
- #line 210 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 216 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.DeviceSerialNumber);
#line default
#line hidden
- #line 210 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 216 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
#line default
@@ -756,14 +770,14 @@ WriteLiteral(" id=\"Job_Show_Device_Model_Image\"");
WriteLiteral(" alt=\"Model Image\"");
-WriteAttribute("src", Tuple.Create(" src=\"", 13636), Tuple.Create("\"", 13754)
+WriteAttribute("src", Tuple.Create(" src=\"", 14091), Tuple.Create("\"", 14209)
- #line 213 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 13642), Tuple.Create (Url.Action(MVC.API.DeviceModel.Image(Model.Job.Device.DeviceModelId, Model.Job.Device.DeviceModel.ImageHash()))
+ #line 219 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 14097), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Job.Device.DeviceModelId, Model.Job.Device.DeviceModel.ImageHash()))
#line default
#line hidden
-, 13642), false)
+, 14097), false)
);
WriteLiteral(" />\r\n ");
- #line 214 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 220 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.ComputerName);
@@ -790,7 +804,7 @@ WriteLiteral(" title=\"Model\"");
WriteLiteral(">");
- #line 215 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 221 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLink(Model.Job.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Job.Device.DeviceModelId)));
@@ -799,13 +813,13 @@ WriteLiteral(">");
WriteLiteral(" \r\n");
- #line 216 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 222 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 216 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 222 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.Device.DeviceBatch != null)
{
@@ -821,7 +835,7 @@ WriteLiteral(" title=\"Batch\"");
WriteLiteral(">");
- #line 218 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 224 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLink(Model.Job.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Job.Device.DeviceBatchId)));
@@ -830,7 +844,7 @@ WriteLiteral(">");
WriteLiteral(" \r\n");
- #line 219 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 225 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -839,13 +853,13 @@ WriteLiteral("\r\n");
WriteLiteral(" \r\n");
- #line 221 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 227 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 221 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 227 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.Device.DeviceBatch != null)
{
if (Model.Job.JobTypeId == JobType.JobTypeIds.HWar)
@@ -866,7 +880,7 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HWar_ValidUntil\"");
WriteLiteral(" data-livestamp=\"");
- #line 227 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 233 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToUnixEpoc());
@@ -877,7 +891,7 @@ WriteLiteral("\"");
WriteLiteral(">");
- #line 227 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 233 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.DeviceBatch.WarrantyValidUntil.ToFullDateTime("Unknown"));
@@ -886,13 +900,13 @@ WriteLiteral(">");
WriteLiteral("\r\n");
- #line 228 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 234 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 228 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 234 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.WarrantyDetails))
{
@@ -913,23 +927,23 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HWar_Details_Dialog\"");
WriteLiteral(" class=\"dialog\"");
-WriteAttribute("title", Tuple.Create(" title=\"", 15418), Tuple.Create("\"", 15483)
-, Tuple.Create(Tuple.Create("", 15426), Tuple.Create("Warranty", 15426), true)
-, Tuple.Create(Tuple.Create(" ", 15434), Tuple.Create("Details", 15435), true)
-, Tuple.Create(Tuple.Create(" ", 15442), Tuple.Create("for", 15443), true)
+WriteAttribute("title", Tuple.Create(" title=\"", 15873), Tuple.Create("\"", 15938)
+, Tuple.Create(Tuple.Create("", 15881), Tuple.Create("Warranty", 15881), true)
+, Tuple.Create(Tuple.Create(" ", 15889), Tuple.Create("Details", 15890), true)
+, Tuple.Create(Tuple.Create(" ", 15897), Tuple.Create("for", 15898), true)
- #line 231 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create(" ", 15446), Tuple.Create(Model.Job.Device.DeviceBatch.Name
+ #line 237 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create(" ", 15901), Tuple.Create(Model.Job.Device.DeviceBatch.Name
#line default
#line hidden
-, 15447), false)
+, 15902), false)
);
WriteLiteral(">\r\n ");
- #line 232 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 238 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(new HtmlString(Model.Job.Device.DeviceBatch.WarrantyDetails));
@@ -959,7 +973,7 @@ WriteLiteral(@">
");
- #line 249 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 255 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -968,7 +982,7 @@ WriteLiteral(@">
WriteLiteral(" \r\n");
- #line 251 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 257 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
if (Model.Job.JobTypeId == JobType.JobTypeIds.HNWar)
{
@@ -988,7 +1002,7 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HNWar_InsuranceSupplier\"");
WriteLiteral(">");
- #line 256 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 262 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.DeviceBatch.InsuranceSupplier);
@@ -1001,7 +1015,7 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HNWar_ValidUntil\"");
WriteLiteral(" data-livestamp=\"");
- #line 257 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 263 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.DeviceBatch.InsuredUntil.ToUnixEpoc());
@@ -1012,7 +1026,7 @@ WriteLiteral("\"");
WriteLiteral(">");
- #line 257 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 263 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.Device.DeviceBatch.InsuredUntil.ToFullDateTime("Unknown"));
@@ -1021,13 +1035,13 @@ WriteLiteral(">");
WriteLiteral("\r\n");
- #line 258 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 264 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 258 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 264 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (!string.IsNullOrWhiteSpace(Model.Job.Device.DeviceBatch.InsuranceDetails))
{
@@ -1048,23 +1062,23 @@ WriteLiteral(" id=\"Job_Show_Device_Details_HNWar_Details_Dialog\"");
WriteLiteral(" class=\"dialog\"");
-WriteAttribute("title", Tuple.Create(" title=\"", 17746), Tuple.Create("\"", 17812)
-, Tuple.Create(Tuple.Create("", 17754), Tuple.Create("Insurance", 17754), true)
-, Tuple.Create(Tuple.Create(" ", 17763), Tuple.Create("Details", 17764), true)
-, Tuple.Create(Tuple.Create(" ", 17771), Tuple.Create("for", 17772), true)
+WriteAttribute("title", Tuple.Create(" title=\"", 18201), Tuple.Create("\"", 18267)
+, Tuple.Create(Tuple.Create("", 18209), Tuple.Create("Insurance", 18209), true)
+, Tuple.Create(Tuple.Create(" ", 18218), Tuple.Create("Details", 18219), true)
+, Tuple.Create(Tuple.Create(" ", 18226), Tuple.Create("for", 18227), true)
- #line 261 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create(" ", 17775), Tuple.Create(Model.Job.Device.DeviceBatch.Name
+ #line 267 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create(" ", 18230), Tuple.Create(Model.Job.Device.DeviceBatch.Name
#line default
#line hidden
-, 17776), false)
+, 18231), false)
);
WriteLiteral(">\r\n ");
- #line 262 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 268 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(new HtmlString(Model.Job.Device.DeviceBatch.InsuranceDetails));
@@ -1094,7 +1108,7 @@ WriteLiteral(@">
");
- #line 279 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 285 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1103,7 +1117,7 @@ WriteLiteral(@">
WriteLiteral(" \r\n");
- #line 281 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 287 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
}
@@ -1113,13 +1127,13 @@ WriteLiteral(" \r\n");
WriteLiteral(" \r\n");
- #line 284 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 290 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 284 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 290 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.DeviceHeld.HasValue)
{
var canEditLocation = Authorization.Has(Claims.Job.Properties.DeviceHeldLocation);
@@ -1146,13 +1160,13 @@ WriteLiteral(" id=\"Job_Show_Device_DeviceHeld_Location\"");
WriteLiteral(">\r\n");
- #line 293 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 299 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 293 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 299 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (canEditLocation)
{
switch (Model.LocationMode)
@@ -1164,14 +1178,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 299 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 305 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.TextBoxFor(m => m.Job.DeviceHeldLocation, new { @class = "small discreet" }));
#line default
#line hidden
- #line 299 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 305 "..\..\Views\Job\JobParts\_Subject.cshtml"
break;
case LocationModes.RestrictedList:
@@ -1186,14 +1200,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 308 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 314 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.DropDownListFor(m => m.Job.DeviceHeldLocation, listOptions, new { @class = "small discreet" }));
#line default
#line hidden
- #line 308 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 314 "..\..\Views\Job\JobParts\_Subject.cshtml"
;
break;
}
@@ -1202,27 +1216,27 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 311 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 317 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(AjaxHelpers.AjaxSave());
#line default
#line hidden
- #line 311 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 317 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 311 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 317 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(AjaxHelpers.AjaxLoader());
#line default
#line hidden
- #line 311 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 317 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
else if (string.IsNullOrEmpty(Model.Job.DeviceHeldLocation))
@@ -1238,7 +1252,7 @@ WriteLiteral(" class=\"smallMessage\"");
WriteLiteral("><None/Unknown>\r\n");
- #line 316 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 322 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
else
{
@@ -1247,14 +1261,14 @@ WriteLiteral("><None/Unknown>\r\n");
#line default
#line hidden
- #line 319 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 325 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.DeviceHeldLocation);
#line default
#line hidden
- #line 319 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 325 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1273,7 +1287,7 @@ WriteLiteral(" id=\"Job_Show_Device_DeviceHeld_DeviceHeld\"");
WriteLiteral(">");
- #line 326 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 332 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceHeld, Model.Job.DeviceHeldTechUser));
@@ -1282,13 +1296,13 @@ WriteLiteral(">");
WriteLiteral(" | \r\n \r\n");
- #line 328 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 334 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 328 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 334 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.DeviceReadyForReturn.HasValue)
{
@@ -1303,7 +1317,7 @@ WriteLiteral(" id=\"Job_Show_Device_DeviceHeld_DeviceReadyForReturn\"");
WriteLiteral(">");
- #line 332 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 338 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReadyForReturn, Model.Job.DeviceReadyForReturnTechUser));
@@ -1312,7 +1326,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 334 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 340 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1321,7 +1335,7 @@ WriteLiteral("\r\n \r\n");
WriteLiteral(" ");
- #line 335 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 341 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.DeviceReturnedDate.HasValue)
{
@@ -1336,7 +1350,7 @@ WriteLiteral(" id=\"Job_Show_Device_DeviceHeld_DeviceReturnedDate\"");
WriteLiteral(">");
- #line 339 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 345 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(CommonHelpers.FriendlyDateAndTitleUser(Model.Job.DeviceReturnedDate, Model.Job.DeviceReturnedTechUser));
@@ -1345,7 +1359,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 341 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 347 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1354,13 +1368,13 @@ WriteLiteral("\r\n \r\n");
WriteLiteral(" \r\n");
- #line 343 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 349 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 343 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 349 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (canEditLocation)
{
@@ -1374,13 +1388,13 @@ WriteLiteral(" type=\"text/javascript\"");
WriteLiteral(">\r\n $(function () {\r\n");
- #line 347 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 353 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 347 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 353 "..\..\Views\Job\JobParts\_Subject.cshtml"
switch (Model.LocationMode)
{
case LocationModes.Unrestricted:
@@ -1407,7 +1421,7 @@ WriteLiteral(@"
url: '");
- #line 364 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 370 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Url.Action(MVC.API.Job.DeviceHeldLocations()));
@@ -1465,7 +1479,7 @@ WriteLiteral("\',\r\n dat
" url: \'");
- #line 415 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 421 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Url.Action(MVC.API.Job.UpdateDeviceHeldLocation(Model.Job.Id, null)));
@@ -1493,7 +1507,7 @@ WriteLiteral(@"',
WriteLiteral("\r\n");
- #line 433 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 439 "..\..\Views\Job\JobParts\_Subject.cshtml"
break;
case LocationModes.RestrictedList:
@@ -1509,7 +1523,7 @@ WriteLiteral(@"
'");
- #line 439 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 445 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Url.Action(MVC.API.Job.UpdateDeviceHeldLocation(Model.Job.Id, null)));
@@ -1521,7 +1535,7 @@ WriteLiteral("\',\r\n \'DeviceHeldLoc
WriteLiteral("\r\n");
- #line 442 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 448 "..\..\Views\Job\JobParts\_Subject.cshtml"
break;
}
@@ -1532,7 +1546,7 @@ WriteLiteral("\r\n \r\n
");\r\n \r\n");
- #line 448 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 454 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1541,7 +1555,7 @@ WriteLiteral("\r\n \r\n
WriteLiteral("
\r\n");
- #line 450 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 456 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1550,7 +1564,7 @@ WriteLiteral("
\r\n");
WriteLiteral(" \r\n \r\n");
- #line 453 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 459 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1559,7 +1573,7 @@ WriteLiteral(" \r\n \r\n");
WriteLiteral(" ");
- #line 454 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 460 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.User != null)
{
@@ -1579,21 +1593,21 @@ WriteLiteral(" title=\"Display Name\"");
WriteLiteral(">");
- #line 458 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 464 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Authorization.Has(Claims.User.Show))
{
#line default
#line hidden
- #line 459 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 465 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLink(Model.Job.User.DisplayName, MVC.User.Show(Model.Job.UserId)));
#line default
#line hidden
- #line 459 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 465 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
else
{
@@ -1601,14 +1615,14 @@ WriteLiteral(">");
#line default
#line hidden
- #line 461 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 467 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.User.DisplayName);
#line default
#line hidden
- #line 461 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 467 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1623,7 +1637,7 @@ WriteLiteral(" title=\"Id\"");
WriteLiteral(">");
- #line 463 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 469 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.User.FriendlyId());
@@ -1632,13 +1646,13 @@ WriteLiteral(">");
WriteLiteral("\r\n");
- #line 464 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 470 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 464 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 470 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Authorization.Has(Claims.User.ShowDetails))
{
if (!string.IsNullOrWhiteSpace(Model.Job.User.PhoneNumber))
@@ -1655,7 +1669,7 @@ WriteLiteral(" title=\"Phone Number\"");
WriteLiteral(">Phone: ");
- #line 467 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 473 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.User.PhoneNumber);
@@ -1664,7 +1678,7 @@ WriteLiteral(">Phone: ");
WriteLiteral("");
- #line 467 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 473 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
if (!string.IsNullOrWhiteSpace(Model.Job.User.EmailAddress))
{
@@ -1679,21 +1693,21 @@ WriteLiteral(" title=\"Email Address\"");
WriteLiteral(">Email: (Model.Job.User.EmailAddress
+ #line 475 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 33366), Tuple.Create(Model.Job.User.EmailAddress
#line default
#line hidden
-, 32911), false)
+, 33366), false)
);
WriteLiteral(">");
- #line 469 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 475 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.User.EmailAddress);
@@ -1702,7 +1716,7 @@ WriteLiteral(">");
WriteLiteral("");
- #line 469 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 475 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
}
@@ -1712,7 +1726,7 @@ WriteLiteral("");
WriteLiteral(" ");
- #line 471 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 477 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Authorization.Has(Claims.User.ShowFlagAssignments))
{
@@ -1726,13 +1740,13 @@ WriteLiteral(" id=\"Job_Show_User_Flags\"");
WriteLiteral(">\r\n");
- #line 474 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 480 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 474 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 480 "..\..\Views\Job\JobParts\_Subject.cshtml"
foreach (var flag in Model.Job.User.UserFlagAssignments.Where(f => !f.RemovedDate.HasValue).Select(f => Tuple.Create(f, UserFlagService.GetUserFlag(f.UserFlagId))))
{
@@ -1741,26 +1755,26 @@ WriteLiteral(">\r\n");
#line hidden
WriteLiteral(" (flag.Item2.Icon
+ #line 482 "..\..\Views\Job\JobParts\_Subject.cshtml"
+, Tuple.Create(Tuple.Create("", 33898), Tuple.Create(flag.Item2.Icon
#line default
#line hidden
-, 33443), false)
-, Tuple.Create(Tuple.Create(" ", 33461), Tuple.Create("fa-fw", 33462), true)
-, Tuple.Create(Tuple.Create(" ", 33467), Tuple.Create("d-", 33468), true)
+, 33898), false)
+, Tuple.Create(Tuple.Create(" ", 33916), Tuple.Create("fa-fw", 33917), true)
+, Tuple.Create(Tuple.Create(" ", 33922), Tuple.Create("d-", 33923), true)
- #line 476 "..\..\Views\Job\JobParts\_Subject.cshtml"
-, Tuple.Create(Tuple.Create("", 33470), Tuple.Create(flag.Item2.IconColour
+ #line 482 "..\..\Views\Job\JobParts\_Subject.cshtml"
+, Tuple.Create(Tuple.Create("", 33925), Tuple.Create(flag.Item2.IconColour
#line default
#line hidden
-, 33470), false)
+, 33925), false)
);
WriteLiteral(">");
- #line 476 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 482 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(flag.Item2.Name);
@@ -1783,7 +1797,7 @@ WriteLiteral(">");
WriteLiteral("");
- #line 476 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 482 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (flag.Item1.Comments != null)
{
@@ -1796,7 +1810,7 @@ WriteLiteral(" class=\"comments\"");
WriteLiteral(">");
- #line 477 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 483 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(flag.Item1.Comments.ToHtmlComment());
@@ -1805,7 +1819,7 @@ WriteLiteral(">");
WriteLiteral("");
- #line 477 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 483 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
#line default
@@ -1817,7 +1831,7 @@ WriteLiteral(" class=\"added\"");
WriteLiteral(">");
- #line 477 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 483 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(CommonHelpers.FriendlyDateAndUser(flag.Item1.AddedDate, flag.Item1.AddedUserId));
@@ -1826,7 +1840,7 @@ WriteLiteral(">");
WriteLiteral("\r\n");
- #line 478 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 484 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1862,7 +1876,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \r\n");
- #line 510 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 516 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1871,7 +1885,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 511 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 517 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.WaitingForUserAction.HasValue)
{
@@ -1890,7 +1904,7 @@ WriteLiteral(">\r\n Awaiting Action
\r\n
WriteLiteral(" data-livestamp=\"");
- #line 515 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 521 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.WaitingForUserAction.ToUnixEpoc());
@@ -1901,7 +1915,7 @@ WriteLiteral("\"");
WriteLiteral(">");
- #line 515 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 521 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Model.Job.WaitingForUserAction.ToFullDateTime());
@@ -1910,7 +1924,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 517 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 523 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1919,7 +1933,7 @@ WriteLiteral("\r\n \r\n");
WriteLiteral(" \r\n \r\n");
- #line 520 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 526 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -1936,13 +1950,13 @@ WriteLiteral(" id=\"Job_Show_Job_Actions\"");
WriteLiteral(">\r\n");
- #line 524 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 530 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 524 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 530 "..\..\Views\Job\JobParts\_Subject.cshtml"
List CanCloseForcedReasons;
if (Model.Job.CanCloseForced(out CanCloseForcedReasons))
@@ -1952,14 +1966,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 528 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 534 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Forcibly Close", MVC.API.Job.Close(Model.Job.Id, true), "Job_Show_Job_Actions_ForceClose_Button"));
#line default
#line hidden
- #line 528 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 534 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -1989,13 +2003,13 @@ WriteLiteral(">Are you sure?\r\n \r\n");
- #line 535 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 541 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 535 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 541 "..\..\Views\Job\JobParts\_Subject.cshtml"
foreach (var reason in CanCloseForcedReasons)
{
@@ -2005,7 +2019,7 @@ WriteLiteral(">Are you sure?\r\n ");
- #line 537 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 543 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(reason);
@@ -2014,7 +2028,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n");
- #line 538 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 544 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2023,13 +2037,13 @@ WriteLiteral("\r\n");
WriteLiteral(" \r\n \r\n");
- #line 541 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 547 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 541 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 547 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.ForceClose(Model.Job.Id, null, true)))
{
@@ -2047,7 +2061,7 @@ WriteLiteral(" class=\"block\"");
WriteLiteral(">\r\n \r\n");
- #line 547 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 553 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2080,7 +2094,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n });\r\n \r\n");
- #line 580 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 586 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2089,13 +2103,13 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral("\r\n\r\n");
- #line 583 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 589 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 583 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 589 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanCloseNormally())
{
@@ -2103,14 +2117,14 @@ WriteLiteral("\r\n\r\n");
#line default
#line hidden
- #line 585 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 591 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Close", MVC.API.Job.Close(Model.Job.Id, true), "Job_Show_Job_Actions_Close_Button"));
#line default
#line hidden
- #line 585 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 591 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2156,7 +2170,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n });\r\n \r\n");
- #line 622 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 628 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2165,7 +2179,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 623 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 629 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanReopen())
{
@@ -2173,14 +2187,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 625 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 631 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Reopen Job", MVC.API.Job.Reopen(Model.Job.Id, true), "Job_Show_Job_Actions_Reopen_Button"));
#line default
#line hidden
- #line 625 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 631 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2227,7 +2241,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n \r\n");
- #line 663 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 669 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2236,7 +2250,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 664 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 670 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDelete())
{
@@ -2244,14 +2258,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 666 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 672 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Delete", MVC.API.Job.Delete(Model.Job.Id, true), "Job_Show_Job_Actions_Delete_Button"));
#line default
#line hidden
- #line 666 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 672 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2299,7 +2313,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \r\n");
- #line 704 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 710 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2308,7 +2322,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 705 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 711 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanAddQueues() && Model.AvailableQueues != null && Model.AvailableQueues.Count > 0)
{
@@ -2322,14 +2336,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 713 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 719 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Add to Queue", MVC.API.JobQueueJob.AddJob(), "Job_Show_Job_Actions_AddQueue_Button"));
#line default
#line hidden
- #line 713 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 719 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2346,13 +2360,13 @@ WriteLiteral(" title=\"Add Job to Queue\"");
WriteLiteral(">\r\n");
- #line 715 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 721 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 715 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 721 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.JobQueueJob.AddJob()))
{
@@ -2377,14 +2391,14 @@ WriteLiteral(" type=\"hidden\"");
WriteLiteral(" name=\"JobId\"");
-WriteAttribute("value", Tuple.Create(" value=\"", 46987), Tuple.Create("\"", 47008)
+WriteAttribute("value", Tuple.Create(" value=\"", 47442), Tuple.Create("\"", 47463)
- #line 718 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 46995), Tuple.Create(Model.Job.Id
+ #line 724 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 47450), Tuple.Create(Model.Job.Id
#line default
#line hidden
-, 46995), false)
+, 47450), false)
);
WriteLiteral(" />\r\n");
@@ -2396,13 +2410,13 @@ WriteLiteral(" class=\"queuePicker\"");
WriteLiteral(">\r\n");
- #line 720 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 726 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 720 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 726 "..\..\Views\Job\JobParts\_Subject.cshtml"
foreach (var jobQueue in Model.AvailableQueues.OrderBy(jq => jq.Name))
{
@@ -2416,7 +2430,7 @@ WriteLiteral(" class=\"queue\"");
WriteLiteral(" data-queueid=\"");
- #line 722 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 728 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(jobQueue.Id);
@@ -2427,7 +2441,7 @@ WriteLiteral("\"");
WriteLiteral(" data-queuesla=\"");
- #line 722 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 728 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(jobQueue.DefaultSLAExpiry.HasValue ? jobQueue.DefaultSLAExpiry.Value.ToString() : null);
@@ -2438,7 +2452,7 @@ WriteLiteral("\"");
WriteLiteral(" data-queuepriority=\"");
- #line 722 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 728 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(jobQueue.Priority.ToString());
@@ -2448,32 +2462,32 @@ WriteLiteral("\"");
WriteLiteral(">\r\n (jobQueue.Icon
+ #line 729 "..\..\Views\Job\JobParts\_Subject.cshtml"
+, Tuple.Create(Tuple.Create("", 47946), Tuple.Create(jobQueue.Icon
#line default
#line hidden
-, 47491), false)
-, Tuple.Create(Tuple.Create(" ", 47507), Tuple.Create("fa-fw", 47508), true)
-, Tuple.Create(Tuple.Create(" ", 47513), Tuple.Create("fa-lg", 47514), true)
-, Tuple.Create(Tuple.Create(" ", 47519), Tuple.Create("d-", 47520), true)
+, 47946), false)
+, Tuple.Create(Tuple.Create(" ", 47962), Tuple.Create("fa-fw", 47963), true)
+, Tuple.Create(Tuple.Create(" ", 47968), Tuple.Create("fa-lg", 47969), true)
+, Tuple.Create(Tuple.Create(" ", 47974), Tuple.Create("d-", 47975), true)
- #line 723 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 47522), Tuple.Create(jobQueue.IconColour
+ #line 729 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 47977), Tuple.Create(jobQueue.IconColour
#line default
#line hidden
-, 47522), false)
+, 47977), false)
);
WriteLiteral(">");
- #line 723 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 729 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(jobQueue.Name);
@@ -2482,7 +2496,7 @@ WriteLiteral(">");
WriteLiteral("\r\n \r\n");
- #line 725 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 731 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2500,7 +2514,7 @@ WriteLiteral(">\r\n \r\n
WriteLiteral(" ");
- #line 730 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 736 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.DropDownList("Priority", priorityItems, new { id = "Job_Show_Job_Actions_AddQueue_Priority" }));
@@ -2508,27 +2522,27 @@ WriteLiteral(" ");
#line hidden
WriteLiteral(" (priorityValue.ToLower()
+ #line 736 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 48418), Tuple.Create(priorityValue.ToLower()
#line default
#line hidden
-, 47963), false)
+, 48418), false)
);
-WriteAttribute("title", Tuple.Create(" title=\"", 47990), Tuple.Create("\"", 48023)
+WriteAttribute("title", Tuple.Create(" title=\"", 48445), Tuple.Create("\"", 48478)
- #line 730 "..\..\Views\Job\JobParts\_Subject.cshtml"
- , Tuple.Create(Tuple.Create("", 47998), Tuple.Create(priorityValue
+ #line 736 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ , Tuple.Create(Tuple.Create("", 48453), Tuple.Create(priorityValue
#line default
#line hidden
-, 47998), false)
-, Tuple.Create(Tuple.Create(" ", 48014), Tuple.Create("Priority", 48015), true)
+, 48453), false)
+, Tuple.Create(Tuple.Create(" ", 48469), Tuple.Create("Priority", 48470), true)
);
WriteLiteral(">\r\n
\r\n \r\n " +
@@ -2537,7 +2551,7 @@ WriteLiteral(">\r\n
\r\n
WriteLiteral(" ");
- #line 734 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 740 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.DropDownList("SLAExpiresMinutes", slaOptions, new { id = "Job_Show_Job_Actions_AddQueue_SLAExpiresMinutes" }));
@@ -2555,7 +2569,7 @@ WriteLiteral(">\r\n \r\n
"\n");
- #line 741 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 747 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2618,7 +2632,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n \r\n");
- #line 820 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 826 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2627,7 +2641,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 821 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 827 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanLogWarranty())
{
@@ -2635,14 +2649,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 823 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 829 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Log Warranty", MVC.Job.LogWarranty(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogWarranty_Button"));
#line default
#line hidden
- #line 823 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 829 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2652,7 +2666,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 825 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 831 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanWarrantyCompleted())
{
@@ -2660,14 +2674,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 827 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 833 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Warranty Complete", MVC.API.Job.UpdateWarrantyExternalCompletedDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_WarrantyComplete_Button", "alert"));
#line default
#line hidden
- #line 827 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 833 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2677,7 +2691,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 829 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 835 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanInsuranceClaimFormSent())
{
@@ -2685,14 +2699,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 831 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 837 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Insurance Claim Sent", MVC.API.Job.UpdateInsuranceClaimFormSentDate(Model.Job.Id, "Now", true), "Job_Show_Job_Actions_InsuranceClaimSent_Button", "alert"));
#line default
#line hidden
- #line 831 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 837 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2702,7 +2716,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 833 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 839 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanLogRepair())
{
@@ -2710,14 +2724,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 835 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 841 "..\..\Views\Job\JobParts\_Subject.cshtml"
Write(Html.ActionLinkSmallButton("Log Repair", MVC.Job.LogRepair(Model.Job.Id, null, null), "Job_Show_Job_Actions_LogRepair_Button"));
#line default
#line hidden
- #line 835 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 841 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2727,7 +2741,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 837 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 843 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanRepairComplete())
{
@@ -2735,14 +2749,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 839 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 845 "..\..\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 839 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 845 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2752,7 +2766,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 841 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 847 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanConvertHWarToHNWar())
{
@@ -2760,14 +2774,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 843 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 849 "..\..\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 843 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 849 "..\..\Views\Job\JobParts\_Subject.cshtml"
@@ -2815,7 +2829,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" \r\n });\r\n \r\n");
- #line 883 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 889 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2824,13 +2838,13 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" \r\n");
- #line 885 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 891 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 885 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 891 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.Device != null)
{
@@ -2844,13 +2858,13 @@ WriteLiteral(" id=\"Job_Show_Device_Actions\"");
WriteLiteral(">\r\n");
- #line 888 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 894 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 888 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 894 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceHeld())
{
@@ -2858,14 +2872,14 @@ WriteLiteral(">\r\n");
#line default
#line hidden
- #line 890 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 896 "..\..\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 890 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 896 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2875,7 +2889,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" ");
- #line 892 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 898 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceReadyForReturn())
{
@@ -2883,14 +2897,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 894 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 900 "..\..\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 894 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 900 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2900,7 +2914,7 @@ WriteLiteral(" ");
WriteLiteral(" ");
- #line 896 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 902 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanDeviceReturned())
{
@@ -2908,14 +2922,14 @@ WriteLiteral(" ");
#line default
#line hidden
- #line 898 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 904 "..\..\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 898 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 904 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2925,7 +2939,7 @@ WriteLiteral(" ");
WriteLiteral(" \r\n");
- #line 901 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 907 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -2934,7 +2948,7 @@ WriteLiteral(" \r\n");
WriteLiteral(" ");
- #line 902 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 908 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.User != null)
{
@@ -2948,13 +2962,13 @@ WriteLiteral(" id=\"Job_Show_User_Actions\"");
WriteLiteral(">\r\n\r\n\r\n");
- #line 907 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 913 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 907 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 913 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanWaitingForUserAction())
{
@@ -2982,13 +2996,13 @@ WriteLiteral(" title=\"Waiting for User Action\"");
WriteLiteral(">\r\n");
- #line 911 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 917 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 911 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 917 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.WaitingForUserAction(Model.Job.Id, null, true)))
{
@@ -3006,7 +3020,7 @@ WriteLiteral(" class=\"block\"");
WriteLiteral(">\r\n \r\n");
- #line 917 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 923 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3041,7 +3055,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n \r\n");
- #line 950 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 956 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3050,7 +3064,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral(" ");
- #line 951 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 957 "..\..\Views\Job\JobParts\_Subject.cshtml"
if (Model.Job.CanNotWaitingForUserAction())
{
@@ -3078,13 +3092,13 @@ WriteLiteral(" title=\"Not Waiting for User Action\"");
WriteLiteral(">\r\n");
- #line 955 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 961 "..\..\Views\Job\JobParts\_Subject.cshtml"
#line default
#line hidden
- #line 955 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 961 "..\..\Views\Job\JobParts\_Subject.cshtml"
using (Html.BeginForm(MVC.API.Job.NotWaitingForUserAction(Model.Job.Id, null, true)))
{
@@ -3102,7 +3116,7 @@ WriteLiteral(" class=\"block\"");
WriteLiteral(">\r\n \r\n");
- #line 961 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 967 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3138,7 +3152,7 @@ WriteLiteral(">\r\n $(function () {\r\n
" });\r\n \r\n");
- #line 995 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 1001 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
@@ -3147,7 +3161,7 @@ WriteLiteral(">\r\n $(function () {\r\n
WriteLiteral("\r\n \r\n");
- #line 998 "..\..\Views\Job\JobParts\_Subject.cshtml"
+ #line 1004 "..\..\Views\Job\JobParts\_Subject.cshtml"
}
diff --git a/Disco.Web/Views/User/UserParts/_Subject.cshtml b/Disco.Web/Views/User/UserParts/_Subject.cshtml
index 5595b5db..9032c6d8 100644
--- a/Disco.Web/Views/User/UserParts/_Subject.cshtml
+++ b/Disco.Web/Views/User/UserParts/_Subject.cshtml
@@ -73,13 +73,19 @@
\r\n " +
-" \r\n");
+WriteLiteral("?DocumentTemplateId=\';\r\n var generatePackageUr" +
+"l = \'");
- #line 107 "..\..\Views\User\UserParts\_Subject.cshtml"
+ #line 76 "..\..\Views\User\UserParts\_Subject.cshtml"
+ Write(Url.Action(MVC.API.User.GeneratePdfPackage(Model.User.UserId, null)));
+
+
+ #line default
+ #line hidden
+WriteLiteral("?DocumentTemplatePackageId=\';\r\n var $documentT" +
+"emplates = $(\'#User_Show_GenerateDocument\');\r\n " +
+" var $generationHost;\r\n\r\n $documentTemplates" +
+".change(function () {\r\n var v = $document" +
+"Templates.val();\r\n if (v) {\r\n " +
+" var url;\r\n " +
+" if (v.lastIndexOf(\'Package:\', 0) === 0) {\r\n " +
+" url = generatePackageUrl + v.substring(8);\r\n " +
+" } else {\r\n " +
+" url = generatePdfUrl + v;\r\n }\r\n\r\n " +
+" if ($.connection && $.connection.hub " +
+"&& $.connection.hub.transport &&\r\n " +
+" $.connection.hub.transport.name == \'foreverFrame\') {\r\n " +
+" // SignalR active with foreverFrame transport - use " +
+"popup window\r\n window.open(url, \'" +
+"_blank\', \'height=150,width=250,location=no,menubar=no,resizable=no,scrollbars=no" +
+",status=no,toolbar=no\');\r\n } else {\r\n" +
+" // use iFrame\r\n " +
+" if (!$generationHost) {\r\n " +
+" $generationHost = $(\'