#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 Id:\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + " "); #line 109 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 109 "..\..\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 123 "..\..\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 129 "..\..\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 34 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DisplayFor(model => model.DeviceBatch.Id)); #line default #line hidden WriteLiteral("\r\n
Name:\r\n " + " \r\n"); #line 41 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 41 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Name)); #line default #line hidden #line 43 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 44 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 44 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 45 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Name'), 'Invalid Name', '"); #line 51 "..\..\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 56 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 59 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Name); #line default #line hidden #line 59 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
Default Device Mo" + "del:\r\n "); #line 66 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 68 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.DropDownListFor(model => model.DeviceBatch.DefaultDeviceModelId, Model.DeviceModels.ToSelectListItems(null, true))); #line default #line hidden #line 68 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 69 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 69 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 70 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 70 "..\..\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 76 "..\..\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 81 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (Model.DefaultDeviceModel == null) { #line default #line hidden WriteLiteral("<None Specified>"); #line 85 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DefaultDeviceModel.ToString()); #line default #line hidden #line 87 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral("
\r\n Devices added offline will default to this Device Model.\r\n On" + "ce a device enrols the Device Model will be accurately represented.\r\n " + "
Devices\r\n"); #line 98 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 98 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceModelMembers.Count > 0) { #line default #line hidden WriteLiteral("
Model Device Count Decommissioned
\r\n"); #line 113 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 113 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canDeviceModelShow) { #line default #line hidden #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLink(membership.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(membership.DeviceModel.Id))); #line default #line hidden #line 115 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceModel.ToString()); #line default #line hidden #line 119 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n"); WriteLiteral(" "); #line 126 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(membership.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("\r\n
Total Models: "); #line 133 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceModelMembers.Count.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 134 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(""); #line 135 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceDecommissionedCount.ToString("n0")); #line default #line hidden WriteLiteral("
\r\n"); #line 139 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" No device models are referenced in this batch.\r\n"); #line 143 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 144 "..\..\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 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceCount.ToString("n0")); #line default #line hidden WriteLiteral(" of "); #line 150 "..\..\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 150 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(missingCount.ToString("n0")); #line default #line hidden WriteLiteral(" "); #line 150 "..\..\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 153 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Purchase:\r\n " + " \r\n \r\n \r\n \r\n Purchase Date:\r\n \r\n \r\n"); #line 165 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 165 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 167 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 167 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 168 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 168 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 182 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 185 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.PurchaseDate)); #line default #line hidden #line 185 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Supplier:\r\n \r\n " + " "); #line 192 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 194 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Supplier)); #line default #line hidden #line 194 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 195 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 195 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 196 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 196 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_Supplier'), 'Batch Supplier', '"); #line 202 "..\..\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 207 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Supplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 211 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 213 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Supplier); #line default #line hidden #line 213 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Unit Cost:\r\n \r\n " + " "); #line 220 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 222 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitCost)); #line default #line hidden #line 222 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 223 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 224 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 224 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitCost'), 'Unit Cost', '"); #line 230 "..\..\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 235 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitCost.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 239 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 241 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitCost.Value.ToString("C")); #line default #line hidden #line 241 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Quantity:\r\n \r\n " + " "); #line 248 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 250 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.UnitQuantity)); #line default #line hidden #line 250 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 251 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 252 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 252 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_UnitQuantity'), 'Quantity', '"); #line 258 "..\..\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 263 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (!Model.DeviceBatch.UnitQuantity.HasValue) { #line default #line hidden WriteLiteral("<None Specified>"); #line 267 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 269 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.UnitQuantity.Value.ToString("n0")); #line default #line hidden #line 269 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 276 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxPurchaseDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 278 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 278 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 280 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 280 "..\..\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 297 "..\..\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 332 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.PurchaseDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 336 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 338 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.PurchaseDetails)); #line default #line hidden #line 338 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Warranty:\r\n \r\n \r\n \r\n \r\n Valid Until:\r\n \r\n \r\n"); #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 352 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 354 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyValidUntil)); #line default #line hidden #line 354 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 355 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 355 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 369 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 372 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.WarrantyValidUntil, "Unknown")); #line default #line hidden #line 372 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 379 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxWarrantyDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 381 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 381 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 383 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 383 "..\..\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 400 "..\..\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 435 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.WarrantyDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 439 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 441 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.WarrantyDetails)); #line default #line hidden #line 441 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Insurance:\r\n \r\n \r\n \r\n \r\n Supplier:\r\n \r\n "); #line 454 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 456 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceSupplier)); #line default #line hidden #line 456 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxSave()); #line default #line hidden #line 457 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 458 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 458 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(" $(function () { document.DiscoFunctions.PropertyChangeHelper( $('#DeviceBatch_InsuranceSupplier'), 'Insurance Supplier', '"); #line 464 "..\..\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 469 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceSupplier)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 473 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.InsuranceSupplier); #line default #line hidden #line 475 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" ; } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Insured Date:\r\n \r\n "); #line 483 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredDate)); #line default #line hidden #line 485 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 486 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 486 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 500 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 503 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredDate, "Unknown")); #line default #line hidden #line 503 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Insured Until:\r\n \r\n "); #line 510 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 512 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuredUntil)); #line default #line hidden #line 512 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader()); #line default #line hidden #line 513 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden WriteLiteral(@" "); #line 527 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 530 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(CommonHelpers.FriendlyDate(Model.DeviceBatch.InsuredUntil, "Unknown")); #line default #line hidden #line 530 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n
\r\n Details "); #line 537 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxInsuranceDetails")); #line default #line hidden WriteLiteral("\r\n
\r\n"); #line 539 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 539 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 541 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 541 "..\..\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 556 "..\..\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 591 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.InsuranceDetails)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 595 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 597 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.InsuranceDetails)); #line default #line hidden #line 597 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n \r\n " + " Comments:
\r\n"); WriteLiteral(" "); #line 604 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(AjaxHelpers.AjaxLoader("ajaxComments")); #line default #line hidden WriteLiteral("\r\n \r\n "); #line 606 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 608 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.EditorFor(model => model.DeviceBatch.Comments)); #line default #line hidden #line 608 "..\..\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 623 "..\..\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 658 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { if (string.IsNullOrEmpty(Model.DeviceBatch.Comments)) { #line default #line hidden WriteLiteral("<None Specified>"); #line 662 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden #line 664 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(new HtmlString(Model.DeviceBatch.Comments)); #line default #line hidden #line 664 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n \r\n \r\n Attachments:" + "\r\n \r\n\r\n (canConfig ? "canAddAttachments" : "cannotAddAttachments" #line default #line hidden , 34495), false) ); WriteLiteral(">\r\n \r\n

