qol: formatting
This commit is contained in:
@@ -121,7 +121,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
|
||||
#region Update Shortcut Methods
|
||||
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure)]
|
||||
public virtual ActionResult UpdateName(int id, string BatchName = null, bool redirect = false)
|
||||
{
|
||||
@@ -139,7 +139,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return Update(id, pSupplier, Supplier, redirect);
|
||||
}
|
||||
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)]
|
||||
public virtual ActionResult UpdatePurchaseDetails(int id, string PurchaseDetails = null, bool redirect = false)
|
||||
{
|
||||
@@ -169,7 +169,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return Update(id, pWarrantyValidUntil, WarrantyValidUntil, redirect);
|
||||
}
|
||||
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)]
|
||||
public virtual ActionResult UpdateWarrantyDetails(int id, string WarrantyDetails = null, bool redirect = false)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
return Update(id, pInsuredUntil, InsuredUntil, redirect);
|
||||
}
|
||||
|
||||
|
||||
[DiscoAuthorize(Claims.Config.DeviceBatch.Configure), ValidateInput(false)]
|
||||
public virtual ActionResult UpdateInsuranceDetails(int id, string InsuranceDetails = null, bool redirect = false)
|
||||
{
|
||||
|
||||
@@ -1263,7 +1263,8 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
Scope = $"User Detail '{key}' didn't match any users{(string.IsNullOrWhiteSpace(value) ? null : $" with the value '{value}'")}",
|
||||
IsError = true,
|
||||
});
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var user in details.Select(d => d.User).Distinct())
|
||||
{
|
||||
@@ -1431,7 +1432,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
UiUrl = handler.GenerationOptionsUi == null ? null : Url.Action(MVC.API.DocumentTemplate.GenerateDocumentHandlerUi(template.Id, target.AttachmentReferenceId, f.Id)),
|
||||
Icon = handler.GenerationOptionsIcon,
|
||||
});
|
||||
};
|
||||
}
|
||||
return Enumerable.Empty<DocumentHandlerModel>();
|
||||
}).ToList();
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
if (id < 0)
|
||||
throw new ArgumentOutOfRangeException("id");
|
||||
|
||||
|
||||
var jobQueueJob = Database.JobQueueJobs.Include("Job").FirstOrDefault(jqj => jqj.Id == id);
|
||||
if (jobQueueJob != null)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
else
|
||||
return Json($"Error: {ex.Message}", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Update Properties
|
||||
@@ -139,7 +139,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
{
|
||||
if (!jobQueueJob.CanEditSla())
|
||||
throw new InvalidOperationException("Editing SLA for job queue job is Denied");
|
||||
|
||||
|
||||
if (!string.IsNullOrEmpty(Sla))
|
||||
{
|
||||
DateTime SLADate;
|
||||
|
||||
@@ -124,7 +124,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ScheduledTaskStatus status;
|
||||
if (Plugins.PluginInstalled(packageManifest.Id))
|
||||
status = UpdatePluginTask.UpdateLocalPlugin(packageManifest.Id, tempPluginLocation, immediateRestart);
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
public virtual async Task<ActionResult> AttachmentOnlineUploadSession(string id, string domain)
|
||||
{
|
||||
var userId = ActiveDirectory.ParseDomainAccountId(id, domain);
|
||||
if (!UserService.TryGetUser(userId, Database, false,out var user))
|
||||
if (!UserService.TryGetUser(userId, Database, false, out var user))
|
||||
throw new InvalidOperationException("Unknown User");
|
||||
|
||||
try
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
public string TemplateName { get; set; }
|
||||
public string TargetId { get; set; }
|
||||
public string TargetName { get; set; }
|
||||
|
||||
|
||||
public List<DocumentHandlerModel> Handlers { get; set; }
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using Disco.Services.Logging;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Disco.Services.Logging;
|
||||
|
||||
namespace Disco.Web.Areas.API.Models.Logs
|
||||
{
|
||||
|
||||
@@ -138,7 +138,7 @@ namespace Disco.Web.Areas.Config
|
||||
context.MapRoute(
|
||||
"Config_Plugins",
|
||||
"Config/Plugins",
|
||||
new { controller = "Plugins", action = "Index"}
|
||||
new { controller = "Plugins", action = "Index" }
|
||||
);
|
||||
context.MapRoute(
|
||||
"Config_Plugins_Install",
|
||||
|
||||
@@ -15,10 +15,10 @@ namespace Disco.Web.Areas.Config.Controllers
|
||||
public virtual ActionResult Index()
|
||||
{
|
||||
IndexViewModel vm = new IndexViewModel()
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins(),
|
||||
PluginLibrary = PluginLibrary.LoadManifest(Database)
|
||||
};
|
||||
{
|
||||
PluginManifests = Plugins.GetPlugins(),
|
||||
PluginLibrary = PluginLibrary.LoadManifest(Database)
|
||||
};
|
||||
return View(vm);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Models.UI.Config.AuthorizationRole;
|
||||
using Disco.Models.Services.Authorization;
|
||||
using Disco.Web.Areas.API.Models.Shared;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.AuthorizationRole
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
public Disco.Models.Repository.DeviceBatch DeviceBatch { get; set; }
|
||||
|
||||
public Disco.Models.Repository.DeviceModel DefaultDeviceModel { get; set; }
|
||||
|
||||
|
||||
public List<Disco.Models.Repository.DeviceModel> DeviceModels { get; set; }
|
||||
public List<ConfigDeviceBatchShowModelMembership> DeviceModelMembers { get; set; }
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Disco.Models.UI.Config.DeviceBatch;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceBatch
|
||||
{
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.UI.Config.DeviceModel;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DeviceModel
|
||||
{
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
using System.Collections.Generic;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Disco.Data.Repository;
|
||||
using Disco.Models.UI.Config.DocumentTemplate;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
public class CreatePackageModel : ConfigDocumentTemplateCreatePackageModel
|
||||
{
|
||||
public DocumentTemplatePackage Package { get; set; }
|
||||
|
||||
|
||||
public List<string> Scopes
|
||||
{
|
||||
get
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Disco.Web.Areas.Config.Models.DocumentTemplate
|
||||
{
|
||||
public class UndetectedPagesModel : ConfigDocumentTemplateUndetectedPagesModel
|
||||
{
|
||||
|
||||
|
||||
public List<Disco.Models.Repository.DocumentTemplate> DocumentTemplates { get; set; }
|
||||
|
||||
public List<SelectListItem> DocumentTemplatesSelectListItems
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
using Disco.Models.UI.Config.Logging;
|
||||
using Disco.Services.Logging;
|
||||
using Disco.Services.Logging.Models;
|
||||
using Disco.Models.UI.Config.Logging;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Logging
|
||||
{
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
using System.Collections.Generic;
|
||||
using Disco.Models.BI.Config;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Disco.Models.BI.Config;
|
||||
using Disco.Models.UI.Config.Organisation;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Disco.Web.Areas.Config.Models.Organisation
|
||||
{
|
||||
public class IndexModel : ConfigOrganisationIndexModel
|
||||
{
|
||||
public string OrganisationName { get; set; }
|
||||
[Display(Name="Enabled")]
|
||||
[Display(Name = "Enabled")]
|
||||
public bool MultiSiteMode { get; set; }
|
||||
public List<OrganisationAddress> OrganisationAddresses { get; set; }
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Disco.Web.Areas.Config.Models.Plugins
|
||||
if (PluginLibrary == null || PluginLibrary.Plugins == null || PluginLibrary.Plugins.Count == 0 ||
|
||||
PluginManifests == null || PluginManifests.Count == 0)
|
||||
{
|
||||
_PluginUpdates = new Dictionary<PluginManifest,Tuple<PluginLibraryItemV2,PluginLibraryItemReleaseV2>>(); // No Updates
|
||||
_PluginUpdates = new Dictionary<PluginManifest, Tuple<PluginLibraryItemV2, PluginLibraryItemReleaseV2>>(); // No Updates
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Disco.Web.Areas.Config.Models.Shared
|
||||
|
||||
public string Description { get; set; }
|
||||
public string CategoryDescription { get; set; }
|
||||
|
||||
|
||||
public string UpdateUrl { get; set; }
|
||||
|
||||
public ADManagedGroup ManagedGroup { get; set; }
|
||||
|
||||
@@ -77,7 +77,7 @@ namespace Disco.Web.Areas.Config.Models.SystemConfig
|
||||
|
||||
#region Active Directory
|
||||
|
||||
[Display(Name="Search All Servers")]
|
||||
[Display(Name = "Search All Servers")]
|
||||
public bool ADSearchAllServers { get; set; }
|
||||
|
||||
public List<ADDomain> ADDomains { get; set; }
|
||||
|
||||
@@ -20,14 +20,14 @@ namespace Disco.Web.Areas.Public.Models.UserHeldDevices
|
||||
public UserHeldDeviceModel ToUserHeldDeviceModel(DiscoDataContext Database)
|
||||
{
|
||||
var uhdm = new UserHeldDeviceModel()
|
||||
{
|
||||
UserId = UserId,
|
||||
UserDisplayName = UserDisplayName,
|
||||
ReadyForReturn = ReadyForReturn,
|
||||
WaitingForUserAction = WaitingForUserAction,
|
||||
DeviceProfileId = DeviceProfileId,
|
||||
DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty)
|
||||
};
|
||||
{
|
||||
UserId = UserId,
|
||||
UserDisplayName = UserDisplayName,
|
||||
ReadyForReturn = ReadyForReturn,
|
||||
WaitingForUserAction = WaitingForUserAction,
|
||||
DeviceProfileId = DeviceProfileId,
|
||||
DeviceAddress = (DeviceAddressId.HasValue ? Database.DiscoConfiguration.OrganisationAddresses.GetAddress(DeviceAddressId.Value)?.ShortName : string.Empty)
|
||||
};
|
||||
var n = DateTime.Now;
|
||||
if (!ReadyForReturn && EstimatedReturnTime.HasValue && EstimatedReturnTime.Value > n)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user