feature: user details are individually exported; shared export field renderer
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
@using Disco.Web.Areas.Config.Models.DocumentTemplate;
|
||||
@using Disco.Services.Exporting;
|
||||
@model ExportModel
|
||||
@{
|
||||
Authorization.Require(Claims.Config.DocumentTemplate.Export);
|
||||
@@ -10,7 +9,7 @@
|
||||
@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">
|
||||
<div id="Export_Scope" class="form" style="width: 570px">
|
||||
<h2>Export Scope</h2>
|
||||
<table>
|
||||
<tr>
|
||||
@@ -58,127 +57,12 @@
|
||||
</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>
|
||||
@Html.Partial(MVC.Shared.Views._ExportFields, Model.Fields.FieldGroups)
|
||||
}
|
||||
</div>
|
||||
@if (Model.ExportId.HasValue)
|
||||
{
|
||||
<div id="DocumentTemplate_Export_Download_Dialog" class="dialog" title="Export Document Instances">
|
||||
<div id="Export_Download_Dialog" class="dialog" title="Export Document Instances">
|
||||
@if (Model.ExportResult.RecordCount == 0)
|
||||
{
|
||||
<h4>No records matched the filter criteria</h4>
|
||||
@@ -191,7 +75,7 @@
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#DocumentTemplate_Export_Download_Dialog')
|
||||
$('#Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
@@ -202,7 +86,7 @@
|
||||
});
|
||||
</script>
|
||||
}
|
||||
<div id="DocumentTemplate_Export_Exporting" class="dialog" title="Exporting Document Instances...">
|
||||
<div id="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">
|
||||
@@ -216,4 +100,42 @@
|
||||
}
|
||||
|
||||
<button type="button" id="DocumentTemplate_Export_Button" class="button">Export Now</button>
|
||||
<script>
|
||||
$(function () {
|
||||
const $form = $('#Export_Scope').closest('form');
|
||||
let $exportingDialog = null;
|
||||
|
||||
$.validator.unobtrusive.parse($form);
|
||||
$form.data("validator").settings.submitHandler = function () {
|
||||
const exportFieldCount = $('#Export_Fields').find('input:checked').length;
|
||||
|
||||
if (exportFieldCount > 0) {
|
||||
|
||||
if (!$exportingDialog) {
|
||||
$exportingDialog = $('#Export_Exporting').dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
}
|
||||
$exportingDialog.dialog('open');
|
||||
|
||||
$form[0].submit();
|
||||
return;
|
||||
}
|
||||
|
||||
alert('Select at least one field to export.');
|
||||
}
|
||||
|
||||
$('#DocumentTemplate_Export_Button').on('click', function () {
|
||||
$form.submit();
|
||||
});
|
||||
$('#DocumentTemplate_Export_Save_Button').on('click', function () {
|
||||
$form.attr('action', $form[0].dataset.saveaction);
|
||||
$form.submit();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
|
||||
@@ -30,12 +30,6 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
|
||||
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;
|
||||
|
||||
@@ -56,7 +50,7 @@ namespace Disco.Web.Areas.Config.Views.DocumentTemplate
|
||||
public override void Execute()
|
||||
{
|
||||
|
||||
#line 4 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 3 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
Authorization.Require(Claims.Config.DocumentTemplate.Export);
|
||||
|
||||
@@ -72,13 +66,13 @@ WriteLiteral(" id=\"DocumentTemplate_Export\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 9 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 9 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
using (Html.BeginForm(MVC.API.DocumentTemplate.Export(), FormMethod.Post, new { @data_saveaction = Url.Action(MVC.API.DocumentTemplate.SaveExport()) }))
|
||||
{
|
||||
|
||||
@@ -86,14 +80,14 @@ WriteLiteral(">\r\n");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 11 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.AntiForgeryToken());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 12 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 11 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
|
||||
@@ -101,7 +95,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Scope\"");
|
||||
WriteLiteral(" id=\"Export_Scope\"");
|
||||
|
||||
WriteLiteral(" class=\"form\"");
|
||||
|
||||
@@ -124,13 +118,13 @@ WriteLiteral(" class=\"tableData\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 21 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
var index = 0;
|
||||
foreach (var document in Model.DocumentTemplates)
|
||||
@@ -145,33 +139,33 @@ WriteLiteral(" <tr>\r\n
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 1353), Tuple.Create("\"", 1392)
|
||||
, Tuple.Create(Tuple.Create("", 1358), Tuple.Create("Options_DocumentTemplateIds_", 1358), true)
|
||||
WriteAttribute("id", Tuple.Create(" id=\"", 1302), Tuple.Create("\"", 1341)
|
||||
, Tuple.Create(Tuple.Create("", 1307), Tuple.Create("Options_DocumentTemplateIds_", 1307), true)
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1386), Tuple.Create<System.Object, System.Int32>(index
|
||||
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1335), Tuple.Create<System.Object, System.Int32>(index
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1386), false)
|
||||
, 1335), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" name=\"Options.DocumentTemplateIds\"");
|
||||
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 1428), Tuple.Create("\"", 1448)
|
||||
WriteAttribute("value", Tuple.Create(" value=\"", 1377), Tuple.Create("\"", 1397)
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1436), Tuple.Create<System.Object, System.Int32>(document.Id
|
||||
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1385), Tuple.Create<System.Object, System.Int32>(document.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1436), false)
|
||||
, 1385), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 28 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(((bool)Model.Options.DocumentTemplateIds.Contains(document.Id)) ? "checked " : null);
|
||||
|
||||
|
||||
@@ -180,7 +174,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral(" />\r\n <strong>");
|
||||
|
||||
|
||||
#line 30 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 29 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Id);
|
||||
|
||||
|
||||
@@ -190,21 +184,21 @@ WriteLiteral("</strong>\r\n </label>\
|
||||
" </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)
|
||||
WriteAttribute("for", Tuple.Create(" for=\"", 1766), Tuple.Create("\"", 1806)
|
||||
, Tuple.Create(Tuple.Create("", 1772), Tuple.Create("Options_DocumentTemplateIds_", 1772), true)
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1851), Tuple.Create<System.Object, System.Int32>(index
|
||||
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1800), Tuple.Create<System.Object, System.Int32>(index
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1851), false)
|
||||
, 1800), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 33 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Description);
|
||||
|
||||
|
||||
@@ -216,7 +210,7 @@ WriteLiteral("</label>\r\n </td>\r\n
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 36 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(document.Scope);
|
||||
|
||||
|
||||
@@ -226,7 +220,7 @@ WriteLiteral("\r\n </td>\r\n
|
||||
" </tr>\r\n");
|
||||
|
||||
|
||||
#line 40 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 39 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
index++;
|
||||
}
|
||||
|
||||
@@ -237,7 +231,7 @@ WriteLiteral("\r\n </table>\r\n </td>\
|
||||
"tr>\r\n <tr>\r\n <th>");
|
||||
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 46 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.LabelFor(m => m.Options.LatestOnly));
|
||||
|
||||
|
||||
@@ -248,7 +242,7 @@ WriteLiteral("</th>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 49 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 48 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.CheckBoxFor(m => m.Options.LatestOnly));
|
||||
|
||||
|
||||
@@ -259,7 +253,7 @@ WriteLiteral("\r\n <p>Uncheck to include all document ins
|
||||
" <th>");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 53 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.LabelFor(m => m.Options.Format));
|
||||
|
||||
|
||||
@@ -270,7 +264,7 @@ WriteLiteral("</th>\r\n <td>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 55 "..\..\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 })));
|
||||
|
||||
|
||||
@@ -279,390 +273,22 @@ WriteLiteral(" ");
|
||||
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 60 "..\..\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 60 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Html.Partial(MVC.Shared.Views._ExportFields, Model.Fields.FieldGroups));
|
||||
|
||||
|
||||
#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 60 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -671,7 +297,7 @@ WriteLiteral(" <script>\r\n $(function () {\r\n
|
||||
WriteLiteral("</div>\r\n");
|
||||
|
||||
|
||||
#line 179 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 63 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Model.ExportId.HasValue)
|
||||
{
|
||||
|
||||
@@ -680,7 +306,7 @@ WriteLiteral("</div>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Download_Dialog\"");
|
||||
WriteLiteral(" id=\"Export_Download_Dialog\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
@@ -689,13 +315,13 @@ WriteLiteral(" title=\"Export Document Instances\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 182 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 182 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 66 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Model.ExportResult.RecordCount == 0)
|
||||
{
|
||||
|
||||
@@ -705,7 +331,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" <h4>No records matched the filter criteria</h4>\r\n");
|
||||
|
||||
|
||||
#line 185 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 69 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -716,7 +342,7 @@ WriteLiteral(" <h4>No records matched the filter criteria</h4>\r\n");
|
||||
WriteLiteral(" <h4>");
|
||||
|
||||
|
||||
#line 188 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Model.ExportResult.RecordCount);
|
||||
|
||||
|
||||
@@ -725,7 +351,7 @@ WriteLiteral(" <h4>");
|
||||
WriteLiteral(" record");
|
||||
|
||||
|
||||
#line 188 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 72 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
Write(Model.ExportResult.RecordCount != 1 ? "s" : null);
|
||||
|
||||
|
||||
@@ -735,14 +361,14 @@ WriteLiteral(" were successfully exported.</h4>\r\n");
|
||||
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 9605), Tuple.Create("\"", 9686)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 3517), Tuple.Create("\"", 3598)
|
||||
|
||||
#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 73 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3524), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DocumentTemplate.ExportRetrieve(Model.ExportId.Value))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 9612), false)
|
||||
, 3524), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -754,7 +380,7 @@ 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 74 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -764,7 +390,7 @@ WriteLiteral(" </div>\r\n");
|
||||
|
||||
WriteLiteral(@" <script>
|
||||
$(function () {
|
||||
$('#DocumentTemplate_Export_Download_Dialog')
|
||||
$('#Export_Download_Dialog')
|
||||
.dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
@@ -777,7 +403,7 @@ WriteLiteral(@" <script>
|
||||
");
|
||||
|
||||
|
||||
#line 204 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 88 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -785,7 +411,7 @@ WriteLiteral(@" <script>
|
||||
#line hidden
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"DocumentTemplate_Export_Exporting\"");
|
||||
WriteLiteral(" id=\"Export_Exporting\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
@@ -804,13 +430,13 @@ WriteLiteral(" class=\"actionBar\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 93 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 209 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 93 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
if (Authorization.Has(Claims.Config.ManageSavedExports))
|
||||
{
|
||||
|
||||
@@ -828,7 +454,7 @@ WriteLiteral(" class=\"button\"");
|
||||
WriteLiteral(">Save Export</button>\r\n");
|
||||
|
||||
|
||||
#line 212 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 96 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -849,7 +475,7 @@ WriteLiteral(" title=\"Requires Manage Saved Exports Permission\"");
|
||||
WriteLiteral(">Save Export</button>\r\n");
|
||||
|
||||
|
||||
#line 216 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
#line 100 "..\..\Areas\Config\Views\DocumentTemplate\Export.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -863,7 +489,47 @@ WriteLiteral(" id=\"DocumentTemplate_Export_Button\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Export Now</button>\r\n</div>\r\n");
|
||||
WriteLiteral(@">Export Now</button>
|
||||
<script>
|
||||
$(function () {
|
||||
const $form = $('#Export_Scope').closest('form');
|
||||
let $exportingDialog = null;
|
||||
|
||||
$.validator.unobtrusive.parse($form);
|
||||
$form.data(""validator"").settings.submitHandler = function () {
|
||||
const exportFieldCount = $('#Export_Fields').find('input:checked').length;
|
||||
|
||||
if (exportFieldCount > 0) {
|
||||
|
||||
if (!$exportingDialog) {
|
||||
$exportingDialog = $('#Export_Exporting').dialog({
|
||||
width: 400,
|
||||
height: 164,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
}
|
||||
$exportingDialog.dialog('open');
|
||||
|
||||
$form[0].submit();
|
||||
return;
|
||||
}
|
||||
|
||||
alert('Select at least one field to export.');
|
||||
}
|
||||
|
||||
$('#DocumentTemplate_Export_Button').on('click', function () {
|
||||
$form.submit();
|
||||
});
|
||||
$('#DocumentTemplate_Export_Save_Button').on('click', function () {
|
||||
$form.attr('action', $form[0].dataset.saveaction);
|
||||
$form.submit();
|
||||
});
|
||||
})
|
||||
</script>
|
||||
</div>
|
||||
");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user