Feature: Quick Search

Device/Job/User Search refactoring. Quick-Search implemented.
This commit is contained in:
Gary Sharp
2014-02-06 16:11:45 +11:00
parent 9ea0273936
commit cd31ba4a6c
53 changed files with 1045 additions and 470 deletions
-76
View File
@@ -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);
}
}
}
-90
View File
@@ -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");
}
}
}
-62
View File
@@ -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);
}
}
}
+1 -4
View File
@@ -129,7 +129,6 @@
<Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" /> <Compile Include="BI\DeviceBI\Importing\ImportParseTask.cs" />
<Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" /> <Compile Include="BI\DeviceBI\Importing\ImportProcessTask.cs" />
<Compile Include="BI\DeviceBI\Migration\LogMacAddressImporting.cs" /> <Compile Include="BI\DeviceBI\Migration\LogMacAddressImporting.cs" />
<Compile Include="BI\DeviceBI\Searching.cs" />
<Compile Include="BI\DisposableImageCollection.cs" /> <Compile Include="BI\DisposableImageCollection.cs" />
<Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" /> <Compile Include="BI\DocumentTemplateBI\DocumentTemplateQRCodeLocationCache.cs" />
<Compile Include="BI\Expressions\EvaluateExpressionParseException.cs" /> <Compile Include="BI\Expressions\EvaluateExpressionParseException.cs" />
@@ -196,10 +195,8 @@
<Compile Include="BI\Interop\SignalRHandlers\ScheduledTasksStatusNotifications.cs" /> <Compile Include="BI\Interop\SignalRHandlers\ScheduledTasksStatusNotifications.cs" />
<Compile Include="BI\Interop\SignalRHandlers\SignalRAuthenticationWorkaround.cs" /> <Compile Include="BI\Interop\SignalRHandlers\SignalRAuthenticationWorkaround.cs" />
<Compile Include="BI\Interop\SignalRHandlers\UserHeldDeviceNotifications.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\Statistics\DailyOpenedClosed.cs" />
<Compile Include="BI\JobBI\Utilities.cs" /> <Compile Include="BI\JobBI\Utilities.cs" />
<Compile Include="BI\UserBI\Searching.cs" />
<Compile Include="BI\Extensions\UtilityExtensions.cs" /> <Compile Include="BI\Extensions\UtilityExtensions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Properties\Resources.Designer.cs"> <Compile Include="Properties\Resources.Designer.cs">
@@ -254,7 +251,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <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> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<Import Project="$(SolutionDir)\.nuget\nuget.targets" /> <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; }
}
}
+5 -3
View File
@@ -63,8 +63,6 @@
<Compile Include="BI\Interop\Community\UpdateRequestV1.cs" /> <Compile Include="BI\Interop\Community\UpdateRequestV1.cs" />
<Compile Include="BI\Interop\Community\UpdateResponse.cs" /> <Compile Include="BI\Interop\Community\UpdateResponse.cs" />
<Compile Include="BI\Job\Statistics\DailyOpenedClosedItem.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\EnrolResponse.cs" />
<Compile Include="ClientServices\MacEnrol.cs" /> <Compile Include="ClientServices\MacEnrol.cs" />
<Compile Include="ClientServices\MacEnrolResponse.cs" /> <Compile Include="ClientServices\MacEnrolResponse.cs" />
@@ -111,6 +109,10 @@
<Compile Include="Services\Jobs\JobLists\JobTableStatusItemModel.cs" /> <Compile Include="Services\Jobs\JobLists\JobTableStatusItemModel.cs" />
<Compile Include="Services\Jobs\JobLists\JobTableStatusQueueItemModel.cs" /> <Compile Include="Services\Jobs\JobLists\JobTableStatusQueueItemModel.cs" />
<Compile Include="Services\Jobs\JobQueues\IJobQueueToken.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\BaseUIModel.cs" />
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleCreateModel.cs" /> <Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleCreateModel.cs" />
<Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleIndexModel.cs" /> <Compile Include="UI\Config\AuthorizationRole\ConfigAuthorizationRoleIndexModel.cs" />
@@ -165,7 +167,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <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> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<PropertyGroup> <PropertyGroup>
@@ -1,22 +1,34 @@
using System; using Disco.Models.Services.Searching;
using System;
namespace Disco.Models.Services.Jobs.JobLists 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 OpenedDate { get; set; }
public DateTime? ClosedDate { get; set; } public DateTime? ClosedDate { get; set; }
public string JobTypeId { get; set; } public string JobTypeId { get; set; }
public string JobTypeDescription { get; set; } public string JobTypeDescription { get; set; }
public string DeviceSerialNumber { get; set; }
public int? DeviceModelId { get; set; } public int? DeviceModelId { get; set; }
public string DeviceModelDescription { get; set; } public string DeviceModelDescription { get; set; }
public int? DeviceProfileId { get; set; } public int? DeviceProfileId { get; set; }
public int? DeviceAddressId { get; set; } public int? DeviceAddressId { get; set; }
public string DeviceAddress { get; set; } public string DeviceAddress { get; set; }
public string UserId { get; set; }
public string UserDisplayName { get; set; }
public string OpenedTechUserId { get; set; } public string OpenedTechUserId { get; set; }
public string OpenedTechUserDisplayName { get; set; } public string OpenedTechUserDisplayName { get; set; }
public string StatusDescription { get; set; } public string StatusDescription { get; set; }
@@ -1,9 +1,20 @@
using System; 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 AssetNumber { get; set; }
public string AssignedUserDescription public string AssignedUserDescription
{ {
@@ -26,6 +37,5 @@ namespace Disco.Models.BI.Search
public string DeviceProfileDescription { get; set; } public string DeviceProfileDescription { get; set; }
public int JobCount { get; set; } public int JobCount { get; set; }
public DateTime? DecommissionedDate { 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; }
}
}
+2 -2
View File
@@ -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; using System.Collections.Generic;
namespace Disco.Models.UI.Search namespace Disco.Models.UI.Search
+3 -1
View File
@@ -173,6 +173,7 @@
<Compile Include="Authorization\Roles\RoleClaims.cs" /> <Compile Include="Authorization\Roles\RoleClaims.cs" />
<Compile Include="Authorization\Roles\RoleToken.cs" /> <Compile Include="Authorization\Roles\RoleToken.cs" />
<Compile Include="Extensions\DateTimeExtensions.cs" /> <Compile Include="Extensions\DateTimeExtensions.cs" />
<Compile Include="Extensions\StringExtensions.cs" />
<Compile Include="Jobs\JobExtensions.cs" /> <Compile Include="Jobs\JobExtensions.cs" />
<Compile Include="Jobs\JobLists\JobTableExtensions.cs" /> <Compile Include="Jobs\JobLists\JobTableExtensions.cs" />
<Compile Include="Jobs\JobQueues\Cache.cs" /> <Compile Include="Jobs\JobQueues\Cache.cs" />
@@ -230,6 +231,7 @@
<Compile Include="Plugins\PluginWebViewPage.cs" /> <Compile Include="Plugins\PluginWebViewPage.cs" />
<Compile Include="Plugins\WebPageHelper.cs" /> <Compile Include="Plugins\WebPageHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Searching\Search.cs" />
<Compile Include="Tasks\ScheduledTask.cs" /> <Compile Include="Tasks\ScheduledTask.cs" />
<Compile Include="Tasks\ScheduledTasks.cs" /> <Compile Include="Tasks\ScheduledTasks.cs" />
<Compile Include="Tasks\ScheduledTasksLog.cs" /> <Compile Include="Tasks\ScheduledTasksLog.cs" />
@@ -278,7 +280,7 @@
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <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> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
<PropertyGroup> <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;
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace Disco.Services
{ {
var i = new JobTableStatusItemModel() var i = new JobTableStatusItemModel()
{ {
Id = j.Id, JobId = j.Id,
OpenedDate = j.OpenedDate, OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate, ClosedDate = j.ClosedDate,
JobTypeId = j.JobTypeId, JobTypeId = j.JobTypeId,
@@ -120,7 +120,7 @@ namespace Disco.Services
var jobItems = Jobs.Select(j => new JobTableStatusItemModel() var jobItems = Jobs.Select(j => new JobTableStatusItemModel()
{ {
Id = j.Id, JobId = j.Id,
OpenedDate = j.OpenedDate, OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate, ClosedDate = j.ClosedDate,
JobTypeId = j.JobTypeId, JobTypeId = j.JobTypeId,
@@ -177,7 +177,7 @@ namespace Disco.Services
{ {
items = Jobs.Select(j => new JobTableItemModel() items = Jobs.Select(j => new JobTableItemModel()
{ {
Id = j.Id, JobId = j.Id,
OpenedDate = j.OpenedDate, OpenedDate = j.OpenedDate,
ClosedDate = j.ClosedDate, ClosedDate = j.ClosedDate,
JobTypeId = j.JobTypeId, JobTypeId = j.JobTypeId,
@@ -217,7 +217,7 @@ using Disco.Services.Authorization;
if (existingItems == null) if (existingItems == null)
throw new InvalidOperationException("Notification algorithm didn't indicate any Jobs for update"); throw new InvalidOperationException("Notification algorithm didn't indicate any Jobs for update");
else else
jobIds = existingItems.Select(i => i.Id).ToList(); jobIds = existingItems.Select(i => i.JobId).ToList();
} }
if (jobIds.Count == 0) if (jobIds.Count == 0)
@@ -232,7 +232,7 @@ using Disco.Services.Authorization;
{ {
// Check for existing items, if not handed them // Check for existing items, if not handed them
if (existingItems == null) 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); var updatedItems = this.DetermineItems(Database, this.FilterFunction(Database.Jobs.Where(j => jobIds.Contains(j.Id))), false);
+247
View File
@@ -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
}
}
+25 -1
View File
@@ -22,13 +22,16 @@ namespace Disco.Services.Users
private const string _cacheHttpRequestKey = "Disco_CurrentUserToken"; private const string _cacheHttpRequestKey = "Disco_CurrentUserToken";
private static Func<string, string[], ActiveDirectoryUserAccount> _GetActiveDirectoryUserAccount; private static Func<string, string[], ActiveDirectoryUserAccount> _GetActiveDirectoryUserAccount;
private static Func<string, string[], ActiveDirectoryMachineAccount> _GetActiveDirectoryMachineAccount; private static Func<string, string[], ActiveDirectoryMachineAccount> _GetActiveDirectoryMachineAccount;
private static Func<string, List<ActiveDirectoryUserAccount>> _SearchActiveDirectoryUsers;
public static void Initialize(DiscoDataContext Database, public static void Initialize(DiscoDataContext Database,
Func<string, string[], ActiveDirectoryUserAccount> GetActiveDirectoryUserAccount, Func<string, string[], ActiveDirectoryUserAccount> GetActiveDirectoryUserAccount,
Func<string, string[], ActiveDirectoryMachineAccount> GetActiveDirectoryMachineAccount) Func<string, string[], ActiveDirectoryMachineAccount> GetActiveDirectoryMachineAccount,
Func<string, List<ActiveDirectoryUserAccount>> SearchActiveDirectoryUsers)
{ {
_GetActiveDirectoryUserAccount = GetActiveDirectoryUserAccount; _GetActiveDirectoryUserAccount = GetActiveDirectoryUserAccount;
_GetActiveDirectoryMachineAccount = GetActiveDirectoryMachineAccount; _GetActiveDirectoryMachineAccount = GetActiveDirectoryMachineAccount;
_SearchActiveDirectoryUsers = SearchActiveDirectoryUsers;
Authorization.Roles.RoleCache.Initialize(Database); Authorization.Roles.RoleCache.Initialize(Database);
} }
@@ -201,6 +204,27 @@ namespace Disco.Services.Users
Cache.FlushCache(); 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) internal static Tuple<User, AuthorizationToken> ImportUser(DiscoDataContext Database, string UserId)
{ {
if (_GetActiveDirectoryUserAccount == null) if (_GetActiveDirectoryUserAccount == null)
+2 -1
View File
@@ -45,7 +45,8 @@ namespace Disco.Web
// Initialize User Service Interop // Initialize User Service Interop
Disco.Services.Users.UserService.Initialize(Database, Disco.Services.Users.UserService.Initialize(Database,
(UserId, AdditionalProperties) => Disco.BI.Interop.ActiveDirectory.ActiveDirectory.GetUserAccount(UserId, AdditionalProperties), (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));
} }
+2 -1
View File
@@ -37,7 +37,8 @@ namespace Disco.Web
routes.MapRoute( routes.MapRoute(
name: "SearchQuery", name: "SearchQuery",
url: "Search/Query/{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 // User Route
routes.MapRoute( routes.MapRoute(
+2 -1
View File
@@ -35,7 +35,8 @@ namespace Disco.Web.Areas.API
context.MapRoute( context.MapRoute(
"API_default", "API_default",
"API/{controller}/{action}/{id}", "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) switch (searchScope)
{ {
case DocumentTemplate.DocumentTemplateScopes.Device: 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; break;
case DocumentTemplate.DocumentTemplateScopes.Job: 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; break;
case DocumentTemplate.DocumentTemplateScopes.User: 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; break;
default: default:
results = null; 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)] [DiscoAuthorize(Claims.User.Search)]
public virtual ActionResult UpstreamUsers(string term) 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 #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;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
@@ -12,20 +12,20 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
public string value { get; set; } public string value { get; set; }
public string label { 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 return new ImporterUndetectedDataIdLookupModel
{ {
value = item.SerialNumber, value = item.Id,
label = string.Format("{0} - {1} - {2}", item.SerialNumber, item.ComputerName, item.DeviceModelDescription) label = string.Format("{0} - {1} - {2}", item.Id, item.ComputerName, item.DeviceModelDescription)
}; };
} }
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(JobTableItemModel item) public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(JobTableItemModel item)
{ {
return new ImporterUndetectedDataIdLookupModel return new ImporterUndetectedDataIdLookupModel
{ {
value = item.Id.ToString(), value = item.JobId.ToString(),
label = string.Format("{0} ({1}; {2})", item.Id, item.DeviceSerialNumber, item.UserDisplayName) label = string.Format("{0} ({1}; {2})", item.JobId, item.DeviceSerialNumber, item.UserDisplayName)
}; };
} }
public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item) public static ImporterUndetectedDataIdLookupModel FromSearchResultItem(UserSearchResultItem item)
+64 -1
View File
@@ -41936,13 +41936,76 @@ jQuery.fn.DataTable.defaults.aLengthMenu = [[10, 20, 50, -1], [10, 20, 50, "All"
$(function () { $(function () {
// Search Functionality // Search Functionality
var quickSearchInited = false;
$('#SearchQuery').watermark('Search').keypress(function (e) { $('#SearchQuery').watermark('Search').keypress(function (e) {
if (e.keyCode == 13) { if (e.keyCode == 13) {
$(this).closest('form').submit(); $(this).closest('form').submit();
return false; return false;
} }
}).focus(function () { }).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 // Menu Functionality
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 () { $(function () {
// Search Functionality // Search Functionality
var quickSearchInited = false;
$('#SearchQuery').watermark('Search').keypress(function (e) { $('#SearchQuery').watermark('Search').keypress(function (e) {
if (e.keyCode == 13) { if (e.keyCode == 13) {
$(this).closest('form').submit(); $(this).closest('form').submit();
return false; return false;
} }
}).focus(function () { }).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 // Menu Functionality
+19 -1
View File
@@ -3492,6 +3492,25 @@ header .watermark,
#header .watermark { #header .watermark {
background-color: #888; 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 { #layout_PageHeading {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x #ffffff; 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; background: linear-gradient(to bottom, #f2f2f2 0px, #ffffff 50px) #ffffff;
@@ -4509,7 +4528,6 @@ input:-moz-placeholder {
overflow-x: hidden; overflow-x: hidden;
/* add padding to account for vertical scrollbar */ /* add padding to account for vertical scrollbar */
padding-right: 20px;
} }
/* IE 6 doesn't support max-height /* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall * we use height instead, but this forces the menu to always be this tall
File diff suppressed because one or more lines are too long
+19
View File
@@ -291,6 +291,25 @@ header .watermark,
#header .watermark { #header .watermark {
background-color: #888; 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 { #layout_PageHeading {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x #ffffff; 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; background: linear-gradient(to bottom, #f2f2f2 0px, #ffffff 50px) #ffffff;
+26
View File
@@ -112,6 +112,7 @@ header, #header {
&:first-child { &:first-child {
border-top: 1px solid @BackgroundColour; border-top: 1px solid @BackgroundColour;
} }
&:last-child { &:last-child {
border-bottom: 1px solid @BackgroundColour; 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 { #layout_PageHeading {
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAA8CAYAAABfESsNAAAAOUlEQVRIx+2SuREAIAzDFELL/uOSFVLx3Mm1C8nnABaNDJq5WJzAVkZGZXyPMg7+jUwCIeNZmdcZC2pxCZOpoRNgAAAAAElFTkSuQmCC) /*Images/BackgroundPage.png*/ left top repeat-x @white; 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; background: linear-gradient(to bottom, @BackgroundColourGradient 0px, @white 50px) @white;
File diff suppressed because one or more lines are too long
@@ -106,7 +106,6 @@ input:-moz-placeholder {
overflow-x: hidden; overflow-x: hidden;
/* add padding to account for vertical scrollbar */ /* add padding to account for vertical scrollbar */
padding-right: 20px;
} }
/* IE 6 doesn't support max-height /* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall * we use height instead, but this forces the menu to always be this tall
@@ -32,7 +32,7 @@ input:-moz-placeholder {
/* prevent horizontal scrollbar */ /* prevent horizontal scrollbar */
overflow-x: hidden; overflow-x: hidden;
/* add padding to account for vertical scrollbar */ /* add padding to account for vertical scrollbar */
padding-right: 20px; //padding-right: 20px;
} }
/* IE 6 doesn't support max-height /* IE 6 doesn't support max-height
* we use height instead, but this forces the menu to always be this tall * we use height instead, but this forces the menu to always be this tall
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -160,7 +160,7 @@ namespace Disco.Web.Controllers
HideClosedJobs = true, HideClosedJobs = true,
EnablePaging = false 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)) if (Authorization.Has(Claims.Device.ShowCertificates))
+10 -10
View File
@@ -34,7 +34,7 @@ namespace Disco.Web.Controllers
if (Authorization.Has(Claims.Job.Lists.LongRunningJobs)) if (Authorization.Has(Claims.Job.Lists.LongRunningJobs))
{ {
var longRunningThreshold = DateTime.Today.AddDays(Database.DiscoConfiguration.JobPreferences.LongRunningJobDaysThreshold * -1); 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)) if (Authorization.Has(Claims.Job.ShowDailyChart))
m.DailyOpenedClosedStatistics = Disco.BI.JobBI.Statistics.DailyOpenedClosed.Data(Database, true); m.DailyOpenedClosedStatistics = Disco.BI.JobBI.Statistics.DailyOpenedClosed.Data(Database, true);
@@ -68,7 +68,7 @@ namespace Disco.Web.Controllers
public virtual ActionResult AllOpen() public virtual ActionResult AllOpen()
{ {
var m = new Models.Job.ListModel() { Title = "All Open Jobs" }; 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 // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); 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 m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => !j.WaitingForUserAction.HasValue
&& j.DeviceHeld != null && j.DeviceReturnedDate == null && j.DeviceReadyForReturn != null && && j.DeviceHeld != null && j.DeviceReturnedDate == null && j.DeviceReadyForReturn != null &&
((!j.JobMetaNonWarranty_AccountingChargeRequiredDate.HasValue && !j.JobMetaNonWarranty_AccountingChargeAddedDate.HasValue) || j.JobMetaNonWarranty_AccountingChargePaidDate.HasValue)) ((!j.JobMetaNonWarranty_AccountingChargeRequiredDate.HasValue && !j.JobMetaNonWarranty_AccountingChargeAddedDate.HasValue) || j.JobMetaNonWarranty_AccountingChargePaidDate.HasValue))
.OrderBy(j => j.Id)); .OrderBy(j => j.JobId));
// UI Extensions // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
@@ -113,7 +113,7 @@ namespace Disco.Web.Controllers
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
(j.JobMetaNonWarranty_RepairerLoggedDate != null && j.JobMetaNonWarranty_RepairerCompletedDate == null) || (j.JobMetaNonWarranty_RepairerLoggedDate != null && j.JobMetaNonWarranty_RepairerCompletedDate == null) ||
(j.JobMetaWarranty_ExternalLoggedDate != null && j.JobMetaWarranty_ExternalCompletedDate == null) (j.JobMetaWarranty_ExternalLoggedDate != null && j.JobMetaWarranty_ExternalCompletedDate == null)
).OrderBy(j => j.Id)); ).OrderBy(j => j.JobId));
// UI Extensions // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); 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" }; var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Accounting Charge" };
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => 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)) 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 // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); 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" }; var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Accounting Payment" };
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => 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) 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 // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); 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" }; var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Insurance Processing" };
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
j.JobTypeId == JobType.JobTypeIds.HNWar && (j.JobMetaNonWarranty_IsInsuranceClaim.Value && !j.JobMetaInsurance_ClaimFormSentDate.HasValue) j.JobTypeId == JobType.JobTypeIds.HNWar && (j.JobMetaNonWarranty_IsInsuranceClaim.Value && !j.JobMetaInsurance_ClaimFormSentDate.HasValue)
).OrderBy(j => j.Id)); ).OrderBy(j => j.JobId));
// UI Extensions // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); 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" }; var m = new Models.Job.ListModel() { Title = "Jobs Awaiting Finance - Agreement Breach" };
m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j => m.JobTable = ManagedJobList.OpenJobsTable(q => q.Where(j =>
j.JobTypeId == JobType.JobTypeIds.UMgmt && Job.UserManagementFlags.Infringement_BreachFinancialAgreement == (j.Flags & Job.UserManagementFlags.Infringement_BreachFinancialAgreement) 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 // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
@@ -204,7 +204,7 @@ namespace Disco.Web.Controllers
j.WaitingForUserAction.HasValue || j.WaitingForUserAction.HasValue ||
(j.JobMetaNonWarranty_AccountingChargeAddedDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null) || (j.JobMetaNonWarranty_AccountingChargeAddedDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null) ||
(j.JobMetaNonWarranty_AccountingChargeRequiredDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null) (j.JobMetaNonWarranty_AccountingChargeRequiredDate != null && j.JobMetaNonWarranty_AccountingChargePaidDate == null)
).OrderBy(j => j.Id)); ).OrderBy(j => j.JobId));
// UI Extensions // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
@@ -224,7 +224,7 @@ namespace Disco.Web.Controllers
closedThreshold = closedThreshold.AddDays(-2); closedThreshold = closedThreshold.AddDays(-2);
if (dateTimeNow.DayOfWeek == DayOfWeek.Tuesday) if (dateTimeNow.DayOfWeek == DayOfWeek.Tuesday)
closedThreshold = closedThreshold.AddDays(-1); 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 // UI Extensions
UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m); UIExtensions.ExecuteExtensions<JobListModel>(this.ControllerContext, m);
+10 -10
View File
@@ -62,13 +62,13 @@ namespace Disco.Web.Controllers
return View(m); return View(m);
} }
if (Authorization.Has(Claims.Job.Search)) 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)) 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)) if (Authorization.Has(Claims.User.Search))
m.Users = BI.UserBI.Searching.Search(Database, term); m.Users = Services.Searching.Search.SearchUsers(Database, term);
} }
else else
{ {
@@ -83,7 +83,7 @@ namespace Disco.Web.Controllers
if (vm != null) if (vm != null)
{ {
m.FriendlyTerm = string.Format("Device Model: {0}", vm.ToString()); 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; break;
} }
} }
@@ -100,7 +100,7 @@ namespace Disco.Web.Controllers
if (dp != null) if (dp != null)
{ {
m.FriendlyTerm = string.Format("Device Profile: {0}", dp.ToString()); 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; break;
} }
} }
@@ -117,7 +117,7 @@ namespace Disco.Web.Controllers
if (db != null) if (db != null)
{ {
m.FriendlyTerm = string.Format("Device Batch: {0}", db.ToString()); 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; break;
} }
} }
@@ -133,10 +133,10 @@ namespace Disco.Web.Controllers
m.ErrorMessage = "A search term of at least two characters is required"; m.ErrorMessage = "A search term of at least two characters is required";
return View(m); 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) if (m.Devices.Count == 1)
{ {
return RedirectToAction(MVC.Device.Show(m.Devices[0].SerialNumber)); return RedirectToAction(MVC.Device.Show(m.Devices[0].Id));
} }
break; break;
case "jobs": case "jobs":
@@ -154,7 +154,7 @@ namespace Disco.Web.Controllers
return RedirectToAction(MVC.Job.Show(termInt)); 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; break;
case "users": case "users":
Authorization.Require(Claims.User.Search); 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"; m.ErrorMessage = "A search term of at least two characters is required";
return View(m); return View(m);
} }
m.Users = BI.UserBI.Searching.Search(Database, term); m.Users = Services.Searching.Search.SearchUsers(Database, term);
if (m.Users.Count == 1) if (m.Users.Count == 1)
{ {
return RedirectToAction(MVC.User.Show(m.Users[0].Id)); return RedirectToAction(MVC.User.Show(m.Users[0].Id));
+1 -1
View File
@@ -64,7 +64,7 @@ namespace Disco.Web.Controllers
HideClosedJobs = true, HideClosedJobs = true,
EnablePaging = false 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 try
+2
View File
@@ -192,6 +192,7 @@
<Compile Include="Areas\API\Controllers\JobQueueController.cs" /> <Compile Include="Areas\API\Controllers\JobQueueController.cs" />
<Compile Include="Areas\API\Controllers\JobQueueJobController.cs" /> <Compile Include="Areas\API\Controllers\JobQueueJobController.cs" />
<Compile Include="Areas\API\Controllers\PluginController.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\AuthorizationRole\SubjectItem.cs" />
<Compile Include="Areas\API\Models\JobQueue\SubjectItem.cs" /> <Compile Include="Areas\API\Models\JobQueue\SubjectItem.cs" />
<Compile Include="Areas\Config\Controllers\AuthorizationRoleController.cs" /> <Compile Include="Areas\Config\Controllers\AuthorizationRoleController.cs" />
@@ -1957,6 +1958,7 @@
<None Include="_bin_deployableAssemblies\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" /> <None Include="_bin_deployableAssemblies\x86\Microsoft.VC90.CRT\Microsoft.VC90.CRT.manifest" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Folder Include="Areas\API\Models\Search\" />
<Folder Include="Areas\API\Models\WirelessCertificate\" /> <Folder Include="Areas\API\Models\WirelessCertificate\" />
<Folder Include="Areas\Services\Models\" /> <Folder Include="Areas\Services\Models\" />
</ItemGroup> </ItemGroup>
+1 -1
View File
@@ -1,4 +1,4 @@
using Disco.Models.BI.Search; using Disco.Models.Services.Searching;
using Disco.Models.Services.Jobs.JobLists; using Disco.Models.Services.Jobs.JobLists;
using Disco.Models.UI.Search; using Disco.Models.UI.Search;
using System.Collections.Generic; using System.Collections.Generic;
+106 -7
View File
@@ -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.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.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.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.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(); 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"; private const string URLPATH = "~/ClientSource/Style";
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); } public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); } 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_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"); public static readonly string BundleSite_min_css = Url("BundleSite.min.css");
@@ -549,8 +550,7 @@ namespace Links
private const string URLPATH = "~/ClientSource/Style/FontAwesome"; private const string URLPATH = "~/ClientSource/Style/FontAwesome";
public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); } public static string Url() { return T4MVCHelpers.ProcessVirtualPath(URLPATH); }
public static string Url(string fileName) { return T4MVCHelpers.ProcessVirtualPath(URLPATH + "/" + fileName); } 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_eot = Url("fontawesome-webfont.eot");
public static readonly string fontawesome_webfont_svg = Url("fontawesome-webfont.svg"); public static readonly string fontawesome_webfont_svg = Url("fontawesome-webfont.svg");
public static readonly string fontawesome_webfont_ttf = Url("fontawesome-webfont.ttf"); 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 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 jquery_ui_less = Url("jquery-ui.less");
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 jQueryUIExtensions_less = Url("jQueryUIExtensions.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_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 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] [GeneratedCode("T4MVC", "2.0"), DebuggerNonUserCode]
public static class Public { public static class Public {
private const string URLPATH = "~/ClientSource/Style/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 namespace Disco.Web.Areas.API.Controllers
{ {
public partial class SystemController public partial class SystemController
+3 -3
View File
@@ -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); var canShowDevices = Authorization.Has(Claims.Device.Show);
} }
@@ -30,9 +30,9 @@
<tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)"> <tr class="@(item.DecommissionedDate.HasValue ? "decommissioned" : string.Empty)">
<td> <td>
@if (canShowDevices) @if (canShowDevices)
{@Html.ActionLink(item.SerialNumber, MVC.Device.Show(item.SerialNumber))} {@Html.ActionLink(item.Id, MVC.Device.Show(item.Id))}
else else
{@item.SerialNumber} {@item.Id}
</td> </td>
<td> <td>
@item.AssetNumber @item.AssetNumber
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.Device
using Disco; using Disco;
using Disco.BI.Extensions; using Disco.BI.Extensions;
using Disco.Models.Repository; using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization; using Disco.Services.Authorization;
using Disco.Services.Web; using Disco.Services.Web;
using Disco.Web; using Disco.Web;
@@ -36,7 +37,7 @@ namespace Disco.Web.Views.Device
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/Device/_DeviceTable.cshtml")] [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() public DeviceTable()
{ {
@@ -113,14 +114,14 @@ WriteLiteral(@">
#line hidden #line hidden
WriteLiteral(" <tr"); 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" #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 default
#line hidden #line hidden
, 903), false) , 912), false)
); );
WriteLiteral(">\r\n <td>\r\n"); WriteLiteral(">\r\n <td>\r\n");
@@ -140,14 +141,14 @@ WriteLiteral(">\r\n <td>\r\n");
#line hidden #line hidden
#line 33 "..\..\Views\Device\_DeviceTable.cshtml" #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 #line default
#line hidden #line hidden
#line 33 "..\..\Views\Device\_DeviceTable.cshtml" #line 33 "..\..\Views\Device\_DeviceTable.cshtml"
} }
else else
{ {
@@ -155,14 +156,14 @@ WriteLiteral(">\r\n <td>\r\n");
#line hidden #line hidden
#line 35 "..\..\Views\Device\_DeviceTable.cshtml" #line 35 "..\..\Views\Device\_DeviceTable.cshtml"
Write(item.SerialNumber); Write(item.Id);
#line default #line default
#line hidden #line hidden
#line 35 "..\..\Views\Device\_DeviceTable.cshtml" #line 35 "..\..\Views\Device\_DeviceTable.cshtml"
} }
#line default #line default
@@ -59,9 +59,9 @@
@if (Model.ShowId) @if (Model.ShowId)
{<td class="id"> {<td class="id">
@if (Authorization.Has(Claims.Job.Show)) @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 else
{@item.Id.ToString()}</td>} {@item.JobId.ToString()}</td>}
@if (Model.ShowStatus) @if (Model.ShowStatus)
{ {
var statusItem = (JobTableStatusItemModel)item; var statusItem = (JobTableStatusItemModel)item;
@@ -397,14 +397,14 @@ WriteLiteral(">\r\n");
#line hidden #line hidden
#line 62 "..\..\Views\Shared\_JobTableRender.cshtml" #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 #line default
#line hidden #line hidden
#line 62 "..\..\Views\Shared\_JobTableRender.cshtml" #line 62 "..\..\Views\Shared\_JobTableRender.cshtml"
} }
else else
{ {
@@ -412,14 +412,14 @@ WriteLiteral(">\r\n");
#line hidden #line hidden
#line 64 "..\..\Views\Shared\_JobTableRender.cshtml" #line 64 "..\..\Views\Shared\_JobTableRender.cshtml"
Write(item.Id.ToString()); Write(item.JobId.ToString());
#line default #line default
#line hidden #line hidden
#line 64 "..\..\Views\Shared\_JobTableRender.cshtml" #line 64 "..\..\Views\Shared\_JobTableRender.cshtml"
} }
#line default #line default
#line hidden #line hidden
@@ -427,7 +427,7 @@ WriteLiteral("</td>");
#line 64 "..\..\Views\Shared\_JobTableRender.cshtml" #line 64 "..\..\Views\Shared\_JobTableRender.cshtml"
} }
#line default #line default
@@ -449,17 +449,17 @@ WriteLiteral(" class=\"status\"");
WriteLiteral("><i"); WriteLiteral("><i");
WriteAttribute("class", Tuple.Create(" class=\"", 3230), Tuple.Create("\"", 3277) WriteAttribute("class", Tuple.Create(" class=\"", 3239), Tuple.Create("\"", 3286)
, Tuple.Create(Tuple.Create("", 3238), Tuple.Create("fa", 3238), true) , Tuple.Create(Tuple.Create("", 3247), Tuple.Create("fa", 3247), true)
, Tuple.Create(Tuple.Create(" ", 3240), Tuple.Create("fa-square", 3241), true) , Tuple.Create(Tuple.Create(" ", 3249), Tuple.Create("fa-square", 3250), true)
, Tuple.Create(Tuple.Create(" ", 3250), Tuple.Create("jobStatus", 3251), true) , Tuple.Create(Tuple.Create(" ", 3259), Tuple.Create("jobStatus", 3260), true)
#line 68 "..\..\Views\Shared\_JobTableRender.cshtml" #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 default
#line hidden #line hidden
, 3261), false) , 3270), false)
); );
WriteLiteral("></i>&nbsp;"); WriteLiteral("></i>&nbsp;");
@@ -508,44 +508,44 @@ WriteLiteral(">\r\n");
#line hidden #line hidden
WriteLiteral(" <i"); WriteLiteral(" <i");
WriteAttribute("class", Tuple.Create(" class=\"", 3809), Tuple.Create("\"", 3898) WriteAttribute("class", Tuple.Create(" class=\"", 3818), Tuple.Create("\"", 3907)
, Tuple.Create(Tuple.Create("", 3817), Tuple.Create("fa", 3817), true) , Tuple.Create(Tuple.Create("", 3826), Tuple.Create("fa", 3826), true)
, Tuple.Create(Tuple.Create(" ", 3819), Tuple.Create("fa-", 3820), true) , Tuple.Create(Tuple.Create(" ", 3828), Tuple.Create("fa-", 3829), true)
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml" #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 default
#line hidden #line hidden
, 3823), false) , 3832), false)
, Tuple.Create(Tuple.Create(" ", 3853), Tuple.Create("fa-fw", 3854), true) , Tuple.Create(Tuple.Create(" ", 3862), Tuple.Create("fa-fw", 3863), true)
, Tuple.Create(Tuple.Create(" ", 3859), Tuple.Create("d-", 3860), true) , Tuple.Create(Tuple.Create(" ", 3868), Tuple.Create("d-", 3869), true)
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml" #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 default
#line hidden #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" #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 default
#line hidden #line hidden
, 3907), false) , 3916), false)
, Tuple.Create(Tuple.Create(" ", 3937), Tuple.Create("[", 3938), true) , Tuple.Create(Tuple.Create(" ", 3946), Tuple.Create("[", 3947), true)
#line 73 "..\..\Views\Shared\_JobTableRender.cshtml" #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 default
#line hidden #line hidden
, 3939), false) , 3948), false)
, Tuple.Create(Tuple.Create("", 3964), Tuple.Create("]", 3964), true) , Tuple.Create(Tuple.Create("", 3973), Tuple.Create("]", 3973), true)
); );
WriteLiteral("></i>\r\n"); WriteLiteral("></i>\r\n");
@@ -649,14 +649,14 @@ WriteLiteral(" class=\"type\"");
WriteLiteral("><span"); 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" #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 default
#line hidden #line hidden
, 4555), false) , 4564), false)
); );
WriteLiteral(">"); WriteLiteral(">");
@@ -724,14 +724,14 @@ WriteLiteral(">\r\n");
#line hidden #line hidden
WriteLiteral("<span"); 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" #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 default
#line hidden #line hidden
, 5127), false) , 5136), false)
); );
WriteLiteral(">"); WriteLiteral(">");
@@ -872,14 +872,14 @@ WriteLiteral(" class=\"technician\"");
WriteLiteral("><span"); 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" #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 default
#line hidden #line hidden
, 6115), false) , 6124), false)
); );
WriteLiteral(">"); WriteLiteral(">");
+19 -15
View File
@@ -28,14 +28,14 @@
var queues = Disco.Services.Jobs.JobQueues.JobQueueService.GetQueues(); var queues = Disco.Services.Jobs.JobQueues.JobQueueService.GetQueues();
if (queues.Count > 0) if (queues.Count > 0)
{ {
<li class="d-sm"><i class="fa fa-caret-right"></i><a>Queues</a> <li class="d-sm"><i class="fa fa-caret-right"></i><a>Queues</a>
<ul> <ul>
@foreach (var queueToken in queues) @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> </ul>
</li> </li>
} }
} }
@if (Authorization.Has(Claims.Job.Lists.AwaitingTechnicianAction)) @if (Authorization.Has(Claims.Job.Lists.AwaitingTechnicianAction))
@@ -98,11 +98,13 @@
} }
</ul> </ul>
</li> </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> {
<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="@((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> <li class="moveRight@((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null)">@Html.ActionLink("Reports", MVC.Public.Public.Index())</li>
@if (Authorization.Has(Claims.Config.Show)) @if (Authorization.Has(Claims.Config.Show))
@@ -116,9 +118,11 @@
{ @Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id))} { @Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id))}
else else
{@CurrentUser.ToString()}</span> {@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" }) }} using (Html.BeginForm(MVC.Search.Query(), FormMethod.Get))
{ @Html.TextBox("term", null, new { id = "SearchQuery", accesskey = "s", placeholder = "Search", data_quicksearchurl = Url.Action(MVC.API.Search.QuickQuery()) }) }
}
</div> </div>
</header> </header>
<div id="layout_PageHeading">@CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty)</div> <div id="layout_PageHeading">@CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty)</div>
+87 -83
View File
@@ -183,7 +183,7 @@ WriteLiteral("\r\n <ul>\r\n");
#line default #line default
#line hidden #line hidden
WriteLiteral(" <li"); WriteLiteral(" <li");
WriteLiteral(" class=\"d-sm\""); WriteLiteral(" class=\"d-sm\"");
@@ -191,62 +191,62 @@ WriteLiteral("><i");
WriteLiteral(" class=\"fa fa-caret-right\""); WriteLiteral(" class=\"fa fa-caret-right\"");
WriteLiteral("></i><a>Queues</a>\r\n <ul>\r\n"); WriteLiteral("></i><a>Queues</a>\r\n <ul>\r\n");
#line 33 "..\..\Views\Shared\_Layout.cshtml" #line 33 "..\..\Views\Shared\_Layout.cshtml"
#line default #line default
#line hidden #line hidden
#line 33 "..\..\Views\Shared\_Layout.cshtml" #line 33 "..\..\Views\Shared\_Layout.cshtml"
foreach (var queueToken in queues) foreach (var queueToken in queues)
{ {
#line default #line default
#line hidden #line hidden
WriteLiteral(" <li><a"); 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" #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 default
#line hidden #line hidden
, 1679), false) , 1659), false)
); );
WriteLiteral("><i"); WriteLiteral("><i");
WriteAttribute("class", Tuple.Create(" class=\"", 1733), Tuple.Create("\"", 1816) WriteAttribute("class", Tuple.Create(" class=\"", 1713), Tuple.Create("\"", 1796)
, Tuple.Create(Tuple.Create("", 1741), Tuple.Create("fa", 1741), true) , Tuple.Create(Tuple.Create("", 1721), Tuple.Create("fa", 1721), true)
, Tuple.Create(Tuple.Create(" ", 1743), Tuple.Create("fa-", 1744), true) , Tuple.Create(Tuple.Create(" ", 1723), Tuple.Create("fa-", 1724), true)
#line 35 "..\..\Views\Shared\_Layout.cshtml" #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 default
#line hidden #line hidden
, 1747), false) , 1727), false)
, Tuple.Create(Tuple.Create(" ", 1774), Tuple.Create("fa-fw", 1775), true) , Tuple.Create(Tuple.Create(" ", 1754), Tuple.Create("fa-fw", 1755), true)
, Tuple.Create(Tuple.Create(" ", 1780), Tuple.Create("d-", 1781), true) , Tuple.Create(Tuple.Create(" ", 1760), Tuple.Create("d-", 1761), true)
#line 35 "..\..\Views\Shared\_Layout.cshtml" #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 default
#line hidden #line hidden
, 1783), false) , 1763), false)
); );
WriteLiteral("></i> "); WriteLiteral("></i>");
#line 35 "..\..\Views\Shared\_Layout.cshtml" #line 35 "..\..\Views\Shared\_Layout.cshtml"
Write(queueToken.JobQueue.Name); Write(queueToken.JobQueue.Name);
#line default #line default
@@ -255,13 +255,13 @@ WriteLiteral("</a></li>\r\n");
#line 36 "..\..\Views\Shared\_Layout.cshtml" #line 36 "..\..\Views\Shared\_Layout.cshtml"
} }
#line default #line default
#line hidden #line hidden
WriteLiteral(" </ul>\r\n " + WriteLiteral(" </ul>\r\n </li>\r" +
" </li>\r\n"); "\n");
#line 39 "..\..\Views\Shared\_Layout.cshtml" #line 39 "..\..\Views\Shared\_Layout.cshtml"
@@ -655,28 +655,29 @@ WriteLiteral(" </ul>\r\n </li>\r\n");
#line hidden #line hidden
#line 101 "..\..\Views\Shared\_Layout.cshtml" #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 default
#line hidden #line hidden
WriteLiteral(" <li"); 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" #line 103 "..\..\Views\Shared\_Layout.cshtml"
, Tuple.Create(Tuple.Create("", 6406), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Device.Name ? "active" : null , Tuple.Create(Tuple.Create("", 6399), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Device.Name ? "active" : null
#line default #line default
#line hidden #line hidden
, 6406), false) , 6399), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 102 "..\..\Views\Shared\_Layout.cshtml" #line 103 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Devices", MVC.Device.Index(), accesskey: "2")); Write(Html.ActionLink("Devices", MVC.Device.Index(), accesskey: "2"));
#line default #line default
@@ -684,7 +685,7 @@ WriteLiteral(">");
WriteLiteral("</li>\r\n"); WriteLiteral("</li>\r\n");
#line 103 "..\..\Views\Shared\_Layout.cshtml" #line 104 "..\..\Views\Shared\_Layout.cshtml"
} }
@@ -693,29 +694,30 @@ WriteLiteral("</li>\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 104 "..\..\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)
#line 105 "..\..\Views\Shared\_Layout.cshtml" #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 if (Authorization.HasAny(Claims.User.Search))
{
#line default #line default
#line hidden #line hidden
, 6681), false) WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 6692), Tuple.Create("\"", 6778)
#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
, 6700), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 105 "..\..\Views\Shared\_Layout.cshtml" #line 107 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Users", MVC.User.Index(), accesskey: "3")); Write(Html.ActionLink("Users", MVC.User.Index(), accesskey: "3"));
#line default #line default
@@ -723,7 +725,7 @@ WriteLiteral(">");
WriteLiteral("</li>\r\n"); 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 #line hidden
WriteLiteral(" <li"); WriteLiteral(" <li");
WriteAttribute("class", Tuple.Create(" class=\"", 6873), Tuple.Create("\"", 6971) WriteAttribute("class", Tuple.Create(" class=\"", 6892), Tuple.Create("\"", 6990)
, Tuple.Create(Tuple.Create("", 6881), Tuple.Create("moveRight", 6881), true) , Tuple.Create(Tuple.Create("", 6900), Tuple.Create("moveRight", 6900), true)
#line 107 "..\..\Views\Shared\_Layout.cshtml" #line 109 "..\..\Views\Shared\_Layout.cshtml"
, Tuple.Create(Tuple.Create("", 6890), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null , Tuple.Create(Tuple.Create("", 6909), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Public.Name ? " active" : null
#line default #line default
#line hidden #line hidden
, 6890), false) , 6909), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 107 "..\..\Views\Shared\_Layout.cshtml" #line 109 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Reports", MVC.Public.Public.Index())); Write(Html.ActionLink("Reports", MVC.Public.Public.Index()));
@@ -754,13 +756,13 @@ WriteLiteral(">");
WriteLiteral("</li>\r\n"); WriteLiteral("</li>\r\n");
#line 108 "..\..\Views\Shared\_Layout.cshtml" #line 110 "..\..\Views\Shared\_Layout.cshtml"
#line default #line default
#line hidden #line hidden
#line 108 "..\..\Views\Shared\_Layout.cshtml" #line 110 "..\..\Views\Shared\_Layout.cshtml"
if (Authorization.Has(Claims.Config.Show)) if (Authorization.Has(Claims.Config.Show))
{ {
@@ -769,20 +771,20 @@ WriteLiteral("</li>\r\n");
#line hidden #line hidden
WriteLiteral(" <li"); 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" #line 112 "..\..\Views\Shared\_Layout.cshtml"
, Tuple.Create(Tuple.Create("", 7157), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Config.Name ? "active" : null , Tuple.Create(Tuple.Create("", 7176), Tuple.Create<System.Object, System.Int32>((string)ViewContext.ViewData["MenuArea"] == MVC.Config.Name ? "active" : null
#line default #line default
#line hidden #line hidden
, 7157), false) , 7176), false)
); );
WriteLiteral(">"); WriteLiteral(">");
#line 110 "..\..\Views\Shared\_Layout.cshtml" #line 112 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Configuration", MVC.Config.Config.Index(), accesskey: "0")); Write(Html.ActionLink("Configuration", MVC.Config.Config.Index(), accesskey: "0"));
@@ -791,7 +793,7 @@ WriteLiteral(">");
WriteLiteral("</li>\r\n"); 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>"); WriteLiteral(">\r\n <span>");
#line 115 "..\..\Views\Shared\_Layout.cshtml" #line 117 "..\..\Views\Shared\_Layout.cshtml"
if (Authorization.Has(Claims.User.Show)) if (Authorization.Has(Claims.User.Show))
{ {
#line default #line default
#line hidden #line hidden
#line 116 "..\..\Views\Shared\_Layout.cshtml" #line 118 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id))); Write(Html.ActionLink(CurrentUser.ToString(), MVC.User.Show(CurrentUser.Id)));
#line default #line default
#line hidden #line hidden
#line 116 "..\..\Views\Shared\_Layout.cshtml" #line 118 "..\..\Views\Shared\_Layout.cshtml"
} }
else else
{ {
@@ -826,14 +828,14 @@ WriteLiteral(">\r\n <span>");
#line default #line default
#line hidden #line hidden
#line 118 "..\..\Views\Shared\_Layout.cshtml" #line 120 "..\..\Views\Shared\_Layout.cshtml"
Write(CurrentUser.ToString()); Write(CurrentUser.ToString());
#line default #line default
#line hidden #line hidden
#line 118 "..\..\Views\Shared\_Layout.cshtml" #line 120 "..\..\Views\Shared\_Layout.cshtml"
} }
#line default #line default
@@ -841,29 +843,31 @@ WriteLiteral(">\r\n <span>");
WriteLiteral("</span>\r\n"); WriteLiteral("</span>\r\n");
#line 119 "..\..\Views\Shared\_Layout.cshtml" #line 121 "..\..\Views\Shared\_Layout.cshtml"
#line default #line default
#line hidden #line hidden
#line 119 "..\..\Views\Shared\_Layout.cshtml" #line 121 "..\..\Views\Shared\_Layout.cshtml"
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)) {
{ using (Html.BeginForm(MVC.Search.Query(), FormMethod.Get))
{
#line default #line default
#line hidden #line hidden
#line 121 "..\..\Views\Shared\_Layout.cshtml" #line 124 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.TextBox("term", null, new { id="SearchQuery", accesskey = "s", placeholder="Search" })); Write(Html.TextBox("term", null, new { id = "SearchQuery", accesskey = "s", placeholder = "Search", data_quicksearchurl = Url.Action(MVC.API.Search.QuickQuery()) }));
#line default #line default
#line hidden #line hidden
#line 121 "..\..\Views\Shared\_Layout.cshtml" #line 124 "..\..\Views\Shared\_Layout.cshtml"
}} }
}
#line default #line default
@@ -875,7 +879,7 @@ WriteLiteral(" id=\"layout_PageHeading\"");
WriteLiteral(">"); WriteLiteral(">");
#line 124 "..\..\Views\Shared\_Layout.cshtml" #line 128 "..\..\Views\Shared\_Layout.cshtml"
Write(CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty)); Write(CommonHelpers.Breadcrumbs(ViewBag.Title ?? string.Empty));
@@ -890,7 +894,7 @@ WriteLiteral(">\r\n");
WriteLiteral(" "); WriteLiteral(" ");
#line 126 "..\..\Views\Shared\_Layout.cshtml" #line 130 "..\..\Views\Shared\_Layout.cshtml"
Write(RenderBody()); Write(RenderBody());
@@ -899,7 +903,7 @@ WriteLiteral(" ");
WriteLiteral("\r\n </section>\r\n <footer>\r\n Disco v"); 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); Write(Disco.Web.DiscoApplication.Version);
@@ -910,7 +914,7 @@ WriteLiteral(" ");
WriteLiteral("@ "); WriteLiteral("@ ");
#line 129 "..\..\Views\Shared\_Layout.cshtml" #line 133 "..\..\Views\Shared\_Layout.cshtml"
Write(Disco.Web.DiscoApplication.OrganisationName); Write(Disco.Web.DiscoApplication.OrganisationName);
@@ -920,7 +924,7 @@ WriteLiteral(" | <a\r\n href=\"https://discoict.com.au/\" target=
"om.au</a> | "); "om.au</a> | ");
#line 130 "..\..\Views\Shared\_Layout.cshtml" #line 134 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Credits", MVC.Public.Public.Credits())); Write(Html.ActionLink("Credits", MVC.Public.Public.Credits()));
@@ -929,7 +933,7 @@ WriteLiteral(" | <a\r\n href=\"https://discoict.com.au/\" target=
WriteLiteral(" | "); WriteLiteral(" | ");
#line 130 "..\..\Views\Shared\_Layout.cshtml" #line 134 "..\..\Views\Shared\_Layout.cshtml"
Write(Html.ActionLink("Licence", MVC.Public.Public.Licence())); Write(Html.ActionLink("Licence", MVC.Public.Public.Licence()));
@@ -938,13 +942,13 @@ WriteLiteral(" | ");
WriteLiteral("\r\n </footer>\r\n </div>\r\n"); WriteLiteral("\r\n </footer>\r\n </div>\r\n");
#line 133 "..\..\Views\Shared\_Layout.cshtml" #line 137 "..\..\Views\Shared\_Layout.cshtml"
#line default #line default
#line hidden #line hidden
#line 133 "..\..\Views\Shared\_Layout.cshtml" #line 137 "..\..\Views\Shared\_Layout.cshtml"
Disco.Services.Plugins.Features.UIExtension.UIExtensions.ExecuteExtensionResult(this); Disco.Services.Plugins.Features.UIExtension.UIExtensions.ExecuteExtensionResult(this);
#line default #line default
+1 -1
View File
@@ -1,4 +1,4 @@
@model IEnumerable<Disco.Models.BI.Search.UserSearchResultItem> @model IEnumerable<Disco.Models.Services.Searching.UserSearchResultItem>
<div class="genericData userTable"> <div class="genericData userTable">
@if (Model != null && Model.Count() > 0) @if (Model != null && Model.Count() > 0)
{ {
+2 -1
View File
@@ -29,6 +29,7 @@ namespace Disco.Web.Views.User
using Disco; using Disco;
using Disco.BI.Extensions; using Disco.BI.Extensions;
using Disco.Models.Repository; using Disco.Models.Repository;
using Disco.Services;
using Disco.Services.Authorization; using Disco.Services.Authorization;
using Disco.Services.Web; using Disco.Services.Web;
using Disco.Web; using Disco.Web;
@@ -36,7 +37,7 @@ namespace Disco.Web.Views.User
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")] [System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
[System.Web.WebPages.PageVirtualPathAttribute("~/Views/User/_UserTable.cshtml")] [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() public UserTable()
{ {