#184: optionally set managed group descriptions
This commit is contained in:
@@ -6,5 +6,6 @@ namespace Disco.Models.Services.Interop.ActiveDirectory
|
||||
{
|
||||
public string GroupId { get; set; }
|
||||
public DateTime? FilterBeginDate { get; set; }
|
||||
public bool UpdateDescription { get; set; } = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,21 +80,23 @@ namespace Disco.Services.Interop.ActiveDirectory
|
||||
return JsonConvert.DeserializeObject<ADManagedGroupConfiguration>(ConfigurationJson);
|
||||
}
|
||||
public static string ValidConfigurationToJson(string GroupKey, string GroupId, DateTime? FilterBeginDate)
|
||||
=> ValidConfigurationToJson(GroupKey, GroupId, FilterBeginDate, true);
|
||||
public static string ValidConfigurationToJson(string groupKey, string groupId, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(GroupId))
|
||||
GroupId = null;
|
||||
if (string.IsNullOrWhiteSpace(groupId))
|
||||
groupId = null;
|
||||
|
||||
if (GroupId != null)
|
||||
GroupId = ActiveDirectory.Context.ManagedGroups.ValidateGroupId(GroupId, GroupKey);
|
||||
|
||||
if (GroupId == null)
|
||||
if (groupId != null)
|
||||
groupId = ActiveDirectory.Context.ManagedGroups.ValidateGroupId(groupId, groupKey);
|
||||
if (groupId == null)
|
||||
return null;
|
||||
else
|
||||
return JsonConvert.SerializeObject(new ADManagedGroupConfiguration()
|
||||
{
|
||||
GroupId = GroupId,
|
||||
FilterBeginDate = FilterBeginDate
|
||||
}, new JsonSerializerSettings() { DefaultValueHandling = DefaultValueHandling.Ignore });
|
||||
GroupId = groupId,
|
||||
FilterBeginDate = filterBeginDate,
|
||||
UpdateDescription = updateDescription,
|
||||
}, new JsonSerializerSettings());
|
||||
}
|
||||
|
||||
public abstract void Dispose();
|
||||
|
||||
@@ -13,9 +13,9 @@ namespace Disco.Services.Interop.ActiveDirectory
|
||||
|
||||
public class ActiveDirectoryManagedGroups : IDisposable
|
||||
{
|
||||
private ConcurrentDictionary<string, ADManagedGroup> managedGroups;
|
||||
private Subject<ADManagedGroupScheduledAction> actionBuffer;
|
||||
private IDisposable actionBufferSubscription;
|
||||
private readonly ConcurrentDictionary<string, ADManagedGroup> managedGroups;
|
||||
private readonly Subject<ADManagedGroupScheduledAction> actionBuffer;
|
||||
private readonly IDisposable actionBufferSubscription;
|
||||
|
||||
internal ActiveDirectoryManagedGroups()
|
||||
{
|
||||
@@ -379,13 +379,16 @@ namespace Disco.Services.Interop.ActiveDirectory
|
||||
throw new InvalidOperationException($"This group [{adGroup.DistinguishedName}] is a Critical System Active Directory Object and Disco ICT refuses to modify it");
|
||||
|
||||
// Update Description
|
||||
var groupDescription = $"Disco ICT: {actionGroup.Item1.GroupDescription}";
|
||||
if (adGroupEntry.Entry.Properties.Value<string>("description") != groupDescription)
|
||||
if (actionGroup.Item1.Configuration.UpdateDescription)
|
||||
{
|
||||
var adGroupEntryDescription = adGroupEntry.Entry.Properties["description"];
|
||||
if (adGroupEntryDescription.Count > 0)
|
||||
adGroupEntryDescription.Clear();
|
||||
adGroupEntryDescription.Add(groupDescription);
|
||||
var groupDescription = $"Disco ICT: {actionGroup.Item1.GroupDescription}";
|
||||
if (adGroupEntry.Entry.Properties.Value<string>("description") != groupDescription)
|
||||
{
|
||||
var adGroupEntryDescription = adGroupEntry.Entry.Properties["description"];
|
||||
if (adGroupEntryDescription.Count > 0)
|
||||
adGroupEntryDescription.Clear();
|
||||
adGroupEntryDescription.Add(groupDescription);
|
||||
}
|
||||
}
|
||||
|
||||
// Sync Members
|
||||
@@ -430,7 +433,7 @@ namespace Disco.Services.Interop.ActiveDirectory
|
||||
|
||||
internal class ADManagedGroupScheduledAction
|
||||
{
|
||||
private Func<DiscoDataContext, IEnumerable<string>> memberResolver;
|
||||
private readonly Func<DiscoDataContext, IEnumerable<string>> memberResolver;
|
||||
|
||||
public ADManagedGroup ManagedGroup { get; private set; }
|
||||
public ADManagedGroupScheduledActionType ActionType { get; private set; }
|
||||
|
||||
@@ -32,8 +32,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
private const string pInsuredUntil = "insureduntil";
|
||||
private const string pInsuranceDetails = "insurancedetails";
|
||||
private const string pComments = "comments";
|
||||
private const string pDevicesLinkedGroup = "deviceslinkedgroup";
|
||||
private const string pAssignedUsersLinkedGroup = "assigneduserslinkedgroup";
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
@@ -94,12 +92,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
case pComments:
|
||||
UpdateComments(deviceBatch, value);
|
||||
break;
|
||||
case pDevicesLinkedGroup:
|
||||
UpdateDevicesLinkedGroup(deviceBatch, value);
|
||||
break;
|
||||
case pAssignedUsersLinkedGroup:
|
||||
UpdateAssignedUsersLinkedGroup(deviceBatch, value);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Invalid Update Key");
|
||||
}
|
||||
@@ -224,18 +216,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string GroupId = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string groupId = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var deviceBatch = Database.DeviceBatches.Find(id);
|
||||
if (deviceBatch == null)
|
||||
throw new ArgumentException("Invalid Device Batch Id", "id");
|
||||
var deviceBatch = Database.DeviceBatches.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Batch Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceBatch, GroupId);
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceBatch, groupId, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceBatch.Index(deviceBatch.Id));
|
||||
@@ -257,18 +248,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var deviceBatch = Database.DeviceBatches.Find(id);
|
||||
if (deviceBatch == null)
|
||||
throw new ArgumentException("Invalid Device Batch Id", "id");
|
||||
var deviceBatch = Database.DeviceBatches.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Batch Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(deviceBatch, GroupId);
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(deviceBatch, groupId, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceBatch.Index(deviceBatch.Id));
|
||||
@@ -486,9 +476,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceBatch DeviceBatch, string devicesLinkedGroup)
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceBatch DeviceBatch, string devicesLinkedGroup, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceBatchDevicesManagedGroup.GetKey(DeviceBatch), devicesLinkedGroup, null);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceBatchDevicesManagedGroup.GetKey(DeviceBatch), devicesLinkedGroup, null, updateDescription);
|
||||
|
||||
if (DeviceBatch.DevicesLinkedGroup != configJson)
|
||||
{
|
||||
@@ -503,9 +493,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(DeviceBatch DeviceBatch, string assignedUsersLinkedGroup)
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(DeviceBatch DeviceBatch, string assignedUsersLinkedGroup, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceBatchAssignedUsersManagedGroup.GetKey(DeviceBatch), assignedUsersLinkedGroup, null);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceBatchAssignedUsersManagedGroup.GetKey(DeviceBatch), assignedUsersLinkedGroup, null, updateDescription);
|
||||
|
||||
if (DeviceBatch.AssignedUsersLinkedGroup != configJson)
|
||||
{
|
||||
|
||||
@@ -166,19 +166,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.DeviceFlag.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var deviceFlag = Database.DeviceFlags.Find(id);
|
||||
if (deviceFlag == null)
|
||||
throw new ArgumentException("Invalid Device Flag Id", "id");
|
||||
var deviceFlag = Database.DeviceFlags.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Flag Id", nameof(id));
|
||||
|
||||
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceFlag, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceFlag, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceFlag.Index(deviceFlag.Id));
|
||||
@@ -200,25 +198,23 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.DeviceFlag.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateAssignedUserLinkedGroup(int id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateAssignedUserLinkedGroup(int id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var DeviceFlag = Database.DeviceFlags.Find(id);
|
||||
if (DeviceFlag == null)
|
||||
throw new ArgumentException("Invalid Device Flag Id", "id");
|
||||
var deviceFlag = Database.DeviceFlags.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Flag Id", nameof(id));
|
||||
|
||||
|
||||
var syncTaskStatus = UpdateAssignedUserLinkedGroup(DeviceFlag, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateAssignedUserLinkedGroup(deviceFlag, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceFlag.Index(DeviceFlag.Id));
|
||||
return RedirectToAction(MVC.Config.DeviceFlag.Index(deviceFlag.Id));
|
||||
else
|
||||
{
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.DeviceFlag.Index(DeviceFlag.Id)));
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.DeviceFlag.Index(deviceFlag.Id)));
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(syncTaskStatus.SessionId));
|
||||
}
|
||||
else
|
||||
@@ -340,9 +336,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
DeviceFlagService.Update(Database, deviceFlag);
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceFlag deviceFlag, string devicesLinkedGroup, DateTime? filterBeginDate)
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceFlag deviceFlag, string devicesLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceFlagDevicesManagedGroup.GetKey(deviceFlag), devicesLinkedGroup, filterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceFlagDevicesManagedGroup.GetKey(deviceFlag), devicesLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (deviceFlag.DevicesLinkedGroup != configJson)
|
||||
{
|
||||
@@ -358,9 +354,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
return null;
|
||||
}
|
||||
private ScheduledTaskStatus UpdateAssignedUserLinkedGroup(DeviceFlag deviceFlag, string assignedUserLinkedGroup, DateTime? filterBeginDate)
|
||||
private ScheduledTaskStatus UpdateAssignedUserLinkedGroup(DeviceFlag deviceFlag, string assignedUserLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceFlagDeviceAssignedUsersManagedGroup.GetKey(deviceFlag), assignedUserLinkedGroup, filterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceFlagDeviceAssignedUsersManagedGroup.GetKey(deviceFlag), assignedUserLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (deviceFlag.DeviceUsersLinkedGroup != configJson)
|
||||
{
|
||||
|
||||
@@ -38,8 +38,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
private const string pAssignedUserLocalAdmin = "assigneduserlocaladmin";
|
||||
private const string pSetAssignedUserForLogon = "setassigneduserforlogon";
|
||||
private const string pAllowUntrustedReimageJobEnrolment = "allowuntrustedreimagejobrnrolment";
|
||||
private const string pDevicesLinkedGroup = "deviceslinkedgroup";
|
||||
private const string pAssignedUsersLinkedGroup = "assigneduserslinkedgroup";
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
@@ -106,12 +104,6 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
case pAllowUntrustedReimageJobEnrolment:
|
||||
UpdateAllowUntrustedReimageJobEnrolment(deviceProfile, value);
|
||||
break;
|
||||
case pDevicesLinkedGroup:
|
||||
UpdateDevicesLinkedGroup(deviceProfile, value);
|
||||
break;
|
||||
case pAssignedUsersLinkedGroup:
|
||||
UpdateAssignedUsersLinkedGroup(deviceProfile, value);
|
||||
break;
|
||||
default:
|
||||
throw new Exception("Invalid Update Key");
|
||||
}
|
||||
@@ -385,18 +377,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string GroupId = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(int id, string groupId = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var deviceProfile = Database.DeviceProfiles.Find(id);
|
||||
if (deviceProfile == null)
|
||||
throw new ArgumentException("Invalid Device Profile Id", "id");
|
||||
var deviceProfile = Database.DeviceProfiles.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Profile Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceProfile, GroupId);
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(deviceProfile, groupId, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceProfile.Index(deviceProfile.Id));
|
||||
@@ -418,18 +409,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.DeviceProfile.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var deviceProfile = Database.DeviceProfiles.Find(id);
|
||||
if (deviceProfile == null)
|
||||
throw new ArgumentException("Invalid Device Profile Id", "id");
|
||||
var deviceProfile = Database.DeviceProfiles.Find(id)
|
||||
?? throw new ArgumentException("Invalid Device Profile Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(deviceProfile, GroupId);
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(deviceProfile, groupId, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DeviceProfile.Index(deviceProfile.Id));
|
||||
@@ -725,9 +715,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
throw new Exception("Invalid Boolean Value");
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceProfile deviceProfile, string devicesLinkedGroup)
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DeviceProfile deviceProfile, string devicesLinkedGroup, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceProfileDevicesManagedGroup.GetKey(deviceProfile), devicesLinkedGroup, null);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceProfileDevicesManagedGroup.GetKey(deviceProfile), devicesLinkedGroup, null, updateDescription);
|
||||
|
||||
if (deviceProfile.DevicesLinkedGroup != configJson)
|
||||
{
|
||||
@@ -742,9 +732,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(DeviceProfile deviceProfile, string assignedUsersLinkedGroup)
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(DeviceProfile deviceProfile, string assignedUsersLinkedGroup, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceProfileAssignedUsersManagedGroup.GetKey(deviceProfile), assignedUsersLinkedGroup, null);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DeviceProfileAssignedUsersManagedGroup.GetKey(deviceProfile), assignedUsersLinkedGroup, null, updateDescription);
|
||||
|
||||
if (deviceProfile.AssignedUsersLinkedGroup != configJson)
|
||||
{
|
||||
|
||||
@@ -255,18 +255,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(string id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateDevicesLinkedGroup(string id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
|
||||
var documentTemplate = Database.DocumentTemplates.Find(id);
|
||||
if (documentTemplate == null)
|
||||
throw new ArgumentException("Invalid Document Template Id", "id");
|
||||
var documentTemplate = Database.DocumentTemplates.Find(id)
|
||||
?? throw new ArgumentException("Invalid Document Template Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(documentTemplate, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateDevicesLinkedGroup(documentTemplate, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DocumentTemplate.Index(documentTemplate.Id));
|
||||
@@ -289,18 +288,17 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DocumentTemplate.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateUsersLinkedGroup(string id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateUsersLinkedGroup(string id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(id))
|
||||
throw new ArgumentNullException("id");
|
||||
throw new ArgumentNullException(nameof(id));
|
||||
|
||||
var documentTemplate = Database.DocumentTemplates.Find(id);
|
||||
if (documentTemplate == null)
|
||||
throw new ArgumentException("Invalid Document Template Id", "id");
|
||||
var documentTemplate = Database.DocumentTemplates.Find(id)
|
||||
?? throw new ArgumentException("Invalid Document Template Id", nameof(id));
|
||||
|
||||
var syncTaskStatus = UpdateUsersLinkedGroup(documentTemplate, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateUsersLinkedGroup(documentTemplate, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.DocumentTemplate.Index(documentTemplate.Id));
|
||||
@@ -470,16 +468,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Database.SaveChanges();
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DocumentTemplate DocumentTemplate, string DevicesLinkedGroup, DateTime? FilterBeginDate)
|
||||
private ScheduledTaskStatus UpdateDevicesLinkedGroup(DocumentTemplate documentTemplate, string devicesLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DocumentTemplateDevicesManagedGroup.GetKey(DocumentTemplate), DevicesLinkedGroup, FilterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DocumentTemplateDevicesManagedGroup.GetKey(documentTemplate), devicesLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (DocumentTemplate.DevicesLinkedGroup != configJson)
|
||||
if (documentTemplate.DevicesLinkedGroup != configJson)
|
||||
{
|
||||
DocumentTemplate.DevicesLinkedGroup = configJson;
|
||||
documentTemplate.DevicesLinkedGroup = configJson;
|
||||
Database.SaveChanges();
|
||||
|
||||
var managedGroup = DocumentTemplateDevicesManagedGroup.Initialize(DocumentTemplate);
|
||||
var managedGroup = DocumentTemplateDevicesManagedGroup.Initialize(documentTemplate);
|
||||
if (managedGroup != null) // Sync Group
|
||||
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||
}
|
||||
@@ -487,16 +485,16 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
return null;
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateUsersLinkedGroup(DocumentTemplate DocumentTemplate, string UsersLinkedGroup, DateTime? FilterBeginDate)
|
||||
private ScheduledTaskStatus UpdateUsersLinkedGroup(DocumentTemplate documentTemplate, string usersLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DocumentTemplateUsersManagedGroup.GetKey(DocumentTemplate), UsersLinkedGroup, FilterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(DocumentTemplateUsersManagedGroup.GetKey(documentTemplate), usersLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (DocumentTemplate.UsersLinkedGroup != configJson)
|
||||
if (documentTemplate.UsersLinkedGroup != configJson)
|
||||
{
|
||||
DocumentTemplate.UsersLinkedGroup = configJson;
|
||||
documentTemplate.UsersLinkedGroup = configJson;
|
||||
Database.SaveChanges();
|
||||
|
||||
var managedGroup = DocumentTemplateUsersManagedGroup.Initialize(DocumentTemplate);
|
||||
var managedGroup = DocumentTemplateUsersManagedGroup.Initialize(documentTemplate);
|
||||
if (managedGroup != null) // Sync Group
|
||||
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||
}
|
||||
|
||||
@@ -166,25 +166,23 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var UserFlag = Database.UserFlags.Find(id);
|
||||
if (UserFlag == null)
|
||||
throw new ArgumentException("Invalid User Flag Id", nameof(id));
|
||||
var userFlag = Database.UserFlags.Find(id)
|
||||
?? throw new ArgumentException("Invalid User Flag Id", nameof(id));
|
||||
|
||||
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(UserFlag, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateAssignedUsersLinkedGroup(userFlag, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(UserFlag.Id));
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(userFlag.Id));
|
||||
else
|
||||
{
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.UserFlag.Index(UserFlag.Id)));
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.UserFlag.Index(userFlag.Id)));
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(syncTaskStatus.SessionId));
|
||||
}
|
||||
else
|
||||
@@ -200,25 +198,23 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
[DiscoAuthorize(Claims.Config.UserFlag.Configure)]
|
||||
[HttpPost, ValidateAntiForgeryToken]
|
||||
public virtual ActionResult UpdateAssignedUserDevicesLinkedGroup(int id, string GroupId = null, DateTime? FilterBeginDate = null, bool redirect = false)
|
||||
public virtual ActionResult UpdateAssignedUserDevicesLinkedGroup(int id, string groupId = null, DateTime? filterBeginDate = null, bool? updateDescription = null, bool redirect = false)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException(nameof(id));
|
||||
|
||||
var UserFlag = Database.UserFlags.Find(id);
|
||||
if (UserFlag == null)
|
||||
throw new ArgumentException("Invalid User Flag Id", nameof(id));
|
||||
var userFlag = Database.UserFlags.Find(id)
|
||||
?? throw new ArgumentException("Invalid User Flag Id", nameof(id));
|
||||
|
||||
|
||||
var syncTaskStatus = UpdateAssignedUserDevicesLinkedGroup(UserFlag, GroupId, FilterBeginDate);
|
||||
var syncTaskStatus = UpdateAssignedUserDevicesLinkedGroup(userFlag, groupId, filterBeginDate, updateDescription ?? true);
|
||||
if (redirect)
|
||||
if (syncTaskStatus == null)
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(UserFlag.Id));
|
||||
return RedirectToAction(MVC.Config.UserFlag.Index(userFlag.Id));
|
||||
else
|
||||
{
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.UserFlag.Index(UserFlag.Id)));
|
||||
syncTaskStatus.SetFinishedUrl(Url.Action(MVC.Config.UserFlag.Index(userFlag.Id)));
|
||||
return RedirectToAction(MVC.Config.Logging.TaskStatus(syncTaskStatus.SessionId));
|
||||
}
|
||||
else
|
||||
@@ -340,19 +336,19 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
}
|
||||
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(UserFlag UserFlag, string AssignedUsersLinkedGroup, DateTime? FilterBeginDate)
|
||||
private ScheduledTaskStatus UpdateAssignedUsersLinkedGroup(UserFlag userFlag, string assignedUsersLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(UserFlagUsersManagedGroup.GetKey(UserFlag), AssignedUsersLinkedGroup, FilterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(UserFlagUsersManagedGroup.GetKey(userFlag), assignedUsersLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (UserFlag.UsersLinkedGroup != configJson)
|
||||
if (userFlag.UsersLinkedGroup != configJson)
|
||||
{
|
||||
UserFlag.UsersLinkedGroup = configJson;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
userFlag.UsersLinkedGroup = configJson;
|
||||
UserFlagService.Update(Database, userFlag);
|
||||
|
||||
if (UserFlag.UsersLinkedGroup != null)
|
||||
if (userFlag.UsersLinkedGroup != null)
|
||||
{
|
||||
// Sync Group
|
||||
if (UserFlagUsersManagedGroup.TryGetManagedGroup(UserFlag, out var managedGroup))
|
||||
if (UserFlagUsersManagedGroup.TryGetManagedGroup(userFlag, out var managedGroup))
|
||||
{
|
||||
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||
}
|
||||
@@ -361,19 +357,19 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
|
||||
return null;
|
||||
}
|
||||
private ScheduledTaskStatus UpdateAssignedUserDevicesLinkedGroup(UserFlag UserFlag, string AssignedUserDevicesLinkedGroup, DateTime? FilterBeginDate)
|
||||
private ScheduledTaskStatus UpdateAssignedUserDevicesLinkedGroup(UserFlag userFlag, string assignedUserDevicesLinkedGroup, DateTime? filterBeginDate, bool updateDescription)
|
||||
{
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(UserFlagUserDevicesManagedGroup.GetKey(UserFlag), AssignedUserDevicesLinkedGroup, FilterBeginDate);
|
||||
var configJson = ADManagedGroup.ValidConfigurationToJson(UserFlagUserDevicesManagedGroup.GetKey(userFlag), assignedUserDevicesLinkedGroup, filterBeginDate, updateDescription);
|
||||
|
||||
if (UserFlag.UserDevicesLinkedGroup != configJson)
|
||||
if (userFlag.UserDevicesLinkedGroup != configJson)
|
||||
{
|
||||
UserFlag.UserDevicesLinkedGroup = configJson;
|
||||
UserFlagService.Update(Database, UserFlag);
|
||||
userFlag.UserDevicesLinkedGroup = configJson;
|
||||
UserFlagService.Update(Database, userFlag);
|
||||
|
||||
if (UserFlag.UserDevicesLinkedGroup != null)
|
||||
if (userFlag.UserDevicesLinkedGroup != null)
|
||||
{
|
||||
// Sync Group
|
||||
if (UserFlagUserDevicesManagedGroup.TryGetManagedGroup(UserFlag, out var managedGroup))
|
||||
if (UserFlagUserDevicesManagedGroup.TryGetManagedGroup(userFlag, out var managedGroup))
|
||||
{
|
||||
return ADManagedGroupsSyncTask.ScheduleSync(managedGroup);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="code" title="@group.Id">
|
||||
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
||||
</div>
|
||||
<button type="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 type="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-linkedgroupdescription="@(Model.CategoryDescription)" data-linkedgroupupdateurl="@(Model.UpdateUrl)" data-linkedgroupupdatedescription="@(Model.ManagedGroup.Configuration.UpdateDescription)">Change Link</button>
|
||||
using (Html.BeginForm(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path)))
|
||||
{
|
||||
@Html.AntiForgeryToken()
|
||||
@@ -34,12 +34,12 @@
|
||||
<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>
|
||||
</div>
|
||||
<button type="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 type="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-linkedgroupdescription="@(Model.CategoryDescription)" data-linkedgroupupdateurl="@(Model.UpdateUrl)" data-linkedgroupupdatedescription="@(Model.ManagedGroup.Configuration.UpdateDescription)">Change Link</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<button type="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 type="button" class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="" data-linkedgroupfilterdateoption="@(Model.IncludeFilterBeginDate)" data-linkedgroupdescription="@(Model.CategoryDescription)" data-linkedgroupupdateurl="@(Model.UpdateUrl)" data-linkedgroupupdatedescription="True">Link Group</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -177,22 +177,33 @@ WriteLiteral(" data-linkedgroupfilterdate=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
WriteLiteral(" data-linkedgroupdescription=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
WriteLiteral(" data-linkedgroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupupdatedescription=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.UpdateDescription);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -303,22 +314,33 @@ WriteLiteral(" data-linkedgroupfilterdate=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
WriteLiteral(" data-linkedgroupdescription=\"");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
WriteLiteral(" data-linkedgroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupupdatedescription=\"");
|
||||
|
||||
|
||||
#line 37 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.UpdateDescription);
|
||||
|
||||
|
||||
#line default
|
||||
@@ -356,28 +378,30 @@ WriteLiteral(" data-linkedgroupfilterdateoption=\"");
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
WriteLiteral(" data-linkedgroupdescription=\"");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
WriteLiteral(" data-linkedgroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 42 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupupdatedescription=\"True\"");
|
||||
|
||||
WriteLiteral(">Link Group</button>\r\n");
|
||||
|
||||
|
||||
@@ -398,14 +422,14 @@ WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2966), Tuple.Create("\"", 2983)
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 3193), Tuple.Create("\"", 3210)
|
||||
|
||||
#line 51 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2974), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||
, Tuple.Create(Tuple.Create("", 3201), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2974), false)
|
||||
, 3201), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<label for="Config_LinkedGroup_Id">Linked Group:</label>
|
||||
</th>
|
||||
<td>
|
||||
<input id="Config_LinkedGroup_Id" type="text" name="GroupId" data-sourceurl="@(Url.Action(MVC.API.System.SearchGroupSubjects()))" />
|
||||
<input id="Config_LinkedGroup_Id" type="text" name="groupId" data-sourceurl="@(Url.Action(MVC.API.System.SearchGroupSubjects()))" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
@@ -20,7 +20,15 @@
|
||||
<label for="Config_LinkedGroup_FilterDate">Filter Date: </label>
|
||||
</th>
|
||||
<td>
|
||||
<input id="Config_LinkedGroup_FilterDate" type="text" name="FilterBeginDate" placeholder="No Filter" autocomplete="off" />
|
||||
<input id="Config_LinkedGroup_FilterDate" type="text" name="filterBeginDate" placeholder="No Filter" autocomplete="off" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<td>
|
||||
<input id="Config_LinkedGroup_UpdateDescriptionOff" type="hidden" name="updateDescription" value="False" disabled />
|
||||
<input id="Config_LinkedGroup_UpdateDescription" type="checkbox" name="updateDescription" value="True" checked />
|
||||
<label for="Config_LinkedGroup_UpdateDescription">Update Group Description</label>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@@ -30,6 +38,7 @@
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-exclamation-circle"></i><strong>Warning:</strong> This group will be managed by Disco ICT.<br />
|
||||
Any <strong>existing members will be removed from the group</strong>, and it will be automatically synchronized with related members.
|
||||
If the 'Update Group Description' option is selected, the group's description will also be updated to reflect its managed status.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -38,9 +47,10 @@
|
||||
let dialog;
|
||||
let dialogGroupId;
|
||||
let dialogFilterDate;
|
||||
let dialogUpdateDescription;
|
||||
let dialogTitle;
|
||||
|
||||
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title) {
|
||||
function showDialog(groupId, filterDateOption, filterDateValue, updateUrl, title, updateDescription) {
|
||||
if (dialog == null) {
|
||||
dialog = $('#Config_LinkedGroup_Dialog').dialog({
|
||||
width: 450,
|
||||
@@ -57,6 +67,10 @@
|
||||
dateFormat: 'yy/mm/dd'
|
||||
});
|
||||
|
||||
dialogUpdateDescription = $('#Config_LinkedGroup_UpdateDescription').on('change', function () {
|
||||
$('#Config_LinkedGroup_UpdateDescriptionOff').prop('disabled', $(this).prop('checked'));
|
||||
});
|
||||
|
||||
dialogGroupId = $('#Config_LinkedGroup_Id');
|
||||
dialogGroupId.focus(function () { $(this).select(); });
|
||||
dialogGroupId.autocomplete({
|
||||
@@ -109,6 +123,8 @@
|
||||
dialogFilterDate.closest('tr').hide();
|
||||
}
|
||||
|
||||
dialogUpdateDescription.prop('checked', updateDescription);
|
||||
|
||||
dialogTitle.text(title);
|
||||
dialog.dialog('option', 'buttons', dialogButtons);
|
||||
dialog.dialog('option', 'title', 'Linked Group: ' + title);
|
||||
@@ -120,11 +136,12 @@
|
||||
|
||||
var configuredGroupId = $this.attr('data-linkedgroupid');
|
||||
var configuredFilterBeginDate = $this.attr('data-linkedgroupfilterdate');
|
||||
var filterDateOption = $this.attr('data-linkedgroupfilterdateoption') == 'True';
|
||||
var description = $this.attr('data-linkedroupdescription');
|
||||
var updateUrl = $this.attr('data-linkedroupupdateurl');
|
||||
var filterDateOption = $this.attr('data-linkedgroupfilterdateoption') === 'True';
|
||||
var description = $this.attr('data-linkedgroupdescription');
|
||||
var updateUrl = $this.attr('data-linkedgroupupdateurl');
|
||||
var updateDescription = $this.attr('data-linkedgroupupdatedescription') === 'True';
|
||||
|
||||
showDialog(configuredGroupId, filterDateOption, configuredFilterBeginDate, updateUrl, description);
|
||||
showDialog(configuredGroupId, filterDateOption, configuredFilterBeginDate, updateUrl, description, updateDescription);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -96,7 +96,7 @@ WriteLiteral(" id=\"Config_LinkedGroup_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" name=\"GroupId\"");
|
||||
WriteLiteral(" name=\"groupId\"");
|
||||
|
||||
WriteLiteral(" data-sourceurl=\"");
|
||||
|
||||
@@ -121,14 +121,40 @@ WriteLiteral(" id=\"Config_LinkedGroup_FilterDate\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" name=\"FilterBeginDate\"");
|
||||
WriteLiteral(" name=\"filterBeginDate\"");
|
||||
|
||||
WriteLiteral(" placeholder=\"No Filter\"");
|
||||
|
||||
WriteLiteral(" autocomplete=\"off\"");
|
||||
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n </tbody>\r\n " +
|
||||
" </table>\r\n </form>\r\n <div");
|
||||
WriteLiteral(" />\r\n </td>\r\n </tr>\r\n <tr>\r\n " +
|
||||
" <th> </th>\r\n <td>\r\n " +
|
||||
" <input");
|
||||
|
||||
WriteLiteral(" id=\"Config_LinkedGroup_UpdateDescriptionOff\"");
|
||||
|
||||
WriteLiteral(" type=\"hidden\"");
|
||||
|
||||
WriteLiteral(" name=\"updateDescription\"");
|
||||
|
||||
WriteLiteral(" value=\"False\"");
|
||||
|
||||
WriteLiteral(" disabled />\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Config_LinkedGroup_UpdateDescription\"");
|
||||
|
||||
WriteLiteral(" type=\"checkbox\"");
|
||||
|
||||
WriteLiteral(" name=\"updateDescription\"");
|
||||
|
||||
WriteLiteral(" value=\"True\"");
|
||||
|
||||
WriteLiteral(" checked />\r\n <label");
|
||||
|
||||
WriteLiteral(" for=\"Config_LinkedGroup_UpdateDescription\"");
|
||||
|
||||
WriteLiteral(">Update Group Description</label>\r\n </td>\r\n </t" +
|
||||
"r>\r\n </tbody>\r\n </table>\r\n </form>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"info-box error\"");
|
||||
|
||||
@@ -142,56 +168,64 @@ WriteLiteral(" class=\"fa fa-exclamation-circle\"");
|
||||
|
||||
WriteLiteral("></i><strong>Warning:</strong> This group will be managed by Disco ICT.<br />\r\n " +
|
||||
" Any <strong>existing members will be removed from the group</strong>, " +
|
||||
"and it will be automatically synchronized with related members.\r\n </p>\r\n " +
|
||||
" </div>\r\n</div>\r\n<script>\r\n $(function () {\r\n let dialog;\r\n l" +
|
||||
"et dialogGroupId;\r\n let dialogFilterDate;\r\n let dialogTitle;\r\n\r\n " +
|
||||
" function showDialog(groupId, filterDateOption, filterDateValue, updateUrl," +
|
||||
" title) {\r\n if (dialog == null) {\r\n dialog = $(\'#Confi" +
|
||||
"g_LinkedGroup_Dialog\').dialog({\r\n width: 450,\r\n " +
|
||||
" resizable: false,\r\n modal: true,\r\n a" +
|
||||
"utoOpen: false\r\n });\r\n\r\n dialogFilterDate = $(\'#Co" +
|
||||
"nfig_LinkedGroup_FilterDate\');\r\n dialogFilterDate.datetimepicker(" +
|
||||
"{\r\n ampm: true,\r\n changeYear: true,\r\n " +
|
||||
" changeMonth: true,\r\n dateFormat: \'yy/mm/dd\'\r\n " +
|
||||
" });\r\n\r\n dialogGroupId = $(\'#Config_LinkedGroup_Id\'" +
|
||||
");\r\n dialogGroupId.focus(function () { $(this).select(); });\r\n " +
|
||||
" dialogGroupId.autocomplete({\r\n source: dialogGro" +
|
||||
"upId.attr(\'data-sourceurl\'),\r\n minLength: 2,\r\n " +
|
||||
" select: function (e, ui) {\r\n dialogGroupId.val(ui.it" +
|
||||
"em.Id);\r\n return false;\r\n }\r\n " +
|
||||
" }).data(\'ui-autocomplete\')._renderItem = function (ul, item) {\r\n " +
|
||||
" return $(\"<li>\")\r\n .data(\"item.autocomplete\", " +
|
||||
"item)\r\n .append(\"<a><strong>\" + item.Name + \"</strong><br" +
|
||||
">\" + item.Id + \" (\" + item.Type + \")</a>\")\r\n .appendTo(ul" +
|
||||
");\r\n };\r\n\r\n dialogTitle = $(\'#Config_LinkedGroup_T" +
|
||||
"itle\');\r\n }\r\n\r\n var dialogButtons = {};\r\n if (!" +
|
||||
"!groupId) {\r\n dialogButtons[\'Remove Link\'] = function () {\r\n " +
|
||||
" $(this).dialog(\'disable\');\r\n dialogGroupId.val" +
|
||||
"(\'\');\r\n dialogGroupId.closest(\'form\').attr(\'action\', updateUr" +
|
||||
"l).submit();\r\n }\r\n }\r\n dialogButtons[(!!gro" +
|
||||
"upId ? \'Save Changes\' : \'Link Group\')] = function () {\r\n if (!dia" +
|
||||
"logGroupId.val()) {\r\n alert(\'A Linked Group must be specified" +
|
||||
"\');\r\n return;\r\n }\r\n $(this).dia" +
|
||||
"log(\'disable\');\r\n dialogGroupId.closest(\'form\').attr(\'action\', up" +
|
||||
"dateUrl).submit();\r\n }\r\n dialogButtons[\'Cancel\'] = functio" +
|
||||
"n () {\r\n $(this).dialog(\'close\');\r\n };\r\n\r\n " +
|
||||
"dialogGroupId.val(groupId);\r\n\r\n if (!!filterDateOption) {\r\n " +
|
||||
" if (!!filterDateValue) {\r\n dialogFilterDate.datetimepic" +
|
||||
"ker(\'setDate\', moment(filterDateValue).toDate());\r\n } else {\r\n " +
|
||||
" dialogFilterDate.val(\'\');\r\n }\r\n d" +
|
||||
"ialogFilterDate.closest(\'tr\').show();\r\n } else {\r\n dia" +
|
||||
"logFilterDate.closest(\'tr\').hide();\r\n }\r\n\r\n dialogTitle.te" +
|
||||
"xt(title);\r\n dialog.dialog(\'option\', \'buttons\', dialogButtons);\r\n " +
|
||||
" dialog.dialog(\'option\', \'title\', \'Linked Group: \' + title);\r\n " +
|
||||
" dialog.dialog(\'open\');\r\n }\r\n\r\n $(document).on(\'click\', \'.Config_L" +
|
||||
"inkedGroup_LinkButton\', function () {\r\n $this = $(this);\r\n\r\n " +
|
||||
" var configuredGroupId = $this.attr(\'data-linkedgroupid\');\r\n var co" +
|
||||
"nfiguredFilterBeginDate = $this.attr(\'data-linkedgroupfilterdate\');\r\n " +
|
||||
" var filterDateOption = $this.attr(\'data-linkedgroupfilterdateoption\') == \'True\'" +
|
||||
";\r\n var description = $this.attr(\'data-linkedroupdescription\');\r\n " +
|
||||
" var updateUrl = $this.attr(\'data-linkedroupupdateurl\');\r\n\r\n s" +
|
||||
"howDialog(configuredGroupId, filterDateOption, configuredFilterBeginDate, update" +
|
||||
"Url, description);\r\n\r\n return false;\r\n });\r\n });\r\n</script>" +
|
||||
"and it will be automatically synchronized with related members.\r\n If " +
|
||||
"the \'Update Group Description\' option is selected, the group\'s description will " +
|
||||
"also be updated to reflect its managed status.\r\n </p>\r\n </div>\r\n</div>" +
|
||||
"\r\n<script>\r\n $(function () {\r\n let dialog;\r\n let dialogGroupId;" +
|
||||
"\r\n let dialogFilterDate;\r\n let dialogUpdateDescription;\r\n l" +
|
||||
"et dialogTitle;\r\n\r\n function showDialog(groupId, filterDateOption, filter" +
|
||||
"DateValue, updateUrl, title, updateDescription) {\r\n if (dialog == nul" +
|
||||
"l) {\r\n dialog = $(\'#Config_LinkedGroup_Dialog\').dialog({\r\n " +
|
||||
" width: 450,\r\n resizable: false,\r\n " +
|
||||
" modal: true,\r\n autoOpen: false\r\n });\r\n\r\n " +
|
||||
" dialogFilterDate = $(\'#Config_LinkedGroup_FilterDate\');\r\n " +
|
||||
" dialogFilterDate.datetimepicker({\r\n ampm: true,\r\n " +
|
||||
" changeYear: true,\r\n changeMonth: true,\r\n " +
|
||||
" dateFormat: \'yy/mm/dd\'\r\n });\r\n\r\n di" +
|
||||
"alogUpdateDescription = $(\'#Config_LinkedGroup_UpdateDescription\').on(\'change\', " +
|
||||
"function () {\r\n $(\'#Config_LinkedGroup_UpdateDescriptionOff\')" +
|
||||
".prop(\'disabled\', $(this).prop(\'checked\'));\r\n });\r\n\r\n " +
|
||||
" dialogGroupId = $(\'#Config_LinkedGroup_Id\');\r\n dialogGroupId." +
|
||||
"focus(function () { $(this).select(); });\r\n dialogGroupId.autocom" +
|
||||
"plete({\r\n source: dialogGroupId.attr(\'data-sourceurl\'),\r\n " +
|
||||
" minLength: 2,\r\n select: function (e, ui) {\r\n " +
|
||||
" dialogGroupId.val(ui.item.Id);\r\n r" +
|
||||
"eturn false;\r\n }\r\n }).data(\'ui-autocomplete\')." +
|
||||
"_renderItem = function (ul, item) {\r\n return $(\"<li>\")\r\n " +
|
||||
" .data(\"item.autocomplete\", item)\r\n .ap" +
|
||||
"pend(\"<a><strong>\" + item.Name + \"</strong><br>\" + item.Id + \" (\" + item.Type + " +
|
||||
"\")</a>\")\r\n .appendTo(ul);\r\n };\r\n\r\n " +
|
||||
" dialogTitle = $(\'#Config_LinkedGroup_Title\');\r\n }\r\n\r\n " +
|
||||
" var dialogButtons = {};\r\n if (!!groupId) {\r\n dialo" +
|
||||
"gButtons[\'Remove Link\'] = function () {\r\n $(this).dialog(\'dis" +
|
||||
"able\');\r\n dialogGroupId.val(\'\');\r\n dialogG" +
|
||||
"roupId.closest(\'form\').attr(\'action\', updateUrl).submit();\r\n }\r\n " +
|
||||
" }\r\n dialogButtons[(!!groupId ? \'Save Changes\' : \'Link Grou" +
|
||||
"p\')] = function () {\r\n if (!dialogGroupId.val()) {\r\n " +
|
||||
" alert(\'A Linked Group must be specified\');\r\n return;\r\n" +
|
||||
" }\r\n $(this).dialog(\'disable\');\r\n d" +
|
||||
"ialogGroupId.closest(\'form\').attr(\'action\', updateUrl).submit();\r\n }\r" +
|
||||
"\n dialogButtons[\'Cancel\'] = function () {\r\n $(this).di" +
|
||||
"alog(\'close\');\r\n };\r\n\r\n dialogGroupId.val(groupId);\r\n\r\n " +
|
||||
" if (!!filterDateOption) {\r\n if (!!filterDateValue) {\r\n " +
|
||||
" dialogFilterDate.datetimepicker(\'setDate\', moment(filterDateVa" +
|
||||
"lue).toDate());\r\n } else {\r\n dialogFilterDate." +
|
||||
"val(\'\');\r\n }\r\n dialogFilterDate.closest(\'tr\').show" +
|
||||
"();\r\n } else {\r\n dialogFilterDate.closest(\'tr\').hide()" +
|
||||
";\r\n }\r\n\r\n dialogUpdateDescription.prop(\'checked\', updateDe" +
|
||||
"scription);\r\n\r\n dialogTitle.text(title);\r\n dialog.dialog(\'" +
|
||||
"option\', \'buttons\', dialogButtons);\r\n dialog.dialog(\'option\', \'title\'" +
|
||||
", \'Linked Group: \' + title);\r\n dialog.dialog(\'open\');\r\n }\r\n\r\n " +
|
||||
" $(document).on(\'click\', \'.Config_LinkedGroup_LinkButton\', function () {\r\n" +
|
||||
" $this = $(this);\r\n\r\n var configuredGroupId = $this.attr(\'" +
|
||||
"data-linkedgroupid\');\r\n var configuredFilterBeginDate = $this.attr(\'d" +
|
||||
"ata-linkedgroupfilterdate\');\r\n var filterDateOption = $this.attr(\'dat" +
|
||||
"a-linkedgroupfilterdateoption\') === \'True\';\r\n var description = $this" +
|
||||
".attr(\'data-linkedgroupdescription\');\r\n var updateUrl = $this.attr(\'d" +
|
||||
"ata-linkedgroupupdateurl\');\r\n var updateDescription = $this.attr(\'dat" +
|
||||
"a-linkedgroupupdatedescription\') === \'True\';\r\n\r\n showDialog(configure" +
|
||||
"dGroupId, filterDateOption, configuredFilterBeginDate, updateUrl, description, u" +
|
||||
"pdateDescription);\r\n\r\n return false;\r\n });\r\n });\r\n</script>" +
|
||||
"\r\n");
|
||||
|
||||
}
|
||||
|
||||
@@ -443,7 +443,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateDevicesLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateAssignedUsersLinkedGroup s_params_UpdateAssignedUsersLinkedGroup = new ActionParamsClass_UpdateAssignedUsersLinkedGroup();
|
||||
@@ -453,7 +454,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateAssignedUsersLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||
@@ -753,30 +755,32 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, bool redirect);
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string GroupId, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string groupId, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDevicesLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, GroupId, redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, groupId, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, bool redirect);
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUsersLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, GroupId, redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, groupId, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -326,8 +326,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateDevicesLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateAssignedUserLinkedGroup s_params_UpdateAssignedUserLinkedGroup = new ActionParamsClass_UpdateAssignedUserLinkedGroup();
|
||||
@@ -337,8 +338,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateAssignedUserLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||
@@ -550,32 +552,34 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDevicesLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateAssignedUserLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateAssignedUserLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUserLinkedGroup(int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUserLinkedGroup(int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUserLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateAssignedUserLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateAssignedUserLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -474,7 +474,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateDevicesLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateAssignedUsersLinkedGroup s_params_UpdateAssignedUsersLinkedGroup = new ActionParamsClass_UpdateAssignedUsersLinkedGroup();
|
||||
@@ -484,7 +485,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateAssignedUsersLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||
@@ -802,30 +804,32 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, bool redirect);
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string GroupId, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(int id, string groupId, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDevicesLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, GroupId, redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, groupId, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, bool redirect);
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUsersLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, GroupId, redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, groupId, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -545,8 +545,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateDevicesLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateUsersLinkedGroup s_params_UpdateUsersLinkedGroup = new ActionParamsClass_UpdateUsersLinkedGroup();
|
||||
@@ -556,8 +557,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateUsersLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_ImporterThumbnail s_params_ImporterThumbnail = new ActionParamsClass_ImporterThumbnail();
|
||||
@@ -1016,32 +1018,34 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(string id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateDevicesLinkedGroup(string id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateDevicesLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateDevicesLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, string id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateUsersLinkedGroup(string id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateUsersLinkedGroup(string id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateUsersLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateUsersLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateUsersLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
@@ -326,8 +326,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateAssignedUsersLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_UpdateAssignedUserDevicesLinkedGroup s_params_UpdateAssignedUserDevicesLinkedGroup = new ActionParamsClass_UpdateAssignedUserDevicesLinkedGroup();
|
||||
@@ -337,8 +338,9 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public class ActionParamsClass_UpdateAssignedUserDevicesLinkedGroup
|
||||
{
|
||||
public readonly string id = "id";
|
||||
public readonly string GroupId = "GroupId";
|
||||
public readonly string FilterBeginDate = "FilterBeginDate";
|
||||
public readonly string groupId = "groupId";
|
||||
public readonly string filterBeginDate = "filterBeginDate";
|
||||
public readonly string updateDescription = "updateDescription";
|
||||
public readonly string redirect = "redirect";
|
||||
}
|
||||
static readonly ActionParamsClass_Delete s_params_Delete = new ActionParamsClass_Delete();
|
||||
@@ -550,32 +552,34 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateAssignedUsersLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUsersLinkedGroup(int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUsersLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateAssignedUsersLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
[NonAction]
|
||||
partial void UpdateAssignedUserDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect);
|
||||
partial void UpdateAssignedUserDevicesLinkedGroupOverride(T4MVC_System_Web_Mvc_ActionResult callInfo, int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect);
|
||||
|
||||
[NonAction]
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUserDevicesLinkedGroup(int id, string GroupId, System.DateTime? FilterBeginDate, bool redirect)
|
||||
public override System.Web.Mvc.ActionResult UpdateAssignedUserDevicesLinkedGroup(int id, string groupId, System.DateTime? filterBeginDate, bool? updateDescription, bool redirect)
|
||||
{
|
||||
var callInfo = new T4MVC_System_Web_Mvc_ActionResult(Area, Name, ActionNames.UpdateAssignedUserDevicesLinkedGroup);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "id", id);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "GroupId", GroupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "FilterBeginDate", FilterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "groupId", groupId);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "filterBeginDate", filterBeginDate);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "updateDescription", updateDescription);
|
||||
ModelUnbinderHelpers.AddRouteValues(callInfo.RouteValueDictionary, "redirect", redirect);
|
||||
UpdateAssignedUserDevicesLinkedGroupOverride(callInfo, id, GroupId, FilterBeginDate, redirect);
|
||||
UpdateAssignedUserDevicesLinkedGroupOverride(callInfo, id, groupId, filterBeginDate, updateDescription, redirect);
|
||||
return callInfo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user