Drop Attachments Here

\r\n \r\n \r\n"); #line 677 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 677 "..\..\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 , 35040), false) ); WriteLiteral(" data-attachmentid=\""); #line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Id); #line default #line hidden WriteLiteral("\""); WriteLiteral(" data-mimetype=\""); #line 681 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.MimeType); #line default #line hidden WriteLiteral("\""); WriteLiteral(">\r\n (attachment.Filename #line default #line hidden , 35244), false) ); WriteLiteral(">\r\n (Url.Action(MVC.API.DeviceBatch.AttachmentThumbnail(attachment.Id)) #line default #line hidden , 35345), false) ); WriteLiteral(" />\r\n \r\n " + " (attachment.Comments #line default #line hidden , 35531), false) ); WriteLiteral(">\r\n"); WriteLiteral(" "); #line 686 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Comments); #line default #line hidden WriteLiteral("\r\n "); #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.TechUser.ToString()); #line default #line hidden WriteLiteral(""); #line 687 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral(""); #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("(attachment.Timestamp.ToFullDateTime() #line default #line hidden , 35865), false) ); WriteLiteral(" data-livestamp=\""); #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToUnixEpoc()); #line default #line hidden WriteLiteral("\""); WriteLiteral(">"); #line 688 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(attachment.Timestamp.ToFullDateTime()); #line default #line hidden WriteLiteral("\r\n \r\n"); #line 690 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral(" \r\n"); #line 693 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 693 "..\..\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 704 "..\..\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 724 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Model.DeviceBatch.Id); #line default #line hidden WriteLiteral("\' };\r\n $.connection.hub.error(onHubFailed);\r\n " + " $.connection.hub.disconnected(onHubFailed);\r\n\r\n " + " $.connection.hub.reconnecting(function () {\r\n " + " $Attachments.find(\'span.action\').addClass(\'disabled\');\r\n " + " });\r\n $.connection.hub.reconnected(fun" + "ction () {\r\n $Attachments.find(\'span.action\').rem" + "oveClass(\'disabled\');\r\n });\r\n\r\n " + " // Start Connection\r\n $.connection.hub.start(fu" + "nction () {\r\n $Attachments.find(\'span.action\').re" + "moveClass(\'disabled\');\r\n }).fail(onHubFailed);\r\n\r\n " + " function onHubFailed(error) {\r\n " + " // Disable UI\r\n $Attachments.find(\'span.a" + "ction\').addClass(\'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(\'

