Feature: Quick Search
Device/Job/User Search refactoring. Quick-Search implemented.
This commit is contained in:
@@ -1,76 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Data.Repository;
|
||||
|
||||
namespace Disco.BI.DeviceBI
|
||||
{
|
||||
public static class Searching
|
||||
{
|
||||
private static List<DeviceSearchResultItem> Search_SelectDeviceSearchResultItem(IQueryable<Device> Query, int? LimitCount = null)
|
||||
{
|
||||
if (LimitCount.HasValue)
|
||||
Query = Query.Take(LimitCount.Value);
|
||||
|
||||
return Query.Select(d => new DeviceSearchResultItem()
|
||||
{
|
||||
SerialNumber = d.SerialNumber,
|
||||
AssetNumber = d.AssetNumber,
|
||||
ComputerName = d.ComputerName,
|
||||
DeviceModelDescription = d.DeviceModel.Description,
|
||||
DeviceProfileDescription = d.DeviceProfile.Description,
|
||||
DecommissionedDate = d.DecommissionedDate,
|
||||
AssignedUserId = d.AssignedUserId,
|
||||
AssignedUserDisplayName = d.AssignedUser.DisplayName,
|
||||
JobCount = d.Jobs.Count()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public static List<DeviceSearchResultItem> Search(DiscoDataContext Database, string Term, int? LimitCount = null, bool SearchDetails = false)
|
||||
{
|
||||
IQueryable<Device> query;
|
||||
|
||||
query = null;
|
||||
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = Database.Devices.Where(d =>
|
||||
d.AssetNumber.Contains(Term) ||
|
||||
d.ComputerName.Contains(Term) ||
|
||||
d.SerialNumber.Contains(Term) ||
|
||||
d.Location.Contains(Term) ||
|
||||
Term.Contains(d.SerialNumber) ||
|
||||
d.DeviceDetails.Any(dd => dd.Value.Contains(Term))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = Database.Devices.Where(d =>
|
||||
d.AssetNumber.Contains(Term) ||
|
||||
d.ComputerName.Contains(Term) ||
|
||||
d.SerialNumber.Contains(Term) ||
|
||||
d.Location.Contains(Term) ||
|
||||
Term.Contains(d.SerialNumber));
|
||||
}
|
||||
|
||||
return Search_SelectDeviceSearchResultItem(query, LimitCount);
|
||||
}
|
||||
|
||||
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext Database, int DeviceModelId, int? LimitCount = null)
|
||||
{
|
||||
return Search_SelectDeviceSearchResultItem(Database.Devices.Where(d => d.DeviceModelId == DeviceModelId), LimitCount);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceProfile(DiscoDataContext Database, int DeviceProfileId, int? LimitCount = null)
|
||||
{
|
||||
return Search_SelectDeviceSearchResultItem(Database.Devices.Where(d => d.DeviceProfileId == DeviceProfileId), LimitCount);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceBatch(DiscoDataContext Database, int DeviceBatchId, int? LimitCount = null)
|
||||
{
|
||||
return Search_SelectDeviceSearchResultItem(Database.Devices.Where(d => d.DeviceBatchId == DeviceBatchId), LimitCount);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,90 +0,0 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Services;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.BI.JobBI
|
||||
{
|
||||
public static class Searching
|
||||
{
|
||||
public static JobTableModel Search(DiscoDataContext Database, string Term, int? LimitCount = null, bool IncludeJobStatus = true, bool SearchDetails = false)
|
||||
{
|
||||
int termInt = default(int);
|
||||
|
||||
IQueryable<Job> query = default(IQueryable<Job>);
|
||||
|
||||
if (int.TryParse(Term, out termInt))
|
||||
{
|
||||
// Term is a Number (int)
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.Id == termInt ||
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term) ||
|
||||
j.JobLogs.Any(jl => jl.Comments.Contains(Term)) ||
|
||||
j.JobAttachments.Any(ja => ja.Comments.Contains(Term)));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.Id == termInt ||
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term) ||
|
||||
j.JobLogs.Any(jl => jl.Comments.Contains(Term)) ||
|
||||
j.JobAttachments.Any(ja => ja.Comments.Contains(Term)));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
}
|
||||
|
||||
if (LimitCount.HasValue)
|
||||
query = query.Take(LimitCount.Value);
|
||||
|
||||
JobTableModel model = new JobTableModel() { ShowStatus = IncludeJobStatus };
|
||||
model.Fill(Database, query, true);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public static IQueryable<Job> BuildJobTableModel(DiscoDataContext Database)
|
||||
{
|
||||
return Database.Jobs.Include("JobType").Include("Device").Include("User").Include("OpenedTechUser");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Services.Users;
|
||||
|
||||
namespace Disco.BI.UserBI
|
||||
{
|
||||
public static class Searching
|
||||
{
|
||||
|
||||
public static List<User> SearchUpstream(string Term)
|
||||
{
|
||||
return Interop.ActiveDirectory.ActiveDirectory.SearchUsers(Term).Select(adU => adU.ToRepositoryUser()).ToList();
|
||||
}
|
||||
|
||||
private static List<UserSearchResultItem> Search_SelectUserSearchResultItems(IQueryable<User> Query, int? LimitCount = null)
|
||||
{
|
||||
if (LimitCount.HasValue)
|
||||
Query = Query.Take(LimitCount.Value);
|
||||
|
||||
return Query.Select(u => new UserSearchResultItem()
|
||||
{
|
||||
Id = u.Id,
|
||||
Surname = u.Surname,
|
||||
GivenName = u.GivenName,
|
||||
DisplayName = u.DisplayName,
|
||||
AssignedDevicesCount = u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).Count(),
|
||||
JobCount = u.Jobs.Count()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public static List<UserSearchResultItem> Search(DiscoDataContext Database, string Term, int? LimitCount = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Term) || Term.Length < 2)
|
||||
throw new ArgumentException("Search Term must contain at least two characters", "Term");
|
||||
|
||||
// Search Active Directory & Import Relevant Users
|
||||
var adImportedUsers = Interop.ActiveDirectory.ActiveDirectory.SearchUsers(Term).Select(adU => adU.ToRepositoryUser());
|
||||
foreach (var adU in adImportedUsers)
|
||||
{
|
||||
var existingUser = Database.Users.Find(adU.Id);
|
||||
if (existingUser != null)
|
||||
existingUser.UpdateSelf(adU);
|
||||
else
|
||||
Database.Users.Add(adU);
|
||||
Database.SaveChanges();
|
||||
UserService.InvalidateCachedUser(adU.Id);
|
||||
}
|
||||
|
||||
return Search_SelectUserSearchResultItems(Database.Users.Where(u =>
|
||||
u.Id.Contains(Term) ||
|
||||
u.Surname.Contains(Term) ||
|
||||
u.GivenName.Contains(Term) ||
|
||||
u.DisplayName.Contains(Term)
|
||||
), LimitCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,6 @@
|
||||
<Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" />
|
||||
<Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" />
|
||||
<Compile Include="BI\DeviceBI\Migration\LogMacAddressImporting.cs" />
|
||||
<Compile Include="BI\DeviceBI\Searching.cs" />
|
||||
<Compile Include="BI\DisposableImageCollection.cs" />
|
||||
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
|
||||
<Compile Include="BI\Expressions\EvaluateExpressionParseException.cs" />
|
||||
@@ -196,10 +195,8 @@
|
||||
<Compile Include="BI\Interop\SignalRHandlers\ScheduledTasksStatusNotifications.cs" />
|
||||
<Compile Include="BI\Interop\SignalRHandlers\SignalRAuthenticationWorkaround.cs" />
|
||||
<Compile Include="BI\Interop\SignalRHandlers\UserHeldDeviceNotifications.cs" />
|
||||
<Compile Include="BI\JobBI\Searching.cs" />
|
||||
<Compile Include="BI\JobBI\Statistics\DailyOpenedClosed.cs" />
|
||||
<Compile Include="BI\JobBI\Utilities.cs" />
|
||||
<Compile Include="BI\UserBI\Searching.cs" />
|
||||
<Compile Include="BI\Extensions\UtilityExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
@@ -254,7 +251,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
|
||||
namespace Disco.Models.BI.Search
|
||||
{
|
||||
public class UserSearchResultItem
|
||||
{
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public string Id { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -63,8 +63,6 @@
|
||||
<Compile Include="BI\Interop\Community\UpdateRequestV1.cs" />
|
||||
<Compile Include="BI\Interop\Community\UpdateResponse.cs" />
|
||||
<Compile Include="BI\Job\Statistics\DailyOpenedClosedItem.cs" />
|
||||
<Compile Include="BI\Search\DeviceSearchResultItem.cs" />
|
||||
<Compile Include="BI\Search\UserSearchResultItem.cs" />
|
||||
<Compile Include="ClientServices\EnrolResponse.cs" />
|
||||
<Compile Include="ClientServices\MacEnrol.cs" />
|
||||
<Compile Include="ClientServices\MacEnrolResponse.cs" />
|
||||
@@ -111,6 +109,10 @@
|
||||
<Compile Include="Services\Jobs\JobLists\JobTableStatusItemModel.cs" />
|
||||
<Compile Include="Services\Jobs\JobLists\JobTableStatusQueueItemModel.cs" />
|
||||
<Compile Include="Services\Jobs\JobQueues\IJobQueueToken.cs" />
|
||||
<Compile Include="Services\Searching\DeviceSearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\ISearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\JobSearchResultItem.cs" />
|
||||
<Compile Include="Services\Searching\UserSearchResultItem.cs" />
|
||||
<Compile Include="UI\BaseUIModel.cs" />
|
||||
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleCreateModel.cs" />
|
||||
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleIndexModel.cs" />
|
||||
@@ -165,7 +167,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" BuildVersion_BuildAction="Both" />
|
||||
<UserProperties BuildVersion_BuildAction="Both" BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -1,22 +1,34 @@
|
||||
using System;
|
||||
using Disco.Models.Services.Searching;
|
||||
using System;
|
||||
|
||||
namespace Disco.Models.Services.Jobs.JobLists
|
||||
{
|
||||
public class JobTableItemModel
|
||||
public class JobTableItemModel : JobSearchResultItem
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public int JobId { get; set; }
|
||||
|
||||
[Obsolete("Use [int] JobId instead")]
|
||||
public override string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.JobId.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Id = value;
|
||||
this.JobId = int.Parse(value);
|
||||
}
|
||||
}
|
||||
public DateTime OpenedDate { get; set; }
|
||||
public DateTime? ClosedDate { get; set; }
|
||||
public string JobTypeId { get; set; }
|
||||
public string JobTypeDescription { get; set; }
|
||||
public string DeviceSerialNumber { get; set; }
|
||||
public int? DeviceModelId { get; set; }
|
||||
public string DeviceModelDescription { get; set; }
|
||||
public int? DeviceProfileId { get; set; }
|
||||
public int? DeviceAddressId { get; set; }
|
||||
public string DeviceAddress { get; set; }
|
||||
public string UserId { get; set; }
|
||||
public string UserDisplayName { get; set; }
|
||||
public string OpenedTechUserId { get; set; }
|
||||
public string OpenedTechUserDisplayName { get; set; }
|
||||
public string StatusDescription { get; set; }
|
||||
|
||||
+13
-3
@@ -1,9 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.BI.Search
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class DeviceSearchResultItem
|
||||
public class DeviceSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "Device";
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.Id, this.ComputerName); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1} {2} {3}", this.Id, this.AssignedUserId, this.AssignedUserDisplayName, this.AssetNumber); } }
|
||||
|
||||
public string AssetNumber { get; set; }
|
||||
public string AssignedUserDescription
|
||||
{
|
||||
@@ -26,6 +37,5 @@ namespace Disco.Models.BI.Search
|
||||
public string DeviceProfileDescription { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public DateTime? DecommissionedDate { get; set; }
|
||||
public string SerialNumber { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public interface ISearchResultItem
|
||||
{
|
||||
string Id { get; set; }
|
||||
string Type { get; }
|
||||
string Description { get; }
|
||||
string ScoreValue { get; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class JobSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "Job";
|
||||
|
||||
public virtual string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1}; {2})", this.Id, this.UserId, this.DeviceSerialNumber); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1} {2} {3}", this.Id, this.UserId, this.DeviceSerialNumber, this.UserDisplayName); } }
|
||||
|
||||
public string DeviceSerialNumber { get; set; }
|
||||
|
||||
public string UserId { get; set; }
|
||||
public string UserDisplayName { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Models.Services.Searching
|
||||
{
|
||||
public class UserSearchResultItem : ISearchResultItem
|
||||
{
|
||||
private const string type = "User";
|
||||
|
||||
public string Id { get; set; }
|
||||
public string Type { get { return type; } }
|
||||
public string Description { get { return string.Format("{0} ({1})", this.DisplayName, this.Id); } }
|
||||
public string ScoreValue { get { return string.Format("{0} {1}", this.Id, this.DisplayName); } }
|
||||
|
||||
public int AssignedDevicesCount { get; set; }
|
||||
public string DisplayName { get; set; }
|
||||
public string GivenName { get; set; }
|
||||
public int JobCount { get; set; }
|
||||
public string Surname { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Searching;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Models.UI.Search
|
||||
|
||||
@@ -173,6 +173,7 @@
|
||||
<Compile Include="Authorization\Roles\RoleClaims.cs" />
|
||||
<Compile Include="Authorization\Roles\RoleToken.cs" />
|
||||
<Compile Include="Extensions\DateTimeExtensions.cs" />
|
||||
<Compile Include="Extensions\StringExtensions.cs" />
|
||||
<Compile Include="Jobs\JobExtensions.cs" />
|
||||
<Compile Include="Jobs\JobLists\JobTableExtensions.cs" />
|
||||
<Compile Include="Jobs\JobQueues\Cache.cs" />
|
||||
@@ -230,6 +231,7 @@
|
||||
<Compile Include="Plugins\PluginWebViewPage.cs" />
|
||||
<Compile Include="Plugins\WebPageHelper.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Searching\Search.cs" />
|
||||
<Compile Include="Tasks\ScheduledTask.cs" />
|
||||
<Compile Include="Tasks\ScheduledTasks.cs" />
|
||||
<Compile Include="Tasks\ScheduledTasksLog.cs" />
|
||||
@@ -278,7 +280,7 @@
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<UserProperties BuildVersion_UpdateFileVersion="True" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildAction="Both" BuildVersion_DetectChanges="False" BuildVersion_UseGlobalSettings="False" />
|
||||
<UserProperties BuildVersion_UseGlobalSettings="False" BuildVersion_DetectChanges="False" BuildVersion_BuildAction="Both" BuildVersion_StartDate="2011/7/1" BuildVersion_BuildVersioningStyle="None.DeltaBaseYear.MonthAndDayStamp.TimeStamp" BuildVersion_UpdateAssemblyVersion="True" BuildVersion_UpdateFileVersion="True" />
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco
|
||||
{
|
||||
public static class StringExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// A fuzzy string search algorithm.
|
||||
///
|
||||
/// Based on: ScoreSharp (https://github.com/bltavares/scoresharp)
|
||||
/// Based on: string_score from Joshaven Potter (https://github.com/joshaven/string_score)
|
||||
///
|
||||
/// MIT License
|
||||
/// </summary>
|
||||
public static double Score(this string Source, string Test, double Fuzziness = 0)
|
||||
{
|
||||
double total_char_score = 0, abbrv_size = Test.Length,
|
||||
fuzzies = 1, final_score, abbrv_score;
|
||||
int word_size = Source.Length;
|
||||
bool start_of_word_bonus = false;
|
||||
|
||||
//If strings are equal, return 1.0
|
||||
if (Source == Test) return 1.0;
|
||||
|
||||
int index_in_string,
|
||||
index_char_lowercase,
|
||||
index_char_uppercase,
|
||||
min_index;
|
||||
double char_score;
|
||||
string c;
|
||||
for (int i = 0; i < abbrv_size; i++)
|
||||
{
|
||||
c = Test[i].ToString();
|
||||
index_char_uppercase = Source.IndexOf(c.ToUpper());
|
||||
index_char_lowercase = Source.IndexOf(c.ToLower());
|
||||
min_index = Math.Min(index_char_lowercase, index_char_uppercase);
|
||||
|
||||
//Finds first valid occurrence
|
||||
//In upper or lowercase
|
||||
index_in_string = min_index > -1 ?
|
||||
min_index : Math.Max(index_char_lowercase, index_char_uppercase);
|
||||
|
||||
//If no value is found
|
||||
//Check if fuzziness is allowed
|
||||
if (index_in_string == -1)
|
||||
{
|
||||
if (Fuzziness > 0)
|
||||
{
|
||||
fuzzies += 1 - Fuzziness;
|
||||
continue;
|
||||
}
|
||||
else return 0;
|
||||
}
|
||||
else
|
||||
char_score = 0.1;
|
||||
|
||||
//Check if current char is the same case
|
||||
//Then add bonus
|
||||
if (Source[index_in_string].ToString() == c) char_score += 0.1;
|
||||
|
||||
//Check if char matches the first letter
|
||||
//And add bonus for consecutive letters
|
||||
if (index_in_string == 0)
|
||||
{
|
||||
char_score += 0.6;
|
||||
|
||||
//Check if the abbreviation
|
||||
//is in the start of the word
|
||||
start_of_word_bonus = i == 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Acronym Bonus
|
||||
// Weighing Logic: Typing the first character of an acronym is as if you
|
||||
// preceded it with two perfect character matches.
|
||||
if (Source.ElementAtOrDefault(index_in_string - 1).ToString() == " ") char_score += 0.8;
|
||||
}
|
||||
|
||||
|
||||
//Remove the start of string, so we don't reprocess it
|
||||
Source = Source.Substring(index_in_string + 1);
|
||||
|
||||
//sum chars scores
|
||||
total_char_score += char_score;
|
||||
}
|
||||
|
||||
abbrv_score = total_char_score / abbrv_size;
|
||||
|
||||
//Reduce penalty for longer words
|
||||
final_score = ((abbrv_score * (abbrv_size / word_size)) + abbrv_score) / 2;
|
||||
|
||||
//Reduce using fuzzies;
|
||||
final_score = final_score / fuzzies;
|
||||
|
||||
//Process start of string bonus
|
||||
if (start_of_word_bonus && final_score <= 0.85)
|
||||
final_score += 0.15;
|
||||
|
||||
return final_score;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Disco.Services
|
||||
{
|
||||
var i = new JobTableStatusItemModel()
|
||||
{
|
||||
Id = j.Id,
|
||||
JobId = j.Id,
|
||||
OpenedDate = j.OpenedDate,
|
||||
ClosedDate = j.ClosedDate,
|
||||
JobTypeId = j.JobTypeId,
|
||||
|
||||
@@ -120,7 +120,7 @@ namespace Disco.Services
|
||||
|
||||
var jobItems = Jobs.Select(j => new JobTableStatusItemModel()
|
||||
{
|
||||
Id = j.Id,
|
||||
JobId = j.Id,
|
||||
OpenedDate = j.OpenedDate,
|
||||
ClosedDate = j.ClosedDate,
|
||||
JobTypeId = j.JobTypeId,
|
||||
@@ -177,7 +177,7 @@ namespace Disco.Services
|
||||
{
|
||||
items = Jobs.Select(j => new JobTableItemModel()
|
||||
{
|
||||
Id = j.Id,
|
||||
JobId = j.Id,
|
||||
OpenedDate = j.OpenedDate,
|
||||
ClosedDate = j.ClosedDate,
|
||||
JobTypeId = j.JobTypeId,
|
||||
|
||||
@@ -217,7 +217,7 @@ using Disco.Services.Authorization;
|
||||
if (existingItems == null)
|
||||
throw new InvalidOperationException("Notification algorithm didn't indicate any Jobs for update");
|
||||
else
|
||||
jobIds = existingItems.Select(i => i.Id).ToList();
|
||||
jobIds = existingItems.Select(i => i.JobId).ToList();
|
||||
}
|
||||
|
||||
if (jobIds.Count == 0)
|
||||
@@ -232,7 +232,7 @@ using Disco.Services.Authorization;
|
||||
{
|
||||
// Check for existing items, if not handed them
|
||||
if (existingItems == null)
|
||||
existingItems = base.Items.Where(i => jobIds.Contains(i.Id)).ToArray();
|
||||
existingItems = base.Items.Where(i => jobIds.Contains(i.JobId)).ToArray();
|
||||
|
||||
var updatedItems = this.DetermineItems(Database, this.FilterFunction(Database.Jobs.Where(j => jobIds.Contains(j.Id))), false);
|
||||
|
||||
|
||||
@@ -0,0 +1,247 @@
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.Interop.ActiveDirectory;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Searching;
|
||||
using Disco.Services.Users;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Disco.Services.Searching
|
||||
{
|
||||
public static class Search
|
||||
{
|
||||
|
||||
#region Jobs
|
||||
public static List<JobSearchResultItem> SearchJobs(DiscoDataContext Database, string Term, int? LimitCount = null)
|
||||
{
|
||||
int termInt = default(int);
|
||||
|
||||
IQueryable<Job> query = default(IQueryable<Job>);
|
||||
|
||||
if (int.TryParse(Term, out termInt))
|
||||
{
|
||||
// Term is a Number (int)
|
||||
query = Database.Jobs.Where(j =>
|
||||
j.Id == termInt ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = Database.Jobs.Where(j =>
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
|
||||
if (LimitCount.HasValue)
|
||||
query = query.Take(LimitCount.Value);
|
||||
|
||||
return query.Select(j => new
|
||||
{
|
||||
Id = j.Id,
|
||||
DeviceSerialNumber = j.DeviceSerialNumber,
|
||||
UserId = j.UserId,
|
||||
UserDisplayName = j.User.DisplayName
|
||||
}).ToArray().Select(i => new JobSearchResultItem()
|
||||
{
|
||||
Id = i.Id.ToString(),
|
||||
DeviceSerialNumber = i.DeviceSerialNumber,
|
||||
UserId = i.UserId,
|
||||
UserDisplayName = i.UserDisplayName
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public static JobTableModel SearchJobsTable(DiscoDataContext Database, string Term, int? LimitCount = null, bool IncludeJobStatus = true, bool SearchDetails = false)
|
||||
{
|
||||
int termInt = default(int);
|
||||
|
||||
IQueryable<Job> query = default(IQueryable<Job>);
|
||||
|
||||
if (int.TryParse(Term, out termInt))
|
||||
{
|
||||
// Term is a Number (int)
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.Id == termInt ||
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term) ||
|
||||
j.JobLogs.Any(jl => jl.Comments.Contains(Term)) ||
|
||||
j.JobAttachments.Any(ja => ja.Comments.Contains(Term)));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.Id == termInt ||
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term) ||
|
||||
j.JobLogs.Any(jl => jl.Comments.Contains(Term)) ||
|
||||
j.JobAttachments.Any(ja => ja.Comments.Contains(Term)));
|
||||
}
|
||||
else
|
||||
{
|
||||
query = BuildJobTableModel(Database).Where(j =>
|
||||
j.DeviceHeldLocation.Contains(Term) ||
|
||||
j.Device.SerialNumber.Contains(Term) ||
|
||||
j.Device.AssetNumber.Contains(Term) ||
|
||||
j.User.Id == Term ||
|
||||
j.User.Surname.Contains(Term) ||
|
||||
j.User.GivenName.Contains(Term) ||
|
||||
j.User.DisplayName.Contains(Term));
|
||||
}
|
||||
}
|
||||
|
||||
if (LimitCount.HasValue)
|
||||
query = query.Take(LimitCount.Value);
|
||||
|
||||
JobTableModel model = new JobTableModel() { ShowStatus = IncludeJobStatus };
|
||||
model.Fill(Database, query, true);
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
public static IQueryable<Job> BuildJobTableModel(DiscoDataContext Database)
|
||||
{
|
||||
return Database.Jobs.Include("JobType").Include("Device").Include("User").Include("OpenedTechUser");
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Users
|
||||
public static List<UserSearchResultItem> SearchUsers(DiscoDataContext Database, string Term, int? LimitCount = null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Term) || Term.Length < 2)
|
||||
throw new ArgumentException("Search Term must contain at least two characters", "Term");
|
||||
|
||||
// Search Active Directory & Import Relevant Users
|
||||
UserService.SearchUsers(Database, Term);
|
||||
|
||||
var matches = Database.Users.Where(u =>
|
||||
u.Id.Contains(Term) ||
|
||||
u.Surname.Contains(Term) ||
|
||||
u.GivenName.Contains(Term) ||
|
||||
u.DisplayName.Contains(Term)
|
||||
);
|
||||
|
||||
if (LimitCount.HasValue)
|
||||
matches = matches.Take(LimitCount.Value);
|
||||
|
||||
return matches.Select(u => new UserSearchResultItem()
|
||||
{
|
||||
Id = u.Id,
|
||||
Surname = u.Surname,
|
||||
GivenName = u.GivenName,
|
||||
DisplayName = u.DisplayName,
|
||||
AssignedDevicesCount = u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue).Count(),
|
||||
JobCount = u.Jobs.Count()
|
||||
}).ToList();
|
||||
}
|
||||
|
||||
public static List<User> SearchUsersUpstream(string Term, int? LimitCount = null)
|
||||
{
|
||||
IEnumerable<ActiveDirectoryUserAccount> matches = UserService.SearchUsers(Term);
|
||||
|
||||
if (LimitCount.HasValue)
|
||||
matches = matches.Take(LimitCount.Value);
|
||||
|
||||
return matches.Select(m => m.ToRepositoryUser()).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Devices
|
||||
public static List<DeviceSearchResultItem> SearchDevices(DiscoDataContext Database, string Term, int? LimitCount = null, bool SearchDetails = false)
|
||||
{
|
||||
IQueryable<Device> query;
|
||||
|
||||
query = null;
|
||||
|
||||
if (SearchDetails)
|
||||
{
|
||||
query = Database.Devices.Where(d =>
|
||||
d.AssetNumber.Contains(Term) ||
|
||||
d.ComputerName.Contains(Term) ||
|
||||
d.SerialNumber.Contains(Term) ||
|
||||
d.Location.Contains(Term) ||
|
||||
Term.Contains(d.SerialNumber) ||
|
||||
d.DeviceDetails.Any(dd => dd.Value.Contains(Term))
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
query = Database.Devices.Where(d =>
|
||||
d.AssetNumber.Contains(Term) ||
|
||||
d.ComputerName.Contains(Term) ||
|
||||
d.SerialNumber.Contains(Term) ||
|
||||
d.Location.Contains(Term) ||
|
||||
Term.Contains(d.SerialNumber));
|
||||
}
|
||||
|
||||
return query.ToDeviceSearchResultItems(LimitCount);
|
||||
}
|
||||
|
||||
public static List<DeviceSearchResultItem> SearchDeviceModel(DiscoDataContext Database, int DeviceModelId, int? LimitCount = null)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceModelId == DeviceModelId).ToDeviceSearchResultItems(LimitCount);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceProfile(DiscoDataContext Database, int DeviceProfileId, int? LimitCount = null)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceProfileId == DeviceProfileId).ToDeviceSearchResultItems(LimitCount);
|
||||
}
|
||||
public static List<DeviceSearchResultItem> SearchDeviceBatch(DiscoDataContext Database, int DeviceBatchId, int? LimitCount = null)
|
||||
{
|
||||
return Database.Devices.Where(d => d.DeviceBatchId == DeviceBatchId).ToDeviceSearchResultItems(LimitCount);
|
||||
}
|
||||
|
||||
private static List<DeviceSearchResultItem> ToDeviceSearchResultItems(this IQueryable<Device> Query, int? LimitCount = null)
|
||||
{
|
||||
if (LimitCount.HasValue)
|
||||
Query = Query.Take(LimitCount.Value);
|
||||
|
||||
return Query.Select(d => new DeviceSearchResultItem()
|
||||
{
|
||||
Id = d.SerialNumber,
|
||||
AssetNumber = d.AssetNumber,
|
||||
ComputerName = d.ComputerName,
|
||||
DeviceModelDescription = d.DeviceModel.Description,
|
||||
DeviceProfileDescription = d.DeviceProfile.Description,
|
||||
DecommissionedDate = d.DecommissionedDate,
|
||||
AssignedUserId = d.AssignedUserId,
|
||||
AssignedUserDisplayName = d.AssignedUser.DisplayName,
|
||||
JobCount = d.Jobs.Count()
|
||||
}).ToList();
|
||||
}
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
@@ -22,13 +22,16 @@ namespace Disco.Services.Users
|
||||
private const string _cacheHttpRequestKey = "Disco_CurrentUserToken";
|
||||
private static Func<string, string[], ActiveDirectoryUserAccount> _GetActiveDirectoryUserAccount;
|
||||
private static Func<string, string[], ActiveDirectoryMachineAccount> _GetActiveDirectoryMachineAccount;
|
||||
private static Func<string, List<ActiveDirectoryUserAccount>> _SearchActiveDirectoryUsers;
|
||||
|
||||
public static void Initialize(DiscoDataContext Database,
|
||||
Func<string, string[], ActiveDirectoryUserAccount> GetActiveDirectoryUserAccount,
|
||||
Func<string, string[], ActiveDirectoryMachineAccount> GetActiveDirectoryMachineAccount)
|
||||
Func<string, string[], ActiveDirectoryMachineAccount> GetActiveDirectoryMachineAccount,
|
||||
Func<string, List<ActiveDirectoryUserAccount>> SearchActiveDirectoryUsers)
|
||||
{
|
||||
_GetActiveDirectoryUserAccount = GetActiveDirectoryUserAccount;
|
||||
_GetActiveDirectoryMachineAccount = GetActiveDirectoryMachineAccount;
|
||||
_SearchActiveDirectoryUsers = SearchActiveDirectoryUsers;
|
||||
|
||||
Authorization.Roles.RoleCache.Initialize(Database);
|
||||
}
|
||||
@@ -201,6 +204,27 @@ namespace Disco.Services.Users
|
||||
Cache.FlushCache();
|
||||
}
|
||||
|
||||
internal static List<ActiveDirectoryUserAccount> SearchUsers(string Term)
|
||||
{
|
||||
return _SearchActiveDirectoryUsers(Term);
|
||||
}
|
||||
|
||||
internal static List<ActiveDirectoryUserAccount> SearchUsers(DiscoDataContext Database, string Term)
|
||||
{
|
||||
var adImportedUsers = SearchUsers(Term);
|
||||
foreach (var adU in adImportedUsers.Select(adU => adU.ToRepositoryUser()))
|
||||
{
|
||||
var existingUser = Database.Users.Find(adU.Id);
|
||||
if (existingUser != null)
|
||||
existingUser.UpdateSelf(adU);
|
||||
else
|
||||
Database.Users.Add(adU);
|
||||
Database.SaveChanges();
|
||||
UserService.InvalidateCachedUser(adU.Id);
|
||||
}
|
||||
return adImportedUsers;
|
||||
}
|
||||
|
||||
internal static Tuple<User, AuthorizationToken> ImportUser(DiscoDataContext Database, string UserId)
|
||||
{
|
||||
if (_GetActiveDirectoryUserAccount == null)
|
||||
|
||||
@@ -45,7 +45,8 @@ namespace Disco.Web
|
||||
// Initialize User Service Interop
|
||||
Disco.Services.Users.UserService.Initialize(Database,
|
||||
(UserId, AdditionalProperties) => Disco.BI.Interop.ActiveDirectory.ActiveDirectory.GetUserAccount(UserId, AdditionalProperties),
|
||||
(UserId, AdditionalProperties) => Disco.BI.Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(UserId, null, null, AdditionalProperties));
|
||||
(UserId, AdditionalProperties) => Disco.BI.Interop.ActiveDirectory.ActiveDirectory.GetMachineAccount(UserId, null, null, AdditionalProperties),
|
||||
(Term) => Disco.BI.Interop.ActiveDirectory.ActiveDirectory.SearchUsers(Term));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,8 @@ namespace Disco.Web
|
||||
routes.MapRoute(
|
||||
name: "SearchQuery",
|
||||
url: "Search/Query/{SearchQuery}",
|
||||
defaults: new { controller = "Search", action = "Query", SearchQuery = UrlParameter.Optional }
|
||||
defaults: new { controller = "Search", action = "Query", SearchQuery = UrlParameter.Optional },
|
||||
namespaces: new string[] { "Disco.Web.Controllers" } // Controllers Namespace Only
|
||||
);
|
||||
// User Route
|
||||
routes.MapRoute(
|
||||
|
||||
@@ -35,7 +35,8 @@ namespace Disco.Web.Areas.API
|
||||
context.MapRoute(
|
||||
"API_default",
|
||||
"API/{controller}/{action}/{id}",
|
||||
new { id = UrlParameter.Optional }
|
||||
new { id = UrlParameter.Optional },
|
||||
new string[] { "Disco.Web.Areas.API.Controllers" }
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -324,13 +324,13 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
switch (searchScope)
|
||||
{
|
||||
case DocumentTemplate.DocumentTemplateScopes.Device:
|
||||
results = BI.DeviceBI.Searching.Search(Database, term, limitCount).Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
results = Disco.Services.Searching.Search.SearchDevices(Database, term, limitCount).Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
break;
|
||||
case DocumentTemplate.DocumentTemplateScopes.Job:
|
||||
results = BI.JobBI.Searching.Search(Database, term, limitCount, false).Items.Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
results = Disco.Services.Searching.Search.SearchJobsTable(Database, term, limitCount, false).Items.Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
break;
|
||||
case DocumentTemplate.DocumentTemplateScopes.User:
|
||||
results = BI.UserBI.Searching.Search(Database, term, limitCount).Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
results = Disco.Services.Searching.Search.SearchUsers(Database, term, limitCount).Select(sr => Models.DocumentTemplate.ImporterUndetectedDataIdLookupModel.FromSearchResultItem(sr)).ToArray();
|
||||
break;
|
||||
default:
|
||||
results = null;
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
using Disco.Models.Services.Searching;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Searching;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class SearchController : AuthorizedDatabaseController
|
||||
{
|
||||
[DiscoAuthorizeAny(Claims.Job.Search, Claims.Device.Search, Claims.User.Search)]
|
||||
public virtual ActionResult QuickQuery(string Term, int Limit = 15)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(Term))
|
||||
throw new ArgumentNullException("Term", "The search query term is required");
|
||||
if (Term.Length < 2)
|
||||
throw new ArgumentException("The search query term must be at least two characters", "Term");
|
||||
if (Limit < 1)
|
||||
throw new ArgumentException("The search query limit cannot be less than 1", "Limit");
|
||||
|
||||
IEnumerable<ISearchResultItem> results = Enumerable.Empty<ISearchResultItem>();
|
||||
|
||||
if (Authorization.Has(Claims.Job.Search))
|
||||
{
|
||||
var jobMatches = Search.SearchJobs(Database, Term, Limit);
|
||||
results = results.Concat(jobMatches);
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.User.Search))
|
||||
{
|
||||
var userMatches = Search.SearchUsers(Database, Term, Limit);
|
||||
results = results.Concat(userMatches);
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
{
|
||||
var deviceMatches = Search.SearchDevices(Database, Term, Limit);
|
||||
results = results.Concat(deviceMatches);
|
||||
}
|
||||
|
||||
results = results.OrderByDescending(i => i.ScoreValue.Score(Term, .5)).Take(Limit);
|
||||
|
||||
return Json(results, JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
[DiscoAuthorize(Claims.User.Search)]
|
||||
public virtual ActionResult UpstreamUsers(string term)
|
||||
{
|
||||
return Json(BI.UserBI.Searching.SearchUpstream(term), JsonRequestBehavior.AllowGet);
|
||||
return Json(Disco.Services.Searching.Search.SearchUsersUpstream(term), JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
#region User Attachements
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.Services.Searching;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,20 +12,20 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
public string value { get; set; }
|
||||
public string label { get; set; }
|
||||
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(Disco.Models.BI.Search.DeviceSearchResultItem item)
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(DeviceSearchResultItem item)
|
||||
{
|
||||
return new ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
value = item.SerialNumber,
|
||||
label = string.Format("{0} - {1} - {2}", item.SerialNumber, item.ComputerName, item.DeviceModelDescription)
|
||||
value = item.Id,
|
||||
label = string.Format("{0} - {1} - {2}", item.Id, item.ComputerName, item.DeviceModelDescription)
|
||||
};
|
||||
}
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(JobTableItemModel item)
|
||||
{
|
||||
return new ImporterUndetectedDataIdLookupModel
|
||||
{
|
||||
value = item.Id.ToString(),
|
||||
label = string.Format("{0} ({1}; {2})", item.Id, item.DeviceSerialNumber, item.UserDisplayName)
|
||||
value = item.JobId.ToString(),
|
||||
label = string.Format("{0} ({1}; {2})", item.JobId, item.DeviceSerialNumber, item.UserDisplayName)
|
||||
};
|
||||
}
|
||||
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item)
|
||||
|
||||
@@ -41936,13 +41936,76 @@ jQuery.fn.DataTable.defaults.aLengthMenu = [[10, 20, 50, -1], [10, 20, 50, "All"
|
||||
$(function () {
|
||||
|
||||
// Search Functionality
|
||||
var quickSearchInited = false;
|
||||
$('#SearchQuery').watermark('Search').keypress(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$(this).closest('form').submit();
|
||||
return false;
|
||||
}
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
$this = $(this);
|
||||
$this.select();
|
||||
|
||||
if (!quickSearchInited) {
|
||||
var quickSearchUrl = $this.attr('data-quicksearchurl');
|
||||
if (quickSearchUrl) {
|
||||
$this.autocomplete({
|
||||
source: quickSearchUrl,
|
||||
minLength: 2,
|
||||
select: function (e, ui) {
|
||||
$this.val(ui.item.tag);
|
||||
$this.closest('form').submit();
|
||||
},
|
||||
response: function (e, ui) {
|
||||
for (var i = 0; i < ui.content.length; i++) {
|
||||
var item = ui.content[i];
|
||||
switch (item.Type) {
|
||||
case 'Device':
|
||||
item.tag = '!' + item.Id;
|
||||
break;
|
||||
case 'Job':
|
||||
item.tag = '#' + item.Id;
|
||||
break;
|
||||
case 'User':
|
||||
item.tag = '@' + item.Id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).autocomplete("widget").attr('id', 'QuickSearchMenu');
|
||||
|
||||
$this.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
var template;
|
||||
|
||||
//"<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>"
|
||||
|
||||
switch (item.Type) {
|
||||
case 'Device':
|
||||
template = $('<a>').append('<i class="fa fa-desktop fa-fw">').append($('<strong>').text('Device ' + item.Id)).append($('<div>').text(item.ComputerName + '; ' + item.DeviceModelDescription))
|
||||
break;
|
||||
case 'Job':
|
||||
if (item.DeviceSerialNumber && item.UserId) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.UserId + '; ' + item.DeviceSerialNumber))
|
||||
} else if (item.DeviceSerialNumber) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.DeviceSerialNumber))
|
||||
} else if (item.UserId) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.UserId))
|
||||
}
|
||||
break;
|
||||
case 'User':
|
||||
template = $('<a>').append('<i class="fa fa-user fa-fw">').append($('<strong>').text(item.DisplayName)).append($('<div>').text(item.Id))
|
||||
break;
|
||||
}
|
||||
|
||||
return $("<li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append(template)
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
}
|
||||
quickSearchInited = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Menu Functionality
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -4,13 +4,76 @@
|
||||
$(function () {
|
||||
|
||||
// Search Functionality
|
||||
var quickSearchInited = false;
|
||||
$('#SearchQuery').watermark('Search').keypress(function (e) {
|
||||
if (e.keyCode == 13) {
|
||||
$(this).closest('form').submit();
|
||||
return false;
|
||||
}
|
||||
}).focus(function () {
|
||||
$(this).select();
|
||||
$this = $(this);
|
||||
$this.select();
|
||||
|
||||
if (!quickSearchInited) {
|
||||
var quickSearchUrl = $this.attr('data-quicksearchurl');
|
||||
if (quickSearchUrl) {
|
||||
$this.autocomplete({
|
||||
source: quickSearchUrl,
|
||||
minLength: 2,
|
||||
select: function (e, ui) {
|
||||
$this.val(ui.item.tag);
|
||||
$this.closest('form').submit();
|
||||
},
|
||||
response: function (e, ui) {
|
||||
for (var i = 0; i < ui.content.length; i++) {
|
||||
var item = ui.content[i];
|
||||
switch (item.Type) {
|
||||
case 'Device':
|
||||
item.tag = '!' + item.Id;
|
||||
break;
|
||||
case 'Job':
|
||||
item.tag = '#' + item.Id;
|
||||
break;
|
||||
case 'User':
|
||||
item.tag = '@' + item.Id;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}).autocomplete("widget").attr('id', 'QuickSearchMenu');
|
||||
|
||||
$this.data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
var template;
|
||||
|
||||
//"<a><strong>" + item.DisplayName + "</strong><br>" + item.Id + " (" + item.Type + ")</a>"
|
||||
|
||||
switch (item.Type) {
|
||||
case 'Device':
|
||||
template = $('<a>').append('<i class="fa fa-desktop fa-fw">').append($('<strong>').text('Device ' + item.Id)).append($('<div>').text(item.ComputerName + '; ' + item.DeviceModelDescription))
|
||||
break;
|
||||
case 'Job':
|
||||
if (item.DeviceSerialNumber && item.UserId) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.UserId + '; ' + item.DeviceSerialNumber))
|
||||
} else if (item.DeviceSerialNumber) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.DeviceSerialNumber))
|
||||
} else if (item.UserId) {
|
||||
template = $('<a>').append('<i class="fa fa-question-circle fa-fw">').append($('<strong>').text('Job ' + item.Id)).append($('<div>').text(item.UserId))
|
||||
}
|
||||
break;
|
||||
case 'User':
|
||||
template = $('<a>').append('<i class="fa fa-user fa-fw">').append($('<strong>').text(item.DisplayName)).append($('<div>').text(item.Id))
|
||||
break;
|
||||
}
|
||||
|
||||
return $("<li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append(template)
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
}
|
||||
quickSearchInited = true;
|
||||
}
|
||||
});
|
||||
|
||||
// Menu Functionality
|
||||
|
||||
@@ -3492,6 +3492,25 @@ header .watermark,
|
||||
#header .watermark {
|
||||
background-color: #888;
|
||||
}
|
||||
#QuickSearchMenu {
|
||||
max-height: 400px;
|
||||
font-size: .9em;
|
||||
background: none;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
#QuickSearchMenu li:not(:last-child) {
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
}
|
||||
#QuickSearchMenu li > a {
|
||||
padding: 2px;
|
||||
}
|
||||
#QuickSearchMenu li > a > i {
|
||||
margin-right: 2px;
|
||||
}
|
||||
#QuickSearchMenu li > a > div {
|
||||
padding-left: 1.2857142857142858em;
|
||||
margin-left: 2px;
|
||||
}
|
||||
#layout_PageHeading {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x #ffffff;
|
||||
background: linear-gradient(to bottom, #f2f2f2 0px, #ffffff 50px) #ffffff;
|
||||
@@ -4509,7 +4528,6 @@ input:-moz-placeholder {
|
||||
overflow-x: hidden;
|
||||
/* add padding to account for vertical scrollbar */
|
||||
|
||||
padding-right: 20px;
|
||||
}
|
||||
/* IE 6 doesn't support max-height
|
||||
* we use height instead, but this forces the menu to always be this tall
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -291,6 +291,25 @@ header .watermark,
|
||||
#header .watermark {
|
||||
background-color: #888;
|
||||
}
|
||||
#QuickSearchMenu {
|
||||
max-height: 400px;
|
||||
font-size: .9em;
|
||||
background: none;
|
||||
background-color: #fafafa;
|
||||
}
|
||||
#QuickSearchMenu li:not(:last-child) {
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
}
|
||||
#QuickSearchMenu li > a {
|
||||
padding: 2px;
|
||||
}
|
||||
#QuickSearchMenu li > a > i {
|
||||
margin-right: 2px;
|
||||
}
|
||||
#QuickSearchMenu li > a > div {
|
||||
padding-left: 1.2857142857142858em;
|
||||
margin-left: 2px;
|
||||
}
|
||||
#layout_PageHeading {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x #ffffff;
|
||||
background: linear-gradient(to bottom, #f2f2f2 0px, #ffffff 50px) #ffffff;
|
||||
|
||||
@@ -112,6 +112,7 @@ header, #header {
|
||||
&:first-child {
|
||||
border-top: 1px solid @BackgroundColour;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-bottom: 1px solid @BackgroundColour;
|
||||
}
|
||||
@@ -215,6 +216,31 @@ header, #header {
|
||||
}
|
||||
}
|
||||
|
||||
#QuickSearchMenu {
|
||||
max-height: 400px;
|
||||
font-size: .9em;
|
||||
background: none;
|
||||
background-color: @BackgroundColourLight;
|
||||
|
||||
li {
|
||||
&:not(:last-child) {
|
||||
border-bottom: 1px solid @TableDataDarkBorderColour;
|
||||
}
|
||||
|
||||
& > a {
|
||||
padding: 2px;
|
||||
& > i {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
& > div {
|
||||
padding-left: 1.2857142857142858em;
|
||||
margin-left: 2px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#layout_PageHeading {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x @white;
|
||||
background: linear-gradient(to bottom, @BackgroundColourGradient 0px, @white 50px) @white;
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -106,7 +106,6 @@ input:-moz-placeholder {
|
||||
overflow-x: hidden;
|
||||
/* add padding to account for vertical scrollbar */
|
||||
|
||||
padding-right: 20px;
|
||||
}
|
||||
/* IE 6 doesn't support max-height
|
||||
* we use height instead, but this forces the menu to always be this tall
|
||||
|
||||
@@ -32,7 +32,7 @@ input:-moz-placeholder {
|
||||
/* prevent horizontal scrollbar */
|
||||
overflow-x: hidden;
|
||||
/* add padding to account for vertical scrollbar */
|
||||
padding-right: 20px;
|
||||
//padding-right: 20px;
|
||||
}
|
||||
/* IE 6 doesn't support max-height
|
||||
* we use height instead, but this forces the menu to always be this tall
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -160,7 +160,7 @@ namespace Disco.Web.Controllers
|
||||
HideClosedJobs = true,
|
||||
EnablePaging = false
|
||||
};
|
||||
m.Jobs.Fill(Database, BI.JobBI.Searching.BuildJobTableModel(Database).Where(j => j.DeviceSerialNumber == m.Device.SerialNumber).OrderByDescending(j => j.Id), true);
|
||||
m.Jobs.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.DeviceSerialNumber == m.Device.SerialNumber).OrderByDescending(j => j.Id), true);
|
||||
}
|
||||
|
||||
if (Authorization.Has(Claims.Device.ShowCertificates))
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Disco.Web.Controllers
|
||||
if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
|
||||
{
|
||||
var longRunningThreshold = DateTime.Today.AddDays(Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold * -1);
|
||||
m.LongRunningJobs = ManagedJobList.OpenJobsTable(q => q.Where(j => j.OpenedDate < longRunningThreshold).OrderBy(j => j.Id));
|
||||
m.LongRunningJobs = ManagedJobList.OpenJobsTable(q => q.Where(j => j.OpenedDate < longRunningThreshold).OrderBy(j => j.JobId));
|
||||
}
|
||||
if (Authorization.Has(Claims.Job.ShowDailyChart))
|
||||
m.DailyOpenedClosedStatistics = Disco.BI.JobBI.Statistics.DailyOpenedClosed.Data(Database, true);
|
||||
@@ -68,7 +68,7 @@ namespace Disco.Web.Controllers
|
||||
public virtual ActionResult AllOpen()
|
||||
{
|
||||
var m = new Models.Job.ListModel() { Title = "All Open Jobs" };
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.OrderBy(j => j.Id));
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -97,7 +97,7 @@ namespace Disco.Web.Controllers
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => !j.WaitingForUserAction.HasValue
|
||||
&& j.DeviceHeld != null && j.DeviceReturnedDate == null && j.DeviceReadyForReturn != null &&
|
||||
((!j.JobMetaNonWarranty_AccountingChargeRequiredDate.HasValue && !j.JobMetaNonWarranty_AccountingChargeAddedDate.HasValue) || j.JobMetaNonWarranty_AccountingChargePaidDate.HasValue))
|
||||
.OrderBy(j => j.Id));
|
||||
.OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -113,7 +113,7 @@ namespace Disco.Web.Controllers
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
|
||||
(j.JobMetaNonWarranty_RepairerLoggedDate != null && j.JobMetaNonWarranty_RepairerCompletedDate == null) ||
|
||||
(j.JobMetaWarranty_ExternalLoggedDate != null && j.JobMetaWarranty_ExternalCompletedDate == null)
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -145,7 +145,7 @@ namespace Disco.Web.Controllers
|
||||
var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Accounting Charge" };
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
|
||||
j.JobTypeId == JobType.JobTypeIds.HNWar && (j.JobMetaNonWarranty_AccountingChargeRequiredDate.HasValue && (!j.JobMetaNonWarranty_AccountingChargeAddedDate.HasValue && !j.JobMetaNonWarranty_AccountingChargePaidDate.HasValue))
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -159,7 +159,7 @@ namespace Disco.Web.Controllers
|
||||
var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Accounting Payment" };
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
|
||||
j.JobTypeId == JobType.JobTypeIds.HNWar && ((j.JobMetaNonWarranty_AccountingChargeRequiredDate.HasValue || j.JobMetaNonWarranty_AccountingChargeAddedDate.HasValue) && !j.JobMetaNonWarranty_AccountingChargePaidDate.HasValue)
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -173,7 +173,7 @@ namespace Disco.Web.Controllers
|
||||
var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Insurance Processing" };
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
|
||||
j.JobTypeId == JobType.JobTypeIds.HNWar && (j.JobMetaNonWarranty_IsInsuranceClaim.Value && !j.JobMetaInsurance_ClaimFormSentDate.HasValue)
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -187,7 +187,7 @@ namespace Disco.Web.Controllers
|
||||
var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Agreement Breach" };
|
||||
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
|
||||
j.JobTypeId == JobType.JobTypeIds.UMgmt && Job.UserManagementFlags.Infringement_BreachFinancialAgreement == (j.Flags & Job.UserManagementFlags.Infringement_BreachFinancialAgreement)
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -204,7 +204,7 @@ namespace Disco.Web.Controllers
|
||||
j.WaitingForUserAction.HasValue ||
|
||||
(j.JobMetaNonWarranty_AccountingChargeAddedDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null) ||
|
||||
(j.JobMetaNonWarranty_AccountingChargeRequiredDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null)
|
||||
).OrderBy(j => j.Id));
|
||||
).OrderBy(j => j.JobId));
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
@@ -224,7 +224,7 @@ namespace Disco.Web.Controllers
|
||||
closedThreshold = closedThreshold.AddDays(-2);
|
||||
if (dateTimeNow.DayOfWeek == DayOfWeek.Tuesday)
|
||||
closedThreshold = closedThreshold.AddDays(-1);
|
||||
m.JobTable.Fill(Database, BI.JobBI.Searching.BuildJobTableModel(Database).Where(j => j.ClosedDate > closedThreshold).OrderBy(j => j.Id), true);
|
||||
m.JobTable.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.ClosedDate > closedThreshold).OrderBy(j => j.Id), true);
|
||||
|
||||
// UI Extensions
|
||||
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
|
||||
|
||||
@@ -62,13 +62,13 @@ namespace Disco.Web.Controllers
|
||||
return View(m);
|
||||
}
|
||||
if (Authorization.Has(Claims.Job.Search))
|
||||
m.Jobs = BI.JobBI.Searching.Search(Database, term, null, true, searchDetails);
|
||||
m.Jobs = Services.Searching.Search.SearchJobsTable(Database, term, null, true, searchDetails);
|
||||
|
||||
if (Authorization.Has(Claims.Device.Search))
|
||||
m.Devices = BI.DeviceBI.Searching.Search(Database, term, null, searchDetails);
|
||||
m.Devices = Services.Searching.Search.SearchDevices(Database, term, null, searchDetails);
|
||||
|
||||
if (Authorization.Has(Claims.User.Search))
|
||||
m.Users = BI.UserBI.Searching.Search(Database, term);
|
||||
m.Users = Services.Searching.Search.SearchUsers(Database, term);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -83,7 +83,7 @@ namespace Disco.Web.Controllers
|
||||
if (vm != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Model: {0}", vm.ToString());
|
||||
m.Devices = BI.DeviceBI.Searching.SearchDeviceModel(Database, vm.Id);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceModel(Database, vm.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -100,7 +100,7 @@ namespace Disco.Web.Controllers
|
||||
if (dp != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Profile: {0}", dp.ToString());
|
||||
m.Devices = BI.DeviceBI.Searching.SearchDeviceProfile(Database, dp.Id);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceProfile(Database, dp.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -117,7 +117,7 @@ namespace Disco.Web.Controllers
|
||||
if (db != null)
|
||||
{
|
||||
m.FriendlyTerm = string.Format("Device Batch: {0}", db.ToString());
|
||||
m.Devices = BI.DeviceBI.Searching.SearchDeviceBatch(Database, db.Id);
|
||||
m.Devices = Services.Searching.Search.SearchDeviceBatch(Database, db.Id);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -133,10 +133,10 @@ namespace Disco.Web.Controllers
|
||||
m.ErrorMessage = "A search term of at least two characters is required";
|
||||
return View(m);
|
||||
}
|
||||
m.Devices = BI.DeviceBI.Searching.Search(Database, term, null, searchDetails);
|
||||
m.Devices = Services.Searching.Search.SearchDevices(Database, term, null, searchDetails);
|
||||
if (m.Devices.Count == 1)
|
||||
{
|
||||
return RedirectToAction(MVC.Device.Show(m.Devices[0].SerialNumber));
|
||||
return RedirectToAction(MVC.Device.Show(m.Devices[0].Id));
|
||||
}
|
||||
break;
|
||||
case "jobs":
|
||||
@@ -154,7 +154,7 @@ namespace Disco.Web.Controllers
|
||||
return RedirectToAction(MVC.Job.Show(termInt));
|
||||
}
|
||||
}
|
||||
m.Jobs = BI.JobBI.Searching.Search(Database, term, null, true, searchDetails);
|
||||
m.Jobs = Services.Searching.Search.SearchJobsTable(Database, term, null, true, searchDetails);
|
||||
break;
|
||||
case "users":
|
||||
Authorization.Require(Claims.User.Search);
|
||||
@@ -164,7 +164,7 @@ namespace Disco.Web.Controllers
|
||||
m.ErrorMessage = "A search term of at least two characters is required";
|
||||
return View(m);
|
||||
}
|
||||
m.Users = BI.UserBI.Searching.Search(Database, term);
|
||||
m.Users = Services.Searching.Search.SearchUsers(Database, term);
|
||||
if (m.Users.Count == 1)
|
||||
{
|
||||
return RedirectToAction(MVC.User.Show(m.Users[0].Id));
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Disco.Web.Controllers
|
||||
HideClosedJobs = true,
|
||||
EnablePaging = false
|
||||
};
|
||||
m.Jobs.Fill(Database, BI.JobBI.Searching.BuildJobTableModel(Database).Where(j => j.UserId == id).OrderByDescending(j => j.Id), true);
|
||||
m.Jobs.Fill(Database, Disco.Services.Searching.Search.BuildJobTableModel(Database).Where(j => j.UserId == id).OrderByDescending(j => j.Id), true);
|
||||
}
|
||||
|
||||
try
|
||||
|
||||
@@ -192,6 +192,7 @@
|
||||
<Compile Include="Areas\API\Controllers\JobQueueController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\JobQueueJobController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\PluginController.cs" />
|
||||
<Compile Include="Areas\API\Controllers\SearchController.cs" />
|
||||
<Compile Include="Areas\API\Models\AuthorizationRole\SubjectItem.cs" />
|
||||
<Compile Include="Areas\API\Models\JobQueue\SubjectItem.cs" />
|
||||
<Compile Include="Areas\Config\Controllers\AuthorizationRoleController.cs" />
|
||||
@@ -1957,6 +1958,7 @@
|
||||
<None Include="_bin_deployableAssemblies\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Areas\API\Models\Search\" />
|
||||
<Folder Include="Areas\API\Models\WirelessCertificate\" />
|
||||
<Folder Include="Areas\Services\Models\" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Disco.Models.BI.Search;
|
||||
using Disco.Models.Services.Searching;
|
||||
using Disco.Models.Services.Jobs.JobLists;
|
||||
using Disco.Models.UI.Search;
|
||||
using System.Collections.Generic;
|
||||
|
||||
+106
-7
@@ -63,6 +63,7 @@ namespace T4MVC
|
||||
public Disco.Web.Areas.API.Controllers.JobQueueJobController JobQueueJob = new Disco.Web.Areas.API.Controllers.T4MVC_JobQueueJobController();
|
||||
public Disco.Web.Areas.API.Controllers.LoggingController Logging = new Disco.Web.Areas.API.Controllers.T4MVC_LoggingController();
|
||||
public Disco.Web.Areas.API.Controllers.PluginController Plugin = new Disco.Web.Areas.API.Controllers.T4MVC_PluginController();
|
||||
public Disco.Web.Areas.API.Controllers.SearchController Search = new Disco.Web.Areas.API.Controllers.T4MVC_SearchController();
|
||||
public Disco.Web.Areas.API.Controllers.SystemController System = new Disco.Web.Areas.API.Controllers.T4MVC_SystemController();
|
||||
public Disco.Web.Areas.API.Controllers.UserController User = new Disco.Web.Areas.API.Controllers.T4MVC_UserController();
|
||||
}
|
||||
@@ -474,7 +475,7 @@ namespace Links
|
||||
private const string URLPATH = "~/ClientSource/Style";
|
||||
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
|
||||
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
|
||||
public static readonly string BundleSite_css_bundle = Url("BundleSite.css.bundle");
|
||||
public static readonly string BundleSite_less = Url("BundleSite.less");
|
||||
public static readonly string BundleSite_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/BundleSite.min.css") ? Url("BundleSite.min.css") : Url("BundleSite.css");
|
||||
|
||||
public static readonly string BundleSite_min_css = Url("BundleSite.min.css");
|
||||
@@ -549,8 +550,7 @@ namespace Links
|
||||
private const string URLPATH = "~/ClientSource/Style/FontAwesome";
|
||||
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
|
||||
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); }
|
||||
public static readonly string font_awesome_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/font-awesome.min.css") ? Url("font-awesome.min.css") : Url("font-awesome.css");
|
||||
|
||||
public static readonly string font_awesome_less = Url("font-awesome.less");
|
||||
public static readonly string fontawesome_webfont_eot = Url("fontawesome-webfont.eot");
|
||||
public static readonly string fontawesome_webfont_svg = Url("fontawesome-webfont.svg");
|
||||
public static readonly string fontawesome_webfont_ttf = Url("fontawesome-webfont.ttf");
|
||||
@@ -678,16 +678,17 @@ namespace Links
|
||||
public static readonly string ui_icons_cd0a0a_256x240_png = Url("ui-icons_cd0a0a_256x240.png");
|
||||
}
|
||||
|
||||
public static readonly string jquery_ui_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jquery-ui.min.css") ? Url("jquery-ui.min.css") : Url("jquery-ui.css");
|
||||
|
||||
public static readonly string old_jquery_ui_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/old_jquery-ui.min.css") ? Url("old_jquery-ui.min.css") : Url("old_jquery-ui.css");
|
||||
|
||||
public static readonly string jquery_ui_less = Url("jquery-ui.less");
|
||||
}
|
||||
|
||||
public static readonly string jQueryUIExtensions_less = Url("jQueryUIExtensions.less");
|
||||
public static readonly string jQueryUIExtensions_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/jQueryUIExtensions.min.css") ? Url("jQueryUIExtensions.min.css") : Url("jQueryUIExtensions.css");
|
||||
|
||||
public static readonly string jQueryUIExtensions_min_css = Url("jQueryUIExtensions.min.css");
|
||||
public static readonly string normalize_less = Url("normalize.less");
|
||||
public static readonly string normalize_css = T4MVCHelpers.IsProduction() && T4Extensions.FileExists(URLPATH + "/normalize.min.css") ? Url("normalize.min.css") : Url("normalize.css");
|
||||
|
||||
public static readonly string normalize_min_css = Url("normalize.min.css");
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public static class Public {
|
||||
private const string URLPATH = "~/ClientSource/Style/Public";
|
||||
@@ -8883,6 +8884,104 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class SearchController
|
||||
{
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public SearchController() { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected SearchController(Dummy d) { }
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToAction(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoute(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
protected RedirectToRouteResult RedirectToActionPermanent(ActionResult result)
|
||||
{
|
||||
var callInfo = result.GetT4MVCResult();
|
||||
return RedirectToRoutePermanent(callInfo.RouteValueDictionary);
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public virtual System.Web.Mvc.ActionResult QuickQuery()
|
||||
{
|
||||
return new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.QuickQuery);
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public SearchController Actions { get { return MVC.API.Search; } }
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Area = "API";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public readonly string Name = "Search";
|
||||
[GeneratedCode("T4MVC", "2.0")]
|
||||
public const string NameConst = "Search";
|
||||
|
||||
static readonly ActionNamesClass s_actions = new ActionNamesClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionNamesClass ActionNames { get { return s_actions; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNamesClass
|
||||
{
|
||||
public readonly string QuickQuery = "QuickQuery";
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionNameConstants
|
||||
{
|
||||
public const string QuickQuery = "QuickQuery";
|
||||
}
|
||||
|
||||
|
||||
static readonly ActionParamsClass_QuickQuery s_params_QuickQuery = new ActionParamsClass_QuickQuery();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ActionParamsClass_QuickQuery QuickQueryParams { get { return s_params_QuickQuery; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ActionParamsClass_QuickQuery
|
||||
{
|
||||
public readonly string Term = "Term";
|
||||
public readonly string Limit = "Limit";
|
||||
}
|
||||
static readonly ViewsClass s_views = new ViewsClass();
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public ViewsClass Views { get { return s_views; } }
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public class ViewsClass
|
||||
{
|
||||
static readonly _ViewNamesClass s_ViewNames = new _ViewNamesClass();
|
||||
public _ViewNamesClass ViewNames { get { return s_ViewNames; } }
|
||||
public class _ViewNamesClass
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
|
||||
public partial class T4MVC_SearchController : Disco.Web.Areas.API.Controllers.SearchController
|
||||
{
|
||||
public T4MVC_SearchController() : base(Dummy.Instance) { }
|
||||
|
||||
partial void QuickQueryOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string Term, int Limit);
|
||||
|
||||
public override System.Web.Mvc.ActionResult QuickQuery(string Term, int Limit)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.QuickQuery);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Term", Term);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "Limit", Limit);
|
||||
QuickQueryOverride(callInfo, Term, Limit);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
public partial class SystemController
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>
|
||||
@model IEnumerable<Disco.Models.Services.Searching.DeviceSearchResultItem>
|
||||
@{
|
||||
var canShowDevices = Authorization.Has(Claims.Device.Show);
|
||||
}
|
||||
@@ -30,9 +30,9 @@
|
||||
<tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)">
|
||||
<td>
|
||||
@if (canShowDevices)
|
||||
{@Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber))}
|
||||
{@Html.ActionLink(item.Id, MVC.Device.Show(item.Id))}
|
||||
else
|
||||
{@item.SerialNumber}
|
||||
{@item.Id}
|
||||
</td>
|
||||
<td>
|
||||
@item.AssetNumber
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Device
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -36,7 +37,7 @@ namespace Disco.Web.Views.Device
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceTable.cshtml")]
|
||||
public partial class DeviceTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.BI.Search.DeviceSearchResultItem>>
|
||||
public partial class DeviceTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.Services.Searching.DeviceSearchResultItem>>
|
||||
{
|
||||
public DeviceTable()
|
||||
{
|
||||
@@ -113,14 +114,14 @@ WriteLiteral(@">
|
||||
#line hidden
|
||||
WriteLiteral(" <tr");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 895), Tuple.Create("\"", 972)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 904), Tuple.Create("\"", 981)
|
||||
|
||||
#line 30 "..\..\Views\Device\_DeviceTable.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 903), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
|
||||
, Tuple.Create(Tuple.Create("", 912), Tuple.Create<System.Object, System.Int32>(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 903), false)
|
||||
, 912), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <td>\r\n");
|
||||
@@ -140,7 +141,7 @@ WriteLiteral(">\r\n <td>\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 33 "..\..\Views\Device\_DeviceTable.cshtml"
|
||||
Write(Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber)));
|
||||
Write(Html.ActionLink(item.Id, MVC.Device.Show(item.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -155,7 +156,7 @@ WriteLiteral(">\r\n <td>\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 35 "..\..\Views\Device\_DeviceTable.cshtml"
|
||||
Write(item.SerialNumber);
|
||||
Write(item.Id);
|
||||
|
||||
|
||||
#line default
|
||||
|
||||
@@ -59,9 +59,9 @@
|
||||
@if (Model.ShowId)
|
||||
{<td class="id">
|
||||
@if (Authorization.Has(Claims.Job.Show))
|
||||
{@Html.ActionLink(item.Id.ToString(), MVC.Job.Show(item.Id))}
|
||||
{@Html.ActionLink(item.JobId.ToString(), MVC.Job.Show(item.JobId))}
|
||||
else
|
||||
{@item.Id.ToString()}</td>}
|
||||
{@item.JobId.ToString()}</td>}
|
||||
@if (Model.ShowStatus)
|
||||
{
|
||||
var statusItem = (JobTableStatusItemModel)item;
|
||||
|
||||
@@ -397,7 +397,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 62 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
Write(Html.ActionLink(item.Id.ToString(), MVC.Job.Show(item.Id)));
|
||||
Write(Html.ActionLink(item.JobId.ToString(), MVC.Job.Show(item.JobId)));
|
||||
|
||||
|
||||
#line default
|
||||
@@ -412,7 +412,7 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 64 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
Write(item.Id.ToString());
|
||||
Write(item.JobId.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
@@ -449,17 +449,17 @@ WriteLiteral(" class=\"status\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3230), Tuple.Create("\"", 3277)
|
||||
, Tuple.Create(Tuple.Create("", 3238), Tuple.Create("fa", 3238), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3240), Tuple.Create("fa-square", 3241), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3250), Tuple.Create("jobStatus", 3251), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3239), Tuple.Create("\"", 3286)
|
||||
, Tuple.Create(Tuple.Create("", 3247), Tuple.Create("fa", 3247), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3249), Tuple.Create("fa-square", 3250), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3259), Tuple.Create("jobStatus", 3260), true)
|
||||
|
||||
#line 68 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create(" ", 3260), Tuple.Create<System.Object, System.Int32>(item.StatusId
|
||||
, Tuple.Create(Tuple.Create(" ", 3269), Tuple.Create<System.Object, System.Int32>(item.StatusId
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3261), false)
|
||||
, 3270), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i> ");
|
||||
@@ -508,44 +508,44 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3809), Tuple.Create("\"", 3898)
|
||||
, Tuple.Create(Tuple.Create("", 3817), Tuple.Create("fa", 3817), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3819), Tuple.Create("fa-", 3820), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 3818), Tuple.Create("\"", 3907)
|
||||
, Tuple.Create(Tuple.Create("", 3826), Tuple.Create("fa", 3826), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3828), Tuple.Create("fa-", 3829), true)
|
||||
|
||||
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3823), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.Icon
|
||||
, Tuple.Create(Tuple.Create("", 3832), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3823), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 3853), Tuple.Create("fa-fw", 3854), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3859), Tuple.Create("d-", 3860), true)
|
||||
, 3832), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 3862), Tuple.Create("fa-fw", 3863), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 3868), Tuple.Create("d-", 3869), true)
|
||||
|
||||
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3862), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.IconColour
|
||||
, Tuple.Create(Tuple.Create("", 3871), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3862), false)
|
||||
, 3871), false)
|
||||
);
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3899), Tuple.Create("\"", 3965)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3908), Tuple.Create("\"", 3974)
|
||||
|
||||
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3907), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.Name
|
||||
, Tuple.Create(Tuple.Create("", 3916), Tuple.Create<System.Object, System.Int32>(jqToken.Item2.JobQueue.Name
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3907), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 3937), Tuple.Create("[", 3938), true)
|
||||
, 3916), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 3946), Tuple.Create("[", 3947), true)
|
||||
|
||||
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 3939), Tuple.Create<System.Object, System.Int32>(jqToken.Item1.Priority
|
||||
, Tuple.Create(Tuple.Create("", 3948), Tuple.Create<System.Object, System.Int32>(jqToken.Item1.Priority
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 3939), false)
|
||||
, Tuple.Create(Tuple.Create("", 3964), Tuple.Create("]", 3964), true)
|
||||
, 3948), false)
|
||||
, Tuple.Create(Tuple.Create("", 3973), Tuple.Create("]", 3973), true)
|
||||
);
|
||||
|
||||
WriteLiteral("></i>\r\n");
|
||||
@@ -649,14 +649,14 @@ WriteLiteral(" class=\"type\"");
|
||||
|
||||
WriteLiteral("><span");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4547), Tuple.Create("\"", 4579)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 4556), Tuple.Create("\"", 4588)
|
||||
|
||||
#line 83 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 4555), Tuple.Create<System.Object, System.Int32>(item.JobTypeDescription
|
||||
, Tuple.Create(Tuple.Create("", 4564), Tuple.Create<System.Object, System.Int32>(item.JobTypeDescription
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 4555), false)
|
||||
, 4564), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -724,14 +724,14 @@ WriteLiteral(">\r\n");
|
||||
#line hidden
|
||||
WriteLiteral("<span");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5119), Tuple.Create("\"", 5155)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 5128), Tuple.Create("\"", 5164)
|
||||
|
||||
#line 91 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 5127), Tuple.Create<System.Object, System.Int32>(item.DeviceModelDescription
|
||||
, Tuple.Create(Tuple.Create("", 5136), Tuple.Create<System.Object, System.Int32>(item.DeviceModelDescription
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 5127), false)
|
||||
, 5136), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
@@ -872,14 +872,14 @@ WriteLiteral(" class=\"technician\"");
|
||||
|
||||
WriteLiteral("><span");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 6107), Tuple.Create("\"", 6146)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 6116), Tuple.Create("\"", 6155)
|
||||
|
||||
#line 107 "..\..\Views\Shared\_JobTableRender.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6115), Tuple.Create<System.Object, System.Int32>(item.OpenedTechUserDisplayName
|
||||
, Tuple.Create(Tuple.Create("", 6124), Tuple.Create<System.Object, System.Int32>(item.OpenedTechUserDisplayName
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6115), false)
|
||||
, 6124), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<ul>
|
||||
@foreach (var queueToken in queues)
|
||||
{
|
||||
<li><a href="@Url.Action(MVC.Job.Queue(queueToken.JobQueue.Id))"><i class="fa fa-@(queueToken.JobQueue.Icon) fa-fw d-@(queueToken.JobQueue.IconColour)"></i> @(queueToken.JobQueue.Name)</a></li>
|
||||
<li><a href="@Url.Action(MVC.Job.Queue(queueToken.JobQueue.Id))"><i class="fa fa-@(queueToken.JobQueue.Icon) fa-fw d-@(queueToken.JobQueue.IconColour)"></i>@(queueToken.JobQueue.Name)</a></li>
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
@@ -98,10 +98,12 @@
|
||||
}
|
||||
</ul>
|
||||
</li>
|
||||
@if (Authorization.HasAny(Claims.Device.Search, Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices)){
|
||||
@if (Authorization.HasAny(Claims.Device.Search, Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices))
|
||||
{
|
||||
<li class="@((string)ViewContext.ViewData["MenuArea"] == MVC.Device.Name ? "active" : null)">@Html.ActionLink("Devices", MVC.Device.Index(), accesskey: "2")</li>
|
||||
}
|
||||
@if (Authorization.HasAny(Claims.User.Search)){
|
||||
@if (Authorization.HasAny(Claims.User.Search))
|
||||
{
|
||||
<li class="@((string)ViewContext.ViewData["MenuArea"] == MVC.User.Name ? "active" : null)">@Html.ActionLink("Users", MVC.User.Index(), accesskey: "3")</li>
|
||||
}
|
||||
<li class="moveRight@((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null)">@Html.ActionLink("Reports", MVC.Public.Public.Index())</li>
|
||||
@@ -116,9 +118,11 @@
|
||||
{ @Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id))}
|
||||
else
|
||||
{@CurrentUser.ToString()}</span>
|
||||
@if (Authorization.HasAny(Claims.Job.Search, Claims.Device.Search, Claims.User.Search)){
|
||||
@if (Authorization.HasAny(Claims.Job.Search, Claims.Device.Search, Claims.User.Search))
|
||||
{
|
||||
using (Html.BeginForm(MVC.Search.Query(), FormMethod.Get))
|
||||
{ @Html.TextBox("term", null, new { id="SearchQuery", accesskey = "s", placeholder="Search" }) }}
|
||||
{ @Html.TextBox("term", null, new { id = "SearchQuery", accesskey = "s", placeholder = "Search", data_quicksearchurl = Url.Action(MVC.API.Search.QuickQuery()) }) }
|
||||
}
|
||||
</div>
|
||||
</header>
|
||||
<div id="layout_PageHeading">@CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty)</div>
|
||||
|
||||
@@ -209,40 +209,40 @@ WriteLiteral("></i><a>Queues</a>\r\n <ul>
|
||||
#line hidden
|
||||
WriteLiteral(" <li><a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1672), Tuple.Create("\"", 1729)
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1652), Tuple.Create("\"", 1709)
|
||||
|
||||
#line 35 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1679), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Job.Queue(queueToken.JobQueue.Id))
|
||||
, Tuple.Create(Tuple.Create("", 1659), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.Job.Queue(queueToken.JobQueue.Id))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1679), false)
|
||||
, 1659), false)
|
||||
);
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1733), Tuple.Create("\"", 1816)
|
||||
, Tuple.Create(Tuple.Create("", 1741), Tuple.Create("fa", 1741), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1743), Tuple.Create("fa-", 1744), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 1713), Tuple.Create("\"", 1796)
|
||||
, Tuple.Create(Tuple.Create("", 1721), Tuple.Create("fa", 1721), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1723), Tuple.Create("fa-", 1724), true)
|
||||
|
||||
#line 35 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1747), Tuple.Create<System.Object, System.Int32>(queueToken.JobQueue.Icon
|
||||
, Tuple.Create(Tuple.Create("", 1727), Tuple.Create<System.Object, System.Int32>(queueToken.JobQueue.Icon
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1747), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1774), Tuple.Create("fa-fw", 1775), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1780), Tuple.Create("d-", 1781), true)
|
||||
, 1727), false)
|
||||
, Tuple.Create(Tuple.Create(" ", 1754), Tuple.Create("fa-fw", 1755), true)
|
||||
, Tuple.Create(Tuple.Create(" ", 1760), Tuple.Create("d-", 1761), true)
|
||||
|
||||
#line 35 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1783), Tuple.Create<System.Object, System.Int32>(queueToken.JobQueue.IconColour
|
||||
, Tuple.Create(Tuple.Create("", 1763), Tuple.Create<System.Object, System.Int32>(queueToken.JobQueue.IconColour
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1783), false)
|
||||
, 1763), false)
|
||||
);
|
||||
|
||||
WriteLiteral("></i> ");
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 35 "..\..\Views\Shared\_Layout.cshtml"
|
||||
@@ -260,8 +260,8 @@ WriteLiteral("</a></li>\r\n");
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" </ul>\r\n " +
|
||||
" </li>\r\n");
|
||||
WriteLiteral(" </ul>\r\n </li>\r" +
|
||||
"\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Views\Shared\_Layout.cshtml"
|
||||
@@ -655,27 +655,28 @@ WriteLiteral(" </ul>\r\n </li>\r\n");
|
||||
#line hidden
|
||||
|
||||
#line 101 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.HasAny(Claims.Device.Search, Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices)){
|
||||
if (Authorization.HasAny(Claims.Device.Search, Claims.Device.Actions.Import, Claims.Device.Actions.Export, Claims.Device.Actions.EnrolDevices))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6398), Tuple.Create("\"", 6486)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6391), Tuple.Create("\"", 6479)
|
||||
|
||||
#line 102 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6406), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Device.Name ? "active" : null
|
||||
#line 103 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6399), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Device.Name ? "active" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6406), false)
|
||||
, 6399), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 102 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 103 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Devices", MVC.Device.Index(), accesskey: "2"));
|
||||
|
||||
|
||||
@@ -684,7 +685,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</li>\r\n");
|
||||
|
||||
|
||||
#line 103 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 104 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -693,28 +694,29 @@ WriteLiteral("</li>\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 104 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.HasAny(Claims.User.Search)){
|
||||
#line 105 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.HasAny(Claims.User.Search))
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6673), Tuple.Create("\"", 6759)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6692), Tuple.Create("\"", 6778)
|
||||
|
||||
#line 105 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6681), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.User.Name ? "active" : null
|
||||
#line 107 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6700), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.User.Name ? "active" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6681), false)
|
||||
, 6700), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 105 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 107 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Users", MVC.User.Index(), accesskey: "3"));
|
||||
|
||||
|
||||
@@ -723,7 +725,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</li>\r\n");
|
||||
|
||||
|
||||
#line 106 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 108 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -731,21 +733,21 @@ WriteLiteral("</li>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6873), Tuple.Create("\"", 6971)
|
||||
, Tuple.Create(Tuple.Create("", 6881), Tuple.Create("moveRight", 6881), true)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 6892), Tuple.Create("\"", 6990)
|
||||
, Tuple.Create(Tuple.Create("", 6900), Tuple.Create("moveRight", 6900), true)
|
||||
|
||||
#line 107 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6890), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null
|
||||
#line 109 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 6909), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 6890), false)
|
||||
, 6909), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 107 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 109 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Reports", MVC.Public.Public.Index()));
|
||||
|
||||
|
||||
@@ -754,13 +756,13 @@ WriteLiteral(">");
|
||||
WriteLiteral("</li>\r\n");
|
||||
|
||||
|
||||
#line 108 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 110 "..\..\Views\Shared\_Layout.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 108 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 110 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.Has(Claims.Config.Show))
|
||||
{
|
||||
|
||||
@@ -769,20 +771,20 @@ WriteLiteral("</li>\r\n");
|
||||
#line hidden
|
||||
WriteLiteral(" <li");
|
||||
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 7149), Tuple.Create("\"", 7237)
|
||||
WriteAttribute("class", Tuple.Create(" class=\"", 7168), Tuple.Create("\"", 7256)
|
||||
|
||||
#line 110 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7157), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Config.Name ? "active" : null
|
||||
#line 112 "..\..\Views\Shared\_Layout.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 7176), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Config.Name ? "active" : null
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 7157), false)
|
||||
, 7176), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 110 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 112 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Configuration", MVC.Config.Config.Index(), accesskey: "0"));
|
||||
|
||||
|
||||
@@ -791,7 +793,7 @@ WriteLiteral(">");
|
||||
WriteLiteral("</li>\r\n");
|
||||
|
||||
|
||||
#line 111 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 113 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
|
||||
|
||||
@@ -804,21 +806,21 @@ WriteLiteral(" id=\"headerMenu\"");
|
||||
WriteLiteral(">\r\n <span>");
|
||||
|
||||
|
||||
#line 115 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 117 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.Has(Claims.User.Show))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 116 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 118 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id)));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 116 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 118 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -826,14 +828,14 @@ WriteLiteral(">\r\n <span>");
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 120 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(CurrentUser.ToString());
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 118 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 120 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
|
||||
#line default
|
||||
@@ -841,29 +843,31 @@ WriteLiteral(">\r\n <span>");
|
||||
WriteLiteral("</span>\r\n");
|
||||
|
||||
|
||||
#line 119 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 121 "..\..\Views\Shared\_Layout.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 119 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.HasAny(Claims.Job.Search, Claims.Device.Search, Claims.User.Search)){
|
||||
#line 121 "..\..\Views\Shared\_Layout.cshtml"
|
||||
if (Authorization.HasAny(Claims.Job.Search, Claims.Device.Search, Claims.User.Search))
|
||||
{
|
||||
using (Html.BeginForm(MVC.Search.Query(), FormMethod.Get))
|
||||
{
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 121 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.TextBox("term", null, new { id="SearchQuery", accesskey = "s", placeholder="Search" }));
|
||||
#line 124 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.TextBox("term", null, new { id = "SearchQuery", accesskey = "s", placeholder = "Search", data_quicksearchurl = Url.Action(MVC.API.Search.QuickQuery()) }));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 121 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}}
|
||||
#line 124 "..\..\Views\Shared\_Layout.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
@@ -875,7 +879,7 @@ WriteLiteral(" id=\"layout_PageHeading\"");
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 124 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 128 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty));
|
||||
|
||||
|
||||
@@ -890,7 +894,7 @@ WriteLiteral(">\r\n");
|
||||
WriteLiteral(" ");
|
||||
|
||||
|
||||
#line 126 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 130 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(RenderBody());
|
||||
|
||||
|
||||
@@ -899,7 +903,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("\r\n </section>\r\n <footer>\r\n Disco v");
|
||||
|
||||
|
||||
#line 129 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 133 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Disco.Web.DiscoApplication.Version);
|
||||
|
||||
|
||||
@@ -910,7 +914,7 @@ WriteLiteral(" ");
|
||||
WriteLiteral("@ ");
|
||||
|
||||
|
||||
#line 129 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 133 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Disco.Web.DiscoApplication.OrganisationName);
|
||||
|
||||
|
||||
@@ -920,7 +924,7 @@ WriteLiteral(" | <a\r\n href=\"https://discoict.com.au/\" target=
|
||||
"om.au</a> | ");
|
||||
|
||||
|
||||
#line 130 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 134 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Credits", MVC.Public.Public.Credits()));
|
||||
|
||||
|
||||
@@ -929,7 +933,7 @@ WriteLiteral(" | <a\r\n href=\"https://discoict.com.au/\" target=
|
||||
WriteLiteral(" | ");
|
||||
|
||||
|
||||
#line 130 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 134 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Write(Html.ActionLink("Licence", MVC.Public.Public.Licence()));
|
||||
|
||||
|
||||
@@ -938,13 +942,13 @@ WriteLiteral(" | ");
|
||||
WriteLiteral("\r\n </footer>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 133 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 137 "..\..\Views\Shared\_Layout.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 133 "..\..\Views\Shared\_Layout.cshtml"
|
||||
#line 137 "..\..\Views\Shared\_Layout.cshtml"
|
||||
Disco.Services.Plugins.Features.UIExtension.UIExtensions.ExecuteExtensionResult(this);
|
||||
|
||||
#line default
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@model IEnumerable<Disco.Models.BI.Search.UserSearchResultItem>
|
||||
@model IEnumerable<Disco.Models.Services.Searching.UserSearchResultItem>
|
||||
<div class="genericData userTable">
|
||||
@if (Model != null && Model.Count() > 0)
|
||||
{
|
||||
|
||||
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.User
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
@@ -36,7 +37,7 @@ namespace Disco.Web.Views.User
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/User/_UserTable.cshtml")]
|
||||
public partial class UserTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.BI.Search.UserSearchResultItem>>
|
||||
public partial class UserTable : Disco.Services.Web.WebViewPage<IEnumerable<Disco.Models.Services.Searching.UserSearchResultItem>>
|
||||
{
|
||||
public UserTable()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user