Feature #49: Active Directory Managed Groups
Document Template Attachments, Device Batches, Device Profiles and User Flags can be associated with an Active Directory group. This AD group is then automatically synchronized with relevant User/Machine accounts. Contains various other UI tweaks and configuration enhancements.
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
@model Disco.Web.Areas.Config.Models.Shared.LinkedGroupModel
|
||||
@using Disco.Services.Interop.ActiveDirectory;
|
||||
<h5>@(Model.CategoryDescription)</h5>
|
||||
<div class="Config_LinkedGroup_Instance">
|
||||
<div class="infoBox">
|
||||
<p class="fa-p">
|
||||
<i class="fa fa-fw fa-info-circle"></i>@Model.Description
|
||||
</p>
|
||||
</div>
|
||||
@{
|
||||
ADGroup group = null;
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
group = Model.ManagedGroup.GetGroup();
|
||||
}
|
||||
if (Model.CanConfigure)
|
||||
{
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
if (group != null)
|
||||
{
|
||||
<div class="code" title="@group.Id">
|
||||
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
||||
</div>
|
||||
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" 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>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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 class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="@(Model.ManagedGroup.Configuration.GroupId)" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Change Link</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<button class="button small Config_LinkedGroup_LinkButton" data-linkedgroupid="" data-linkedroupdescription="@(Model.CategoryDescription)" data-linkedroupupdateurl="@(Model.UpdateUrl)">Link Group</button>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
if (group != null)
|
||||
{
|
||||
<div class="code" title="@group.Id">
|
||||
<i class="fa fa-fw fa-lg fa-link success"></i>@group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName)
|
||||
</div>
|
||||
}
|
||||
else
|
||||
{
|
||||
<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>
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="smallMessage"><i class="fa fa-fw fa-lg fa-unlink information"></i>No Group Linked</div>
|
||||
}
|
||||
}
|
||||
}
|
||||
</div>
|
||||
@@ -0,0 +1,416 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.Shared
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
|
||||
#line 2 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
using Disco.Services.Interop.ActiveDirectory;
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/LinkedGroupInstance.cshtml")]
|
||||
public partial class LinkedGroupInstance : Disco.Services.Web.WebViewPage<Disco.Web.Areas.Config.Models.Shared.LinkedGroupModel>
|
||||
{
|
||||
public LinkedGroupInstance()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<h5>");
|
||||
|
||||
|
||||
#line 3 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</h5>\r\n<div");
|
||||
|
||||
WriteLiteral(" class=\"Config_LinkedGroup_Instance\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"infoBox\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"fa-p\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-info-circle\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 7 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.Description);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </p>\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
|
||||
#line 10 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
|
||||
ADGroup group = null;
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
group = Model.ManagedGroup.GetGroup();
|
||||
}
|
||||
if (Model.CanConfigure)
|
||||
{
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
if (group != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 680), Tuple.Create("\"", 697)
|
||||
|
||||
#line 22 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 688), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 688), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 23 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
WriteLiteral(" <button");
|
||||
|
||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupid=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 25 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">Change Link</button>\r\n");
|
||||
|
||||
WriteLiteral(" <a");
|
||||
|
||||
WriteAttribute("href", Tuple.Create(" href=\"", 1113), Tuple.Create("\"", 1227)
|
||||
|
||||
#line 26 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 1120), Tuple.Create<System.Object, System.Int32>(Url.Action(MVC.API.System.SyncActiveDirectoryManagedGroup(Model.ManagedGroup.Key, Context.Request.Path))
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 1120), false)
|
||||
);
|
||||
|
||||
WriteLiteral(" class=\"button small\"");
|
||||
|
||||
WriteLiteral(">Synchronize Now</a>\r\n");
|
||||
|
||||
|
||||
#line 27 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code error\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
||||
|
||||
WriteLiteral("></i>Group Not Found: <strong");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 31 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</strong>\r\n </div> \r\n");
|
||||
|
||||
WriteLiteral(" <button");
|
||||
|
||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupid=\"");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 33 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">Change Link</button>\r\n");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <button");
|
||||
|
||||
WriteLiteral(" class=\"button small Config_LinkedGroup_LinkButton\"");
|
||||
|
||||
WriteLiteral(" data-linkedgroupid=\"\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupdescription=\"");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.CategoryDescription);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(" data-linkedroupupdateurl=\"");
|
||||
|
||||
|
||||
#line 38 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.UpdateUrl);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\"");
|
||||
|
||||
WriteLiteral(">Link Group</button>\r\n");
|
||||
|
||||
|
||||
#line 39 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Model.ManagedGroup != null)
|
||||
{
|
||||
if (group != null)
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteAttribute("title", Tuple.Create(" title=\"", 2271), Tuple.Create("\"", 2288)
|
||||
|
||||
#line 47 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
, Tuple.Create(Tuple.Create("", 2279), Tuple.Create<System.Object, System.Int32>(group.Id
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
, 2279), false)
|
||||
);
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-link success\"");
|
||||
|
||||
WriteLiteral("></i>");
|
||||
|
||||
|
||||
#line 48 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(group.Domain.FriendlyDistinguishedNamePath(group.DistinguishedName));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n </div>\r\n");
|
||||
|
||||
|
||||
#line 50 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"code error\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink error\"");
|
||||
|
||||
WriteLiteral("></i>Group Not Found: <strong");
|
||||
|
||||
WriteLiteral(" class=\"code\"");
|
||||
|
||||
WriteLiteral(">");
|
||||
|
||||
|
||||
#line 54 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
Write(Model.ManagedGroup.Configuration.GroupId);
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("</strong>\r\n </div> \r\n");
|
||||
|
||||
|
||||
#line 56 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral(" <div");
|
||||
|
||||
WriteLiteral(" class=\"smallMessage\"");
|
||||
|
||||
WriteLiteral("><i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-fw fa-lg fa-unlink information\"");
|
||||
|
||||
WriteLiteral("></i>No Group Linked</div>\r\n");
|
||||
|
||||
|
||||
#line 61 "..\..\Areas\Config\Views\Shared\LinkedGroupInstance.cshtml"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\r\n</div>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
@@ -0,0 +1,89 @@
|
||||
<div id="Config_LinkedGroup_Dialog" title="Linked Group" class="dialog">
|
||||
<h3 id="Config_LinkedGroup_Title"></h3>
|
||||
<div class="infoBox error">
|
||||
<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.
|
||||
</p>
|
||||
</div>
|
||||
<form action="#" method="post">
|
||||
<div class="input">
|
||||
<label for="Config_LinkedGroup_Id">Linked Group: </label>
|
||||
<input id="Config_LinkedGroup_Id" type="text" name="GroupId" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var dialog;
|
||||
var dialogGroupId;
|
||||
var dialogTitle;
|
||||
|
||||
function showDialog(groupId, updateUrl, title) {
|
||||
if (dialog == null) {
|
||||
dialog = $('#Config_LinkedGroup_Dialog').dialog({
|
||||
width: 450,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
dialogGroupId = $('#Config_LinkedGroup_Id');
|
||||
dialogGroupId.focus(function () { $(this).select(); });
|
||||
dialogGroupId.autocomplete({
|
||||
source: '@(Url.Action(MVC.API.System.SearchGroupSubjects()))',
|
||||
minLength: 2,
|
||||
select: function (e, ui) {
|
||||
dialogGroupId.val(ui.item.Id);
|
||||
return false;
|
||||
}
|
||||
}).data('ui-autocomplete')._renderItem = function (ul, item) {
|
||||
return $("<li>")
|
||||
.data("item.autocomplete", item)
|
||||
.append("<a><strong>" + item.Name + "</strong><br>" + item.Id + " (" + item.Type + ")</a>")
|
||||
.appendTo(ul);
|
||||
};
|
||||
|
||||
dialogTitle = $('#Config_LinkedGroup_Title');
|
||||
}
|
||||
|
||||
var dialogButtons = {};
|
||||
if (!!groupId) {
|
||||
dialogButtons['Remove Link'] = function () {
|
||||
$(this).dialog('disable');
|
||||
dialogGroupId.val('');
|
||||
dialogGroupId.closest('form').attr('action', updateUrl).submit();
|
||||
}
|
||||
}
|
||||
dialogButtons[(!!groupId ? 'Save Changes' : 'Link Group')] = function () {
|
||||
if (!dialogGroupId.val()) {
|
||||
alert('A Linked Group must be specified');
|
||||
return;
|
||||
}
|
||||
$(this).dialog('disable');
|
||||
dialogGroupId.closest('form').attr('action', updateUrl).submit();
|
||||
}
|
||||
dialogButtons['Cancel'] = function () {
|
||||
$(this).dialog('close');
|
||||
};
|
||||
|
||||
dialogGroupId.val(groupId);
|
||||
dialogTitle.text(title);
|
||||
dialog.dialog('option', 'buttons', dialogButtons);
|
||||
dialog.dialog('option', 'title', 'Linked Group: ' + title);
|
||||
dialog.dialog('open');
|
||||
}
|
||||
|
||||
$(document).on('click', '.Config_LinkedGroup_LinkButton', function () {
|
||||
$this = $(this);
|
||||
|
||||
var configuredGroupId = $this.attr('data-linkedgroupid');
|
||||
var description = $this.attr('data-linkedroupdescription');
|
||||
var updateUrl = $this.attr('data-linkedroupupdateurl');
|
||||
|
||||
showDialog(configuredGroupId, updateUrl, description);
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,160 @@
|
||||
#pragma warning disable 1591
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.34014
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace Disco.Web.Areas.Config.Views.Shared
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.Helpers;
|
||||
using System.Web.Mvc;
|
||||
using System.Web.Mvc.Ajax;
|
||||
using System.Web.Mvc.Html;
|
||||
using System.Web.Routing;
|
||||
using System.Web.Security;
|
||||
using System.Web.UI;
|
||||
using System.Web.WebPages;
|
||||
using Disco;
|
||||
using Disco.BI.Extensions;
|
||||
using Disco.Models.Repository;
|
||||
using Disco.Services;
|
||||
using Disco.Services.Authorization;
|
||||
using Disco.Services.Web;
|
||||
using Disco.Web;
|
||||
using Disco.Web.Extensions;
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCodeAttribute("RazorGenerator", "2.0.0.0")]
|
||||
[System.Web.WebPages.PageVirtualPathAttribute("~/Areas/Config/Views/Shared/LinkedGroupShared.cshtml")]
|
||||
public partial class LinkedGroupShared : Disco.Services.Web.WebViewPage<dynamic>
|
||||
{
|
||||
public LinkedGroupShared()
|
||||
{
|
||||
}
|
||||
public override void Execute()
|
||||
{
|
||||
WriteLiteral("<div");
|
||||
|
||||
WriteLiteral(" id=\"Config_LinkedGroup_Dialog\"");
|
||||
|
||||
WriteLiteral(" title=\"Linked Group\"");
|
||||
|
||||
WriteLiteral(" class=\"dialog\"");
|
||||
|
||||
WriteLiteral(">\r\n <h3");
|
||||
|
||||
WriteLiteral(" id=\"Config_LinkedGroup_Title\"");
|
||||
|
||||
WriteLiteral("></h3>\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"infoBox error\"");
|
||||
|
||||
WriteLiteral(">\r\n <p");
|
||||
|
||||
WriteLiteral(" class=\"fa-p\"");
|
||||
|
||||
WriteLiteral(">\r\n <i");
|
||||
|
||||
WriteLiteral(" class=\"fa fa-exclamation-circle\"");
|
||||
|
||||
WriteLiteral(@"></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.
|
||||
</p>
|
||||
</div>
|
||||
<form");
|
||||
|
||||
WriteLiteral(" action=\"#\"");
|
||||
|
||||
WriteLiteral(" method=\"post\"");
|
||||
|
||||
WriteLiteral(">\r\n <div");
|
||||
|
||||
WriteLiteral(" class=\"input\"");
|
||||
|
||||
WriteLiteral(">\r\n <label");
|
||||
|
||||
WriteLiteral(" for=\"Config_LinkedGroup_Id\"");
|
||||
|
||||
WriteLiteral(">Linked Group: </label>\r\n <input");
|
||||
|
||||
WriteLiteral(" id=\"Config_LinkedGroup_Id\"");
|
||||
|
||||
WriteLiteral(" type=\"text\"");
|
||||
|
||||
WriteLiteral(" name=\"GroupId\"");
|
||||
|
||||
WriteLiteral(@" />
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
var dialog;
|
||||
var dialogGroupId;
|
||||
var dialogTitle;
|
||||
|
||||
function showDialog(groupId, updateUrl, title) {
|
||||
if (dialog == null) {
|
||||
dialog = $('#Config_LinkedGroup_Dialog').dialog({
|
||||
width: 450,
|
||||
resizable: false,
|
||||
modal: true,
|
||||
autoOpen: false
|
||||
});
|
||||
|
||||
dialogGroupId = $('#Config_LinkedGroup_Id');
|
||||
dialogGroupId.focus(function () { $(this).select(); });
|
||||
dialogGroupId.autocomplete({
|
||||
source: '");
|
||||
|
||||
|
||||
#line 34 "..\..\Areas\Config\Views\Shared\LinkedGroupShared.cshtml"
|
||||
Write(Url.Action(MVC.API.System.SearchGroupSubjects()));
|
||||
|
||||
|
||||
#line default
|
||||
#line hidden
|
||||
WriteLiteral("\',\r\n minLength: 2,\r\n select: function (e, u" +
|
||||
"i) {\r\n dialogGroupId.val(ui.item.Id);\r\n " +
|
||||
" return false;\r\n }\r\n }).data(\'ui-autocomp" +
|
||||
"lete\')._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_Title\');\r\n }\r\n\r\n " +
|
||||
" var dialogButtons = {};\r\n if (!!groupId) {\r\n " +
|
||||
" dialogButtons[\'Remove Link\'] = function () {\r\n $(this).dial" +
|
||||
"og(\'disable\');\r\n dialogGroupId.val(\'\');\r\n " +
|
||||
"dialogGroupId.closest(\'form\').attr(\'action\', updateUrl).submit();\r\n " +
|
||||
" }\r\n }\r\n dialogButtons[(!!groupId ? \'Save Changes\' : \'Li" +
|
||||
"nk Group\')] = function () {\r\n if (!dialogGroupId.val()) {\r\n " +
|
||||
" alert(\'A Linked Group must be specified\');\r\n re" +
|
||||
"turn;\r\n }\r\n $(this).dialog(\'disable\');\r\n " +
|
||||
" dialogGroupId.closest(\'form\').attr(\'action\', updateUrl).submit();\r\n " +
|
||||
" }\r\n dialogButtons[\'Cancel\'] = function () {\r\n $(t" +
|
||||
"his).dialog(\'close\');\r\n };\r\n\r\n dialogGroupId.val(groupId);" +
|
||||
"\r\n dialogTitle.text(title);\r\n dialog.dialog(\'option\', \'but" +
|
||||
"tons\', dialogButtons);\r\n dialog.dialog(\'option\', \'title\', \'Linked Gro" +
|
||||
"up: \' + title);\r\n dialog.dialog(\'open\');\r\n }\r\n\r\n $(docu" +
|
||||
"ment).on(\'click\', \'.Config_LinkedGroup_LinkButton\', function () {\r\n $" +
|
||||
"this = $(this);\r\n\r\n var configuredGroupId = $this.attr(\'data-linkedgr" +
|
||||
"oupid\');\r\n var description = $this.attr(\'data-linkedroupdescription\')" +
|
||||
";\r\n var updateUrl = $this.attr(\'data-linkedroupupdateurl\');\r\n\r\n " +
|
||||
" showDialog(configuredGroupId, updateUrl, description);\r\n\r\n retu" +
|
||||
"rn false;\r\n });\r\n });\r\n</script>\r\n");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
#pragma warning restore 1591
|
||||
Reference in New Issue
Block a user