resolves #179: filter noticeboard by job queue
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Disco.Models.Services.Jobs.Noticeboards
|
namespace Disco.Models.Services.Jobs.Noticeboards
|
||||||
{
|
{
|
||||||
@@ -9,6 +10,7 @@ namespace Disco.Models.Services.Jobs.Noticeboards
|
|||||||
string DeviceSerialNumber { get; }
|
string DeviceSerialNumber { get; }
|
||||||
string DeviceComputerNameFriendly { get; }
|
string DeviceComputerNameFriendly { get; }
|
||||||
string DeviceComputerName { get; }
|
string DeviceComputerName { get; }
|
||||||
|
string DeviceName { get; }
|
||||||
|
|
||||||
string DeviceLocation { get; }
|
string DeviceLocation { get; }
|
||||||
string DeviceDescription { get; }
|
string DeviceDescription { get; }
|
||||||
@@ -16,6 +18,7 @@ namespace Disco.Models.Services.Jobs.Noticeboards
|
|||||||
int DeviceProfileId { get; }
|
int DeviceProfileId { get; }
|
||||||
int? DeviceAddressId { get; }
|
int? DeviceAddressId { get; }
|
||||||
string DeviceAddressShortName { get; }
|
string DeviceAddressShortName { get; }
|
||||||
|
IEnumerable<int> JobQueueIds { get; }
|
||||||
|
|
||||||
string UserId { get; }
|
string UserId { get; }
|
||||||
string UserIdFriendly { get; }
|
string UserIdFriendly { get; }
|
||||||
|
|||||||
@@ -16,20 +16,22 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
public string DeviceSerialNumber { get; set; }
|
public string DeviceSerialNumber { get; set; }
|
||||||
public string DeviceComputerNameFriendly
|
public string DeviceComputerNameFriendly
|
||||||
{
|
{
|
||||||
get
|
get => DeviceComputerName == null ? null : ActiveDirectory.FriendlyAccountId(DeviceComputerName);
|
||||||
{
|
|
||||||
return DeviceComputerName == null ? null : ActiveDirectory.FriendlyAccountId(DeviceComputerName);
|
|
||||||
}
|
|
||||||
set { } // for XML Serialization
|
set { } // for XML Serialization
|
||||||
}
|
}
|
||||||
public string DeviceComputerName { get; set; }
|
public string DeviceComputerName { get; set; }
|
||||||
|
public string DeviceName
|
||||||
|
{
|
||||||
|
get => DeviceComputerNameFriendly ?? DeviceSerialNumber;
|
||||||
|
set { }
|
||||||
|
}
|
||||||
|
|
||||||
public string DeviceLocation { get; set; }
|
public string DeviceLocation { get; set; }
|
||||||
public string DeviceDescription
|
public string DeviceDescription
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
StringBuilder sb = new StringBuilder(DeviceComputerNameFriendly);
|
StringBuilder sb = new StringBuilder(DeviceName);
|
||||||
|
|
||||||
if (UserId != null)
|
if (UserId != null)
|
||||||
sb.Append(" - ").Append(UserDisplayName).Append(" (").Append(UserIdFriendly).Append(")");
|
sb.Append(" - ").Append(UserDisplayName).Append(" (").Append(UserIdFriendly).Append(")");
|
||||||
@@ -60,6 +62,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
}
|
}
|
||||||
set { } // for XML Serialization
|
set { } // for XML Serialization
|
||||||
}
|
}
|
||||||
|
public IEnumerable<int> JobQueueIds { get; set; }
|
||||||
|
|
||||||
public string UserId { get; set; }
|
public string UserId { get; set; }
|
||||||
public string UserIdFriendly
|
public string UserIdFriendly
|
||||||
@@ -130,6 +133,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
DeviceLocation = j.Device.Location,
|
DeviceLocation = j.Device.Location,
|
||||||
DeviceProfileId = j.Device.DeviceProfileId,
|
DeviceProfileId = j.Device.DeviceProfileId,
|
||||||
DeviceAddressId = j.Device.DeviceProfile.DefaultOrganisationAddress,
|
DeviceAddressId = j.Device.DeviceProfile.DefaultOrganisationAddress,
|
||||||
|
JobQueueIds = j.JobQueues.Where(q => q.RemovedDate == null).Select(q => q.JobQueueId),
|
||||||
UserId = j.Device.AssignedUserId,
|
UserId = j.Device.AssignedUserId,
|
||||||
UserDisplayName = j.Device.AssignedUser.DisplayName,
|
UserDisplayName = j.Device.AssignedUser.DisplayName,
|
||||||
WaitingForUserAction = j.WaitingForUserAction.HasValue || ((j.JobMetaNonWarranty.AccountingChargeRequiredDate.HasValue || j.JobMetaNonWarranty.AccountingChargeAddedDate.HasValue) && !j.JobMetaNonWarranty.AccountingChargePaidDate.HasValue),
|
WaitingForUserAction = j.WaitingForUserAction.HasValue || ((j.JobMetaNonWarranty.AccountingChargeRequiredDate.HasValue || j.JobMetaNonWarranty.AccountingChargeAddedDate.HasValue) && !j.JobMetaNonWarranty.AccountingChargePaidDate.HasValue),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
{
|
{
|
||||||
public const string Name = "HeldDevices";
|
public const string Name = "HeldDevices";
|
||||||
|
|
||||||
private readonly static List<string> MonitorJobProperties = new List<string>() {
|
private static readonly List<string> MonitorJobProperties = new List<string>() {
|
||||||
"DeviceSerialNumber",
|
"DeviceSerialNumber",
|
||||||
"UserId",
|
"UserId",
|
||||||
"ExpectedClosedDate",
|
"ExpectedClosedDate",
|
||||||
@@ -25,25 +25,25 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
"DeviceReadyForReturn",
|
"DeviceReadyForReturn",
|
||||||
"DeviceReturnedDate"
|
"DeviceReturnedDate"
|
||||||
};
|
};
|
||||||
private readonly static List<string> MonitorJobMetaNonWarrantyProperties = new List<string>(){
|
private static readonly List<string> MonitorJobMetaNonWarrantyProperties = new List<string>(){
|
||||||
"AccountingChargeRequiredDate",
|
"AccountingChargeRequiredDate",
|
||||||
"AccountingChargeAddedDate",
|
"AccountingChargeAddedDate",
|
||||||
"AccountingChargePaidDate"
|
"AccountingChargePaidDate"
|
||||||
};
|
};
|
||||||
private readonly static List<string> MonitorDeviceProperties = new List<string>(){
|
private static readonly List<string> MonitorDeviceProperties = new List<string>(){
|
||||||
"Location",
|
"Location",
|
||||||
"DeviceProfileId",
|
"DeviceProfileId",
|
||||||
"DeviceDomainId",
|
"DeviceDomainId",
|
||||||
"AssignedUserId",
|
"AssignedUserId",
|
||||||
};
|
};
|
||||||
private readonly static List<string> MonitorDeviceProfileProperties = new List<string>(){
|
private static readonly List<string> MonitorDeviceProfileProperties = new List<string>(){
|
||||||
"DefaultOrganisationAddress"
|
"DefaultOrganisationAddress"
|
||||||
};
|
};
|
||||||
private readonly static List<string> MonitorUserProperties = new List<string>(){
|
private static readonly List<string> MonitorUserProperties = new List<string>(){
|
||||||
"DisplayName"
|
"DisplayName"
|
||||||
};
|
};
|
||||||
|
|
||||||
private static Subject<Tuple<List<string>, List<string>>> BufferedUpdateStream;
|
private static readonly Subject<Tuple<List<string>, List<string>>> BufferedUpdateStream;
|
||||||
|
|
||||||
static HeldDevices()
|
static HeldDevices()
|
||||||
{
|
{
|
||||||
@@ -74,7 +74,9 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
) ||
|
) ||
|
||||||
(e.EntityType == typeof(User) &&
|
(e.EntityType == typeof(User) &&
|
||||||
(e.EventType == RepositoryMonitorEventType.Modified && e.ModifiedProperties.Any(p => MonitorUserProperties.Contains(p)))
|
(e.EventType == RepositoryMonitorEventType.Modified && e.ModifiedProperties.Any(p => MonitorUserProperties.Contains(p)))
|
||||||
)
|
) ||
|
||||||
|
(e.EntityType == typeof(JobQueueJob) &&
|
||||||
|
(e.EventType == RepositoryMonitorEventType.Added || e.EventType == RepositoryMonitorEventType.Modified))
|
||||||
)
|
)
|
||||||
.Subscribe(RepositoryEvent);
|
.Subscribe(RepositoryEvent);
|
||||||
}
|
}
|
||||||
@@ -147,6 +149,15 @@ namespace Disco.Services.Jobs.Noticeboards
|
|||||||
.Select(j => j.DeviceSerialNumber)
|
.Select(j => j.DeviceSerialNumber)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
else if (i.EntityType == typeof(JobQueueJob))
|
||||||
|
{
|
||||||
|
var jqj = (JobQueueJob)i.Entity;
|
||||||
|
var j = i.Database.Jobs.Find(jqj.JobId);
|
||||||
|
if (j != null && j.DeviceSerialNumber != null)
|
||||||
|
{
|
||||||
|
deviceSerialNumbers.Add(j.DeviceSerialNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (deviceSerialNumbers.Count > 0 || userIds.Count > 0)
|
if (deviceSerialNumbers.Count > 0 || userIds.Count > 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Disco.Models.UI.Config.JobPreferences;
|
using Disco.Models.UI.Config.JobPreferences;
|
||||||
using Disco.Services.Authorization;
|
using Disco.Services.Authorization;
|
||||||
|
using Disco.Services.Jobs.JobQueues;
|
||||||
using Disco.Services.Plugins.Features.UIExtension;
|
using Disco.Services.Plugins.Features.UIExtension;
|
||||||
using Disco.Services.Web;
|
using Disco.Services.Web;
|
||||||
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
namespace Disco.Web.Areas.Config.Controllers
|
namespace Disco.Web.Areas.Config.Controllers
|
||||||
@@ -23,6 +25,9 @@ namespace Disco.Web.Areas.Config.Controllers
|
|||||||
OnCreateExpression = Database.DiscoConfiguration.JobPreferences.OnCreateExpression,
|
OnCreateExpression = Database.DiscoConfiguration.JobPreferences.OnCreateExpression,
|
||||||
OnDeviceReadyForReturnExpression = Database.DiscoConfiguration.JobPreferences.OnDeviceReadyForReturnExpression,
|
OnDeviceReadyForReturnExpression = Database.DiscoConfiguration.JobPreferences.OnDeviceReadyForReturnExpression,
|
||||||
OnCloseExpression = Database.DiscoConfiguration.JobPreferences.OnCloseExpression,
|
OnCloseExpression = Database.DiscoConfiguration.JobPreferences.OnCloseExpression,
|
||||||
|
DeviceProfiles = Database.DeviceProfiles.OrderBy(dp => dp.Name).ToList(),
|
||||||
|
OrganisationAddresses = Database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList(),
|
||||||
|
JobQueues = JobQueueService.GetQueues().Select(q => q.JobQueue).OrderBy(q => q.Name).ToList(),
|
||||||
};
|
};
|
||||||
|
|
||||||
// UI Extensions
|
// UI Extensions
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
using Disco.Data.Repository;
|
using Disco.Models.Services.Jobs;
|
||||||
using Disco.Models.Services.Jobs;
|
|
||||||
using Disco.Models.UI.Config.JobPreferences;
|
using Disco.Models.UI.Config.JobPreferences;
|
||||||
using Disco.Services.Extensions;
|
using Disco.Services.Extensions;
|
||||||
using System;
|
using System;
|
||||||
@@ -32,21 +31,9 @@ namespace Disco.Web.Areas.Config.Models.JobPreferences
|
|||||||
return UIHelpers.NoticeboardThemes.ToList();
|
return UIHelpers.NoticeboardThemes.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Lazy<List<Disco.Models.Repository.DeviceProfile>> DeviceProfiles = new Lazy<List<Disco.Models.Repository.DeviceProfile>>(() =>
|
public List<Disco.Models.Repository.DeviceProfile> DeviceProfiles { get; set; }
|
||||||
{
|
public List<Disco.Models.BI.Config.OrganisationAddress> OrganisationAddresses { get; set; }
|
||||||
using (var database = new DiscoDataContext())
|
public List<Disco.Models.Repository.JobQueue> JobQueues { get; set; }
|
||||||
{
|
|
||||||
return database.DeviceProfiles.OrderBy(a => a.Description).ToList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
public Lazy<List<Disco.Models.BI.Config.OrganisationAddress>> OrganisationAddresses = new Lazy<List<Disco.Models.BI.Config.OrganisationAddress>>(() =>
|
|
||||||
{
|
|
||||||
using (var database = new DiscoDataContext())
|
|
||||||
{
|
|
||||||
return database.DiscoConfiguration.OrganisationAddresses.Addresses.OrderBy(a => a.Name).ToList();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
public List<KeyValuePair<int, string>> LongRunningJobDaysThresholdOptions()
|
public List<KeyValuePair<int, string>> LongRunningJobDaysThresholdOptions()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -93,8 +93,18 @@
|
|||||||
<h3>Filter</h3>
|
<h3>Filter</h3>
|
||||||
<select id="Config_ReportPrefs_Builder_Filter">
|
<select id="Config_ReportPrefs_Builder_Filter">
|
||||||
<option value=""><None></option>
|
<option value=""><None></option>
|
||||||
|
@if (Model.DeviceProfiles.Any())
|
||||||
|
{
|
||||||
<option value="DeviceProfile">Device Profile</option>
|
<option value="DeviceProfile">Device Profile</option>
|
||||||
|
}
|
||||||
|
@if (Model.OrganisationAddresses.Any())
|
||||||
|
{
|
||||||
<option value="DeviceAddress">Device Profile Address</option>
|
<option value="DeviceAddress">Device Profile Address</option>
|
||||||
|
}
|
||||||
|
@if (Model.JobQueues.Any())
|
||||||
|
{
|
||||||
|
<option value="JobQueue">Job Queue</option>
|
||||||
|
}
|
||||||
</select>
|
</select>
|
||||||
<div class="options">
|
<div class="options">
|
||||||
<div class="method">
|
<div class="method">
|
||||||
@@ -103,17 +113,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="filter-option filter-DeviceProfile">
|
<div class="filter-option filter-DeviceProfile">
|
||||||
<ul class="none">
|
<ul class="none">
|
||||||
@foreach (var deviceProfile in Model.DeviceProfiles.Value)
|
@foreach (var deviceProfile in Model.DeviceProfiles)
|
||||||
{
|
{
|
||||||
<li>
|
<li>
|
||||||
<input id="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)" type="checkbox" value="@deviceProfile.Id" /><label for="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)">@deviceProfile.Description</label>
|
<input id="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)" type="checkbox" value="@deviceProfile.Id" /><label for="Config_ReportPrefs_Builder_DP_@(deviceProfile.Id)">@deviceProfile.Name</label>
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="filter-option filter-DeviceAddress">
|
<div class="filter-option filter-DeviceAddress">
|
||||||
<ul class="none">
|
<ul class="none">
|
||||||
@foreach (var address in Model.OrganisationAddresses.Value)
|
@foreach (var address in Model.OrganisationAddresses)
|
||||||
{
|
{
|
||||||
<li>
|
<li>
|
||||||
<input id="Config_ReportPrefs_Builder_OA_@(address.Id)" type="checkbox" value="@address.ShortName" /><label for="Config_ReportPrefs_Builder_OA_@(address.Id)">@address.Name (@address.ShortName)</label>
|
<input id="Config_ReportPrefs_Builder_OA_@(address.Id)" type="checkbox" value="@address.ShortName" /><label for="Config_ReportPrefs_Builder_OA_@(address.Id)">@address.Name (@address.ShortName)</label>
|
||||||
@@ -121,6 +131,16 @@
|
|||||||
}
|
}
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="filter-option filter-JobQueue">
|
||||||
|
<ul class="none">
|
||||||
|
@foreach (var queue in Model.JobQueues)
|
||||||
|
{
|
||||||
|
<li>
|
||||||
|
<input id="Config_ReportPrefs_Builder_JQ_@(queue.Id)" type="checkbox" value="@queue.Id" /><label for="Config_ReportPrefs_Builder_JQ_@(queue.Id)"><i class="fa fa-@(queue.Icon) d-@(queue.IconColour)"></i> @queue.Name</label>
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -436,16 +436,82 @@ WriteLiteral(">\r\n <option");
|
|||||||
|
|
||||||
WriteLiteral(" value=\"\"");
|
WriteLiteral(" value=\"\"");
|
||||||
|
|
||||||
WriteLiteral("><None></option>\r\n <option");
|
WriteLiteral("><None></option>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 96 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 96 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
if (Model.DeviceProfiles.Any())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <option");
|
||||||
|
|
||||||
WriteLiteral(" value=\"DeviceProfile\"");
|
WriteLiteral(" value=\"DeviceProfile\"");
|
||||||
|
|
||||||
WriteLiteral(">Device Profile</option>\r\n <option");
|
WriteLiteral(">Device Profile</option>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 99 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 100 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
if (Model.OrganisationAddresses.Any())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <option");
|
||||||
|
|
||||||
WriteLiteral(" value=\"DeviceAddress\"");
|
WriteLiteral(" value=\"DeviceAddress\"");
|
||||||
|
|
||||||
WriteLiteral(">Device Profile Address</option>\r\n </select>\r\n " +
|
WriteLiteral(">Device Profile Address</option>\r\n");
|
||||||
" <div");
|
|
||||||
|
|
||||||
|
#line 103 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 104 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
if (Model.JobQueues.Any())
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <option");
|
||||||
|
|
||||||
|
WriteLiteral(" value=\"JobQueue\"");
|
||||||
|
|
||||||
|
WriteLiteral(">Job Queue</option>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 107 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </select>\r\n <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"options\"");
|
WriteLiteral(" class=\"options\"");
|
||||||
|
|
||||||
@@ -495,14 +561,14 @@ WriteLiteral(" class=\"none\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 106 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 116 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 106 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 116 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
foreach (var deviceProfile in Model.DeviceProfiles.Value)
|
foreach (var deviceProfile in Model.DeviceProfiles)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -511,47 +577,47 @@ WriteLiteral(">\r\n");
|
|||||||
WriteLiteral(" <li>\r\n " +
|
WriteLiteral(" <li>\r\n " +
|
||||||
" <input");
|
" <input");
|
||||||
|
|
||||||
WriteAttribute("id", Tuple.Create(" id=\"", 7313), Tuple.Create("\"", 7367)
|
WriteAttribute("id", Tuple.Create(" id=\"", 7806), Tuple.Create("\"", 7860)
|
||||||
, Tuple.Create(Tuple.Create("", 7318), Tuple.Create("Config_ReportPrefs_Builder_DP_", 7318), true)
|
, Tuple.Create(Tuple.Create("", 7811), Tuple.Create("Config_ReportPrefs_Builder_DP_", 7811), true)
|
||||||
|
|
||||||
#line 109 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 7348), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
, Tuple.Create(Tuple.Create("", 7841), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 7348), false)
|
, 7841), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" type=\"checkbox\"");
|
WriteLiteral(" type=\"checkbox\"");
|
||||||
|
|
||||||
WriteAttribute("value", Tuple.Create(" value=\"", 7384), Tuple.Create("\"", 7409)
|
WriteAttribute("value", Tuple.Create(" value=\"", 7877), Tuple.Create("\"", 7902)
|
||||||
|
|
||||||
#line 109 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 7392), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
, Tuple.Create(Tuple.Create("", 7885), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 7392), false)
|
, 7885), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" /><label");
|
WriteLiteral(" /><label");
|
||||||
|
|
||||||
WriteAttribute("for", Tuple.Create(" for=\"", 7419), Tuple.Create("\"", 7474)
|
WriteAttribute("for", Tuple.Create(" for=\"", 7912), Tuple.Create("\"", 7967)
|
||||||
, Tuple.Create(Tuple.Create("", 7425), Tuple.Create("Config_ReportPrefs_Builder_DP_", 7425), true)
|
, Tuple.Create(Tuple.Create("", 7918), Tuple.Create("Config_ReportPrefs_Builder_DP_", 7918), true)
|
||||||
|
|
||||||
#line 109 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 7455), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
, Tuple.Create(Tuple.Create("", 7948), Tuple.Create<System.Object, System.Int32>(deviceProfile.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 7455), false)
|
, 7948), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 109 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
Write(deviceProfile.Description);
|
Write(deviceProfile.Name);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -559,7 +625,7 @@ WriteLiteral(">");
|
|||||||
WriteLiteral("</label>\r\n </li>\r\n");
|
WriteLiteral("</label>\r\n </li>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 111 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 121 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -577,14 +643,14 @@ WriteLiteral(" class=\"none\"");
|
|||||||
WriteLiteral(">\r\n");
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 116 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 126 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
|
|
||||||
#line 116 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 126 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
foreach (var address in Model.OrganisationAddresses.Value)
|
foreach (var address in Model.OrganisationAddresses)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
@@ -593,46 +659,46 @@ WriteLiteral(">\r\n");
|
|||||||
WriteLiteral(" <li>\r\n " +
|
WriteLiteral(" <li>\r\n " +
|
||||||
" <input");
|
" <input");
|
||||||
|
|
||||||
WriteAttribute("id", Tuple.Create(" id=\"", 8074), Tuple.Create("\"", 8122)
|
WriteAttribute("id", Tuple.Create(" id=\"", 8554), Tuple.Create("\"", 8602)
|
||||||
, Tuple.Create(Tuple.Create("", 8079), Tuple.Create("Config_ReportPrefs_Builder_OA_", 8079), true)
|
, Tuple.Create(Tuple.Create("", 8559), Tuple.Create("Config_ReportPrefs_Builder_OA_", 8559), true)
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 8109), Tuple.Create<System.Object, System.Int32>(address.Id
|
, Tuple.Create(Tuple.Create("", 8589), Tuple.Create<System.Object, System.Int32>(address.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 8109), false)
|
, 8589), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" type=\"checkbox\"");
|
WriteLiteral(" type=\"checkbox\"");
|
||||||
|
|
||||||
WriteAttribute("value", Tuple.Create(" value=\"", 8139), Tuple.Create("\"", 8165)
|
WriteAttribute("value", Tuple.Create(" value=\"", 8619), Tuple.Create("\"", 8645)
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 8147), Tuple.Create<System.Object, System.Int32>(address.ShortName
|
, Tuple.Create(Tuple.Create("", 8627), Tuple.Create<System.Object, System.Int32>(address.ShortName
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 8147), false)
|
, 8627), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" /><label");
|
WriteLiteral(" /><label");
|
||||||
|
|
||||||
WriteAttribute("for", Tuple.Create(" for=\"", 8175), Tuple.Create("\"", 8224)
|
WriteAttribute("for", Tuple.Create(" for=\"", 8655), Tuple.Create("\"", 8704)
|
||||||
, Tuple.Create(Tuple.Create("", 8181), Tuple.Create("Config_ReportPrefs_Builder_OA_", 8181), true)
|
, Tuple.Create(Tuple.Create("", 8661), Tuple.Create("Config_ReportPrefs_Builder_OA_", 8661), true)
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 8211), Tuple.Create<System.Object, System.Int32>(address.Id
|
, Tuple.Create(Tuple.Create("", 8691), Tuple.Create<System.Object, System.Int32>(address.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 8211), false)
|
, 8691), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">");
|
WriteLiteral(">");
|
||||||
|
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
Write(address.Name);
|
Write(address.Name);
|
||||||
|
|
||||||
|
|
||||||
@@ -641,7 +707,7 @@ WriteLiteral(">");
|
|||||||
WriteLiteral(" (");
|
WriteLiteral(" (");
|
||||||
|
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 129 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
Write(address.ShortName);
|
Write(address.ShortName);
|
||||||
|
|
||||||
|
|
||||||
@@ -650,7 +716,111 @@ WriteLiteral(" (");
|
|||||||
WriteLiteral(")</label>\r\n </li>\r\n");
|
WriteLiteral(")</label>\r\n </li>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 121 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
#line 131 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" </ul>\r\n </div>" +
|
||||||
|
"\r\n <div");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"filter-option filter-JobQueue\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n <ul");
|
||||||
|
|
||||||
|
WriteLiteral(" class=\"none\"");
|
||||||
|
|
||||||
|
WriteLiteral(">\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 136 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
|
||||||
|
#line 136 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
foreach (var queue in Model.JobQueues)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral(" <li>\r\n " +
|
||||||
|
" <input");
|
||||||
|
|
||||||
|
WriteAttribute("id", Tuple.Create(" id=\"", 9287), Tuple.Create("\"", 9333)
|
||||||
|
, Tuple.Create(Tuple.Create("", 9292), Tuple.Create("Config_ReportPrefs_Builder_JQ_", 9292), true)
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 9322), Tuple.Create<System.Object, System.Int32>(queue.Id
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 9322), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral(" type=\"checkbox\"");
|
||||||
|
|
||||||
|
WriteAttribute("value", Tuple.Create(" value=\"", 9350), Tuple.Create("\"", 9367)
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 9358), Tuple.Create<System.Object, System.Int32>(queue.Id
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 9358), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral(" /><label");
|
||||||
|
|
||||||
|
WriteAttribute("for", Tuple.Create(" for=\"", 9377), Tuple.Create("\"", 9424)
|
||||||
|
, Tuple.Create(Tuple.Create("", 9383), Tuple.Create("Config_ReportPrefs_Builder_JQ_", 9383), true)
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 9413), Tuple.Create<System.Object, System.Int32>(queue.Id
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 9413), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral("><i");
|
||||||
|
|
||||||
|
WriteAttribute("class", Tuple.Create(" class=\"", 9428), Tuple.Create("\"", 9477)
|
||||||
|
, Tuple.Create(Tuple.Create("", 9436), Tuple.Create("fa", 9436), true)
|
||||||
|
, Tuple.Create(Tuple.Create(" ", 9438), Tuple.Create("fa-", 9439), true)
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 9442), Tuple.Create<System.Object, System.Int32>(queue.Icon
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 9442), false)
|
||||||
|
, Tuple.Create(Tuple.Create(" ", 9455), Tuple.Create("d-", 9456), true)
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
, Tuple.Create(Tuple.Create("", 9458), Tuple.Create<System.Object, System.Int32>(queue.IconColour
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
, 9458), false)
|
||||||
|
);
|
||||||
|
|
||||||
|
WriteLiteral("></i> ");
|
||||||
|
|
||||||
|
|
||||||
|
#line 139 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
|
Write(queue.Name);
|
||||||
|
|
||||||
|
|
||||||
|
#line default
|
||||||
|
#line hidden
|
||||||
|
WriteLiteral("</label>\r\n </li>\r\n");
|
||||||
|
|
||||||
|
|
||||||
|
#line 141 "..\..\Areas\Config\Views\JobPreferences\Parts\Reports.cshtml"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Data.Repository;
|
||||||
|
using Disco.Models.Repository;
|
||||||
using Disco.Services.Jobs.Noticeboards;
|
using Disco.Services.Jobs.Noticeboards;
|
||||||
using Disco.Services.Web;
|
using Disco.Services.Web;
|
||||||
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
@@ -10,30 +10,53 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
{
|
{
|
||||||
public partial class HeldDevicesController : DatabaseController
|
public partial class HeldDevicesController : DatabaseController
|
||||||
{
|
{
|
||||||
public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
|
public virtual ActionResult Index(string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude)
|
||||||
{
|
{
|
||||||
IQueryable<Job> query = Database.Jobs;
|
var query = FilterJobs(Database.Jobs, Database, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude, JobQueueInclude, JobQueueExclude);
|
||||||
|
|
||||||
if (DeviceProfileInclude != null)
|
|
||||||
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
|
|
||||||
if (DeviceProfileExclude != null)
|
|
||||||
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
|
|
||||||
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
|
|
||||||
{
|
|
||||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
|
|
||||||
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
|
||||||
}
|
|
||||||
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
|
|
||||||
{
|
|
||||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
|
|
||||||
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
|
||||||
}
|
|
||||||
|
|
||||||
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(query);
|
var m = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(query);
|
||||||
|
|
||||||
return View(m);
|
return View(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal static IQueryable<Job> FilterJobs(IQueryable<Job> query, DiscoDataContext database, string deviceProfileInclude, string deviceProfileExclude, string deviceAddressInclude, string deviceAddressExclude, string jobQueueInclude, string jobQueueExclude)
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(deviceProfileInclude))
|
||||||
|
{
|
||||||
|
var include = deviceProfileInclude.Split(',').Select(int.Parse).ToList();
|
||||||
|
query = query.Where(j => include.Contains(j.Device.DeviceProfileId));
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrWhiteSpace(deviceProfileExclude))
|
||||||
|
{
|
||||||
|
var exclude = deviceProfileExclude.Split(',').Select(int.Parse).ToList();
|
||||||
|
query = query.Where(j => !exclude.Contains(j.Device.DeviceProfileId));
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrWhiteSpace(deviceAddressInclude))
|
||||||
|
{
|
||||||
|
var include = deviceAddressInclude.Split(',');
|
||||||
|
var addressIds = database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => include.Contains(a.ShortName)).Select(a => a.Id).ToList();
|
||||||
|
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||||
|
}
|
||||||
|
if (!string.IsNullOrWhiteSpace(deviceAddressExclude))
|
||||||
|
{
|
||||||
|
var exclude = deviceAddressExclude.Split(',');
|
||||||
|
var addressIds = database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => exclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
|
||||||
|
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
||||||
|
}
|
||||||
|
if (jobQueueInclude != null)
|
||||||
|
{
|
||||||
|
var include = jobQueueInclude.Split(',').Select(int.Parse).ToList();
|
||||||
|
query = query.Where(j => j.JobQueues.Any(q => q.RemovedDate == null && include.Contains(q.JobQueueId)));
|
||||||
|
}
|
||||||
|
if (jobQueueExclude != null)
|
||||||
|
{
|
||||||
|
var exclude = jobQueueExclude.Split(',').Select(int.Parse).ToList();
|
||||||
|
query = query.Where(j => !j.JobQueues.Any(q => q.RemovedDate == null && exclude.Contains(q.JobQueueId)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return query;
|
||||||
|
}
|
||||||
|
|
||||||
public virtual ActionResult ReadyForReturnXml()
|
public virtual ActionResult ReadyForReturnXml()
|
||||||
{
|
{
|
||||||
var readyForReturn = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(Database)
|
var readyForReturn = Disco.Services.Jobs.Noticeboards.HeldDevices.GetHeldDevices(Database)
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
using Disco.Models.Repository;
|
using Disco.Services.Jobs.Noticeboards;
|
||||||
using Disco.Services.Jobs.Noticeboards;
|
|
||||||
using Disco.Services.Web;
|
using Disco.Services.Web;
|
||||||
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
using Disco.Web.Areas.Public.Models.UserHeldDevices;
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web.Mvc;
|
using System.Web.Mvc;
|
||||||
|
|
||||||
@@ -10,24 +8,9 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
{
|
{
|
||||||
public partial class UserHeldDevicesController : DatabaseController
|
public partial class UserHeldDevicesController : DatabaseController
|
||||||
{
|
{
|
||||||
public virtual ActionResult Index(List<int?> DeviceProfileInclude, List<int?> DeviceProfileExclude, List<string> DeviceAddressInclude, List<string> DeviceAddressExclude)
|
public virtual ActionResult Index(string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude)
|
||||||
{
|
{
|
||||||
IQueryable<Job> query = Database.Jobs;
|
var query = HeldDevicesController.FilterJobs(Database.Jobs, Database, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude, JobQueueInclude, JobQueueExclude);
|
||||||
|
|
||||||
if (DeviceProfileInclude != null)
|
|
||||||
query = query.Where(j => DeviceProfileInclude.Contains(j.Device.DeviceProfileId));
|
|
||||||
if (DeviceProfileExclude != null)
|
|
||||||
query = query.Where(j => !DeviceProfileExclude.Contains(j.Device.DeviceProfileId));
|
|
||||||
if (DeviceAddressInclude != null && DeviceAddressInclude.Count > 0)
|
|
||||||
{
|
|
||||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressInclude.Contains(a.ShortName)).Select(a => a.Id).ToList();
|
|
||||||
query = query.Where(j => addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
|
||||||
}
|
|
||||||
if (DeviceAddressExclude != null && DeviceAddressExclude.Count > 0)
|
|
||||||
{
|
|
||||||
var addressIds = Database.DiscoConfiguration.OrganisationAddresses.Addresses.Where(a => DeviceAddressExclude.Contains(a.ShortName)).Select(a => (int?)a.Id).ToList();
|
|
||||||
query = query.Where(j => j.Device.DeviceProfile.DefaultOrganisationAddress == null || !addressIds.Contains(j.Device.DeviceProfile.DefaultOrganisationAddress));
|
|
||||||
}
|
|
||||||
|
|
||||||
var m = HeldDevicesForUsers.GetHeldDevicesForUsers(query);
|
var m = HeldDevicesForUsers.GetHeldDevicesForUsers(query);
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
{
|
{
|
||||||
<tr>
|
<tr>
|
||||||
<td class="id">
|
<td class="id">
|
||||||
@item.DeviceComputerNameFriendly
|
@item.DeviceName
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
@if (item.UserId != null)
|
@if (item.UserId != null)
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ WriteLiteral(" ");
|
|||||||
|
|
||||||
|
|
||||||
#line 17 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
#line 17 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
||||||
Write(item.DeviceComputerNameFriendly);
|
Write(item.DeviceName);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -448,15 +448,15 @@ WriteLiteral("\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" </td>\r\n <td");
|
WriteLiteral(" </td>\r\n <td");
|
||||||
|
|
||||||
WriteAttribute("class", Tuple.Create(" class=\"", 3397), Tuple.Create("\"", 3455)
|
WriteAttribute("class", Tuple.Create(" class=\"", 3381), Tuple.Create("\"", 3439)
|
||||||
, Tuple.Create(Tuple.Create("", 3405), Tuple.Create("timestamp", 3405), true)
|
, Tuple.Create(Tuple.Create("", 3389), Tuple.Create("timestamp", 3389), true)
|
||||||
|
|
||||||
#line 81 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
#line 81 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 3414), Tuple.Create<System.Object, System.Int32>(item.IsAlert ? " Alert" : string.Empty
|
, Tuple.Create(Tuple.Create("", 3398), Tuple.Create<System.Object, System.Int32>(item.IsAlert ? " Alert" : string.Empty
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 3414), false)
|
, 3398), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">Since ");
|
WriteLiteral(">Since ");
|
||||||
@@ -650,15 +650,15 @@ WriteLiteral("\r\n");
|
|||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" </td>\r\n <td");
|
WriteLiteral(" </td>\r\n <td");
|
||||||
|
|
||||||
WriteAttribute("class", Tuple.Create(" class=\"", 5022), Tuple.Create("\"", 5080)
|
WriteAttribute("class", Tuple.Create(" class=\"", 5006), Tuple.Create("\"", 5064)
|
||||||
, Tuple.Create(Tuple.Create("", 5030), Tuple.Create("timestamp", 5030), true)
|
, Tuple.Create(Tuple.Create("", 5014), Tuple.Create("timestamp", 5014), true)
|
||||||
|
|
||||||
#line 119 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
#line 119 "..\..\Areas\Public\Views\HeldDevices\Index.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 5039), Tuple.Create<System.Object, System.Int32>(item.IsAlert ? " Alert" : string.Empty
|
, Tuple.Create(Tuple.Create("", 5023), Tuple.Create<System.Object, System.Int32>(item.IsAlert ? " Alert" : string.Empty
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 5039), false)
|
, 5023), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">Ready ");
|
WriteLiteral(">Ready ");
|
||||||
|
|||||||
@@ -353,6 +353,42 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'jobqueueinclude': // FILTER: Job Queue Include
|
||||||
|
var jobQueues = value.split(",").map(function (v) { return parseInt(v); });
|
||||||
|
if (jobQueues.length > 0) {
|
||||||
|
filters.push(function (heldDeviceItem) {
|
||||||
|
// true if any JobQueueId is included
|
||||||
|
if (!heldDeviceItem.JobQueueIds)
|
||||||
|
return false; // not in any queues
|
||||||
|
var include = false;
|
||||||
|
$.each(jobQueues, function (i, v) {
|
||||||
|
if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {
|
||||||
|
include = true;
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return include;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'jobqueueexclude': // FILTER: Job Queue Exclude
|
||||||
|
var jobQueues = value.split(",").map(function (v) { return parseInt(v); });
|
||||||
|
if (jobQueues.length > 0) {
|
||||||
|
filters.push(function (heldDeviceItem) {
|
||||||
|
// true if any JobQueueId is excluded
|
||||||
|
if (!heldDeviceItem.JobQueueIds)
|
||||||
|
return true; // not in any queues
|
||||||
|
var exclude = false;
|
||||||
|
$.each(jobQueues, function (i, v) {
|
||||||
|
if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {
|
||||||
|
exclude = true;
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return !exclude;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -409,58 +409,88 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
|
|||||||
"luded\r\n return $.inArray(heldDeviceItem.D" +
|
"luded\r\n return $.inArray(heldDeviceItem.D" +
|
||||||
"eviceProfileId, deviceProfiles) < 0;\r\n });\r\n " +
|
"eviceProfileId, deviceProfiles) < 0;\r\n });\r\n " +
|
||||||
" }\r\n break;\r\n " +
|
" }\r\n break;\r\n " +
|
||||||
" }\r\n });\r\n\r\n if (filters." +
|
" case \'jobqueueinclude\': // FILTER: Job Queue Include\r\n " +
|
||||||
"length > 0)\r\n itemFilters = filters;\r\n " +
|
" var jobQueues = value.split(\",\").map(function (v) { " +
|
||||||
|
"return parseInt(v); });\r\n if (jobQueues.length > " +
|
||||||
|
"0) {\r\n filters.push(function (heldDeviceItem)" +
|
||||||
|
" {\r\n // true if any JobQueueId is include" +
|
||||||
|
"d\r\n if (!heldDeviceItem.JobQueueIds)\r\n " +
|
||||||
|
" return false; // not in any queues\r\n " +
|
||||||
|
" var include = false;\r\n " +
|
||||||
|
" $.each(jobQueues, function (i, v) {\r\n " +
|
||||||
|
" if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {\r\n " +
|
||||||
|
" include = true;\r\n " +
|
||||||
|
" return false; // break\r\n " +
|
||||||
|
" }\r\n });\r\n " +
|
||||||
|
" return include;\r\n });\r" +
|
||||||
|
"\n }\r\n break;\r\n " +
|
||||||
|
" case \'jobqueueexclude\': // FILTER: Job Queue Exclude\r\n " +
|
||||||
|
" var jobQueues = value.split(\",\").map(function (v) " +
|
||||||
|
"{ return parseInt(v); });\r\n if (jobQueues.length " +
|
||||||
|
"> 0) {\r\n filters.push(function (heldDeviceIte" +
|
||||||
|
"m) {\r\n // true if any JobQueueId is exclu" +
|
||||||
|
"ded\r\n if (!heldDeviceItem.JobQueueIds)\r\n " +
|
||||||
|
" return true; // not in any queues\r\n " +
|
||||||
|
" var exclude = false;\r\n " +
|
||||||
|
" $.each(jobQueues, function (i, v) {\r\n " +
|
||||||
|
" if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {\r\n " +
|
||||||
|
" exclude = true;\r\n " +
|
||||||
|
" return false; // break\r\n " +
|
||||||
|
" }\r\n });\r\n " +
|
||||||
|
" return !exclude;\r\n })" +
|
||||||
|
";\r\n }\r\n break;\r\n " +
|
||||||
|
" }\r\n });\r\n\r\n if (filt" +
|
||||||
|
"ers.length > 0)\r\n itemFilters = filters;\r\n " +
|
||||||
" else\r\n itemFilters = null;\r\n }\r\n " +
|
" else\r\n itemFilters = null;\r\n }\r\n " +
|
||||||
" }\r\n\r\n function connectionError() {\r\n try {\r\n " +
|
" }\r\n\r\n function connectionError() {\r\n try {\r\n " +
|
||||||
" $(\'body\').addClass(\'status-error\');\r\n } catch (e) {\r" +
|
" $(\'body\').addClass(\'status-error\');\r\n } catch (e" +
|
||||||
"\n // Ignore\r\n }\r\n\r\n window.setT" +
|
") {\r\n // Ignore\r\n }\r\n\r\n window." +
|
||||||
"imeout(function () {\r\n window.location.reload(true);\r\n " +
|
"setTimeout(function () {\r\n window.location.reload(true);\r\n " +
|
||||||
" }, 10000);\r\n }\r\n\r\n // Helpers\r\n functi" +
|
" }, 10000);\r\n }\r\n\r\n // Helpers\r\n fu" +
|
||||||
"on rotateArray(koArray, element) {\r\n var items = koArray();\r\n\r\n " +
|
"nction rotateArray(koArray, element) {\r\n var items = koArray();\r\n" +
|
||||||
" if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
|
||||||
" if (element.height() < (element.parent().height() - 30)) {\r\n\r\n " +
|
|
||||||
" if (findUnsortedArrayTopIndex(items) !== 0)\r\n ko" +
|
|
||||||
"Array.sort(sortFunction);\r\n\r\n // Don\'t rotate if small & sort" +
|
|
||||||
"ed correctly\r\n return;\r\n }\r\n\r\n " +
|
|
||||||
"// Move Last Item to Top\r\n var item = koArray.pop();\r\n " +
|
|
||||||
" koArray.unshift(item);\r\n }\r\n function removeItemFromA" +
|
|
||||||
"rray(koArray, deviceSerialNumber) {\r\n var items = koArray();\r\n " +
|
|
||||||
" for (var i = 0; i < items.length; i++) {\r\n if (i" +
|
|
||||||
"tems[i].DeviceSerialNumber == deviceSerialNumber) {\r\n koA" +
|
|
||||||
"rray.splice(i, 1);\r\n items = koArray();\r\n " +
|
|
||||||
" i--;\r\n }\r\n }\r\n }\r\n " +
|
|
||||||
" function findUnsortedArrayTopIndex(items) {\r\n // Only one Item" +
|
|
||||||
"\r\n if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
"\r\n if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
||||||
" for (var i = 1; i < items.length; i++) {\r\n var s =" +
|
" if (element.height() < (element.parent().height() - 30)) {\r\n\r\n " +
|
||||||
" sortFunction(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
" if (findUnsortedArrayTopIndex(items) !== 0)\r\n " +
|
||||||
|
" koArray.sort(sortFunction);\r\n\r\n // Don\'t rotate if small & " +
|
||||||
|
"sorted correctly\r\n return;\r\n }\r\n\r\n " +
|
||||||
|
" // Move Last Item to Top\r\n var item = koArray.pop();\r\n " +
|
||||||
|
" koArray.unshift(item);\r\n }\r\n function removeItemF" +
|
||||||
|
"romArray(koArray, deviceSerialNumber) {\r\n var items = koArray();\r" +
|
||||||
|
"\n for (var i = 0; i < items.length; i++) {\r\n i" +
|
||||||
|
"f (items[i].DeviceSerialNumber == deviceSerialNumber) {\r\n " +
|
||||||
|
" koArray.splice(i, 1);\r\n items = koArray();\r\n " +
|
||||||
|
" i--;\r\n }\r\n }\r\n }\r\n " +
|
||||||
|
" function findUnsortedArrayTopIndex(items) {\r\n // Only one " +
|
||||||
|
"Item\r\n if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
||||||
|
" for (var i = 1; i < items.length; i++) {\r\n var" +
|
||||||
|
" s = sortFunction(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
||||||
" return i;\r\n }\r\n\r\n return 0;\r\n " +
|
" return i;\r\n }\r\n\r\n return 0;\r\n " +
|
||||||
" }\r\n function findSortedInsertIndex(koArray, heldDeviceItem) {\r" +
|
" }\r\n function findSortedInsertIndex(koArray, heldDeviceItem" +
|
||||||
"\n var items = koArray();\r\n var startIndex = findUn" +
|
") {\r\n var items = koArray();\r\n var startIndex = fi" +
|
||||||
"sortedArrayTopIndex(items);\r\n for (var i = startIndex; i < items." +
|
"ndUnsortedArrayTopIndex(items);\r\n for (var i = startIndex; i < it" +
|
||||||
"length; i++) {\r\n var s = sortFunction(heldDeviceItem, items[i" +
|
"ems.length; i++) {\r\n var s = sortFunction(heldDeviceItem, ite" +
|
||||||
"]);\r\n if (s <= 0)\r\n return i;\r\n " +
|
"ms[i]);\r\n if (s <= 0)\r\n return i;\r\n " +
|
||||||
" }\r\n if (startIndex !== 0) {\r\n for (va" +
|
" }\r\n if (startIndex !== 0) {\r\n for" +
|
||||||
"r i = 0; i < startIndex; i++) {\r\n var s = sortFunction(he" +
|
" (var i = 0; i < startIndex; i++) {\r\n var s = sortFunctio" +
|
||||||
"ldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
|
"n(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
|
||||||
" return i;\r\n }\r\n return startInd" +
|
" return i;\r\n }\r\n return star" +
|
||||||
"ex;\r\n } else {\r\n return -1;\r\n }" +
|
"tIndex;\r\n } else {\r\n return -1;\r\n " +
|
||||||
"\r\n }\r\n function sortFunction(l, r) {\r\n retu" +
|
" }\r\n }\r\n function sortFunction(l, r) {\r\n " +
|
||||||
"rn l.DeviceDescription.toLowerCase() == r.DeviceDescription.toLowerCase() ? 0 : " +
|
"return l.DeviceDescription.toLowerCase() == r.DeviceDescription.toLowerCase() ? " +
|
||||||
"(l.DeviceDescription.toLowerCase() < r.DeviceDescription.toLowerCase() ? -1 : 1)" +
|
"0 : (l.DeviceDescription.toLowerCase() < r.DeviceDescription.toLowerCase() ? -1 " +
|
||||||
"\r\n }\r\n function isInProcess(i) {\r\n return !" +
|
": 1)\r\n }\r\n function isInProcess(i) {\r\n retu" +
|
||||||
"i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n functio" +
|
"rn !i.ReadyForReturn && !i.WaitingForUserAction;\r\n }\r\n fun" +
|
||||||
"n isReadyForReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingFo" +
|
"ction isReadyForReturn(i) {\r\n return i.ReadyForReturn && !i.Waiti" +
|
||||||
"rUserAction;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " +
|
"ngForUserAction;\r\n }\r\n function isWaitingForUserAction(i) " +
|
||||||
" return i.WaitingForUserAction;\r\n }\r\n functi" +
|
"{\r\n return i.WaitingForUserAction;\r\n }\r\n fu" +
|
||||||
"on getQueryStringParameters() {\r\n\r\n if (window.location.search.le" +
|
"nction getQueryStringParameters() {\r\n\r\n if (window.location.searc" +
|
||||||
"ngth === 0)\r\n return null;\r\n\r\n var params = {}" +
|
"h.length === 0)\r\n return null;\r\n\r\n var params " +
|
||||||
";\r\n window.location.search.substr(1).split(\"&\").forEach(function " +
|
"= {};\r\n window.location.search.substr(1).split(\"&\").forEach(funct" +
|
||||||
"(pair) {\r\n if (pair === \"\") return;\r\n var " +
|
"ion (pair) {\r\n if (pair === \"\") return;\r\n " +
|
||||||
"parts = pair.split(\"=\");\r\n params[parts[0]] = parts[1] && dec" +
|
"var parts = pair.split(\"=\");\r\n params[parts[0]] = parts[1] &&" +
|
||||||
"odeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n " +
|
" decodeURIComponent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n " +
|
||||||
" return params;\r\n }\r\n\r\n init();\r\n });\r\n </sc" +
|
" return params;\r\n }\r\n\r\n init();\r\n });\r\n " +
|
||||||
"ript>\r\n</body>\r\n</html>\r\n");
|
"</script>\r\n</body>\r\n</html>\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -353,6 +353,42 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case 'jobqueueinclude': // FILTER: Job Queue Include
|
||||||
|
var jobQueues = value.split(",").map(function (v) { return parseInt(v); });
|
||||||
|
if (jobQueues.length > 0) {
|
||||||
|
filters.push(function (heldDeviceItem) {
|
||||||
|
// true if any JobQueueId is included
|
||||||
|
if (!heldDeviceItem.JobQueueIds)
|
||||||
|
return false; // not in any queues
|
||||||
|
var include = false;
|
||||||
|
$.each(jobQueues, function (i, v) {
|
||||||
|
if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {
|
||||||
|
include = true;
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return include;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'jobqueueexclude': // FILTER: Job Queue Exclude
|
||||||
|
var jobQueues = value.split(",").map(function (v) { return parseInt(v); });
|
||||||
|
if (jobQueues.length > 0) {
|
||||||
|
filters.push(function (heldDeviceItem) {
|
||||||
|
// true if any JobQueueId is excluded
|
||||||
|
if (!heldDeviceItem.JobQueueIds)
|
||||||
|
return true; // not in any queues
|
||||||
|
var exclude = false;
|
||||||
|
$.each(jobQueues, function (i, v) {
|
||||||
|
if ($.inArray(v, heldDeviceItem.JobQueueIds) >= 0) {
|
||||||
|
exclude = true;
|
||||||
|
return false; // break
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return !exclude;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -408,58 +408,88 @@ WriteLiteral(">\r\n <li data-bind=\"css: { alert: IsAlert }\">\r\n
|
|||||||
" // true if DeviceProfileId is excluded\r\n " +
|
" // true if DeviceProfileId is excluded\r\n " +
|
||||||
" return $.inArray(heldDeviceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
|
" return $.inArray(heldDeviceItem.DeviceProfileId, deviceProfiles) < 0;\r\n " +
|
||||||
" });\r\n }\r\n " +
|
" });\r\n }\r\n " +
|
||||||
" break;\r\n }\r\n }" +
|
" break;\r\n case \'jobqueueinclud" +
|
||||||
");\r\n\r\n if (filters.length > 0)\r\n itemF" +
|
"e\': // FILTER: Job Queue Include\r\n var jobQueues " +
|
||||||
"ilters = filters;\r\n else\r\n itemFilters" +
|
"= value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
|
||||||
" = null;\r\n }\r\n }\r\n\r\n function connectionErr" +
|
" if (jobQueues.length > 0) {\r\n " +
|
||||||
"or() {\r\n try {\r\n $(\'body\').addClass(\'status-er" +
|
"filters.push(function (heldDeviceItem) {\r\n " +
|
||||||
"ror\');\r\n } catch (e) {\r\n // Ignore\r\n " +
|
" // true if any JobQueueId is included\r\n " +
|
||||||
|
" if (!heldDeviceItem.JobQueueIds)\r\n r" +
|
||||||
|
"eturn false; // not in any queues\r\n var i" +
|
||||||
|
"nclude = false;\r\n $.each(jobQueues, funct" +
|
||||||
|
"ion (i, v) {\r\n if ($.inArray(v, heldD" +
|
||||||
|
"eviceItem.JobQueueIds) >= 0) {\r\n " +
|
||||||
|
"include = true;\r\n return false; /" +
|
||||||
|
"/ break\r\n }\r\n " +
|
||||||
|
" });\r\n return include;\r\n " +
|
||||||
|
" });\r\n }\r\n " +
|
||||||
|
" break;\r\n case \'jobqueueexcl" +
|
||||||
|
"ude\': // FILTER: Job Queue Exclude\r\n var jobQueue" +
|
||||||
|
"s = value.split(\",\").map(function (v) { return parseInt(v); });\r\n " +
|
||||||
|
" if (jobQueues.length > 0) {\r\n " +
|
||||||
|
" filters.push(function (heldDeviceItem) {\r\n " +
|
||||||
|
" // true if any JobQueueId is excluded\r\n " +
|
||||||
|
" if (!heldDeviceItem.JobQueueIds)\r\n " +
|
||||||
|
" return true; // not in any queues\r\n var " +
|
||||||
|
"exclude = false;\r\n $.each(jobQueues, func" +
|
||||||
|
"tion (i, v) {\r\n if ($.inArray(v, held" +
|
||||||
|
"DeviceItem.JobQueueIds) >= 0) {\r\n " +
|
||||||
|
" exclude = true;\r\n return false; " +
|
||||||
|
"// break\r\n }\r\n " +
|
||||||
|
" });\r\n return !exclude;\r\n" +
|
||||||
|
" });\r\n }\r\n " +
|
||||||
|
" break;\r\n }\r\n " +
|
||||||
|
" });\r\n\r\n if (filters.length > 0)\r\n i" +
|
||||||
|
"temFilters = filters;\r\n else\r\n itemFil" +
|
||||||
|
"ters = null;\r\n }\r\n }\r\n\r\n function connectio" +
|
||||||
|
"nError() {\r\n try {\r\n $(\'body\').addClass(\'statu" +
|
||||||
|
"s-error\');\r\n } catch (e) {\r\n // Ignore\r\n " +
|
||||||
" }\r\n\r\n window.setTimeout(function () {\r\n " +
|
" }\r\n\r\n window.setTimeout(function () {\r\n " +
|
||||||
"window.location.reload(true);\r\n }, 10000);\r\n }\r\n\r\n " +
|
" window.location.reload(true);\r\n }, 10000);\r\n }\r\n\r\n" +
|
||||||
" // Helpers\r\n function rotateArray(koArray, element) {\r\n " +
|
" // Helpers\r\n function rotateArray(koArray, element) {\r\n " +
|
||||||
" var items = koArray();\r\n\r\n if (items.length <= 1)\r\n " +
|
" var items = koArray();\r\n\r\n if (items.length <= 1)\r\n" +
|
||||||
" return 0;\r\n\r\n if (element.height() < (element.par" +
|
" return 0;\r\n\r\n if (element.height() < (element" +
|
||||||
"ent().height() - 30)) {\r\n\r\n if (findUnsortedArrayTopIndex(ite" +
|
".parent().height() - 30)) {\r\n\r\n if (findUnsortedArrayTopIndex" +
|
||||||
"ms) !== 0)\r\n koArray.sort(sortFunction);\r\n\r\n " +
|
"(items) !== 0)\r\n koArray.sort(sortFunction);\r\n\r\n " +
|
||||||
" // Don\'t rotate if small & sorted correctly\r\n return;\r" +
|
" // Don\'t rotate if small & sorted correctly\r\n retu" +
|
||||||
"\n }\r\n\r\n // Move Last Item to Top\r\n " +
|
"rn;\r\n }\r\n\r\n // Move Last Item to Top\r\n " +
|
||||||
"var item = koArray.pop();\r\n koArray.unshift(item);\r\n }" +
|
" var item = koArray.pop();\r\n koArray.unshift(item);\r\n " +
|
||||||
"\r\n function removeItemFromArray(koArray, UserId) {\r\n v" +
|
" }\r\n function removeItemFromArray(koArray, UserId) {\r\n " +
|
||||||
"ar items = koArray();\r\n for (var i = 0; i < items.length; i++) {\r" +
|
" var items = koArray();\r\n for (var i = 0; i < items.length; i++" +
|
||||||
"\n if (items[i].UserId == UserId) {\r\n k" +
|
") {\r\n if (items[i].UserId == UserId) {\r\n " +
|
||||||
"oArray.splice(i, 1);\r\n items = koArray();\r\n " +
|
" koArray.splice(i, 1);\r\n items = koArray();\r\n " +
|
||||||
" i--;\r\n }\r\n }\r\n }\r\n " +
|
" i--;\r\n }\r\n }\r\n }\r\n " +
|
||||||
" function findUnsortedArrayTopIndex(items) {\r\n // Only one It" +
|
" function findUnsortedArrayTopIndex(items) {\r\n // Only on" +
|
||||||
"em\r\n if (items.length <= 1)\r\n return 0;\r\n\r\n " +
|
"e Item\r\n if (items.length <= 1)\r\n return 0;\r\n\r" +
|
||||||
" for (var i = 1; i < items.length; i++) {\r\n var s" +
|
"\n for (var i = 1; i < items.length; i++) {\r\n v" +
|
||||||
" = sortFunction(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
"ar s = sortFunction(items[i - 1], items[i]);\r\n if (s > 0)\r\n " +
|
||||||
" return i;\r\n }\r\n\r\n return 0;\r\n " +
|
" return i;\r\n }\r\n\r\n return 0;\r" +
|
||||||
" }\r\n function findSortedInsertIndex(koArray, heldDeviceItem) " +
|
"\n }\r\n function findSortedInsertIndex(koArray, heldDeviceIt" +
|
||||||
"{\r\n var items = koArray();\r\n var startIndex = find" +
|
"em) {\r\n var items = koArray();\r\n var startIndex = " +
|
||||||
"UnsortedArrayTopIndex(items);\r\n for (var i = startIndex; i < item" +
|
"findUnsortedArrayTopIndex(items);\r\n for (var i = startIndex; i < " +
|
||||||
"s.length; i++) {\r\n var s = sortFunction(heldDeviceItem, items" +
|
"items.length; i++) {\r\n var s = sortFunction(heldDeviceItem, i" +
|
||||||
"[i]);\r\n if (s <= 0)\r\n return i;\r\n " +
|
"tems[i]);\r\n if (s <= 0)\r\n return i;\r\n " +
|
||||||
" }\r\n if (startIndex !== 0) {\r\n for (" +
|
" }\r\n if (startIndex !== 0) {\r\n f" +
|
||||||
"var i = 0; i < startIndex; i++) {\r\n var s = sortFunction(" +
|
"or (var i = 0; i < startIndex; i++) {\r\n var s = sortFunct" +
|
||||||
"heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
|
"ion(heldDeviceItem, items[i]);\r\n if (s <= 0)\r\n " +
|
||||||
" return i;\r\n }\r\n return startI" +
|
" return i;\r\n }\r\n return st" +
|
||||||
"ndex;\r\n } else {\r\n return -1;\r\n " +
|
"artIndex;\r\n } else {\r\n return -1;\r\n " +
|
||||||
" }\r\n }\r\n function sortFunction(l, r) {\r\n re" +
|
" }\r\n }\r\n function sortFunction(l, r) {\r\n " +
|
||||||
"turn l.UserIdFriendly.toLowerCase() == r.UserIdFriendly.toLowerCase() ? 0 : (l.U" +
|
" return l.UserIdFriendly.toLowerCase() == r.UserIdFriendly.toLowerCase() ? 0 : " +
|
||||||
"serIdFriendly.toLowerCase() < r.UserIdFriendly.toLowerCase() ? -1 : 1)\r\n " +
|
"(l.UserIdFriendly.toLowerCase() < r.UserIdFriendly.toLowerCase() ? -1 : 1)\r\n " +
|
||||||
" }\r\n function isInProcess(i) {\r\n return !i.ReadyFor" +
|
" }\r\n function isInProcess(i) {\r\n return !i.Read" +
|
||||||
"Return && !i.WaitingForUserAction;\r\n }\r\n function isReadyF" +
|
"yForReturn && !i.WaitingForUserAction;\r\n }\r\n function isRe" +
|
||||||
"orReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingForUserActio" +
|
"adyForReturn(i) {\r\n return i.ReadyForReturn && !i.WaitingForUserA" +
|
||||||
"n;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " +
|
"ction;\r\n }\r\n function isWaitingForUserAction(i) {\r\n " +
|
||||||
" return i.WaitingForUserAction;\r\n }\r\n function getQuer" +
|
" return i.WaitingForUserAction;\r\n }\r\n function get" +
|
||||||
"yStringParameters() {\r\n\r\n if (window.location.search.length === 0" +
|
"QueryStringParameters() {\r\n\r\n if (window.location.search.length =" +
|
||||||
")\r\n return null;\r\n\r\n var params = {};\r\n " +
|
"== 0)\r\n return null;\r\n\r\n var params = {};\r\n " +
|
||||||
" window.location.search.substr(1).split(\"&\").forEach(function (pair) {\r\n" +
|
" window.location.search.substr(1).split(\"&\").forEach(function (pair)" +
|
||||||
" if (pair === \"\") return;\r\n var parts = pa" +
|
" {\r\n if (pair === \"\") return;\r\n var parts " +
|
||||||
"ir.split(\"=\");\r\n params[parts[0]] = parts[1] && decodeURIComp" +
|
"= pair.split(\"=\");\r\n params[parts[0]] = parts[1] && decodeURI" +
|
||||||
"onent(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n retur" +
|
"Component(parts[1].replace(/\\+/g, \" \"));\r\n });\r\n r" +
|
||||||
"n params;\r\n }\r\n\r\n init();\r\n });\r\n </script>\r\n</b" +
|
"eturn params;\r\n }\r\n\r\n init();\r\n });\r\n </script>\r" +
|
||||||
"ody>\r\n</html>\r\n");
|
"\n</body>\r\n</html>\r\n");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
||||||
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
||||||
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
||||||
|
public readonly string JobQueueInclude = "JobQueueInclude";
|
||||||
|
public readonly string JobQueueExclude = "JobQueueExclude";
|
||||||
}
|
}
|
||||||
static readonly ActionParamsClass_HeldDevice s_params_HeldDevice = new ActionParamsClass_HeldDevice();
|
static readonly ActionParamsClass_HeldDevice s_params_HeldDevice = new ActionParamsClass_HeldDevice();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
@@ -152,17 +154,19 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
public T4MVC_HeldDevicesController() : base(Dummy.Instance) { }
|
public T4MVC_HeldDevicesController() : base(Dummy.Instance) { }
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
|
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude);
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
|
public override System.Web.Mvc.ActionResult Index(string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude)
|
||||||
{
|
{
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
||||||
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "JobQueueInclude", JobQueueInclude);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "JobQueueExclude", JobQueueExclude);
|
||||||
|
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude, JobQueueInclude, JobQueueExclude);
|
||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,8 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
public readonly string DeviceProfileExclude = "DeviceProfileExclude";
|
||||||
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
public readonly string DeviceAddressInclude = "DeviceAddressInclude";
|
||||||
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
public readonly string DeviceAddressExclude = "DeviceAddressExclude";
|
||||||
|
public readonly string JobQueueInclude = "JobQueueInclude";
|
||||||
|
public readonly string JobQueueExclude = "JobQueueExclude";
|
||||||
}
|
}
|
||||||
static readonly ActionParamsClass_UserHeldDevice s_params_UserHeldDevice = new ActionParamsClass_UserHeldDevice();
|
static readonly ActionParamsClass_UserHeldDevice s_params_UserHeldDevice = new ActionParamsClass_UserHeldDevice();
|
||||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||||
@@ -152,17 +154,19 @@ namespace Disco.Web.Areas.Public.Controllers
|
|||||||
public T4MVC_UserHeldDevicesController() : base(Dummy.Instance) { }
|
public T4MVC_UserHeldDevicesController() : base(Dummy.Instance) { }
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude);
|
partial void IndexOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude);
|
||||||
|
|
||||||
[NonAction]
|
[NonAction]
|
||||||
public override System.Web.Mvc.ActionResult Index(System.Collections.Generic.List<int?> DeviceProfileInclude, System.Collections.Generic.List<int?> DeviceProfileExclude, System.Collections.Generic.List<string> DeviceAddressInclude, System.Collections.Generic.List<string> DeviceAddressExclude)
|
public override System.Web.Mvc.ActionResult Index(string DeviceProfileInclude, string DeviceProfileExclude, string DeviceAddressInclude, string DeviceAddressExclude, string JobQueueInclude, string JobQueueExclude)
|
||||||
{
|
{
|
||||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.Index);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileInclude", DeviceProfileInclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceProfileExclude", DeviceProfileExclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressInclude", DeviceAddressInclude);
|
||||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "DeviceAddressExclude", DeviceAddressExclude);
|
||||||
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude);
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "JobQueueInclude", JobQueueInclude);
|
||||||
|
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "JobQueueExclude", JobQueueExclude);
|
||||||
|
IndexOverride(callInfo, DeviceProfileInclude, DeviceProfileExclude, DeviceAddressInclude, DeviceAddressExclude, JobQueueInclude, JobQueueExclude);
|
||||||
return callInfo;
|
return callInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user