Disconnected fro" + "m 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 feature" + "s.
\')\r\n .dialog({\r\n " + " resizable: false,\r\n " + " title: \'Disconnected\',\r\n wi" + "dth: 400,\r\n modal: true,\r\n " + " buttons: {\r\n " + " \'Refresh Now\': function () {\r\n " + " $(this).dialog(\'option\', \'buttons\', null);\r\n " + " window.location.reload(true);\r\n " + " },\r\n " + " \'Close\': function () {\r\n $(" + "this).dialog(\'destroy\');\r\n }\r\n " + " }\r\n " + " });\r\n }\r\n }\r\n\r\n " + " function onAddAttachment(id, quick) {\r\n " + " var data = { id: id };\r\n $.ajax({" + "\r\n url: \'"); #line 770 "..\..\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 776 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 776 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden WriteLiteral(" "); WriteLiteral("buildAttachment(a, true, quick);"); WriteLiteral("\r\n"); #line 779 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } else { #line default #line hidden WriteLiteral(" "); WriteLiteral("buildAttachment(a, false, quick);"); WriteLiteral("\r\n"); #line 783 "..\..\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 802 "..\..\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 824 "..\..\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 876 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 876 "..\..\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(\r\n " + " \'"); #line 880 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Url.Action(MVC.API.DeviceBatch.AttachmentUpload(Model.DeviceBatch.Id, null))); #line default #line hidden WriteLiteral("\',\r\n $Attachments.find(\'.Disco-AttachmentUpload-DropTa" + "rget\'),\r\n $Attachments.find(\'.Disco-AttachmentUpload-" + "Progress\'));\r\n\r\n var $attachmentInput = $Attachments." + "find(\'.attachmentInput\');\r\n $attachmentInput.find(\'.p" + "hoto\').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.upload" + "Image();\r\n });\r\n $attachme" + "ntInput.find(\'.upload\').click(function () {\r\n if " + "($(this).hasClass(\'disabled\'))\r\n alert(\'Disco" + "nnected from the Disco ICT Server, please refresh this page and try again\');\r\n " + " else\r\n attachme" + "ntUploader.uploadFiles();\r\n });\r\n " + " //#endregion\r\n //#region Remove Attachments\r\n" + " $attachmentOutput.find(\'span.remove\').click(removeAt" + "tachment);\r\n\r\n function removeAttachment() {\r\n " + " $this = $(this).closest(\'a\');\r\n\r\n " + " var data = { id: $this.attr(\'data-attachmentid\') };\r\n\r\n " + " if (!$dialogRemoveAttachment) {\r\n " + " $dialogRemoveAttachment = $(\'#dialogRemoveAttachment\').dialog({\r\n " + " resizable: false,\r\n " + " height: 140,\r\n modal: true,\r\n " + " autoOpen: false\r\n " + " });\r\n }\r\n\r\n " + " $dialogRemoveAttachment.dialog(\"enable\");\r\n " + "$dialogRemoveAttachment.dialog(\'option\', \'buttons\', {\r\n " + " \"Remove\": function () {\r\n $dia" + "logRemoveAttachment.dialog(\"disable\");\r\n " + "$dialogRemoveAttachment.dialog(\"option\", \"buttons\", null);\r\n " + " $.ajax({\r\n url: \'" + ""); #line 921 "..\..\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 948 "..\..\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 963 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 963 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (hideAdvanced) { #line default #line hidden WriteLiteral(" \r\n \r\n Show Advanced Options "); #line 979 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" \r\n Linked Groups:\r\n \r\n \r\n " + "
\r\n"); WriteLiteral(" "); #line 985 "..\..\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 993 "..\..\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 1001 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1001 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (canConfig) { #line default #line hidden #line 1003 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.Partial(MVC.Config.Shared.Views.LinkedGroupShared)); #line default #line hidden #line 1003 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral("
\r\n \r\n \r\n \r\n\r\n<" + "div"); WriteLiteral(" class=\"actionBar\""); WriteLiteral(">\r\n"); #line 1011 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" #line default #line hidden #line 1011 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.CanDelete) { #line default #line hidden #line 1013 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Delete", MVC.API.DeviceBatch.Delete(Model.DeviceBatch.Id, true), "buttonDelete")); #line default #line hidden #line 1013 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } #line default #line hidden WriteLiteral(" "); #line 1015 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" if (Model.DeviceCount > 0) { if (Authorization.Has(Claims.Device.Actions.Export)) { #line default #line hidden #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" Write(Html.ActionLinkButton("Export Devices", MVC.Device.Export(null, Disco.Models.Services.Devices.Exporting.DeviceExportTypes.Batch, Model.DeviceBatch.Id))); #line default #line hidden #line 1019 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } if (Authorization.Has(Claims.Device.Search) && Model.DeviceCount > 0) { #line default #line hidden #line 1023 "..\..\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 1023 "..\..\Areas\Config\Views\DeviceBatch\Show.cshtml" } } #line default #line hidden WriteLiteral("\r\n"); } } } #pragma warning restore 1591