#pragma warning disable 1591 //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace Disco.Web.Areas.Config.Views.DeviceBatch { using System; using System.Collections.Generic; using System.IO; using System.Linq; using System.Net; using System.Text; using System.Web; using System.Web.Helpers; using System.Web.Mvc; using System.Web.Mvc.Ajax; using System.Web.Mvc.Html; using System.Web.Routing; using System.Web.Security; using System.Web.UI; using System.Web.WebPages; using Disco; using Disco.Models.Repository; using Disco.Services; using Disco.Services.Authorization; #line 2 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" using Disco.Services.Devices.ManagedGroups; #line default #line hidden using Disco.Services.Web; using Disco.Web; #line 3 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" using Disco.Web.Areas.Config.Models.Shared; #line default #line hidden using Disco.Web.Extensions; [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/DeviceBatch/Show.cshtml")] public partial class Show : Disco.Services.Web.WebViewPage { public Show() { } public override void Execute() { #line 4 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Authorization.Require(Claims.Config.DeviceBatch.Show); ViewBag.Title = Html.ToBreadcrumb("Configuration", MVC.Config.Config.Index(), "Device Batches", MVC.Config.DeviceBatch.Index(null), Model.DeviceBatch.ToString()); var canConfig = Authorization.Has(Claims.Config.DeviceBatch.Configure); var canDeviceModelShow = Authorization.Has(Claims.Config.DeviceModel.Show); var hideAdvanced = Model.DeviceBatch.AssignedUsersLinkedGroup == null && Model.DeviceBatch.DevicesLinkedGroup == null; Html.BundleDeferred("~/Style/Shadowbox"); Html.BundleDeferred("~/ClientScripts/Modules/Shadowbox"); Html.BundleDeferred("~/ClientScripts/Modules/jQuery-SignalR"); if (canConfig) { Html.BundleDeferred("~/ClientScripts/Modules/Disco-PropertyChangeHelpers"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AjaxHelperIcons"); Html.BundleDeferred("~/ClientScripts/Modules/tinymce"); Html.BundleDeferred("~/ClientScripts/Modules/Disco-AttachmentUploader"); } #line default #line hidden WriteLiteral("\r\n(hideAdvanced ? " Config_HideAdvanced" : null #line default #line hidden , 1250), false) ); WriteLiteral(" style=\"width: 730px\""); WriteLiteral(">\r\n \r\n \r\n \r\n Id:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n "); #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" foreach (var membership in Model.DeviceModelMembers.OrderByDescending(dmm => dmm.DeviceCount)) { #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); WriteLiteral(" "); #line 129 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n \r\n " + "\r\n \r\n"); #line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n " + " \r\n \r\n \r\n \r\n \r\n \r\n " + "
\r\n"); WriteLiteral(" "); #line 35 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceBatch.Id)); #line default #line hidden WriteLiteral("\r\n
\r\n " + " Name:\r\n \r\n"); #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Name)); #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 46 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 47 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Name'), 'Invalid Name', '"); #line 53 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateName(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'BatchName\'\r\n );\r\n " + " });\r\n \r\n"); #line 58 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Name); #line default #line hidden #line 61 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n " + " Default Device Model:\r\n \r\n"); #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))); #line default #line hidden #line 72 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 73 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 74 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n $(function () {\r\n document.DiscoFun" + "ctions.PropertyChangeHelper(\r\n $(\'#DeviceBatch_Defaul" + "tDeviceModelId\'),\r\n null,\r\n " + " \'"); #line 80 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateDefaultDeviceModelId(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'DefaultDeviceModelId\'\r\n )" + ";\r\n });\r\n \r\n"); #line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (Model.DefaultDeviceModel == null) { #line default #line hidden WriteLiteral("<None Specified>"); #line 89 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DefaultDeviceModel.ToString()); #line default #line hidden #line 91 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral("
\r\n Devices added offline will default to this Device Model. Once a device enrols the Device Model will be accurately represented.
Devices "); #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceModelMembers.Count > 0) { #line default #line hidden WriteLiteral("
Model Device Count Decommissioned
\r\n"); #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canDeviceModelShow) { #line default #line hidden #line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))); #line default #line hidden #line 121 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceModel.ToString()); #line default #line hidden #line 125 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" "); #line 132 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n
Total Models: "); #line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceModelMembers.Count.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 140 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 141 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("
\r\n"); #line 145 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" No device models are referenced in this batch.\r\n"); #line 149 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceBatch.UnitQuantity.HasValue && Model.DeviceBatch.UnitQuantity.Value > Model.DeviceCount) { var missingCount = Model.DeviceBatch.UnitQuantity.Value - Model.DeviceCount; #line default #line hidden WriteLiteral(" \r\n \r\n \r\n"); WriteLiteral(" "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(" of "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden WriteLiteral(" purchased devices are managed by Disco. "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 156 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount == 1 ? "is" : "are"); #line default #line hidden WriteLiteral(" not managed.\r\n

