fix: simplify document template managed groups
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
using Disco.Data.Repository.Monitor;
|
using Disco.Data.Repository.Monitor;
|
||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Interop.ActiveDirectory;
|
using Disco.Models.Services.Interop.ActiveDirectory;
|
||||||
|
using Disco.Services.Expressions;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -157,128 +159,73 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
switch (DocumentTemplateScope)
|
switch (DocumentTemplateScope)
|
||||||
{
|
{
|
||||||
case DocumentTemplate.DocumentTemplateScopes.Device:
|
case DocumentTemplate.DocumentTemplateScopes.Device:
|
||||||
|
var deviceFilter = Database.DeviceAttachments.Include("Device").Where(a => a.DocumentTemplateId == DocumentTemplateId);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Devices
|
deviceFilter = deviceFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
}
|
||||||
.Select(d => d.DeviceDomainId)
|
|
||||||
|
return deviceFilter.Select(a => a.Device.DeviceDomainId)
|
||||||
|
.Distinct()
|
||||||
.ToList()
|
.ToList()
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||||
.Select(id => id + "$");
|
.Select(id => id + "$");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Devices
|
|
||||||
.Where(d => d.DeviceDomainId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Select(d => d.DeviceDomainId)
|
|
||||||
.ToList()
|
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
|
||||||
.Select(id => id + "$");
|
|
||||||
}
|
|
||||||
case DocumentTemplate.DocumentTemplateScopes.Job:
|
case DocumentTemplate.DocumentTemplateScopes.Job:
|
||||||
|
var jobFilter = Database.JobAttachments.Include("Job.Device").Where(a => a.DocumentTemplateId == DocumentTemplateId && a.Job.Device.DeviceDomainId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Jobs
|
jobFilter = jobFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
}
|
||||||
.Select(j => j.Device.DeviceDomainId)
|
|
||||||
|
return jobFilter.Select(a => a.Job.Device.DeviceDomainId)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
.ToList()
|
.ToList()
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||||
.Select(id => id + "$");
|
.Select(id => id + "$");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Jobs
|
|
||||||
.Where(j => j.Device.DeviceDomainId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Select(j => j.Device.DeviceDomainId)
|
|
||||||
.Distinct()
|
|
||||||
.ToList()
|
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
|
||||||
.Select(id => id + "$");
|
|
||||||
}
|
|
||||||
case DocumentTemplate.DocumentTemplateScopes.User:
|
case DocumentTemplate.DocumentTemplateScopes.User:
|
||||||
|
var userFilter = Database.UserAttachments.Include("User.Device.DeviceUserAssignments.Device").Where(a => a.DocumentTemplateId == DocumentTemplateId && a.User.DeviceUserAssignments.Where(ua => ua.UnassignedDate == null && ua.Device.DeviceDomainId != null).Any());
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Users
|
userFilter = userFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
}
|
||||||
.SelectMany(u => u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null), (u, dua) => dua.Device.DeviceDomainId)
|
|
||||||
|
return userFilter.SelectMany(a => a.User.DeviceUserAssignments)
|
||||||
|
.Where(a => a.UnassignedDate == null)
|
||||||
|
.Select(a => a.Device.DeviceDomainId)
|
||||||
|
.Distinct()
|
||||||
.ToList()
|
.ToList()
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
.Where(ActiveDirectory.IsValidDomainAccountId)
|
||||||
.Select(id => id + "$");
|
.Select(id => id + "$");
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Users
|
|
||||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.SelectMany(u => u.DeviceUserAssignments.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null), (u, dua) => dua.Device.DeviceDomainId)
|
|
||||||
.ToList()
|
|
||||||
.Where(ActiveDirectory.IsValidDomainAccountId)
|
|
||||||
.Select(id => id + "$");
|
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
return Enumerable.Empty<string>();
|
return Enumerable.Empty<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Device Scope
|
#region Device Scope
|
||||||
private class ContainsAttachmentResult
|
|
||||||
{
|
|
||||||
public string Id;
|
|
||||||
public bool HasAttachment;
|
|
||||||
public string SerialNumber;
|
|
||||||
public IEnumerable<ContainsAttachmentDeviceResult> Devices;
|
|
||||||
}
|
|
||||||
private class ContainsAttachmentDeviceResult
|
|
||||||
{
|
|
||||||
public string Id;
|
|
||||||
public string SerialNumber;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool DeviceContainsAttachment(DiscoDataContext Database, string DeviceSerialNumber, out string DeviceAccountId)
|
private bool DeviceContainsAttachment(DiscoDataContext Database, string DeviceSerialNumber, out string DeviceAccountId)
|
||||||
{
|
{
|
||||||
ContainsAttachmentResult result;
|
var query = Database.DeviceAttachments.Include("Device")
|
||||||
|
.Where(a => a.DocumentTemplateId == DocumentTemplateId && a.DeviceSerialNumber == DeviceSerialNumber && a.Device.DeviceDomainId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
result = Database.Devices
|
query = query.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.DeviceDomainId != null)
|
|
||||||
.Select(d => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
Id = d.DeviceDomainId,
|
|
||||||
HasAttachment = d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = Database.Devices
|
|
||||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.DeviceDomainId != null)
|
|
||||||
.Select(d => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
Id = d.DeviceDomainId,
|
|
||||||
HasAttachment = d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId)
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == null)
|
var deviceDomainId = query.Select(a => a.Device.DeviceDomainId).FirstOrDefault();
|
||||||
|
if (ActiveDirectory.IsValidDomainAccountId(deviceDomainId))
|
||||||
|
{
|
||||||
|
DeviceAccountId = deviceDomainId + "$";
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
DeviceAccountId = null;
|
DeviceAccountId = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ActiveDirectory.IsValidDomainAccountId(result.Id))
|
|
||||||
{
|
|
||||||
DeviceAccountId = result.Id + "$";
|
|
||||||
return result.HasAttachment;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DeviceAccountId = result.Id + "$";
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessDeviceAttachmentAddEvent(RepositoryMonitorEvent e)
|
private void ProcessDeviceAttachmentAddEvent(RepositoryMonitorEvent e)
|
||||||
@@ -307,55 +254,27 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
#region Job Scope
|
#region Job Scope
|
||||||
private bool JobsContainAttachment(DiscoDataContext Database, int JobId, out string DeviceAccountId, out string DeviceSerialNumber)
|
private bool JobsContainAttachment(DiscoDataContext Database, int JobId, out string DeviceAccountId, out string DeviceSerialNumber)
|
||||||
{
|
{
|
||||||
ContainsAttachmentResult result;
|
var query = Database.JobAttachments.Include("Job.Device")
|
||||||
|
.Where(a => a.DocumentTemplateId == DocumentTemplateId && a.JobId == JobId && a.Job.Device.DeviceDomainId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
result = Database.Jobs
|
query = query.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(j => j.Id == JobId && j.Device.DeviceDomainId != null)
|
}
|
||||||
.Select(j => new ContainsAttachmentResult()
|
|
||||||
{
|
var deviceRecord = query.Select(a => Tuple.Create(a.Job.DeviceSerialNumber, a.Job.Device.DeviceDomainId)).FirstOrDefault();
|
||||||
Id = j.Device.DeviceDomainId,
|
if (ActiveDirectory.IsValidDomainAccountId(deviceRecord.Item2))
|
||||||
SerialNumber = j.Device.SerialNumber,
|
{
|
||||||
HasAttachment = j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
DeviceSerialNumber = deviceRecord.Item1;
|
||||||
})
|
DeviceAccountId = deviceRecord.Item2 + "$";
|
||||||
.FirstOrDefault();
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result = Database.Jobs
|
|
||||||
.Where(j => j.Id == JobId && j.Device.DeviceDomainId != null)
|
|
||||||
.Select(j => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
Id = j.Device.DeviceDomainId,
|
|
||||||
SerialNumber = j.Device.SerialNumber,
|
|
||||||
HasAttachment = j.Device.Jobs.Any(dj => dj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (result == null)
|
|
||||||
{
|
|
||||||
DeviceAccountId = null;
|
|
||||||
DeviceSerialNumber = null;
|
DeviceSerialNumber = null;
|
||||||
|
DeviceAccountId = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
if (ActiveDirectory.IsValidDomainAccountId(result.Id))
|
|
||||||
{
|
|
||||||
DeviceAccountId = result.Id + "$";
|
|
||||||
DeviceSerialNumber = result.SerialNumber;
|
|
||||||
return result.HasAttachment;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
DeviceAccountId = result.Id + "$";
|
|
||||||
DeviceSerialNumber = result.SerialNumber;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessJobAttachmentAddEvent(RepositoryMonitorEvent e)
|
private void ProcessJobAttachmentAddEvent(RepositoryMonitorEvent e)
|
||||||
@@ -390,48 +309,28 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
#region User Scope
|
#region User Scope
|
||||||
private bool DeviceUserContainAttachment(DiscoDataContext Database, string UserId, out List<Tuple<string, string>> Devices)
|
private bool DeviceUserContainAttachment(DiscoDataContext Database, string UserId, out List<Tuple<string, string>> Devices)
|
||||||
{
|
{
|
||||||
ContainsAttachmentResult result;
|
var query = Database.UserAttachments.Include("User.DeviceUserAssignments.Device")
|
||||||
|
.Where(a => a.DocumentTemplateId == DocumentTemplateId && a.UserId == UserId && a.User.DeviceUserAssignments.Any(d => d.UnassignedDate == null && d.Device.DeviceDomainId != null));
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
result = Database.Users
|
query = query.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(u => u.UserId == UserId)
|
|
||||||
.Select(u => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
HasAttachment = u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate),
|
|
||||||
Devices = u.DeviceUserAssignments
|
|
||||||
.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null)
|
|
||||||
.Select(dua => new ContainsAttachmentDeviceResult() { Id = dua.Device.DeviceDomainId, SerialNumber = dua.Device.SerialNumber })
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
result = Database.Users
|
|
||||||
.Where(u => u.UserId == UserId)
|
|
||||||
.Select(u => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
HasAttachment = u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId),
|
|
||||||
Devices = u.DeviceUserAssignments
|
|
||||||
.Where(dua => !dua.UnassignedDate.HasValue && dua.Device.DeviceDomainId != null)
|
|
||||||
.Select(dua => new ContainsAttachmentDeviceResult() { Id = dua.Device.DeviceDomainId, SerialNumber = dua.Device.SerialNumber })
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result == null)
|
var deviceRecords = query.Take(1).SelectMany(a => a.User.DeviceUserAssignments)
|
||||||
|
.Where(a => a.UnassignedDate == null && a.Device.DeviceDomainId != null)
|
||||||
|
.Select(a => new { a.Device.SerialNumber, a.Device.DeviceDomainId }).ToList()
|
||||||
|
.Where(r => ActiveDirectory.IsValidDomainAccountId(r.DeviceDomainId)).ToList();
|
||||||
|
if (deviceRecords.Count > 0)
|
||||||
|
{
|
||||||
|
Devices = deviceRecords.Select(r => Tuple.Create(r.DeviceDomainId + "$", r.SerialNumber)).ToList();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
Devices = null;
|
Devices = null;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Devices = result.Devices
|
|
||||||
.Where(d => ActiveDirectory.IsValidDomainAccountId(d.Id))
|
|
||||||
.Select(d => new Tuple<string, string>(d.Id + "$", d.SerialNumber))
|
|
||||||
.ToList();
|
|
||||||
return result.HasAttachment;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessUserAttachmentAddEvent(RepositoryMonitorEvent e)
|
private void ProcessUserAttachmentAddEvent(RepositoryMonitorEvent e)
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
using Disco.Data.Repository;
|
using Disco.Data.Repository;
|
||||||
using Disco.Data.Repository.Monitor;
|
using Disco.Data.Repository.Monitor;
|
||||||
using Disco.Models.Repository;
|
using Disco.Models.Repository;
|
||||||
|
using Disco.Models.Services.Documents;
|
||||||
using Disco.Models.Services.Interop.ActiveDirectory;
|
using Disco.Models.Services.Interop.ActiveDirectory;
|
||||||
|
using Disco.Services.Expressions;
|
||||||
using Disco.Services.Interop.ActiveDirectory;
|
using Disco.Services.Interop.ActiveDirectory;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -152,84 +154,54 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
switch (DocumentTemplateScope)
|
switch (DocumentTemplateScope)
|
||||||
{
|
{
|
||||||
case DocumentTemplate.DocumentTemplateScopes.Device:
|
case DocumentTemplate.DocumentTemplateScopes.Device:
|
||||||
|
var deviceFilter = Database.DeviceAttachments.Include("Device").Where(a => a.DocumentTemplateId == DocumentTemplateId && a.Device.AssignedUserId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Devices
|
deviceFilter = deviceFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
|
||||||
.Select(d => d.AssignedUserId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Devices
|
|
||||||
.Where(d => d.AssignedUserId != null && d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Select(d => d.AssignedUserId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return deviceFilter.Select(a => a.Device.AssignedUserId).Distinct();
|
||||||
case DocumentTemplate.DocumentTemplateScopes.Job:
|
case DocumentTemplate.DocumentTemplateScopes.Job:
|
||||||
|
var jobFilter = Database.JobAttachments.Include("Job").Where(a => a.DocumentTemplateId == DocumentTemplateId && a.Job.UserId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Jobs
|
jobFilter = jobFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
|
||||||
.Select(j => j.UserId)
|
|
||||||
.Distinct();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Jobs
|
|
||||||
.Where(j => j.UserId != null && j.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Select(j => j.UserId)
|
|
||||||
.Distinct();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return jobFilter.Select(a => a.Job.UserId).Distinct();
|
||||||
case DocumentTemplate.DocumentTemplateScopes.User:
|
case DocumentTemplate.DocumentTemplateScopes.User:
|
||||||
|
var userFilter = Database.UserAttachments.Include("User").Where(a => a.DocumentTemplateId == DocumentTemplateId && a.User.UserId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Users
|
userFilter = userFilter.Where(a => a.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
|
||||||
.Select(u => u.UserId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Users
|
|
||||||
.Where(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Select(u => u.UserId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return userFilter.Select(a => a.UserId).Distinct();
|
||||||
default:
|
default:
|
||||||
return Enumerable.Empty<string>();
|
return Enumerable.Empty<string>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Device Scope
|
#region Device Scope
|
||||||
private class ContainsAttachmentResult
|
|
||||||
{
|
|
||||||
public string Id;
|
|
||||||
public bool HasAttachment;
|
|
||||||
}
|
|
||||||
|
|
||||||
private bool DeviceContainsAttachment(DiscoDataContext Database, string DeviceSerialNumber, out string UserId)
|
private bool DeviceContainsAttachment(DiscoDataContext Database, string DeviceSerialNumber, out string UserId)
|
||||||
{
|
{
|
||||||
ContainsAttachmentResult result;
|
var query = Database.DeviceAttachments
|
||||||
|
.Include("Device")
|
||||||
|
.Where(da => da.DocumentTemplateId == DocumentTemplateId && da.DeviceSerialNumber == DeviceSerialNumber && da.Device.AssignedUserId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
result = Database.Devices
|
query = query.Where(da => da.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.AssignedUser != null)
|
|
||||||
.Select(d => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
Id = d.AssignedUserId,
|
|
||||||
HasAttachment = d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate)
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
var result = query.Select(da => new
|
||||||
{
|
{
|
||||||
result = Database.Devices
|
da.Id,
|
||||||
.Where(d => d.SerialNumber == DeviceSerialNumber && d.AssignedUser != null)
|
da.Device.AssignedUserId,
|
||||||
.Select(d => new ContainsAttachmentResult()
|
}).FirstOrDefault();
|
||||||
{
|
|
||||||
Id = d.AssignedUserId,
|
|
||||||
HasAttachment = d.DeviceAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId)
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
@@ -238,8 +210,8 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UserId = result.Id;
|
UserId = result.AssignedUserId;
|
||||||
return result.HasAttachment;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -272,30 +244,20 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
#region Job Scope
|
#region Job Scope
|
||||||
private bool JobsContainAttachment(DiscoDataContext Database, int JobId, out string UserId)
|
private bool JobsContainAttachment(DiscoDataContext Database, int JobId, out string UserId)
|
||||||
{
|
{
|
||||||
ContainsAttachmentResult result;
|
var query = Database.JobAttachments
|
||||||
|
.Include("Job")
|
||||||
|
.Where(da => da.DocumentTemplateId == DocumentTemplateId && da.JobId == JobId && da.Job.UserId != null);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
result = Database.Jobs
|
query = query.Where(da => da.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(j => j.Id == JobId && j.UserId != null)
|
|
||||||
.Select(j => new ContainsAttachmentResult()
|
|
||||||
{
|
|
||||||
Id = j.UserId,
|
|
||||||
HasAttachment = j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate))
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
var result = query.Select(da => new
|
||||||
{
|
{
|
||||||
result = Database.Jobs
|
da.Id,
|
||||||
.Where(j => j.Id == JobId && j.UserId != null)
|
da.Job.UserId,
|
||||||
.Select(j => new ContainsAttachmentResult()
|
}).FirstOrDefault();
|
||||||
{
|
|
||||||
Id = j.UserId,
|
|
||||||
HasAttachment = j.User.Jobs.Any(uj => uj.JobAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
})
|
|
||||||
.FirstOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result == null)
|
if (result == null)
|
||||||
{
|
{
|
||||||
@@ -304,8 +266,8 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UserId = result.Id;
|
UserId = result.UserId;
|
||||||
return result.HasAttachment;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,18 +300,16 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
#region User Scope
|
#region User Scope
|
||||||
private bool UserContainAttachment(DiscoDataContext Database, string UserId)
|
private bool UserContainAttachment(DiscoDataContext Database, string UserId)
|
||||||
{
|
{
|
||||||
|
var query = Database.UserAttachments
|
||||||
|
.Include("User")
|
||||||
|
.Where(da => da.DocumentTemplateId == DocumentTemplateId && da.UserId == UserId);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
return Database.Users
|
query = query.Where(da => da.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(u => u.UserId == UserId)
|
|
||||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId && a.Timestamp >= Configuration.FilterBeginDate));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return Database.Users
|
|
||||||
.Where(u => u.UserId == UserId)
|
|
||||||
.Any(u => u.UserAttachments.Any(a => a.DocumentTemplateId == DocumentTemplateId));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return query.Any();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ProcessUserAttachmentAddEvent(RepositoryMonitorEvent e)
|
private void ProcessUserAttachmentAddEvent(RepositoryMonitorEvent e)
|
||||||
@@ -380,19 +340,16 @@ namespace Disco.Services.Documents.ManagedGroups
|
|||||||
var deviceSerialNumber = device.SerialNumber;
|
var deviceSerialNumber = device.SerialNumber;
|
||||||
bool relevantDevice;
|
bool relevantDevice;
|
||||||
|
|
||||||
|
var query = Event.Database.DeviceAttachments.Include("Device")
|
||||||
|
.Where(da => da.DocumentTemplateId == DocumentTemplateId && da.DeviceSerialNumber == deviceSerialNumber);
|
||||||
|
|
||||||
if (Configuration.FilterBeginDate.HasValue)
|
if (Configuration.FilterBeginDate.HasValue)
|
||||||
{
|
{
|
||||||
relevantDevice = Event.Database.Devices
|
query = query.Where(da => da.Timestamp >= Configuration.FilterBeginDate);
|
||||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == DocumentTemplateId && ja.Timestamp >= Configuration.FilterBeginDate))
|
|
||||||
.Any();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
relevantDevice = Event.Database.Devices
|
|
||||||
.Where(d => d.SerialNumber == deviceSerialNumber && d.DeviceAttachments.Any(ja => ja.DocumentTemplateId == DocumentTemplateId))
|
|
||||||
.Any();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
relevantDevice = query.Any();
|
||||||
|
|
||||||
if (relevantDevice)
|
if (relevantDevice)
|
||||||
{
|
{
|
||||||
var deviceCurrentAssignedUserId = device.AssignedUserId;
|
var deviceCurrentAssignedUserId = device.AssignedUserId;
|
||||||
|
|||||||
@@ -19,23 +19,23 @@
|
|||||||
{
|
{
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
<div class="code" title="@group.Id">
|
<div class="code" title="@group.Id">
|
||||||
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
||||||
</div>
|
</div>
|
||||||
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" data-linkedgroupfilterdateoption="@(Model.ManagedGroup.IncludeFilterBeginDate)" data-linkedgroupfilterdate="@(Model.ManagedGroup.Configuration.FilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Change Link</button>
|
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" data-linkedgroupfilterdateoption="@(Model.ManagedGroup.IncludeFilterBeginDate)" data-linkedgroupfilterdate="@(Model.ManagedGroup.Configuration.FilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Change Link</button>
|
||||||
<a href="@(Url.Action(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path)))" class="button small">Synchronize Now</a>
|
<a href="@(Url.Action(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path)))" class="button small">Synchronize Now</a>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="code error">
|
<div class="code error">
|
||||||
<i class="fa fa-fw fa-lg fa-unlink error"></i>Group Not Found: <strong class="code">@Model.ManagedGroup.Configuration.GroupId</strong>
|
<i class="fa fa-fw fa-lg fa-unlink error"></i>Group Not Found: <strong class="code">@Model.ManagedGroup.Configuration.GroupId</strong>
|
||||||
</div>
|
</div>
|
||||||
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" data-linkedgroupfilterdateoption="@(Model.ManagedGroup.IncludeFilterBeginDate)" data-linkedgroupfilterdate="@(Model.ManagedGroup.Configuration.FilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Change Link</button>
|
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" data-linkedgroupfilterdateoption="@(Model.ManagedGroup.IncludeFilterBeginDate)" data-linkedgroupfilterdate="@(Model.ManagedGroup.Configuration.FilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Change Link</button>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="" data-linkedgroupfilterdateoption="@(Model.IncludeFilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Link Group</button>
|
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="" data-linkedgroupfilterdateoption="@(Model.IncludeFilterBeginDate)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Link Group</button>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -44,21 +44,21 @@
|
|||||||
{
|
{
|
||||||
if (group != null)
|
if (group != null)
|
||||||
{
|
{
|
||||||
<div class="code" title="@group.Id">
|
<div class="code" title="@group.Id">
|
||||||
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="code error">
|
<div class="code error">
|
||||||
<i class="fa fa-fw fa-lg fa-unlink error"></i>Group Not Found: <strong class="code">@Model.ManagedGroup.Configuration.GroupId</strong>
|
<i class="fa fa-fw fa-lg fa-unlink error"></i>Group Not Found: <strong class="code">@Model.ManagedGroup.Configuration.GroupId</strong>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<div class="smallMessage"><i class="fa fa-fw fa-lg fa-unlink information"></i>No Group Linked</div>
|
<div class="smallMessage"><i class="fa fa-fw fa-lg fa-unlink information"></i>No Group Linked</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -109,21 +109,21 @@ WriteLiteral("\r\n </p>\r\n </div>\r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <div");
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"code\"");
|
WriteLiteral(" class=\"code\"");
|
||||||
|
|
||||||
WriteAttribute("title", Tuple.Create(" title=\"", 681), Tuple.Create("\"", 698)
|
WriteAttribute("title", Tuple.Create(" title=\"", 693), Tuple.Create("\"", 710)
|
||||||
|
|
||||||
#line 22 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 22 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 689), Tuple.Create<System.Object, System.Int32>(group.Id
|
, Tuple.Create(Tuple.Create("", 701), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 689), false)
|
, 701), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <i");
|
WriteLiteral(">\r\n <i");
|
||||||
|
|
||||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
||||||
|
|
||||||
@@ -131,14 +131,14 @@ WriteLiteral("></i>");
|
|||||||
|
|
||||||
|
|
||||||
#line 23 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 23 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n </div>\r\n");
|
WriteLiteral("\r\n </div>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" <button");
|
WriteLiteral(" <button");
|
||||||
|
|
||||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||||
|
|
||||||
@@ -146,7 +146,7 @@ WriteLiteral(" data-linkedgroupid=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -157,7 +157,7 @@ WriteLiteral(" data-linkedgroupfilterdateoption=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.IncludeFilterBeginDate);
|
Write(Model.ManagedGroup.IncludeFilterBeginDate);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -168,7 +168,7 @@ WriteLiteral(" data-linkedgroupfilterdate=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.FilterBeginDate);
|
Write(Model.ManagedGroup.Configuration.FilterBeginDate);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -179,7 +179,7 @@ WriteLiteral(" data-linkedroupdescription=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.CategoryDescription);
|
Write(Model.CategoryDescription);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -190,7 +190,7 @@ WriteLiteral(" data-linkedroupupdateurl=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.UpdateUrl);
|
Write(Model.UpdateUrl);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -199,16 +199,16 @@ WriteLiteral("\"");
|
|||||||
|
|
||||||
WriteLiteral(">Change Link</button>\r\n");
|
WriteLiteral(">Change Link</button>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" <a");
|
WriteLiteral(" <a");
|
||||||
|
|
||||||
WriteAttribute("href", Tuple.Create(" href=\"", 1275), Tuple.Create("\"", 1389)
|
WriteAttribute("href", Tuple.Create(" href=\"", 1335), Tuple.Create("\"", 1449)
|
||||||
|
|
||||||
#line 26 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 26 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 1282), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path))
|
, Tuple.Create(Tuple.Create("", 1342), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path))
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 1282), false)
|
, 1342), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(" class=\"button small\"");
|
WriteLiteral(" class=\"button small\"");
|
||||||
@@ -224,11 +224,11 @@ WriteLiteral(">Synchronize Now</a>\r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <div");
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"code error\"");
|
WriteLiteral(" class=\"code error\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n <i");
|
WriteLiteral(">\r\n <i");
|
||||||
|
|
||||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
||||||
|
|
||||||
@@ -240,14 +240,14 @@ WriteLiteral(">");
|
|||||||
|
|
||||||
|
|
||||||
#line 31 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 31 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("</strong>\r\n </div> \r\n");
|
WriteLiteral("</strong>\r\n </div>\r\n");
|
||||||
|
|
||||||
WriteLiteral(" <button");
|
WriteLiteral(" <button");
|
||||||
|
|
||||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||||
|
|
||||||
@@ -255,7 +255,7 @@ WriteLiteral(" data-linkedgroupid=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -266,7 +266,7 @@ WriteLiteral(" data-linkedgroupfilterdateoption=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.IncludeFilterBeginDate);
|
Write(Model.ManagedGroup.IncludeFilterBeginDate);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -277,7 +277,7 @@ WriteLiteral(" data-linkedgroupfilterdate=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.FilterBeginDate);
|
Write(Model.ManagedGroup.Configuration.FilterBeginDate);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -288,7 +288,7 @@ WriteLiteral(" data-linkedroupdescription=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.CategoryDescription);
|
Write(Model.CategoryDescription);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -299,7 +299,7 @@ WriteLiteral(" data-linkedroupupdateurl=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.UpdateUrl);
|
Write(Model.UpdateUrl);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -318,7 +318,7 @@ WriteLiteral(">Change Link</button>\r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <button");
|
WriteLiteral(" <button");
|
||||||
|
|
||||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||||
|
|
||||||
@@ -328,7 +328,7 @@ WriteLiteral(" data-linkedgroupfilterdateoption=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.IncludeFilterBeginDate);
|
Write(Model.IncludeFilterBeginDate);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -339,7 +339,7 @@ WriteLiteral(" data-linkedroupdescription=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.CategoryDescription);
|
Write(Model.CategoryDescription);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -350,7 +350,7 @@ WriteLiteral(" data-linkedroupupdateurl=\"");
|
|||||||
|
|
||||||
|
|
||||||
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.UpdateUrl);
|
Write(Model.UpdateUrl);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
@@ -373,21 +373,21 @@ WriteLiteral(">Link Group</button>\r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <div");
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"code\"");
|
WriteLiteral(" class=\"code\"");
|
||||||
|
|
||||||
WriteAttribute("title", Tuple.Create(" title=\"", 2661), Tuple.Create("\"", 2678)
|
WriteAttribute("title", Tuple.Create(" title=\"", 2777), Tuple.Create("\"", 2794)
|
||||||
|
|
||||||
#line 47 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 47 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
, Tuple.Create(Tuple.Create("", 2669), Tuple.Create<System.Object, System.Int32>(group.Id
|
, Tuple.Create(Tuple.Create("", 2785), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
, 2669), false)
|
, 2785), false)
|
||||||
);
|
);
|
||||||
|
|
||||||
WriteLiteral(">\r\n <i");
|
WriteLiteral(">\r\n <i");
|
||||||
|
|
||||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
||||||
|
|
||||||
@@ -395,12 +395,12 @@ WriteLiteral("></i>");
|
|||||||
|
|
||||||
|
|
||||||
#line 48 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 48 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("\r\n </div>\r\n");
|
WriteLiteral("\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 50 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 50 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
@@ -411,11 +411,11 @@ WriteLiteral("\r\n </div>\r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <div");
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"code error\"");
|
WriteLiteral(" class=\"code error\"");
|
||||||
|
|
||||||
WriteLiteral(">\r\n <i");
|
WriteLiteral(">\r\n <i");
|
||||||
|
|
||||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
||||||
|
|
||||||
@@ -427,12 +427,12 @@ WriteLiteral(">");
|
|||||||
|
|
||||||
|
|
||||||
#line 54 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 54 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral("</strong>\r\n </div> \r\n");
|
WriteLiteral("</strong>\r\n </div>\r\n");
|
||||||
|
|
||||||
|
|
||||||
#line 56 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 56 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
@@ -444,7 +444,7 @@ WriteLiteral("</strong>\r\n </div> \r\n");
|
|||||||
|
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
WriteLiteral(" <div");
|
WriteLiteral(" <div");
|
||||||
|
|
||||||
WriteLiteral(" class=\"smallMessage\"");
|
WriteLiteral(" class=\"smallMessage\"");
|
||||||
|
|
||||||
@@ -457,7 +457,7 @@ WriteLiteral("></i>No Group Linked</div>\r\n");
|
|||||||
|
|
||||||
#line 61 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
#line 61 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
var dialog;
|
let dialog;
|
||||||
var dialogGroupId;
|
let dialogGroupId;
|
||||||
var dialogFilterDate;
|
let dialogFilterDate;
|
||||||
var dialogTitle;
|
let dialogTitle;
|
||||||
|
|
||||||
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
|
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
|
||||||
if (dialog == null) {
|
if (dialog == null) {
|
||||||
|
|||||||
@@ -125,10 +125,10 @@ WriteLiteral(@"></i><strong>Warning:</strong> This group will be managed by Disc
|
|||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
var dialog;
|
let dialog;
|
||||||
var dialogGroupId;
|
let dialogGroupId;
|
||||||
var dialogFilterDate;
|
let dialogFilterDate;
|
||||||
var dialogTitle;
|
let dialogTitle;
|
||||||
|
|
||||||
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
|
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
|
||||||
if (dialog == null) {
|
if (dialog == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user