feature: batch device decommissioning
This commit is contained in:
@@ -217,7 +217,7 @@
|
||||
{
|
||||
<div id="Devices_Import_Completed_Dialog" class="dialog" title="Device Import Completed">
|
||||
<h3><i class="fa fa-lg fa-check"></i>Successfully imported/updated @Model.CompletedImportSessionContext.AffectedRecords device@(Model.CompletedImportSessionContext.AffectedRecords != 1 ? "s" : null).</h3>
|
||||
<div>File: <code>@Model.CompletedImportSessionContext.Filename</code></div>
|
||||
<div><code>@Model.CompletedImportSessionContext.Filename</code></div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
@@ -668,11 +668,11 @@ WriteLiteral(" device");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(".</h3>\r\n <div>File: <code>");
|
||||
WriteLiteral(".</h3>\r\n <div><code>");
|
||||
|
||||
|
||||
#line 220 "..\..\Views\Device\Import.cshtml"
|
||||
Write(Model.CompletedImportSessionContext.Filename);
|
||||
Write(Model.CompletedImportSessionContext.Filename);
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
@{
|
||||
Authorization.Require(Claims.Device.Actions.Import);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), string.Format("File: {0}", Model.Context.DatasetName));
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), Model.Context.DatasetName);
|
||||
}
|
||||
<div id="Devices_Import_Headers">
|
||||
|
||||
@@ -29,7 +29,8 @@
|
||||
{
|
||||
<td data-headerindex="@header.Index" class="header@(header.Type.ToString())">
|
||||
<ul class="importHeaderType" data-headerindex="@header.Index" data-headertype="@header.Type.ToString()">
|
||||
<li><a href="#"><span class="headerTypeTitle">@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)</span></a>
|
||||
<li>
|
||||
<a href="#"><span class="headerTypeTitle">@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)</span></a>
|
||||
<ul>
|
||||
@foreach (var headerType in Model.HeaderTypes)
|
||||
{
|
||||
@@ -62,7 +63,7 @@
|
||||
<div class="actionBar">
|
||||
@using (Html.BeginForm(MVC.API.Device.ImportParse(Model.Context.SessionId, null)))
|
||||
{
|
||||
<a id="Devices_Import_Headers_Submit" href="#" class="button">Parse Device Import</a>
|
||||
<a id="Devices_Import_Headers_Submit" href="#" class="button">Parse Device Import</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace Disco.Web.Views.Device
|
||||
|
||||
Authorization.Require(Claims.Device.Actions.Import);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), string.Format("File: {0}", Model.Context.DatasetName));
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), Model.Context.DatasetName);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -138,15 +138,15 @@ WriteLiteral(" data-headerindex=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 947), Tuple.Create("\"", 986)
|
||||
, Tuple.Create(Tuple.Create("", 955), Tuple.Create("header", 955), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 919), Tuple.Create("\"", 958)
|
||||
, Tuple.Create(Tuple.Create("", 927), Tuple.Create("header", 927), true)
|
||||
|
||||
#line 24 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 961), Tuple.Create<System.Object, System.Int32>(header.Type.ToString()
|
||||
, Tuple.Create(Tuple.Create("", 933), Tuple.Create<System.Object, System.Int32>(header.Type.ToString()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 961), false)
|
||||
, 933), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -196,15 +196,15 @@ WriteLiteral(" data-headerindex=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1226), Tuple.Create("\"", 1265)
|
||||
, Tuple.Create(Tuple.Create("", 1234), Tuple.Create("header", 1234), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1198), Tuple.Create("\"", 1237)
|
||||
, Tuple.Create(Tuple.Create("", 1206), Tuple.Create("header", 1206), true)
|
||||
|
||||
#line 30 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1240), Tuple.Create<System.Object, System.Int32>(header.Type.ToString()
|
||||
, Tuple.Create(Tuple.Create("", 1212), Tuple.Create<System.Object, System.Int32>(header.Type.ToString()
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1240), false)
|
||||
, 1212), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <ul");
|
||||
@@ -233,7 +233,7 @@ WriteLiteral(" data-headertype=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">\r\n <li><a");
|
||||
WriteLiteral(">\r\n <li>\r\n <a");
|
||||
|
||||
WriteLiteral(" href=\"#\"");
|
||||
|
||||
@@ -244,7 +244,7 @@ WriteLiteral(" class=\"headerTypeTitle\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 32 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 33 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2);
|
||||
|
||||
|
||||
@@ -253,13 +253,13 @@ WriteLiteral(">");
|
||||
WriteLiteral("</span></a>\r\n <ul>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 35 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 35 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
foreach (var headerType in Model.HeaderTypes)
|
||||
{
|
||||
|
||||
@@ -271,7 +271,7 @@ WriteLiteral(" <li");
|
||||
WriteLiteral(" data-headertype=\"");
|
||||
|
||||
|
||||
#line 36 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 37 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(headerType.Item1);
|
||||
|
||||
|
||||
@@ -286,7 +286,7 @@ WriteLiteral(" href=\"#\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 36 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 37 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(headerType.Item2);
|
||||
|
||||
|
||||
@@ -295,7 +295,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</a></li>\r\n");
|
||||
|
||||
|
||||
#line 37 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 38 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -305,7 +305,7 @@ WriteLiteral(" </ul>\r\n
|
||||
"\n </ul>\r\n </td>\r\n");
|
||||
|
||||
|
||||
#line 42 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 43 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -314,13 +314,13 @@ WriteLiteral(" </ul>\r\n
|
||||
WriteLiteral(" </tr>\r\n </thead>\r\n <tbody>\r\n");
|
||||
|
||||
|
||||
#line 46 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 47 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 46 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 47 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
using (var dataReader = Model.Context.GetDataReader())
|
||||
{
|
||||
for (int r = 0; r < Math.Min(10, Model.Context.RecordCount); r++)
|
||||
@@ -333,13 +333,13 @@ WriteLiteral(" </tr>\r\n </thead>\r\n <tbod
|
||||
WriteLiteral(" <tr>\r\n");
|
||||
|
||||
|
||||
#line 52 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 53 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 52 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 53 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
for (int c = 0; c < Model.Context.ColumnCount; c++)
|
||||
{
|
||||
|
||||
@@ -351,7 +351,7 @@ WriteLiteral(" <td");
|
||||
WriteLiteral(" data-headerindex=\"");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 55 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(c);
|
||||
|
||||
|
||||
@@ -362,7 +362,7 @@ WriteLiteral("\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 54 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 55 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(dataReader.GetString(c));
|
||||
|
||||
|
||||
@@ -371,7 +371,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</td>\r\n");
|
||||
|
||||
|
||||
#line 55 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 56 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ WriteLiteral("</td>\r\n");
|
||||
WriteLiteral(" </tr>\r\n");
|
||||
|
||||
|
||||
#line 57 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 58 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -394,13 +394,13 @@ WriteLiteral(" class=\"actionBar\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 63 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 64 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 63 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 64 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
using (Html.BeginForm(MVC.API.Device.ImportParse(Model.Context.SessionId, null)))
|
||||
{
|
||||
|
||||
@@ -415,10 +415,10 @@ WriteLiteral(" href=\"#\"");
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
|
||||
WriteLiteral(">Parse Device Import</a> \r\n");
|
||||
WriteLiteral(">Parse Device Import</a>\r\n");
|
||||
|
||||
|
||||
#line 66 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 67 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -442,13 +442,13 @@ WriteLiteral("></i>Parsing device import...</h4>\r\n</div>\r\n<script>\r\n $(
|
||||
" var headerTypes = {\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 76 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 76 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
foreach (var h in Model.HeaderTypes)
|
||||
{
|
||||
|
||||
@@ -460,7 +460,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\'");
|
||||
|
||||
|
||||
#line 77 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 78 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(h.Item1);
|
||||
|
||||
|
||||
@@ -469,7 +469,7 @@ WriteLiteral("\'");
|
||||
WriteLiteral("\': \'");
|
||||
|
||||
|
||||
#line 77 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 78 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
Write(h.Item2);
|
||||
|
||||
|
||||
@@ -480,7 +480,7 @@ WriteLiteral("\',");
|
||||
WriteLiteral("\r\n");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
#line 79 "..\..\Views\Device\ImportHeaders.cshtml"
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
@{
|
||||
Authorization.Require(Claims.Device.Actions.Import);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), string.Format("File: {0}", Model.Context.Filename));
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), Model.Context.Filename);
|
||||
}
|
||||
<div id="Devices_Import_Review">
|
||||
|
||||
@@ -23,105 +23,116 @@
|
||||
<div id="Devices_Import_Review_Navigation">
|
||||
<ul class="none">
|
||||
@if (Model.StatisticErrorRecords > 0)
|
||||
{<li class="actionDetached">
|
||||
<input id="Devices_Import_Review_Navigation_Error" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Error">Show Errors (@(Model.StatisticErrorRecords))</label>
|
||||
</li>}@if (Model.StatisticNewRecords > 0)
|
||||
{<li class="actionAdded">
|
||||
<input id="Devices_Import_Review_Navigation_New" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_New">Show New Devices (@(Model.StatisticNewRecords))</label>
|
||||
</li>}@if (Model.StatisticModifiedRecords > 0)
|
||||
{<li class="actionModified">
|
||||
<input id="Devices_Import_Review_Navigation_Modified" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Modified">Show Modified Devices (@(Model.StatisticModifiedRecords))</label>
|
||||
</li>}@if (Model.StatisticUnmodifiedRecords > 0)
|
||||
{<li class="actionUnchanged">
|
||||
<input id="Devices_Import_Review_Navigation_Unchanged" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Unchanged">Show Unchanged Devices (@(Model.StatisticUnmodifiedRecords))</label>
|
||||
</li>}
|
||||
</ul>
|
||||
<script>
|
||||
$(function () {
|
||||
$navigationContainer = $('#Devices_Import_Review_Navigation');
|
||||
$tableBody = $('#Devices_Import_Review_TableContainer').find('tbody');
|
||||
{
|
||||
<li class="actionDetached">
|
||||
<input id="Devices_Import_Review_Navigation_Error" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Error">Show Errors (@(Model.StatisticErrorRecords))</label>
|
||||
</li>
|
||||
}@if (Model.StatisticNewRecords > 0)
|
||||
{
|
||||
<li class="actionAdded">
|
||||
<input id="Devices_Import_Review_Navigation_New" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_New">Show New Devices (@(Model.StatisticNewRecords))</label>
|
||||
</li>
|
||||
}@if (Model.StatisticModifiedRecords > 0)
|
||||
{
|
||||
<li class="actionModified">
|
||||
<input id="Devices_Import_Review_Navigation_Modified" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Modified">Show Modified Devices (@(Model.StatisticModifiedRecords))</label>
|
||||
</li>
|
||||
}@if (Model.StatisticUnmodifiedRecords > 0)
|
||||
{
|
||||
<li class="actionUnchanged">
|
||||
<input id="Devices_Import_Review_Navigation_Unchanged" type="checkbox" checked /><label for="Devices_Import_Review_Navigation_Unchanged">Show Unchanged Devices (@(Model.StatisticUnmodifiedRecords))</label>
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
<script>
|
||||
$(function () {
|
||||
$navigationContainer = $('#Devices_Import_Review_Navigation');
|
||||
$tableBody = $('#Devices_Import_Review_TableContainer').find('tbody');
|
||||
|
||||
$navigationContainer.on('change', 'input', function () {
|
||||
$tableBody.find('tr').show();
|
||||
$navigationContainer.on('change', 'input', function () {
|
||||
$tableBody.find('tr').show();
|
||||
|
||||
$navigationContainer.find('input').each(function () {
|
||||
var $this = $(this);
|
||||
var action = $this.closest('li').attr('class');
|
||||
var records = $tableBody.find('tr.' + action);
|
||||
if ($this.is(':checked')) {
|
||||
records.show();
|
||||
} else {
|
||||
records.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="Devices_Import_Review_TableContainer">
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Action</th>
|
||||
<th>Row</th>
|
||||
@foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
<th>@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)</th>
|
||||
}
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
@foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
<th>@header.Name</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i)))
|
||||
{
|
||||
var record = recordEntry.Item1;
|
||||
<tr class="action@(record.RecordAction)">
|
||||
<td class="action"><i class="fa fa-fw"></i></td>
|
||||
<td>@(recordEntry.Item2 + 1)</td>
|
||||
@foreach (var field in record.Fields)
|
||||
{
|
||||
var friendlyValue = field.FriendlyValue;
|
||||
<td class="header@(field.FieldType) action@(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error")" data-previousvalue="@(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null)">
|
||||
@if (!field.FieldAction.HasValue)
|
||||
{
|
||||
<span class="errorMessage"><strong>Error:</strong> @field.ErrorMessage</span>
|
||||
<i class="fa fa-exclamation-triangle fa-fw"></i>
|
||||
}
|
||||
@if (string.IsNullOrEmpty(friendlyValue))
|
||||
{<span class="smallMessage"><None></span>}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added)
|
||||
{
|
||||
@Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target="_blank" })}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged)
|
||||
{
|
||||
@Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target="_blank" })}
|
||||
else
|
||||
{@friendlyValue}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
$navigationContainer.find('input').each(function () {
|
||||
var $this = $(this);
|
||||
var action = $this.closest('li').attr('class');
|
||||
var records = $tableBody.find('tr.' + action);
|
||||
if ($this.is(':checked')) {
|
||||
records.show();
|
||||
} else {
|
||||
records.hide();
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div id="Devices_Import_Review_TableContainer">
|
||||
<table class="tableData">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Action</th>
|
||||
<th>Row</th>
|
||||
@foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
<th>@(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2)</th>
|
||||
}
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
@foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
<th>@header.Name</th>
|
||||
}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i)))
|
||||
{
|
||||
var record = recordEntry.Item1;
|
||||
<tr class="action@(record.RecordAction)">
|
||||
<td class="action"><i class="fa fa-fw"></i></td>
|
||||
<td>@(recordEntry.Item2 + 1)</td>
|
||||
@foreach (var field in record.Fields)
|
||||
{
|
||||
var friendlyValue = field.FriendlyValue;
|
||||
<td class="header@(field.FieldType) action@(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error")" data-previousvalue="@(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null)">
|
||||
@if (!field.FieldAction.HasValue)
|
||||
{
|
||||
<span class="errorMessage"><strong>Error:</strong> @field.ErrorMessage</span>
|
||||
<i class="fa fa-exclamation-triangle fa-fw"></i>
|
||||
}
|
||||
@if (string.IsNullOrEmpty(friendlyValue))
|
||||
{<span class="smallMessage"><None></span>}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added)
|
||||
{
|
||||
@Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target = "_blank" })}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged)
|
||||
{
|
||||
@Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target = "_blank" })}
|
||||
else
|
||||
{@friendlyValue}
|
||||
</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="actionBar">
|
||||
@if (Model.Context.AllowBacktracking)
|
||||
{
|
||||
<a id="Devices_Import_Review_ChangeHeaders" href="@Url.Action(MVC.Device.ImportHeaders(Model.Context.SessionId))" class="button"><i class="fa fa-caret-left"></i>Change Import Columns</a>
|
||||
@if (Model.StatisticImportRecords == 0)
|
||||
{
|
||||
<a id="Devices_Import_Review_Apply" href="#" class="button disabled" disabled><i class="fa fa-wrench"></i>Apply Device Import</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a id="Devices_Import_Review_Apply" href="@Url.Action(MVC.API.Device.ImportApply(Model.Context.SessionId))" class="button"><i class="fa fa-wrench"></i>Apply Device Import</a>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
@if (Model.StatisticImportRecords == 0)
|
||||
{
|
||||
<a id="Devices_Import_Review_Apply" href="#" class="button disabled" disabled><i class="fa fa-wrench"></i>Apply Device Import</a>
|
||||
}
|
||||
else
|
||||
{
|
||||
<a id="Devices_Import_Review_Apply" href="@Url.Action(MVC.API.Device.ImportApply(Model.Context.SessionId))" class="button"><i class="fa fa-wrench"></i>Apply Device Import</a>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Disco.Web.Views.Device
|
||||
|
||||
Authorization.Require(Claims.Device.Actions.Import);
|
||||
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), string.Format("File: {0}", Model.Context.Filename));
|
||||
ViewBag.Title = Html.ToBreadcrumb("Devices", MVC.Device.Index(), "Import Devices", MVC.Device.Import(), Model.Context.Filename);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -185,14 +185,15 @@ WriteLiteral(">\r\n");
|
||||
#line 25 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticErrorRecords > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<li");
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteLiteral(" class=\"actionDetached\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Navigation_Error\"");
|
||||
|
||||
@@ -205,32 +206,33 @@ WriteLiteral(" for=\"Devices_Import_Review_Navigation_Error\"");
|
||||
WriteLiteral(">Show Errors (");
|
||||
|
||||
|
||||
#line 27 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticErrorRecords);
|
||||
#line 28 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticErrorRecords);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</label>\r\n </li>");
|
||||
WriteLiteral(")</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 28 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 30 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 28 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticNewRecords > 0)
|
||||
{
|
||||
#line 30 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticNewRecords > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<li");
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteLiteral(" class=\"actionAdded\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Navigation_New\"");
|
||||
|
||||
@@ -243,32 +245,33 @@ WriteLiteral(" for=\"Devices_Import_Review_Navigation_New\"");
|
||||
WriteLiteral(">Show New Devices (");
|
||||
|
||||
|
||||
#line 30 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticNewRecords);
|
||||
#line 33 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticNewRecords);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</label>\r\n </li>");
|
||||
WriteLiteral(")</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 31 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 35 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 31 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticModifiedRecords > 0)
|
||||
{
|
||||
#line 35 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticModifiedRecords > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<li");
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteLiteral(" class=\"actionModified\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Navigation_Modified\"");
|
||||
|
||||
@@ -281,32 +284,33 @@ WriteLiteral(" for=\"Devices_Import_Review_Navigation_Modified\"");
|
||||
WriteLiteral(">Show Modified Devices (");
|
||||
|
||||
|
||||
#line 33 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticModifiedRecords);
|
||||
#line 38 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticModifiedRecords);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</label>\r\n </li>");
|
||||
WriteLiteral(")</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 40 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 34 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticUnmodifiedRecords > 0)
|
||||
{
|
||||
#line 40 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticUnmodifiedRecords > 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("<li");
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteLiteral(" class=\"actionUnchanged\"");
|
||||
|
||||
WriteLiteral(">\r\n <input");
|
||||
WriteLiteral(">\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Navigation_Unchanged\"");
|
||||
|
||||
@@ -319,109 +323,74 @@ WriteLiteral(" for=\"Devices_Import_Review_Navigation_Unchanged\"");
|
||||
WriteLiteral(">Show Unchanged Devices (");
|
||||
|
||||
|
||||
#line 36 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticUnmodifiedRecords);
|
||||
#line 43 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.StatisticUnmodifiedRecords);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(")</label>\r\n </li>");
|
||||
WriteLiteral(")</label>\r\n </li>\r\n");
|
||||
|
||||
|
||||
#line 37 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 45 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(@" </ul>
|
||||
<script>
|
||||
$(function () {
|
||||
$navigationContainer = $('#Devices_Import_Review_Navigation');
|
||||
$tableBody = $('#Devices_Import_Review_TableContainer').find('tbody');
|
||||
WriteLiteral(@"</ul>
|
||||
<script>
|
||||
$(function () {
|
||||
$navigationContainer = $('#Devices_Import_Review_Navigation');
|
||||
$tableBody = $('#Devices_Import_Review_TableContainer').find('tbody');
|
||||
|
||||
$navigationContainer.on('change', 'input', function () {
|
||||
$tableBody.find('tr').show();
|
||||
$navigationContainer.on('change', 'input', function () {
|
||||
$tableBody.find('tr').show();
|
||||
|
||||
$navigationContainer.find('input').each(function () {
|
||||
var $this = $(this);
|
||||
var action = $this.closest('li').attr('class');
|
||||
var records = $tableBody.find('tr.' + action);
|
||||
if ($this.is(':checked')) {
|
||||
records.show();
|
||||
} else {
|
||||
records.hide();
|
||||
}
|
||||
});
|
||||
});
|
||||
$navigationContainer.find('input').each(function () {
|
||||
var $this = $(this);
|
||||
var action = $this.closest('li').attr('class');
|
||||
var records = $tableBody.find('tr.' + action);
|
||||
if ($this.is(':checked')) {
|
||||
records.show();
|
||||
} else {
|
||||
records.hide();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div");
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
<div");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_TableContainer\"");
|
||||
|
||||
WriteLiteral(">\r\n <table");
|
||||
WriteLiteral(">\r\n <table");
|
||||
|
||||
WriteLiteral(" class=\"tableData\"");
|
||||
|
||||
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th>Action</th>" +
|
||||
"\r\n <th>Row</th>\r\n");
|
||||
|
||||
|
||||
#line 67 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 67 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <th>");
|
||||
|
||||
|
||||
#line 69 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</th>\r\n");
|
||||
|
||||
|
||||
#line 70 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n <tr>\r\n <th> </th>\r" +
|
||||
"\n <th> </th>\r\n");
|
||||
WriteLiteral(">\r\n <thead>\r\n <tr>\r\n <th>Action</th>\r\n " +
|
||||
" <th>Row</th>\r\n");
|
||||
|
||||
|
||||
#line 75 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 75 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <th>");
|
||||
WriteLiteral(" <th>");
|
||||
|
||||
|
||||
#line 77 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(header.Name);
|
||||
Write(Model.HeaderTypes.FirstOrDefault(h => h.Item1 == header.Type).Item2);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -430,42 +399,77 @@ WriteLiteral("</th>\r\n");
|
||||
|
||||
|
||||
#line 78 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n </thead>\r\n <tbody>\r\n");
|
||||
WriteLiteral(" </tr>\r\n <tr>\r\n <th> </th>\r\n " +
|
||||
" <th> </th>\r\n");
|
||||
|
||||
|
||||
#line 82 "..\..\Views\Device\ImportReview.cshtml"
|
||||
#line 83 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 82 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i)))
|
||||
#line 83 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var header in Model.Context.Columns.Where(c => c.Type != DeviceImportFieldTypes.IgnoreColumn))
|
||||
{
|
||||
var record = recordEntry.Item1;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
WriteLiteral(" <th>");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4401), Tuple.Create("\"", 4437)
|
||||
, Tuple.Create(Tuple.Create("", 4409), Tuple.Create("action", 4409), true)
|
||||
|
||||
#line 85 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4415), Tuple.Create<System.Object, System.Int32>(record.RecordAction
|
||||
Write(header.Name);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4415), false)
|
||||
WriteLiteral("</th>\r\n");
|
||||
|
||||
|
||||
#line 86 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n </thead>\r\n <tbody>\r\n");
|
||||
|
||||
|
||||
#line 90 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 90 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var recordEntry in Model.Context.Records.Select((r, i) => Tuple.Create(r, i)))
|
||||
{
|
||||
var record = recordEntry.Item1;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4017), Tuple.Create("\"", 4053)
|
||||
, Tuple.Create(Tuple.Create("", 4025), Tuple.Create("action", 4025), true)
|
||||
|
||||
#line 93 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4031), Tuple.Create<System.Object, System.Int32>(record.RecordAction
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4031), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <td");
|
||||
WriteLiteral(">\r\n <td");
|
||||
|
||||
WriteLiteral(" class=\"action\"");
|
||||
|
||||
@@ -473,11 +477,11 @@ WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw\"");
|
||||
|
||||
WriteLiteral("></i></td>\r\n <td>");
|
||||
WriteLiteral("></i></td>\r\n <td>");
|
||||
|
||||
|
||||
#line 87 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(recordEntry.Item2 + 1);
|
||||
#line 95 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(recordEntry.Item2 + 1);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -485,46 +489,46 @@ WriteLiteral("></i></td>\r\n <td>");
|
||||
WriteLiteral("</td>\r\n");
|
||||
|
||||
|
||||
#line 88 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
#line 96 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 88 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var field in record.Fields)
|
||||
{
|
||||
var friendlyValue = field.FriendlyValue;
|
||||
#line 96 "..\..\Views\Device\ImportReview.cshtml"
|
||||
foreach (var field in record.Fields)
|
||||
{
|
||||
var friendlyValue = field.FriendlyValue;
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <td");
|
||||
WriteLiteral(" <td");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4765), Tuple.Create("\"", 4874)
|
||||
, Tuple.Create(Tuple.Create("", 4773), Tuple.Create("header", 4773), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 4357), Tuple.Create("\"", 4466)
|
||||
, Tuple.Create(Tuple.Create("", 4365), Tuple.Create("header", 4365), true)
|
||||
|
||||
#line 91 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4779), Tuple.Create<System.Object, System.Int32>(field.FieldType
|
||||
#line 99 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4371), Tuple.Create<System.Object, System.Int32>(field.FieldType
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4779), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 4797), Tuple.Create("action", 4798), true)
|
||||
, 4371), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 4389), Tuple.Create("action", 4390), true)
|
||||
|
||||
#line 91 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4804), Tuple.Create<System.Object, System.Int32>(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error"
|
||||
#line 99 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4396), Tuple.Create<System.Object, System.Int32>(field.FieldAction.HasValue ? field.FieldAction.ToString() : "Error"
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4804), false)
|
||||
, 4396), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" data-previousvalue=\"");
|
||||
|
||||
|
||||
#line 91 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null);
|
||||
#line 99 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(field.FieldAction.HasValue && field.FieldAction.Value == System.Data.EntityState.Modified ? field.FriendlyPreviousValue : null);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -534,53 +538,53 @@ WriteLiteral("\"");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
|
||||
#line 92 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
#line 100 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 92 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (!field.FieldAction.HasValue)
|
||||
{
|
||||
#line 100 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (!field.FieldAction.HasValue)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <span");
|
||||
WriteLiteral(" <span");
|
||||
|
||||
WriteLiteral(" class=\"errorMessage\"");
|
||||
|
||||
WriteLiteral("><strong>Error:</strong> ");
|
||||
|
||||
|
||||
#line 94 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(field.ErrorMessage);
|
||||
#line 102 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(field.ErrorMessage);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
WriteLiteral(" <i");
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-fw\"");
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
|
||||
|
||||
#line 96 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 104 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" ");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 97 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (string.IsNullOrEmpty(friendlyValue))
|
||||
{
|
||||
#line 105 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (string.IsNullOrEmpty(friendlyValue))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
@@ -591,93 +595,109 @@ WriteLiteral(" class=\"smallMessage\"");
|
||||
WriteLiteral("><None></span>");
|
||||
|
||||
|
||||
#line 98 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added)
|
||||
{
|
||||
|
||||
#line 106 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.DeviceSerialNumber && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Added)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target="_blank" }));
|
||||
#line 109 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Html.ActionLink(friendlyValue, MVC.Device.Show((string)field.RawParsedValue), new { target = "_blank" }));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 101 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 104 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target="_blank" }));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 104 "..\..\Views\Device\ImportReview.cshtml"
|
||||
#line 109 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
else if (field.FieldType == DeviceImportFieldTypes.AssignedUserId && field.FieldAction.HasValue && field.FieldAction.Value != EntityState.Unchanged)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 106 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(friendlyValue);
|
||||
#line 112 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(Html.ActionLink(friendlyValue, MVC.User.Show((string)field.RawParsedValue), new { target = "_blank" }));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 106 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 112 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 114 "..\..\Views\Device\ImportReview.cshtml"
|
||||
Write(friendlyValue);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </td>\r\n");
|
||||
|
||||
|
||||
#line 108 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 114 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tr>\r\n");
|
||||
WriteLiteral(" </td>\r\n");
|
||||
|
||||
|
||||
#line 110 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 116 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n </div>\r\n <div");
|
||||
WriteLiteral(" </tr>\r\n");
|
||||
|
||||
|
||||
#line 118 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </tbody>\r\n </table>\r\n</div>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"actionBar\"");
|
||||
|
||||
WriteLiteral(">\r\n <a");
|
||||
WriteLiteral(">\r\n");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_ChangeHeaders\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 6568), Tuple.Create("\"", 6637)
|
||||
|
||||
#line 115 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6575), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.ImportHeaders(Model.Context.SessionId))
|
||||
#line 123 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6575), false)
|
||||
|
||||
#line 123 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.Context.AllowBacktracking)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_ChangeHeaders\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 6122), Tuple.Create("\"", 6191)
|
||||
|
||||
#line 125 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6129), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Device.ImportHeaders(Model.Context.SessionId))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6129), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -689,20 +709,23 @@ WriteLiteral(" class=\"fa fa-caret-left\"");
|
||||
WriteLiteral("></i>Change Import Columns</a>\r\n");
|
||||
|
||||
|
||||
#line 116 "..\..\Views\Device\ImportReview.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 116 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticImportRecords == 0)
|
||||
{
|
||||
#line 126 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 127 "..\..\Views\Device\ImportReview.cshtml"
|
||||
if (Model.StatisticImportRecords == 0)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Apply\"");
|
||||
|
||||
@@ -717,26 +740,26 @@ WriteLiteral(" class=\"fa fa-wrench\"");
|
||||
WriteLiteral("></i>Apply Device Import</a>\r\n");
|
||||
|
||||
|
||||
#line 119 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
#line 130 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <a");
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteLiteral(" id=\"Devices_Import_Review_Apply\"");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 6999), Tuple.Create("\"", 7070)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 6532), Tuple.Create("\"", 6603)
|
||||
|
||||
#line 122 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7006), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.ImportApply(Model.Context.SessionId))
|
||||
#line 133 "..\..\Views\Device\ImportReview.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6539), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.Device.ImportApply(Model.Context.SessionId))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7006), false)
|
||||
, 6539), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button\"");
|
||||
@@ -748,39 +771,39 @@ WriteLiteral(" class=\"fa fa-wrench\"");
|
||||
WriteLiteral("></i>Apply Device Import</a>\r\n");
|
||||
|
||||
|
||||
#line 123 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
#line 134 "..\..\Views\Device\ImportReview.cshtml"
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </div>\r\n</div>\r\n<script>\r\n $(function () {\r\n $Devices_Import_Review" +
|
||||
"_TableContainer = $(\'#Devices_Import_Review_TableContainer\');\r\n\r\n $Device" +
|
||||
"s_Import_Review_TableContainer.find(\'tbody\').tooltip({\r\n items: \'td.a" +
|
||||
"ction, td.actionError, td.actionModified\',\r\n content: function () {\r\n" +
|
||||
" var $this = $(this);\r\n\r\n if ($this.hasClass(\'acti" +
|
||||
"on\')) {\r\n var record = $(this).closest(\'tr\');\r\n\r\n " +
|
||||
" if (record.hasClass(\'actionDetached\')) {\r\n return" +
|
||||
" \'<strong>Error Parsing Record</strong><div>Review the record fields for details" +
|
||||
" about any errors.</div><div class=\"smallMessage\">This record will be skipped.</" +
|
||||
"div>\';\r\n } else if (record.hasClass(\'actionUnchanged\')) {\r\n " +
|
||||
" return \'<strong>No Changes</strong><div>No changes were fo" +
|
||||
"und while parsing this record.</div><div class=\"smallMessage\">This record will b" +
|
||||
"e skipped.</div>\';\r\n } else if (record.hasClass(\'actionModifi" +
|
||||
"ed\')) {\r\n return \'<strong>Pending Changes</strong><div>Th" +
|
||||
"is record contains changes which will be applied.</div>\';\r\n }" +
|
||||
" else if (record.hasClass(\'actionAdded\')) {\r\n return \'<st" +
|
||||
"rong>New Record</strong><div>This record will be imported.</div>\';\r\n " +
|
||||
" }\r\n } else if ($this.hasClass(\'actionError\')) {\r\n " +
|
||||
" return $(this).find(\'span.errorMessage\').html();\r\n } " +
|
||||
"else if ($this.hasClass(\'actionModified\')) {\r\n var v = $(this" +
|
||||
").attr(\'data-previousvalue\');\r\n if (v) {\r\n " +
|
||||
" return \'<strong>Previous Value:</strong><br />\' + v;\r\n }" +
|
||||
" else {\r\n return \'<strong>Previous Value:</strong><br /><" +
|
||||
"em><None></em>\';\r\n }\r\n }\r\n }," +
|
||||
"\r\n position: {\r\n my: \"left top\",\r\n at: " +
|
||||
"\"left bottom\",\r\n collision: \"flipfit flip\"\r\n }\r\n " +
|
||||
" });\r\n\r\n });\r\n</script>\r\n");
|
||||
WriteLiteral("</div>\r\n</div>\r\n<script>\r\n $(function () {\r\n $Devices_Import_Review_Tab" +
|
||||
"leContainer = $(\'#Devices_Import_Review_TableContainer\');\r\n\r\n $Devices_Im" +
|
||||
"port_Review_TableContainer.find(\'tbody\').tooltip({\r\n items: \'td.actio" +
|
||||
"n, td.actionError, td.actionModified\',\r\n content: function () {\r\n " +
|
||||
" var $this = $(this);\r\n\r\n if ($this.hasClass(\'action\')" +
|
||||
") {\r\n var record = $(this).closest(\'tr\');\r\n\r\n " +
|
||||
" if (record.hasClass(\'actionDetached\')) {\r\n return \'<s" +
|
||||
"trong>Error Parsing Record</strong><div>Review the record fields for details abo" +
|
||||
"ut any errors.</div><div class=\"smallMessage\">This record will be skipped.</div>" +
|
||||
"\';\r\n } else if (record.hasClass(\'actionUnchanged\')) {\r\n " +
|
||||
" return \'<strong>No Changes</strong><div>No changes were found " +
|
||||
"while parsing this record.</div><div class=\"smallMessage\">This record will be sk" +
|
||||
"ipped.</div>\';\r\n } else if (record.hasClass(\'actionModified\')" +
|
||||
") {\r\n return \'<strong>Pending Changes</strong><div>This r" +
|
||||
"ecord contains changes which will be applied.</div>\';\r\n } els" +
|
||||
"e if (record.hasClass(\'actionAdded\')) {\r\n return \'<strong" +
|
||||
">New Record</strong><div>This record will be imported.</div>\';\r\n " +
|
||||
" }\r\n } else if ($this.hasClass(\'actionError\')) {\r\n " +
|
||||
" return $(this).find(\'span.errorMessage\').html();\r\n } else" +
|
||||
" if ($this.hasClass(\'actionModified\')) {\r\n var v = $(this).at" +
|
||||
"tr(\'data-previousvalue\');\r\n if (v) {\r\n " +
|
||||
" return \'<strong>Previous Value:</strong><br />\' + v;\r\n } els" +
|
||||
"e {\r\n return \'<strong>Previous Value:</strong><br /><em>&" +
|
||||
"lt;None></em>\';\r\n }\r\n }\r\n },\r\n " +
|
||||
" position: {\r\n my: \"left top\",\r\n at: \"lef" +
|
||||
"t bottom\",\r\n collision: \"flipfit flip\"\r\n }\r\n })" +
|
||||
";\r\n\r\n });\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user