\r\n \r" + "\n"); #line 159 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Purchase:\r\n \r\n \r\n \r\n \r\n \r\n Purchase Date:\r\n \r\n " + " \r\n"); #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 173 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 175 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 176 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 190 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 193 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Supplier:\r\n " + " \r\n \r\n"); #line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 202 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Supplier)); #line default #line hidden #line 204 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 205 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 206 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Supplier'), 'Batch Supplier', '"); #line 212 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateSupplier(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'Supplier\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 217 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 221 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Supplier); #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Unit Cost:\r\n " + " \r\n \r\n"); #line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 232 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); #line default #line hidden #line 234 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 236 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitCost'), 'Unit Cost', '"); #line 242 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitCost(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'UnitCost\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 247 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitCost.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitCost.Value.ToString("C")); #line default #line hidden #line 253 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Quantity:\r\n " + " \r\n \r\n"); #line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 262 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); #line default #line hidden #line 264 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 265 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 266 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitQuantity'), 'Quantity', '"); #line 272 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateUnitQuantity(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'UnitQuantity\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 277 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitQuantity.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 281 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden #line 283 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 290 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 292 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 294 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_PurchaseDetails'), fieldName: 'PurchaseDetails', $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajax' + model.fieldName + '_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajax' + model.fieldName + '_ok'); model.$ajax_loading.show(); var data = {}; data[model.fieldName] = model.$field.tinymce().getContent(); $.ajax({ url: '"); #line 311 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdatePurchaseDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update purchase details:" + " \' + d);\r\n }\r\n " + " },\r\n error: " + "function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update purchase details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_trig" + "ger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n se" + "tup: function (ed) {\r\n ed.on(\'init\', func" + "tion () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 346 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 350 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " \r\n Warranty:\r\n \r\n \r\n \r\n \r\n \r\n Valid Until:\r\n \r\n " + " \r\n"); #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 368 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)); #line default #line hidden #line 370 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 371 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 385 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown")); #line default #line hidden #line 388 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 395 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxWarrantyDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 397 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 397 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 399 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 399 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_WarrantyDetails'), fieldName: 'WarrantyDetails', $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajax' + model.fieldName + '_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajax' + model.fieldName + '_ok'); model.$ajax_loading.show(); var data = {}; data[model.fieldName] = model.$field.tinymce().getContent(); $.ajax({ url: '"); #line 416 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateWarrantyDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update warranty details:" + " \' + d);\r\n }\r\n " + " },\r\n error: " + "function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update warranty details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_trig" + "ger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n se" + "tup: function (ed) {\r\n ed.on(\'init\', func" + "tion () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 451 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 455 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " \r\n Insurance:\r\n \r\n \r\n \r\n \r\n \r\n Supplier:\r\n \r\n " + " \r\n"); #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)); #line default #line hidden #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 476 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 477 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_InsuranceSupplier'), 'Insurance Supplier', '"); #line 483 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceSupplier(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n \'InsuranceSupplier\'\r\n " + " );\r\n });\r\n " + " \r\n"); #line 488 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 492 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.InsuranceSupplier); #line default #line hidden #line 494 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Insured Date:\r\n \r\n " + " \r\n"); #line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 504 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate)); #line default #line hidden #line 506 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 507 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 521 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")); #line default #line hidden #line 524 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n Insured Until:\r\n \r\n " + " \r\n"); #line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 533 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil)); #line default #line hidden #line 535 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 536 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 550 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")); #line default #line hidden #line 553 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 560 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 562 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 564 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_InsuranceDetails'), $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajaxInsuranceDetails_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajaxInsuranceDetails_ok'); model.$ajax_loading.show(); var data = { InsuranceDetails: model.$field.tinymce().getContent() }; $.ajax({ url: '"); #line 579 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateInsuranceDetails(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " traditional: true,\r\n type: \'PO" + "ST\',\r\n success: function (d) {\r\n " + " if (d == \'OK\') {\r\n " + " model.$ajax_loading.hide();\r\n " + " model.$ajax_ok.show().delay(\'fast\').fadeOut(\'s" + "low\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update insurance details" + ": \' + d);\r\n }\r\n " + " },\r\n error:" + " function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to update insurance details: \' + errorThrown);\r\n " + " model.$ajax_loading.hide();\r\n " + " }\r\n " + "})\r\n }\r\n };\r\n\r" + "\n model.$field.tinymce({\r\n " + " theme: \'simple\',\r\n add_unload_tr" + "igger: false,\r\n schema: \"html5\",\r\n " + " statusbar: false,\r\n " + "setup: function (ed) {\r\n ed.on(\'init\', fu" + "nction () {\r\n $(ed.getWin()).blur(mod" + "el.updated);\r\n });\r\n " + " }\r\n });\r\n " + " });\r\n \r\n"); #line 614 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 618 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 620 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " \r\n Comments:
\r\n"); WriteLiteral(" "); #line 628 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxComments")); #line default #line hidden WriteLiteral("\r\n \r\n \r\n"); #line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 631 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Comments)); #line default #line hidden #line 633 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { var model = { $field: $('#DeviceBatch_Comments'), $ajax_loading: null, $ajax_ok: null, updated: function () { if (!model.$ajax_loading) model.$ajax_loading = $('#ajaxComments_loading'); if (!model.$ajax_ok) model.$ajax_ok = $('#ajaxComments_ok'); model.$ajax_loading.show(); var data = { Comments: model.$field.tinymce().getContent() }; $.ajax({ url: '"); #line 648 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.UpdateComments(Model.DeviceBatch.Id))); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n traditional: true" + ",\r\n type: \'POST\',\r\n " + " success: function (d) {\r\n if (d" + " == \'OK\') {\r\n model.$ajax_loading.hid" + "e();\r\n model.$ajax_ok.show().delay(\'f" + "ast\').fadeOut(\'slow\');\r\n } else {\r\n " + " model.$ajax_loading.hide();\r\n " + " alert(\'Unable to update comments: \' + d);\r\n " + " }\r\n },\r\n " + " error: function (jqXHR, textStatus, errorThrown" + ") {\r\n alert(\'Unable to update comments: \'" + " + errorThrown);\r\n model.$ajax_loading.hi" + "de();\r\n }\r\n })" + "\r\n }\r\n };\r\n\r\n " + " model.$field.tinymce({\r\n theme: \'simple\',\r\n " + " add_unload_trigger: false,\r\n " + " schema: \"html5\",\r\n statusbar: false,\r\n " + " setup: function (ed) {\r\n ed.on(\'ini" + "t\', function () {\r\n $(ed.getWin()).blur(model" + ".updated);\r\n });\r\n }\r\n" + " });\r\n });\r\n \r\n"); #line 683 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Comments)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.Comments)); #line default #line hidden #line 689 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Attachments:" + "\r\n \r\n (canConfig ? "canAddAttachments" : "cannotAddAttachments" #line default #line hidden , 35239), false) ); WriteLiteral(" data-uploadurl=\""); #line 696 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null))); #line default #line hidden WriteLiteral("\""); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 697 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden WriteLiteral("\r\n \r\n

