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.
This commit is contained in:
@@ -10,6 +10,7 @@ using iTextSharp.text.pdf;
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Concurrent;
|
using System.Collections.Concurrent;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
namespace Disco.BI.Extensions
|
namespace Disco.BI.Extensions
|
||||||
@@ -45,15 +46,15 @@ namespace Disco.BI.Extensions
|
|||||||
return dt.PdfExpressionsFromCache(Database).Values.OrderBy(e => e.Ordinal).ToList();
|
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);
|
bool generateExpression = !string.IsNullOrEmpty(dt.OnGenerateExpression);
|
||||||
string generateExpressionResult = null;
|
string generateExpressionResult = null;
|
||||||
@@ -70,6 +71,36 @@ namespace Disco.BI.Extensions
|
|||||||
|
|
||||||
return pdfStream;
|
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<string> 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<IAttachmentTarget> DataObjects)
|
||||||
|
{
|
||||||
|
return Interop.Pdf.PdfGenerator.GenerateBulkFromPackage(package, Database, CreatorUser, Timestamp, InsertBlankPages, DataObjects);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<bool> 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)
|
public static void Delete(this DocumentTemplate dt, DiscoDataContext Database)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -21,8 +21,106 @@ namespace Disco.BI.Interop.Pdf
|
|||||||
{
|
{
|
||||||
public static class PdfGenerator
|
public static class PdfGenerator
|
||||||
{
|
{
|
||||||
|
public static Stream GenerateBulkFromPackage(DocumentTemplatePackage package, DiscoDataContext Database, User CreatorUser, DateTime Timestamp, bool InsertBlankPages, List<IAttachmentTarget> DataObjects)
|
||||||
|
{
|
||||||
|
if (DataObjects.Count > 0)
|
||||||
|
{
|
||||||
|
List<Stream> generatedPdfs = new List<Stream>(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<string> DataObjectsIds)
|
||||||
|
{
|
||||||
|
List<IAttachmentTarget> DataObjects;
|
||||||
|
|
||||||
|
switch (package.Scope)
|
||||||
|
{
|
||||||
|
case AttachmentTypes.Device:
|
||||||
|
DataObjects = Database.Devices.Where(d => DataObjectsIds.Contains(d.SerialNumber)).ToList<IAttachmentTarget>();
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.Job:
|
||||||
|
int[] intDataObjectsIds = DataObjectsIds.Select(i => int.Parse(i)).ToArray();
|
||||||
|
DataObjects = Database.Jobs.Where(j => intDataObjectsIds.Contains(j.Id)).ToList<IAttachmentTarget>();
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.User:
|
||||||
|
DataObjects = new List<IAttachmentTarget>(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<Stream> generatedPdfs = new List<Stream>(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)
|
if (DataObjects.Length > 0)
|
||||||
{
|
{
|
||||||
@@ -42,7 +140,7 @@ namespace Disco.BI.Interop.Pdf
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Stream bulkPdf = Utilities.JoinPdfs(generatedPdfs.ToArray());
|
Stream bulkPdf = Utilities.JoinPdfs(InsertBlankPages, generatedPdfs);
|
||||||
foreach (Stream singlePdf in generatedPdfs)
|
foreach (Stream singlePdf in generatedPdfs)
|
||||||
singlePdf.Dispose();
|
singlePdf.Dispose();
|
||||||
return bulkPdf;
|
return bulkPdf;
|
||||||
@@ -51,7 +149,7 @@ namespace Disco.BI.Interop.Pdf
|
|||||||
return null;
|
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;
|
IAttachmentTarget[] DataObjects;
|
||||||
|
|
||||||
@@ -72,14 +170,14 @@ namespace Disco.BI.Interop.Pdf
|
|||||||
|
|
||||||
DataObjects[idIndex] = UserService.GetUser(ActiveDirectory.ParseDomainAccountId(dataObjectId), Database, true);
|
DataObjects[idIndex] = UserService.GetUser(ActiveDirectory.ParseDomainAccountId(dataObjectId), Database, true);
|
||||||
if (DataObjects[idIndex] == null)
|
if (DataObjects[idIndex] == null)
|
||||||
throw new Exception(string.Format("Unknown Username specified: {0}", dataObjectId));
|
throw new Exception($"Unknown Username specified: {dataObjectId}");
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new InvalidOperationException("Invalid DocumentType Scope");
|
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)
|
public static Stream GenerateFromTemplate(DocumentTemplate dt, DiscoDataContext Database, IAttachmentTarget Data, User CreatorUser, DateTime TimeStamp, DocumentState State, bool FlattenFields = false)
|
||||||
|
|||||||
@@ -1,41 +1,50 @@
|
|||||||
using iTextSharp.text;
|
using iTextSharp.text;
|
||||||
using iTextSharp.text.pdf;
|
using iTextSharp.text.pdf;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace Disco.BI.Interop.Pdf
|
namespace Disco.BI.Interop.Pdf
|
||||||
{
|
{
|
||||||
public static class Utilities
|
public static class Utilities
|
||||||
{
|
{
|
||||||
public static System.IO.Stream JoinPdfs(params System.IO.Stream[] Pdfs)
|
public static Stream JoinPdfs(bool InsertBlankPages, List<Stream> Pdfs)
|
||||||
{
|
{
|
||||||
if (Pdfs.Length == 0)
|
if (Pdfs.Count == 0)
|
||||||
throw new System.ArgumentNullException("Pdfs");
|
throw new System.ArgumentNullException(nameof(Pdfs));
|
||||||
|
|
||||||
// Only One PDF - Possible Reference Bug v's Memory/Speed (Returning Param Memory Stream)
|
// 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];
|
return Pdfs[0];
|
||||||
|
|
||||||
// Join Pdfs
|
// Join Pdfs
|
||||||
System.IO.MemoryStream msBuilder = new System.IO.MemoryStream();
|
var msBuilder = new MemoryStream();
|
||||||
|
|
||||||
Document pdfDoc = new Document();
|
var pdfLastPageSize = PageSize.A4;
|
||||||
PdfCopy pdfCopy = new PdfCopy(pdfDoc, msBuilder);
|
var pdfDoc = new Document();
|
||||||
|
var pdfCopy = new PdfSmartCopy(pdfDoc, msBuilder);
|
||||||
pdfDoc.Open();
|
pdfDoc.Open();
|
||||||
pdfCopy.CloseStream = false;
|
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];
|
var pdf = Pdfs[i];
|
||||||
PdfReader pdfReader = new PdfReader(pdf);
|
var pdfReader = new PdfReader(pdf);
|
||||||
|
|
||||||
for (int indexPage = 1; indexPage <= pdfReader.NumberOfPages; indexPage++)
|
for (int indexPage = 1; indexPage <= pdfReader.NumberOfPages; indexPage++)
|
||||||
{
|
{
|
||||||
iTextSharp.text.Rectangle pageSize = pdfReader.GetPageSizeWithRotation(indexPage);
|
pdfLastPageSize = pdfReader.GetPageSizeWithRotation(indexPage);
|
||||||
PdfImportedPage page = pdfCopy.GetImportedPage(pdfReader, indexPage);
|
var page = pdfCopy.GetImportedPage(pdfReader, indexPage);
|
||||||
pdfDoc.SetPageSize(pageSize);
|
pdfDoc.SetPageSize(pdfLastPageSize);
|
||||||
pdfDoc.NewPage();
|
pdfDoc.NewPage();
|
||||||
pdfCopy.AddPage(page);
|
pdfCopy.AddPage(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (InsertBlankPages && (pdfCopy.PageNumber % 2) != 0)
|
||||||
|
{
|
||||||
|
pdfDoc.NewPage();
|
||||||
|
pdfCopy.AddPage(pdfLastPageSize, 0);
|
||||||
|
}
|
||||||
|
|
||||||
pdfReader.Close();
|
pdfReader.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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<DocumentTemplatePackage> Packages
|
||||||
|
{
|
||||||
|
get { return Get<List<DocumentTemplatePackage>>(null); }
|
||||||
|
set { Set(value); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,12 +11,13 @@ namespace Disco.Data.Configuration
|
|||||||
: base(Database)
|
: base(Database)
|
||||||
{
|
{
|
||||||
// Init Modules
|
// Init Modules
|
||||||
this.moduleBootstrapperConfiguration = new Lazy<Modules.BootstrapperConfiguration>(() => new Modules.BootstrapperConfiguration(Database));
|
moduleBootstrapperConfiguration = new Lazy<Modules.BootstrapperConfiguration>(() => new Modules.BootstrapperConfiguration(Database));
|
||||||
this.moduleDeviceProfilesConfiguration = new Lazy<Modules.DeviceProfilesConfiguration>(() => new Modules.DeviceProfilesConfiguration(Database));
|
moduleDeviceProfilesConfiguration = new Lazy<Modules.DeviceProfilesConfiguration>(() => new Modules.DeviceProfilesConfiguration(Database));
|
||||||
this.moduleOrganisationAddressesConfiguration = new Lazy<Modules.OrganisationAddressesConfiguration>(() => new Modules.OrganisationAddressesConfiguration(Database));
|
moduleOrganisationAddressesConfiguration = new Lazy<Modules.OrganisationAddressesConfiguration>(() => new Modules.OrganisationAddressesConfiguration(Database));
|
||||||
this.moduleJobPreferencesConfiguration = new Lazy<Modules.JobPreferencesConfiguration>(() => new Modules.JobPreferencesConfiguration(Database));
|
moduleJobPreferencesConfiguration = new Lazy<Modules.JobPreferencesConfiguration>(() => new Modules.JobPreferencesConfiguration(Database));
|
||||||
this.moduleActiveDirectoryConfiguration = new Lazy<Modules.ActiveDirectoryConfiguration>(() => new Modules.ActiveDirectoryConfiguration(Database));
|
moduleActiveDirectoryConfiguration = new Lazy<Modules.ActiveDirectoryConfiguration>(() => new Modules.ActiveDirectoryConfiguration(Database));
|
||||||
this.moduleDevicesConfiguration = new Lazy<Modules.DevicesConfiguration>(() => new Modules.DevicesConfiguration(Database));
|
moduleDevicesConfiguration = new Lazy<Modules.DevicesConfiguration>(() => new Modules.DevicesConfiguration(Database));
|
||||||
|
moduleDocumentsConfiguration = new Lazy<Modules.DocumentsConfiguration>(() => new Modules.DocumentsConfiguration(Database));
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Configuration Modules
|
#region Configuration Modules
|
||||||
@@ -27,6 +28,7 @@ namespace Disco.Data.Configuration
|
|||||||
private Lazy<Modules.JobPreferencesConfiguration> moduleJobPreferencesConfiguration;
|
private Lazy<Modules.JobPreferencesConfiguration> moduleJobPreferencesConfiguration;
|
||||||
private Lazy<Modules.ActiveDirectoryConfiguration> moduleActiveDirectoryConfiguration;
|
private Lazy<Modules.ActiveDirectoryConfiguration> moduleActiveDirectoryConfiguration;
|
||||||
private Lazy<Modules.DevicesConfiguration> moduleDevicesConfiguration;
|
private Lazy<Modules.DevicesConfiguration> moduleDevicesConfiguration;
|
||||||
|
private Lazy<Modules.DocumentsConfiguration> moduleDocumentsConfiguration;
|
||||||
|
|
||||||
public Modules.BootstrapperConfiguration Bootstrapper
|
public Modules.BootstrapperConfiguration Bootstrapper
|
||||||
{
|
{
|
||||||
@@ -71,6 +73,14 @@ namespace Disco.Data.Configuration
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Modules.DocumentsConfiguration Documents
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return moduleDocumentsConfiguration.Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public override string Scope { get { return "System"; } }
|
public override string Scope { get { return "System"; } }
|
||||||
@@ -79,7 +89,7 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var result = this.Get<string>(null);
|
var result = Get<string>(null);
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
var appDataPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");
|
var appDataPath = System.Web.HttpContext.Current.Server.MapPath("~/App_Data");
|
||||||
@@ -102,7 +112,7 @@ namespace Disco.Data.Configuration
|
|||||||
storePath = value;
|
storePath = value;
|
||||||
else
|
else
|
||||||
storePath = string.Concat(value, '\\');
|
storePath = string.Concat(value, '\\');
|
||||||
this.Set(storePath);
|
Set(storePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -110,7 +120,7 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>("Domain Admins,Disco Admins");
|
return Get("Domain Admins,Disco Admins");
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
@@ -123,21 +133,21 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return System.IO.Path.Combine(this.DataStoreLocation, @"Plugins\");
|
return System.IO.Path.Combine(DataStoreLocation, @"Plugins\");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string PluginStorageLocation
|
public string PluginStorageLocation
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return System.IO.Path.Combine(this.DataStoreLocation, @"PluginStorage\");
|
return System.IO.Path.Combine(DataStoreLocation, @"PluginStorage\");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string PluginPackagesLocation
|
public string PluginPackagesLocation
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return System.IO.Path.Combine(this.DataStoreLocation, @"PluginPackages\");
|
return System.IO.Path.Combine(DataStoreLocation, @"PluginPackages\");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -155,7 +165,7 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var path = this.OrganisationLogoPath;
|
var path = OrganisationLogoPath;
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
return File.GetLastWriteTimeUtc(path).ToBinary().ToString();
|
return File.GetLastWriteTimeUtc(path).ToBinary().ToString();
|
||||||
else
|
else
|
||||||
@@ -166,7 +176,7 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var path = this.OrganisationLogoPath;
|
var path = OrganisationLogoPath;
|
||||||
if (File.Exists(path))
|
if (File.Exists(path))
|
||||||
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
|
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read);
|
||||||
else
|
else
|
||||||
@@ -174,7 +184,7 @@ namespace Disco.Data.Configuration
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
string organisationLogoPath = this.OrganisationLogoPath;
|
string organisationLogoPath = OrganisationLogoPath;
|
||||||
if (value == null)
|
if (value == null)
|
||||||
{
|
{
|
||||||
if (System.IO.File.Exists(organisationLogoPath))
|
if (System.IO.File.Exists(organisationLogoPath))
|
||||||
@@ -194,22 +204,22 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>(null);
|
return Get<string>(null);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool MultiSiteMode
|
public bool MultiSiteMode
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get(false);
|
return Get(false);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -219,44 +229,44 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>(null);
|
return Get<string>(null);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public int ProxyPort
|
public int ProxyPort
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get(8080);
|
return Get(8080);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ProxyUsername
|
public string ProxyUsername
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>(null);
|
return Get<string>(null);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string ProxyPassword
|
public string ProxyPassword
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.GetDeobsfucated(null);
|
return GetDeobsfucated(null);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.SetObsfucated(value);
|
SetObsfucated(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
@@ -266,14 +276,14 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>(null);
|
return Get<string>(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public string DeploymentSecret
|
public string DeploymentSecret
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<string>(null);
|
return Get<string>(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public short DeploymentChecksum
|
public short DeploymentChecksum
|
||||||
@@ -296,25 +306,25 @@ namespace Disco.Data.Configuration
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<UpdateResponseV2>(null);
|
return Get<UpdateResponseV2>(null);
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set(value);
|
Set(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public bool UpdateBetaDeployment
|
public bool UpdateBetaDeployment
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
return this.Get<bool>(false);
|
return Get(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public Version InstalledDatabaseVersion
|
public Version InstalledDatabaseVersion
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var versionString = this.Get<string>(null);
|
var versionString = Get<string>(null);
|
||||||
if (string.IsNullOrEmpty(versionString))
|
if (string.IsNullOrEmpty(versionString))
|
||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
@@ -322,7 +332,7 @@ namespace Disco.Data.Configuration
|
|||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
this.Set<string>(value.ToString(4));
|
Set(value.ToString(4));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|||||||
@@ -77,6 +77,7 @@
|
|||||||
<Compile Include="Configuration\ConfigurationCache.cs" />
|
<Compile Include="Configuration\ConfigurationCache.cs" />
|
||||||
<Compile Include="Configuration\Modules\ActiveDirectoryConfiguration.cs" />
|
<Compile Include="Configuration\Modules\ActiveDirectoryConfiguration.cs" />
|
||||||
<Compile Include="Configuration\Modules\DevicesConfiguration.cs" />
|
<Compile Include="Configuration\Modules\DevicesConfiguration.cs" />
|
||||||
|
<Compile Include="Configuration\Modules\DocumentsConfiguration.cs" />
|
||||||
<Compile Include="Configuration\Modules\JobPreferencesConfiguration.cs" />
|
<Compile Include="Configuration\Modules\JobPreferencesConfiguration.cs" />
|
||||||
<Compile Include="Configuration\SystemConfiguration.cs" />
|
<Compile Include="Configuration\SystemConfiguration.cs" />
|
||||||
<Compile Include="Configuration\Modules\BootstrapperConfiguration.cs" />
|
<Compile Include="Configuration\Modules\BootstrapperConfiguration.cs" />
|
||||||
|
|||||||
@@ -60,6 +60,7 @@
|
|||||||
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfile.cs" />
|
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfile.cs" />
|
||||||
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfileStore.cs" />
|
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfileStore.cs" />
|
||||||
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfileTransformation.cs" />
|
<Compile Include="ClientServices\EnrolmentInformation\WirelessProfileTransformation.cs" />
|
||||||
|
<Compile Include="Services\Documents\DocumentTemplatePackage.cs" />
|
||||||
<Compile Include="Services\Jobs\LocationModes.cs" />
|
<Compile Include="Services\Jobs\LocationModes.cs" />
|
||||||
<Compile Include="ClientServices\EnrolmentInformation\Certificate.cs" />
|
<Compile Include="ClientServices\EnrolmentInformation\Certificate.cs" />
|
||||||
<Compile Include="ClientServices\Register.cs" />
|
<Compile Include="ClientServices\Register.cs" />
|
||||||
@@ -157,10 +158,12 @@
|
|||||||
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModel.cs" />
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModel.cs" />
|
||||||
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModelItem.cs" />
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileIndexModelItem.cs" />
|
||||||
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileShowModel.cs" />
|
<Compile Include="UI\Config\DeviceProfile\ConfigDeviceProfileShowModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreatePackageModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreateModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateCreateModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateExpressionBrowserModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateExpressionBrowserModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateImportStatusModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateImportStatusModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateIndexModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateIndexModel.cs" />
|
||||||
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateShowPackageModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateShowModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateShowModel.cs" />
|
||||||
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateUndetectedPagesModel.cs" />
|
<Compile Include="UI\Config\DocumentTemplate\ConfigDocumentTemplateUndetectedPagesModel.cs" />
|
||||||
<Compile Include="UI\Config\Enrolment\ConfigEnrolmentIndexModel.cs" />
|
<Compile Include="UI\Config\Enrolment\ConfigEnrolmentIndexModel.cs" />
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
|
|||||||
@@ -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<string> JobSubTypes { get; set; }
|
||||||
|
|
||||||
|
public List<string> DocumentTemplateIds { get; set; }
|
||||||
|
|
||||||
|
[DataType(DataType.MultilineText)]
|
||||||
|
public string FilterExpression { get; set; }
|
||||||
|
[DataType(DataType.MultilineText)]
|
||||||
|
public string OnGenerateExpression { get; set; }
|
||||||
|
|
||||||
|
public bool IsHidden { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Indicates blank pages should be added so that documents will be separated when duplex printed.
|
||||||
|
/// </summary>
|
||||||
|
public bool InsertBlankPages { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,24 +1,20 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Disco.Models.UI.Config.DocumentTemplate
|
namespace Disco.Models.UI.Config.DocumentTemplate
|
||||||
{
|
{
|
||||||
public interface ConfigDocumentTemplateCreateModel : BaseUIModel
|
public interface ConfigDocumentTemplateCreateModel : BaseUIModel
|
||||||
{
|
{
|
||||||
Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
|
Repository.DocumentTemplate DocumentTemplate { get; set; }
|
||||||
|
|
||||||
List<string> Types { get; set; }
|
List<string> Types { get; set; }
|
||||||
List<string> SubTypes { get; set; }
|
List<string> SubTypes { get; set; }
|
||||||
|
|
||||||
List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
List<Repository.JobType> JobTypes { get; set; }
|
||||||
List<Disco.Models.Repository.JobSubType> JobSubTypes { get; set; }
|
List<Repository.JobSubType> JobSubTypes { get; set; }
|
||||||
|
|
||||||
List<string> Scopes { get; }
|
List<string> Scopes { get; }
|
||||||
|
|
||||||
List<Disco.Models.Repository.JobType> GetJobTypes { get; }
|
List<Repository.JobType> GetJobTypes { get; }
|
||||||
List<Disco.Models.Repository.JobSubType> GetJobSubTypes { get; }
|
List<Repository.JobSubType> GetJobSubTypes { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<string> Scopes { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,9 +1,12 @@
|
|||||||
using System.Collections.Generic;
|
using Disco.Models.Services.Documents;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Disco.Models.UI.Config.DocumentTemplate
|
namespace Disco.Models.UI.Config.DocumentTemplate
|
||||||
{
|
{
|
||||||
public interface ConfigDocumentTemplateIndexModel : BaseUIModel
|
public interface ConfigDocumentTemplateIndexModel : BaseUIModel
|
||||||
{
|
{
|
||||||
Dictionary<Repository.DocumentTemplate, int> DocumentTemplates { get; set; }
|
Dictionary<Repository.DocumentTemplate, int> DocumentTemplates { get; set; }
|
||||||
|
|
||||||
|
List<DocumentTemplatePackage> Packages { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,17 +1,15 @@
|
|||||||
using System;
|
using System.Collections.Generic;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Disco.Models.UI.Config.DocumentTemplate
|
namespace Disco.Models.UI.Config.DocumentTemplate
|
||||||
{
|
{
|
||||||
public interface ConfigDocumentTemplateShowModel : BaseUIModel
|
public interface ConfigDocumentTemplateShowModel : BaseUIModel
|
||||||
{
|
{
|
||||||
Disco.Models.Repository.DocumentTemplate DocumentTemplate { get; set; }
|
Repository.DocumentTemplate DocumentTemplate { get; set; }
|
||||||
int StoredInstanceCount { get; set; }
|
int StoredInstanceCount { get; set; }
|
||||||
|
List<bool> TemplatePagesHaveAttachmentId { get; set; }
|
||||||
|
int TemplatePageCount { get; }
|
||||||
|
|
||||||
List<Disco.Models.Repository.JobType> JobTypes { get; set; }
|
List<Repository.JobType> JobTypes { get; set; }
|
||||||
|
|
||||||
List<string> Scopes { get; }
|
List<string> Scopes { get; }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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<JobSubType> JobSubTypesSelected { get; set; }
|
||||||
|
List<Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
List<Repository.DocumentTemplate> DocumentTemplatesSelected { get; set; }
|
||||||
|
|
||||||
|
List<JobType> JobTypes { get; set; }
|
||||||
|
|
||||||
|
List<string> Scopes { get; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Disco.Models.BI.Config;
|
using Disco.Models.BI.Config;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@@ -18,5 +19,6 @@ namespace Disco.Models.UI.Device
|
|||||||
List<Repository.DeviceCertificate> Certificates { get; set; }
|
List<Repository.DeviceCertificate> Certificates { get; set; }
|
||||||
|
|
||||||
List<Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
List<Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 Disco.Models.Services.Jobs.JobLists;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -10,6 +11,7 @@ namespace Disco.Models.UI.Job
|
|||||||
Repository.Job Job { get; set; }
|
Repository.Job Job { get; set; }
|
||||||
TimeSpan? LongRunning { get; set; }
|
TimeSpan? LongRunning { get; set; }
|
||||||
List<Repository.DocumentTemplate> AvailableDocumentTemplates { get; set; }
|
List<Repository.DocumentTemplate> AvailableDocumentTemplates { get; set; }
|
||||||
|
List<DocumentTemplatePackage> AvailableDocumentTemplatePackages { get; set; }
|
||||||
List<Repository.JobSubType> UpdatableJobSubTypes { get; set; }
|
List<Repository.JobSubType> UpdatableJobSubTypes { get; set; }
|
||||||
List<Repository.JobQueue> AvailableQueues { get; set; }
|
List<Repository.JobQueue> AvailableQueues { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.Services.Authorization;
|
using Disco.Models.Services.Authorization;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
@@ -10,6 +11,7 @@ namespace Disco.Models.UI.User
|
|||||||
Disco.Models.Repository.User User { get; set; }
|
Disco.Models.Repository.User User { get; set; }
|
||||||
JobTableModel Jobs { get; set; }
|
JobTableModel Jobs { get; set; }
|
||||||
List<DocumentTemplate> DocumentTemplates { get; set; }
|
List<DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||||
|
|
||||||
List<UserFlag> AvailableUserFlags { get; set; }
|
List<UserFlag> AvailableUserFlags { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.Services.Documents;
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Expressions;
|
using Disco.Services.Expressions;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using Disco.Services.Users;
|
using Disco.Services.Users;
|
||||||
@@ -54,6 +55,10 @@ namespace Disco.Services
|
|||||||
|
|
||||||
return ats.Where(at => at.FilterExpressionMatches(d, Database, User, TimeStamp, DocumentState.DefaultState())).ToList();
|
return ats.Where(at => at.FilterExpressionMatches(d, Database, User, TimeStamp, DocumentState.DefaultState())).ToList();
|
||||||
}
|
}
|
||||||
|
public static List<DocumentTemplatePackage> AvailableDocumentTemplatePackages(this Device d, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
return DocumentTemplatePackages.AvailablePackages(d, Database, TechnicianUser);
|
||||||
|
}
|
||||||
|
|
||||||
public static bool UpdateLastNetworkLogonDate(this Device Device)
|
public static bool UpdateLastNetworkLogonDate(this Device Device)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -281,9 +281,11 @@
|
|||||||
<Compile Include="Documents\AttachmentImport\ImportPage.cs" />
|
<Compile Include="Documents\AttachmentImport\ImportPage.cs" />
|
||||||
<Compile Include="Documents\AttachmentImport\ThumbnailUpdateTask.cs" />
|
<Compile Include="Documents\AttachmentImport\ThumbnailUpdateTask.cs" />
|
||||||
<Compile Include="Documents\DocumentsLog.cs" />
|
<Compile Include="Documents\DocumentsLog.cs" />
|
||||||
|
<Compile Include="Documents\DocumentTemplatePackageExtensions.cs" />
|
||||||
<Compile Include="Documents\DocumentTemplateExtensions.cs" />
|
<Compile Include="Documents\DocumentTemplateExtensions.cs" />
|
||||||
<Compile Include="Documents\DocumentTemplateDataStoreExtensions.cs" />
|
<Compile Include="Documents\DocumentTemplateDataStoreExtensions.cs" />
|
||||||
<Compile Include="Documents\DocumentTemplateExpressionExtensions.cs" />
|
<Compile Include="Documents\DocumentTemplateExpressionExtensions.cs" />
|
||||||
|
<Compile Include="Documents\DocumentTemplatePackages.cs" />
|
||||||
<Compile Include="Documents\DocumentUniqueIdentifier.cs" />
|
<Compile Include="Documents\DocumentUniqueIdentifier.cs" />
|
||||||
<Compile Include="Documents\DocumentUniqueIdentifierExtensions.cs" />
|
<Compile Include="Documents\DocumentUniqueIdentifierExtensions.cs" />
|
||||||
<Compile Include="Documents\ManagedGroups\DocumentTemplateDevicesManagedGroup.cs" />
|
<Compile Include="Documents\ManagedGroups\DocumentTemplateDevicesManagedGroup.cs" />
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ using Disco.Models.Services.Documents;
|
|||||||
using Disco.Services.Documents;
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Expressions;
|
using Disco.Services.Expressions;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Disco.Services
|
namespace Disco.Services
|
||||||
@@ -27,11 +26,11 @@ namespace Disco.Services
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(dt.FilterExpression))
|
if (!string.IsNullOrEmpty(dt.FilterExpression))
|
||||||
{
|
{
|
||||||
Expression compiledExpression = dt.FilterExpressionFromCache();
|
var compiledExpression = dt.FilterExpressionFromCache();
|
||||||
System.Collections.IDictionary evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
|
var evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
object er = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
var er = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
||||||
if (er is bool)
|
if (er is bool)
|
||||||
{
|
{
|
||||||
return (bool)er;
|
return (bool)er;
|
||||||
@@ -60,26 +59,19 @@ namespace Disco.Services
|
|||||||
ExpressionCache.InvalidateKey("DocumentTemplate_OnImportExpression", dt.Id);
|
ExpressionCache.InvalidateKey("DocumentTemplate_OnImportExpression", dt.Id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string EvaluateOnAttachmentImportExpression(this DocumentTemplate dt, object Data, DiscoDataContext Database, User User, DateTime TimeStamp, List<DocumentUniqueIdentifier> PageIdentifiers)
|
public static string EvaluateOnAttachmentImportExpression(this DocumentTemplate dt, IAttachment Data, DiscoDataContext Database, User User, DateTime TimeStamp, List<DocumentUniqueIdentifier> PageIdentifiers)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(dt.OnImportAttachmentExpression))
|
if (!string.IsNullOrEmpty(dt.OnImportAttachmentExpression))
|
||||||
{
|
{
|
||||||
Expression compiledExpression = dt.OnImportAttachmentExpressionFromCache();
|
var compiledExpression = dt.OnImportAttachmentExpressionFromCache();
|
||||||
IDictionary evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, null);
|
var evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, null);
|
||||||
evaluatorVariables.Add("PageIdentifiers", PageIdentifiers);
|
evaluatorVariables.Add("PageIdentifiers", PageIdentifiers);
|
||||||
try
|
var result = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
||||||
{
|
|
||||||
object result = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
return null;
|
return null;
|
||||||
else
|
else
|
||||||
return result.ToString();
|
return result.ToString();
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,18 +89,12 @@ namespace Disco.Services
|
|||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(dt.OnGenerateExpression))
|
if (!string.IsNullOrEmpty(dt.OnGenerateExpression))
|
||||||
{
|
{
|
||||||
Expression compiledExpression = dt.OnGenerateExpressionFromCache();
|
var compiledExpression = dt.OnGenerateExpressionFromCache();
|
||||||
System.Collections.IDictionary evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
|
var evaluatorVariables = Expression.StandardVariables(dt, Database, User, TimeStamp, State);
|
||||||
try
|
|
||||||
{
|
var result = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
||||||
object result = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
|
||||||
return result.ToString();
|
return result.ToString();
|
||||||
}
|
}
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,13 @@
|
|||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
|
|
||||||
namespace Disco.Services
|
namespace Disco.Services
|
||||||
{
|
{
|
||||||
public static class DocumentTemplateActionExtensions
|
public static class DocumentTemplateExtensions
|
||||||
{
|
{
|
||||||
|
|
||||||
public static Bitmap GenerateTemplatePreview(this DocumentTemplate DocumentTemplate, DiscoDataContext Database, int Width, int PageGapHeight, bool DrawPageBorder)
|
public static Bitmap GenerateTemplatePreview(this DocumentTemplate DocumentTemplate, DiscoDataContext Database, int Width, int PageGapHeight, bool DrawPageBorder)
|
||||||
|
|||||||
@@ -0,0 +1,143 @@
|
|||||||
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Services.Expressions;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Disco.Services
|
||||||
|
{
|
||||||
|
public static class DocumentTemplatePackageExtensions
|
||||||
|
{
|
||||||
|
public static List<JobSubType> GetJobSubTypes(this DocumentTemplatePackage package, IEnumerable<JobSubType> JobSubTypes)
|
||||||
|
{
|
||||||
|
var result = new List<JobSubType>();
|
||||||
|
|
||||||
|
if (package.JobSubTypes != null && package.JobSubTypes.Count > 0)
|
||||||
|
{
|
||||||
|
foreach (var jobSubTypeRefId in package.JobSubTypes)
|
||||||
|
{
|
||||||
|
var jobTypeId = jobSubTypeRefId.Substring(0, jobSubTypeRefId.IndexOf('_'));
|
||||||
|
var jobSubTypeId = jobSubTypeRefId.Substring(jobTypeId.Length + 1);
|
||||||
|
result.Add(JobSubTypes.First(jst => jst.JobTypeId == jobTypeId && jst.Id == jobSubTypeId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplate> GetDocumentTemplates(this DocumentTemplatePackage package, DiscoDataContext Database)
|
||||||
|
{
|
||||||
|
var result = new List<DocumentTemplate>();
|
||||||
|
|
||||||
|
if (package.DocumentTemplateIds != null && package.DocumentTemplateIds.Count > 0)
|
||||||
|
{
|
||||||
|
var dbScope = package.Scope.ToString();
|
||||||
|
var dbTemplates = Database.DocumentTemplates
|
||||||
|
.Where(dt => package.DocumentTemplateIds.Contains(dt.Id) && dt.Scope == dbScope)
|
||||||
|
.ToList();
|
||||||
|
|
||||||
|
foreach (var id in package.DocumentTemplateIds)
|
||||||
|
{
|
||||||
|
var template = dbTemplates.FirstOrDefault(t => t.Id.Equals(id, StringComparison.OrdinalIgnoreCase));
|
||||||
|
if (template != null)
|
||||||
|
{
|
||||||
|
result.Add(template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplate> GetDocumentTemplates(this DocumentTemplatePackage package, IEnumerable<DocumentTemplate> DocumentTemplates)
|
||||||
|
{
|
||||||
|
var result = new List<DocumentTemplate>();
|
||||||
|
|
||||||
|
if (package.DocumentTemplateIds != null && package.DocumentTemplateIds.Count > 0)
|
||||||
|
{
|
||||||
|
var dbScope = package.Scope.ToString();
|
||||||
|
foreach (var id in package.DocumentTemplateIds)
|
||||||
|
{
|
||||||
|
var template = DocumentTemplates.FirstOrDefault(t => t.Id == id && t.Scope == dbScope);
|
||||||
|
if (template != null)
|
||||||
|
{
|
||||||
|
result.Add(template);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Expression FilterExpressionFromCache(this DocumentTemplatePackage package)
|
||||||
|
{
|
||||||
|
return ExpressionCache.GetValue("DocumentTemplatePackage_FilterExpression", package.Id, () => { return Expression.TokenizeSingleDynamic(null, package.FilterExpression, 0); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void FilterExpressionInvalidateCache(this DocumentTemplatePackage package)
|
||||||
|
{
|
||||||
|
ExpressionCache.InvalidateKey("DocumentTemplatePackage_FilterExpression", package.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool FilterExpressionMatches(this DocumentTemplatePackage package, object Data, DiscoDataContext Database, User User, DateTime TimeStamp, DocumentState State)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(package.FilterExpression))
|
||||||
|
{
|
||||||
|
var compiledExpression = package.FilterExpressionFromCache();
|
||||||
|
var evaluatorVariables = Expression.StandardVariables(null, Database, User, TimeStamp, State);
|
||||||
|
evaluatorVariables.Add("Package", package);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
object er = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
||||||
|
if (er is bool)
|
||||||
|
{
|
||||||
|
return (bool)er;
|
||||||
|
}
|
||||||
|
bool erBool;
|
||||||
|
if (bool.TryParse(er.ToString(), out erBool))
|
||||||
|
{
|
||||||
|
return erBool;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Expression OnGenerateExpressionFromCache(this DocumentTemplatePackage package)
|
||||||
|
{
|
||||||
|
return ExpressionCache.GetValue("DocumentTemplatePackage_OnGenerateExpression", package.Id, () => { return Expression.TokenizeSingleDynamic(null, package.OnGenerateExpression, 0); });
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void OnGenerateExpressionInvalidateCache(this DocumentTemplatePackage package)
|
||||||
|
{
|
||||||
|
ExpressionCache.InvalidateKey("DocumentTemplatePackage_OnGenerateExpression", package.Id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string EvaluateOnGenerateExpression(this DocumentTemplatePackage package, object Data, DiscoDataContext Database, User User, DateTime TimeStamp, DocumentState State)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(package.OnGenerateExpression))
|
||||||
|
{
|
||||||
|
Expression compiledExpression = package.OnGenerateExpressionFromCache();
|
||||||
|
System.Collections.IDictionary evaluatorVariables = Expression.StandardVariables(null, Database, User, TimeStamp, State);
|
||||||
|
evaluatorVariables.Add("Package", package);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
object result = compiledExpression.EvaluateFirst<object>(Data, evaluatorVariables);
|
||||||
|
return result.ToString();
|
||||||
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,187 @@
|
|||||||
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Concurrent;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace Disco.Services.Documents
|
||||||
|
{
|
||||||
|
public static class DocumentTemplatePackages
|
||||||
|
{
|
||||||
|
private static ConcurrentDictionary<string, DocumentTemplatePackage> cache;
|
||||||
|
|
||||||
|
static DocumentTemplatePackages()
|
||||||
|
{
|
||||||
|
using (var database = new DiscoDataContext())
|
||||||
|
{
|
||||||
|
var packages = database.DiscoConfiguration.Documents.Packages;
|
||||||
|
if (packages == null)
|
||||||
|
{
|
||||||
|
cache = new ConcurrentDictionary<string, DocumentTemplatePackage>(StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cache = new ConcurrentDictionary<string, DocumentTemplatePackage>(
|
||||||
|
packages.Select(p => new KeyValuePair<string, DocumentTemplatePackage>(p.Id, p)),
|
||||||
|
StringComparer.OrdinalIgnoreCase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplatePackage> GetPackages()
|
||||||
|
=> cache.Values.ToList();
|
||||||
|
|
||||||
|
public static DocumentTemplatePackage GetPackage(string Id)
|
||||||
|
{
|
||||||
|
DocumentTemplatePackage package;
|
||||||
|
if (cache.TryGetValue(Id, out package))
|
||||||
|
return package;
|
||||||
|
else
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<DocumentTemplatePackage> AvailablePackages(DiscoDataContext Database, AttachmentTypes Scope)
|
||||||
|
{
|
||||||
|
var packages = cache.Values.Where(p => p.Scope == Scope).ToList();
|
||||||
|
if (packages.Count > 0)
|
||||||
|
{
|
||||||
|
var dbScope = Scope.ToString();
|
||||||
|
var validTemplateIds = Database.DocumentTemplates
|
||||||
|
.Where(dt => dt.Scope == dbScope)
|
||||||
|
.Select(dt => dt.Id).ToList();
|
||||||
|
|
||||||
|
return packages.Where(p =>
|
||||||
|
!p.IsHidden &&
|
||||||
|
p.DocumentTemplateIds != null && p.DocumentTemplateIds.Count > 0 &&
|
||||||
|
p.DocumentTemplateIds.Count(id => validTemplateIds.Contains(id)) > 0);
|
||||||
|
}
|
||||||
|
return Enumerable.Empty<DocumentTemplatePackage>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplatePackage> AvailablePackages(this Device device, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
var packages = new List<DocumentTemplatePackage>();
|
||||||
|
|
||||||
|
foreach (var package in AvailablePackages(Database, AttachmentTypes.Device))
|
||||||
|
{
|
||||||
|
if (package.FilterExpressionMatches(device, Database, TechnicianUser, DateTime.Now, DocumentState.DefaultState()))
|
||||||
|
{
|
||||||
|
packages.Add(package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return packages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplatePackage> AvailablePackages(this Job job, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
var packages = new List<DocumentTemplatePackage>();
|
||||||
|
|
||||||
|
foreach (var package in AvailablePackages(Database, AttachmentTypes.Job))
|
||||||
|
{
|
||||||
|
bool subTypeMatch = true; // default match
|
||||||
|
if (package.JobSubTypes != null && package.JobSubTypes.Count > 0)
|
||||||
|
{
|
||||||
|
subTypeMatch = false; // enforce match
|
||||||
|
foreach (var subType in job.JobSubTypes)
|
||||||
|
{
|
||||||
|
if (package.JobSubTypes.Contains($"{subType.JobTypeId}_{subType.Id}", StringComparer.OrdinalIgnoreCase))
|
||||||
|
{
|
||||||
|
subTypeMatch = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (subTypeMatch)
|
||||||
|
{
|
||||||
|
if (package.FilterExpressionMatches(job, Database, TechnicianUser, DateTime.Now, DocumentState.DefaultState()))
|
||||||
|
{
|
||||||
|
packages.Add(package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return packages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplatePackage> AvailablePackages(this User user, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
var packages = new List<DocumentTemplatePackage>();
|
||||||
|
|
||||||
|
foreach (var package in AvailablePackages(Database, AttachmentTypes.User))
|
||||||
|
{
|
||||||
|
if (package.FilterExpressionMatches(user, Database, TechnicianUser, DateTime.Now, DocumentState.DefaultState()))
|
||||||
|
{
|
||||||
|
packages.Add(package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return packages;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DocumentTemplatePackage CreatePackage(DocumentTemplatePackage Package)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(Package.Id))
|
||||||
|
throw new ArgumentNullException(nameof(Package), "The Package Id is required");
|
||||||
|
if (cache.ContainsKey(Package.Id)) // Name Unique
|
||||||
|
throw new ArgumentException("Another Package already exists with that Id", nameof(Package));
|
||||||
|
if (string.IsNullOrWhiteSpace(Package.Description))
|
||||||
|
throw new ArgumentNullException(nameof(Package), "The Package Description is required");
|
||||||
|
|
||||||
|
if (cache.TryAdd(Package.Id, Package))
|
||||||
|
{
|
||||||
|
PersistCache();
|
||||||
|
return Package;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw new Exception("Unable to add the Package to the Cache, check the Package Id and try again");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static DocumentTemplatePackage UpdatePackage(DocumentTemplatePackage Package)
|
||||||
|
{
|
||||||
|
DocumentTemplatePackage existingPackage;
|
||||||
|
|
||||||
|
if (string.IsNullOrWhiteSpace(Package.Id))
|
||||||
|
throw new ArgumentNullException(nameof(Package), "The Package Id is required");
|
||||||
|
if (!cache.TryGetValue(Package.Id, out existingPackage)) // Name Unique
|
||||||
|
throw new ArgumentException("The Package Id does not exist", nameof(Package));
|
||||||
|
if (string.IsNullOrWhiteSpace(Package.Description))
|
||||||
|
throw new ArgumentNullException(nameof(Package), "The Package Description is required");
|
||||||
|
|
||||||
|
if (cache.TryUpdate(Package.Id, Package, existingPackage))
|
||||||
|
{
|
||||||
|
PersistCache();
|
||||||
|
return Package;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
throw new Exception("Unable to update the Package in the Cache, there were concurrent updates to the same package");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void RemovePackage(string Id)
|
||||||
|
{
|
||||||
|
DocumentTemplatePackage existingPackage;
|
||||||
|
if (cache.TryRemove(Id, out existingPackage))
|
||||||
|
{
|
||||||
|
PersistCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void PersistCache()
|
||||||
|
{
|
||||||
|
var packages = cache.Values.ToList();
|
||||||
|
if (packages.Count == 0)
|
||||||
|
packages = null;
|
||||||
|
|
||||||
|
using (var database = new DiscoDataContext())
|
||||||
|
{
|
||||||
|
database.DiscoConfiguration.Documents.Packages = packages;
|
||||||
|
|
||||||
|
database.SaveChanges();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Services.Logging;
|
using Disco.Services.Logging;
|
||||||
using Disco.Services.Logging.Models;
|
using Disco.Services.Logging.Models;
|
||||||
|
|
||||||
@@ -23,7 +24,9 @@ namespace Disco.Services.Documents
|
|||||||
ImportPageError = 120,
|
ImportPageError = 120,
|
||||||
ImportPageUndetectedStored = 150,
|
ImportPageUndetectedStored = 150,
|
||||||
DocumentGenerated = 500,
|
DocumentGenerated = 500,
|
||||||
DocumentGeneratedWithExpression
|
DocumentGeneratedWithExpression,
|
||||||
|
DocumentPackageGenerated = 600,
|
||||||
|
DocumentPackageGeneratedWithExpression,
|
||||||
}
|
}
|
||||||
|
|
||||||
private const int _ModuleId = 40;
|
private const int _ModuleId = 40;
|
||||||
@@ -175,93 +178,41 @@ namespace Disco.Services.Documents
|
|||||||
PageNumber
|
PageNumber
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, Device Device, User Author, string ExpressionResult)
|
|
||||||
{
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGeneratedWithExpression, new object[]
|
|
||||||
{
|
|
||||||
Template.Id,
|
|
||||||
Device.SerialNumber,
|
|
||||||
Author.UserId,
|
|
||||||
ExpressionResult
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, Job Job, User Author, string ExpressionResult)
|
|
||||||
{
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGeneratedWithExpression, new object[]
|
|
||||||
{
|
|
||||||
Template.Id,
|
|
||||||
Job.Id,
|
|
||||||
Author.UserId,
|
|
||||||
ExpressionResult
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, User User, User Author, string ExpressionResult)
|
|
||||||
{
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGeneratedWithExpression, new object[]
|
|
||||||
{
|
|
||||||
Template.Id,
|
|
||||||
User.UserId,
|
|
||||||
Author.UserId,
|
|
||||||
ExpressionResult
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, IAttachmentTarget Data, User Author, string ExpressionResult)
|
public static void LogDocumentGenerated(DocumentTemplate Template, IAttachmentTarget Data, User Author, string ExpressionResult)
|
||||||
{
|
{
|
||||||
if (Data is Job)
|
Log(EventTypeIds.DocumentGeneratedWithExpression, new object[]
|
||||||
LogDocumentGenerated(Template, (Job)Data, Author, ExpressionResult);
|
|
||||||
else if (Data is User)
|
|
||||||
LogDocumentGenerated(Template, (User)Data, Author, ExpressionResult);
|
|
||||||
else if (Data is Device)
|
|
||||||
LogDocumentGenerated(Template, (Device)Data, Author, ExpressionResult);
|
|
||||||
else
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGeneratedWithExpression, new object[]
|
|
||||||
{
|
{
|
||||||
Template.Id,
|
Template.Id,
|
||||||
"UNKNOWN",
|
Data.AttachmentReferenceId,
|
||||||
Author.UserId,
|
Author.UserId,
|
||||||
ExpressionResult
|
ExpressionResult
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, Device Device, User Author)
|
public static void LogDocumentPackageGenerated(DocumentTemplatePackage Package, IAttachmentTarget Data, User Author, string ExpressionResult)
|
||||||
{
|
{
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGenerated, new object[]
|
Log(EventTypeIds.DocumentPackageGeneratedWithExpression, new object[]
|
||||||
|
{
|
||||||
|
Package.Id,
|
||||||
|
Data.AttachmentReferenceId,
|
||||||
|
Author.UserId,
|
||||||
|
ExpressionResult
|
||||||
|
});
|
||||||
|
}
|
||||||
|
public static void LogDocumentGenerated(DocumentTemplate Template, IAttachmentTarget Data, User Author)
|
||||||
|
{
|
||||||
|
Log(EventTypeIds.DocumentGenerated, new object[]
|
||||||
{
|
{
|
||||||
Template.Id,
|
Template.Id,
|
||||||
Device.SerialNumber,
|
Data.AttachmentReferenceId,
|
||||||
Author.UserId
|
Author.UserId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, Job Job, User Author)
|
public static void LogDocumentPackageGenerated(DocumentTemplatePackage Package, IAttachmentTarget Data, User Author)
|
||||||
{
|
{
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGenerated, new object[]
|
Log(EventTypeIds.DocumentPackageGenerated, new object[]
|
||||||
{
|
{
|
||||||
Template.Id,
|
Package.Id,
|
||||||
Job.Id,
|
Data.AttachmentReferenceId,
|
||||||
Author.UserId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, User User, User Author)
|
|
||||||
{
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGenerated, new object[]
|
|
||||||
{
|
|
||||||
Template.Id,
|
|
||||||
User.UserId,
|
|
||||||
Author.UserId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
public static void LogDocumentGenerated(DocumentTemplate Template, object Data, User Author)
|
|
||||||
{
|
|
||||||
if (Data is Job)
|
|
||||||
LogDocumentGenerated(Template, (Job)Data, Author);
|
|
||||||
else if (Data is User)
|
|
||||||
LogDocumentGenerated(Template, (User)Data, Author);
|
|
||||||
else if (Data is Device)
|
|
||||||
LogDocumentGenerated(Template, (Device)Data, Author);
|
|
||||||
else
|
|
||||||
DocumentsLog.Log(DocumentsLog.EventTypeIds.DocumentGenerated, new object[]
|
|
||||||
{
|
|
||||||
Template.Id,
|
|
||||||
"UNKNOWN",
|
|
||||||
Author.UserId
|
Author.UserId
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -433,6 +384,28 @@ namespace Disco.Services.Documents
|
|||||||
UseLive = true,
|
UseLive = true,
|
||||||
UsePersist = true,
|
UsePersist = true,
|
||||||
UseDisplay = true
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.DocumentPackageGenerated,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Document Package Generated",
|
||||||
|
Format = "A '{0}' document package was generated for '{1}' by '{2}'",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
|
},
|
||||||
|
new LogEventType
|
||||||
|
{
|
||||||
|
Id = (int)EventTypeIds.DocumentPackageGeneratedWithExpression,
|
||||||
|
ModuleId = _ModuleId,
|
||||||
|
Name = "Document Package Generated with Expression",
|
||||||
|
Format = "A '{0}' document package was generated for '{1}' by '{2}'. The expression returned: {3}",
|
||||||
|
Severity = (int)LogEventType.Severities.Information,
|
||||||
|
UseLive = true,
|
||||||
|
UsePersist = true,
|
||||||
|
UseDisplay = true
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ using Disco.Models.Repository;
|
|||||||
using Disco.Models.Services.Documents;
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Expressions;
|
using Disco.Services.Expressions;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using Disco.Services.Plugins;
|
using Disco.Services.Plugins;
|
||||||
@@ -230,6 +231,10 @@ namespace Disco.Services
|
|||||||
|
|
||||||
return dts;
|
return dts;
|
||||||
}
|
}
|
||||||
|
public static List<DocumentTemplatePackage> AvailableDocumentTemplatePackages(this Job j, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
return DocumentTemplatePackages.AvailablePackages(j, Database, TechnicianUser);
|
||||||
|
}
|
||||||
|
|
||||||
public static DateTime ValidateDateAfterOpened(this Job j, DateTime d)
|
public static DateTime ValidateDateAfterOpened(this Job j, DateTime d)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.Services.Documents;
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -35,6 +36,11 @@ namespace Disco.Services
|
|||||||
return dts;
|
return dts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static List<DocumentTemplatePackage> AvailableDocumentTemplatePackages(this User u, DiscoDataContext Database, User TechnicianUser)
|
||||||
|
{
|
||||||
|
return DocumentTemplatePackages.AvailablePackages(u, Database, TechnicianUser);
|
||||||
|
}
|
||||||
|
|
||||||
public static List<DeviceUserAssignment> CurrentDeviceUserAssignments(this User u)
|
public static List<DeviceUserAssignment> CurrentDeviceUserAssignments(this User u)
|
||||||
{
|
{
|
||||||
return u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).ToList();
|
return u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).ToList();
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
using System;
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
using Disco.Models.Repository;
|
|
||||||
|
|
||||||
namespace Disco.Web.Extensions
|
namespace Disco.Web.Extensions
|
||||||
{
|
{
|
||||||
@@ -16,5 +15,13 @@ namespace Disco.Web.Extensions
|
|||||||
else
|
else
|
||||||
return documentTemplates.Select(dt => new SelectListItem { Value = dt.Id, Text = dt.Description, Selected = (SelectedId == dt.Id) }).ToList();
|
return documentTemplates.Select(dt => new SelectListItem { Value = dt.Id, Text = dt.Description, Selected = (SelectedId == dt.Id) }).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static IEnumerable<SelectListItem> ToSelectListItems(this IEnumerable<DocumentTemplatePackage> documentTemplatePackages, string SelectedId = null)
|
||||||
|
{
|
||||||
|
if (SelectedId == null)
|
||||||
|
return documentTemplatePackages.Select(dt => new SelectListItem { Value = $"Package:{dt.Id}", Text = $"Package: {dt.Description}" }).ToList();
|
||||||
|
else
|
||||||
|
return documentTemplatePackages.Select(dt => new SelectListItem { Value = $"Package:{dt.Id}", Text = $"Package: {dt.Description}", Selected = (SelectedId == dt.Id) }).ToList();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ using Disco.Services;
|
|||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
using Disco.Services.Devices.Exporting;
|
using Disco.Services.Devices.Exporting;
|
||||||
using Disco.Services.Devices.Importing;
|
using Disco.Services.Devices.Importing;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Interop;
|
using Disco.Services.Interop;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using Disco.Services.Users;
|
using Disco.Services.Users;
|
||||||
@@ -380,9 +381,10 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public virtual ActionResult GeneratePdf(string id, string DocumentTemplateId)
|
public virtual ActionResult GeneratePdf(string id, string DocumentTemplateId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
throw new ArgumentNullException("id");
|
throw new ArgumentNullException(nameof(id));
|
||||||
if (string.IsNullOrEmpty(DocumentTemplateId))
|
if (string.IsNullOrEmpty(DocumentTemplateId))
|
||||||
throw new ArgumentNullException("AttachmentTypeId");
|
throw new ArgumentNullException(nameof(DocumentTemplateId));
|
||||||
|
|
||||||
var device = Database.Devices.Find(id);
|
var device = Database.Devices.Find(id);
|
||||||
if (device != null)
|
if (device != null)
|
||||||
{
|
{
|
||||||
@@ -400,12 +402,49 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new ArgumentException("Invalid Document Template Id", "id");
|
throw new ArgumentException("Invalid Document Template Id", nameof(DocumentTemplateId));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new ArgumentException("Invalid Serial Number", "id");
|
throw new ArgumentException("Invalid Serial Number", nameof(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[DiscoAuthorize(Claims.Device.Actions.GenerateDocuments)]
|
||||||
|
public virtual ActionResult GeneratePdfPackage(string id, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException(nameof(id));
|
||||||
|
if (string.IsNullOrEmpty(DocumentTemplatePackageId))
|
||||||
|
throw new ArgumentNullException(nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
var device = Database.Devices.Find(id);
|
||||||
|
if (device != null)
|
||||||
|
{
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(DocumentTemplatePackageId);
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
if (package.Scope != AttachmentTypes.Device)
|
||||||
|
throw new ArgumentException("This package cannot be generated from the Device Scope", nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
var timeStamp = DateTime.Now;
|
||||||
|
Stream pdf;
|
||||||
|
using (var generationState = DocumentState.DefaultState())
|
||||||
|
{
|
||||||
|
pdf = package.GeneratePdfPackage(Database, device, UserService.CurrentUser, timeStamp, generationState);
|
||||||
|
}
|
||||||
|
Database.SaveChanges();
|
||||||
|
return File(pdf, "application/pdf", string.Format("{0}_{1}_{2:yyyyMMdd-HHmmss}.pdf", package.Id, device.SerialNumber, timeStamp));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(DocumentTemplatePackageId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid Serial Number", nameof(id));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -568,7 +568,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.UndetectedPages)]
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.UndetectedPages)]
|
||||||
public virtual ActionResult ImporterUndetectedFile(string id, Nullable<bool> Source, Nullable<bool> Thumbnail)
|
public virtual ActionResult ImporterUndetectedFile(string id, bool? Source, bool? Thumbnail)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrEmpty(id))
|
if (!string.IsNullOrEmpty(id))
|
||||||
{
|
{
|
||||||
@@ -659,7 +659,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.BulkGenerate)]
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.BulkGenerate)]
|
||||||
public virtual ActionResult BulkGenerate(string id, string DataIds = null)
|
public virtual ActionResult BulkGenerate(string id, string DataIds = null, bool InsertBlankPage = false)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
throw new ArgumentNullException("id");
|
throw new ArgumentNullException("id");
|
||||||
@@ -686,13 +686,13 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
|
|
||||||
var dataIds = DataIds.Split(new string[] { Environment.NewLine, ",", ";" }, StringSplitOptions.RemoveEmptyEntries).Select(d => d.Trim()).Where(d => !string.IsNullOrEmpty(d)).ToArray();
|
var dataIds = DataIds.Split(new string[] { Environment.NewLine, ",", ";" }, StringSplitOptions.RemoveEmptyEntries).Select(d => d.Trim()).Where(d => !string.IsNullOrEmpty(d)).ToArray();
|
||||||
var timeStamp = DateTime.Now;
|
var timeStamp = DateTime.Now;
|
||||||
var pdf = documentTemplate.GeneratePdfBulk(Database, UserService.CurrentUser, timeStamp, dataIds);
|
var pdf = documentTemplate.GeneratePdfBulk(Database, UserService.CurrentUser, timeStamp, InsertBlankPage, dataIds);
|
||||||
|
|
||||||
return File(pdf, "application/pdf", string.Format("{0}_Bulk_{1:yyyyMMdd-HHmmss}.pdf", documentTemplate.Id, timeStamp));
|
return File(pdf, "application/pdf", string.Format("{0}_Bulk_{1:yyyyMMdd-HHmmss}.pdf", documentTemplate.Id, timeStamp));
|
||||||
}
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Delete)]
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Delete)]
|
||||||
public virtual ActionResult Delete(string id, Nullable<bool> redirect = false)
|
public virtual ActionResult Delete(string id, bool? redirect = false)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,422 @@
|
|||||||
|
using Disco.BI.Extensions;
|
||||||
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Services;
|
||||||
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
|
using Disco.Services.Users;
|
||||||
|
using Disco.Services.Web;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
|
{
|
||||||
|
public partial class DocumentTemplatePackageController : AuthorizedDatabaseController
|
||||||
|
{
|
||||||
|
const string pDescription = "description";
|
||||||
|
const string pScope = "scope";
|
||||||
|
const string pFilterExpression = "filterexpression";
|
||||||
|
const string pOnGenerateExpression = "ongenerateexpression";
|
||||||
|
const string pIsHidden = "ishidden";
|
||||||
|
const string pInsertBlankPages = "insertblankpages";
|
||||||
|
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult Update(string id, string key, string value = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException("id");
|
||||||
|
if (string.IsNullOrEmpty(key))
|
||||||
|
throw new ArgumentNullException("key");
|
||||||
|
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(id);
|
||||||
|
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
switch (key.ToLower())
|
||||||
|
{
|
||||||
|
case pDescription:
|
||||||
|
UpdateDescription(package, value);
|
||||||
|
break;
|
||||||
|
case pScope:
|
||||||
|
UpdateScope(package, value);
|
||||||
|
break;
|
||||||
|
case pFilterExpression:
|
||||||
|
Authorization.Require(Claims.Config.DocumentTemplate.ConfigureFilterExpression);
|
||||||
|
UpdateFilterExpression(package, value);
|
||||||
|
break;
|
||||||
|
case pOnGenerateExpression:
|
||||||
|
UpdateOnGenerateExpression(package, value);
|
||||||
|
break;
|
||||||
|
case pIsHidden:
|
||||||
|
UpdateIsHidden(package, value);
|
||||||
|
break;
|
||||||
|
case pInsertBlankPages:
|
||||||
|
UpdateInsertBlankPages(package, value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new Exception("Invalid Update Key");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new Exception("Invalid Document Template Package Id");
|
||||||
|
}
|
||||||
|
if (redirect)
|
||||||
|
return RedirectToAction(MVC.Config.DocumentTemplate.ShowPackage(package.Id));
|
||||||
|
else
|
||||||
|
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (redirect)
|
||||||
|
throw;
|
||||||
|
else
|
||||||
|
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Update Shortcut Methods
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateDescription(string id, string Description = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pDescription, Description, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateDocumentTemplates(string id, List<string> DocumentTemplates = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException("id");
|
||||||
|
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(id);
|
||||||
|
|
||||||
|
if (package == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(id));
|
||||||
|
|
||||||
|
UpdateDocumentTemplates(package, DocumentTemplates);
|
||||||
|
|
||||||
|
if (redirect)
|
||||||
|
return RedirectToAction(MVC.Config.DocumentTemplate.ShowPackage(package.Id));
|
||||||
|
else
|
||||||
|
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (redirect)
|
||||||
|
throw;
|
||||||
|
else
|
||||||
|
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
[DiscoAuthorizeAll(Claims.Config.DocumentTemplate.Configure, Claims.Config.DocumentTemplate.ConfigureFilterExpression)]
|
||||||
|
public virtual ActionResult UpdateFilterExpression(string id, string FilterExpression = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pFilterExpression, FilterExpression, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorizeAll(Claims.Config.DocumentTemplate.Configure, Claims.Config.DocumentTemplate.ConfigureFilterExpression)]
|
||||||
|
public virtual ActionResult UpdateOnGenerateExpression(string id, string OnGenerateExpression = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pOnGenerateExpression, OnGenerateExpression, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateIsHidden(string id, string IsHidden = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pIsHidden, IsHidden, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateInsertBlankPages(string id, string InsertBlankPages = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pInsertBlankPages, InsertBlankPages, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateScope(string id, string Scope = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
return Update(id, pScope, Scope, redirect);
|
||||||
|
}
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult UpdateJobSubTypes(string id, List<string> JobSubTypes = null, bool redirect = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException("id");
|
||||||
|
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(id);
|
||||||
|
|
||||||
|
if (package == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(id));
|
||||||
|
|
||||||
|
UpdateJobSubTypes(package, JobSubTypes);
|
||||||
|
|
||||||
|
if (redirect)
|
||||||
|
return RedirectToAction(MVC.Config.DocumentTemplate.ShowPackage(package.Id));
|
||||||
|
else
|
||||||
|
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (redirect)
|
||||||
|
throw;
|
||||||
|
else
|
||||||
|
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Update Properties
|
||||||
|
private void UpdateDescription(DocumentTemplatePackage Package, string Description)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(Description))
|
||||||
|
{
|
||||||
|
var description = Description.Trim();
|
||||||
|
if (Package.Description != description)
|
||||||
|
{
|
||||||
|
Package.Description = description;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new Exception("Invalid Description");
|
||||||
|
}
|
||||||
|
private void UpdateDocumentTemplates(DocumentTemplatePackage Package, List<string> DocumentTemplates)
|
||||||
|
{
|
||||||
|
List<string> documentTemplateIds = null;
|
||||||
|
|
||||||
|
if (DocumentTemplates != null && DocumentTemplates.Count > 0)
|
||||||
|
{
|
||||||
|
var packageScope = Package.Scope.ToString();
|
||||||
|
|
||||||
|
// Collect Valid from Database (maintain order)
|
||||||
|
documentTemplateIds = new List<string>(DocumentTemplates.Count);
|
||||||
|
foreach (var templateId in DocumentTemplates)
|
||||||
|
{
|
||||||
|
var dbId = Database.DocumentTemplates
|
||||||
|
.Where(dt => dt.Scope == packageScope && dt.Id == templateId)
|
||||||
|
.Select(dt => dt.Id).FirstOrDefault();
|
||||||
|
if (dbId != null)
|
||||||
|
{
|
||||||
|
documentTemplateIds.Add(dbId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (documentTemplateIds == null)
|
||||||
|
{
|
||||||
|
if (Package.DocumentTemplateIds != null)
|
||||||
|
{
|
||||||
|
Package.DocumentTemplateIds = null;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Package.DocumentTemplateIds == null || Package.DocumentTemplateIds.Count != documentTemplateIds.Count)
|
||||||
|
{
|
||||||
|
Package.DocumentTemplateIds = documentTemplateIds;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Package.DocumentTemplateIds.Zip(documentTemplateIds, (a, b) => a != b).Any(r => r))
|
||||||
|
{
|
||||||
|
Package.DocumentTemplateIds = documentTemplateIds;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
private void UpdateScope(DocumentTemplatePackage Package, string Scope)
|
||||||
|
{
|
||||||
|
AttachmentTypes scope;
|
||||||
|
if (!Enum.TryParse<AttachmentTypes>(Scope, true, out scope))
|
||||||
|
throw new ArgumentException("Invalid Scope", nameof(Scope));
|
||||||
|
|
||||||
|
if (Package.Scope != scope)
|
||||||
|
{
|
||||||
|
Package.Scope = scope;
|
||||||
|
|
||||||
|
// Remove all Templates (none can be of the same scope)
|
||||||
|
Package.DocumentTemplateIds = null;
|
||||||
|
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateFilterExpression(DocumentTemplatePackage Package, string FilterExpression)
|
||||||
|
{
|
||||||
|
string expression;
|
||||||
|
if (string.IsNullOrWhiteSpace(FilterExpression))
|
||||||
|
expression = null;
|
||||||
|
else
|
||||||
|
expression = FilterExpression.Trim();
|
||||||
|
|
||||||
|
if (Package.FilterExpression != expression)
|
||||||
|
{
|
||||||
|
Package.FilterExpression = expression;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
Package.FilterExpressionInvalidateCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateOnGenerateExpression(DocumentTemplatePackage Package, string OnGenerateExpression)
|
||||||
|
{
|
||||||
|
string expression;
|
||||||
|
if (string.IsNullOrWhiteSpace(OnGenerateExpression))
|
||||||
|
expression = null;
|
||||||
|
else
|
||||||
|
expression = OnGenerateExpression.Trim();
|
||||||
|
|
||||||
|
if (Package.OnGenerateExpression != expression)
|
||||||
|
{
|
||||||
|
Package.OnGenerateExpression = expression;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
Package.OnGenerateExpressionInvalidateCache();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateIsHidden(DocumentTemplatePackage Package, string IsHidden)
|
||||||
|
{
|
||||||
|
var isHidden = false;
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(IsHidden) && !bool.TryParse(IsHidden, out isHidden))
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(IsHidden));
|
||||||
|
|
||||||
|
if (Package.IsHidden != isHidden)
|
||||||
|
{
|
||||||
|
Package.IsHidden = isHidden;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateInsertBlankPages(DocumentTemplatePackage Package, string InsertBlankPages)
|
||||||
|
{
|
||||||
|
var insertBlankPages = false;
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(InsertBlankPages) && !bool.TryParse(InsertBlankPages, out insertBlankPages))
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(InsertBlankPages));
|
||||||
|
|
||||||
|
if (Package.InsertBlankPages != insertBlankPages)
|
||||||
|
{
|
||||||
|
Package.InsertBlankPages = insertBlankPages;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void UpdateJobSubTypes(DocumentTemplatePackage Package, List<string> JobSubTypes)
|
||||||
|
{
|
||||||
|
List<string> jobSubTypes = null;
|
||||||
|
|
||||||
|
if (JobSubTypes != null && JobSubTypes.Count > 0)
|
||||||
|
{
|
||||||
|
var subTypeIds = Database.JobSubTypes.Select(jst => jst.JobTypeId + "_" + jst.Id).ToList();
|
||||||
|
|
||||||
|
jobSubTypes = subTypeIds
|
||||||
|
.Where(id => JobSubTypes.Contains(id, StringComparer.OrdinalIgnoreCase))
|
||||||
|
.OrderBy(id => id)
|
||||||
|
.ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (jobSubTypes == null)
|
||||||
|
{
|
||||||
|
if (Package.JobSubTypes != null)
|
||||||
|
{
|
||||||
|
Package.JobSubTypes = null;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Package.JobSubTypes == null || Package.JobSubTypes.Count != jobSubTypes.Count)
|
||||||
|
{
|
||||||
|
Package.JobSubTypes = jobSubTypes;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (Package.JobSubTypes.Zip(jobSubTypes, (a, b) => a != b).Any(r => r))
|
||||||
|
{
|
||||||
|
Package.JobSubTypes = jobSubTypes;
|
||||||
|
DocumentTemplatePackages.UpdatePackage(Package);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region Actions
|
||||||
|
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.BulkGenerate)]
|
||||||
|
public virtual ActionResult BulkGenerate(string id, string DataIds = null, bool InsertBlankPage = false)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException(nameof(id));
|
||||||
|
if (string.IsNullOrEmpty(DataIds))
|
||||||
|
throw new ArgumentNullException(nameof(DataIds));
|
||||||
|
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(id);
|
||||||
|
|
||||||
|
if (package == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", "id");
|
||||||
|
|
||||||
|
switch (package.Scope)
|
||||||
|
{
|
||||||
|
case AttachmentTypes.Device:
|
||||||
|
Authorization.Require(Claims.Device.Actions.GenerateDocuments);
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.Job:
|
||||||
|
Authorization.Require(Claims.Job.Actions.GenerateDocuments);
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.User:
|
||||||
|
Authorization.Require(Claims.User.Actions.GenerateDocuments);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new InvalidOperationException("Unknown DocumentType Scope");
|
||||||
|
}
|
||||||
|
|
||||||
|
var dataIds = DataIds.Split(new string[] { Environment.NewLine, ",", ";" }, StringSplitOptions.RemoveEmptyEntries).Select(d => d.Trim()).Where(d => !string.IsNullOrEmpty(d)).ToList();
|
||||||
|
var timeStamp = DateTime.Now;
|
||||||
|
var pdf = package.GeneratePdfPackageBulk(Database, UserService.CurrentUser, timeStamp, InsertBlankPage, dataIds);
|
||||||
|
|
||||||
|
return File(pdf, "application/pdf", string.Format("{0}_Bulk_{1:yyyyMMdd-HHmmss}.pdf", package.Id, timeStamp));
|
||||||
|
}
|
||||||
|
|
||||||
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.Delete)]
|
||||||
|
public virtual ActionResult Delete(string id, bool? redirect = false)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException("id");
|
||||||
|
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(id);
|
||||||
|
|
||||||
|
if (package == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(id));
|
||||||
|
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
DocumentTemplatePackages.RemovePackage(package.Id);
|
||||||
|
|
||||||
|
if (redirect.HasValue && redirect.Value)
|
||||||
|
return RedirectToAction(MVC.Config.DocumentTemplate.Index(null));
|
||||||
|
else
|
||||||
|
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
throw new Exception("Invalid Document Template Package Id");
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
if (redirect.HasValue && redirect.Value)
|
||||||
|
throw;
|
||||||
|
else
|
||||||
|
return Json(string.Format("Error: {0}", ex.Message), JsonRequestBehavior.AllowGet);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ using Disco.Models.Services.Job;
|
|||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using Disco.Services;
|
using Disco.Services;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Interop;
|
using Disco.Services.Interop;
|
||||||
using Disco.Services.Jobs.JobLists;
|
using Disco.Services.Jobs.JobLists;
|
||||||
using Disco.Services.Jobs.Statistics;
|
using Disco.Services.Jobs.Statistics;
|
||||||
@@ -2086,13 +2087,13 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Job.Actions.GenerateDocuments)]
|
[DiscoAuthorize(Claims.Job.Actions.GenerateDocuments)]
|
||||||
public virtual ActionResult GeneratePdf(string id, string DocumentTemplateId)
|
public virtual ActionResult GeneratePdf(int id, string DocumentTemplateId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(id))
|
if (id <= 0)
|
||||||
throw new ArgumentNullException("id");
|
throw new ArgumentOutOfRangeException(nameof(id));
|
||||||
if (string.IsNullOrEmpty(DocumentTemplateId))
|
if (string.IsNullOrEmpty(DocumentTemplateId))
|
||||||
throw new ArgumentNullException("AttachmentTypeId");
|
throw new ArgumentNullException(nameof(DocumentTemplateId));
|
||||||
var job = Database.Jobs.Find(int.Parse(id));
|
var job = Database.Jobs.Find(id);
|
||||||
if (job != null)
|
if (job != null)
|
||||||
{
|
{
|
||||||
var documentTemplate = Database.DocumentTemplates.Find(DocumentTemplateId);
|
var documentTemplate = Database.DocumentTemplates.Find(DocumentTemplateId);
|
||||||
@@ -2118,6 +2119,44 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DiscoAuthorize(Claims.Job.Actions.GenerateDocuments)]
|
||||||
|
public virtual ActionResult GeneratePdfPackage(int id, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
if (id <= 0)
|
||||||
|
throw new ArgumentOutOfRangeException(nameof(id));
|
||||||
|
if (string.IsNullOrEmpty(DocumentTemplatePackageId))
|
||||||
|
throw new ArgumentNullException(nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
var job = Database.Jobs.Find(id);
|
||||||
|
|
||||||
|
if (job != null)
|
||||||
|
{
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(DocumentTemplatePackageId);
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
if (package.Scope != AttachmentTypes.Job)
|
||||||
|
throw new ArgumentException("This package cannot be generated from the Job Scope", nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
var timeStamp = DateTime.Now;
|
||||||
|
Stream pdf;
|
||||||
|
using (var generationState = DocumentState.DefaultState())
|
||||||
|
{
|
||||||
|
pdf = package.GeneratePdfPackage(Database, job, UserService.CurrentUser, timeStamp, generationState);
|
||||||
|
}
|
||||||
|
Database.SaveChanges();
|
||||||
|
return File(pdf, "application/pdf", string.Format("{0}_{1}_{2:yyyyMMdd-HHmmss}.pdf", package.Id, job.Id, timeStamp));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(DocumentTemplatePackageId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid Job Id", nameof(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Job.Properties.DeviceHeldLocation)]
|
[DiscoAuthorize(Claims.Job.Properties.DeviceHeldLocation)]
|
||||||
public virtual ActionResult DeviceHeldLocations()
|
public virtual ActionResult DeviceHeldLocations()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Disco.BI.Extensions;
|
using Disco.BI.Extensions;
|
||||||
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.Services.Documents;
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Services;
|
using Disco.Services;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Interop;
|
using Disco.Services.Interop;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using Disco.Services.Users;
|
using Disco.Services.Users;
|
||||||
@@ -160,9 +162,9 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public virtual ActionResult GeneratePdf(string id, string Domain, string DocumentTemplateId)
|
public virtual ActionResult GeneratePdf(string id, string Domain, string DocumentTemplateId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
throw new ArgumentNullException("id");
|
throw new ArgumentNullException(nameof(id));
|
||||||
if (string.IsNullOrEmpty(DocumentTemplateId))
|
if (string.IsNullOrEmpty(DocumentTemplateId))
|
||||||
throw new ArgumentNullException("AttachmentTypeId");
|
throw new ArgumentNullException(nameof(DocumentTemplateId));
|
||||||
|
|
||||||
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
|
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
|
||||||
|
|
||||||
@@ -191,6 +193,44 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
throw new ArgumentException("Invalid User Id", "id");
|
throw new ArgumentException("Invalid User Id", "id");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
[DiscoAuthorize(Claims.User.Actions.GenerateDocuments)]
|
||||||
|
public virtual ActionResult GeneratePdfPackage(string id, string Domain, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(id))
|
||||||
|
throw new ArgumentNullException(nameof(id));
|
||||||
|
if (string.IsNullOrEmpty(DocumentTemplatePackageId))
|
||||||
|
throw new ArgumentNullException(nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
id = ActiveDirectory.ParseDomainAccountId(id, Domain);
|
||||||
|
|
||||||
|
var user = Database.Users.Find(id);
|
||||||
|
if (user != null)
|
||||||
|
{
|
||||||
|
var package = DocumentTemplatePackages.GetPackage(DocumentTemplatePackageId);
|
||||||
|
if (package != null)
|
||||||
|
{
|
||||||
|
if (package.Scope != AttachmentTypes.User)
|
||||||
|
throw new ArgumentException("This package cannot be generated from the User Scope", nameof(DocumentTemplatePackageId));
|
||||||
|
|
||||||
|
var timeStamp = DateTime.Now;
|
||||||
|
Stream pdf;
|
||||||
|
using (var generationState = DocumentState.DefaultState())
|
||||||
|
{
|
||||||
|
pdf = package.GeneratePdfPackage(Database, user, UserService.CurrentUser, timeStamp, generationState);
|
||||||
|
}
|
||||||
|
Database.SaveChanges();
|
||||||
|
return File(pdf, "application/pdf", string.Format("{0}_{1}_{2:yyyyMMdd-HHmmss}.pdf", package.Id, user.UserId, timeStamp));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(DocumentTemplatePackageId));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new ArgumentException("Invalid User Id", nameof(id));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,12 @@ namespace Disco.Web.Areas.Config
|
|||||||
context.MapRoute(
|
context.MapRoute(
|
||||||
"Config_DocumentTemplate_Create",
|
"Config_DocumentTemplate_Create",
|
||||||
"Config/DocumentTemplate/Create",
|
"Config/DocumentTemplate/Create",
|
||||||
new { controller = "DocumentTemplate", action = "Create", id = UrlParameter.Optional }
|
new { controller = "DocumentTemplate", action = "Create" }
|
||||||
|
);
|
||||||
|
context.MapRoute(
|
||||||
|
"Config_DocumentTemplate_CreatePackage",
|
||||||
|
"Config/DocumentTemplate/CreatePackage",
|
||||||
|
new { controller = "DocumentTemplate", action = "CreatePackage" }
|
||||||
);
|
);
|
||||||
context.MapRoute(
|
context.MapRoute(
|
||||||
"Config_DocumentTemplate_ImportStatus",
|
"Config_DocumentTemplate_ImportStatus",
|
||||||
@@ -89,6 +94,11 @@ namespace Disco.Web.Areas.Config
|
|||||||
"Config/DocumentTemplate/ExpressionBrowser",
|
"Config/DocumentTemplate/ExpressionBrowser",
|
||||||
new { controller = "DocumentTemplate", action = "ExpressionBrowser", id = UrlParameter.Optional }
|
new { controller = "DocumentTemplate", action = "ExpressionBrowser", id = UrlParameter.Optional }
|
||||||
);
|
);
|
||||||
|
context.MapRoute(
|
||||||
|
"Config_DocumentTemplate_ShowPackage",
|
||||||
|
"Config/DocumentTemplate/Package/{id}",
|
||||||
|
new { controller = "DocumentTemplate", action = "ShowPackage" }
|
||||||
|
);
|
||||||
context.MapRoute(
|
context.MapRoute(
|
||||||
"Config_DocumentTemplate",
|
"Config_DocumentTemplate",
|
||||||
"Config/DocumentTemplate/{id}",
|
"Config/DocumentTemplate/{id}",
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Disco.BI.Extensions;
|
using Disco.BI.Extensions;
|
||||||
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.UI.Config.DocumentTemplate;
|
using Disco.Models.UI.Config.DocumentTemplate;
|
||||||
using Disco.Services;
|
using Disco.Services;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Documents;
|
||||||
using Disco.Services.Documents.ManagedGroups;
|
using Disco.Services.Documents.ManagedGroups;
|
||||||
using Disco.Services.Expressions;
|
using Disco.Services.Expressions;
|
||||||
using Disco.Services.Plugins.Features.UIExtension;
|
using Disco.Services.Plugins.Features.UIExtension;
|
||||||
@@ -20,7 +22,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(id))
|
if (string.IsNullOrEmpty(id))
|
||||||
{
|
{
|
||||||
var m = new Models.DocumentTemplate.IndexModel() {
|
var m = new Models.DocumentTemplate.IndexModel()
|
||||||
|
{
|
||||||
DocumentTemplates = Database.DocumentTemplates
|
DocumentTemplates = Database.DocumentTemplates
|
||||||
.Select(dt => new
|
.Select(dt => new
|
||||||
{
|
{
|
||||||
@@ -30,7 +33,8 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
Database.JobAttachments.Count(a => a.DocumentTemplateId == dt.Id) +
|
Database.JobAttachments.Count(a => a.DocumentTemplateId == dt.Id) +
|
||||||
Database.UserAttachments.Count(a => a.DocumentTemplateId == dt.Id)
|
Database.UserAttachments.Count(a => a.DocumentTemplateId == dt.Id)
|
||||||
})
|
})
|
||||||
.ToDictionary(i => i.documentTemplate, i => i.storedInstances)
|
.ToDictionary(i => i.documentTemplate, i => i.storedInstances),
|
||||||
|
Packages = DocumentTemplatePackages.GetPackages()
|
||||||
};
|
};
|
||||||
|
|
||||||
// UI Extensions
|
// UI Extensions
|
||||||
@@ -40,10 +44,15 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// Normal Document Template
|
||||||
var m = new Models.DocumentTemplate.ShowModel()
|
var m = new Models.DocumentTemplate.ShowModel()
|
||||||
{
|
{
|
||||||
DocumentTemplate = Database.DocumentTemplates.Include("JobSubTypes").FirstOrDefault(at => at.Id == id)
|
DocumentTemplate = Database.DocumentTemplates.Include("JobSubTypes").FirstOrDefault(at => at.Id == id)
|
||||||
};
|
};
|
||||||
|
if (m.DocumentTemplate == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Id", nameof(id));
|
||||||
|
|
||||||
|
m.TemplatePagesHaveAttachmentId = m.DocumentTemplate.PdfPageHasAttachmentId(Database);
|
||||||
m.TemplateExpressions = m.DocumentTemplate.ExtractPdfExpressions(Database);
|
m.TemplateExpressions = m.DocumentTemplate.ExtractPdfExpressions(Database);
|
||||||
m.UpdateModel(Database);
|
m.UpdateModel(Database);
|
||||||
|
|
||||||
@@ -61,6 +70,32 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual ActionResult ShowPackage(string id)
|
||||||
|
{
|
||||||
|
// Document Template Package
|
||||||
|
var m = new Models.DocumentTemplate.ShowPackageModel()
|
||||||
|
{
|
||||||
|
Package = DocumentTemplatePackages.GetPackage(id)
|
||||||
|
};
|
||||||
|
if (m.Package == null)
|
||||||
|
throw new ArgumentException("Invalid Document Template Package Id", nameof(id));
|
||||||
|
|
||||||
|
if (m.Package.Scope == AttachmentTypes.Job)
|
||||||
|
{
|
||||||
|
m.JobTypes = Database.JobTypes.Include("JobSubTypes").ToList();
|
||||||
|
m.JobSubTypesSelected = m.Package.GetJobSubTypes(m.JobTypes.SelectMany(jt => jt.JobSubTypes));
|
||||||
|
}
|
||||||
|
var packageScopeString = m.Package.Scope.ToString();
|
||||||
|
|
||||||
|
m.DocumentTemplates = Database.DocumentTemplates.Where(dt => dt.Scope == packageScopeString).ToList();
|
||||||
|
m.DocumentTemplatesSelected = m.Package.GetDocumentTemplates(m.DocumentTemplates);
|
||||||
|
|
||||||
|
// UI Extensions
|
||||||
|
UIExtensions.ExecuteExtensions<ConfigDocumentTemplateShowPackageModel>(this.ControllerContext, m);
|
||||||
|
|
||||||
|
return View(MVC.Config.DocumentTemplate.Views.ShowPackage, m);
|
||||||
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.ShowStatus)]
|
[DiscoAuthorize(Claims.Config.DocumentTemplate.ShowStatus)]
|
||||||
public virtual ActionResult ImportStatus()
|
public virtual ActionResult ImportStatus()
|
||||||
{
|
{
|
||||||
@@ -130,7 +165,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ModelState.AddModelError("Name", "A Document Template with this Name already exists.");
|
ModelState.AddModelError("Id", "A Document Template with this Id already exists.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -140,6 +175,42 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[DiscoAuthorizeAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure)]
|
||||||
|
public virtual ActionResult CreatePackage()
|
||||||
|
{
|
||||||
|
var m = new Models.DocumentTemplate.CreatePackageModel();
|
||||||
|
|
||||||
|
// UI Extensions
|
||||||
|
UIExtensions.ExecuteExtensions<ConfigDocumentTemplateCreatePackageModel>(this.ControllerContext, m);
|
||||||
|
|
||||||
|
return View(m);
|
||||||
|
}
|
||||||
|
|
||||||
|
[DiscoAuthorizeAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure), HttpPost]
|
||||||
|
public virtual ActionResult CreatePackage(Models.DocumentTemplate.CreatePackageModel model)
|
||||||
|
{
|
||||||
|
if (ModelState.IsValid)
|
||||||
|
{
|
||||||
|
// Check for Existing
|
||||||
|
var existing = DocumentTemplatePackages.GetPackage(model.Package.Id);
|
||||||
|
if (existing == null)
|
||||||
|
{
|
||||||
|
DocumentTemplatePackages.CreatePackage(model.Package);
|
||||||
|
|
||||||
|
return RedirectToAction(MVC.Config.DocumentTemplate.ShowPackage(model.Package.Id));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ModelState.AddModelError("Id", "A Document Template Package with this Id already exists.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// UI Extensions
|
||||||
|
UIExtensions.ExecuteExtensions<ConfigDocumentTemplateCreatePackageModel>(this.ControllerContext, model);
|
||||||
|
|
||||||
|
return View(model);
|
||||||
|
}
|
||||||
|
|
||||||
[DiscoAuthorize(Claims.Config.Show)]
|
[DiscoAuthorize(Claims.Config.Show)]
|
||||||
public virtual ActionResult ExpressionBrowser(string type, bool StaticDeclaredMembersOnly = false)
|
public virtual ActionResult ExpressionBrowser(string type, bool StaticDeclaredMembersOnly = false)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Models.UI.Config.DocumentTemplate;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||||
|
{
|
||||||
|
public class CreatePackageModel : ConfigDocumentTemplateCreatePackageModel
|
||||||
|
{
|
||||||
|
public DocumentTemplatePackage Package { get; set; }
|
||||||
|
|
||||||
|
public List<string> Scopes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Disco.Models.UI.Config.DocumentTemplate;
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Models.UI.Config.DocumentTemplate;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||||
@@ -6,5 +7,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
|||||||
public class IndexModel : ConfigDocumentTemplateIndexModel
|
public class IndexModel : ConfigDocumentTemplateIndexModel
|
||||||
{
|
{
|
||||||
public Dictionary<Disco.Models.Repository.DocumentTemplate, int> DocumentTemplates { get; set; }
|
public Dictionary<Disco.Models.Repository.DocumentTemplate, int> DocumentTemplates { get; set; }
|
||||||
|
|
||||||
|
public List<DocumentTemplatePackage> Packages { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14,7 +14,9 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
|||||||
|
|
||||||
public int StoredInstanceCount { get; set; }
|
public int StoredInstanceCount { get; set; }
|
||||||
|
|
||||||
|
public List<bool> TemplatePagesHaveAttachmentId { get; set; }
|
||||||
public List<Expression> TemplateExpressions { get; set; }
|
public List<Expression> TemplateExpressions { get; set; }
|
||||||
|
public int TemplatePageCount { get { return TemplatePagesHaveAttachmentId?.Count() ?? 0; } }
|
||||||
|
|
||||||
public List<JobType> JobTypes { get; set; }
|
public List<JobType> JobTypes { get; set; }
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Models.UI.Config.DocumentTemplate;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||||
|
{
|
||||||
|
public class ShowPackageModel : ConfigDocumentTemplateShowPackageModel
|
||||||
|
{
|
||||||
|
public DocumentTemplatePackage Package { get; set; }
|
||||||
|
public List<JobSubType> JobSubTypesSelected { get; set; }
|
||||||
|
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplatesSelected { get; set; }
|
||||||
|
public List<JobType> JobTypes { get; set; }
|
||||||
|
public List<string> Scopes
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return Disco.Models.Repository.DocumentTemplate.DocumentTemplateScopes.ToList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,38 @@
|
|||||||
|
@model Disco.Web.Areas.Config.Models.DocumentTemplate.CreatePackageModel
|
||||||
|
@{
|
||||||
|
Authorization.RequireAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure);
|
||||||
|
|
||||||
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create Package");
|
||||||
|
}
|
||||||
|
@using (Html.BeginForm(MVC.Config.DocumentTemplate.CreatePackage()))
|
||||||
|
{
|
||||||
|
<div class="form" style="width: 650px">
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Id:
|
||||||
|
</th>
|
||||||
|
<td>@Html.TextBoxFor(model => model.Package.Id)<br />@Html.ValidationMessageFor(model => model.Package.Id)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Description:
|
||||||
|
</th>
|
||||||
|
<td>@Html.TextBoxFor(model => model.Package.Description)<br />@Html.ValidationMessageFor(model => model.Package.Description)
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Scope:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
@Html.DropDownListFor(model => model.Package.Scope, Model.Scopes.ToSelectListItems(null))
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<p class="actions">
|
||||||
|
<input type="submit" class="button" value="Create" />
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
@@ -0,0 +1,146 @@
|
|||||||
|
#pragma warning disable 1591
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// This code was generated by a tool.
|
||||||
|
// Runtime Version:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Changes to this file may cause incorrect behavior and will be lost if
|
||||||
|
// the code is regenerated.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace Disco.Web.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;
|
||||||
|
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/CreatePackage.cshtml")]
|
||||||
|
public partial class CreatePackage : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.DocumentTemplate.CreatePackageModel>
|
||||||
|
{
|
||||||
|
public CreatePackage()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public override void Execute()
|
||||||
|
{
|
||||||
|
|
||||||
|
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
|
||||||
|
Authorization.RequireAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure);
|
||||||
|
|
||||||
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Create Package");
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 7 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
using (Html.BeginForm(MVC.Config.DocumentTemplate.CreatePackage()))
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"form\"");
|
||||||
|
|
||||||
|
WriteLiteral(" style=\"width: 650px\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <table>\r\n <tr>\r\n <th>\r\n I" +
|
||||||
|
"d:\r\n </th>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#line 15 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
Write(Html.TextBoxFor(model => model.Package.Id));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("<br />");
|
||||||
|
|
||||||
|
|
||||||
|
#line 15 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
Write(Html.ValidationMessageFor(model => model.Package.Id));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||||
|
">\r\n Description:\r\n </th>\r\n <td>" +
|
||||||
|
"");
|
||||||
|
|
||||||
|
|
||||||
|
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
Write(Html.TextBoxFor(model => model.Package.Description));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("<br />");
|
||||||
|
|
||||||
|
|
||||||
|
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
Write(Html.ValidationMessageFor(model => model.Package.Description));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n <tr>\r\n <th" +
|
||||||
|
">\r\n Scope:\r\n </th>\r\n <td>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
Write(Html.DropDownListFor(model => model.Package.Scope, Model.Scopes.ToSelectListItems(null)));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n <p");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"actions\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <input");
|
||||||
|
|
||||||
|
WriteLiteral(" type=\"submit\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"button\"");
|
||||||
|
|
||||||
|
WriteLiteral(" value=\"Create\"");
|
||||||
|
|
||||||
|
WriteLiteral(" />\r\n </p>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 38 "..\..\Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#pragma warning restore 1591
|
||||||
@@ -3,8 +3,9 @@
|
|||||||
Authorization.Require(Claims.Config.DocumentTemplate.Show);
|
Authorization.Require(Claims.Config.DocumentTemplate.Show);
|
||||||
|
|
||||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
||||||
var showTags = Model.DocumentTemplates.Keys.Any(i => i.DevicesLinkedGroup != null || i.UsersLinkedGroup != null ||
|
var showTags = Model.DocumentTemplates.Keys.Any(i => i.IsHidden || i.DevicesLinkedGroup != null || i.UsersLinkedGroup != null ||
|
||||||
i.FilterExpression != null || i.OnGenerateExpression != null || i.OnImportAttachmentExpression != null);
|
i.FilterExpression != null || i.OnGenerateExpression != null || i.OnImportAttachmentExpression != null) ||
|
||||||
|
Model.Packages.Any(i => i.IsHidden || i.FilterExpression != null || i.OnGenerateExpression != null);
|
||||||
}
|
}
|
||||||
@if (Model.DocumentTemplates.Count == 0)
|
@if (Model.DocumentTemplates.Count == 0)
|
||||||
{
|
{
|
||||||
@@ -14,14 +15,15 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden))
|
if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden) || Model.Packages.Any(p => p.IsHidden))
|
||||||
{
|
{
|
||||||
<a id="Config_DocumentTemplates_ShowHidden" href="#" class="button small">Show Hidden (@(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden)))</a>
|
<a id="Config_DocumentTemplates_ShowHidden" href="#" class="button small">Show Hidden (@(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden) + Model.Packages.Count(p => p.IsHidden)))</a>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#Config_DocumentTemplates_ShowHidden').click(function () {
|
$('#Config_DocumentTemplates_ShowHidden').click(function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
$('#Config_DocumentTemplates_List').find('tr.hidden').show();
|
$('#Config_DocumentTemplates_List').find('tr.hidden').show();
|
||||||
|
$('#Config_DocumentTemplatePackages_List').find('tr.hidden').show();
|
||||||
return false;
|
return false;
|
||||||
}).detach().appendTo('#layout_PageHeading');
|
}).detach().appendTo('#layout_PageHeading');
|
||||||
})
|
})
|
||||||
@@ -67,6 +69,43 @@ else
|
|||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</table>
|
</table>
|
||||||
|
if (Model.Packages.Count > 0)
|
||||||
|
{
|
||||||
|
<h1 class="Config_DocumentTemplates">Document Template Packages</h1>
|
||||||
|
<table id="Config_DocumentTemplatePackages_List" class="tableData">
|
||||||
|
<tr>
|
||||||
|
<th>Id</th>
|
||||||
|
<th>Description</th>
|
||||||
|
<th>Scope</th>
|
||||||
|
<th>Document Templates</th>
|
||||||
|
@if (showTags)
|
||||||
|
{
|
||||||
|
<th> </th>
|
||||||
|
}
|
||||||
|
</tr>
|
||||||
|
@foreach (var package in Model.Packages.OrderBy(p => p.Id))
|
||||||
|
{
|
||||||
|
<tr class="@(package.IsHidden ? "hidden" : null)">
|
||||||
|
<td>@Html.ActionLink(package.Id.ToString(), MVC.Config.DocumentTemplate.ShowPackage(package.Id))</td>
|
||||||
|
<td>@Html.DisplayFor(modelItem => package.Description)</td>
|
||||||
|
<td>@Html.DisplayFor(modelItem => package.Scope)</td>
|
||||||
|
@if (showTags)
|
||||||
|
{
|
||||||
|
<td>
|
||||||
|
@if (package.FilterExpression != null || package.OnGenerateExpression != null)
|
||||||
|
{
|
||||||
|
<i class="fa fa-bolt fa-lg alert" title="Has Expressions"></i>
|
||||||
|
}
|
||||||
|
@if (package.IsHidden)
|
||||||
|
{
|
||||||
|
<i class="fa fa-minus-square fa-lg error" title="Is Hidden"></i>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
}
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
</table>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
<div class="actionBar">
|
<div class="actionBar">
|
||||||
@if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
|
@if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
|
||||||
@@ -81,6 +120,10 @@ else
|
|||||||
{
|
{
|
||||||
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
|
@Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser())
|
||||||
}
|
}
|
||||||
|
@if (Model.DocumentTemplates.Count > 2 && Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||||
|
{
|
||||||
|
@Html.ActionLinkButton("Create Package", MVC.Config.DocumentTemplate.CreatePackage())
|
||||||
|
}
|
||||||
@if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
@if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||||
{
|
{
|
||||||
@Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
|
@Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create())
|
||||||
|
|||||||
@@ -49,8 +49,9 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
|
|||||||
Authorization.Require(Claims.Config.DocumentTemplate.Show);
|
Authorization.Require(Claims.Config.DocumentTemplate.Show);
|
||||||
|
|
||||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates");
|
||||||
var showTags = Model.DocumentTemplates.Keys.Any(i => i.DevicesLinkedGroup != null || i.UsersLinkedGroup != null ||
|
var showTags = Model.DocumentTemplates.Keys.Any(i => i.IsHidden || i.DevicesLinkedGroup != null || i.UsersLinkedGroup != null ||
|
||||||
i.FilterExpression != null || i.OnGenerateExpression != null || i.OnImportAttachmentExpression != null);
|
i.FilterExpression != null || i.OnGenerateExpression != null || i.OnImportAttachmentExpression != null) ||
|
||||||
|
Model.Packages.Any(i => i.IsHidden || i.FilterExpression != null || i.OnGenerateExpression != null);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -58,7 +59,7 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
|
|||||||
WriteLiteral("\r\n");
|
WriteLiteral("\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 9 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 10 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (Model.DocumentTemplates.Count == 0)
|
if (Model.DocumentTemplates.Count == 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -74,11 +75,11 @@ WriteLiteral(" style=\"width: 450px; padding: 100px 0;\"");
|
|||||||
WriteLiteral(">\r\n <h2>No document templates are configured</h2>\r\n </div>\r\n");
|
WriteLiteral(">\r\n <h2>No document templates are configured</h2>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 14 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 15 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden))
|
if (Model.DocumentTemplates.Keys.Any(dt => dt.IsHidden) || Model.Packages.Any(p => p.IsHidden))
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -95,8 +96,8 @@ WriteLiteral(" class=\"button small\"");
|
|||||||
WriteLiteral(">Show Hidden (");
|
WriteLiteral(">Show Hidden (");
|
||||||
|
|
||||||
|
|
||||||
#line 19 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 20 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
Write(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden));
|
Write(Model.DocumentTemplates.Keys.Count(dt => dt.IsHidden) + Model.Packages.Count(p => p.IsHidden));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -108,6 +109,7 @@ WriteLiteral(@" <script>
|
|||||||
$('#Config_DocumentTemplates_ShowHidden').click(function () {
|
$('#Config_DocumentTemplates_ShowHidden').click(function () {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
$('#Config_DocumentTemplates_List').find('tr.hidden').show();
|
$('#Config_DocumentTemplates_List').find('tr.hidden').show();
|
||||||
|
$('#Config_DocumentTemplatePackages_List').find('tr.hidden').show();
|
||||||
return false;
|
return false;
|
||||||
}).detach().appendTo('#layout_PageHeading');
|
}).detach().appendTo('#layout_PageHeading');
|
||||||
})
|
})
|
||||||
@@ -115,7 +117,7 @@ WriteLiteral(@" <script>
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 31 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,13 +133,13 @@ WriteLiteral(">\r\n <tr>\r\n <th>Id</th>\r\n <th>De
|
|||||||
" <th>Scope</th>\r\n <th>Stored Instances</th>\r\n");
|
" <th>Scope</th>\r\n <th>Stored Instances</th>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 38 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 38 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (showTags)
|
if (showTags)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -147,7 +149,7 @@ WriteLiteral(">\r\n <tr>\r\n <th>Id</th>\r\n <th>De
|
|||||||
WriteLiteral(" <th> </th>\r\n");
|
WriteLiteral(" <th> </th>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 39 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -156,13 +158,13 @@ WriteLiteral(" <th> </th>\r\n");
|
|||||||
WriteLiteral(" </tr>\r\n");
|
WriteLiteral(" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 41 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 43 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
foreach (var pair in Model.DocumentTemplates)
|
foreach (var pair in Model.DocumentTemplates)
|
||||||
{
|
{
|
||||||
var item = pair.Key;
|
var item = pair.Key;
|
||||||
@@ -173,20 +175,20 @@ WriteLiteral(" </tr>\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <tr");
|
WriteLiteral(" <tr");
|
||||||
|
|
||||||
WriteAttribute("class", Tuple.Create(" class=\"", 1798), Tuple.Create("\"", 1840)
|
WriteAttribute("class", Tuple.Create(" class=\"", 2057), Tuple.Create("\"", 2099)
|
||||||
|
|
||||||
#line 45 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 1806), Tuple.Create<System.Object, System.Int32>(item.IsHidden ? "hidden" : null
|
, Tuple.Create(Tuple.Create("", 2065), Tuple.Create<System.Object, System.Int32>(item.IsHidden ? "hidden" : null
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 1806), false)
|
, 2065), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <td>");
|
WriteLiteral(">\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
#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)));
|
Write(Html.ActionLink(item.Id.ToString(), MVC.Config.DocumentTemplate.Index(item.Id)));
|
||||||
|
|
||||||
|
|
||||||
@@ -195,7 +197,7 @@ WriteLiteral(">\r\n <td>");
|
|||||||
WriteLiteral("</td>\r\n <td>");
|
WriteLiteral("</td>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
Write(Html.DisplayFor(modelItem => item.Description));
|
Write(Html.DisplayFor(modelItem => item.Description));
|
||||||
|
|
||||||
|
|
||||||
@@ -204,7 +206,7 @@ WriteLiteral("</td>\r\n <td>");
|
|||||||
WriteLiteral("</td>\r\n <td>");
|
WriteLiteral("</td>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
#line 48 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
Write(Html.DisplayFor(modelItem => item.Scope));
|
Write(Html.DisplayFor(modelItem => item.Scope));
|
||||||
|
|
||||||
|
|
||||||
@@ -213,7 +215,7 @@ WriteLiteral("</td>\r\n <td>");
|
|||||||
WriteLiteral("</td>\r\n <td>");
|
WriteLiteral("</td>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 51 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
Write(storedCount.ToString("N0"));
|
Write(storedCount.ToString("N0"));
|
||||||
|
|
||||||
|
|
||||||
@@ -222,13 +224,13 @@ WriteLiteral("</td>\r\n <td>");
|
|||||||
WriteLiteral("</td>\r\n");
|
WriteLiteral("</td>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 52 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 50 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 52 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (showTags)
|
if (showTags)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -238,13 +240,13 @@ WriteLiteral("</td>\r\n");
|
|||||||
WriteLiteral(" <td>\r\n");
|
WriteLiteral(" <td>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 55 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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)
|
if (item.DevicesLinkedGroup != null || item.UsersLinkedGroup != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -260,7 +262,7 @@ WriteLiteral(" title=\"Is Linked\"");
|
|||||||
WriteLiteral("></i>\r\n");
|
WriteLiteral("></i>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 58 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -269,7 +271,7 @@ WriteLiteral("></i>\r\n");
|
|||||||
WriteLiteral(" ");
|
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)
|
if (item.FilterExpression != null || item.OnGenerateExpression != null || item.OnImportAttachmentExpression != null)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -285,7 +287,7 @@ WriteLiteral(" title=\"Has Expressions\"");
|
|||||||
WriteLiteral("></i>\r\n");
|
WriteLiteral("></i>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 60 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 62 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -294,7 +296,7 @@ WriteLiteral("></i>\r\n");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 61 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (item.IsHidden)
|
if (item.IsHidden)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -310,7 +312,7 @@ WriteLiteral(" title=\"Is Hidden\"");
|
|||||||
WriteLiteral("></i>\r\n");
|
WriteLiteral("></i>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -319,7 +321,7 @@ WriteLiteral("></i>\r\n");
|
|||||||
WriteLiteral(" </td>\r\n");
|
WriteLiteral(" </td>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 68 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -328,7 +330,7 @@ WriteLiteral(" </td>\r\n");
|
|||||||
WriteLiteral(" </tr>\r\n");
|
WriteLiteral(" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 68 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -337,7 +339,202 @@ WriteLiteral(" </tr>\r\n");
|
|||||||
WriteLiteral(" </table>\r\n");
|
WriteLiteral(" </table>\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(" <h1");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"Config_DocumentTemplates\"");
|
||||||
|
|
||||||
|
WriteLiteral(">Document Template Packages</h1>\r\n");
|
||||||
|
|
||||||
|
WriteLiteral(" <table");
|
||||||
|
|
||||||
|
WriteLiteral(" id=\"Config_DocumentTemplatePackages_List\"");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"tableData\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <tr>\r\n <th>Id</th>\r\n <th>Description" +
|
||||||
|
"</th>\r\n <th>Scope</th>\r\n <th>Document Templates</t" +
|
||||||
|
"h>\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(" <th> </th>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 84 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </tr>\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(" <tr");
|
||||||
|
|
||||||
|
WriteAttribute("class", Tuple.Create(" class=\"", 3889), Tuple.Create("\"", 3934)
|
||||||
|
|
||||||
|
#line 88 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 3897), Tuple.Create<System.Object, System.Int32>(package.IsHidden ? "hidden" : null
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 3897), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#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("</td>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#line 90 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
Write(Html.DisplayFor(modelItem => package.Description));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</td>\r\n <td>");
|
||||||
|
|
||||||
|
|
||||||
|
#line 91 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
Write(Html.DisplayFor(modelItem => package.Scope));
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</td>\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(" <td>\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(" <i");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"fa fa-bolt fa-lg alert\"");
|
||||||
|
|
||||||
|
WriteLiteral(" title=\"Has Expressions\"");
|
||||||
|
|
||||||
|
WriteLiteral("></i>\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(" <i");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"fa fa-minus-square fa-lg error\"");
|
||||||
|
|
||||||
|
WriteLiteral(" title=\"Is Hidden\"");
|
||||||
|
|
||||||
|
WriteLiteral("></i>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 102 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </td>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 104 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 106 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </table>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 108 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -350,13 +547,13 @@ WriteLiteral(" class=\"actionBar\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 72 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 111 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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))
|
if (Authorization.Has(Claims.Config.DocumentTemplate.UndetectedPages))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -364,14 +561,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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()));
|
Write(Html.ActionLinkButton("Undetected Pages", MVC.Config.DocumentTemplate.UndetectedPages()));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 76 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 115 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
|
if (Authorization.Has(Claims.Config.DocumentTemplate.ShowStatus))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -389,14 +586,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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()));
|
Write(Html.ActionLinkButton("Import Status", MVC.Config.DocumentTemplate.ImportStatus()));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 78 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 117 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -406,7 +603,7 @@ WriteLiteral(" ");
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 80 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 119 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
if (Authorization.Has(Claims.Config.Show))
|
if (Authorization.Has(Claims.Config.Show))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -414,14 +611,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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()));
|
Write(Html.ActionLinkButton("Expression Browser", MVC.Config.DocumentTemplate.ExpressionBrowser()));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 82 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 121 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,7 +628,32 @@ WriteLiteral(" ");
|
|||||||
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))
|
if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -439,14 +661,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#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()));
|
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 86 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
#line 129 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
Id:
|
Id:
|
||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
@Html.DisplayFor(model => model.DocumentTemplate.Id)
|
<code>@Html.DisplayFor(model => model.DocumentTemplate.Id)</code>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
@@ -212,7 +212,7 @@
|
|||||||
{
|
{
|
||||||
<hr />
|
<hr />
|
||||||
<h4>Job Type Filters:</h4>
|
<h4>Job Type Filters:</h4>
|
||||||
<div id="Config_DocumentTemplates_JobSubTypes" @(Model.DocumentTemplate.Scope !=DocumentTemplate.DocumentTemplateScopes.Job ? "style=\" display none;\" " : null)>
|
<div id="Config_DocumentTemplates_JobSubTypes">
|
||||||
<div>
|
<div>
|
||||||
@if (Model.DocumentTemplate.JobSubTypes.Count > 0)
|
@if (Model.DocumentTemplate.JobSubTypes.Count > 0)
|
||||||
{
|
{
|
||||||
@@ -384,7 +384,25 @@
|
|||||||
@if (canConfig)
|
@if (canConfig)
|
||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align: right;">
|
<td>
|
||||||
|
@if (Model.TemplatePagesHaveAttachmentId.Any(i => !i))
|
||||||
|
{
|
||||||
|
<div class="info-box">
|
||||||
|
@for (int i = 0; i < Model.TemplatePagesHaveAttachmentId.Count; i++)
|
||||||
|
{
|
||||||
|
if (!Model.TemplatePagesHaveAttachmentId[i])
|
||||||
|
{
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-question-circle"></i>Note: Page @(i + 1) does not have a <code>DiscoAttachmentId</code> field.
|
||||||
|
</p>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<p style="margin-top: 6px;">
|
||||||
|
The <code>DiscoAttachmentId</code> field is replaced with a unique QR Code which identifies the page when it is imported back into Disco ICT.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
<div style="text-align: right;">
|
||||||
@Html.ActionLinkSmallButton("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
|
@Html.ActionLinkSmallButton("Download Template", MVC.API.DocumentTemplate.Template(Model.DocumentTemplate.Id))
|
||||||
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
|
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.Upload))
|
||||||
{
|
{
|
||||||
@@ -437,6 +455,7 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
}
|
}
|
||||||
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
@@ -810,6 +829,12 @@
|
|||||||
{
|
{
|
||||||
<div class="field-validation-valid" data-valmsg-replace="true" data-valmsg-for="DataIds"></div>
|
<div class="field-validation-valid" data-valmsg-replace="true" data-valmsg-for="DataIds"></div>
|
||||||
<textarea id="inputBulkGenerateDataIds" name="DataIds" data-val="true" data-val-required="Identifiers are required"></textarea>
|
<textarea id="inputBulkGenerateDataIds" name="DataIds" data-val="true" data-val-required="Identifiers are required"></textarea>
|
||||||
|
if (Model.TemplatePageCount > 1 && Model.TemplatePageCount % 2 != 0)
|
||||||
|
{
|
||||||
|
<div style="margin-top: 6px;">
|
||||||
|
<input id="inputBulkGenerateInsertBlankPage" type="checkbox" name="InsertBlankPage" value="True" /><label for="inputBulkGenerateInsertBlankPage">Insert Blank Pages for Double-Sided Printing</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,767 @@
|
|||||||
|
@model Disco.Web.Areas.Config.Models.DocumentTemplate.ShowPackageModel
|
||||||
|
@using Disco.Services.Interop.ActiveDirectory;
|
||||||
|
@{
|
||||||
|
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");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<div id="Config_DocumentTemplatePackages_Show" class="@(hideAdvanced ? " Config_HideAdvanced" : null)">
|
||||||
|
<div class="form" style="width: 650px; margin: 10px auto 20px;">
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Id:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<code>@Html.DisplayFor(model => model.Package.Id)</code>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Description:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
@Html.TextBoxFor(model => model.Package.Description)
|
||||||
|
@AjaxHelpers.AjaxSave()
|
||||||
|
@AjaxHelpers.AjaxLoader()
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
document.DiscoFunctions.PropertyChangeHelper(
|
||||||
|
$('#Package_Description'),
|
||||||
|
'Description',
|
||||||
|
'@Url.Action(MVC.API.DocumentTemplatePackage.UpdateDescription(Model.Package.Id))',
|
||||||
|
'Description'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(Model.Package.Description))
|
||||||
|
{
|
||||||
|
<span class="smallMessage"><None Specified></span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@Model.Package.Description
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
<input id="Package_IsHidden" type="checkbox" @(Model.Package.IsHidden ? new MvcHtmlString("checked=\"checked\" ") : null) />
|
||||||
|
<label for="Package_IsHidden">Hidden</label>
|
||||||
|
@AjaxHelpers.AjaxLoader()
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
document.DiscoFunctions.PropertyChangeHelper(
|
||||||
|
$('#Package_IsHidden'),
|
||||||
|
null,
|
||||||
|
'@Url.Action(MVC.API.DocumentTemplatePackage.UpdateIsHidden(Model.Package.Id))',
|
||||||
|
'IsHidden'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input id="Package_IsHidden" type="checkbox" @(Model.Package.IsHidden ? new MvcHtmlString("checked=\"checked\" ") : null) disabled="disabled" />
|
||||||
|
<label for="Package_IsHidden">Hidden</label>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>If selected the package will not appear in the list of documents to generate.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
<input id="Package_InsertBlankPages" type="checkbox" @(Model.Package.InsertBlankPages ? new MvcHtmlString("checked=\"checked\" ") : null) />
|
||||||
|
<label for="Package_InsertBlankPages">Insert Blank Pages</label>
|
||||||
|
@AjaxHelpers.AjaxLoader()
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
document.DiscoFunctions.PropertyChangeHelper(
|
||||||
|
$('#Package_InsertBlankPages'),
|
||||||
|
null,
|
||||||
|
'@Url.Action(MVC.API.DocumentTemplatePackage.UpdateInsertBlankPages(Model.Package.Id))',
|
||||||
|
'InsertBlankPages'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<input id="Package_InsertBlankPages" type="checkbox" @(Model.Package.InsertBlankPages ? new MvcHtmlString("checked=\"checked\" ") : null) disabled="disabled" />
|
||||||
|
<label for="Package_InsertBlankPages">Hidden</label>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>If selected blank pages will be inserted to ensure each of the individual documents within the package appear on separate pages when using duplex printing.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Scope:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
<h4>@Model.Package.Scope Scope</h4>
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>This package is generated from @(Model.Package.Scope)s. Any expressions within the Document Template PDF will be evaluated within the <a href="@(Url.Action(MVC.Config.DocumentTemplate.ExpressionBrowser()))#@(Model.Package.Scope)Scope">@(Model.Package.Scope) Scope</a>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button id="Config_DocumentTemplatePackages_Scope_Button" class="button small">Change Scope</button>
|
||||||
|
</div>
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
<div id="Config_DocumentTemplatePackages_Scope_Dialog" title="Change Document Template Package Scope" class="dialog">
|
||||||
|
@using (Html.BeginForm(MVC.API.DocumentTemplatePackage.UpdateScope(Model.Package.Id, redirect: true)))
|
||||||
|
{
|
||||||
|
<div class="input">
|
||||||
|
<label for="Config_DocumentTemplatePackages_Scope_Scope">Scope: </label>
|
||||||
|
<select id="Config_DocumentTemplatePackages_Scope_Scope" name="Scope">
|
||||||
|
@foreach (var scope in Model.Scopes)
|
||||||
|
{
|
||||||
|
<option value="@scope" selected="@(scope == Model.Package.Scope.ToString() ? " selected" : null)">@scope</option>
|
||||||
|
}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (Model.Package.DocumentTemplateIds != null && Model.Package.DocumentTemplateIds.Count > 0)
|
||||||
|
{
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>If changed, all Document Templates will be unassociated with this Package.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
var dialog;
|
||||||
|
|
||||||
|
function showDialog() {
|
||||||
|
if (dialog == null) {
|
||||||
|
dialog = $('#Config_DocumentTemplatePackages_Scope_Dialog').dialog({
|
||||||
|
width: 400,
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
'Save Changes': function () {
|
||||||
|
dialog.dialog('option', 'buttons', null);
|
||||||
|
dialog.dialog('disable');
|
||||||
|
$('#Config_DocumentTemplatePackages_Scope_Scope').closest('form').submit();
|
||||||
|
},
|
||||||
|
'Cancel': function () {
|
||||||
|
dialog.dialog('close');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dialog('open');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#Config_DocumentTemplatePackages_Scope_Button').click(showDialog);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
@if (Model.Package.Scope == AttachmentTypes.Job)
|
||||||
|
{
|
||||||
|
<hr />
|
||||||
|
<h4>Job Type Filters:</h4>
|
||||||
|
<div id="Config_DocumentTemplatePackages_JobSubTypes">
|
||||||
|
<div>
|
||||||
|
@if (Model.Package.JobSubTypes != null && Model.Package.JobSubTypes.Count > 0)
|
||||||
|
{
|
||||||
|
<ul>
|
||||||
|
@foreach (var jobType in Model.JobSubTypesSelected.GroupBy(jst => jst.JobType).OrderBy(jtg => jtg.Key.Description))
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
@jobType.Key.Description
|
||||||
|
<ul>
|
||||||
|
@if (jobType.Count() == Model.JobTypes.FirstOrDefault(jt => jt.Id == jobType.Key.Id).JobSubTypes.Count)
|
||||||
|
{
|
||||||
|
<li><span class="smallMessage">[All Sub Types]</span></li>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var jobSubType in jobType)
|
||||||
|
{
|
||||||
|
<li>@jobSubType.Description</li>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<span class="smallMessage"><No Filter></span>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
<a id="Config_DocumentTemplatePackages_JobSubTypes_Update" href="#" class="button small">Update</a>
|
||||||
|
<div id="Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog" class="dialog" title="Job Type Filter">
|
||||||
|
@using (Html.BeginForm(MVC.API.DocumentTemplatePackage.UpdateJobSubTypes(Model.Package.Id, null, true)))
|
||||||
|
{
|
||||||
|
var selectedTypes = Model.JobSubTypesSelected.Select(jst => jst.JobType).Distinct().ToList();
|
||||||
|
foreach (var jt in Model.JobTypes)
|
||||||
|
{
|
||||||
|
<div class="jobTypes">
|
||||||
|
<h4>
|
||||||
|
<input id="Types_@(jt.Id)" class="jobType" type="checkbox" value="@(jt.Id)" @(selectedTypes.Contains(jt) ? "checked=\" checked\"" : null) /><label for="Types_@(jt.Id)">@jt.Description</label>
|
||||||
|
</h4>
|
||||||
|
<div id="SubTypes_@(jt.Id)" class="jobSubTypes">
|
||||||
|
@CommonHelpers.CheckboxBulkSelect(string.Format("CheckboxBulkSelect_{0}", jt.Id), "div")
|
||||||
|
@CommonHelpers.CheckBoxList("JobSubTypes", jt.JobSubTypes.OrderBy(jst => jst.Description).ToSelectListItems(Model.Package.JobSubTypes), 2)
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var dialog;
|
||||||
|
|
||||||
|
function showDialog() {
|
||||||
|
if (!dialog) {
|
||||||
|
dialog = $('#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog').dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
autoOpen: false,
|
||||||
|
width: 750,
|
||||||
|
height: 580,
|
||||||
|
buttons: {
|
||||||
|
"Save Changes": saveChanges,
|
||||||
|
Cancel: cancel
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.find('.jobSubTypes').hide();
|
||||||
|
dialog.on('change', 'input.jobType', function () {
|
||||||
|
var $this = $(this);
|
||||||
|
if ($this.is(':checked'))
|
||||||
|
$('#SubTypes_' + $this.val()).slideDown('fast');
|
||||||
|
else
|
||||||
|
$('#SubTypes_' + $this.val()).slideUp('fast');
|
||||||
|
}).find('input.jobType:checked').each(function () {
|
||||||
|
$('#SubTypes_' + $(this).val()).show();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dialog('open');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function cancel() {
|
||||||
|
dialog.dialog("disable");
|
||||||
|
dialog.dialog("option", "buttons", null);
|
||||||
|
|
||||||
|
// Refresh Page
|
||||||
|
window.location.reload(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
function saveChanges() {
|
||||||
|
var form = dialog.find('form');
|
||||||
|
|
||||||
|
$('input.jobType:unchecked').each(function () {
|
||||||
|
$('#SubTypes_' + $(this).val()).find('input').prop('checked', false);
|
||||||
|
});
|
||||||
|
|
||||||
|
form.submit();
|
||||||
|
|
||||||
|
dialog.dialog("disable");
|
||||||
|
dialog.dialog("option", "buttons", null);
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$('#Config_DocumentTemplatePackages_JobSubTypes_Update').click(showDialog);
|
||||||
|
});
|
||||||
|
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Document Templates:</th>
|
||||||
|
<td>
|
||||||
|
@if (Model.DocumentTemplatesSelected.Count == 0)
|
||||||
|
{
|
||||||
|
<div class="info-box error">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-exclamation-triangle"></i>The package has no associated Document Templates and cannot be generated.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button id="Config_DocumentTemplatePackages_Templates_Button" class="button small alert">Choose Document Templates</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<ol id="Config_DocumentTemplatePackage_List" class="none">
|
||||||
|
@foreach (var template in Model.DocumentTemplatesSelected)
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<span class="description">@template.Description</span>
|
||||||
|
<span class="id">@Html.ActionLink(template.Id, MVC.Config.DocumentTemplate.Index(template.Id))</span>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ol>
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>The package will be generated with the above Document Templates in the order they appear.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<button id="Config_DocumentTemplatePackages_Templates_Button" class="button small">Change Document Templates</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
@if (canConfig)
|
||||||
|
{
|
||||||
|
<div id="Config_DocumentTemplatePackages_Templates_Dialog" title="Change Document Templates" class="dialog">
|
||||||
|
<div>
|
||||||
|
<h3>Package Templates</h3>
|
||||||
|
@using (Html.BeginForm(MVC.API.DocumentTemplatePackage.UpdateDocumentTemplates(Model.Package.Id, redirect: true)))
|
||||||
|
{
|
||||||
|
<ol class="templates_connected none">
|
||||||
|
@foreach (var template in Model.DocumentTemplatesSelected)
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<input type="hidden" name="DocumentTemplates" value="@template.Id" />
|
||||||
|
<span class="id">@template.Id</span>
|
||||||
|
<span class="description">@template.Description</span>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ol>
|
||||||
|
}
|
||||||
|
<div>
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-info-circle"></i>Include Document Templates by drag them from the list of Available Templates. Reorder Document Templates by dragging them within the list.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<h3>Available Templates</h3>
|
||||||
|
<ul class="templates_connected none">
|
||||||
|
@foreach (var template in Model.DocumentTemplates.Where(t => !t.IsHidden).Except(Model.DocumentTemplatesSelected))
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<input type="hidden" name="DocumentTemplates" value="@template.Id" />
|
||||||
|
<span class="id">@template.Id</span>
|
||||||
|
<span class="description">@template.Description</span>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
var dialog;
|
||||||
|
|
||||||
|
function showDialog() {
|
||||||
|
if (dialog == null) {
|
||||||
|
dialog = $('#Config_DocumentTemplatePackages_Templates_Dialog').dialog({
|
||||||
|
width: 800,
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
'Save Changes': function () {
|
||||||
|
var $form = dialog.find('form');
|
||||||
|
if ($form.find('input').length > 0) {
|
||||||
|
dialog.dialog('option', 'buttons', null);
|
||||||
|
dialog.dialog('disable');
|
||||||
|
$form.submit();
|
||||||
|
} else {
|
||||||
|
alert('The package templates must include at least one document template');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'Cancel': function () {
|
||||||
|
dialog.dialog('close');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
dialog.find('.templates_connected')
|
||||||
|
.sortable({
|
||||||
|
connectWith: '.templates_connected'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dialog('open');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#Config_DocumentTemplatePackages_Templates_Button').click(showDialog);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form Config_HideAdvanced_Item" style="width: 650px;">
|
||||||
|
<h2>Advanced Options</h2>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
Filter Expression:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
|
||||||
|
{
|
||||||
|
@Html.EditorFor(model => Model.Package.FilterExpression)
|
||||||
|
@AjaxHelpers.AjaxRemove()
|
||||||
|
@AjaxHelpers.AjaxSave()
|
||||||
|
@AjaxHelpers.AjaxLoader()
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
var field = $('#Package_FilterExpression');
|
||||||
|
var fieldRemove = field.next('.ajaxRemove');
|
||||||
|
var fieldOriginalWidth, fieldOriginalHeight;
|
||||||
|
|
||||||
|
document.DiscoFunctions.PropertyChangeHelper(
|
||||||
|
field,
|
||||||
|
'None',
|
||||||
|
'@Url.Action(MVC.API.DocumentTemplatePackage.UpdateFilterExpression(Model.Package.Id))',
|
||||||
|
'FilterExpression'
|
||||||
|
);
|
||||||
|
|
||||||
|
field.focus(function () {
|
||||||
|
fieldOriginalWidth = field.width();
|
||||||
|
fieldOriginalHeight = field.height();
|
||||||
|
field.css('overflow', 'visible').animate({ width: field.parent().width() - 42, height: 75 }, 200);
|
||||||
|
}).blur(function () {
|
||||||
|
field.css('overflow', 'hidden').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);
|
||||||
|
}).change(function () {
|
||||||
|
if (!!field.val()) {
|
||||||
|
fieldRemove.show();
|
||||||
|
} else {
|
||||||
|
fieldRemove.hide();
|
||||||
|
}
|
||||||
|
}).attr('placeholder', 'None').attr('spellcheck', 'false');
|
||||||
|
|
||||||
|
fieldRemove.click(function () {
|
||||||
|
field.val('').change();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!field.val()) {
|
||||||
|
fieldRemove.show();
|
||||||
|
} else {
|
||||||
|
fieldRemove.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(Model.Package.FilterExpression))
|
||||||
|
{
|
||||||
|
<span class="smallMessage"><None Specified></span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="code">
|
||||||
|
@Model.Package.FilterExpression
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-fw fa-info-circle"></i>This expression will be evaluated to determine if this package is shown in the <em>Generate Document</em> drop-down list. If the template is hidden (see above) this expression is ignored.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>
|
||||||
|
On Generated Expression:
|
||||||
|
</th>
|
||||||
|
<td>
|
||||||
|
@if (canConfig && Authorization.Has(Claims.Config.DocumentTemplate.ConfigureFilterExpression))
|
||||||
|
{
|
||||||
|
@Html.EditorFor(model => Model.Package.OnGenerateExpression)
|
||||||
|
@AjaxHelpers.AjaxRemove()
|
||||||
|
@AjaxHelpers.AjaxSave()
|
||||||
|
@AjaxHelpers.AjaxLoader()
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
var field = $('#Package_OnGenerateExpression');
|
||||||
|
var fieldRemove = field.next('.ajaxRemove');
|
||||||
|
var fieldOriginalWidth, fieldOriginalHeight;
|
||||||
|
|
||||||
|
document.DiscoFunctions.PropertyChangeHelper(
|
||||||
|
field,
|
||||||
|
'None',
|
||||||
|
'@Url.Action(MVC.API.DocumentTemplatePackage.UpdateOnGenerateExpression(Model.Package.Id))',
|
||||||
|
'OnGenerateExpression'
|
||||||
|
);
|
||||||
|
|
||||||
|
field.focus(function () {
|
||||||
|
fieldOriginalWidth = field.width();
|
||||||
|
fieldOriginalHeight = field.height();
|
||||||
|
field.css('overflow', 'visible').animate({ width: field.parent().width() - 42, height: 75 }, 200);
|
||||||
|
}).blur(function () {
|
||||||
|
field.css('overflow', 'hidden').animate({ width: fieldOriginalWidth, height: fieldOriginalHeight }, 200);
|
||||||
|
}).change(function () {
|
||||||
|
if (!!field.val()) {
|
||||||
|
fieldRemove.show();
|
||||||
|
} else {
|
||||||
|
fieldRemove.hide();
|
||||||
|
}
|
||||||
|
}).attr('placeholder', 'None').attr('spellcheck', 'false');
|
||||||
|
|
||||||
|
fieldRemove.click(function () {
|
||||||
|
field.val('').change();
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!field.val()) {
|
||||||
|
fieldRemove.show();
|
||||||
|
} else {
|
||||||
|
fieldRemove.hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (string.IsNullOrWhiteSpace(Model.Package.OnGenerateExpression))
|
||||||
|
{
|
||||||
|
<span class="smallMessage"><None Specified></span>
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
<div class="code">
|
||||||
|
@Model.Package.OnGenerateExpression
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
<div class="info-box">
|
||||||
|
<p class="fa-p">
|
||||||
|
<i class="fa fa-fw fa-info-circle"></i>This expression will be evaluated each time the package is generated.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="dialogConfirmDelete" title="Delete this Document Template?">
|
||||||
|
<p>
|
||||||
|
<i class="fa fa-exclamation-triangle fa-lg warning"></i>This item will be permanently deleted.<br />
|
||||||
|
Are you sure?
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function () {
|
||||||
|
var button = $('#buttonDelete');
|
||||||
|
var buttonDialog = $("#dialogConfirmDelete");
|
||||||
|
var buttonLink = button.attr('href');
|
||||||
|
button.attr('href', '#');
|
||||||
|
button.click(function () {
|
||||||
|
buttonDialog.dialog('open');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
buttonDialog.dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
autoOpen: false,
|
||||||
|
buttons: {
|
||||||
|
"Delete": function () {
|
||||||
|
$this = $(this);
|
||||||
|
$this.dialog('disable');
|
||||||
|
$this.dialog("option", "buttons", null);
|
||||||
|
window.location.href = buttonLink;
|
||||||
|
},
|
||||||
|
Cancel: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<div class="actionBar">
|
||||||
|
@if (hideAdvanced)
|
||||||
|
{
|
||||||
|
<button id="Config_HideAdvanced_Show" class="button">Show Advanced Options</button>
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
$('#Config_HideAdvanced_Show').click(function () {
|
||||||
|
$('#Config_DocumentTemplatePackages_Show').removeClass('Config_HideAdvanced');
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
@if (canBulkGenerate)
|
||||||
|
{
|
||||||
|
<a id="buttonBulkGenerate" href="#" class="button">Bulk Generate</a>
|
||||||
|
<div id="dialogBulkGenerate" class="hiddenDialog" title="Bulk Generate: @(Model.Package.Id)">
|
||||||
|
<div class="brief">
|
||||||
|
@switch (Model.Package.Scope)
|
||||||
|
{
|
||||||
|
case AttachmentTypes.Device:
|
||||||
|
<div>
|
||||||
|
Enter multiple <span class="scopeDescBulkGenerate">Device Serial Numbers</span> separated by <code><new line></code>, commas (<code>,</code>) or semicolons (<code>;</code>).
|
||||||
|
</div>
|
||||||
|
<div class="examples clearfix">
|
||||||
|
<h4>Examples:</h4>
|
||||||
|
<div class="example1 code">
|
||||||
|
01234567<br />
|
||||||
|
ABCD9876<br />
|
||||||
|
8VQ6G2R
|
||||||
|
</div>
|
||||||
|
<div class="example2 code">01234567,ABCD9876,8VQ6G2R</div>
|
||||||
|
<div class="example3 code">01234567;ABCD9876;8VQ6G2R</div>
|
||||||
|
</div>
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.Job:
|
||||||
|
<div>
|
||||||
|
Enter multiple <span class="scopeDescBulkGenerate">Job Ids</span> separated by <code><new line></code>, commas (<code>,</code>) or semicolons (<code>;</code>).
|
||||||
|
</div>
|
||||||
|
<div class="examples clearfix">
|
||||||
|
<h4>Examples:</h4>
|
||||||
|
<div class="example1 code">
|
||||||
|
86<br />
|
||||||
|
99<br />
|
||||||
|
44
|
||||||
|
</div>
|
||||||
|
<div class="example2 code">86,99,44</div>
|
||||||
|
<div class="example3 code">86;99;44</div>
|
||||||
|
</div>
|
||||||
|
break;
|
||||||
|
case AttachmentTypes.User:
|
||||||
|
<div>
|
||||||
|
Enter multiple <span class="scopeDescBulkGenerate">User Ids</span> separated by <code><new line></code>, commas (<code>,</code>) or semicolons (<code>;</code>).
|
||||||
|
</div>
|
||||||
|
<div class="examples clearfix">
|
||||||
|
<h4>Examples:</h4>
|
||||||
|
<div class="example1 code">
|
||||||
|
user6<br />
|
||||||
|
smi0099<br />@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith
|
||||||
|
</div>
|
||||||
|
<div class="example2 code">user6,smi0099,@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith</div>
|
||||||
|
<div class="example3 code">user6;smi0099;@(ActiveDirectory.Context.PrimaryDomain.NetBiosName)\rsmith</div>
|
||||||
|
</div>
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
@using (Html.BeginForm(MVC.API.DocumentTemplatePackage.BulkGenerate(Model.Package.Id), FormMethod.Post))
|
||||||
|
{
|
||||||
|
<div class="field-validation-valid" data-valmsg-replace="true" data-valmsg-for="DataIds"></div>
|
||||||
|
<textarea id="inputBulkGenerateDataIds" name="DataIds" data-val="true" data-val-required="Identifiers are required"></textarea>
|
||||||
|
<div style="margin-top: 6px;">
|
||||||
|
<input id="inputBulkGenerateInsertBlankPage" type="checkbox" name="InsertBlankPage" value="True" /><label for="inputBulkGenerateInsertBlankPage">Insert Blank Pages for Double-Sided Printing</label>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function () {
|
||||||
|
var dialog;
|
||||||
|
|
||||||
|
$('#buttonBulkGenerate').click(function () {
|
||||||
|
if (!dialog) {
|
||||||
|
dialog = $('#dialogBulkGenerate').dialog({
|
||||||
|
resizable: false,
|
||||||
|
modal: true,
|
||||||
|
autoOpen: false,
|
||||||
|
width: 460,
|
||||||
|
buttons: {
|
||||||
|
"Bulk Generate": function () {
|
||||||
|
dialog.find('form').submit();
|
||||||
|
dialog.dialog("disable");
|
||||||
|
},
|
||||||
|
Close: function () {
|
||||||
|
$(this).dialog("close");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.validator.unobtrusive.reparse('#inputBulkGenerateDataIds');
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog.dialog('open');
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
}
|
||||||
|
@if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
|
||||||
|
{
|
||||||
|
@Html.ActionLinkButton("Delete", MVC.API.DocumentTemplatePackage.Delete(Model.Package.Id, true), "buttonDelete")
|
||||||
|
}
|
||||||
|
</div>
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -4771,12 +4771,14 @@ button.button:hover {
|
|||||||
border: 1px solid #6b6b6b;
|
border: 1px solid #6b6b6b;
|
||||||
background: #9e9e9e;
|
background: #9e9e9e;
|
||||||
}
|
}
|
||||||
ul.none {
|
ul.none,
|
||||||
|
ol.none {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
ul.none li {
|
ul.none li,
|
||||||
|
ol.none li {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
div.form {
|
div.form {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -690,6 +690,107 @@ div.logEventsViewport table.logEventsViewport > tbody > tr > td.eventType {
|
|||||||
height: 200px;
|
height: 200px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
}
|
}
|
||||||
|
h1.Config_DocumentTemplates {
|
||||||
|
margin: 10px 0 6px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show > div.form > table > tbody > tr > th {
|
||||||
|
width: 140px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Package_FilterExpression,
|
||||||
|
#Config_DocumentTemplatePackages_Show #Package_OnGenerateExpression {
|
||||||
|
height: 16px;
|
||||||
|
min-height: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-family: Consolas, "Courier New", monospace;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Config_DocumentTemplatePackages_Scope_Button {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Config_DocumentTemplatePackage_List {
|
||||||
|
list-style-type: decimal;
|
||||||
|
list-style-position: inside;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
border: 1px solid #d8d8d8;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Config_DocumentTemplatePackage_List li {
|
||||||
|
padding: 6px 8px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Config_DocumentTemplatePackage_List li:not(:first-child) {
|
||||||
|
border-top: 1px dashed #d8d8d8;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Show #Config_DocumentTemplatePackage_List li .id {
|
||||||
|
font-family: Consolas, "Courier New", monospace;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Scope_Dialog div.input {
|
||||||
|
margin: 14px 10px 20px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes {
|
||||||
|
border: 1px dashed #d8d8d8;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 4px;
|
||||||
|
margin-top: 6px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes > h4 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes #Config_DocumentTemplatePackages_JobSubTypes_Update {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog #Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog_Types {
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog .jobTypes {
|
||||||
|
padding: 6px 0;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog .jobTypes .jobSubTypes {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
border-left: 4px solid #d8d8d8;
|
||||||
|
padding: 4px 0 4px 8px;
|
||||||
|
margin: 4px 0 0 6px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog .checkboxBulkSelectContainer {
|
||||||
|
font-size: .8em;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog h3 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog > div {
|
||||||
|
width: 374px;
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog > div:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog .templates_connected {
|
||||||
|
min-height: 200px;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog ol {
|
||||||
|
list-style-type: decimal;
|
||||||
|
padding-left: 24px;
|
||||||
|
border: 1px solid #d8d8d8;
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog li {
|
||||||
|
background-color: #fff;
|
||||||
|
border: 1px solid #d8d8d8;
|
||||||
|
margin: 4px;
|
||||||
|
padding: 2px 4px;
|
||||||
|
-moz-box-shadow: 0 0 5px rgba(209, 209, 209, 0.5);
|
||||||
|
-webkit-box-shadow: 0 0 5px rgba(209, 209, 209, 0.5);
|
||||||
|
box-shadow: 0 0 5px rgba(209, 209, 209, 0.5);
|
||||||
|
cursor: default;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog li:hover {
|
||||||
|
background-color: #cddbec;
|
||||||
|
border-color: #1e6dab;
|
||||||
|
}
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog li .id {
|
||||||
|
font-family: Consolas, "Courier New", monospace;
|
||||||
|
color: #888;
|
||||||
|
float: right;
|
||||||
|
font-size: .9em;
|
||||||
|
}
|
||||||
#importStatus #sessions .session {
|
#importStatus #sessions .session {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|||||||
@@ -760,6 +760,139 @@ div.logEventsViewport {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
h1.Config_DocumentTemplates {
|
||||||
|
margin: 10px 0 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Document Template Packages
|
||||||
|
#Config_DocumentTemplatePackages_Show {
|
||||||
|
& > div.form > table > tbody > tr > th {
|
||||||
|
width: 140px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Package_FilterExpression, #Package_OnGenerateExpression {
|
||||||
|
height: 16px;
|
||||||
|
min-height: 16px;
|
||||||
|
overflow: hidden;
|
||||||
|
font-family: @FontFamilyMono;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_Scope_Button {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackage_List {
|
||||||
|
list-style-type: decimal;
|
||||||
|
list-style-position: inside;
|
||||||
|
background-color: @FormBackgroundOddColour;
|
||||||
|
border: 1px solid @TableDataDarkBorderColour;
|
||||||
|
|
||||||
|
li {
|
||||||
|
padding: 6px 8px;
|
||||||
|
|
||||||
|
&:not(:first-child) {
|
||||||
|
border-top: 1px dashed @TableDataDarkBorderColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
.id {
|
||||||
|
font-family: @FontFamilyMono;
|
||||||
|
float: right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_Scope_Dialog {
|
||||||
|
div.input {
|
||||||
|
margin: 14px 10px 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes {
|
||||||
|
border: 1px dashed @TableDataDarkBorderColour;
|
||||||
|
background-color: @white;
|
||||||
|
padding: 4px;
|
||||||
|
margin-top: 6px;
|
||||||
|
|
||||||
|
& > h4 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog {
|
||||||
|
#Config_DocumentTemplatePackages_JobSubTypes_Update_Dialog_Types {
|
||||||
|
margin: 0 0 8px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.jobTypes {
|
||||||
|
padding: 6px 0;
|
||||||
|
|
||||||
|
.jobSubTypes {
|
||||||
|
background-color: @FormBackgroundOddColour;
|
||||||
|
border-left: 4px solid @TableDataDarkBorderColour;
|
||||||
|
padding: 4px 0 4px 8px;
|
||||||
|
margin: 4px 0 0 6px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.checkboxBulkSelectContainer {
|
||||||
|
font-size: .8em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Config_DocumentTemplatePackages_Templates_Dialog {
|
||||||
|
h3 {
|
||||||
|
margin-bottom: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > div {
|
||||||
|
width: 374px;
|
||||||
|
float: left;
|
||||||
|
|
||||||
|
&:first-child {
|
||||||
|
margin-right: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.templates_connected {
|
||||||
|
min-height: 200px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ol {
|
||||||
|
list-style-type: decimal;
|
||||||
|
padding-left: 24px;
|
||||||
|
border: 1px solid @TableDataDarkBorderColour;
|
||||||
|
background-color: @FormBackgroundOddColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
li {
|
||||||
|
background-color: @white;
|
||||||
|
border: 1px solid @TableDataDarkBorderColour;
|
||||||
|
margin: 4px;
|
||||||
|
padding: 2px 4px;
|
||||||
|
-moz-box-shadow: 0 0 5px fade(@BackgroundColour, 50%);
|
||||||
|
-webkit-box-shadow: 0 0 5px fade(@BackgroundColour, 50%);
|
||||||
|
box-shadow: 0 0 5px fade(@BackgroundColour, 50%);
|
||||||
|
cursor: default;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: @HighlightColour;
|
||||||
|
border-color: @ButtonColour;
|
||||||
|
}
|
||||||
|
|
||||||
|
.id {
|
||||||
|
font-family: @FontFamilyMono;
|
||||||
|
color: #888;
|
||||||
|
float: right;
|
||||||
|
font-size: .9em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Document Templates - Import Status
|
// Document Templates - Import Status
|
||||||
#importStatus {
|
#importStatus {
|
||||||
#sessions {
|
#sessions {
|
||||||
@@ -1670,7 +1803,6 @@ div.logEventsViewport {
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
font-family: @FontFamilyMono;
|
font-family: @FontFamilyMono;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#Config_UserFlags_Index {
|
#Config_UserFlags_Index {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -1004,12 +1004,14 @@ button.button:hover {
|
|||||||
border: 1px solid #6b6b6b;
|
border: 1px solid #6b6b6b;
|
||||||
background: #9e9e9e;
|
background: #9e9e9e;
|
||||||
}
|
}
|
||||||
ul.none {
|
ul.none,
|
||||||
|
ol.none {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
ul.none li {
|
ul.none li,
|
||||||
|
ol.none li {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
div.form {
|
div.form {
|
||||||
|
|||||||
@@ -978,7 +978,7 @@ input[type="submit"], button {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.none {
|
ul.none, ol.none {
|
||||||
list-style: none;
|
list-style: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -246,7 +246,10 @@ namespace Disco.Web.Controllers
|
|||||||
m.Certificates = Database.DeviceCertificates.Where(c => c.DeviceSerialNumber == m.Device.SerialNumber).ToList();
|
m.Certificates = Database.DeviceCertificates.Where(c => c.DeviceSerialNumber == m.Device.SerialNumber).ToList();
|
||||||
|
|
||||||
if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
|
if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
|
||||||
|
{
|
||||||
m.DocumentTemplates = m.Device.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
m.DocumentTemplates = m.Device.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
||||||
|
m.DocumentTemplatePackages = m.Device.AvailableDocumentTemplatePackages(Database, UserService.CurrentUser);
|
||||||
|
}
|
||||||
|
|
||||||
m.DeviceProfileDefaultOrganisationAddress = m.Device.DeviceProfile.DefaultOrganisationAddressDetails(Database);
|
m.DeviceProfileDefaultOrganisationAddress = m.Device.DeviceProfile.DefaultOrganisationAddressDetails(Database);
|
||||||
|
|
||||||
|
|||||||
@@ -344,7 +344,10 @@ namespace Disco.Web.Controllers
|
|||||||
m.UpdatableJobSubTypes = m.Job.JobType.JobSubTypes.OrderBy(jst => jst.Description).ToList();
|
m.UpdatableJobSubTypes = m.Job.JobType.JobSubTypes.OrderBy(jst => jst.Description).ToList();
|
||||||
|
|
||||||
if (Authorization.Has(Claims.Job.Actions.GenerateDocuments))
|
if (Authorization.Has(Claims.Job.Actions.GenerateDocuments))
|
||||||
|
{
|
||||||
m.AvailableDocumentTemplates = m.Job.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
m.AvailableDocumentTemplates = m.Job.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
||||||
|
m.AvailableDocumentTemplatePackages = m.Job.AvailableDocumentTemplatePackages(Database, UserService.CurrentUser);
|
||||||
|
}
|
||||||
|
|
||||||
// Available Job Queues
|
// Available Job Queues
|
||||||
IEnumerable<JobQueueToken> jobQueues = null;
|
IEnumerable<JobQueueToken> jobQueues = null;
|
||||||
|
|||||||
@@ -105,7 +105,10 @@ namespace Disco.Web.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Authorization.Has(Claims.User.Actions.GenerateDocuments))
|
if (Authorization.Has(Claims.User.Actions.GenerateDocuments))
|
||||||
|
{
|
||||||
m.DocumentTemplates = m.User.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
m.DocumentTemplates = m.User.AvailableDocumentTemplates(Database, UserService.CurrentUser, DateTime.Now);
|
||||||
|
m.DocumentTemplatePackages = m.User.AvailableDocumentTemplatePackages(Database, UserService.CurrentUser);
|
||||||
|
}
|
||||||
|
|
||||||
// UI Extensions
|
// UI Extensions
|
||||||
UIExtensions.ExecuteExtensions<UserShowModel>(this.ControllerContext, m);
|
UIExtensions.ExecuteExtensions<UserShowModel>(this.ControllerContext, m);
|
||||||
|
|||||||
@@ -214,6 +214,7 @@
|
|||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="App_Start\OwinStartupConfig.cs" />
|
<Compile Include="App_Start\OwinStartupConfig.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\AuthorizationRoleController.cs" />
|
<Compile Include="Areas\API\Controllers\AuthorizationRoleController.cs" />
|
||||||
|
<Compile Include="Areas\API\Controllers\DocumentTemplatePackageController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\UserFlagAssignmentController.cs" />
|
<Compile Include="Areas\API\Controllers\UserFlagAssignmentController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\UserFlagController.cs" />
|
<Compile Include="Areas\API\Controllers\UserFlagController.cs" />
|
||||||
<Compile Include="Areas\API\Controllers\JobPreferencesController.cs" />
|
<Compile Include="Areas\API\Controllers\JobPreferencesController.cs" />
|
||||||
@@ -232,6 +233,8 @@
|
|||||||
<Compile Include="Areas\Config\Models\AuthorizationRole\IndexModel.cs" />
|
<Compile Include="Areas\Config\Models\AuthorizationRole\IndexModel.cs" />
|
||||||
<Compile Include="Areas\Config\Models\AuthorizationRole\ShowModel.cs" />
|
<Compile Include="Areas\Config\Models\AuthorizationRole\ShowModel.cs" />
|
||||||
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
||||||
|
<Compile Include="Areas\Config\Models\DocumentTemplate\CreatePackageModel.cs" />
|
||||||
|
<Compile Include="Areas\Config\Models\DocumentTemplate\ShowPackageModel.cs" />
|
||||||
<Compile Include="Areas\Config\Models\Shared\LinkedGroupModel.cs" />
|
<Compile Include="Areas\Config\Models\Shared\LinkedGroupModel.cs" />
|
||||||
<Compile Include="Areas\Config\Models\UserFlag\CreateModel.cs" />
|
<Compile Include="Areas\Config\Models\UserFlag\CreateModel.cs" />
|
||||||
<Compile Include="Areas\Config\Models\UserFlag\IndexModel.cs" />
|
<Compile Include="Areas\Config\Models\UserFlag\IndexModel.cs" />
|
||||||
@@ -262,6 +265,16 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Areas\Config\Views\DocumentTemplate\CreatePackage.generated.cs">
|
||||||
|
<DependentUpon>CreatePackage.cshtml</DependentUpon>
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="Areas\Config\Views\DocumentTemplate\ShowPackage1.generated.cs">
|
||||||
|
<AutoGen>True</AutoGen>
|
||||||
|
<DesignTime>True</DesignTime>
|
||||||
|
<DependentUpon>ShowPackage.cshtml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Areas\Config\Views\JobPreferences\Index.generated.cs">
|
<Compile Include="Areas\Config\Views\JobPreferences\Index.generated.cs">
|
||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
@@ -615,6 +628,9 @@
|
|||||||
<AutoGen>True</AutoGen>
|
<AutoGen>True</AutoGen>
|
||||||
<DesignTime>True</DesignTime>
|
<DesignTime>True</DesignTime>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Extensions\T4MVC\API.DocumentTemplatePackageController.generated.cs">
|
||||||
|
<DependentUpon>T4MVC.tt</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Extensions\T4MVC\T4MVCExtensions.cs" />
|
<Compile Include="Extensions\T4MVC\T4MVCExtensions.cs" />
|
||||||
<Compile Include="Extensions\T4MVC\API.AuthorizationRoleController.generated.cs">
|
<Compile Include="Extensions\T4MVC\API.AuthorizationRoleController.generated.cs">
|
||||||
<DependentUpon>T4MVC.tt</DependentUpon>
|
<DependentUpon>T4MVC.tt</DependentUpon>
|
||||||
@@ -1191,6 +1207,14 @@
|
|||||||
<Generator>RazorGenerator</Generator>
|
<Generator>RazorGenerator</Generator>
|
||||||
<LastGenOutput>Show.generated.cs</LastGenOutput>
|
<LastGenOutput>Show.generated.cs</LastGenOutput>
|
||||||
</None>
|
</None>
|
||||||
|
<Content Include="Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml">
|
||||||
|
<Generator>RazorGenerator</Generator>
|
||||||
|
<LastGenOutput>ShowPackage1.generated.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
|
<Content Include="Areas\Config\Views\DocumentTemplate\CreatePackage.cshtml">
|
||||||
|
<Generator>RazorGenerator</Generator>
|
||||||
|
<LastGenOutput>CreatePackage.generated.cs</LastGenOutput>
|
||||||
|
</Content>
|
||||||
<None Include="Areas\Config\Views\JobPreferences\Index.cshtml">
|
<None Include="Areas\Config\Views\JobPreferences\Index.cshtml">
|
||||||
<Generator>RazorGenerator</Generator>
|
<Generator>RazorGenerator</Generator>
|
||||||
<LastGenOutput>Index.generated.cs</LastGenOutput>
|
<LastGenOutput>Index.generated.cs</LastGenOutput>
|
||||||
|
|||||||
@@ -143,6 +143,12 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
[NonAction]
|
[NonAction]
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult GeneratePdfPackage()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public virtual System.Web.Mvc.ActionResult LastNetworkLogonDate()
|
public virtual System.Web.Mvc.ActionResult LastNetworkLogonDate()
|
||||||
{
|
{
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LastNetworkLogonDate);
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.LastNetworkLogonDate);
|
||||||
@@ -243,6 +249,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string Recommission = "Recommission";
|
public readonly string Recommission = "Recommission";
|
||||||
public readonly string Delete = "Delete";
|
public readonly string Delete = "Delete";
|
||||||
public readonly string GeneratePdf = "GeneratePdf";
|
public readonly string GeneratePdf = "GeneratePdf";
|
||||||
|
public readonly string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
public readonly string LastNetworkLogonDate = "LastNetworkLogonDate";
|
public readonly string LastNetworkLogonDate = "LastNetworkLogonDate";
|
||||||
public readonly string AttachmentDownload = "AttachmentDownload";
|
public readonly string AttachmentDownload = "AttachmentDownload";
|
||||||
public readonly string AttachmentThumbnail = "AttachmentThumbnail";
|
public readonly string AttachmentThumbnail = "AttachmentThumbnail";
|
||||||
@@ -275,6 +282,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public const string Recommission = "Recommission";
|
public const string Recommission = "Recommission";
|
||||||
public const string Delete = "Delete";
|
public const string Delete = "Delete";
|
||||||
public const string GeneratePdf = "GeneratePdf";
|
public const string GeneratePdf = "GeneratePdf";
|
||||||
|
public const string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
public const string LastNetworkLogonDate = "LastNetworkLogonDate";
|
public const string LastNetworkLogonDate = "LastNetworkLogonDate";
|
||||||
public const string AttachmentDownload = "AttachmentDownload";
|
public const string AttachmentDownload = "AttachmentDownload";
|
||||||
public const string AttachmentThumbnail = "AttachmentThumbnail";
|
public const string AttachmentThumbnail = "AttachmentThumbnail";
|
||||||
@@ -429,6 +437,15 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string id = "id";
|
public readonly string id = "id";
|
||||||
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
||||||
}
|
}
|
||||||
|
static readonly ActionParamsClass_GeneratePdfPackage s_params_GeneratePdfPackage = new ActionParamsClass_GeneratePdfPackage();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_GeneratePdfPackage GeneratePdfPackageParams { get { return s_params_GeneratePdfPackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_GeneratePdfPackage
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string DocumentTemplatePackageId = "DocumentTemplatePackageId";
|
||||||
|
}
|
||||||
static readonly ActionParamsClass_LastNetworkLogonDate s_params_LastNetworkLogonDate = new ActionParamsClass_LastNetworkLogonDate();
|
static readonly ActionParamsClass_LastNetworkLogonDate s_params_LastNetworkLogonDate = new ActionParamsClass_LastNetworkLogonDate();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public ActionParamsClass_LastNetworkLogonDate LastNetworkLogonDateParams { get { return s_params_LastNetworkLogonDate; } }
|
public ActionParamsClass_LastNetworkLogonDate LastNetworkLogonDateParams { get { return s_params_LastNetworkLogonDate; } }
|
||||||
@@ -741,6 +758,19 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void GeneratePdfPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DocumentTemplatePackageId);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult GeneratePdfPackage(string id, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplatePackageId", DocumentTemplatePackageId);
|
||||||
|
GeneratePdfPackageOverride(callInfo, id, DocumentTemplatePackageId);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void LastNetworkLogonDateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id);
|
partial void LastNetworkLogonDateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id);
|
||||||
|
|
||||||
|
|||||||
@@ -429,6 +429,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
{
|
{
|
||||||
public readonly string id = "id";
|
public readonly string id = "id";
|
||||||
public readonly string DataIds = "DataIds";
|
public readonly string DataIds = "DataIds";
|
||||||
|
public readonly string InsertBlankPage = "InsertBlankPage";
|
||||||
}
|
}
|
||||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
@@ -732,15 +733,16 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void BulkGenerateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DataIds);
|
partial void BulkGenerateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DataIds, bool InsertBlankPage);
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
public override System.Web.Mvc.ActionResult BulkGenerate(string id, string DataIds)
|
public override System.Web.Mvc.ActionResult BulkGenerate(string id, string DataIds, bool InsertBlankPage)
|
||||||
{
|
{
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.BulkGenerate);
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.BulkGenerate);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DataIds", DataIds);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DataIds", DataIds);
|
||||||
BulkGenerateOverride(callInfo, id, DataIds);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "InsertBlankPage", InsertBlankPage);
|
||||||
|
BulkGenerateOverride(callInfo, id, DataIds, InsertBlankPage);
|
||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,459 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
// This file was generated by a T4 template.
|
||||||
|
// Don't change it directly as your change would get overwritten. Instead, make changes
|
||||||
|
// to the .tt file (i.e. the T4 template) and save it to regenerate this file.
|
||||||
|
|
||||||
|
// Make sure the compiler doesn't complain about missing Xml comments
|
||||||
|
#pragma warning disable 1591
|
||||||
|
#region T4MVC
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Web;
|
||||||
|
using System.Web.Hosting;
|
||||||
|
using System.Web.Mvc;
|
||||||
|
using System.Web.Mvc.Ajax;
|
||||||
|
using System.Web.Mvc.Html;
|
||||||
|
using System.Web.Routing;
|
||||||
|
using T4MVC;
|
||||||
|
namespace Disco.Web.Areas.API.Controllers
|
||||||
|
{
|
||||||
|
public partial class DocumentTemplatePackageController
|
||||||
|
{
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public DocumentTemplatePackageController() { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected DocumentTemplatePackageController(Dummy d) { }
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToAction(Task<ActionResult> taskResult)
|
||||||
|
{
|
||||||
|
return RedirectToAction(taskResult.Result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||||
|
{
|
||||||
|
var callInfo = result.GetT4MVCResult();
|
||||||
|
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
protected RedirectToRouteResult RedirectToActionPermanent(Task<ActionResult> taskResult)
|
||||||
|
{
|
||||||
|
return RedirectToActionPermanent(taskResult.Result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult Update()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateDescription()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDescription);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateDocumentTemplates()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDocumentTemplates);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateFilterExpression()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateFilterExpression);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateOnGenerateExpression()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateOnGenerateExpression);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateIsHidden()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIsHidden);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateInsertBlankPages()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateInsertBlankPages);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateScope()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateScope);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult UpdateJobSubTypes()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateJobSubTypes);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult BulkGenerate()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.BulkGenerate);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult Delete()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Delete);
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public DocumentTemplatePackageController Actions { get { return MVC.API.DocumentTemplatePackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Area = "API";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public readonly string Name = "DocumentTemplatePackage";
|
||||||
|
[GeneratedCode("T4MVC", "2.0")]
|
||||||
|
public const string NameConst = "DocumentTemplatePackage";
|
||||||
|
|
||||||
|
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNamesClass
|
||||||
|
{
|
||||||
|
public readonly string Update = "Update";
|
||||||
|
public readonly string UpdateDescription = "UpdateDescription";
|
||||||
|
public readonly string UpdateDocumentTemplates = "UpdateDocumentTemplates";
|
||||||
|
public readonly string UpdateFilterExpression = "UpdateFilterExpression";
|
||||||
|
public readonly string UpdateOnGenerateExpression = "UpdateOnGenerateExpression";
|
||||||
|
public readonly string UpdateIsHidden = "UpdateIsHidden";
|
||||||
|
public readonly string UpdateInsertBlankPages = "UpdateInsertBlankPages";
|
||||||
|
public readonly string UpdateScope = "UpdateScope";
|
||||||
|
public readonly string UpdateJobSubTypes = "UpdateJobSubTypes";
|
||||||
|
public readonly string BulkGenerate = "BulkGenerate";
|
||||||
|
public readonly string Delete = "Delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionNameConstants
|
||||||
|
{
|
||||||
|
public const string Update = "Update";
|
||||||
|
public const string UpdateDescription = "UpdateDescription";
|
||||||
|
public const string UpdateDocumentTemplates = "UpdateDocumentTemplates";
|
||||||
|
public const string UpdateFilterExpression = "UpdateFilterExpression";
|
||||||
|
public const string UpdateOnGenerateExpression = "UpdateOnGenerateExpression";
|
||||||
|
public const string UpdateIsHidden = "UpdateIsHidden";
|
||||||
|
public const string UpdateInsertBlankPages = "UpdateInsertBlankPages";
|
||||||
|
public const string UpdateScope = "UpdateScope";
|
||||||
|
public const string UpdateJobSubTypes = "UpdateJobSubTypes";
|
||||||
|
public const string BulkGenerate = "BulkGenerate";
|
||||||
|
public const string Delete = "Delete";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static readonly ActionParamsClass_Update s_params_Update = new ActionParamsClass_Update();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_Update UpdateParams { get { return s_params_Update; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_Update
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string key = "key";
|
||||||
|
public readonly string value = "value";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateDescription s_params_UpdateDescription = new ActionParamsClass_UpdateDescription();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateDescription UpdateDescriptionParams { get { return s_params_UpdateDescription; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateDescription
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string Description = "Description";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateDocumentTemplates s_params_UpdateDocumentTemplates = new ActionParamsClass_UpdateDocumentTemplates();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateDocumentTemplates UpdateDocumentTemplatesParams { get { return s_params_UpdateDocumentTemplates; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateDocumentTemplates
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string DocumentTemplates = "DocumentTemplates";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateFilterExpression s_params_UpdateFilterExpression = new ActionParamsClass_UpdateFilterExpression();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateFilterExpression UpdateFilterExpressionParams { get { return s_params_UpdateFilterExpression; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateFilterExpression
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string FilterExpression = "FilterExpression";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateOnGenerateExpression s_params_UpdateOnGenerateExpression = new ActionParamsClass_UpdateOnGenerateExpression();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateOnGenerateExpression UpdateOnGenerateExpressionParams { get { return s_params_UpdateOnGenerateExpression; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateOnGenerateExpression
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string OnGenerateExpression = "OnGenerateExpression";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateIsHidden s_params_UpdateIsHidden = new ActionParamsClass_UpdateIsHidden();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateIsHidden UpdateIsHiddenParams { get { return s_params_UpdateIsHidden; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateIsHidden
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string IsHidden = "IsHidden";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateInsertBlankPages s_params_UpdateInsertBlankPages = new ActionParamsClass_UpdateInsertBlankPages();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateInsertBlankPages UpdateInsertBlankPagesParams { get { return s_params_UpdateInsertBlankPages; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateInsertBlankPages
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string InsertBlankPages = "InsertBlankPages";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateScope s_params_UpdateScope = new ActionParamsClass_UpdateScope();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateScope UpdateScopeParams { get { return s_params_UpdateScope; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateScope
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string Scope = "Scope";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_UpdateJobSubTypes s_params_UpdateJobSubTypes = new ActionParamsClass_UpdateJobSubTypes();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_UpdateJobSubTypes UpdateJobSubTypesParams { get { return s_params_UpdateJobSubTypes; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_UpdateJobSubTypes
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string JobSubTypes = "JobSubTypes";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_BulkGenerate s_params_BulkGenerate = new ActionParamsClass_BulkGenerate();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_BulkGenerate BulkGenerateParams { get { return s_params_BulkGenerate; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_BulkGenerate
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string DataIds = "DataIds";
|
||||||
|
public readonly string InsertBlankPage = "InsertBlankPage";
|
||||||
|
}
|
||||||
|
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_Delete DeleteParams { get { return s_params_Delete; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_Delete
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string redirect = "redirect";
|
||||||
|
}
|
||||||
|
static readonly ViewsClass s_views = new ViewsClass();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ViewsClass Views { get { return s_views; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ViewsClass
|
||||||
|
{
|
||||||
|
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||||
|
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||||
|
public class _ViewNamesClass
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public partial class T4MVC_DocumentTemplatePackageController : Disco.Web.Areas.API.Controllers.DocumentTemplatePackageController
|
||||||
|
{
|
||||||
|
public T4MVC_DocumentTemplatePackageController() : base(Dummy.Instance) { }
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string key, string value, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult Update(string id, string key, string value, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Update);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "key", key);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "value", value);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateOverride(callInfo, id, key, value, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateDescriptionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Description, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateDescription(string id, string Description, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDescription);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Description", Description);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateDescriptionOverride(callInfo, id, Description, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateDocumentTemplatesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, System.Collections.Generic.List<string> DocumentTemplates, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateDocumentTemplates(string id, System.Collections.Generic.List<string> DocumentTemplates, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDocumentTemplates);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplates", DocumentTemplates);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateDocumentTemplatesOverride(callInfo, id, DocumentTemplates, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateFilterExpressionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string FilterExpression, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateFilterExpression(string id, string FilterExpression, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateFilterExpression);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterExpression", FilterExpression);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateFilterExpressionOverride(callInfo, id, FilterExpression, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateOnGenerateExpressionOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string OnGenerateExpression, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateOnGenerateExpression(string id, string OnGenerateExpression, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateOnGenerateExpression);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "OnGenerateExpression", OnGenerateExpression);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateOnGenerateExpressionOverride(callInfo, id, OnGenerateExpression, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateIsHiddenOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string IsHidden, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateIsHidden(string id, string IsHidden, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateIsHidden);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "IsHidden", IsHidden);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateIsHiddenOverride(callInfo, id, IsHidden, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateInsertBlankPagesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string InsertBlankPages, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateInsertBlankPages(string id, string InsertBlankPages, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateInsertBlankPages);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "InsertBlankPages", InsertBlankPages);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateInsertBlankPagesOverride(callInfo, id, InsertBlankPages, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateScopeOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Scope, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateScope(string id, string Scope, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateScope);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Scope", Scope);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateScopeOverride(callInfo, id, Scope, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void UpdateJobSubTypesOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, System.Collections.Generic.List<string> JobSubTypes, bool redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult UpdateJobSubTypes(string id, System.Collections.Generic.List<string> JobSubTypes, bool redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateJobSubTypes);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "JobSubTypes", JobSubTypes);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
UpdateJobSubTypesOverride(callInfo, id, JobSubTypes, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void BulkGenerateOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DataIds, bool InsertBlankPage);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult BulkGenerate(string id, string DataIds, bool InsertBlankPage)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.BulkGenerate);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DataIds", DataIds);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "InsertBlankPage", InsertBlankPage);
|
||||||
|
BulkGenerateOverride(callInfo, id, DataIds, InsertBlankPage);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void DeleteOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, bool? redirect);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult Delete(string id, bool? redirect)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Delete);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||||
|
DeleteOverride(callInfo, id, redirect);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion T4MVC
|
||||||
|
#pragma warning restore 1591
|
||||||
@@ -441,6 +441,12 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
{
|
{
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
||||||
}
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult GeneratePdfPackage()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
}
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public JobController Actions { get { return MVC.API.Job; } }
|
public JobController Actions { get { return MVC.API.Job; } }
|
||||||
@@ -522,6 +528,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string ComponentRemove = "ComponentRemove";
|
public readonly string ComponentRemove = "ComponentRemove";
|
||||||
public readonly string StatisticsDailyOpenedClosed = "StatisticsDailyOpenedClosed";
|
public readonly string StatisticsDailyOpenedClosed = "StatisticsDailyOpenedClosed";
|
||||||
public readonly string GeneratePdf = "GeneratePdf";
|
public readonly string GeneratePdf = "GeneratePdf";
|
||||||
|
public readonly string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
public readonly string DeviceHeldLocations = "DeviceHeldLocations";
|
public readonly string DeviceHeldLocations = "DeviceHeldLocations";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -593,6 +600,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public const string ComponentRemove = "ComponentRemove";
|
public const string ComponentRemove = "ComponentRemove";
|
||||||
public const string StatisticsDailyOpenedClosed = "StatisticsDailyOpenedClosed";
|
public const string StatisticsDailyOpenedClosed = "StatisticsDailyOpenedClosed";
|
||||||
public const string GeneratePdf = "GeneratePdf";
|
public const string GeneratePdf = "GeneratePdf";
|
||||||
|
public const string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
public const string DeviceHeldLocations = "DeviceHeldLocations";
|
public const string DeviceHeldLocations = "DeviceHeldLocations";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1212,6 +1220,15 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string id = "id";
|
public readonly string id = "id";
|
||||||
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
||||||
}
|
}
|
||||||
|
static readonly ActionParamsClass_GeneratePdfPackage s_params_GeneratePdfPackage = new ActionParamsClass_GeneratePdfPackage();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_GeneratePdfPackage GeneratePdfPackageParams { get { return s_params_GeneratePdfPackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_GeneratePdfPackage
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string DocumentTemplatePackageId = "DocumentTemplatePackageId";
|
||||||
|
}
|
||||||
static readonly ViewsClass s_views = new ViewsClass();
|
static readonly ViewsClass s_views = new ViewsClass();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public ViewsClass Views { get { return s_views; } }
|
public ViewsClass Views { get { return s_views; } }
|
||||||
@@ -2101,10 +2118,10 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void GeneratePdfOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DocumentTemplateId);
|
partial void GeneratePdfOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string DocumentTemplateId);
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
public override System.Web.Mvc.ActionResult GeneratePdf(string id, string DocumentTemplateId)
|
public override System.Web.Mvc.ActionResult GeneratePdf(int id, string DocumentTemplateId)
|
||||||
{
|
{
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
@@ -2113,6 +2130,19 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void GeneratePdfPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string DocumentTemplatePackageId);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult GeneratePdfPackage(int id, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplatePackageId", DocumentTemplatePackageId);
|
||||||
|
GeneratePdfPackageOverride(callInfo, id, DocumentTemplatePackageId);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void DeviceHeldLocationsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
partial void DeviceHeldLocationsOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,12 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
{
|
{
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdf);
|
||||||
}
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult GeneratePdfPackage()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
}
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public UserController Actions { get { return MVC.API.User; } }
|
public UserController Actions { get { return MVC.API.User; } }
|
||||||
@@ -122,6 +128,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string Attachments = "Attachments";
|
public readonly string Attachments = "Attachments";
|
||||||
public readonly string AttachmentRemove = "AttachmentRemove";
|
public readonly string AttachmentRemove = "AttachmentRemove";
|
||||||
public readonly string GeneratePdf = "GeneratePdf";
|
public readonly string GeneratePdf = "GeneratePdf";
|
||||||
|
public readonly string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
}
|
}
|
||||||
|
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
@@ -134,6 +141,7 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public const string Attachments = "Attachments";
|
public const string Attachments = "Attachments";
|
||||||
public const string AttachmentRemove = "AttachmentRemove";
|
public const string AttachmentRemove = "AttachmentRemove";
|
||||||
public const string GeneratePdf = "GeneratePdf";
|
public const string GeneratePdf = "GeneratePdf";
|
||||||
|
public const string GeneratePdfPackage = "GeneratePdfPackage";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -198,6 +206,16 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
public readonly string Domain = "Domain";
|
public readonly string Domain = "Domain";
|
||||||
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
public readonly string DocumentTemplateId = "DocumentTemplateId";
|
||||||
}
|
}
|
||||||
|
static readonly ActionParamsClass_GeneratePdfPackage s_params_GeneratePdfPackage = new ActionParamsClass_GeneratePdfPackage();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_GeneratePdfPackage GeneratePdfPackageParams { get { return s_params_GeneratePdfPackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_GeneratePdfPackage
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
public readonly string Domain = "Domain";
|
||||||
|
public readonly string DocumentTemplatePackageId = "DocumentTemplatePackageId";
|
||||||
|
}
|
||||||
static readonly ViewsClass s_views = new ViewsClass();
|
static readonly ViewsClass s_views = new ViewsClass();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public ViewsClass Views { get { return s_views; } }
|
public ViewsClass Views { get { return s_views; } }
|
||||||
@@ -306,6 +324,20 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void GeneratePdfPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string Domain, string DocumentTemplatePackageId);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult GeneratePdfPackage(string id, string Domain, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Domain", Domain);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplatePackageId", DocumentTemplatePackageId);
|
||||||
|
GeneratePdfPackageOverride(callInfo, id, Domain, DocumentTemplatePackageId);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,12 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
}
|
}
|
||||||
[NonAction]
|
[NonAction]
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public virtual System.Web.Mvc.ActionResult ShowPackage()
|
||||||
|
{
|
||||||
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ShowPackage);
|
||||||
|
}
|
||||||
|
[NonAction]
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public virtual System.Web.Mvc.ActionResult ExpressionBrowser()
|
public virtual System.Web.Mvc.ActionResult ExpressionBrowser()
|
||||||
{
|
{
|
||||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExpressionBrowser);
|
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExpressionBrowser);
|
||||||
@@ -86,9 +92,11 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
public class ActionNamesClass
|
public class ActionNamesClass
|
||||||
{
|
{
|
||||||
public readonly string Index = "Index";
|
public readonly string Index = "Index";
|
||||||
|
public readonly string ShowPackage = "ShowPackage";
|
||||||
public readonly string ImportStatus = "ImportStatus";
|
public readonly string ImportStatus = "ImportStatus";
|
||||||
public readonly string UndetectedPages = "UndetectedPages";
|
public readonly string UndetectedPages = "UndetectedPages";
|
||||||
public readonly string Create = "Create";
|
public readonly string Create = "Create";
|
||||||
|
public readonly string CreatePackage = "CreatePackage";
|
||||||
public readonly string ExpressionBrowser = "ExpressionBrowser";
|
public readonly string ExpressionBrowser = "ExpressionBrowser";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -96,9 +104,11 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
public class ActionNameConstants
|
public class ActionNameConstants
|
||||||
{
|
{
|
||||||
public const string Index = "Index";
|
public const string Index = "Index";
|
||||||
|
public const string ShowPackage = "ShowPackage";
|
||||||
public const string ImportStatus = "ImportStatus";
|
public const string ImportStatus = "ImportStatus";
|
||||||
public const string UndetectedPages = "UndetectedPages";
|
public const string UndetectedPages = "UndetectedPages";
|
||||||
public const string Create = "Create";
|
public const string Create = "Create";
|
||||||
|
public const string CreatePackage = "CreatePackage";
|
||||||
public const string ExpressionBrowser = "ExpressionBrowser";
|
public const string ExpressionBrowser = "ExpressionBrowser";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,6 +121,14 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
{
|
{
|
||||||
public readonly string id = "id";
|
public readonly string id = "id";
|
||||||
}
|
}
|
||||||
|
static readonly ActionParamsClass_ShowPackage s_params_ShowPackage = new ActionParamsClass_ShowPackage();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_ShowPackage ShowPackageParams { get { return s_params_ShowPackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_ShowPackage
|
||||||
|
{
|
||||||
|
public readonly string id = "id";
|
||||||
|
}
|
||||||
static readonly ActionParamsClass_Create s_params_Create = new ActionParamsClass_Create();
|
static readonly ActionParamsClass_Create s_params_Create = new ActionParamsClass_Create();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public ActionParamsClass_Create CreateParams { get { return s_params_Create; } }
|
public ActionParamsClass_Create CreateParams { get { return s_params_Create; } }
|
||||||
@@ -119,6 +137,14 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
{
|
{
|
||||||
public readonly string model = "model";
|
public readonly string model = "model";
|
||||||
}
|
}
|
||||||
|
static readonly ActionParamsClass_CreatePackage s_params_CreatePackage = new ActionParamsClass_CreatePackage();
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public ActionParamsClass_CreatePackage CreatePackageParams { get { return s_params_CreatePackage; } }
|
||||||
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
|
public class ActionParamsClass_CreatePackage
|
||||||
|
{
|
||||||
|
public readonly string model = "model";
|
||||||
|
}
|
||||||
static readonly ActionParamsClass_ExpressionBrowser s_params_ExpressionBrowser = new ActionParamsClass_ExpressionBrowser();
|
static readonly ActionParamsClass_ExpressionBrowser s_params_ExpressionBrowser = new ActionParamsClass_ExpressionBrowser();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
public ActionParamsClass_ExpressionBrowser ExpressionBrowserParams { get { return s_params_ExpressionBrowser; } }
|
public ActionParamsClass_ExpressionBrowser ExpressionBrowserParams { get { return s_params_ExpressionBrowser; } }
|
||||||
@@ -140,18 +166,22 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
{
|
{
|
||||||
public readonly string _ExpressionsTable = "_ExpressionsTable";
|
public readonly string _ExpressionsTable = "_ExpressionsTable";
|
||||||
public readonly string Create = "Create";
|
public readonly string Create = "Create";
|
||||||
|
public readonly string CreatePackage = "CreatePackage";
|
||||||
public readonly string ExpressionBrowser = "ExpressionBrowser";
|
public readonly string ExpressionBrowser = "ExpressionBrowser";
|
||||||
public readonly string ImportStatus = "ImportStatus";
|
public readonly string ImportStatus = "ImportStatus";
|
||||||
public readonly string Index = "Index";
|
public readonly string Index = "Index";
|
||||||
public readonly string Show = "Show";
|
public readonly string Show = "Show";
|
||||||
|
public readonly string ShowPackage = "ShowPackage";
|
||||||
public readonly string UndetectedPages = "UndetectedPages";
|
public readonly string UndetectedPages = "UndetectedPages";
|
||||||
}
|
}
|
||||||
public readonly string _ExpressionsTable = "~/Areas/Config/Views/DocumentTemplate/_ExpressionsTable.cshtml";
|
public readonly string _ExpressionsTable = "~/Areas/Config/Views/DocumentTemplate/_ExpressionsTable.cshtml";
|
||||||
public readonly string Create = "~/Areas/Config/Views/DocumentTemplate/Create.cshtml";
|
public readonly string Create = "~/Areas/Config/Views/DocumentTemplate/Create.cshtml";
|
||||||
|
public readonly string CreatePackage = "~/Areas/Config/Views/DocumentTemplate/CreatePackage.cshtml";
|
||||||
public readonly string ExpressionBrowser = "~/Areas/Config/Views/DocumentTemplate/ExpressionBrowser.cshtml";
|
public readonly string ExpressionBrowser = "~/Areas/Config/Views/DocumentTemplate/ExpressionBrowser.cshtml";
|
||||||
public readonly string ImportStatus = "~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml";
|
public readonly string ImportStatus = "~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml";
|
||||||
public readonly string Index = "~/Areas/Config/Views/DocumentTemplate/Index.cshtml";
|
public readonly string Index = "~/Areas/Config/Views/DocumentTemplate/Index.cshtml";
|
||||||
public readonly string Show = "~/Areas/Config/Views/DocumentTemplate/Show.cshtml";
|
public readonly string Show = "~/Areas/Config/Views/DocumentTemplate/Show.cshtml";
|
||||||
|
public readonly string ShowPackage = "~/Areas/Config/Views/DocumentTemplate/ShowPackage.cshtml";
|
||||||
public readonly string UndetectedPages = "~/Areas/Config/Views/DocumentTemplate/UndetectedPages.cshtml";
|
public readonly string UndetectedPages = "~/Areas/Config/Views/DocumentTemplate/UndetectedPages.cshtml";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -173,6 +203,18 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void ShowPackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult ShowPackage(string id)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ShowPackage);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||||
|
ShowPackageOverride(callInfo, id);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void ImportStatusOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
partial void ImportStatusOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||||
|
|
||||||
@@ -218,6 +260,29 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void CreatePackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult CreatePackage()
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.CreatePackage);
|
||||||
|
CreatePackageOverride(callInfo);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
partial void CreatePackageOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Areas.Config.Models.DocumentTemplate.CreatePackageModel model);
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public override System.Web.Mvc.ActionResult CreatePackage(Disco.Web.Areas.Config.Models.DocumentTemplate.CreatePackageModel model)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.CreatePackage);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "model", model);
|
||||||
|
CreatePackageOverride(callInfo, model);
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void ExpressionBrowserOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string type, bool StaticDeclaredMembersOnly);
|
partial void ExpressionBrowserOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string type, bool StaticDeclaredMembersOnly);
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,7 @@ namespace T4MVC
|
|||||||
public Disco.Web.Areas.API.Controllers.DeviceModelController DeviceModel = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceModelController();
|
public Disco.Web.Areas.API.Controllers.DeviceModelController DeviceModel = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceModelController();
|
||||||
public Disco.Web.Areas.API.Controllers.DeviceProfileController DeviceProfile = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceProfileController();
|
public Disco.Web.Areas.API.Controllers.DeviceProfileController DeviceProfile = new Disco.Web.Areas.API.Controllers.T4MVC_DeviceProfileController();
|
||||||
public Disco.Web.Areas.API.Controllers.DocumentTemplateController DocumentTemplate = new Disco.Web.Areas.API.Controllers.T4MVC_DocumentTemplateController();
|
public Disco.Web.Areas.API.Controllers.DocumentTemplateController DocumentTemplate = new Disco.Web.Areas.API.Controllers.T4MVC_DocumentTemplateController();
|
||||||
|
public Disco.Web.Areas.API.Controllers.DocumentTemplatePackageController DocumentTemplatePackage = new Disco.Web.Areas.API.Controllers.T4MVC_DocumentTemplatePackageController();
|
||||||
public Disco.Web.Areas.API.Controllers.ExpressionsController Expressions = new Disco.Web.Areas.API.Controllers.T4MVC_ExpressionsController();
|
public Disco.Web.Areas.API.Controllers.ExpressionsController Expressions = new Disco.Web.Areas.API.Controllers.T4MVC_ExpressionsController();
|
||||||
public Disco.Web.Areas.API.Controllers.JobController Job = new Disco.Web.Areas.API.Controllers.T4MVC_JobController();
|
public Disco.Web.Areas.API.Controllers.JobController Job = new Disco.Web.Areas.API.Controllers.T4MVC_JobController();
|
||||||
public Disco.Web.Areas.API.Controllers.JobPreferencesController JobPreferences = new Disco.Web.Areas.API.Controllers.T4MVC_JobPreferencesController();
|
public Disco.Web.Areas.API.Controllers.JobPreferencesController JobPreferences = new Disco.Web.Areas.API.Controllers.T4MVC_JobPreferencesController();
|
||||||
|
|||||||
@@ -69,5 +69,16 @@ namespace Disco.Web.Areas.API.Controllers
|
|||||||
|
|
||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[NonAction]
|
||||||
|
public virtual ActionResult GeneratePdfPackage(string id, string DocumentTemplatePackageId)
|
||||||
|
{
|
||||||
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.GeneratePdfPackage);
|
||||||
|
|
||||||
|
Disco.Web.Controllers.UserController.T4MVCAddUserIdRouteValues(callInfo, id);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DocumentTemplatePackageId", DocumentTemplatePackageId);
|
||||||
|
|
||||||
|
return callInfo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Documents;
|
||||||
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using Disco.Models.UI.Device;
|
using Disco.Models.UI.Device;
|
||||||
using Disco.Services.Plugins;
|
using Disco.Services.Plugins;
|
||||||
using Disco.Web.Extensions;
|
using Disco.Web.Extensions;
|
||||||
@@ -23,6 +24,7 @@ namespace Disco.Web.Models.Device
|
|||||||
public string OrganisationUnit { get; set; }
|
public string OrganisationUnit { get; set; }
|
||||||
|
|
||||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
public List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||||
|
|
||||||
public List<SelectListItem> DocumentTemplatesSelectListItems
|
public List<SelectListItem> DocumentTemplatesSelectListItems
|
||||||
{
|
{
|
||||||
@@ -30,7 +32,8 @@ namespace Disco.Web.Models.Device
|
|||||||
{
|
{
|
||||||
var list = new List<SelectListItem>();
|
var list = new List<SelectListItem>();
|
||||||
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
||||||
list.AddRange(this.DocumentTemplates.ToSelectListItems());
|
list.AddRange(DocumentTemplates.ToSelectListItems());
|
||||||
|
list.AddRange(DocumentTemplatePackages.ToSelectListItems());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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 Disco.Models.Services.Jobs.JobLists;
|
||||||
using Disco.Models.UI.Job;
|
using Disco.Models.UI.Job;
|
||||||
using Disco.Web.Extensions;
|
using Disco.Web.Extensions;
|
||||||
@@ -15,6 +16,7 @@ namespace Disco.Web.Models.Job
|
|||||||
public TimeSpan? LongRunning { get; set; }
|
public TimeSpan? LongRunning { get; set; }
|
||||||
|
|
||||||
public List<Disco.Models.Repository.DocumentTemplate> AvailableDocumentTemplates { get; set; }
|
public List<Disco.Models.Repository.DocumentTemplate> AvailableDocumentTemplates { get; set; }
|
||||||
|
public List<DocumentTemplatePackage> AvailableDocumentTemplatePackages { get; set; }
|
||||||
public List<Disco.Models.Repository.JobSubType> UpdatableJobSubTypes { get; set; }
|
public List<Disco.Models.Repository.JobSubType> UpdatableJobSubTypes { get; set; }
|
||||||
public List<Disco.Models.Repository.JobQueue> AvailableQueues { get; set; }
|
public List<Disco.Models.Repository.JobQueue> AvailableQueues { get; set; }
|
||||||
|
|
||||||
@@ -24,7 +26,8 @@ namespace Disco.Web.Models.Job
|
|||||||
{
|
{
|
||||||
var list = new List<SelectListItem>();
|
var list = new List<SelectListItem>();
|
||||||
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Generate Document" });
|
||||||
list.AddRange(this.AvailableDocumentTemplates.ToSelectListItems());
|
list.AddRange(AvailableDocumentTemplates.ToSelectListItems());
|
||||||
|
list.AddRange(AvailableDocumentTemplatePackages.ToSelectListItems());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
using Disco.Models.Services.Authorization;
|
using Disco.Models.Services.Authorization;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Jobs.JobLists;
|
using Disco.Models.Services.Jobs.JobLists;
|
||||||
using Disco.Models.UI.User;
|
using Disco.Models.UI.User;
|
||||||
using Disco.Services.Users.UserFlags;
|
using Disco.Services.Users.UserFlags;
|
||||||
@@ -16,6 +17,7 @@ namespace Disco.Web.Models.User
|
|||||||
public Disco.Models.Repository.User User { get; set; }
|
public Disco.Models.Repository.User User { get; set; }
|
||||||
public JobTableModel Jobs { get; set; }
|
public JobTableModel Jobs { get; set; }
|
||||||
public List<DocumentTemplate> DocumentTemplates { get; set; }
|
public List<DocumentTemplate> DocumentTemplates { get; set; }
|
||||||
|
public List<DocumentTemplatePackage> DocumentTemplatePackages { get; set; }
|
||||||
|
|
||||||
public List<UserFlag> AvailableUserFlags { get; set; }
|
public List<UserFlag> AvailableUserFlags { get; set; }
|
||||||
|
|
||||||
@@ -26,7 +28,7 @@ namespace Disco.Web.Models.User
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
var rootNode = FancyTreeNode.FromClaimNavigatorItem(this.ClaimNavigator, true);
|
var rootNode = FancyTreeNode.FromClaimNavigatorItem(ClaimNavigator, true);
|
||||||
rootNode.expanded = true;
|
rootNode.expanded = true;
|
||||||
|
|
||||||
return new FancyTreeNode[] {
|
return new FancyTreeNode[] {
|
||||||
@@ -41,7 +43,8 @@ namespace Disco.Web.Models.User
|
|||||||
{
|
{
|
||||||
var list = new List<SelectListItem>();
|
var list = new List<SelectListItem>();
|
||||||
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Select a Document to Generate" });
|
list.Add(new SelectListItem() { Selected = true, Value = string.Empty, Text = "Select a Document to Generate" });
|
||||||
list.AddRange(this.DocumentTemplates.ToSelectListItems());
|
list.AddRange(DocumentTemplates.ToSelectListItems());
|
||||||
|
list.AddRange(DocumentTemplatePackages.ToSelectListItems());
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -282,14 +282,20 @@
|
|||||||
@Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
@Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null))?DocumentTemplateId=';
|
var generatePdfUrl = '@Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber, null))?DocumentTemplateId=';
|
||||||
|
var generatePackageUrl = '@Url.Action(MVC.API.Device.GeneratePdfPackage(Model.Device.SerialNumber, null))?DocumentTemplatePackageId=';
|
||||||
var $documentTemplates = $('#Device_Show_GenerateDocument');
|
var $documentTemplates = $('#Device_Show_GenerateDocument');
|
||||||
var $generationHost;
|
var $generationHost;
|
||||||
|
|
||||||
$documentTemplates.change(function () {
|
$documentTemplates.change(function () {
|
||||||
var v = $documentTemplates.val();
|
var v = $documentTemplates.val();
|
||||||
if (v) {
|
if (v) {
|
||||||
var url = generatePdfUrl + v;
|
var url;
|
||||||
|
if (v.lastIndexOf('Package:', 0) === 0) {
|
||||||
|
url = generatePackageUrl + v.substring(8);
|
||||||
|
} else {
|
||||||
|
url = generatePdfUrl + v;
|
||||||
|
}
|
||||||
|
|
||||||
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
||||||
$.connection.hub.transport.name == 'foreverFrame') {
|
$.connection.hub.transport.name == 'foreverFrame') {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -165,14 +165,20 @@
|
|||||||
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
@Html.DropDownList("Job_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems)
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
var generatePdfUrl = '@Url.Action(MVC.API.Job.GeneratePdf(Model.Job.Id.ToString(), null))?DocumentTemplateId=';
|
var generatePdfUrl = '@Url.Action(MVC.API.Job.GeneratePdf(Model.Job.Id, null))?DocumentTemplateId=';
|
||||||
|
var generatePackageUrl = '@Url.Action(MVC.API.Job.GeneratePdfPackage(Model.Job.Id, null))?DocumentTemplatePackageId=';
|
||||||
var $documentTemplates = $('#Job_Show_GenerateDocument');
|
var $documentTemplates = $('#Job_Show_GenerateDocument');
|
||||||
var $generationHost;
|
var $generationHost;
|
||||||
|
|
||||||
$documentTemplates.change(function () {
|
$documentTemplates.change(function () {
|
||||||
var v = $documentTemplates.val();
|
var v = $documentTemplates.val();
|
||||||
if (v) {
|
if (v) {
|
||||||
var url = generatePdfUrl + v;
|
var url;
|
||||||
|
if (v.lastIndexOf('Package:', 0) === 0) {
|
||||||
|
url = generatePackageUrl + v.substring(8);
|
||||||
|
} else {
|
||||||
|
url = generatePdfUrl + v;
|
||||||
|
}
|
||||||
|
|
||||||
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
||||||
$.connection.hub.transport.name == 'foreverFrame') {
|
$.connection.hub.transport.name == 'foreverFrame') {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -73,13 +73,19 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function () {
|
$(function () {
|
||||||
var generatePdfUrl = '@Url.Action(MVC.API.User.GeneratePdf(Model.User.UserId, null))?DocumentTemplateId=';
|
var generatePdfUrl = '@Url.Action(MVC.API.User.GeneratePdf(Model.User.UserId, null))?DocumentTemplateId=';
|
||||||
|
var generatePackageUrl = '@Url.Action(MVC.API.User.GeneratePdfPackage(Model.User.UserId, null))?DocumentTemplatePackageId=';
|
||||||
var $documentTemplates = $('#User_Show_GenerateDocument');
|
var $documentTemplates = $('#User_Show_GenerateDocument');
|
||||||
var $generationHost;
|
var $generationHost;
|
||||||
|
|
||||||
$documentTemplates.change(function () {
|
$documentTemplates.change(function () {
|
||||||
var v = $documentTemplates.val();
|
var v = $documentTemplates.val();
|
||||||
if (v) {
|
if (v) {
|
||||||
var url = generatePdfUrl + v;
|
var url;
|
||||||
|
if (v.lastIndexOf('Package:', 0) === 0) {
|
||||||
|
url = generatePackageUrl + v.substring(8);
|
||||||
|
} else {
|
||||||
|
url = generatePdfUrl + v;
|
||||||
|
}
|
||||||
|
|
||||||
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
if ($.connection && $.connection.hub && $.connection.hub.transport &&
|
||||||
$.connection.hub.transport.name == 'foreverFrame') {
|
$.connection.hub.transport.name == 'foreverFrame') {
|
||||||
|
|||||||
@@ -332,36 +332,50 @@ WriteLiteral(">\r\n $(function () {\r\n
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("?DocumentTemplateId=\';\r\n var $documentTemplate" +
|
WriteLiteral("?DocumentTemplateId=\';\r\n var generatePackageUr" +
|
||||||
"s = $(\'#User_Show_GenerateDocument\');\r\n var $" +
|
"l = \'");
|
||||||
"generationHost;\r\n\r\n $documentTemplates.change" +
|
|
||||||
"(function () {\r\n var v = $documentTemplat" +
|
|
||||||
"es.val();\r\n if (v) {\r\n " +
|
#line 76 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
" var url = generatePdfUrl + v;\r\n\r\n " +
|
Write(Url.Action(MVC.API.User.GeneratePdfPackage(Model.User.UserId, null)));
|
||||||
" if ($.connection && $.connection.hub && $.connection.hub.t" +
|
|
||||||
"ransport &&\r\n $.connection.hu" +
|
|
||||||
"b.transport.name == \'foreverFrame\') {\r\n " +
|
#line default
|
||||||
" // SignalR active with foreverFrame transport - use popup window\r\n " +
|
#line hidden
|
||||||
" window.open(url, \'_blank\', \'height=150," +
|
WriteLiteral("?DocumentTemplatePackageId=\';\r\n var $documentT" +
|
||||||
"width=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no" +
|
"emplates = $(\'#User_Show_GenerateDocument\');\r\n " +
|
||||||
"\');\r\n } else {\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 " +
|
" // use iFrame\r\n " +
|
||||||
" if (!$generationHost) {\r\n " +
|
" if (!$generationHost) {\r\n " +
|
||||||
" $generationHost = $(\'<iframe>\')\r\n " +
|
" $generationHost = $(\'<iframe>\')\r\n " +
|
||||||
" .attr({ \'src\': url, \'title\': \'Document Generation Host\' })\r\n " +
|
" .attr({ \'src\': url, \'title\': \'Document Gene" +
|
||||||
" .addClass(\'hidden\')\r\n " +
|
"ration Host\' })\r\n .addCla" +
|
||||||
" .appendTo(\'body\')\r\n " +
|
"ss(\'hidden\')\r\n .appendTo(" +
|
||||||
" .contents();\r\n " +
|
"\'body\')\r\n .contents();\r\n " +
|
||||||
" } else {\r\n " +
|
" } else {\r\n " +
|
||||||
" $generationHost[0].location.href = url;\r\n " +
|
" $generationHost[0].location.href = url;\r\n " +
|
||||||
" }\r\n }\r\n\r\n " +
|
" }\r\n " +
|
||||||
" $documentTemplates.val(\'\').blur();\r\n " +
|
" }\r\n\r\n $documentTemplates.val(\'\')" +
|
||||||
" }\r\n });\r\n " +
|
".blur();\r\n }\r\n " +
|
||||||
" });\r\n </script>\r\n " +
|
" });\r\n });\r\n <" +
|
||||||
" </div>\r\n");
|
"/script>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 107 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 113 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -374,13 +388,13 @@ WriteLiteral(" id=\"User_Show_Details_Actions\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 109 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 115 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 109 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 115 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (Model.User.CanCreateJob())
|
if (Model.User.CanCreateJob())
|
||||||
{
|
{
|
||||||
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
||||||
@@ -389,14 +403,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 112 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 118 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.UserId), "User_Show_Details_Actions_CreateJob_Button"));
|
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.PrimaryDeviceSerialNumber, Model.User.UserId), "User_Show_Details_Actions_CreateJob_Button"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 112 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 118 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
if (currentDeviceAssignments.Count > 1)
|
if (currentDeviceAssignments.Count > 1)
|
||||||
{
|
{
|
||||||
@@ -436,13 +450,13 @@ WriteLiteral(" class=\"none\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 125 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 131 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 125 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 131 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
foreach (var assignment in currentDeviceAssignments)
|
foreach (var assignment in currentDeviceAssignments)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -456,7 +470,7 @@ WriteLiteral(" class=\"CreateJob_Assignment clearfix\"");
|
|||||||
WriteLiteral(" data-createjoburl=\"");
|
WriteLiteral(" data-createjoburl=\"");
|
||||||
|
|
||||||
|
|
||||||
#line 127 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 133 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(Url.Action(MVC.Job.Create(assignment.DeviceSerialNumber, Model.User.UserId)));
|
Write(Url.Action(MVC.Job.Create(assignment.DeviceSerialNumber, Model.User.UserId)));
|
||||||
|
|
||||||
|
|
||||||
@@ -480,14 +494,14 @@ WriteLiteral(" class=\"CreateJob_Assignment_Image\"");
|
|||||||
|
|
||||||
WriteLiteral(" alt=\"Model Image\"");
|
WriteLiteral(" alt=\"Model Image\"");
|
||||||
|
|
||||||
WriteAttribute("src", Tuple.Create(" src=\"", 8299), Tuple.Create("\"", 8420)
|
WriteAttribute("src", Tuple.Create(" src=\"", 8795), Tuple.Create("\"", 8916)
|
||||||
|
|
||||||
#line 132 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 138 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 8305), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
, Tuple.Create(Tuple.Create("", 8801), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 8305), false)
|
, 8801), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(@" />
|
WriteLiteral(@" />
|
||||||
@@ -501,7 +515,7 @@ WriteLiteral(@" />
|
|||||||
<span>");
|
<span>");
|
||||||
|
|
||||||
|
|
||||||
#line 140 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 146 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.SerialNumber);
|
Write(assignment.Device.SerialNumber);
|
||||||
|
|
||||||
|
|
||||||
@@ -510,7 +524,7 @@ WriteLiteral(@" />
|
|||||||
WriteLiteral("</span> (<span>");
|
WriteLiteral("</span> (<span>");
|
||||||
|
|
||||||
|
|
||||||
#line 140 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 146 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.ComputerName);
|
Write(assignment.Device.ComputerName);
|
||||||
|
|
||||||
|
|
||||||
@@ -527,7 +541,7 @@ WriteLiteral(@"</span>)
|
|||||||
<span>");
|
<span>");
|
||||||
|
|
||||||
|
|
||||||
#line 148 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 154 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.DeviceModel.ToString());
|
Write(assignment.Device.DeviceModel.ToString());
|
||||||
|
|
||||||
|
|
||||||
@@ -542,13 +556,13 @@ WriteLiteral(@"</span>
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 154 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 160 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 154 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 160 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -558,7 +572,7 @@ WriteLiteral(@"</span>
|
|||||||
WriteLiteral(" <span>");
|
WriteLiteral(" <span>");
|
||||||
|
|
||||||
|
|
||||||
#line 156 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 162 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.AssetNumber);
|
Write(assignment.Device.AssetNumber);
|
||||||
|
|
||||||
|
|
||||||
@@ -567,7 +581,7 @@ WriteLiteral(" <s
|
|||||||
WriteLiteral("</span>\r\n");
|
WriteLiteral("</span>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 157 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 163 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -582,7 +596,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
|||||||
WriteLiteral(">Unknown</span>\r\n");
|
WriteLiteral(">Unknown</span>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 161 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 167 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -596,7 +610,7 @@ WriteLiteral(@" </td>
|
|||||||
<span>");
|
<span>");
|
||||||
|
|
||||||
|
|
||||||
#line 167 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 173 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
||||||
|
|
||||||
|
|
||||||
@@ -610,7 +624,7 @@ WriteLiteral(@"</span>
|
|||||||
</li>");
|
</li>");
|
||||||
|
|
||||||
|
|
||||||
#line 172 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 178 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -648,7 +662,7 @@ WriteLiteral(" <script>\r\n
|
|||||||
";\r\n </script>\r\n");
|
";\r\n </script>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 212 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 218 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -671,7 +685,7 @@ WriteLiteral(@" <script>
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 227 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 233 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,7 +695,7 @@ WriteLiteral(@" <script>
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 229 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 235 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (Model.User.CanAddUserFlags() && Model.AvailableUserFlags != null && Model.AvailableUserFlags.Count > 0)
|
if (Model.User.CanAddUserFlags() && Model.AvailableUserFlags != null && Model.AvailableUserFlags.Count > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -689,14 +703,14 @@ WriteLiteral(" ");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 231 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 237 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLinkSmallButton("Add Flag", MVC.API.UserFlagAssignment.AddUser(), "User_Show_Details_Actions_AddFlag_Button"));
|
Write(Html.ActionLinkSmallButton("Add Flag", MVC.API.UserFlagAssignment.AddUser(), "User_Show_Details_Actions_AddFlag_Button"));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 231 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 237 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -713,13 +727,13 @@ WriteLiteral(" title=\"Add User Flag\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 233 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 239 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 233 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 239 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
using (Html.BeginForm(MVC.API.UserFlagAssignment.AddUser()))
|
using (Html.BeginForm(MVC.API.UserFlagAssignment.AddUser()))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -744,14 +758,14 @@ WriteLiteral(" type=\"hidden\"");
|
|||||||
|
|
||||||
WriteLiteral(" name=\"UserId\"");
|
WriteLiteral(" name=\"UserId\"");
|
||||||
|
|
||||||
WriteAttribute("value", Tuple.Create(" value=\"", 15119), Tuple.Create("\"", 15145)
|
WriteAttribute("value", Tuple.Create(" value=\"", 15615), Tuple.Create("\"", 15641)
|
||||||
|
|
||||||
#line 236 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 242 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 15127), Tuple.Create<System.Object, System.Int32>(Model.User.UserId
|
, Tuple.Create(Tuple.Create("", 15623), Tuple.Create<System.Object, System.Int32>(Model.User.UserId
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 15127), false)
|
, 15623), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" />\r\n");
|
WriteLiteral(" />\r\n");
|
||||||
@@ -763,13 +777,13 @@ WriteLiteral(" class=\"flagPicker\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 238 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 244 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 238 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 244 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
foreach (var userFlag in Model.AvailableUserFlags.OrderBy(jq => jq.Name))
|
foreach (var userFlag in Model.AvailableUserFlags.OrderBy(jq => jq.Name))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -783,7 +797,7 @@ WriteLiteral(" class=\"flag\"");
|
|||||||
WriteLiteral(" data-userflagid=\"");
|
WriteLiteral(" data-userflagid=\"");
|
||||||
|
|
||||||
|
|
||||||
#line 240 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 246 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(userFlag.Id);
|
Write(userFlag.Id);
|
||||||
|
|
||||||
|
|
||||||
@@ -793,32 +807,32 @@ WriteLiteral("\"");
|
|||||||
|
|
||||||
WriteLiteral(">\r\n <i");
|
WriteLiteral(">\r\n <i");
|
||||||
|
|
||||||
WriteAttribute("class", Tuple.Create(" class=\"", 15519), Tuple.Create("\"", 15586)
|
WriteAttribute("class", Tuple.Create(" class=\"", 16015), Tuple.Create("\"", 16082)
|
||||||
, Tuple.Create(Tuple.Create("", 15527), Tuple.Create("fa", 15527), true)
|
, Tuple.Create(Tuple.Create("", 16023), Tuple.Create("fa", 16023), true)
|
||||||
, Tuple.Create(Tuple.Create(" ", 15529), Tuple.Create("fa-", 15530), true)
|
, Tuple.Create(Tuple.Create(" ", 16025), Tuple.Create("fa-", 16026), true)
|
||||||
|
|
||||||
#line 241 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 247 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 15533), Tuple.Create<System.Object, System.Int32>(userFlag.Icon
|
, Tuple.Create(Tuple.Create("", 16029), Tuple.Create<System.Object, System.Int32>(userFlag.Icon
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 15533), false)
|
, 16029), false)
|
||||||
, Tuple.Create(Tuple.Create(" ", 15549), Tuple.Create("fa-fw", 15550), true)
|
, Tuple.Create(Tuple.Create(" ", 16045), Tuple.Create("fa-fw", 16046), true)
|
||||||
, Tuple.Create(Tuple.Create(" ", 15555), Tuple.Create("fa-lg", 15556), true)
|
, Tuple.Create(Tuple.Create(" ", 16051), Tuple.Create("fa-lg", 16052), true)
|
||||||
, Tuple.Create(Tuple.Create(" ", 15561), Tuple.Create("d-", 15562), true)
|
, Tuple.Create(Tuple.Create(" ", 16057), Tuple.Create("d-", 16058), true)
|
||||||
|
|
||||||
#line 241 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 247 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 15564), Tuple.Create<System.Object, System.Int32>(userFlag.IconColour
|
, Tuple.Create(Tuple.Create("", 16060), Tuple.Create<System.Object, System.Int32>(userFlag.IconColour
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 15564), false)
|
, 16060), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral("></i>");
|
WriteLiteral("></i>");
|
||||||
|
|
||||||
|
|
||||||
#line 241 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 247 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(userFlag.Name);
|
Write(userFlag.Name);
|
||||||
|
|
||||||
|
|
||||||
@@ -827,7 +841,7 @@ WriteLiteral("></i>");
|
|||||||
WriteLiteral("\r\n </div>\r\n");
|
WriteLiteral("\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 243 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 249 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -851,7 +865,7 @@ WriteLiteral("></textarea>\r\n </div>\r\n
|
|||||||
" </div>\r\n");
|
" </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 251 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 257 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -912,7 +926,7 @@ WriteLiteral(">\r\n $(function () {\r\n
|
|||||||
"\r\n });\r\n </script>\r\n");
|
"\r\n });\r\n </script>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 318 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 324 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -921,13 +935,13 @@ WriteLiteral(">\r\n $(function () {\r\n
|
|||||||
WriteLiteral(" </div>\r\n </div>\r\n </td>\r\n");
|
WriteLiteral(" </div>\r\n </div>\r\n </td>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 322 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 328 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 322 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 328 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (Authorization.Has(Claims.User.ShowAssignments))
|
if (Authorization.Has(Claims.User.ShowAssignments))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -945,13 +959,13 @@ WriteLiteral(" id=\"User_Show_AssignedDevices_Active\"");
|
|||||||
WriteLiteral(">\r\n <h3>Current Device Assignments</h3>\r\n");
|
WriteLiteral(">\r\n <h3>Current Device Assignments</h3>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 328 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 334 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 328 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 334 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (currentDeviceAssignments.Count > 0)
|
if (currentDeviceAssignments.Count > 0)
|
||||||
{
|
{
|
||||||
foreach (var assignment in currentDeviceAssignments)
|
foreach (var assignment in currentDeviceAssignments)
|
||||||
@@ -967,7 +981,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment clearfix\"");
|
|||||||
WriteLiteral(" data-deviceserialnumber=\"");
|
WriteLiteral(" data-deviceserialnumber=\"");
|
||||||
|
|
||||||
|
|
||||||
#line 332 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 338 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.DeviceSerialNumber);
|
Write(assignment.DeviceSerialNumber);
|
||||||
|
|
||||||
|
|
||||||
@@ -978,13 +992,13 @@ WriteLiteral("\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 333 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 339 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 333 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 339 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (Authorization.Has(Claims.Device.Show))
|
if (Authorization.Has(Claims.Device.Show))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -993,14 +1007,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <a");
|
WriteLiteral(" <a");
|
||||||
|
|
||||||
WriteAttribute("href", Tuple.Create(" href=\"", 20984), Tuple.Create("\"", 21051)
|
WriteAttribute("href", Tuple.Create(" href=\"", 21480), Tuple.Create("\"", 21547)
|
||||||
|
|
||||||
#line 335 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 341 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 20991), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))
|
, Tuple.Create(Tuple.Create("", 21487), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.Show(assignment.Device.SerialNumber))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 20991), false)
|
, 21487), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <img");
|
WriteLiteral(">\r\n <img");
|
||||||
@@ -1009,20 +1023,20 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Image\"");
|
|||||||
|
|
||||||
WriteLiteral(" alt=\"Model Image\"");
|
WriteLiteral(" alt=\"Model Image\"");
|
||||||
|
|
||||||
WriteAttribute("src", Tuple.Create(" src=\"", 21183), Tuple.Create("\"", 21304)
|
WriteAttribute("src", Tuple.Create(" src=\"", 21679), Tuple.Create("\"", 21800)
|
||||||
|
|
||||||
#line 336 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 342 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 21189), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
, Tuple.Create(Tuple.Create("", 21685), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 21189), false)
|
, 21685), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" />\r\n </a>\r\n");
|
WriteLiteral(" />\r\n </a>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 338 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 344 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1036,20 +1050,20 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Image\"");
|
|||||||
|
|
||||||
WriteLiteral(" alt=\"Model Image\"");
|
WriteLiteral(" alt=\"Model Image\"");
|
||||||
|
|
||||||
WriteAttribute("src", Tuple.Create(" src=\"", 21616), Tuple.Create("\"", 21737)
|
WriteAttribute("src", Tuple.Create(" src=\"", 22112), Tuple.Create("\"", 22233)
|
||||||
|
|
||||||
#line 341 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 347 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 21622), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
, Tuple.Create(Tuple.Create("", 22118), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(assignment.Device.DeviceModel.Id, assignment.Device.DeviceModel.ImageHash()))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 21622), false)
|
, 22118), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" />\r\n");
|
WriteLiteral(" />\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 342 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 348 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1077,13 +1091,13 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_SerialNumber\
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 352 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 358 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 352 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 358 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (Authorization.Has(Claims.Device.Show))
|
if (Authorization.Has(Claims.Device.Show))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1091,14 +1105,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 354 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 360 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber)));
|
Write(Html.ActionLink(assignment.Device.SerialNumber, MVC.Device.Show(assignment.Device.SerialNumber)));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 354 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 360 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1108,14 +1122,14 @@ WriteLiteral(">\r\n");
|
|||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 358 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 364 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.SerialNumber);
|
Write(assignment.Device.SerialNumber);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 358 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 364 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1125,13 +1139,13 @@ WriteLiteral(">\r\n");
|
|||||||
WriteLiteral(" </span>\r\n");
|
WriteLiteral(" </span>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 361 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 367 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 361 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 367 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (!string.IsNullOrWhiteSpace(assignment.Device.ComputerName))
|
if (!string.IsNullOrWhiteSpace(assignment.Device.ComputerName))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1147,7 +1161,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_ComputerName\
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 363 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 369 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.ComputerName);
|
Write(assignment.Device.ComputerName);
|
||||||
|
|
||||||
|
|
||||||
@@ -1158,7 +1172,7 @@ WriteLiteral("</span>)");
|
|||||||
WriteLiteral("\r\n");
|
WriteLiteral("\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 364 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 370 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1168,13 +1182,13 @@ WriteLiteral(" </td>\r\n
|
|||||||
" </tr>\r\n");
|
" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 367 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 373 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 367 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 373 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
if (!string.IsNullOrEmpty(assignment.Device.AssetNumber))
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1191,7 +1205,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Asset\"");
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 372 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 378 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.AssetNumber);
|
Write(assignment.Device.AssetNumber);
|
||||||
|
|
||||||
|
|
||||||
@@ -1201,7 +1215,7 @@ WriteLiteral("</span>\r\n
|
|||||||
" </tr>\r\n");
|
" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 375 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 381 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1210,7 +1224,7 @@ WriteLiteral("</span>\r\n
|
|||||||
WriteLiteral(" ");
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
#line 376 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 382 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (assignment.Device.DeviceModelId.HasValue)
|
if (assignment.Device.DeviceModelId.HasValue)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1229,7 +1243,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Model\"");
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 383 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 389 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.DeviceModel.ToString());
|
Write(assignment.Device.DeviceModel.ToString());
|
||||||
|
|
||||||
|
|
||||||
@@ -1239,7 +1253,7 @@ WriteLiteral("</span>\r\n
|
|||||||
" </tr>\r\n");
|
" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 386 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 392 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1257,7 +1271,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Profile\"");
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 392 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 398 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.DeviceProfile.ToString());
|
Write(assignment.Device.DeviceProfile.ToString());
|
||||||
|
|
||||||
|
|
||||||
@@ -1267,13 +1281,13 @@ WriteLiteral("</span>\r\n
|
|||||||
" </tr>\r\n");
|
" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 395 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 401 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 395 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 401 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
if (assignment.Device.DeviceBatchId.HasValue)
|
if (assignment.Device.DeviceBatchId.HasValue)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1292,7 +1306,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Batch\"");
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 402 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 408 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(assignment.Device.DeviceBatch.ToString());
|
Write(assignment.Device.DeviceBatch.ToString());
|
||||||
|
|
||||||
|
|
||||||
@@ -1302,7 +1316,7 @@ WriteLiteral("</span>\r\n
|
|||||||
" </tr>\r\n");
|
" </tr>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 405 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 411 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1318,7 +1332,7 @@ WriteLiteral(" class=\"User_Show_AssignedDevices_CurrentAssignment_Assigned\"");
|
|||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 409 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 415 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
Write(CommonHelpers.FriendlyDate(assignment.AssignedDate));
|
||||||
|
|
||||||
|
|
||||||
@@ -1334,7 +1348,7 @@ WriteLiteral(@"</span>
|
|||||||
");
|
");
|
||||||
|
|
||||||
|
|
||||||
#line 416 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 422 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1350,7 +1364,7 @@ WriteLiteral(" class=\"smallMessage\"");
|
|||||||
WriteLiteral(">No Current Device Assignments</span>\r\n");
|
WriteLiteral(">No Current Device Assignments</span>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 421 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 427 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1360,7 +1374,7 @@ WriteLiteral(" </div>\r\n </div>\r\n
|
|||||||
"\r\n");
|
"\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 425 "..\..\Views\User\UserParts\_Subject.cshtml"
|
#line 431 "..\..\Views\User\UserParts\_Subject.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user