From 8afe4195a92309b5ec792a6f8eb7463ed8b7a83c Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Fri, 12 Jan 2024 12:53:50 +1100 Subject: [PATCH] #107 allow moving of device OU when changing profile --- .../Areas/API/Controllers/DeviceController.cs | 52 +- Disco.Web/ClientSource/Style/Device.css | 23 +- Disco.Web/ClientSource/Style/Device.less | 15 +- Disco.Web/ClientSource/Style/Device.min.css | 2 +- .../T4MVC/API.DeviceController.generated.cs | 8 +- .../Views/Device/DeviceParts/_Subject.cshtml | 62 +- .../Device/DeviceParts/_Subject.generated.cs | 584 ++++++++++-------- 7 files changed, 447 insertions(+), 299 deletions(-) diff --git a/Disco.Web/Areas/API/Controllers/DeviceController.cs b/Disco.Web/Areas/API/Controllers/DeviceController.cs index d7333c3f..d4384840 100644 --- a/Disco.Web/Areas/API/Controllers/DeviceController.cs +++ b/Disco.Web/Areas/API/Controllers/DeviceController.cs @@ -3,6 +3,7 @@ using Disco.Models.Repository; using Disco.Models.Services.Devices.Exporting; using Disco.Models.Services.Devices.Importing; using Disco.Models.Services.Documents; +using System.Data.Entity; using Disco.Services; using Disco.Services.Authorization; using Disco.Services.Devices.Exporting; @@ -22,6 +23,7 @@ using System.Linq; using System.Web; using System.Web.Caching; using System.Web.Mvc; +using Disco.Services.Logging; namespace Disco.Web.Areas.API.Controllers { @@ -113,10 +115,54 @@ namespace Disco.Web.Areas.API.Controllers #region Update Shortcut Methods - [DiscoAuthorize(Claims.Device.Properties.DeviceProfile)] - public virtual ActionResult UpdateDeviceProfileId(string id, string DeviceProfileId = null, bool redirect = false) + [DiscoAuthorize(Claims.Device.Properties.DeviceProfile), HttpPost, ValidateAntiForgeryToken] + public virtual ActionResult UpdateDeviceProfileId(string id, string DeviceProfileId = null, bool enforceOrganisationalUnit = false, bool redirect = false) { - return Update(id, pDeviceProfileId, DeviceProfileId, redirect); + var updateResult = Update(id, pDeviceProfileId, DeviceProfileId, redirect); + + if (enforceOrganisationalUnit) + { + var device = Database.Devices + .Include(d => d.DeviceProfile) + .First(d => d.SerialNumber == id); + + if (ActiveDirectory.IsValidDomainAccountId(device.DeviceDomainId, out ADDomain deviceDomain)) + { + var ou = device.DeviceProfile.OrganisationalUnit; + if (string.IsNullOrWhiteSpace(ou)) + ou = ActiveDirectory.Context.PrimaryDomain.DefaultComputerContainer; + var domain = ActiveDirectory.Context.GetDomainFromDistinguishedName(ou); + + if (domain != deviceDomain) + SystemLog.LogWarning($"Device '{device.SerialNumber}' [{device.DeviceDomainId}] is not in the same domain as the Organisational Unit '{ou}' and cannot be moved"); + else + { + var domainController = domain.GetAvailableDomainController(RequireWritable: true); + var deviceAccount = domainController.RetrieveADMachineAccount(device.DeviceDomainId); + + if (deviceAccount == null) + SystemLog.LogWarning($"Device '{device.SerialNumber}' [{device.DeviceDomainId}] was not found on the domain controller"); + else + { + if (!string.Equals(deviceAccount.ParentDistinguishedName, ou, StringComparison.OrdinalIgnoreCase)) + { + try + { + var existingOu = deviceAccount.ParentDistinguishedName; + deviceAccount.MoveOrganisationalUnit(domainController, ou); + SystemLog.LogInformation($"Device Profile Updated; Moved Device '{device.SerialNumber}' [{device.DeviceDomainId}] from '{existingOu}' to '{ou}'"); + } + catch (Exception ex) + { + SystemLog.LogException($"Failed to move Device '{device.SerialNumber}' [{device.DeviceDomainId}] from '{deviceAccount.ParentDistinguishedName}' to '{ou}'", ex); + } + } + } + } + } + } + + return updateResult; } [DiscoAuthorize(Claims.Device.Properties.DeviceBatch)] diff --git a/Disco.Web/ClientSource/Style/Device.css b/Disco.Web/ClientSource/Style/Device.css index 80025d53..ea4fdf1c 100644 --- a/Disco.Web/ClientSource/Style/Device.css +++ b/Disco.Web/ClientSource/Style/Device.css @@ -199,23 +199,28 @@ border-top: none; background-color: #eee; } -#Device_Show_Policies_Profile_Actions_Update_Dialog ul li, -#Device_Show_Policies_Batch_Actions_Update_Dialog ul li { +#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list, +#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list { + max-height: 300px; + overflow-y: auto; +} +#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li, +#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li { background-color: #fff; padding: 2px 0 2px 4px; } -#Device_Show_Policies_Profile_Actions_Update_Dialog ul li:nth-child(odd), -#Device_Show_Policies_Batch_Actions_Update_Dialog ul li:nth-child(odd) { +#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li:nth-child(odd), +#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li:nth-child(odd) { background-color: hsl(0, 0%, 98.5%); } -#Device_Show_Policies_Profile_Actions_Update_Dialog ul li.selected, -#Device_Show_Policies_Batch_Actions_Update_Dialog ul li.selected { +#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li.selected, +#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li.selected { background-color: #cddbec; font-weight: 600; } -#Device_Show_Policies_Profile_Actions_Update_Dialog label, -#Device_Show_Policies_Batch_Actions_Update_Dialog label { - display: block; +#Device_Show_Policies_Profile_Actions_Update_Dialog .enforce-ou, +#Device_Show_Policies_Batch_Actions_Update_Dialog .enforce-ou { + padding-top: 0.5em; } #DeviceDetailTab-JobsContainer div.jobTable { margin: -1px; diff --git a/Disco.Web/ClientSource/Style/Device.less b/Disco.Web/ClientSource/Style/Device.less index 85cb9991..5ef4c087 100644 --- a/Disco.Web/ClientSource/Style/Device.less +++ b/Disco.Web/ClientSource/Style/Device.less @@ -170,7 +170,10 @@ } #Device_Show_Policies_Profile_Actions_Update_Dialog, #Device_Show_Policies_Batch_Actions_Update_Dialog { - ul { + .profile-list { + max-height: 300px; + overflow-y: auto; + li { background-color: @white; padding: 2px 0 2px 4px; @@ -185,8 +188,8 @@ } } } - label { - display: block; + .enforce-ou { + padding-top: .5em; } } @@ -619,9 +622,9 @@ background-color: @TableDataRowBackgroundColor; } - td:nth-child(n+3) { - color: @SubtleBorderColour; - } + td:nth-child(n+3) { + color: @SubtleBorderColour; + } } tr.actionModified { diff --git a/Disco.Web/ClientSource/Style/Device.min.css b/Disco.Web/ClientSource/Style/Device.min.css index 450e99c6..490b6274 100644 --- a/Disco.Web/ClientSource/Style/Device.min.css +++ b/Disco.Web/ClientSource/Style/Device.min.css @@ -1 +1 @@ -.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo_Container{float:left;padding-right:2px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo{max-width:48px;height:auto;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:0;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:0;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>a{padding:5px 8px;}#DeviceDetailTabs div.ui-tabs-panel{border-radius:0;padding:4px;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-top:0;background-color:#eee;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li{background-color:#fff;padding:2px 0 2px 4px;}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li:nth-child(odd),#Device_Show_Policies_Batch_Actions_Update_Dialog ul li:nth-child(odd){background-color:hsl(0,0%,98.5%);}#Device_Show_Policies_Profile_Actions_Update_Dialog ul li.selected,#Device_Show_Policies_Batch_Actions_Update_Dialog ul li.selected{background-color:#cddbec;font-weight:600;}#Device_Show_Policies_Profile_Actions_Update_Dialog label,#Device_Show_Policies_Batch_Actions_Update_Dialog label{display:block;}#DeviceDetailTab-JobsContainer div.jobTable{margin:-1px;border:1px solid #ddd;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_filter{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_length{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_showStatusClosed{right:220px;margin-top:-24px;}#DeviceDetailTab-DetailsContainer>table{border:solid 1px #f4f4f4;border-collapse:collapse;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}#DeviceDetailTab-DetailsContainer>table>thead>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}#DeviceDetailTab-DetailsContainer>table>tfoot>tr>th,#DeviceDetailTab-DetailsContainer>table>tfoot>tr>td{background-color:#f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{width:150px;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>td.pad{padding:10px 6px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition{position:relative;height:40px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span{position:absolute;display:block;height:40px;box-sizing:border-box;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f4f4f4;padding:2px;line-height:18px;border:1px solid #cacaca;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .details{position:relative;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .freespace{position:absolute;top:0;height:40px;display:block;background-color:#fff;background:repeating-linear-gradient(45deg,#f4f4f4,#f4f4f4 10px,#fff 10px,#fff 20px);}#deviceShowResources #AttachmentsContainer{padding:0;}#deviceShowResources #Attachments{position:relative;border:1px solid #ccc;background-color:#fff;}#deviceShowResources #Attachments div.attachmentOutput{position:relative;height:115px;overflow:auto;}#deviceShowResources #Attachments div.attachmentOutput>a{display:block;float:left;height:48px;width:221px;padding:2px;margin:2px;font-size:.9em;border:1px solid #fff;color:#000;text-decoration:none;}#deviceShowResources #Attachments div.attachmentOutput>a span.comments,#deviceShowResources #Attachments div.attachmentOutput>a span.author,#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{display:block;float:left;width:168px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:16px;}#deviceShowResources #Attachments div.attachmentOutput>a span.author{color:#888;width:150px;}#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{color:#888;font-style:italic;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon{display:block;float:left;height:48px;width:48px;margin-right:2px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img{height:48px;width:48px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img.loading{display:none;}#deviceShowResources #Attachments div.attachmentOutput>a:hover{background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentOutput>a:hover span.remove{opacity:.5;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove{font-size:1.4em;color:#e51400;margin-left:6px;cursor:pointer;opacity:0;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove:hover{opacity:1;}#deviceShowResources #Attachments div.attachmentInput{border-top:1px solid #ccc;height:40px;background-color:#fff;padding:3px;}#deviceShowResources #Attachments div.attachmentInput span.action{color:#333;display:block;margin:0 4px 0 0;font-size:1.5em;cursor:pointer;float:right;border:1px solid #fff;padding:.5em;}#deviceShowResources #Attachments div.attachmentInput span.action:hover{color:#335a87;background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled{color:rgba(51,51,51,.2);cursor:default;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled:hover{color:rgba(51,51,51,.2);background-color:inherit;border:1px solid #fff;}#Devices_Export .Devices_Export_Type_Target{margin-top:10px;display:none;}#Devices_Export #Devices_Export_Fields #Devices_Export_Fields_Defaults{font-size:.75em;}#Devices_Export #Devices_Export_Fields th{font-size:1.05em;}#Devices_Export #Devices_Export_Fields th span{margin-top:4px;font-size:.8em;}#Devices_Export_Download_Dialog{padding-top:20px;text-align:center;}#Devices_Export_Download_Dialog h4{margin-bottom:30px;}#Devices_Export_Download_Dialog a{margin-bottom:20px;}#Devices_Export_Exporting{padding-top:50px;text-align:center;}#Devices_Export_Exporting i{margin-right:10px;color:#1e6dab;}#Devices_Import #ImportFile{width:96%;margin-bottom:8px;}#Devices_Import #Devices_Import_Documentation{width:700px;margin:20px auto;}#Devices_Import #Devices_Import_Documentation>table>tbody th:first-child{width:220px;}#Devices_Import_Completed_Dialog{padding:50px 0;text-align:center;}#Devices_Import_Completed_Dialog h3{margin-bottom:16px;}#Devices_Import_Completed_Dialog i{margin-right:10px;color:#60a917;}#Devices_Import_Loading_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Loading_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType>li>a>span:not(.ui-menu-icon){padding-right:16px;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType ul{z-index:1000;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td.headerIgnoreColumn{background-color:#fa6800;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td:not(.headerIgnoreColumn){background-color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerDeviceSerialNumber{border-top-color:#d1e6f7;border-bottom-color:#d1e6f7;background-color:#e2f0fa;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerIgnoreColumn{max-width:150px;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#ccc;}#Devices_Import_Parsing_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Parsing_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Review #Devices_Import_Review_Navigation{margin-top:15px;text-align:right;}#Devices_Import_Review #Devices_Import_Review_Navigation ul{display:inline-block;padding:0;border:1px solid #bbb;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li{display:inline-block;padding:3px 10px;margin:0;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionDetached{background-color:#ffd0cc;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionModified{background-color:#e2f0fa;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionAdded{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionUnchanged{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead tr:nth-child(2) th{padding-top:0;font-weight:normal;font-size:.9em;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.action{text-align:center;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td.action i:before{color:#e51400;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td{background-color:#ffe7e5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td.action i:before{content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td:nth-child(n+3){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td.action i:before{color:#1e6dab;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td{background-color:#f4f9fd;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td.action i:before{color:#60a917;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr:not(.actionUnchanged) td.actionUnchanged:nth-child(n+3):not(.headerDeviceSerialNumber){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError{color:#e51400;background-color:#fff1ef;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError span.errorMessage{display:none;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionModified{background-color:#e2f0fa!important;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceSerialNumber,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedDate,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedReason,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerModelId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerBatchId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerProfileId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerAssignedUserId{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody span.smallMessage{color:inherit;} \ No newline at end of file +.tableData{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableData>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}.tableData>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}.tableData>thead>tr>th,.tableData>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}.tableData>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}.tableData>tfoot>tr>th,.tableData>tfoot>tr>td{background-color:#f4f4f4;}.tableDataDark{border:solid 1px #d8d8d8;border-collapse:collapse;}.tableDataDark td{border:solid 1px #d8d8d8;background-color:#fff;}.tableDataDark th{background-color:#eee;border:solid 1px #d8d8d8;}.tableDataContainer{background-color:#fff;}.tableDataVertical{border:solid 1px #f4f4f4;border-collapse:collapse;}.tableDataVertical>tbody>tr:nth-child(odd){background-color:#f4f4f4;margin:0;padding:0;}.tableDataVertical>tbody>tr>th.name{width:170px;text-align:right;}.tableDataVertical table.sub>tbody>tr:not(:first-child)>th,.tableDataVertical table.sub>tbody>tr:not(:first-child)>td{border-top:1px dashed #aaa;}.tableDataVertical table.sub>tbody>tr>th{font-weight:normal;text-align:right;}.tableDataVertical table.sub>tbody>tr>th.name{text-align:right;}.icon16{display:inline-block;height:16px;width:16px;margin-left:2px;cursor:pointer;}.subtleUntilHover{-moz-opacity:.3;opacity:.3;}.subtleUntilHover:hover{-moz-opacity:1;opacity:1;}#layout_PageHeading #Device_Show_Status{margin-left:20px;display:inline-block;height:50px;font-family:"Segoe UI",Arial,Verdana,Tahoma,sans-serif;font-weight:lighter;font-stretch:condensed;font-size:.7em;text-transform:uppercase;}#layout_PageHeading #Device_Show_Status span.icon{margin-right:6px;}#Device_Show #Device_Show_Subjects{table-layout:fixed;}#Device_Show #Device_Show_Subjects>tbody>tr>td{padding-top:0;height:100%;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div{position:relative;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div div.status{margin-top:2px;padding-top:2px;border-top:1px dashed #ddd;}#Device_Show #Device_Show_Subjects>tbody>tr>td>div input.discreet{margin-left:-2px;}#Device_Show #Device_Show_Subjects>tbody>tr>td:not(:last-child){border-right:1px dashed #aaa;}#Device_Show #Device_Show_Subjects #Device_Show_Details table.verticalHeadings>tbody>tr>td:first-child{width:104px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Name{font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_Details_Asset_Enrolled_Trusted{display:inline-block;height:16px;padding-left:16px;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACWUlEQVQ4y6XRXWiSURgHcJsXa4WNNuuyiy6CoAupixERoXXhmljuxaJiFrVA1i72cVFCOSMt8rNt2YfGO5g5Z1NstWW+c4ZBq4QpqMkEbZDSCObAMprjdf90sIjxsgUdODd/zvmd5zwPCwDrf/aGB7q6utgmk8ngdruzVqt10eVyTWu1Wuk/AXK5vMpoNPpjsRgGbU8/9fbdH/J4PAuRSARKpfLKhoBYLG595nTCaDSZVjPp6TPbHQ5H0mAwfBeJRHXrAp0dna9JcqCguX2H/Xd+S625aLFYQBDE8XWBd+8/TI6Njc+vzcfGX4nLX4FOp5OuC0wGAlS53NzaPPAm2Gi32+H3+5tYJEl+pigKoVAIPp+PnpqaosPhMF1uHB2Px2mv14vya6VgMKhhHGN3d/dSMplENptFIpHA3NwcCoUCSqUSKqvScZVKBbPZHGQEFApFMZ1OI5PJIBqNrkD5fB40Ta8AlcrUajVsNpufEbh+42YxHEkh+/UbUqlZpGd/lAH8WTMzMzDd64d7NMAMDOobi/OpHqh6rqK9jcCvBQncQzK0Xm5DPn0BJ4lz6GgVIkedYAaamxqK0dEDePl4FziczehTsZGLs7BnNwdiwRac4lejvp6La83VzABv/8FF/qG9oD/WQS/fhNptHEw8rEJiuAo7ubXACAtH9m0Fu2YHxQzweEuEVIYnaiFmvQ04f1aItksi5KaP4ZFGjDB5GG/7j4LL5YYYgZYW2c/yiJbv6h/A0EvC4RjGiOsFnK4J+KgABmyjsDufL0skki8CgYCoXOLz+TWrwG+kXMkgQ6yv+QAAAABJRU5ErkJggg==);background-repeat:no-repeat;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo_Container{float:left;padding-right:2px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Photo{max-width:48px;height:auto;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags{font-size:16px;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i{cursor:default;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_User #Device_Show_User_Flags>i>.details{display:none;}#Device_Show #Device_Show_Subjects #Device_Show_Details #Device_Show_GenerateDocument_Container{padding-top:4px;}#Device_Show #Device_Show_Subjects #Device_Show_Policies table.verticalHeadings>tbody>tr>td:first-child{width:120px;font-weight:600;}#Device_Show #Device_Show_Subjects #Device_Show_Aspects #Device_Show_Aspects_Model_Image{display:block;width:256px;height:256px;margin:0 auto;}#Device_Show #Device_Show_Subjects #Device_Show_Subjects_Actions>td{padding-top:4px;}#DeviceDetailTabs{margin-top:10px;border-radius:0;background-image:none;background-color:#fff;border:0;padding:0;}#DeviceDetailTabs #DeviceDetailTabItems{border-radius:0;border-top:1px solid #ddd;border-right:1px solid #ddd;border-left:1px solid #ddd;border-bottom:0;padding:2px 0 0 4px;background-image:none;background-color:#eee;display:table;}#DeviceDetailTabs #DeviceDetailTabItems>li{top:0;border-radius:0;margin:0 5px 0 0;padding:0;line-height:normal;margin-right:4px;}#DeviceDetailTabs #DeviceDetailTabItems>li>a{padding:5px 8px;}#DeviceDetailTabs div.ui-tabs-panel{border-radius:0;padding:4px;border-right:1px solid #ddd;border-bottom:1px solid #ddd;border-left:1px solid #ddd;border-top:0;background-color:#eee;}#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list,#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list{max-height:300px;overflow-y:auto;}#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li,#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li{background-color:#fff;padding:2px 0 2px 4px;}#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li:nth-child(odd),#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li:nth-child(odd){background-color:hsl(0,0%,98.5%);}#Device_Show_Policies_Profile_Actions_Update_Dialog .profile-list li.selected,#Device_Show_Policies_Batch_Actions_Update_Dialog .profile-list li.selected{background-color:#cddbec;font-weight:600;}#Device_Show_Policies_Profile_Actions_Update_Dialog .enforce-ou,#Device_Show_Policies_Batch_Actions_Update_Dialog .enforce-ou{padding-top:.5em;}#DeviceDetailTab-JobsContainer div.jobTable{margin:-1px;border:1px solid #ddd;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_filter{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_length{margin-top:-24px;-moz-opacity:1;opacity:1;}#DeviceDetailTab-JobsContainer .dataTables_wrapper .dataTables_showStatusClosed{right:220px;margin-top:-24px;}#DeviceDetailTab-DetailsContainer>table{border:solid 1px #f4f4f4;border-collapse:collapse;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>td{border:solid 1px #f4f4f4;background-color:#fff;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:nth-child(odd)>td{background-color:hsl(0,0%,98.5%);}#DeviceDetailTab-DetailsContainer>table>thead>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{background-color:#f4f4f4;border:solid 1px #f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr:hover>td{background-color:hsl(0,0%,97.5%);}#DeviceDetailTab-DetailsContainer>table>tfoot>tr>th,#DeviceDetailTab-DetailsContainer>table>tfoot>tr>td{background-color:#f4f4f4;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th{width:150px;}#DeviceDetailTab-DetailsContainer>table>tbody>tr>th,#DeviceDetailTab-DetailsContainer>table>tbody>tr>td.pad{padding:10px 6px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition{position:relative;height:40px;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span{position:absolute;display:block;height:40px;box-sizing:border-box;overflow-x:hidden;overflow-y:hidden;text-overflow:ellipsis;white-space:nowrap;background-color:#f4f4f4;padding:2px;line-height:18px;border:1px solid #cacaca;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .details{position:relative;}#DeviceDetailTab-DetailsContainer .device_detail_disk_drives .partition>span .freespace{position:absolute;top:0;height:40px;display:block;background-color:#fff;background:repeating-linear-gradient(45deg,#f4f4f4,#f4f4f4 10px,#fff 10px,#fff 20px);}#deviceShowResources #AttachmentsContainer{padding:0;}#deviceShowResources #Attachments{position:relative;border:1px solid #ccc;background-color:#fff;}#deviceShowResources #Attachments div.attachmentOutput{position:relative;height:115px;overflow:auto;}#deviceShowResources #Attachments div.attachmentOutput>a{display:block;float:left;height:48px;width:221px;padding:2px;margin:2px;font-size:.9em;border:1px solid #fff;color:#000;text-decoration:none;}#deviceShowResources #Attachments div.attachmentOutput>a span.comments,#deviceShowResources #Attachments div.attachmentOutput>a span.author,#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{display:block;float:left;width:168px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;height:16px;}#deviceShowResources #Attachments div.attachmentOutput>a span.author{color:#888;width:150px;}#deviceShowResources #Attachments div.attachmentOutput>a span.timestamp{color:#888;font-style:italic;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon{display:block;float:left;height:48px;width:48px;margin-right:2px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img{height:48px;width:48px;}#deviceShowResources #Attachments div.attachmentOutput>a span.icon img.loading{display:none;}#deviceShowResources #Attachments div.attachmentOutput>a:hover{background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentOutput>a:hover span.remove{opacity:.5;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove{font-size:1.4em;color:#e51400;margin-left:6px;cursor:pointer;opacity:0;}#deviceShowResources #Attachments div.attachmentOutput>a span.remove:hover{opacity:1;}#deviceShowResources #Attachments div.attachmentInput{border-top:1px solid #ccc;height:40px;background-color:#fff;padding:3px;}#deviceShowResources #Attachments div.attachmentInput span.action{color:#333;display:block;margin:0 4px 0 0;font-size:1.5em;cursor:pointer;float:right;border:1px solid #fff;padding:.5em;}#deviceShowResources #Attachments div.attachmentInput span.action:hover{color:#335a87;background-color:#ededed;border:1px solid #ccc;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled{color:rgba(51,51,51,.2);cursor:default;}#deviceShowResources #Attachments div.attachmentInput span.action.disabled:hover{color:rgba(51,51,51,.2);background-color:inherit;border:1px solid #fff;}#Devices_Export .Devices_Export_Type_Target{margin-top:10px;display:none;}#Devices_Export #Devices_Export_Fields #Devices_Export_Fields_Defaults{font-size:.75em;}#Devices_Export #Devices_Export_Fields th{font-size:1.05em;}#Devices_Export #Devices_Export_Fields th span{margin-top:4px;font-size:.8em;}#Devices_Export_Download_Dialog{padding-top:20px;text-align:center;}#Devices_Export_Download_Dialog h4{margin-bottom:30px;}#Devices_Export_Download_Dialog a{margin-bottom:20px;}#Devices_Export_Exporting{padding-top:50px;text-align:center;}#Devices_Export_Exporting i{margin-right:10px;color:#1e6dab;}#Devices_Import #ImportFile{width:96%;margin-bottom:8px;}#Devices_Import #Devices_Import_Documentation{width:700px;margin:20px auto;}#Devices_Import #Devices_Import_Documentation>table>tbody th:first-child{width:220px;}#Devices_Import_Completed_Dialog{padding:50px 0;text-align:center;}#Devices_Import_Completed_Dialog h3{margin-bottom:16px;}#Devices_Import_Completed_Dialog i{margin-right:10px;color:#60a917;}#Devices_Import_Loading_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Loading_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType>li>a>span:not(.ui-menu-icon){padding-right:16px;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead ul.importHeaderType ul{z-index:1000;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td.headerIgnoreColumn{background-color:#fa6800;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>thead td:not(.headerIgnoreColumn){background-color:#1e6dab;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerDeviceSerialNumber{border-top-color:#d1e6f7;border-bottom-color:#d1e6f7;background-color:#e2f0fa;}#Devices_Import_Headers #Devices_Import_Headers_TableContainer table>tbody td.headerIgnoreColumn{max-width:150px;white-space:nowrap;overflow:hidden;-ms-text-overflow:ellipsis;-o-text-overflow:ellipsis;text-overflow:ellipsis;color:#ccc;}#Devices_Import_Parsing_Dialog{padding-top:50px;text-align:center;}#Devices_Import_Parsing_Dialog i{margin-right:10px;color:#1e6dab;}#Devices_Import_Review #Devices_Import_Review_Navigation{margin-top:15px;text-align:right;}#Devices_Import_Review #Devices_Import_Review_Navigation ul{display:inline-block;padding:0;border:1px solid #bbb;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li{display:inline-block;padding:3px 10px;margin:0;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionDetached{background-color:#ffd0cc;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionModified{background-color:#e2f0fa;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionAdded{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_Navigation ul li.actionUnchanged{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer{margin:18px 0;overflow-x:auto;border:1px solid #ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>thead tr:nth-child(2) th{padding-top:0;font-weight:normal;font-size:.9em;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.action{text-align:center;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td.action i:before{color:#e51400;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionDetached td{background-color:#ffe7e5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td.action i:before{content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td{background-color:hsl(0,0%,98.5%);}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionUnchanged td:nth-child(n+3){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td.action i:before{color:#1e6dab;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionModified td{background-color:#f4f9fd;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td.action i:before{color:#60a917;content:"";}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr.actionAdded td{background-color:#e7f9d5;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody tr:not(.actionUnchanged) td.actionUnchanged:nth-child(n+3):not(.headerDeviceSerialNumber){color:#ccc;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError{color:#e51400;background-color:#fff1ef;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionError span.errorMessage{display:none;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.actionModified{background-color:#e2f0fa!important;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceSerialNumber,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedDate,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerDeviceDecommissionedReason,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerModelId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerBatchId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerProfileId,#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody td.headerAssignedUserId{white-space:nowrap;}#Devices_Import_Review #Devices_Import_Review_TableContainer table>tbody span.smallMessage{color:inherit;} \ No newline at end of file diff --git a/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs b/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs index 50fc1f47..d387e176 100644 --- a/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs +++ b/Disco.Web/Extensions/T4MVC/API.DeviceController.generated.cs @@ -320,6 +320,7 @@ namespace Disco.Web.Areas.API.Controllers { public readonly string id = "id"; public readonly string DeviceProfileId = "DeviceProfileId"; + public readonly string enforceOrganisationalUnit = "enforceOrganisationalUnit"; public readonly string redirect = "redirect"; } static readonly ActionParamsClass_UpdateDeviceBatchId s_params_UpdateDeviceBatchId = new ActionParamsClass_UpdateDeviceBatchId(); @@ -582,16 +583,17 @@ namespace Disco.Web.Areas.API.Controllers } [NonAction] - partial void UpdateDeviceProfileIdOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DeviceProfileId, bool redirect); + partial void UpdateDeviceProfileIdOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string DeviceProfileId, bool enforceOrganisationalUnit, bool redirect); [NonAction] - public override System.Web.Mvc.ActionResult UpdateDeviceProfileId(string id, string DeviceProfileId, bool redirect) + public override System.Web.Mvc.ActionResult UpdateDeviceProfileId(string id, string DeviceProfileId, bool enforceOrganisationalUnit, bool redirect) { var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDeviceProfileId); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileId", DeviceProfileId); + ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "enforceOrganisationalUnit", enforceOrganisationalUnit); ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect); - UpdateDeviceProfileIdOverride(callInfo, id, DeviceProfileId, redirect); + UpdateDeviceProfileIdOverride(callInfo, id, DeviceProfileId, enforceOrganisationalUnit, redirect); return callInfo; } diff --git a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml index 1bcc55ce..bb5a7435 100644 --- a/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml +++ b/Disco.Web/Views/Device/DeviceParts/_Subject.cshtml @@ -386,31 +386,38 @@ @if (Model.Device.CanUpdateDeviceProfile()) { - @Html.ActionLinkSmallButton("Update Profile", MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true), "Device_Show_Policies_Profile_Actions_Update_Button") +
-
-
    - @foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name)) - { - var isDecommissioned = Model.DecommissionedDeviceProfileIds.Contains(dp.Id); -
  • - -
  • - if (isDecommissioned) + @using (Html.BeginForm(MVC.API.Device.UpdateDeviceProfileId(Model.Device.SerialNumber, redirect: true))) + { +
    + @Html.AntiForgeryToken() +
      + @foreach (var dp in Model.DeviceProfiles.OrderBy(i => i.Name)) { - + var isDecommissioned = Model.DecommissionedDeviceProfileIds.Contains(dp.Id); +
    • + +
    • + if (isDecommissioned) + { + + } } +
    + @if (Model.DecommissionedDeviceProfileIds.Count > 0) + { + Show Decommissioned } -
- @if (Model.DecommissionedDeviceProfileIds.Count > 0) - { - Show Decommissioned - } -
+
+
+ +
+ } \r\n"); +"utton.click(function (e) {\r\n e.preventDefault" + +"();\r\n\r\n if (!buttonDialog) {\r\n " + +" buttonDialog = $(\'#Device_Show_Policies_Profile_Actions" + +"_Update_Dialog\')\r\n .d" + +"ialog({\r\n resizab" + +"le: false,\r\n moda" + +"l: true,\r\n maxHei" + +"ght: 450,\r\n autoO" + +"pen: false,\r\n but" + +"tons: {\r\n \"Up" + +"date Profile\": function () {\r\n " + +" var deviceProfileId = dialogInputs.filter(\':checked\').val(" + +");\r\n if (" + +"deviceProfileId) {\r\n " + +" var $this = $(this);\r\n " + +" $this.dialog(\"disable\");\r\n " + +" $this.dialog(\"option\", \"" + +"buttons\", null);\r\n " + +" $this.find(\'form\').submit();\r\n " + +" } else {\r\n " + +" alert(\'A device profile must be select" + +"ed\');\r\n }" + +"\r\n },\r\n " + +" Cancel: function (" + +") {\r\n $(t" + +"his).dialog(\"close\");\r\n " + +" }\r\n }\r" + +"\n });\r\n " + +" dialogInputs = buttonDialog.find(\'input[type=\"radio\"]\'" + +");\r\n dialogContainers = dialogInputs.clos" + +"est(\'li\');\r\n\r\n dialogInputs.change(functi" + +"on () {\r\n const $this = $(this);\r\n " + +" dialogContainers.removeClass(\'selected\'" + +");\r\n\r\n $this.closest(\'li\').addClass(\'" + +"selected\');\r\n $(\'#deviceProfileMoveOr" + +"ganisationalUnit\').prop(\'checked\', $this.attr(\'data-ouenforced\') === \'True\');\r\n " + +" });\r\n " + +" buttonDialog.find(\'.show-decommissioned\')\r\n " + +" .click(function (e) {\r\n " + +" e.preventDefault();\r\n var $this" + +" = $(this);\r\n buttonDialog.find(\'" + +"ul.none\')\r\n .find(\'li.hidden\'" + +").removeClass(\'hidden\')\r\n .fi" + +"lter(\'.decommissioned-padding\').remove();\r\n " + +" $this.remove();\r\n retu" + +"rn false;\r\n })\r\n " + +" }\r\n\r\n dialogInputs.filter(\'[da" + +"ta-deviceprofileid=\' + currentProfile + \']\').prop(\'checked\', true).change();\r\n\r\n" + +" buttonDialog.dialog(\'open\');\r\n " + +" return false;\r\n });\r\n\r\n " + +" });\r\n \r\n"); - #line 477 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 487 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -1865,13 +1947,13 @@ WriteLiteral(" class=\"status\""); WriteLiteral(">\r\n"); - #line 480 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 490 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 480 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 490 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.DeviceBatchId.HasValue) { @@ -1885,13 +1967,13 @@ WriteLiteral(" title=\"Device Batch\""); WriteLiteral(">\r\n"); - #line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 493 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 483 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 493 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Authorization.Has(Claims.Config.DeviceBatch.Show)) { @@ -1899,14 +1981,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 485 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 495 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLink(Model.Device.DeviceBatch.Name, MVC.Config.DeviceBatch.Index(Model.Device.DeviceBatchId.Value))); #line default #line hidden - #line 485 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 495 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else @@ -1916,14 +1998,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 489 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 499 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceBatch.Name); #line default #line hidden - #line 489 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 499 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -1947,7 +2029,7 @@ WriteLiteral(">Purchased:\r\n \r\n WriteLiteral(" "); - #line 498 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 508 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.PurchaseDate)); @@ -1965,7 +2047,7 @@ WriteLiteral(">Supplier:\r\n \r\n WriteLiteral(" "); - #line 506 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 516 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceBatch.Supplier ?? "Unknown"); @@ -1980,14 +2062,14 @@ WriteLiteral(" title=\"Warranty Valid Until\""); WriteLiteral(">Warranty Until:\r\n \r\n " + " (Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null + #line 523 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create("", 33487), Tuple.Create(Model.Device.DeviceBatch.WarrantyValidUntil.HasValue && Model.Device.DeviceBatch.WarrantyValidUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 32549), false) +, 33487), false) ); WriteLiteral(">\r\n"); @@ -1995,7 +2077,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 514 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 524 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.WarrantyValidUntil, "Unknown", null)); @@ -2013,7 +2095,7 @@ WriteLiteral(">Insurance Supplier:\r\n Insured Until:\r\n \r\n " + " (Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null + #line 539 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create("", 34489), Tuple.Create(Model.Device.DeviceBatch.InsuredUntil.HasValue && Model.Device.DeviceBatch.InsuredUntil.Value < DateTime.Now ? "alert" : null #line default #line hidden -, 33551), false) +, 34489), false) ); WriteLiteral(">\r\n"); @@ -2043,7 +2125,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 530 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 540 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(CommonHelpers.FriendlyDate(Model.Device.DeviceBatch.InsuredUntil, "Unknown", null)); @@ -2053,7 +2135,7 @@ WriteLiteral("\r\n \r\n " \r\n"); - #line 534 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 544 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else { @@ -2064,7 +2146,7 @@ WriteLiteral("\r\n \r\n WriteLiteral("

Batch: Not Associated

\r\n"); - #line 538 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 548 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2073,7 +2155,7 @@ WriteLiteral("

Batch: Not Associated

\r\ WriteLiteral(" "); - #line 539 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 549 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateDeviceBatch()) { @@ -2081,14 +2163,14 @@ WriteLiteral(" "); #line default #line hidden - #line 541 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 551 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Update Batch", MVC.API.Device.UpdateDeviceBatchId(Model.Device.SerialNumber, null, true), "Device_Show_Policies_Batch_Actions_Update_Button")); #line default #line hidden - #line 541 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 551 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2110,13 +2192,13 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 546 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 556 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 546 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 556 "..\..\Views\Device\DeviceParts\_Subject.cshtml" foreach (var db in Model.DeviceBatches.OrderBy(i => i.Name)) { var isDecommissioned = Model.DecommissionedDeviceBatchIds.Contains(db.Id); @@ -2126,27 +2208,27 @@ WriteLiteral(">\r\n"); #line hidden WriteLiteral(" (isDecommissioned ? "hidden" : null + #line 559 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create("", 35816), Tuple.Create(isDecommissioned ? "hidden" : null #line default #line hidden -, 34878), false) +, 35816), false) ); WriteLiteral(">\r\n (db.PurchaseDate.ToLongDateString() + #line 560 "..\..\Views\Device\DeviceParts\_Subject.cshtml" +, Tuple.Create(Tuple.Create(" ", 35925), Tuple.Create(db.PurchaseDate.ToLongDateString() #line default #line hidden -, 34988), false) +, 35926), false) ); WriteLiteral(">\r\n \r\n"); WriteLiteral(" "); - #line 552 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 562 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(db.Name); @@ -2181,7 +2263,7 @@ WriteLiteral("\r\n \r\n " \r\n"); - #line 555 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 565 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (isDecommissioned) { @@ -2195,7 +2277,7 @@ WriteLiteral(" class=\"hidden decommissioned-padding\""); WriteLiteral(">\r\n"); - #line 558 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 568 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } } @@ -2205,13 +2287,13 @@ WriteLiteral(">\r\n"); WriteLiteral(" \r\n"); - #line 561 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 571 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 561 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 571 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.DecommissionedDeviceBatchIds.Count > 0) { @@ -2227,7 +2309,7 @@ WriteLiteral(" href=\"#\""); WriteLiteral(">Show Decommissioned\r\n"); - #line 564 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 574 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2239,7 +2321,7 @@ WriteLiteral(" \r\n"); - #line 631 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 641 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2328,13 +2410,13 @@ WriteLiteral(" title=\"Model Description\""); WriteLiteral(">\r\n"); - #line 639 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 649 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 639 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 649 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Authorization.Has(Claims.Config.DeviceModel.Show)) { @@ -2342,14 +2424,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 641 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 651 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLink(Model.Device.DeviceModel.ToString(), MVC.Config.DeviceModel.Index(Model.Device.DeviceModelId))); #line default #line hidden - #line 641 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 651 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } else @@ -2359,14 +2441,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 645 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.DeviceModel.ToString()); #line default #line hidden - #line 645 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2379,14 +2461,14 @@ WriteLiteral(" id=\"Device_Show_Aspects_Model_Image\""); WriteLiteral(" alt=\"Model Image\""); -WriteAttribute("src", Tuple.Create(" src=\"", 41232), Tuple.Create("\"", 41342) +WriteAttribute("src", Tuple.Create(" src=\"", 42170), Tuple.Create("\"", 42280) - #line 648 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 41238), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) + #line 658 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 42176), Tuple.Create(Url.Action(MVC.API.DeviceModel.Image(Model.Device.DeviceModelId, Model.Device.DeviceModel.ImageHash())) #line default #line hidden -, 41238), false) +, 42176), false) ); WriteLiteral(" />\r\n \r\n \r\n \r\n \r\n \r\n"); - #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 665 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 655 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 665 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanCreateJob()) { Html.BundleDeferred("~/ClientScripts/Modules/Disco-CreateJob"); @@ -2416,14 +2498,14 @@ WriteLiteral(">\r\n"); #line default #line hidden - #line 658 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 668 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Create Job", MVC.Job.Create(Model.Device.SerialNumber, Model.Device.AssignedUserId), "buttonCreateJob")); #line default #line hidden - #line 658 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 668 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2433,7 +2515,7 @@ WriteLiteral(">\r\n"); WriteLiteral(" "); - #line 660 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 670 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateAssignment()) { @@ -2465,13 +2547,13 @@ WriteLiteral(" class=\"fa fa-info-circle information\""); WriteLiteral("> Assign to User:\r\n
\r\n"); - #line 666 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 676 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 666 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 676 "..\..\Views\Device\DeviceParts\_Subject.cshtml" using (Html.BeginForm(MVC.API.Device.UpdateAssignedUserId(Model.Device.SerialNumber, redirect: true))) { @@ -2489,7 +2571,7 @@ WriteLiteral(" type=\"text\""); WriteLiteral(" />\r\n"); - #line 669 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 679 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2511,13 +2593,13 @@ WriteLiteral(@"> "); - #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 688 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 678 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 688 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (assignedUser != null) { @@ -2541,7 +2623,7 @@ WriteLiteral(@" WriteLiteral("\r\n"); - #line 691 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 701 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2572,7 +2654,7 @@ WriteLiteral("\r\n \"Assign\": function () {\r\n " \'"); - #line 722 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 732 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Url.Action(MVC.API.Search.UsersUpstream())); @@ -2602,7 +2684,7 @@ WriteLiteral(@"', "); - #line 743 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 753 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2611,7 +2693,7 @@ WriteLiteral(@"', WriteLiteral(" "); - #line 744 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 754 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateTrustEnrol()) { @@ -2619,14 +2701,14 @@ WriteLiteral(" "); #line default #line hidden - #line 746 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Trust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, true.ToString(), true), "Device_Show_Device_Actions_TrustEnrol_Button")); #line default #line hidden - #line 746 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2667,7 +2749,7 @@ WriteLiteral(">This action will allow a device claiming to have the "\'"); - #line 756 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 766 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.SerialNumber); @@ -2709,7 +2791,7 @@ WriteLiteral(">\r\n $(function () {\r\n " });\r\n \r\n"); - #line 796 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 806 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2718,7 +2800,7 @@ WriteLiteral(">\r\n $(function () {\r\n WriteLiteral(" "); - #line 797 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 807 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanUpdateUntrustEnrol()) { @@ -2726,14 +2808,14 @@ WriteLiteral(" "); #line default #line hidden - #line 799 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Untrust Enrol", MVC.API.Device.UpdateAllowUnauthenticatedEnrol(Model.Device.SerialNumber, false.ToString(), true), "Device_Show_Device_Actions_UntrustEnrol_Button")); #line default #line hidden - #line 799 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 809 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2804,7 +2886,7 @@ WriteLiteral(@"> "); - #line 839 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2813,7 +2895,7 @@ WriteLiteral(@"> WriteLiteral(" "); - #line 840 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 850 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanDecommission()) { @@ -2821,14 +2903,14 @@ WriteLiteral(" "); #line default #line hidden - #line 842 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Decommission", MVC.API.Device.Decommission(), "Device_Show_Device_Actions_Decommission_Button")); #line default #line hidden - #line 842 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -2860,13 +2942,13 @@ WriteLiteral(" class=\"none\""); WriteLiteral(">\r\n"); - #line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml" #line default #line hidden - #line 849 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 859 "..\..\Views\Device\DeviceParts\_Subject.cshtml" foreach (DecommissionReasons decommissionReason in Enum.GetValues(typeof(DecommissionReasons)).Cast().OrderBy(r => r.ToString())) { @@ -2877,34 +2959,34 @@ WriteLiteral("
  • \r\n WriteLiteral(" type=\"radio\""); -WriteAttribute("id", Tuple.Create(" id=\"", 52907), Tuple.Create("\"", 52985) -, Tuple.Create(Tuple.Create("", 52912), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 52912), true) +WriteAttribute("id", Tuple.Create(" id=\"", 53845), Tuple.Create("\"", 53923) +, Tuple.Create(Tuple.Create("", 53850), Tuple.Create("Device_Show_Device_Actions_Decommission_Reason_", 53850), true) - #line 852 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 52959), Tuple.Create((int)decommissionReason + #line 862 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 53897), Tuple.Create((int)decommissionReason #line default #line hidden -, 52959), false) +, 53897), false) ); WriteLiteral("\r\n name=\"Device_Show_Device_Actions_Dec" + "ommission_Reason\""); -WriteAttribute("value", Tuple.Create(" value=\"", 53084), Tuple.Create("\"", 53118) +WriteAttribute("value", Tuple.Create(" value=\"", 54022), Tuple.Create("\"", 54056) - #line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml" - , Tuple.Create(Tuple.Create("", 53092), Tuple.Create((int)decommissionReason + #line 863 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 54030), Tuple.Create((int)decommissionReason #line default #line hidden -, 53092), false) +, 54030), false) ); WriteLiteral(" "); - #line 853 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 863 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write((decommissionReason == DecommissionReasons.EndOfLife) ? "checked=\"checked\"" : string.Empty); @@ -2912,21 +2994,21 @@ WriteLiteral(" "); #line hidden WriteLiteral(" />\r\n ((int)decommissionReason + #line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + , Tuple.Create(Tuple.Create("", 54253), Tuple.Create((int)decommissionReason #line default #line hidden -, 53315), false) +, 54253), false) ); WriteLiteral(">"); - #line 854 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(decommissionReason.ReasonMessage()); @@ -2935,7 +3017,7 @@ WriteLiteral(">"); WriteLiteral("\r\n
  • \r\n"); - #line 856 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 866 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2953,7 +3035,7 @@ WriteLiteral(">\r\n $(function () {\r\n "uttonDialog = null;\r\n var deviceSerialNumber = \'"); - #line 864 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 874 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Model.Device.SerialNumber); @@ -2986,7 +3068,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\ " });\r\n \r\n"); - #line 900 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 910 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -2995,7 +3077,7 @@ WriteLiteral("\';\r\n\r\n button.click(function () {\r\n\ WriteLiteral(" "); - #line 901 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 911 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanRecommission()) { @@ -3003,14 +3085,14 @@ WriteLiteral(" "); #line default #line hidden - #line 903 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 913 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Recommission", MVC.API.Device.Recommission(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Recommission_Button")); #line default #line hidden - #line 903 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 913 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -3064,7 +3146,7 @@ WriteLiteral(@"> "); - #line 938 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 948 "..\..\Views\Device\DeviceParts\_Subject.cshtml" } @@ -3073,7 +3155,7 @@ WriteLiteral(@"> WriteLiteral(" "); - #line 939 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 949 "..\..\Views\Device\DeviceParts\_Subject.cshtml" if (Model.Device.CanDelete()) { @@ -3081,14 +3163,14 @@ WriteLiteral(" "); #line default #line hidden - #line 941 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml" Write(Html.ActionLinkSmallButton("Delete Device", MVC.API.Device.Delete(Model.Device.SerialNumber, true), "Device_Show_Device_Actions_Delete_Button")); #line default #line hidden - #line 941 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 951 "..\..\Views\Device\DeviceParts\_Subject.cshtml" @@ -3148,7 +3230,7 @@ WriteLiteral(@"> "); - #line 979 "..\..\Views\Device\DeviceParts\_Subject.cshtml" + #line 989 "..\..\Views\Device\DeviceParts\_Subject.cshtml" }