Drop Attachments Here

\r\n \r\n \r\n"); #line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 702 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceBatch.DeviceBatchAttachments != null) { foreach (var attachment in Model.DeviceBatch.DeviceBatchAttachments) { #line default #line hidden WriteLiteral(" (Url.Action(MVC.API.DeviceBatch.AttachmentDownload(attachment.Id)) #line default #line hidden , 35927), false) ); WriteLiteral(" data-attachmentid=\""); #line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Id); #line default #line hidden WriteLiteral("\""); WriteLiteral(" data-mimetype=\""); #line 706 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.MimeType); #line default #line hidden WriteLiteral("\""); WriteLiteral(">\r\n (attachment.Filename #line default #line hidden , 36131), false) ); WriteLiteral(">\r\n (Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id)) #line default #line hidden , 36232), false) ); WriteLiteral(" />\r\n \r\n " + " (attachment.Comments #line default #line hidden , 36418), false) ); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 711 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Comments); #line default #line hidden WriteLiteral("\r\n "); #line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.TechUser.ToString()); #line default #line hidden WriteLiteral(""); #line 712 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral(""); #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("(attachment.Timestamp.ToFullDateTime() #line default #line hidden , 36752), false) ); WriteLiteral(" data-livestamp=\""); #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToUnixEpoc()); #line default #line hidden WriteLiteral("\""); WriteLiteral(">"); #line 713 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToFullDateTime()); #line default #line hidden WriteLiteral("\r\n \r\n"); #line 715 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n"); #line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 718 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" \r\n \r\n \r\n"); WriteLiteral(" \r\n

\r\n  Are you sure?\r\n

\r\n " + " \r\n"); #line 729 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" Shadowbox.init({ skipSetup: true, modal: true }); $(function () { var $Attachments = $('#DeviceBatch_Attachments'); var $attachmentOutput = $Attachments.find('.attachmentOutput'); var $attachmentDownloadHost; var $dialogRemoveAttachment = null; // Connect to Hub var hub = $.connection.deviceBatchUpdates; // Map Functions hub.client.addAttachment = onAddAttachment; hub.client.removeAttachment = onRemoveAttachment; $.connection.hub.qs = { DeviceBatchId: '"); #line 749 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Id); #line default #line hidden WriteLiteral("\' };\r\n\r\n $.connection.hub.reconnecting(function () {\r\n" + " $Attachments.find(\'span.action.enabled\').addClas" + "s(\'disabled\');\r\n });\r\n $.c" + "onnection.hub.reconnected(function () {\r\n $Attach" + "ments.find(\'span.action.enabled\').removeClass(\'disabled\');\r\n " + " });\r\n $.connection.hub.error(function (error)" + " {\r\n console.log(\'Server connection error: \' + er" + "ror);\r\n });\r\n $.connection" + ".hub.disconnected(function () {\r\n // Disable UI\r\n" + " $Attachments.find(\'span.action.enabled\').addClas" + "s(\'disabled\');\r\n\r\n // Show Dialog Message\r\n " + " if ($(\'.disconnected-dialog\').length == 0) {\r\n " + " $(\'
\')\r\n " + ".addClass(\'dialog disconnected-dialog\')\r\n " + " .html(\'

<" + "i class=\"fa fa-ban fa-stack-2x error\">Disconnected from the Disco ICT" + " Server

This page is not receiving live updates. Please ensure you are " + "connected to the server, then refresh this page to enable features.
\')\r\n " + " .dialog({\r\n " + " resizable: false,\r\n title" + ": \'Disconnected\',\r\n width: 400,\r\n " + " modal: true,\r\n " + " buttons: {\r\n \'R" + "efresh Now\': function () {\r\n " + "$(this).dialog(\'option\', \'buttons\', null);\r\n " + " window.location.reload(true);\r\n " + " },\r\n \'Close\': func" + "tion () {\r\n $(this).dialog(\'d" + "estroy\');\r\n }\r\n " + " }\r\n });\r\n " + " }\r\n });\r\n\r\n " + " // Start Connection\r\n $.connection.hub.st" + "art(function () {\r\n $Attachments.find(\'span.actio" + "n.enabled\').removeClass(\'disabled\');\r\n });\r\n\r\n " + " function onAddAttachment(id, quick) {\r\n " + " var data = { id: id };\r\n $.ajax({\r\n " + " url: \'"); #line 795 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.Attachment())); #line default #line hidden WriteLiteral(@"', dataType: 'json', data: data, success: function (d) { if (d.Result == 'OK') { var a = d.Attachment; "); #line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 801 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral(" "); WriteLiteral("buildAttachment(a, true, quick);"); WriteLiteral("\r\n"); #line 804 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" "); WriteLiteral("buildAttachment(a, false, quick);"); WriteLiteral("\r\n"); #line 808 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(@" } else { alert('Unable to add attachment: ' + d.Result); } }, error: function (jqXHR, textStatus, errorThrown) { alert('Unable to add attachment: ' + textStatus); } }); } function buildAttachment(a, canRemove, quick) { var t = ''; if (canRemove) t += ''; t += ''; var e = $(t); e.attr('data-attachmentid', a.Id).attr('data-mimetype', a.MimeType).attr('href', '"); #line 827 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentDownload())); #line default #line hidden WriteLiteral(@"/' + a.Id); e.find('.comments').text(a.Description); e.find('.author').text(a.Author); e.find('.timestamp').text(a.TimestampFull).attr('title', a.TimestampFull).livestamp(a.TimestampUnixEpoc); if (canRemove) e.find('.remove').click(removeAttachment); if (!quick) e.hide(); $attachmentOutput.append(e); if (!quick) e.show('slow'); if (a.MimeType.toLowerCase().indexOf('image/') == 0) e.shadowbox({ gallery: 'attachments', player: 'img', title: a.Description }); else e.click(onDownload); // Add Thumbnail var buildThumbnail = function () { var retryCount = 0; var img = e.find('.icon img'); var setThumbnailUrl = function () { img.attr('src', '"); #line 849 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail())); #line default #line hidden WriteLiteral("/\' + a.Id + \'?v=\' + retryCount);\r\n };\r\n " + " img.on(\'error\', function () {\r\n " + " img.addClass(\'loading\');\r\n " + " retryCount++;\r\n if (retryCount < 6)" + "\r\n window.setTimeout(setThumbnailUrl," + " retryCount * 250);\r\n });\r\n " + " img.on(\'load\', function () {\r\n " + " img.removeClass(\'loading\');\r\n });\r\n " + " window.setTimeout(setThumbnailUrl, 100);\r\n " + " };\r\n buildThumbnail()" + ";\r\n }\r\n\r\n function onRemov" + "eAttachment(id) {\r\n var a = $attachmentOutput.fin" + "d(\'a[data-attachmentid=\' + id + \']\');\r\n\r\n a.hide(" + "300).delay(300).queue(function () {\r\n var $th" + "is = $(this);\r\n if ($this.attr(\'data-mimetype" + "\').toLowerCase().indexOf(\'image/\') == 0)\r\n " + " Shadowbox.removeCache(this);\r\n $this.find(\'" + ".timestamp\').livestamp(\'destroy\');\r\n $this.re" + "move();\r\n });\r\n }\r\n\r\n " + " function onDownload() {\r\n " + " var $this = $(this);\r\n var url = $this.attr(\'" + "href\');\r\n\r\n if ($.connection && $.connection.hub " + "&& $.connection.hub.transport &&\r\n " + " $.connection.hub.transport.name == \'foreverFrame\') {\r\n " + " // SignalR active with foreverFrame transport - use popup window" + "\r\n window.open(url, \'_blank\', \'height=150,wid" + "th=250,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no\');" + "\r\n } else {\r\n " + "// use iFrame\r\n if (!$attachmentDownloadHost)" + " {\r\n $attachmentDownloadHost = $(\'\')\r\n .attr({ \'src\': url, \'title\': \'A" + "ttachment Download Host\' })\r\n .addCla" + "ss(\'hidden\')\r\n .appendTo(\'body\')\r\n " + " .contents();\r\n " + " } else {\r\n $attachmentDownload" + "Host[0].location.href = url;\r\n }\r\n " + " }\r\n\r\n return false;\r\n " + " }\r\n\r\n"); #line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 901 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral("\r\n //#region Add Attachments\r\n " + " var attachmentUploader = new document.Disco.AttachmentUploader($Attachments)" + ";\r\n\r\n var $attachmentInput = $Attachments.find(\'.atta" + "chmentInput\');\r\n if (window.location.protocol != \'htt" + "ps:\') {\r\n $attachmentInput.find(\'.photo\')\r\n " + " .removeClass(\'enabled\')\r\n " + " .addClass(\'disabled\')\r\n .attr(\'tit" + "le\', \'Capture Image: this functionality is only available over a HTTPS connectio" + "n\');\r\n }\r\n $attachmentInpu" + "t.find(\'.photo\').click(function () {\r\n if (!$(thi" + "s).hasClass(\'enabled\'))\r\n alert(\'This functio" + "nality is only available over a HTTPS connection\');\r\n " + " else if ($(this).hasClass(\'disabled\'))\r\n " + " alert(\'Disconnected from the Disco ICT Server, please refresh this page and try" + " again\');\r\n else\r\n " + " attachmentUploader.uploadImage();\r\n });\r\n " + " $attachmentInput.find(\'.upload\').click(function () {\r\n " + " if ($(this).hasClass(\'disabled\'))\r\n " + " alert(\'Disconnected from the Disco ICT Server, please refresh " + "this page and try again\');\r\n else\r\n " + " attachmentUploader.uploadFiles();\r\n " + " });\r\n //#endregion\r\n " + "//#region Remove Attachments\r\n $attachmentOutput.find" + "(\'span.remove\').click(removeAttachment);\r\n\r\n function" + " removeAttachment() {\r\n $this = $(this).closest(\'" + "a\');\r\n\r\n var data = { id: $this.attr(\'data-attach" + "mentid\') };\r\n\r\n if (!$dialogRemoveAttachment) {\r\n" + " $dialogRemoveAttachment = $(\'#dialogRemoveAt" + "tachment\').dialog({\r\n resizable: false,\r\n" + " height: 140,\r\n " + " modal: true,\r\n autoOpen: fa" + "lse\r\n });\r\n }\r" + "\n\r\n $dialogRemoveAttachment.dialog(\"enable\");\r\n " + " $dialogRemoveAttachment.dialog(\'option\', \'buttons\'" + ", {\r\n \"Remove\": function () {\r\n " + " $dialogRemoveAttachment.dialog(\"disable\");\r\n " + " $dialogRemoveAttachment.dialog(\"option\", \"buttons\"" + ", null);\r\n $.ajax({\r\n " + " url: \'"); #line 951 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentRemove())); #line default #line hidden WriteLiteral("\',\r\n dataType: \'json\',\r\n " + " data: data,\r\n " + " success: function (d) {\r\n " + "if (d == \'OK\') {\r\n // Do noth" + "ing, await SignalR notification\r\n " + " } else {\r\n alert(\'Unable to " + "remove attachment: \' + d);\r\n }\r\n " + " $dialogRemoveAttachment.dialog(\"c" + "lose\");\r\n },\r\n " + " error: function (jqXHR, textStatus, errorThrown) {\r\n " + " alert(\'Unable to remove attachment: \' +" + " textStatus);\r\n $dialogRemoveAtta" + "chment.dialog(\"close\");\r\n }\r\n " + " });\r\n },\r\n " + " Cancel: function () {\r\n " + " $dialogRemoveAttachment.dialog(\"close\");\r\n " + " }\r\n });\r\n\r\n " + " $dialogRemoveAttachment.dialog(\'open\');\r\n\r\n " + " return false;\r\n }\r\n //#" + "endregion\r\n "); #line 978 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(@" $attachmentOutput.children('a').each(function () { $this = $(this); if ($this.attr('data-mimetype').toLowerCase().indexOf('image/') == 0) $this.shadowbox({ gallery: 'attachments', player: 'img', title: $this.find('.comments').text() }); else $this.click(onDownload); }); });
"); #line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 993 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (hideAdvanced) { #line default #line hidden WriteLiteral(" \r\n \r\n Show Advanced Options "); #line 1009 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n Linked Groups:\r\n \r\n " + " \r\n
\r\n"); WriteLiteral(" "); #line 1016 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, CategoryDescription = DeviceBatchDevicesManagedGroup.GetCategoryDescription(Model.DeviceBatch), Description = DeviceBatchDevicesManagedGroup.GetDescription(Model.DeviceBatch), ManagedGroup = Model.DevicesLinkedGroup, UpdateUrl = Url.Action(MVC.API.DeviceBatch.UpdateDevicesLinkedGroup(Model.DeviceBatch.Id, redirect: true)) })); #line default #line hidden WriteLiteral("\r\n"); WriteLiteral(" "); #line 1024 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupInstance, new LinkedGroupModel() { CanConfigure = canConfig, CategoryDescription = DeviceBatchAssignedUsersManagedGroup.GetCategoryDescription(Model.DeviceBatch), Description = DeviceBatchAssignedUsersManagedGroup.GetDescription(Model.DeviceBatch), ManagedGroup = Model.AssignedUsersLinkedGroup, UpdateUrl = Url.Action(MVC.API.DeviceBatch.UpdateAssignedUsersLinkedGroup(Model.DeviceBatch.Id, redirect: true)) })); #line default #line hidden WriteLiteral("\r\n"); #line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1032 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)); #line default #line hidden #line 1034 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n \r\n \r\n \r\n\r\n"); #line 1041 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views._DeviceGroupDocumentBulkGenerate, Model)); #line default #line hidden WriteLiteral("\r\n\r\n"); #line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1043 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDecommission) { #line default #line hidden WriteLiteral(" Decommission All Devices\r\n"); WriteLiteral(" \r\n"); #line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1047 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" using (Html.BeginForm(MVC.API.Device.DeviceBatchDecommission(Model.DeviceBatch.Id), FormMethod.Post)) { #line default #line hidden #line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.AntiForgeryToken()); #line default #line hidden #line 1049 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" \r\n  Why are these devices to be decommissioned?\r\n \r\n"); WriteLiteral("
\r\n \r\n"); #line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1055 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) { #line default #line hidden WriteLiteral("
  • \r\n ((int)decommissionReason #line default #line hidden , 56912), false) ); WriteLiteral("\r\n name=\"decommissionReason\""); WriteAttribute("value", Tuple.Create(" value=\"", 57005), Tuple.Create("\"", 57039) #line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" , Tuple.Create(Tuple.Create("", 57013), Tuple.Create((int)decommissionReason #line default #line hidden , 57013), false) ); WriteLiteral(" "); #line 1059 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty); #line default #line hidden WriteLiteral(" />\r\n ((int)decommissionReason #line default #line hidden , 57224), false) ); WriteLiteral(">"); #line 1060 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(decommissionReason.ReasonMessage()); #line default #line hidden WriteLiteral("\r\n
  • \r\n"); #line 1062 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n
    \r\n \r\n \r\n Unassign devices users\r\n " + "\r\n
    \r\n"); #line 1070 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" $(function () { let buttonDialog = null; $('#DeviceBatch_Decommission').click(function () { if (!buttonDialog) { buttonDialog = $('#DeviceBatch_Decommission_Dialog') .dialog({ resizable: false, modal: true, autoOpen: false, buttons: { ""Decommission"": function () { const $this = $(this); $this.find('form').trigger('submit'); $this.dialog(""disable""); $this.dialog(""option"", ""buttons"", null); }, Cancel: function () { $(this).dialog(""close""); } } }); } buttonDialog.dialog('open'); return false; }); }); "); #line 1101 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1102 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDelete) { #line default #line hidden #line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")); #line default #line hidden #line 1104 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1106 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { #line default #line hidden #line 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.DeviceExportTypes.Batch, Model.DeviceBatch.Id))); #line default #line hidden #line 1110 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { #line default #line hidden #line 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton(string.Format("View {0} Device{1}", Model.DeviceCount, (Model.DeviceCount != 1 ? "s" : null)), MVC.Search.Query(Model.DeviceBatch.Id.ToString(), "DeviceBatch"))); #line default #line hidden #line 1114 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral("\r\n"); } } } #pragma warning restore 1591