2ac3a9bdd3
Also some UI tweaks.
2541 lines
96 KiB
C#
2541 lines
96 KiB
C#
#pragma warning disable 1591
|
|
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was generated by a tool.
|
|
// Runtime Version:4.0.30319.34003
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
namespace Disco.Web.Views.Device.DeviceParts
|
|
{
|
|
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.BI.Extensions;
|
|
using Disco.Models.Repository;
|
|
using Disco.Services;
|
|
using Disco.Services.Authorization;
|
|
using Disco.Services.Web;
|
|
using Disco.Web;
|
|
using Disco.Web.Extensions;
|
|
|
|
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
|
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/DeviceParts/_Subject.cshtml")]
|
|
public partial class Subject : Disco.Services.Web.WebViewPage<Disco.Web.Models.Device.ShowModel>
|
|
{
|
|
public Subject()
|
|
{
|
|
}
|
|
public override void Execute()
|
|
{
|
|
|
|
#line 2 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
Authorization.Require(Claims.Device.Show);
|
|
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n<table");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Subjects\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(">Name:</span>\r\n </td>\r\n <td" +
|
|
">");
|
|
|
|
|
|
#line 16 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (string.IsNullOrWhiteSpace(Model.Device.ComputerName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_NameUnknown\"");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral("><Unknown/Not Allocated></span>\r\n");
|
|
|
|
|
|
#line 19 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h4");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Name\"");
|
|
|
|
WriteLiteral(" title=\"Computer Name\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 22 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.ComputerName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h4>\r\n");
|
|
|
|
|
|
#line 23 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>Asset:</td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 29 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 29 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.AssetNumber))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.TextBoxFor(m => m.Device.AssetNumber, new { @class = "small discreet" }));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 31 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"small discreet\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 35 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.AssetNumber ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 36 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td>Location:</td>\r\n " +
|
|
" <td>\r\n");
|
|
|
|
|
|
#line 42 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 42 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.Location))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.TextBoxFor(m => m.Device.Location, new { @class = "small discreet" }));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxSave());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(AjaxHelpers.AjaxLoader());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 44 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"small discreet\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 48 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.Location ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 49 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 53 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 53 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.HasAny(Claims.Device.Properties.AssetNumber, Claims.Device.Properties.Location))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n");
|
|
|
|
|
|
#line 57 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 57 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.AssetNumber))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_AssetNumber\'), \'Unknown\'," +
|
|
" \'");
|
|
|
|
|
|
#line 58 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.UpdateAssetNumber(Model.Device.SerialNumber, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', \'AssetNumber\');");
|
|
|
|
|
|
#line 58 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 59 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Properties.Location))
|
|
{
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("document.DiscoFunctions.PropertyChangeHelper($(\'#Device_Location\'), \'Unknown\', \'");
|
|
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.UpdateLocation(Model.Device.SerialNumber, null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', \'Location\');");
|
|
|
|
|
|
#line 60 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 63 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>Created:\r\n " +
|
|
" </td>\r\n <td><span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates_Created\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 70 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.CreatedDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span></td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 72 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 72 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.DecommissionedDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <tr>\r\n <td>Decommissio" +
|
|
"ned:\r\n </td>\r\n <td" +
|
|
"><span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Dates_Decommissioned\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 77 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DecommissionedDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span></td>\r\n </tr>\r\n");
|
|
|
|
|
|
#line 79 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <tr>\r\n <td>Enrolled:\r\n " +
|
|
" </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 85 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 85 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.EnrolledDate.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral("First: ");
|
|
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_First\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 87 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.EnrolledDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 88 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.LastEnrolDate.HasValue && Model.Device.EnrolledDate.Value != Model.Device.LastEnrolDate.Value)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <br />");
|
|
|
|
WriteLiteral("Last: ");
|
|
|
|
WriteLiteral("<span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Last\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 90 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.LastEnrolDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 91 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Never\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Never</span>\r\n");
|
|
|
|
|
|
#line 96 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 97 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.AllowUnauthenticatedEnrol)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Asset_Enrolled_Trusted\"");
|
|
|
|
WriteLiteral(" title=\"Trusted Unauthenticated Enrolment is Allowed\"");
|
|
|
|
WriteLiteral("></span>\r\n");
|
|
|
|
|
|
#line 100 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n\r\n " +
|
|
" </table>\r\n </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Status\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Last Network Logon Date\"");
|
|
|
|
WriteLiteral(">Last Seen:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 111 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
string lastSeenClass = null;
|
|
if (Model.Device.LastNetworkLogonDate.HasValue)
|
|
{
|
|
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-30))
|
|
{
|
|
lastSeenClass = "error";
|
|
}
|
|
else
|
|
{
|
|
if (Model.Device.LastNetworkLogonDate.Value < DateTime.Now.AddDays(-7))
|
|
{
|
|
lastSeenClass = "alert";
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Details_Status_LastSeen\"");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 7270), Tuple.Create("\"", 7292)
|
|
|
|
#line 128 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 7278), Tuple.Create<System.Object, System.Int32>(lastSeenClass
|
|
|
|
#line default
|
|
#line hidden
|
|
, 7278), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 128 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.LastNetworkLogonDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span></td>\r\n");
|
|
|
|
|
|
#line 129 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 129 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (!string.IsNullOrEmpty(Model.Device.ComputerName))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var updated = false;
|
|
var span = $('#Device_Show_Details_Status_LastSeen');
|
|
var spanProgress = null;
|
|
|
|
$.getJSON('");
|
|
|
|
|
|
#line 137 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.LastNetworkLogonDate(Model.Device.SerialNumber)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\', function (response, result) {\r\n upd" +
|
|
"ated = true;\r\n if (spanProgress)\r\n " +
|
|
" spanProgress.remove();\r\n\r\n " +
|
|
" if (result != \'success\') {\r\n " +
|
|
" alert(\'Unable to retrieve latest network logon da" +
|
|
"te:\\n\' + response);\r\n $(\'<span>\')" +
|
|
".addClass(\'smallMessage\').text(\'[may not be current]\').appendTo(span);\r\n " +
|
|
" } else {\r\n " +
|
|
" var spanClasses = \'\',\r\n " +
|
|
" diff = moment().valueOf() - response.UnixEpoc;\r\n " +
|
|
" if (diff > 2592000000) // 30 Days\r\n " +
|
|
" spanClasses = \'error\';\r\n " +
|
|
" else if (diff > 604800000) // 7 Days\r\n " +
|
|
" spanClasses = \'alert\';\r\n " +
|
|
" span.removeClass(\'alert error\').addClass(spanClasses)." +
|
|
"attr(\'title\', response.Formatted).text(response.Formatted).livestamp(response.Un" +
|
|
"ixEpoc);\r\n }\r\n " +
|
|
" });\r\n window.setTimeout(" +
|
|
"function () {\r\n if (!updated) {\r\n " +
|
|
" spanProgress = $(\'<i>\').addClass(\'aj" +
|
|
"axLoading showInitially\').attr(\'title\', \'Loading...\').appendTo(span);\r\n " +
|
|
" }\r\n }," +
|
|
" 250);\r\n });\r\n " +
|
|
" </script>\r\n");
|
|
|
|
|
|
#line 162 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </tr>\r\n </table>\r\n </di" +
|
|
"v>\r\n <div");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 167 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 167 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
var assignedUser = Model.Device.AssignedUser;
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td>Assignment:\r\n " +
|
|
" </td>\r\n <td>\r\n");
|
|
|
|
|
|
#line 175 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 175 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (assignedUser != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_DisplayName\"");
|
|
|
|
WriteLiteral(" title=\"Display Name\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 179 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 179 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.User.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 181 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(assignedUser.DisplayName, MVC.User.Show(assignedUser.Id)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 181 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 185 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.DisplayName);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 185 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n " +
|
|
" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Id\"");
|
|
|
|
WriteLiteral(" title=\"Id\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 188 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 189 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 189 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.User.ShowDetails))
|
|
{
|
|
if (!string.IsNullOrWhiteSpace(assignedUser.PhoneNumber))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_PhoneNumber\"");
|
|
|
|
WriteLiteral(" title=\"Phone Number\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 193 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.PhoneNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</div>\r\n");
|
|
|
|
|
|
#line 194 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
if (!string.IsNullOrWhiteSpace(assignedUser.EmailAddress))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_EmailAddress\"");
|
|
|
|
WriteLiteral(" title=\"Email Address\"");
|
|
|
|
WriteLiteral("><a");
|
|
|
|
WriteAttribute("href", Tuple.Create(" href=\"", 11949), Tuple.Create("\"", 12004)
|
|
, Tuple.Create(Tuple.Create("", 11956), Tuple.Create("mailto:", 11956), true)
|
|
|
|
#line 197 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 11963), Tuple.Create<System.Object, System.Int32>(Model.Device.AssignedUser.EmailAddress
|
|
|
|
#line default
|
|
#line hidden
|
|
, 11963), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 197 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(assignedUser.EmailAddress);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</a></div>\r\n");
|
|
|
|
|
|
#line 198 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n");
|
|
|
|
|
|
#line 201 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">Not Assigned</span>\r\n");
|
|
|
|
|
|
#line 205 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n </div>\r\n");
|
|
|
|
|
|
#line 210 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 210 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Device.Actions.GenerateDocuments))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_GenerateDocument_Container\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 213 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.DropDownList("Device_Show_GenerateDocument", Model.DocumentTemplatesSelectListItems));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n v" +
|
|
"ar generatePdfUrl = \'");
|
|
|
|
|
|
#line 216 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.Device.GeneratePdf(Model.Device.SerialNumber.ToString(), null)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"?DocumentTemplateId=';
|
|
var $documentTemplates = $('#Device_Show_GenerateDocument');
|
|
$documentTemplates.change(function () {
|
|
var v = $documentTemplates.val();
|
|
if (v) {
|
|
window.location.href = generatePdfUrl + v;
|
|
$documentTemplates.val('').blur();
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
</div>
|
|
");
|
|
|
|
|
|
#line 228 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n </td>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies\"");
|
|
|
|
WriteLiteral(" rowspan=\"2\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile\"");
|
|
|
|
WriteLiteral(">\r\n <h2");
|
|
|
|
WriteLiteral(" title=\"Device Profile\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 234 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceProfile.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 236 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceProfile.Name, MVC.Config.DeviceProfile.Index(Model.Device.DeviceProfileId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 236 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 240 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 240 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h2>\r\n <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Distribution Type\"");
|
|
|
|
WriteLiteral(">Distribution:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 246 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.DistributionType.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Address\"");
|
|
|
|
WriteLiteral(">Address:</span>\r\n </td>\r\n " +
|
|
"<td>");
|
|
|
|
|
|
#line 252 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
if (Model.DeviceProfileDefaultOrganisationAddress != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Address\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 255 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.DeviceProfileDefaultOrganisationAddress.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</span>\r\n");
|
|
|
|
|
|
#line 256 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <span");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Address_None\"");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(">None</span>\r\n");
|
|
|
|
|
|
#line 260 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Provision Active Directory Account\"");
|
|
|
|
WriteLiteral(">Provision Account:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 267 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfile.ProvisionADAccount ? "Active Directory" : "No");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Allocate Certificates\"");
|
|
|
|
WriteLiteral(">Allocate Certificate:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 273 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.DeviceProfileCertificateProvider != null ? Model.DeviceProfileCertificateProvider.Name : "No");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 277 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 277 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateDeviceProfile())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 279 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Profile_Actions_Update_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 279 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Profile_Actions_Update_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign to Device Profile\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 284 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 284 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n " +
|
|
" <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteLiteral(" data-deviceprofileid=\"");
|
|
|
|
|
|
#line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(dp.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" name=\"DeviceProfile\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 17177), Tuple.Create("\"", 17204)
|
|
, Tuple.Create(Tuple.Create("", 17182), Tuple.Create("DeviceProfile_", 17182), true)
|
|
|
|
#line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 17196), Tuple.Create<System.Object, System.Int32>(dp.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 17196), false)
|
|
);
|
|
|
|
WriteLiteral(" /><label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 17214), Tuple.Create("\"", 17242)
|
|
, Tuple.Create(Tuple.Create("", 17220), Tuple.Create("DeviceProfile_", 17220), true)
|
|
|
|
#line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 17234), Tuple.Create<System.Object, System.Int32>(dp.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 17234), false)
|
|
);
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 17243), Tuple.Create("\"", 17287)
|
|
, Tuple.Create(Tuple.Create("", 17251), Tuple.Create("Distribution:", 17251), true)
|
|
|
|
#line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create(" ", 17264), Tuple.Create<System.Object, System.Int32>(dp.DistributionType
|
|
|
|
#line default
|
|
#line hidden
|
|
, 17265), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 287 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(dp.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label></li> \r\n");
|
|
|
|
|
|
#line 288 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n " +
|
|
" </div>\r\n");
|
|
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n " +
|
|
" var currentProfile = \'");
|
|
|
|
|
|
#line 294 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceProfileId);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n var button = $(\'#Device_Show_Policies_Profile" +
|
|
"_Actions_Update_Button\');\r\n var buttonDialog = nu" +
|
|
"ll;\r\n var dialogInputs = null;\r\n " +
|
|
" var dialogContainers = null;\r\n\r\n b" +
|
|
"utton.click(function () {\r\n\r\n if (!buttonDial" +
|
|
"og) {\r\n buttonDialog = $(\'#Device_Show_Po" +
|
|
"licies_Profile_Actions_Update_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n " +
|
|
" maxHeight: 450,\r\n " +
|
|
" autoOpen: false,\r\n " +
|
|
" buttons: {\r\n " +
|
|
" \"Update Profile\": function () {\r\n " +
|
|
" var deviceProfileId = dialogInputs.f" +
|
|
"ilter(\':checked\').attr(\'data-deviceprofileid\');\r\n\r\n " +
|
|
" if (deviceProfileId) {\r\n " +
|
|
" var $this = $(thi" +
|
|
"s);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
" window.location.hre" +
|
|
"f = button.attr(\'href\') + \'&DeviceProfileId=\' + deviceProfileId;\r\n " +
|
|
" } else {\r\n " +
|
|
" alert(\'A device " +
|
|
"profile must be selected\');\r\n " +
|
|
" }\r\n " +
|
|
" },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n " +
|
|
" }\r\n " +
|
|
" });\r\n dialogInputs = buttonDialog.find" +
|
|
"(\'input\');\r\n dialogContainers = dialogInp" +
|
|
"uts.closest(\'li\');\r\n\r\n dialogInputs.chang" +
|
|
"e(function () {\r\n dialogContainers.re" +
|
|
"moveClass(\'selected\');\r\n $(this).clos" +
|
|
"est(\'li\').addClass(\'selected\');\r\n });\r\n " +
|
|
" }\r\n\r\n dialo" +
|
|
"gInputs.filter(\'[data-deviceprofileid=\' + currentProfile + \']\').prop(\'checked\', " +
|
|
"true).change();\r\n\r\n buttonDialog.dialog(\'open" +
|
|
"\');\r\n return false;\r\n " +
|
|
" });\r\n\r\n });\r\n </script" +
|
|
">\r\n");
|
|
|
|
|
|
#line 344 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Batch\"");
|
|
|
|
WriteLiteral(" class=\"status\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 347 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 347 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.DeviceBatchId.HasValue)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2");
|
|
|
|
WriteLiteral(" title=\"Device Batch\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 349 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceBatch.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 351 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 351 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 355 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 355 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h2>\r\n");
|
|
|
|
WriteLiteral(" <table");
|
|
|
|
WriteLiteral(" class=\"none verticalHeadings\"");
|
|
|
|
WriteLiteral(">\r\n <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Purchased Date\"");
|
|
|
|
WriteLiteral(">Purchased:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 361 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Supplier\"");
|
|
|
|
WriteLiteral(">Supplier:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 367 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.Supplier ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Warranty Valid Until\"");
|
|
|
|
WriteLiteral(">Warranty Until:</span>\r\n </td>\r\n " +
|
|
" <td");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 22759), Tuple.Create("\"", 22907)
|
|
|
|
#line 373 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 22767), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null
|
|
|
|
#line default
|
|
#line hidden
|
|
, 22767), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 373 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Insurance Supplier\"");
|
|
|
|
WriteLiteral(">Insurance Supplier:</span>\r\n </td>\r\n " +
|
|
" <td>");
|
|
|
|
|
|
#line 379 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatch.InsuranceSupplier ?? "Unknown");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" <tr>\r\n <td><span");
|
|
|
|
WriteLiteral(" title=\"Insured Until\"");
|
|
|
|
WriteLiteral(">Insured Until:</span>\r\n </td>\r\n " +
|
|
" <td");
|
|
|
|
WriteAttribute("class", Tuple.Create(" class=\"", 23609), Tuple.Create("\"", 23745)
|
|
|
|
#line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 23617), Tuple.Create<System.Object, System.Int32>(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null
|
|
|
|
#line default
|
|
#line hidden
|
|
, 23617), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 385 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n </td>\r\n </tr>\r\n " +
|
|
" </table>\r\n");
|
|
|
|
|
|
#line 389 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <h2>Batch: <em>Not Associated</em></h2>\r\n");
|
|
|
|
|
|
#line 393 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 394 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateDeviceBatch())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 396 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 396 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Policies_Batch_Actions_Update_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign to Device Batch\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 401 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 401 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n " +
|
|
" <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteLiteral(" data-devicebatchid=\"");
|
|
|
|
|
|
#line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(db.Id);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\"");
|
|
|
|
WriteLiteral(" name=\"DeviceBatch\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 24895), Tuple.Create("\"", 24920)
|
|
, Tuple.Create(Tuple.Create("", 24900), Tuple.Create("DeviceBatch_", 24900), true)
|
|
|
|
#line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 24912), Tuple.Create<System.Object, System.Int32>(db.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24912), false)
|
|
);
|
|
|
|
WriteLiteral(" /><label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 24930), Tuple.Create("\"", 24956)
|
|
, Tuple.Create(Tuple.Create("", 24936), Tuple.Create("DeviceBatch_", 24936), true)
|
|
|
|
#line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 24948), Tuple.Create<System.Object, System.Int32>(db.Id
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24948), false)
|
|
);
|
|
|
|
WriteAttribute("title", Tuple.Create(" title=\"", 24957), Tuple.Create("\"", 25013)
|
|
, Tuple.Create(Tuple.Create("", 24965), Tuple.Create("Purchased:", 24965), true)
|
|
|
|
#line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create(" ", 24975), Tuple.Create<System.Object, System.Int32>(db.PurchaseDate.ToLongDateString()
|
|
|
|
#line default
|
|
#line hidden
|
|
, 24976), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 404 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(db.Name);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label></li> \r\n");
|
|
|
|
|
|
#line 405 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n " +
|
|
" </div>\r\n");
|
|
|
|
WriteLiteral(" <script>\r\n $(function () {\r\n " +
|
|
" var currentBatch = \'");
|
|
|
|
|
|
#line 411 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceBatchId);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n var button = $(\'#Device_Show_Policies_Batch_A" +
|
|
"ctions_Update_Button\');\r\n var buttonDialog = null" +
|
|
";\r\n var dialogInputs = null;\r\n " +
|
|
" var dialogContainers = null;\r\n\r\n but" +
|
|
"ton.click(function () {\r\n\r\n if (!buttonDialog" +
|
|
") {\r\n buttonDialog = $(\'#Device_Show_Poli" +
|
|
"cies_Batch_Actions_Update_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n " +
|
|
" maxHeight: 450,\r\n " +
|
|
" autoOpen: false,\r\n " +
|
|
" buttons: {\r\n " +
|
|
" \"Update Batch\": function () {\r\n " +
|
|
" var deviceBatchId = dialogInputs.filter(\':" +
|
|
"checked\').attr(\'data-devicebatchid\');\r\n\r\n " +
|
|
" if (deviceBatchId) {\r\n " +
|
|
" var $this = $(this);\r\n " +
|
|
" $this.dialo" +
|
|
"g(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", \"buttons\", null);\r\n " +
|
|
" window.location.href = button.a" +
|
|
"ttr(\'href\') + \'&DeviceBatchId=\' + deviceBatchId;\r\n " +
|
|
" } else {\r\n " +
|
|
" alert(\'A device batch must be se" +
|
|
"lected\');\r\n " +
|
|
" }\r\n },\r\n " +
|
|
" Cancel: functi" +
|
|
"on () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n " +
|
|
" }\r\n });\r\n " +
|
|
" dialogInputs = buttonDialog.find(\'input\');\r\n " +
|
|
" dialogContainers = dialogInputs.closest(\'li\');" +
|
|
"\r\n\r\n dialogInputs.change(function () {\r\n " +
|
|
" dialogContainers.removeClass(\'selecte" +
|
|
"d\');\r\n $(this).closest(\'li\').addClass" +
|
|
"(\'selected\');\r\n });\r\n " +
|
|
" }\r\n\r\n dialogInputs.filter(\'[d" +
|
|
"ata-devicebatchid=\' + currentBatch + \']\').prop(\'checked\', true).change();\r\n\r\n " +
|
|
" buttonDialog.dialog(\'open\');\r\n " +
|
|
" return false;\r\n });\r\n\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 461 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </div>\r\n </div>\r\n </td>\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects\"");
|
|
|
|
WriteLiteral(" rowspan=\"2\"");
|
|
|
|
WriteLiteral(">\r\n <div>\r\n <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model\"");
|
|
|
|
WriteLiteral(" class=\"clearfix\"");
|
|
|
|
WriteLiteral(">\r\n <h2");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model_Description\"");
|
|
|
|
WriteLiteral(" title=\"Model Description\"");
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 468 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Authorization.Has(Claims.Config.DeviceModel.Show))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 470 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId)));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 470 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
else
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 474 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.DeviceModel.ToString());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 474 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</h2>\r\n <img");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\"");
|
|
|
|
WriteLiteral(" alt=\"Model Image\"");
|
|
|
|
WriteAttribute("src", Tuple.Create(" src=\"", 29908), Tuple.Create("\"", 30018)
|
|
|
|
#line 476 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 29914), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash()))
|
|
|
|
#line default
|
|
#line hidden
|
|
, 29914), false)
|
|
);
|
|
|
|
WriteLiteral(" />\r\n </div>\r\n </div>\r\n </td>\r\n </tr>\r\n <t" +
|
|
"r");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Subjects_Actions\"");
|
|
|
|
WriteLiteral(">\r\n <td");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanCreateJob())
|
|
{
|
|
Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob");
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 486 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 486 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 488 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateAssignment())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 490 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Update Assignment", MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, null, true), "Device_Show_User_Actions_Assign_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 490 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Actions_Assign_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Assign this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <h4><i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle information\"");
|
|
|
|
WriteLiteral("></i> Assign to User:</h4>\r\n <br />\r\n " +
|
|
"<input");
|
|
|
|
WriteLiteral(" id=\"Device_Show_User_Actions_Assign_UserId\"");
|
|
|
|
WriteLiteral(" type=\"text\"");
|
|
|
|
WriteLiteral(" />\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_User_Actions_Assign_Button');
|
|
var buttonDialog = null;
|
|
var inputUserId = null;
|
|
|
|
var dialogButtons = {
|
|
");
|
|
|
|
|
|
#line 503 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 503 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
if (assignedUser != null)
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
WriteLiteral(@"
|
|
""Unassign"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = button.attr('href');
|
|
},
|
|
");
|
|
|
|
WriteLiteral("\r\n");
|
|
|
|
|
|
#line 514 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\r\n \"Assign\": function () {\r\n " +
|
|
" var $this = $(this);\r\n var userId = inputUs" +
|
|
"erId.val();\r\n if (userId) {\r\n " +
|
|
" $this.dialog(\"disable\");\r\n $t" +
|
|
"his.dialog(\"option\", \"buttons\", null);\r\n wind" +
|
|
"ow.location.href = button.attr(\'href\') + \'&AssignedUserId=\' + userId;\r\n " +
|
|
" } else {\r\n alert(\'Ente" +
|
|
"r a user to assign this device\');\r\n }\r\n " +
|
|
" },\r\n Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n }" +
|
|
"\r\n }\r\n\r\n button.click(function () " +
|
|
"{\r\n if (!buttonDialog) {\r\n " +
|
|
" buttonDialog = $(\'#Device_Show_User_Actions_Assign_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" height: 180,\r\n " +
|
|
" modal: true,\r\n " +
|
|
"autoOpen: false,\r\n button" +
|
|
"s: dialogButtons\r\n });\r\n " +
|
|
" inputUserId = $(\'#Device_Show_User_Actions_Assign_Use" +
|
|
"rId\');\r\n inputUserId.focus(function () { inputUse" +
|
|
"rId.select() })\r\n .autocomplete({\r\n " +
|
|
" source: \'");
|
|
|
|
|
|
#line 545 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Url.Action(MVC.API.User.UpstreamUsers()));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"',
|
|
minLength: 2,
|
|
select: function (e, ui) {
|
|
inputUserId.val(ui.item.Id);
|
|
return false;
|
|
}
|
|
});
|
|
inputUserId.data('ui-autocomplete')._renderItem = function (ul, item) {
|
|
return $(""<li>"")
|
|
.data(""item.autocomplete"", item)
|
|
.append(""<a><strong>"" + item.DisplayName + ""</strong><br>"" + item.Id + "" ("" + item.Type + "")</a>"")
|
|
.appendTo(ul);
|
|
};
|
|
}
|
|
buttonDialog.dialog('open');
|
|
inputUserId.focus();
|
|
return false;
|
|
});
|
|
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 566 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 567 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateTrustEnrol())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 569 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 569 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_TrustEnrol_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Trust this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"ui-widget\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"ui-state-highlight ui-corner-all\"");
|
|
|
|
WriteLiteral(" style=\"padding: 6px;\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" style=\"padding-bottom: 6px;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral("></i> \r\n This action will allow a device <em>" +
|
|
"claiming</em> to have the Serial Number \'");
|
|
|
|
|
|
#line 575 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.SerialNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(@"' to be enrolled without authentication.
|
|
</div>
|
|
<strong>Are you sure you want to allow an unauthenticated enrolment?</strong>
|
|
</div>
|
|
</div>
|
|
<div");
|
|
|
|
WriteLiteral(" class=\"smallMessage\"");
|
|
|
|
WriteLiteral(" style=\"margin-top: 10px; font-size: 1em;\"");
|
|
|
|
WriteLiteral(@">
|
|
Devices flagged as 'trusted' are allowed a single-use device enrolment without providing authentication (for example: Active Directory Computer Account).<br />
|
|
Once a devices enrol, their trust setting is reset and additional enrolments need to be authenticated (domain joined) or manually trusted again.
|
|
</div>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_TrustEnrol_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_TrustEnrol_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
width: 400,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Trust"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 614 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 615 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanUpdateUntrustEnrol())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 617 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 617 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_UntrustEnrol_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Untrust this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" style=\"padding-bottom: 6px;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-info-circle information\"");
|
|
|
|
WriteLiteral(@"></i> This action will require the device to enrol with authentication (for example: domain joined).
|
|
</div>
|
|
<strong>Are you sure you want to require an authenticated enrolment?</strong>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_UntrustEnrol_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_UntrustEnrol_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
width: 400,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Untrust"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 653 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 654 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanDecommission())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 656 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 656 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Decommission_Dialog\"");
|
|
|
|
WriteLiteral(" class=\"dialog\"");
|
|
|
|
WriteLiteral(" title=\"Device Decommissioning\"");
|
|
|
|
WriteLiteral(">\r\n <div");
|
|
|
|
WriteLiteral(" class=\"clearfix\"");
|
|
|
|
WriteLiteral(" style=\"margin-bottom: 10px;\"");
|
|
|
|
WriteLiteral(">\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-question-circle fa-lg information\"");
|
|
|
|
WriteLiteral("></i> Why was this Device Decommissioned?\r\n </div>\r\n " +
|
|
" <div>\r\n <ul");
|
|
|
|
WriteLiteral(" class=\"none\"");
|
|
|
|
WriteLiteral(">\r\n");
|
|
|
|
|
|
#line 663 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 663 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
foreach (Device.DecommissionReasons decommissionReason in Enum.GetValues(typeof(Device.DecommissionReasons)))
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <li>\r\n <input");
|
|
|
|
WriteLiteral(" type=\"radio\"");
|
|
|
|
WriteAttribute("id", Tuple.Create(" id=\"", 41139), Tuple.Create("\"", 41217)
|
|
, Tuple.Create(Tuple.Create("", 41144), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 41144), true)
|
|
|
|
#line 666 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 41191), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 41191), false)
|
|
);
|
|
|
|
WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Decomm" +
|
|
"ission_Reason\"");
|
|
|
|
WriteAttribute("value", Tuple.Create(" value=\"", 41313), Tuple.Create("\"", 41347)
|
|
|
|
#line 667 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 41321), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 41321), false)
|
|
);
|
|
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 667 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write((decommissionReason == Device.DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("/>\r\n <label");
|
|
|
|
WriteAttribute("for", Tuple.Create(" for=\"", 41497), Tuple.Create("\"", 41576)
|
|
, Tuple.Create(Tuple.Create("", 41503), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 41503), true)
|
|
|
|
#line 668 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
, Tuple.Create(Tuple.Create("", 41550), Tuple.Create<System.Object, System.Int32>((int)decommissionReason
|
|
|
|
#line default
|
|
#line hidden
|
|
, 41550), false)
|
|
);
|
|
|
|
WriteLiteral(">");
|
|
|
|
|
|
#line 668 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(decommissionReason.ReasonMessage());
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("</label>\r\n </li>\r\n");
|
|
|
|
|
|
#line 670 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </ul>\r\n </div>\r\n </div>" +
|
|
"\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(">\r\n $(function () {\r\n var button = $(\'#" +
|
|
"Device_Show_Device_Actions_Decommission_Button\');\r\n var b" +
|
|
"uttonDialog = null;\r\n var deviceSerialNumber = \'");
|
|
|
|
|
|
#line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Model.Device.SerialNumber);
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\r\n " +
|
|
" if (!buttonDialog) {\r\n buttonDialog = $(\'#" +
|
|
"Device_Show_Device_Actions_Decommission_Dialog\')\r\n " +
|
|
" .dialog({\r\n " +
|
|
" resizable: false,\r\n " +
|
|
" modal: true,\r\n autoOp" +
|
|
"en: false,\r\n buttons: {\r\n" +
|
|
" \"Decommission\": func" +
|
|
"tion () {\r\n\r\n var" +
|
|
" reasonId = buttonDialog.find(\'input:checked\').val();\r\n\r\n " +
|
|
" var $this = $(this);\r\n " +
|
|
" $this.dialog(\"disable\");\r\n " +
|
|
" $this.dialog(\"option\", " +
|
|
"\"buttons\", null);\r\n\r\n " +
|
|
" var url = button.attr(\'href\') + \'/\' + deviceSerialNumber + \'?Reason=\' + rea" +
|
|
"sonId + \'&redirect=True\';\r\n\r\n " +
|
|
" window.location.href = url;\r\n " +
|
|
" },\r\n " +
|
|
" Cancel: function () {\r\n " +
|
|
" $(this).dialog(\"close\");\r\n " +
|
|
" }\r\n }\r" +
|
|
"\n });\r\n " +
|
|
" }\r\n\r\n buttonDialog.dialog(\'open\');\r\n " +
|
|
" return false;\r\n });\r\n\r\n " +
|
|
" });\r\n </script>\r\n");
|
|
|
|
|
|
#line 714 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 715 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanRecommission())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 717 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 717 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Recommission_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Recommission this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral("></i> Are you sure?\r\n </p>\r\n </div>\r\n");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_Recommission_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_Recommission_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
height: 140,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Recommission"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 752 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" ");
|
|
|
|
|
|
#line 753 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
if (Model.Device.CanDelete())
|
|
{
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button"));
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
|
|
#line 755 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" <div");
|
|
|
|
WriteLiteral(" id=\"Device_Show_Device_Actions_Delete_Dialog\"");
|
|
|
|
WriteLiteral(" title=\"Delete this Device?\"");
|
|
|
|
WriteLiteral(">\r\n <p>\r\n <i");
|
|
|
|
WriteLiteral(" class=\"fa fa-exclamation-triangle fa-lg\"");
|
|
|
|
WriteLiteral(@"></i>
|
|
This item will be permanently deleted and cannot be recovered.<br />
|
|
Jobs linked to this Device (but not to a User) will be deleted also.<br />
|
|
Are you sure?
|
|
</p>
|
|
</div>
|
|
");
|
|
|
|
WriteLiteral(" <script");
|
|
|
|
WriteLiteral(" type=\"text/javascript\"");
|
|
|
|
WriteLiteral(@">
|
|
$(function () {
|
|
var button = $('#Device_Show_Device_Actions_Delete_Button');
|
|
var buttonDialog = $('#Device_Show_Device_Actions_Delete_Dialog');
|
|
var buttonLink = button.attr('href');
|
|
button.attr('href', '#');
|
|
button.click(function () {
|
|
buttonDialog.dialog('open');
|
|
return false;
|
|
});
|
|
buttonDialog.dialog({
|
|
resizable: false,
|
|
height: 200,
|
|
modal: true,
|
|
autoOpen: false,
|
|
buttons: {
|
|
""Delete"": function () {
|
|
var $this = $(this);
|
|
$this.dialog(""disable"");
|
|
$this.dialog(""option"", ""buttons"", null);
|
|
window.location.href = buttonLink;
|
|
},
|
|
Cancel: function () {
|
|
$(this).dialog(""close"");
|
|
}
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
");
|
|
|
|
|
|
#line 793 "..\..\Views\Device\DeviceParts\_Subject.cshtml"
|
|
}
|
|
|
|
|
|
#line default
|
|
#line hidden
|
|
WriteLiteral(" </td>\r\n </tr>\r\n</table>\r\n");
|
|
|
|
}
|
|
}
|
|
}
|
|
#pragma warning restore 1591
|