@@ -5,13 +5,17 @@ using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Documents;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Exporting;
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
using Disco.Services.Plugins;
|
||||
using Disco.Services.Plugins.Features.DocumentHandlerProvider;
|
||||
using Disco.Services.Tasks;
|
||||
using Disco.Services.Users;
|
||||
using Disco.Services.Users.UserFlags;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.API.Models.DocumentTemplate;
|
||||
using Disco.Web.Areas.Config.Models.DocumentTemplate;
|
||||
using Disco.Web.Extensions;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
@@ -1444,5 +1448,58 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return Json(model);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Exporting
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Export)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult Export(ExportModel Model)
|
||||
{
|
||||
if (Model == null || Model.Options == null)
|
||||
throw new ArgumentNullException(nameof(Model));
|
||||
|
||||
var templateId = default(string);
|
||||
if (Model.Options.DocumentTemplateIds.Count == 1)
|
||||
templateId = Model.Options.DocumentTemplateIds.First();
|
||||
|
||||
// Start Export
|
||||
var exportContext = new DocumentExport(Model.Options);
|
||||
var taskContext = ExportTask.ScheduleNowCacheResult(exportContext, id => Url.Action(MVC.Config.DocumentTemplate.Export(templateId, id)));
|
||||
|
||||
// Try waiting for completion
|
||||
if (taskContext.TaskStatus.WaitUntilFinished(TimeSpan.FromSeconds(1)))
|
||||
return RedirectToAction(MVC.Config.DocumentTemplate.Export(templateId, taskContext.Id));
|
||||
else
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(taskContext.TaskStatus.SessionId));
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Export)]
|
||||
public virtual ActionResult ExportRetrieve(Guid id)
|
||||
{
|
||||
if (!ExportTask.TryFromCache(id, out var context))
|
||||
throw new ArgumentException("The export id specified is invalid, or the export data expired (60 minutes)", nameof(id));
|
||||
|
||||
if (context.Result == null || context.Result.Result == null)
|
||||
throw new ArgumentException("The export session is still running, or failed to complete successfully", nameof(id));
|
||||
|
||||
if (context.Result.RecordCount == 0)
|
||||
throw new ArgumentException("No records were found to export", nameof(id));
|
||||
|
||||
var fileStream = context.Result.Result;
|
||||
|
||||
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);
|
||||
}
|
||||
|
||||
[DiscoAuthorizeAll(Claims.Config.ManageSavedExports, Claims.Config.DocumentTemplate.Export)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult SaveExport(ExportModel Model)
|
||||
{
|
||||
var export = new DocumentExport(Model.Options);
|
||||
var savedExport = SavedExports.SaveExport(export, Database, CurrentUser);
|
||||
|
||||
return RedirectToAction(MVC.Config.Export.Create(savedExport.Id));
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,6 +64,11 @@ namespace Disco.Web.Areas.Config
|
||||
"Config/DocumentTemplate/CreatePackage",
|
||||
new { controller = "DocumentTemplate", action = "CreatePackage" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_Export",
|
||||
"Config/DocumentTemplate/Export/{id}",
|
||||
new { controller = "DocumentTemplate", action = "Export", id = UrlParameter.Optional }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_DocumentTemplate_ImportStatus",
|
||||
"Config/DocumentTemplate/ImportStatus",
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Areas.Config.UI.UserFlag;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Services.Exporting;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Documents;
|
||||
using Disco.Services.Documents.ManagedGroups;
|
||||
using Disco.Services.Expressions;
|
||||
using Disco.Services.Plugins.Features.ExpressionExtensionProvider;
|
||||
using Disco.Services.Exporting;
|
||||
using Disco.Services.Plugins.Features.UIExtension;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web.Areas.Config.Models.DocumentTemplate;
|
||||
using Disco.Web.Models.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -293,6 +296,60 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
return View(MVC.Config.DocumentTemplate.Views.BulkGenerate, model);
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Export)]
|
||||
public virtual ActionResult Export(string id, Guid? exportId)
|
||||
{
|
||||
var m = new ExportModel()
|
||||
{
|
||||
Options = DocumentExportOptions.DefaultOptions(),
|
||||
DocumentTemplates = Database.DocumentTemplates.OrderBy(d => d.Id).ToList(),
|
||||
};
|
||||
|
||||
m.Fields = ExportFieldsModel.Create(m.Options, nameof(DocumentExportOptions.LatestOnly));
|
||||
|
||||
var userCustomDetailKeys = Database.UserDetails.Where(d => d.Scope == "Details").Select(d => d.Key).Distinct().OrderBy(k => k).ToList();
|
||||
if (userCustomDetailKeys.Any())
|
||||
{
|
||||
var group = new ExportOptionGroup("User Custom Details");
|
||||
foreach (var key in userCustomDetailKeys)
|
||||
{
|
||||
group.Add(new ExportOptionField()
|
||||
{
|
||||
GroupName = group.Name,
|
||||
Name = key,
|
||||
DisplayName = key.TrimEnd('*', '&'),
|
||||
Description = $"{key} custom detail for the user associated with the document instance",
|
||||
Checked = false,
|
||||
Key = "UserDetailCustom",
|
||||
Value = key,
|
||||
});
|
||||
}
|
||||
m.Fields.FieldGroups.Add(group);
|
||||
}
|
||||
|
||||
if (ExportTask.TryFromCache(exportId, out var context))
|
||||
{
|
||||
m.ExportId = exportId;
|
||||
m.ExportResult = context.Result;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(id))
|
||||
{
|
||||
var template = m.DocumentTemplates.FirstOrDefault(d => string.Equals(d.Id, id, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (template != null)
|
||||
{
|
||||
m.Options.DocumentTemplateIds.Add(template.Id);
|
||||
}
|
||||
}
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<ConfigDocumentTemplateExportModel>(ControllerContext, m);
|
||||
|
||||
return View(m);
|
||||
}
|
||||
|
||||
public virtual ActionResult ExpressionBrowser()
|
||||
{
|
||||
// for backwards compatibility
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using Disco.Models.Areas.Config.UI.UserFlag;
|
||||
using Disco.Models.Services.Documents;
|
||||
using Disco.Models.Services.Exporting;
|
||||
using Disco.Models.UI.Shared;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class ExportModel : ConfigDocumentTemplateExportModel
|
||||
{
|
||||
public DocumentExportOptions Options { get; set; }
|
||||
|
||||
public Guid? ExportId { get; set; }
|
||||
public ExportResult ExportResult { get; set; }
|
||||
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
public SharedExportFieldsModel<DocumentExportOptions> Fields { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
@using Disco.Web.Areas.Config.Models.DocumentTemplate;
|
||||
@using Disco.Services.Exporting;
|
||||
@model ExportModel
|
||||
@{
|
||||
Authorization.Require(Claims.Config.DocumentTemplate.Export);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Export");
|
||||
}
|
||||
<div id="DocumentTemplate_Export">
|
||||
@using (Html.BeginForm(MVC.API.DocumentTemplate.Export(), FormMethod.Post, new { @data_saveaction = Url.Action(MVC.API.DocumentTemplate.SaveExport()) }))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
<div id="DocumentTemplate_Export_Scope" class="form" style="width: 570px">
|
||||
<h2>Export Scope</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width: 100px">
|
||||
Documents:
|
||||
</th>
|
||||
<td class="details">
|
||||
<table class="tableData">
|
||||
@{
|
||||
var index = 0;
|
||||
foreach (var document in Model.DocumentTemplates)
|
||||
{
|
||||
<tr>
|
||||
<td>
|
||||
<label>
|
||||
<input type="checkbox" id="Options_DocumentTemplateIds_@index" name="Options.DocumentTemplateIds" value="@document.Id" @(((bool)Model.Options.DocumentTemplateIds.Contains(document.Id)) ? "checked " : null) />
|
||||
<strong>@document.Id</strong>
|
||||
</label>
|
||||
</td>
|
||||
<td>
|
||||
<label for="Options_DocumentTemplateIds_@index">@document.Description</label>
|
||||
</td>
|
||||
<td>
|
||||
@document.Scope
|
||||
</td>
|
||||
</tr>
|
||||
index++;
|
||||
}
|
||||
}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>@Html.LabelFor(m => m.Options.LatestOnly)</th>
|
||||
<td>
|
||||
@Html.CheckBoxFor(m => m.Options.LatestOnly)
|
||||
<p>Uncheck to include all document instances.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>@Html.LabelFor(m => m.Options.Format)</th>
|
||||
<td>
|
||||
@Html.DropDownListFor(m => m.Options.Format, Enum.GetNames(typeof(Disco.Models.Exporting.ExportFormat)).Select(v => new SelectListItem() { Value = v, Text = v }))
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<div id="DocumentTemplate_Export_Fields" class="form" style="width: 570px; margin-top: 15px;">
|
||||
<h2>Export Fields <a id="DocumentTemplate_Export_Fields_Defaults" href="#">(Defaults)</a></h2>
|
||||
<table>
|
||||
@foreach (var optionGroup in Model.Fields.FieldGroups)
|
||||
{
|
||||
var optionFields = optionGroup.ToList();
|
||||
var itemsPerColumn = (int)Math.Ceiling((double)optionFields.Count / 2);
|
||||
<tr>
|
||||
<th style="width: 120px;">
|
||||
@optionGroup.Name
|
||||
@if (optionFields.Count > 2)
|
||||
{
|
||||
<span style="display: block;" class="select"><a class="selectAll" href="#">ALL</a> | <a class="selectNone" href="#">NONE</a></span>
|
||||
}
|
||||
</th>
|
||||
<td>
|
||||
<div class="DocumentTemplate_Export_Fields_Group">
|
||||
<table class="none">
|
||||
<tr>
|
||||
<td style="width: 50%">
|
||||
<ul class="none">
|
||||
@foreach (var optionItem in optionFields.Take(itemsPerColumn))
|
||||
{
|
||||
<li title="@optionItem.Description">
|
||||
<input type="checkbox" id="Options_@optionItem.Name" name="Options.@(optionItem.Key ?? optionItem.Name)" value="@(optionItem.Value ?? "true")" @((optionItem.Checked) ? "checked " : null) /><label for="Options_@optionItem.Name">@optionItem.DisplayName</label>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
<td style="width: 50%">
|
||||
<ul class="none">
|
||||
@foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
<li title="@optionItem.Description">
|
||||
<input type="checkbox" id="Options_@optionItem.Name" name="Options.@(optionItem.Key ?? optionItem.Name)" value="@(optionItem.Value ?? "true")" @((optionItem.Checked) ? "checked " : null) /><label for="Options_@optionItem.Name">@optionItem.DisplayName</label>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
}
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var exportDefaultFields = ['Id', 'Description', 'Scope', 'AttachmentId', 'AttachmentCreatedUser', 'AttachmentCreatedDate', 'AttachmentComments', 'DeviceSerialNumber', 'JobId', 'JobStatus', 'JobType', 'UserId', 'UserDisplayName'];
|
||||
var $exportFields = $('#DocumentTemplate_Export_Fields');
|
||||
var $exportScope = $('#DocumentTemplate_Export_Scope');
|
||||
var $form = $exportScope.closest('form');
|
||||
var $exportingDialog = null;
|
||||
|
||||
$exportFields.on('click', 'a.selectAll,a.selectNone', function () {
|
||||
var $this = $(this);
|
||||
|
||||
$this.closest('tr').find('input').prop('checked', $this.is('.selectAll'));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#DocumentTemplate_Export_Fields_Defaults').click(function () {
|
||||
|
||||
$exportFields.find('input').prop('checked', false);
|
||||
|
||||
$.each(exportDefaultFields, function (index, value) {
|
||||
$('#Options_' + value).prop('checked', true);
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Submit Validation
|
||||
function submitHandler() {
|
||||
var exportFieldCount = $exportFields.find('input:checked').length;
|
||||
|
||||
if (exportFieldCount > 0) {
|
||||
|
||||
if ($exportingDialog == null) {
|
||||
$exportingDialog = $('#DocumentTemplate_Export_Exporting').dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
}
|
||||
$exportingDialog.dialog('open');
|
||||
|
||||
$form[0].submit();
|
||||
}
|
||||
else
|
||||
alert('Select at least one field to export.');
|
||||
}
|
||||
$.validator.unobtrusive.parse($form);
|
||||
$form.data("validator").settings.submitHandler = submitHandler;
|
||||
|
||||
$('#DocumentTemplate_Export_Download_Dialog').dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: true
|
||||
});
|
||||
$('#DocumentTemplate_Export_Button').click(function () {
|
||||
$form.submit();
|
||||
});
|
||||
$('#DocumentTemplate_Export_Save_Button').click(function () {
|
||||
$form.attr('action', $form[0].dataset.saveaction);
|
||||
$form.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
</div>
|
||||
@if (Model.ExportId.HasValue)
|
||||
{
|
||||
<div id="DocumentTemplate_Export_Download_Dialog" class="dialog" title="Export Document Instances">
|
||||
@if (Model.ExportResult.RecordCount == 0)
|
||||
{
|
||||
<h4>No records matched the filter criteria</h4>
|
||||
}
|
||||
else
|
||||
{
|
||||
<h4>@Model.ExportResult.RecordCount record@(Model.ExportResult.RecordCount != 1 ? "s" : null) were successfully exported.</h4>
|
||||
<a href="@Url.Action(MVC.API.DocumentTemplate.ExportRetrieve(Model.ExportId.Value))" class="button"><i class="fa fa-download fa-lg"></i>Download Document Instance Export</a>
|
||||
}
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#DocumentTemplate_Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<div id="DocumentTemplate_Export_Exporting" class="dialog" title="Exporting Document Instances...">
|
||||
<h4><i class="fa fa-lg fa-cog fa-spin" title="Please Wait"></i>Exporting document instances...</h4>
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
@if (Authorization.Has(Claims.Config.ManageSavedExports))
|
||||
{
|
||||
<button type="button" id="DocumentTemplate_Export_Save_Button" class="button">Save Export</button>
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="button" class="button" disabled title="Requires Manage Saved Exports Permission">Save Export</button>
|
||||
}
|
||||
|
||||
<button type="button" id="DocumentTemplate_Export_Button" class="button">Export Now</button>
|
||||
</div>
|
||||
@@ -0,0 +1,871 @@
|
||||
#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;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
using Disco.Services.Exporting;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
|
||||
#line 1 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
using Disco.Web.Areas.Config.Models.DocumentTemplate;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DocumentTemplate/Export.cshtml")]
|
||||
public partial class Export : Disco.Services.Web.WebViewPage<ExportModel>
|
||||
{
|
||||
public Export()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 4 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
Authorization.Require(Claims.Config.DocumentTemplate.Export);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Document Templates", MVC.Config.DocumentTemplate.Index(null), "Export");
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n<div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DocumentTemplate.Export(), FormMethod.Post, new { @data_saveaction = Url.Action(MVC.API.DocumentTemplate.SaveExport()) }))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Scope\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 570px\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Export Scope</h2>\r\n <table>\r\n <tr>\r\n" +
|
||||
" <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 100px\"");
|
||||
|
||||
WriteLiteral(">\r\n Documents:\r\n </th>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" class=\"details\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
var index = 0;
|
||||
foreach (var document in Model.DocumentTemplates)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n " +
|
||||
" <td>\r\n <label>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 1353), Tuple.Create("\"", 1392)
|
||||
, Tuple.Create(Tuple.Create("", 1358), Tuple.Create("Options_DocumentTemplateIds_", 1358), true)
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1386), Tuple.Create<System.Object, System.Int32>(index
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1386), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" name=\"Options.DocumentTemplateIds\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 1428), Tuple.Create("\"", 1448)
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1436), Tuple.Create<System.Object, System.Int32>(document.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1436), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(((bool)Model.Options.DocumentTemplateIds.Contains(document.Id)) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" />\r\n <strong>");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Id);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</strong>\r\n </label>\r\n " +
|
||||
" </td>\r\n <td>\r\n " +
|
||||
" <label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 1817), Tuple.Create("\"", 1857)
|
||||
, Tuple.Create(Tuple.Create("", 1823), Tuple.Create("Options_DocumentTemplateIds_", 1823), true)
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1851), Tuple.Create<System.Object, System.Int32>(index
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1851), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label>\r\n </td>\r\n " +
|
||||
" <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Scope);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n " +
|
||||
" </tr>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
index++;
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </table>\r\n </td>\r\n </" +
|
||||
"tr>\r\n <tr>\r\n <th>");
|
||||
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.LabelFor(m => m.Options.LatestOnly));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.CheckBoxFor(m => m.Options.LatestOnly));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <p>Uncheck to include all document instances.</p>\r\n " +
|
||||
" </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th>");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.LabelFor(m => m.Options.Format));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</th>\r\n <td>\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.DropDownListFor(m => m.Options.Format, Enum.GetNames(typeof(Disco.Models.Exporting.ExportFormat)).Select(v => new SelectListItem() { Value = v, Text = v })));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </td>\r\n </tr>\r\n </table>\r\n " +
|
||||
" </div>\r\n");
|
||||
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Fields\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
WriteLiteral(" style=\"width: 570px; margin-top: 15px;\"");
|
||||
|
||||
WriteLiteral(">\r\n <h2>Export Fields <a");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Fields_Defaults\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">(Defaults)</a></h2>\r\n <table>\r\n");
|
||||
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 64 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
foreach (var optionGroup in Model.Fields.FieldGroups)
|
||||
{
|
||||
var optionFields = optionGroup.ToList();
|
||||
var itemsPerColumn = (int)Math.Ceiling((double)optionFields.Count / 2);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr>\r\n <th");
|
||||
|
||||
WriteLiteral(" style=\"width: 120px;\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 70 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(optionGroup.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 71 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (optionFields.Count > 2)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" style=\"display: block;\"");
|
||||
|
||||
WriteLiteral(" class=\"select\"");
|
||||
|
||||
WriteLiteral("><a");
|
||||
|
||||
WriteLiteral(" class=\"selectAll\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">ALL</a> | <a");
|
||||
|
||||
WriteLiteral(" class=\"selectNone\"");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(">NONE</a></span>\r\n");
|
||||
|
||||
|
||||
#line 74 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </th>\r\n <td>\r\n " +
|
||||
" <div");
|
||||
|
||||
WriteLiteral(" class=\"DocumentTemplate_Export_Fields_Group\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n <tr>\r\n " +
|
||||
" <td");
|
||||
|
||||
WriteLiteral(" style=\"width: 50%\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 82 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Take(itemsPerColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4509), Tuple.Create("\"", 4540)
|
||||
|
||||
#line 84 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4517), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4517), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 4622), Tuple.Create("\"", 4651)
|
||||
, Tuple.Create(Tuple.Create("", 4627), Tuple.Create("Options_", 4627), true)
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4635), Tuple.Create<System.Object, System.Int32>(optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4635), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 4652), Tuple.Create("\"", 4703)
|
||||
, Tuple.Create(Tuple.Create("", 4659), Tuple.Create("Options.", 4659), true)
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4667), Tuple.Create<System.Object, System.Int32>(optionItem.Key ?? optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4667), false)
|
||||
);
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 4704), Tuple.Create("\"", 4741)
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4712), Tuple.Create<System.Object, System.Int32>(optionItem.Value ?? "true"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4712), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write((optionItem.Checked) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 4795), Tuple.Create("\"", 4825)
|
||||
, Tuple.Create(Tuple.Create("", 4801), Tuple.Create("Options_", 4801), true)
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4809), Tuple.Create<System.Object, System.Int32>(optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4809), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 85 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 87 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n " +
|
||||
" </td>\r\n <td");
|
||||
|
||||
WriteLiteral(" style=\"width: 50%\"");
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
|
||||
WriteLiteral(" class=\"none\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 92 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
foreach (var optionItem in optionFields.Skip(itemsPerColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5414), Tuple.Create("\"", 5445)
|
||||
|
||||
#line 94 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5422), Tuple.Create<System.Object, System.Int32>(optionItem.Description
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5422), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 5527), Tuple.Create("\"", 5556)
|
||||
, Tuple.Create(Tuple.Create("", 5532), Tuple.Create("Options_", 5532), true)
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5540), Tuple.Create<System.Object, System.Int32>(optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5540), false)
|
||||
);
|
||||
|
||||
WriteAttribute("name", Tuple.Create(" name=\"", 5557), Tuple.Create("\"", 5608)
|
||||
, Tuple.Create(Tuple.Create("", 5564), Tuple.Create("Options.", 5564), true)
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5572), Tuple.Create<System.Object, System.Int32>(optionItem.Key ?? optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5572), false)
|
||||
);
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 5609), Tuple.Create("\"", 5646)
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5617), Tuple.Create<System.Object, System.Int32>(optionItem.Value ?? "true"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5617), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write((optionItem.Checked) ? "checked " : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" /><label");
|
||||
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 5700), Tuple.Create("\"", 5730)
|
||||
, Tuple.Create(Tuple.Create("", 5706), Tuple.Create("Options_", 5706), true)
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5714), Tuple.Create<System.Object, System.Int32>(optionItem.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5714), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 95 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(optionItem.DisplayName);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 97 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@" </ul>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
");
|
||||
|
||||
|
||||
#line 105 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </table>\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <script>\r\n $(function () {\r\n var exportDefaultF" +
|
||||
"ields = [\'Id\', \'Description\', \'Scope\', \'AttachmentId\', \'AttachmentCreatedUser\', " +
|
||||
"\'AttachmentCreatedDate\', \'AttachmentComments\', \'DeviceSerialNumber\', \'JobId\', \'J" +
|
||||
"obStatus\', \'JobType\', \'UserId\', \'UserDisplayName\'];\r\n var $export" +
|
||||
"Fields = $(\'#DocumentTemplate_Export_Fields\');\r\n var $exportScope" +
|
||||
" = $(\'#DocumentTemplate_Export_Scope\');\r\n var $form = $exportScop" +
|
||||
"e.closest(\'form\');\r\n var $exportingDialog = null;\r\n\r\n " +
|
||||
" $exportFields.on(\'click\', \'a.selectAll,a.selectNone\', function () {\r\n " +
|
||||
" var $this = $(this);\r\n\r\n $this.closest(\'tr\').fin" +
|
||||
"d(\'input\').prop(\'checked\', $this.is(\'.selectAll\'));\r\n\r\n retur" +
|
||||
"n false;\r\n });\r\n\r\n $(\'#DocumentTemplate_Export_Fie" +
|
||||
"lds_Defaults\').click(function () {\r\n\r\n $exportFields.find(\'in" +
|
||||
"put\').prop(\'checked\', false);\r\n\r\n $.each(exportDefaultFields," +
|
||||
" function (index, value) {\r\n $(\'#Options_\' + value).prop(" +
|
||||
"\'checked\', true);\r\n });\r\n\r\n return false;\r" +
|
||||
"\n });\r\n\r\n // Submit Validation\r\n fu" +
|
||||
"nction submitHandler() {\r\n var exportFieldCount = $exportFiel" +
|
||||
"ds.find(\'input:checked\').length;\r\n\r\n if (exportFieldCount > 0" +
|
||||
") {\r\n\r\n if ($exportingDialog == null) {\r\n " +
|
||||
" $exportingDialog = $(\'#DocumentTemplate_Export_Exporting\').dialog({\r" +
|
||||
"\n width: 400,\r\n he" +
|
||||
"ight: 164,\r\n resizable: false,\r\n " +
|
||||
" modal: true,\r\n autoOpen: false\r\n " +
|
||||
" });\r\n }\r\n " +
|
||||
" $exportingDialog.dialog(\'open\');\r\n\r\n $form[0].submit();" +
|
||||
"\r\n }\r\n else\r\n alert" +
|
||||
"(\'Select at least one field to export.\');\r\n }\r\n $." +
|
||||
"validator.unobtrusive.parse($form);\r\n $form.data(\"validator\").set" +
|
||||
"tings.submitHandler = submitHandler;\r\n\r\n $(\'#DocumentTemplate_Exp" +
|
||||
"ort_Download_Dialog\').dialog({\r\n width: 400,\r\n " +
|
||||
" height: 164,\r\n resizable: false,\r\n mo" +
|
||||
"dal: true,\r\n autoOpen: true\r\n });\r\n " +
|
||||
" $(\'#DocumentTemplate_Export_Button\').click(function () {\r\n " +
|
||||
" $form.submit();\r\n });\r\n $(\'#DocumentTemplate_Ex" +
|
||||
"port_Save_Button\').click(function () {\r\n $form.attr(\'action\'," +
|
||||
" $form[0].dataset.saveaction);\r\n $form.submit();\r\n " +
|
||||
" });\r\n });\r\n </script>\r\n");
|
||||
|
||||
|
||||
#line 177 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 179 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Model.ExportId.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Download_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Export Document Instances\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 182 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Model.ExportResult.RecordCount == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>No records matched the filter criteria</h4>\r\n");
|
||||
|
||||
|
||||
#line 185 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <h4>");
|
||||
|
||||
|
||||
#line 188 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Model.ExportResult.RecordCount);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" record");
|
||||
|
||||
|
||||
#line 188 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Model.ExportResult.RecordCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" were successfully exported.</h4>\r\n");
|
||||
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 9605), Tuple.Create("\"", 9686)
|
||||
|
||||
#line 189 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 9612), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.ExportRetrieve(Model.ExportId.Value))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 9612), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-download fa-lg\"");
|
||||
|
||||
WriteLiteral("></i>Download Document Instance Export</a>\r\n");
|
||||
|
||||
|
||||
#line 190 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
$(function () {
|
||||
$('#DocumentTemplate_Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
");
|
||||
|
||||
|
||||
#line 204 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Exporting\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Exporting Document Instances...\"");
|
||||
|
||||
WriteLiteral(">\r\n <h4><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-lg fa-cog fa-spin\"");
|
||||
|
||||
WriteLiteral(" title=\"Please Wait\"");
|
||||
|
||||
WriteLiteral("></i>Exporting document instances...</h4>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Authorization.Has(Claims.Config.ManageSavedExports))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <button");
|
||||
|
||||
WriteLiteral(" type=\"button\"");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Save_Button\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Save Export</button>\r\n");
|
||||
|
||||
|
||||
#line 212 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <button");
|
||||
|
||||
WriteLiteral(" type=\"button\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(" disabled");
|
||||
|
||||
WriteLiteral(" title=\"Requires Manage Saved Exports Permission\"");
|
||||
|
||||
WriteLiteral(">Save Export</button>\r\n");
|
||||
|
||||
|
||||
#line 216 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n <button");
|
||||
|
||||
WriteLiteral(" type=\"button\"");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Button\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Export Now</button>\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -120,6 +120,10 @@ else
|
||||
{
|
||||
@Html.ActionLinkButton("Expression Browser", MVC.Config.Expressions.Browser())
|
||||
}
|
||||
@if (Authorization.Has(Claims.Config.DocumentTemplate.Export))
|
||||
{
|
||||
@Html.ActionLinkButton("Export Instances", MVC.Config.DocumentTemplate.Export())
|
||||
}
|
||||
@if (Model.DocumentTemplates.Count > 2 && Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||
{
|
||||
@Html.ActionLinkButton("Create Package", MVC.Config.DocumentTemplate.CreatePackage())
|
||||
|
||||
@@ -629,7 +629,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 123 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
if (Model.DocumentTemplates.Count > 2 && Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||
if (Authorization.Has(Claims.Config.DocumentTemplate.Export))
|
||||
{
|
||||
|
||||
|
||||
@@ -637,14 +637,14 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Package", MVC.Config.DocumentTemplate.CreatePackage()));
|
||||
Write(Html.ActionLinkButton("Export Instances", MVC.Config.DocumentTemplate.Export()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 125 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -654,7 +654,7 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 127 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||
if (Model.DocumentTemplates.Count > 2 && Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||
{
|
||||
|
||||
|
||||
@@ -662,13 +662,38 @@ WriteLiteral(" ");
|
||||
#line hidden
|
||||
|
||||
#line 129 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
|
||||
Write(Html.ActionLinkButton("Create Package", MVC.Config.DocumentTemplate.CreatePackage()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 129 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 131 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
if (Authorization.HasAll(Claims.Config.DocumentTemplate.Create, Claims.Config.DocumentTemplate.Configure))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 133 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
Write(Html.ActionLinkButton("Create Document Template", MVC.Config.DocumentTemplate.Create()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 133 "..\..\Areas\Config\Views\DocumentTemplate\Index.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1052,6 +1052,10 @@
|
||||
{
|
||||
@Html.ActionLinkButton("Expression Browser", MVC.Config.Expressions.Browser())
|
||||
}
|
||||
@if (Authorization.Has(Claims.Config.DocumentTemplate.Export))
|
||||
{
|
||||
@Html.ActionLinkButton("Export Instances", MVC.Config.DocumentTemplate.Export(Model.DocumentTemplate.Id, null))
|
||||
}
|
||||
@if (canBulkGenerate)
|
||||
{
|
||||
if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.User)
|
||||
|
||||
@@ -3198,6 +3198,31 @@ WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 1055 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DocumentTemplate.Export))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1057 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Export Instances", MVC.Config.DocumentTemplate.Export(Model.DocumentTemplate.Id, null)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1057 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 1059 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
if (canBulkGenerate)
|
||||
{
|
||||
if (Model.DocumentTemplate.Scope == DocumentTemplate.DocumentTemplateScopes.User)
|
||||
@@ -3207,14 +3232,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1059 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1063 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Bulk Generate", MVC.Config.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1059 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1063 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
}
|
||||
else
|
||||
@@ -3239,16 +3264,16 @@ WriteLiteral(" id=\"dialogBulkGenerate\"");
|
||||
|
||||
WriteLiteral(" class=\"hiddenDialog dialog-bulk-generate\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 62552), Tuple.Create("\"", 62603)
|
||||
, Tuple.Create(Tuple.Create("", 62560), Tuple.Create("Bulk", 62560), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 62564), Tuple.Create("Generate:", 62565), true)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 62787), Tuple.Create("\"", 62838)
|
||||
, Tuple.Create(Tuple.Create("", 62795), Tuple.Create("Bulk", 62795), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 62799), Tuple.Create("Generate:", 62800), true)
|
||||
|
||||
#line 1064 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 62574), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
#line 1068 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 62809), Tuple.Create<System.Object, System.Int32>(Model.DocumentTemplate.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 62575), false)
|
||||
, 62810), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
@@ -3258,13 +3283,13 @@ WriteLiteral(" class=\"brief\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 1066 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1070 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1066 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1070 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
switch (Model.DocumentTemplate.Scope)
|
||||
{
|
||||
case "Device":
|
||||
@@ -3306,7 +3331,7 @@ WriteLiteral(" class=\"example3 code\"");
|
||||
WriteLiteral(">01234567;ABCD9876;8VQ6G2R</div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 1082 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1086 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
break;
|
||||
case "Job":
|
||||
|
||||
@@ -3345,7 +3370,7 @@ WriteLiteral(" class=\"example3 code\"");
|
||||
WriteLiteral(">86;99;44</div>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 1097 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1101 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -3355,13 +3380,13 @@ WriteLiteral(">86;99;44</div>\r\n </div>\r\n"
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 1100 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1104 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1100 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1104 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DocumentTemplate.BulkGenerate(Model.DocumentTemplate.Id), FormMethod.Post))
|
||||
{
|
||||
|
||||
@@ -3391,7 +3416,7 @@ WriteLiteral(" data-val-required=\"Identifiers are required\"");
|
||||
WriteLiteral("></textarea>\r\n");
|
||||
|
||||
|
||||
#line 1104 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1108 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
if (Model.TemplatePageCount > 1 && Model.TemplatePageCount % 2 != 0)
|
||||
{
|
||||
|
||||
@@ -3420,7 +3445,7 @@ WriteLiteral(">Insert Blank Pages for Double-Sided Printing</label>\r\n
|
||||
" </div>\r\n");
|
||||
|
||||
|
||||
#line 1109 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1113 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3430,7 +3455,7 @@ WriteLiteral(">Insert Blank Pages for Double-Sided Printing</label>\r\n
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 1112 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1116 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -3469,7 +3494,7 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 1143 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1147 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3479,7 +3504,7 @@ WriteLiteral(@" <script>
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 1145 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1149 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
if (Authorization.Has(Claims.Config.DocumentTemplate.Delete))
|
||||
{
|
||||
|
||||
@@ -3487,14 +3512,14 @@ WriteLiteral(" ");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1147 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1151 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
Write(Html.ActionLinkButton("Delete", MVC.API.DocumentTemplate.Delete(Model.DocumentTemplate.Id, true), "buttonDelete"));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1147 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1151 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
}
|
||||
|
||||
@@ -3504,13 +3529,13 @@ WriteLiteral(" ");
|
||||
WriteLiteral(" </div>\r\n");
|
||||
|
||||
|
||||
#line 1150 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1154 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 1150 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1154 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
if (!string.IsNullOrWhiteSpace(Model.BulkGenerateDownloadId))
|
||||
{
|
||||
|
||||
@@ -3527,14 +3552,14 @@ WriteLiteral(" title=\"Download Bulk Documents\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 67854), Tuple.Create("\"", 67985)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 68089), Tuple.Create("\"", 68220)
|
||||
|
||||
#line 1153 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 67861), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.BulkGenerateDownload(Model.BulkGenerateDownloadId, Model.BulkGenerateDownloadFilename))
|
||||
#line 1157 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 68096), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.BulkGenerateDownload(Model.BulkGenerateDownloadId, Model.BulkGenerateDownloadFilename))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 67861), false)
|
||||
, 68096), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -3560,7 +3585,7 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 1167 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
#line 1171 "..\..\Areas\Config\Views\DocumentTemplate\Show.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
|
||||
@@ -2066,4 +2066,32 @@ h1.Config_DocumentTemplates {
|
||||
}
|
||||
#Config_Export_Edit_OnDemand #Config_Export_Edit_OnDemand_List li .remove:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
#DocumentTemplate_Export #DocumentTemplate_Export_Fields #DocumentTemplate_Export_Fields_Defaults {
|
||||
font-size: 0.75em;
|
||||
}
|
||||
#DocumentTemplate_Export #DocumentTemplate_Export_Fields th {
|
||||
font-size: 1.05em;
|
||||
}
|
||||
#DocumentTemplate_Export #DocumentTemplate_Export_Fields th span {
|
||||
margin-top: 4px;
|
||||
font-size: 0.8em;
|
||||
}
|
||||
#DocumentTemplate_Export_Download_Dialog {
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
#DocumentTemplate_Export_Download_Dialog h4 {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
#DocumentTemplate_Export_Download_Dialog a {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
#DocumentTemplate_Export_Exporting {
|
||||
padding-top: 50px;
|
||||
text-align: center;
|
||||
}
|
||||
#DocumentTemplate_Export_Exporting i {
|
||||
margin-right: 10px;
|
||||
color: #1e6dab;
|
||||
}
|
||||
@@ -2497,3 +2497,43 @@ h1.Config_DocumentTemplates {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#DocumentTemplate_Export {
|
||||
#DocumentTemplate_Export_Fields {
|
||||
#DocumentTemplate_Export_Fields_Defaults {
|
||||
font-size: .75em;
|
||||
}
|
||||
|
||||
th {
|
||||
font-size: 1.05em;
|
||||
|
||||
span {
|
||||
margin-top: 4px;
|
||||
font-size: .8em;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#DocumentTemplate_Export_Download_Dialog {
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
|
||||
h4 {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
a {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
#DocumentTemplate_Export_Exporting {
|
||||
padding-top: 50px;
|
||||
text-align: center;
|
||||
|
||||
i {
|
||||
margin-right: 10px;
|
||||
color: @StatusInformation;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -248,6 +248,7 @@
|
||||
<Compile Include="Areas\Config\Models\Config\IndexModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DocumentTemplate\BulkGenerateModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DocumentTemplate\CreatePackageModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DocumentTemplate\ExportModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\DocumentTemplate\ShowPackageModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\Export\EditModel.cs" />
|
||||
<Compile Include="Areas\Config\Models\Export\IndexModel.cs" />
|
||||
@@ -299,6 +300,11 @@
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\DocumentTemplate\Export.generated.cs">
|
||||
<DependentUpon>Export.cshtml</DependentUpon>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<Compile Include="Areas\Config\Views\DocumentTemplate\ShowPackage1.generated.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
@@ -901,6 +907,7 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>T4MVC.tt</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Models\Shared\ExportFieldsModel.cs" />
|
||||
<Compile Include="Models\Shared\GenerateDocumentControlModel.cs" />
|
||||
<Compile Include="Views\Device\DeviceParts\_Flags.generated.cs">
|
||||
<DependentUpon>_Flags.cshtml</DependentUpon>
|
||||
@@ -1375,6 +1382,10 @@
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>BulkGenerate.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Config\Views\DocumentTemplate\Export.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>Export.generated.cs</LastGenOutput>
|
||||
</None>
|
||||
<None Include="Areas\Config\Views\DocumentTemplate\ShowPackage.cshtml">
|
||||
<Generator>RazorGenerator</Generator>
|
||||
<LastGenOutput>ShowPackage1.generated.cs</LastGenOutput>
|
||||
|
||||
@@ -281,6 +281,24 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.DocumentHandlers);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Export()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Export);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult ExportRetrieve()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportRetrieve);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult SaveExport()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.SaveExport);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DocumentTemplateController Actions { get { return MVC.API.DocumentTemplate; } }
|
||||
@@ -335,6 +353,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string AddOnImportUserFlagRule = "AddOnImportUserFlagRule";
|
||||
public readonly string GenerateDocumentHandlerUi = "GenerateDocumentHandlerUi";
|
||||
public readonly string DocumentHandlers = "DocumentHandlers";
|
||||
public readonly string Export = "Export";
|
||||
public readonly string ExportRetrieve = "ExportRetrieve";
|
||||
public readonly string SaveExport = "SaveExport";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
@@ -378,6 +399,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public const string AddOnImportUserFlagRule = "AddOnImportUserFlagRule";
|
||||
public const string GenerateDocumentHandlerUi = "GenerateDocumentHandlerUi";
|
||||
public const string DocumentHandlers = "DocumentHandlers";
|
||||
public const string Export = "Export";
|
||||
public const string ExportRetrieve = "ExportRetrieve";
|
||||
public const string SaveExport = "SaveExport";
|
||||
}
|
||||
|
||||
|
||||
@@ -728,6 +752,30 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public readonly string templateId = "templateId";
|
||||
public readonly string targetId = "targetId";
|
||||
}
|
||||
static readonly ActionParamsClass_Export s_params_Export = new ActionParamsClass_Export();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Export ExportParams { get { return s_params_Export; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Export
|
||||
{
|
||||
public readonly string Model = "Model";
|
||||
}
|
||||
static readonly ActionParamsClass_ExportRetrieve s_params_ExportRetrieve = new ActionParamsClass_ExportRetrieve();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_ExportRetrieve ExportRetrieveParams { get { return s_params_ExportRetrieve; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_ExportRetrieve
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ActionParamsClass_SaveExport s_params_SaveExport = new ActionParamsClass_SaveExport();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_SaveExport SaveExportParams { get { return s_params_SaveExport; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_SaveExport
|
||||
{
|
||||
public readonly string Model = "Model";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -1265,6 +1313,42 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void ExportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Areas.Config.Models.DocumentTemplate.ExportModel Model);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Export(Disco.Web.Areas.Config.Models.DocumentTemplate.ExportModel Model)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Export);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Model", Model);
|
||||
ExportOverride(callInfo, Model);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void ExportRetrieveOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Guid id);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult ExportRetrieve(System.Guid id)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.ExportRetrieve);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ExportRetrieveOverride(callInfo, id);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void SaveExportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, Disco.Web.Areas.Config.Models.DocumentTemplate.ExportModel Model);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult SaveExport(Disco.Web.Areas.Config.Models.DocumentTemplate.ExportModel Model)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.SaveExport);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Model", Model);
|
||||
SaveExportOverride(callInfo, Model);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -77,6 +77,12 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.BulkGenerate);
|
||||
}
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult Export()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Export);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public DocumentTemplateController Actions { get { return MVC.Config.DocumentTemplate; } }
|
||||
@@ -100,6 +106,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
public readonly string Create = "Create";
|
||||
public readonly string CreatePackage = "CreatePackage";
|
||||
public readonly string BulkGenerate = "BulkGenerate";
|
||||
public readonly string Export = "Export";
|
||||
public readonly string ExpressionBrowser = "ExpressionBrowser";
|
||||
}
|
||||
|
||||
@@ -113,6 +120,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
public const string Create = "Create";
|
||||
public const string CreatePackage = "CreatePackage";
|
||||
public const string BulkGenerate = "BulkGenerate";
|
||||
public const string Export = "Export";
|
||||
public const string ExpressionBrowser = "ExpressionBrowser";
|
||||
}
|
||||
|
||||
@@ -159,6 +167,15 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
{
|
||||
public readonly string id = "id";
|
||||
}
|
||||
static readonly ActionParamsClass_Export s_params_Export = new ActionParamsClass_Export();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_Export ExportParams { get { return s_params_Export; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_Export
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string exportId = "exportId";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
@@ -173,6 +190,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
public readonly string BulkGenerate = "BulkGenerate";
|
||||
public readonly string Create = "Create";
|
||||
public readonly string CreatePackage = "CreatePackage";
|
||||
public readonly string Export = "Export";
|
||||
public readonly string ImportStatus = "ImportStatus";
|
||||
public readonly string Index = "Index";
|
||||
public readonly string Show = "Show";
|
||||
@@ -183,6 +201,7 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
public readonly string BulkGenerate = "~/Areas/Config/Views/DocumentTemplate/BulkGenerate.cshtml";
|
||||
public readonly string Create = "~/Areas/Config/Views/DocumentTemplate/Create.cshtml";
|
||||
public readonly string CreatePackage = "~/Areas/Config/Views/DocumentTemplate/CreatePackage.cshtml";
|
||||
public readonly string Export = "~/Areas/Config/Views/DocumentTemplate/Export.cshtml";
|
||||
public readonly string ImportStatus = "~/Areas/Config/Views/DocumentTemplate/ImportStatus.cshtml";
|
||||
public readonly string Index = "~/Areas/Config/Views/DocumentTemplate/Index.cshtml";
|
||||
public readonly string Show = "~/Areas/Config/Views/DocumentTemplate/Show.cshtml";
|
||||
@@ -302,6 +321,19 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void ExportOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, System.Guid? exportId);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult Export(string id, System.Guid? exportId)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Export);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "exportId", exportId);
|
||||
ExportOverride(callInfo, id, exportId);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void ExpressionBrowserOverride(T4MVC_System_Web_Mvc_ActionResult callInfo);
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
using Disco.Models.Services.Exporting;
|
||||
using Disco.Models.UI.Shared;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Models.Shared
|
||||
{
|
||||
public static class ExportFieldsModel
|
||||
{
|
||||
public static ExportFieldsModel<V> Create<V>(V options, params string[] ignoreProperties)
|
||||
where V : IExportOptions
|
||||
{
|
||||
return new ExportFieldsModel<V>(options, ignoreProperties);
|
||||
}
|
||||
}
|
||||
|
||||
public class ExportFieldsModel<T> : SharedExportFieldsModel<T> where T : IExportOptions
|
||||
{
|
||||
public T Options { get; set; }
|
||||
public List<ExportOptionGroup> FieldGroups { get; set; }
|
||||
|
||||
public ExportFieldsModel(T options, params string[] ignoreProperties)
|
||||
{
|
||||
FieldGroups = GetFields(options, ignoreProperties);
|
||||
}
|
||||
|
||||
private static List<ExportOptionGroup> GetFields(T options, params string[] ignoreProperties)
|
||||
{
|
||||
var viewData = new ViewDataDictionary<IExportOptions>(options);
|
||||
var metaData = ModelMetadata.FromLambdaExpression(o => o, viewData);
|
||||
|
||||
var properties = metaData.Properties
|
||||
.Where(p => p.ShortDisplayName != null && p.ModelType == typeof(bool) && !ignoreProperties.Contains(p.PropertyName));
|
||||
|
||||
return properties
|
||||
.Select(p => new ExportOptionField()
|
||||
{
|
||||
GroupName = p.ShortDisplayName,
|
||||
Name = p.PropertyName,
|
||||
DisplayName = p.DisplayName,
|
||||
Description = p.Description,
|
||||
Checked = (bool)p.Model,
|
||||
})
|
||||
.GroupBy(p => p.GroupName)
|
||||
.Select(g =>
|
||||
{
|
||||
var group = new ExportOptionGroup(g.Key);
|
||||
group.AddRange(g);
|
||||
return group;
|
||||
})
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user