Feature #4: Pre-defined/Restricted Locations
Configurable list and location suggestions. Ability to restrict locations. Shows 'occupied' locations.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Models.BI.Job;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -33,5 +34,29 @@ namespace Disco.Web.Areas.API.Controllers
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateLocationMode(LocationModes LocationMode, bool redirect = false)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.LocationMode = LocationMode;
|
||||
Database.SaveChanges();
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
|
||||
[DiscoAuthorize(Claims.Config.JobPreferences.Configure)]
|
||||
public virtual ActionResult UpdateLocationList(string[] LocationList, bool redirect = false)
|
||||
{
|
||||
Database.DiscoConfiguration.JobPreferences.LocationList = LocationList.Where(i => !string.IsNullOrWhiteSpace(i)).Select(i => i.Trim()).OrderBy(i => i).ToList();
|
||||
Database.SaveChanges();
|
||||
|
||||
if (redirect)
|
||||
return RedirectToAction(MVC.Config.JobPreferences.Index());
|
||||
else
|
||||
return Json("OK", JsonRequestBehavior.AllowGet);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user