v1.1.8
This commit is contained in:
@@ -149,11 +149,15 @@ namespace Saxonite.Net.Core.Web.Base.App
|
|||||||
private Dictionary<Sax.CodeType, List<TypeCodeDesc>> codeTypeCache { get; } = new Dictionary<Sax.CodeType, List<TypeCodeDesc>>();
|
private Dictionary<Sax.CodeType, List<TypeCodeDesc>> codeTypeCache { get; } = new Dictionary<Sax.CodeType, List<TypeCodeDesc>>();
|
||||||
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
|
public List<TypeCodeDesc> GetCodesOfType(Sax.CodeType codeType)
|
||||||
{
|
{
|
||||||
List<TypeCodeDesc> codes = codeTypeCache.GetValue(codeType, null);
|
List<TypeCodeDesc> codes = null;
|
||||||
if (codes == null)
|
lock (codeTypeCache)
|
||||||
{
|
{
|
||||||
codes = SaxSystem.GetCodesOfType(codeType);
|
codes = codeTypeCache.GetValue(codeType, null);
|
||||||
codeTypeCache.Add(codeType, codes);
|
if (codes == null)
|
||||||
|
{
|
||||||
|
codes = SaxSystem.GetCodesOfType(codeType);
|
||||||
|
codeTypeCache.Add(codeType, codes);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return codes;
|
return codes;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -289,7 +289,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc yesNo in YesNoCodes)
|
foreach (TypeCodeDesc yesNo in YesNoCodes)
|
||||||
values.Add(new SelectListItem(yesNo.Code, Localiser.GetYesNoCaption((Sax.YesNo)yesNo.Type)));
|
values.Add(new SelectListItem(Localiser.GetYesNoCaption((Sax.YesNo)yesNo.Type), yesNo.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
values.Add(new SelectListItem("Default", ""));
|
values.Add(new SelectListItem("Default", ""));
|
||||||
foreach (TypeCodeDesc sportSpecialityLabel in SportSpecialityLabelCodes)
|
foreach (TypeCodeDesc sportSpecialityLabel in SportSpecialityLabelCodes)
|
||||||
values.Add(new SelectListItem(sportSpecialityLabel.Code, Localiser.GetSportSpecialityLabelCaption((Sax.SportSpecialityLabel)sportSpecialityLabel.Type)));
|
values.Add(new SelectListItem(Localiser.GetSportSpecialityLabelCaption((Sax.SportSpecialityLabel)sportSpecialityLabel.Type), sportSpecialityLabel.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -314,7 +314,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc sportParticipation in SportParticipationCodes)
|
foreach (TypeCodeDesc sportParticipation in SportParticipationCodes)
|
||||||
values.Add(new SelectListItem(sportParticipation.Code, Localiser.GetSportParticipationCaption((Sax.SportParticipation)sportParticipation.Type)));
|
values.Add(new SelectListItem(Localiser.GetSportParticipationCaption((Sax.SportParticipation)sportParticipation.Type), sportParticipation.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -326,7 +326,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc sportOfficiating in SportOfficiatingCodes)
|
foreach (TypeCodeDesc sportOfficiating in SportOfficiatingCodes)
|
||||||
values.Add(new SelectListItem(sportOfficiating.Code, Localiser.GetSportOfficiatingCaption((Sax.SportOfficiating)sportOfficiating.Type)));
|
values.Add(new SelectListItem(Localiser.GetSportOfficiatingCaption((Sax.SportOfficiating)sportOfficiating.Type), sportOfficiating.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -338,7 +338,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc organisationType in RegionTypeCodes.FindAll(item => item.Type != (int)Sax.RegionType.Universe && item.Type != (int)Sax.RegionType.Galaxy))
|
foreach (TypeCodeDesc organisationType in RegionTypeCodes.FindAll(item => item.Type != (int)Sax.RegionType.Universe && item.Type != (int)Sax.RegionType.Galaxy))
|
||||||
values.Add(new SelectListItem(organisationType.Code, Localiser.GetRegionTypeCaption((Sax.RegionType)organisationType.Type)));
|
values.Add(new SelectListItem(Localiser.GetRegionTypeCaption((Sax.RegionType)organisationType.Type), organisationType.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -356,7 +356,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc organisationType in OrganisationTypeCodes)
|
foreach (TypeCodeDesc organisationType in OrganisationTypeCodes)
|
||||||
values.Add(new SelectListItem(organisationType.Code, Localiser.GetOrganisationTypeCaption((Sax.OrganisationType)organisationType.Type)));
|
values.Add(new SelectListItem(Localiser.GetOrganisationTypeCaption((Sax.OrganisationType)organisationType.Type), organisationType.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -368,7 +368,7 @@ namespace Saxonite.Net.Core.Web.Base.Models
|
|||||||
{
|
{
|
||||||
List<SelectListItem> values = new List<SelectListItem>();
|
List<SelectListItem> values = new List<SelectListItem>();
|
||||||
foreach (TypeCodeDesc organisationCategory in OrganisationCategoryCodes)
|
foreach (TypeCodeDesc organisationCategory in OrganisationCategoryCodes)
|
||||||
values.Add(new SelectListItem(organisationCategory.Code, Localiser.GetOrganisationCategoryCaption((Sax.OrganisationCategory)organisationCategory.Type)));
|
values.Add(new SelectListItem(Localiser.GetOrganisationCategoryCaption((Sax.OrganisationCategory)organisationCategory.Type), organisationCategory.Code));
|
||||||
return values;
|
return values;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Paging.
|
// Paging.
|
||||||
Model_Organisation model = new Model_Organisation(Localiser);
|
Model_Organisation model = new Model_Organisation(Localiser);
|
||||||
model.Paging.PageNo = 1;
|
model.Paging.PageNo = 1;
|
||||||
model.Paging.PageLength = 6;
|
model.Paging.PageLength = 8;
|
||||||
|
|
||||||
// Default status.
|
// Default status.
|
||||||
if (sta.StartsWithCI("Awa"))
|
if (sta.StartsWithCI("Awa"))
|
||||||
|
|||||||
@@ -109,8 +109,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
|
|
||||||
// Item filter.
|
// Item filter.
|
||||||
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||||
prmUserAccount.UserAccountFilter = model.Filter.User;
|
prmUserAccount.UserFilterPartial = model.Filter.User;
|
||||||
prmUserAccount.StatusCat = SaxUserAccount.StatusCat.NotDeleted;
|
prmUserAccount.SportIdsIncluded.AddId(model.Filter.UserSportId.ToSysId());
|
||||||
|
prmUserAccount.RegionIdsIncluded.AddId(model.Filter.UserRegionId.ToSysId());
|
||||||
|
prmUserAccount.StatusCat = model.Filter.UserStatusCategoryCode != null ? model.FilterUserStatusCategory : SaxUserAccount.StatusCat.NotDeleted;
|
||||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
||||||
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
using Saxonite.Net.Core.Web.Admin.Models;
|
using Saxonite.Net.Core.Web.Admin.Models;
|
||||||
using Saxonite.Net.Core.Web.Base.App;
|
using Saxonite.Net.Core.Web.Base.App;
|
||||||
using Saxonite.Net.Core.Web.Base.Controllers;
|
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||||
|
using Saxonite.Net.Standard.Base.Bus;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics;
|
using System.Diagnostics;
|
||||||
@@ -23,7 +25,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
public IActionResult Index()
|
public IActionResult Index(String sta)
|
||||||
{
|
{
|
||||||
// Validate session.
|
// Validate session.
|
||||||
if (!ValidUserSession)
|
if (!ValidUserSession)
|
||||||
@@ -34,6 +36,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
model.Paging.PageNo = 1;
|
model.Paging.PageNo = 1;
|
||||||
model.Paging.PageLength = 12;
|
model.Paging.PageLength = 12;
|
||||||
|
|
||||||
|
// Default status.
|
||||||
|
if (sta.StartsWithCI("Awa"))
|
||||||
|
model.Filter.UserStatusCategoryCode = nameof(SaxUserAccount.StatusCat.AwaitingOnly);
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// List configuration.
|
// Organisation filter properties.
|
||||||
public class FilterData
|
public class FilterData
|
||||||
{
|
{
|
||||||
public String Organisation { get; set; }
|
public String Organisation { get; set; }
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using Sarand.Net.Standard.Base.App;
|
using Microsoft.AspNetCore.Mvc.Rendering;
|
||||||
|
using Sarand.Net.Standard.Base.App;
|
||||||
using Sarand.Net.Standard.Base.Bus;
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
using Sarand.Net.Standard.Base.Core;
|
using Sarand.Net.Standard.Base.Core;
|
||||||
using Sarand.Net.Standard.Base.Helpers;
|
using Sarand.Net.Standard.Base.Helpers;
|
||||||
@@ -29,12 +30,34 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// User list configuration.
|
// User filter properties.
|
||||||
public class FilterData
|
public class FilterData
|
||||||
{
|
{
|
||||||
public String User { get; set; }
|
public String User { get; set; }
|
||||||
|
public String UserSportId { get; set; }
|
||||||
|
public String UserRegionId { get; set; }
|
||||||
|
public String UserStatusCategoryCode { get; set; }
|
||||||
}
|
}
|
||||||
public FilterData Filter { get; } = new FilterData();
|
public FilterData Filter { get; } = new FilterData();
|
||||||
|
public SaxUserAccount.StatusCat FilterUserStatusCategory
|
||||||
|
{
|
||||||
|
get { return EnumUtil.ParseEnum(Filter.UserStatusCategoryCode, SaxUserAccount.StatusCat.Any); }
|
||||||
|
}
|
||||||
|
/// <summary>User Status Categories for filter.</summary>
|
||||||
|
public IEnumerable<SelectListItem> UserFilterStatusCategoriesForSelect
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
List<CodeDesc> statusCategories = new List<CodeDesc>();
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.Any.ToString(), Localiser["label.any"]);
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.AwaitingOnly.ToString(), "Awaiting");
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.ActiveOnly.ToString(), "Active");
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.InactiveOnly.ToString(), "Inactive");
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.NotDeleted.ToString(), "Not deleted");
|
||||||
|
statusCategories.Add(SaxUserAccount.StatusCat.DeletedOnly.ToString(), "Deleted");
|
||||||
|
return new SelectList(statusCategories, "Code", "Desc", SaxUserAccount.StatusCat.Any.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// User properties.
|
// User properties.
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
ViewData["Title"] = "Organisations";
|
ViewData["Title"] = "Organisations";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="sax-page-organisations">
|
<div class="sax-panel Organisations">
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
sax.lbl.edit = '@(Localiser.GetJavascriptText("label.edit"))';
|
sax.lbl.edit = '@(Localiser.GetJavascriptText("label.edit"))';
|
||||||
@@ -36,59 +36,59 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-content">
|
||||||
|
@* Organisation filter - name etc. *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
||||||
|
<div class="col-sm-7">
|
||||||
|
@Html.TextBoxFor(model => model.Filter.Organisation, new { @id = "", @class = "FilterOrganisation", @maxlength = "32" })
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-content">
|
@* Organisation Category *@
|
||||||
@* Organisation filter - name etc. *@
|
<div class="row pb4">
|
||||||
<div class="row pb4">
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.category"]</div>
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.search"]</div>
|
<div class="col-sm-7">
|
||||||
<div class="col-sm-7">
|
@Html.DropDownListFor(model => model.Filter.OrganisationCategoryCode, Model.OrganisationCategoriesForSelect, Localiser["label.any"], new { @id = "", @class = "FilterOrganisationCategory sax-select" })
|
||||||
@Html.TextBoxFor(model => model.Filter.Organisation, new { @id = "", @class = "FilterOrganisation", @maxlength = "32" })
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
@* Organisation Category *@
|
</div>
|
||||||
<div class="row pb4">
|
@* Organisation sport *@
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.category"]</div>
|
<div class="row pb4">
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
||||||
@Html.DropDownListFor(model => model.Filter.OrganisationCategoryCode, Model.OrganisationCategoriesForSelect, Localiser["label.any"], new { @id = "", @class = "FilterOrganisationCategory sax-select" })
|
<div class="col-sm-7">
|
||||||
</div>
|
<div class="row">
|
||||||
</div>
|
@Html.HiddenFor(model => model.Filter.OrganisationSportId, new { @id = "", @class = "FilterOrganisationSportId" })
|
||||||
@* Organisation sport *@
|
<div class="col"><input type="text" class="FilterOrganisationSportCaption sax-input" readonly="readonly" /> </div>
|
||||||
<div class="row pb4">
|
<div class="fixed row">
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
<div class="sax-action FilterSportSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
<div class="col-sm-7">
|
<div class="sax-action FilterSportClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
<div class="row">
|
|
||||||
@Html.HiddenFor(model => model.Filter.OrganisationSportId, new { @id = "", @class = "FilterOrganisationSportId" })
|
|
||||||
<div class="col"><input type="text" class="FilterOrganisationSportCaption sax-input" readonly="readonly" ondblclick="sax.selectFilterSport()" /> </div>
|
|
||||||
<div class="fixed row">
|
|
||||||
<div class="sax-action" onclick="sax.selectFilterSport();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
|
||||||
<div class="sax-action" onclick="sax.clearFilterSport();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@* Organisation region *@
|
</div>
|
||||||
<div class="row pb4">
|
@* Organisation region *@
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
<div class="row pb4">
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
||||||
<div class="row">
|
<div class="col-sm-7">
|
||||||
@Html.HiddenFor(model => model.Filter.OrganisationRegionId, new { @id = "", @class = "FilterOrganisationRegionId" })
|
<div class="row">
|
||||||
<div class="col"><input type="text" class="FilterOrganisationRegionCaption sax-input" readonly="readonly" ondblclick="sax.selectFilterRegion()" /> </div>
|
@Html.HiddenFor(model => model.Filter.OrganisationRegionId, new { @id = "", @class = "FilterOrganisationRegionId" })
|
||||||
<div class="fixed row">
|
<div class="col"><input type="text" class="FilterOrganisationRegionCaption sax-input" readonly="readonly" /> </div>
|
||||||
<div class="sax-action" onclick="sax.selectFilterRegion();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
<div class="fixed row">
|
||||||
<div class="sax-action" onclick="sax.clearFilterRegion();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
<div class="sax-action FilterRegionSelect"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
</div>
|
<div class="sax-action FilterRegionClear"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@* Organisation Status *@
|
</div>
|
||||||
<div class="row pb4">
|
@* Organisation Status *@
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.status"]</div>
|
<div class="row pb4">
|
||||||
<div class="col-sm-7">
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.status"]</div>
|
||||||
@Html.DropDownListFor(model => model.Filter.OrganisationStatusCategoryCode, Model.OrganisationFilterStatusCategoriesForSelect, new { @id = "", @class = "FilterOrganisationStatusCategory sax-select" })
|
<div class="col-sm-7">
|
||||||
</div>
|
@Html.DropDownListFor(model => model.Filter.OrganisationStatusCategoryCode, Model.OrganisationFilterStatusCategoriesForSelect, new { @id = "", @class = "FilterOrganisationStatusCategory sax-select" })
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-7">
|
<div class="col-md">
|
||||||
|
|
||||||
@* Results Panel *@
|
@* Results Panel *@
|
||||||
<div class="sax-panel-results">
|
<div class="sax-panel-results">
|
||||||
@@ -149,3 +149,5 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<partial name="Panel-OrganisationDialog.cshtml" />
|
<partial name="Panel-OrganisationDialog.cshtml" />
|
||||||
|
<partial name="~/Views/Common/SelectItem.cshtml" />
|
||||||
|
<partial name="Panel-ActivationDialog.cshtml" />
|
||||||
|
|||||||
@@ -85,6 +85,4 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
<partial name="~/Views/Common/SelectItem.cshtml" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -16,29 +16,37 @@
|
|||||||
}
|
}
|
||||||
<div id="dlgOrganisation" class="sax-dialog" title="">
|
<div id="dlgOrganisation" class="sax-dialog" title="">
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisation", @class = "sax-form", @onSubmit = "return false;" }))
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisation", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
{
|
{
|
||||||
@Html.HiddenFor(model => model.OrganisationId, new { @id = "", @class = "OrganisationId" })
|
@Html.HiddenFor(model => model.OrganisationId, new { @id = "", @class = "OrganisationId" })
|
||||||
|
|
||||||
@* Organisation name *@
|
@* Organisation name *@
|
||||||
<div class="sax-form-control OrganisationName">
|
<div class="sax-form-control OrganisationName">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifOrganisationName"><span><span class="required">*</span> @Localiser["label.name"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifOrganisationName"><span>@Localiser["label.name"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
@Html.TextBoxFor(model => model.OrganisationName, new { @id = "ifOrganisationName", @class = "OrganisationName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name) })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
@Html.TextBoxFor(model => model.OrganisationName, new { @id = "ifOrganisationName", @class = "OrganisationName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name) })
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
<div class="col-sm-4"></div>
|
||||||
|
|
||||||
<div class="col-sm-6">
|
<div class="col-sm">
|
||||||
|
|
||||||
@* Organisation category *@
|
@* Organisation category *@
|
||||||
<div class="sax-form-control OrganisationCategory pr4">
|
<div class="sax-form-control OrganisationCategory pr4">
|
||||||
<div class="sax-label">
|
<div class="sax-label">
|
||||||
<label for="cbOrganisationCategory"><span><span class="required">*</span> @Localiser["label.category"]</span></label>
|
<label for="cbOrganisationCategory"><span>@Localiser["label.category"]</span> <span class="required">*</span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
<div class="sax-control">
|
||||||
@Html.DropDownListFor(model => model.OrganisationCategoryValue, Model.OrganisationCategoriesForSelect, Localiser["label.select"], new { @id = "cbOrganisationCategory", @class = "OrganisationCategory sax-select" })
|
@Html.DropDownListFor(model => model.OrganisationCategoryValue, Model.OrganisationCategoriesForSelect, Localiser["label.select"], new { @id = "cbOrganisationCategory", @class = "OrganisationCategory sax-select" })
|
||||||
@@ -53,7 +61,7 @@
|
|||||||
@* Organisation type *@
|
@* Organisation type *@
|
||||||
<div class="sax-form-control OrganisationType">
|
<div class="sax-form-control OrganisationType">
|
||||||
<div class="sax-label">
|
<div class="sax-label">
|
||||||
<label for="cbOrganisationType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
<label for="cbOrganisationType"><span>@Localiser["label.type"]</span> <span class="required">*</span></label>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
<div class="sax-control">
|
||||||
@Html.DropDownListFor(model => model.OrganisationTypeValue, Model.OrganisationTypesForSelect, Localiser["label.select"], new { @id = "cbOrganisationType", @class = "OrganisationType sax-select" })
|
@Html.DropDownListFor(model => model.OrganisationTypeValue, Model.OrganisationTypesForSelect, Localiser["label.select"], new { @id = "cbOrganisationType", @class = "OrganisationType sax-select" })
|
||||||
@@ -67,44 +75,61 @@
|
|||||||
|
|
||||||
@* Organisation sport *@
|
@* Organisation sport *@
|
||||||
<div class="sax-form-control OrganisationSportId">
|
<div class="sax-form-control OrganisationSportId">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifOrganisationSportCaption"><span><span class="required">*</span> @Localiser["label.sport"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifOrganisationSportCaption"><span>@Localiser["label.sport"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
@Html.HiddenFor(model => model.OrganisationSportId, new { @id = "ifOrganisationSportId", @class = "OrganisationSportId" })
|
||||||
|
<div class="col"><input type="text" id="ifOrganisationSportCaption" class="OrganisationSportCaption sax-input" readonly="readonly" ondblclick="sax.selectSport()" /> </div>
|
||||||
|
<div class="fixed"><button id="pbSelectSport" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectSport()">@Localiser["label.select"]</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control row">
|
|
||||||
@Html.HiddenFor(model => model.OrganisationSportId, new { @id = "ifOrganisationSportId", @class = "OrganisationSportId" })
|
|
||||||
<div class="col"><input type="text" id="ifOrganisationSportCaption" class="OrganisationSportCaption sax-input" readonly="readonly" ondblclick="sax.selectSport()" /> </div>
|
|
||||||
<div class="fixed"><button id="pbSelectSport" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectSport()">@Localiser["label.select"]</button></div>
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Organisation region *@
|
@* Organisation region *@
|
||||||
<div class="sax-form-control OrganisationRegionIdCountry">
|
<div class="sax-form-control OrganisationRegionIdCountry">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifOrganisationRegionCaptionCountry"><span><span class="required">*</span> @Localiser["label.country"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifOrganisationRegionCaptionCountry"><span>@Localiser["label.country"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
@Html.HiddenFor(model => model.OrganisationRegionIdCountry, new { @id = "ifOrganisationRegionIdCountry", @class = "OrganisationRegionIdCountry" })
|
||||||
|
<div class="col"><input type="text" id="ifOrganisationRegionCaptionCountry" class="OrganisationRegionCaptionCountry sax-input" readonly="readonly" ondblclick="sax.selectRegion()" /> </div>
|
||||||
|
<div class="fixed"><button id="pbSelectRegion" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectRegion()">@Localiser["label.select"]</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control row">
|
|
||||||
@Html.HiddenFor(model => model.OrganisationRegionIdCountry, new { @id = "ifOrganisationRegionIdCountry", @class = "OrganisationRegionIdCountry" })
|
|
||||||
<div class="col"><input type="text" id="ifOrganisationRegionCaptionCountry" class="OrganisationRegionCaptionCountry sax-input" readonly="readonly" ondblclick="sax.selectRegion()" /> </div>
|
|
||||||
<div class="fixed"><button id="pbSelectRegion" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectRegion()">@Localiser["label.select"]</button></div>
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Organisation status *@
|
@* Organisation status *@
|
||||||
<div class="sax-form-control OrganisationStatus">
|
<div class="sax-form-control OrganisationStatus">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="cbOrganisationStatus"><span><span class="required">*</span> @Localiser["label.status"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="cbOrganisationStatus"><span>@Localiser["label.status"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
<select id="cbOrganisationStatus" class="sax-select OrganisationStatus" name="OrganisationStatusCode"></select>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
<select id="cbOrganisationStatus" class="sax-select OrganisationStatus" name="OrganisationStatusCode"></select>
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<div class="spacer"></div>
|
||||||
<partial name="~/Views/Common/SelectItem.cshtml" />
|
|
||||||
<partial name="Panel-ActivationDialog.cshtml" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
|
|
||||||
@* Scripts *@
|
@* Scripts *@
|
||||||
<script>
|
<script>
|
||||||
var sax = sax || { page: {}, url: {}, links: {}, form: {}, data: {}, ajax: {}, msg: {}, lbl: {}, dlg: { title: {}, btn: {} }, $frm: {}, $dlg: {}, $pnl: {} };
|
var sax = sax || { page: {}, mdl: {}, url: {}, links: {}, form: {}, data: {}, ajax: {}, msg: {}, lbl: {}, dlg: { title: {}, btn: {} }, $frm: {}, $dlg: {}, $pnl: {} };
|
||||||
sax.url.base = '@Model.RedirectLocation.Base';
|
sax.url.base = '@Model.RedirectLocation.Base';
|
||||||
sax.url.home = '@Model.RedirectLocation.Home';
|
sax.url.home = '@Model.RedirectLocation.Home';
|
||||||
sax.url.sessionExpired = '@Model.RedirectLocation.Home_SessionExpired';
|
sax.url.sessionExpired = '@Model.RedirectLocation.Home_SessionExpired';
|
||||||
|
|||||||
@@ -14,95 +14,145 @@
|
|||||||
sax.lbl.emails= '@(Localiser.GetJavascriptText("label.emails"))';
|
sax.lbl.emails= '@(Localiser.GetJavascriptText("label.emails"))';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
<div class="row">
|
||||||
{
|
|
||||||
|
<div class="col-md-5 row">
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
|
@* Filter Panel *@
|
||||||
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserFilter", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
|
{
|
||||||
|
|
||||||
|
<div class="sax-panel-filter">
|
||||||
|
@* Header - Page caption, paging controls, actions. *@
|
||||||
|
<div class="sax-header row">
|
||||||
|
<div class="col"><div class="sax-caption">@Localiser["user.caption.users"]</div></div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="col">
|
||||||
|
<partial name="~/Views/Common/ResultsPaging.cshtml" />
|
||||||
|
</div>
|
||||||
|
<div class="fixed">
|
||||||
|
@* Burger menu *@
|
||||||
|
<ul class="nav navbar-nav navbar-dark navbar-right sax-burger">
|
||||||
|
<li class="dropdown-toggle caret-off">
|
||||||
|
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-content">
|
||||||
|
@* User filter - email, name etc. *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["user.caption.user"]</div>
|
||||||
|
<div class="col-sm-7">@Html.TextBoxFor(model => model.Filter.User, new { @id = "ifFilterUser", @class = "FilterUser", @maxlength = "32" })</div>
|
||||||
|
</div>
|
||||||
|
@* User sport *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
||||||
|
<div class="col-sm-7">
|
||||||
|
<div class="row">
|
||||||
|
@Html.HiddenFor(model => model.Filter.UserSportId, new { @id = "", @class = "FilterUserSportId" })
|
||||||
|
<div class="col"><input type="text" class="FilterUserSportCaption sax-input" readonly="readonly" ondblclick="sax.selectFilterSport()" /> </div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action" onclick="sax.selectFilterSport();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
|
<div class="sax-action" onclick="sax.clearFilterSport();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@* User region *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
||||||
|
<div class="col-sm-7">
|
||||||
|
<div class="row">
|
||||||
|
@Html.HiddenFor(model => model.Filter.UserRegionId, new { @id = "", @class = "FilterUserRegionId" })
|
||||||
|
<div class="col"><input type="text" class="FilterUserRegionCaption sax-input" readonly="readonly" ondblclick="sax.selectFilterRegion()" /> </div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action" onclick="sax.selectFilterRegion();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
|
<div class="sax-action" onclick="sax.clearFilterRegion();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@* Organisation Status *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["label.status"]</div>
|
||||||
|
<div class="col-sm-7">
|
||||||
|
@Html.DropDownListFor(model => model.Filter.UserStatusCategoryCode, Model.UserFilterStatusCategoriesForSelect, new { @id = "", @class = "FilterUserStatusCategory sax-select" })
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Filter element templates *@
|
||||||
|
<div class="sax-panel-item-template">
|
||||||
|
@* Burger dropdown item template - ul is ignored *@
|
||||||
|
<ul class="sax-dropdown-menu UserFilter">
|
||||||
|
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
@* Filter Panel *@
|
|
||||||
<div class="sax-panel-filter">
|
|
||||||
@* Header - Page caption, paging controls, actions. *@
|
|
||||||
<div class="sax-header row">
|
|
||||||
<div class="col"><div class="sax-caption">@Localiser["user.caption.users"]</div></div>
|
|
||||||
<div class="fixed row">
|
|
||||||
<div class="col">
|
|
||||||
<partial name="~/Views/Common/ResultsPaging.cshtml" />
|
|
||||||
</div>
|
</div>
|
||||||
<div class="fixed">
|
}
|
||||||
@* Burger menu *@
|
|
||||||
<ul class="nav navbar-nav navbar-dark navbar-right sax-burger">
|
|
||||||
<li class="dropdown-toggle caret-off">
|
|
||||||
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
|
||||||
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="sax-content">
|
|
||||||
<div class="row">
|
|
||||||
@* User filter - email, name etc. *@
|
|
||||||
<div class="col-sm-5 sax-label text-left text-sm-right">@Localiser["user.caption.user"]</div>
|
|
||||||
<div class="col-sm-7">@Html.TextBoxFor(model => model.Filter.User, new { @id = "ifFilterUser", @class = "FilterUser", @maxlength = "32" })</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Filter element templates *@
|
@* Separate filter from results when alondside each other. *@
|
||||||
<div class="sax-panel-item-template">
|
<div class="fixed"><div class="d-none d-md-block" style="width:8px;"></div></div>
|
||||||
@* Burger dropdown item template - ul is ignored *@
|
|
||||||
<ul class="sax-dropdown-menu UserFilter">
|
|
||||||
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
}
|
|
||||||
|
|
||||||
@* Results Panel *@
|
<div class="col-md">
|
||||||
<div class="sax-panel-results">
|
|
||||||
<div class="sax-panel-messages"></div>
|
|
||||||
<div class="sax-panel-item-list"></div>
|
|
||||||
|
|
||||||
@* Element templates *@
|
@* Results Panel *@
|
||||||
<div class="sax-panel-item-template">
|
<div class="sax-panel-results">
|
||||||
|
<div class="sax-panel-messages"></div>
|
||||||
|
<div class="sax-panel-item-list"></div>
|
||||||
|
|
||||||
@* User item template *@
|
@* Element templates *@
|
||||||
<div class="sax-panel-item User">
|
<div class="sax-panel-item-template">
|
||||||
<div class="sax-header row">
|
|
||||||
<div class="col">
|
@* User item template *@
|
||||||
@* User email *@
|
<div class="sax-panel-item User">
|
||||||
<div class="sax-caption"><div class="sax-action sax-item-update UserEmailAddress"></div></div>
|
<div class="sax-header row">
|
||||||
</div>
|
<div class="col">
|
||||||
<div class="fixed sax-actions">
|
@* User email *@
|
||||||
@* Burger menu *@
|
<div class="sax-caption"><div class="sax-action sax-item-update UserEmailAddress"></div></div>
|
||||||
<ul class="nav navbar-nav navbar-light navbar-right sax-burger">
|
</div>
|
||||||
<li class="dropdown-toggle caret-off">
|
<div class="fixed sax-actions">
|
||||||
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
@* Burger menu *@
|
||||||
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
<ul class="nav navbar-nav navbar-light navbar-right sax-burger">
|
||||||
</li>
|
<li class="dropdown-toggle caret-off">
|
||||||
</ul>
|
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||||
</div>
|
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||||
</div>
|
</li>
|
||||||
<div class="sax-content">
|
</ul>
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="col-sm-4"><span class="UserDisplayName"></span></div>
|
</div>
|
||||||
<div class="col-sm-4"><div>Roles: <span class="UserRoleCount"></span></div></div>
|
<div class="sax-content">
|
||||||
<div class="col-sm-4 right"><div class="StatusDesc"></div></div>
|
<div class="row">
|
||||||
</div>
|
<div class="col-sm-4"><span class="UserDisplayName"></span></div>
|
||||||
<div class="row">
|
<div class="col-sm-4"><div>Roles: <span class="UserRoleCount"></span></div></div>
|
||||||
<div class="col-sm-4"></div>
|
<div class="col-sm-4 right"><div class="StatusDesc"></div></div>
|
||||||
<div class="col-sm-4"><div class=""></div></div>
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-4"></div>
|
||||||
|
<div class="col-sm-4"><div class=""></div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@* Burger dropdown item template - ul is ignored *@
|
||||||
|
<ul class="sax-dropdown-menu User">
|
||||||
|
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* Burger dropdown item template - ul is ignored *@
|
|
||||||
<ul class="sax-dropdown-menu User">
|
|
||||||
<li class="sax-dropdown-item sax-action"><div class="sax-label">XXX</div></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<partial name="Panel-UserDialog.cshtml" />
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<partial name="Panel-UserDialog.cshtml" />
|
||||||
|
<partial name="~/Views/Common/SelectItem.cshtml" />
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
@Html.HiddenFor(model => model.UserAccountId, new { @class = "UserAccountId" })
|
@Html.HiddenFor(model => model.UserAccountId, new { @class = "UserAccountId" })
|
||||||
}
|
}
|
||||||
<div id="dlgUser" class="sax-dialog" title="">
|
<div id="dlgUser" class="sax-dialog" title="">
|
||||||
|
<div class="spacer"></div>
|
||||||
|
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUser", @class = "sax-form", @onSubmit = "return false;" }))
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUser", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
{
|
{
|
||||||
@@ -23,125 +24,183 @@
|
|||||||
|
|
||||||
@* User email *@
|
@* User email *@
|
||||||
<div class="sax-form-control UserEmailAddress">
|
<div class="sax-form-control UserEmailAddress">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifUserEmailAddress"><span><span class="required">*</span> @Localiser["label.email.address"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifUserEmailAddress"><span>@Localiser["label.email.address"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
@Html.TextBoxFor(model => model.UserEmailAddress, new { @id = "ifUserEmailAddress", @class = "UserEmailAddress sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress) })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
@Html.TextBoxFor(model => model.UserEmailAddress, new { @id = "ifUserEmailAddress", @class = "UserEmailAddress sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress) })
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
/* Title */
|
/* Title */
|
||||||
<div class="sax-form-control UserTitle">
|
<div class="sax-form-control UserTitle">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="cbUserTitle"><span><span class="required"></span> @Localiser["label.title"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="cbUserTitle"><span><span class="required"></span> @Localiser["label.title"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
@Html.DropDownListFor(model => model.UserTitle, Model.TitlesForSelect, Localiser["label.not.specified"], new { @id = "cbUserTitle", @class = "UserTitle sax-select" })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
@Html.DropDownListFor(model => model.UserTitle, Model.TitlesForSelect, Localiser["label.not.specified"], new { @id = "cbUserTitle", @class = "UserTitle sax-select" })
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User first name *@
|
@* User first name *@
|
||||||
<div class="sax-form-control UserFirstName">
|
<div class="sax-form-control UserFirstName">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifUserFirstName"><span><span class="required">*</span> @Localiser["label.first.name"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifUserFirstName"><span>@Localiser["label.first.name"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
@Html.TextBoxFor(model => model.UserFirstName, new { @id = "ifUserFirstName", @class = "UserFirstName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName) })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
@Html.TextBoxFor(model => model.UserFirstName, new { @id = "ifUserFirstName", @class = "UserFirstName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName) })
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User last name *@
|
@* User last name *@
|
||||||
<div class="sax-form-control UserLastName">
|
<div class="sax-form-control UserLastName">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="ifUserLastName"><span><span class="required">*</span> @Localiser["label.last.name"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="ifUserLastName"><span>@Localiser["label.last.name"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
@Html.TextBoxFor(model => model.UserLastName, new { @id = "ifUserLastName", @class = "UserLastName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName) })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
@Html.TextBoxFor(model => model.UserLastName, new { @id = "ifUserLastName", @class = "UserLastName sax-input", @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName) })
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User roles *@
|
@* User roles *@
|
||||||
<div class="sax-form-control UserRoles">
|
<div class="sax-form-control UserRoles">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="lbUserRoles"><span>@Localiser["label.user.roles"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="lbUserRoles"><span>@Localiser["label.user.roles"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
@Html.HiddenFor(model => model.UserRoleCodes, new { @id = "ifUserRoleCodes", @class = "UserRoleCodes sax-input" })
|
||||||
|
<div class="col"><textarea id="ifUserRoles" class="UserRoles sax-input" style="" rows="3" readonly="readonly" onDblClick="sax.selectUserRoles()"></textarea></div>
|
||||||
|
<div class="fixed"><button id="" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectUserRoles()">@Localiser["label.select"]</button></div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control row">
|
|
||||||
@Html.HiddenFor(model => model.UserRoleCodes, new { @id = "ifUserRoleCodes", @class = "UserRoleCodes sax-input" })
|
|
||||||
<div class="col"><textarea id="ifUserRoles" class="UserRoles sax-input" style="" rows="3" readonly="readonly" onDblClick="sax.selectUserRoles()"></textarea></div>
|
|
||||||
<div class="fixed"><button id="" class="sax-button" style="min-width:auto;margin-left:4px;padding:4px 6px" onclick="sax.selectUserRoles()">@Localiser["label.select"]</button></div>
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User status *@
|
@* User status *@
|
||||||
<div class="sax-form-control UserStatus">
|
<div class="sax-form-control UserStatus">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="cbUserStatus"><span><span class="required">*</span> @Localiser["label.status"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for="cbUserStatus"><span>@Localiser["label.status"]</span> <span class="required">*</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
<select id="cbUserStatus" class="sax-select UserStatus" name="UserStatusCode"></select>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
<select id="cbUserStatus" class="sax-select UserStatus" name="UserStatusCode"></select>
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<partial name="~/Views/Common/SelectCode.cshtml" />
|
<partial name="~/Views/Common/SelectCode.cshtml" />
|
||||||
|
|
||||||
<div id="dlgUserEmails" class="sax-dialog" title="">
|
<div id="dlgUserEmails" class="sax-dialog" title="">
|
||||||
|
<div class="spacer"></div>
|
||||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserEmails", @class = "sax-form", @onSubmit = "return false;" }))
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserEmails", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
{
|
{
|
||||||
@Html.HiddenFor(model => model.UserAccountId, new { @class = "UserAccountId" })
|
@Html.HiddenFor(model => model.UserAccountId, new { @class = "UserAccountId" })
|
||||||
|
|
||||||
<div class="sax-para">@Localiser["user.emails.intro"]</div>
|
<div class="sax-para">@Localiser["user.emails.intro"]</div>
|
||||||
|
<div class="spacer2"></div>
|
||||||
|
|
||||||
@* User email *@
|
@* User email *@
|
||||||
<div class="sax-form-control UserEmailAddress">
|
<div class="sax-form-control UserEmailAddress">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label><span>@Localiser["label.email.address"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label><span>@Localiser["label.email.address"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
<input type="text" class="UserEmailAddress sax-input" readonly="readonly" />
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
<input type="text" class="UserEmailAddress sax-input" readonly="readonly" />
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User display name *@
|
@* User display name *@
|
||||||
<div class="sax-form-control UserDisplayName">
|
<div class="sax-form-control UserDisplayName">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label ><span>@Localiser["label.name"]</span></label>
|
<div class="col-sm-4">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label><span>@Localiser["label.name"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control">
|
||||||
|
<input type="text" class="UserDisplayName sax-input" readonly="readonly" />
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-control">
|
|
||||||
<input type="text" class="UserDisplayName sax-input" readonly="readonly" />
|
|
||||||
</div>
|
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@* User emails *@
|
@* User emails *@
|
||||||
<div class="sax-form-control UserEmailTypes">
|
<div class="sax-form-control UserEmailTypes">
|
||||||
<div class="sax-label">
|
<div class="row">
|
||||||
<label for="chkUserEmailRequestPasswordAdmin"><span>@Localiser["label.email.types"]</span></label>
|
<div class="col-sm-4">
|
||||||
</div>
|
<div class="sax-label">
|
||||||
<div class="sax-control">
|
<label for="chkUserEmailRequestPasswordAdmin"><span>@Localiser["label.email.types"]</span></label>
|
||||||
<div class="AcountActivationOnlineOption">
|
</div>
|
||||||
<input type="checkbox" id="chkUserEmailAcountActivationOnline" class="UserEmailAcountActivationOnline" name="UserEmailAcountActivationOnline" value="1" /> <span onclick="$('#chkUserEmailAcountActivationOnline').click()">@Localiser["user.email.account.activation.online"]</span>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="RequestPasswordOnlineOption">
|
<div class="col-sm">
|
||||||
<input type="checkbox" id="chkUserEmailRequestPasswordOnline" class="UserEmailRequestPasswordOnline" name="UserEmailRequestPasswordOnline" value="1" /> <span onclick="$('#chkUserEmailRequestPasswordOnline').click()">@Localiser["user.email.request.password.online"]</span>
|
<div class="sax-control">
|
||||||
</div>
|
<div class="AcountActivationOnlineOption">
|
||||||
<div class="RequestPasswordAdminOption">
|
<input type="checkbox" id="chkUserEmailAcountActivationOnline" class="UserEmailAcountActivationOnline" name="UserEmailAcountActivationOnline" value="1" /> <span onclick="$('#chkUserEmailAcountActivationOnline').click()">@Localiser["user.email.account.activation.online"]</span>
|
||||||
<input type="checkbox" id="chkUserEmailRequestPasswordAdmin" class="UserEmailRequestPasswordAdmin" name="UserEmailRequestPasswordAdmin" value="1" /> <span onclick="$('#chkUserEmailRequestPasswordAdmin').click()">@Localiser["user.email.request.password.admin"]</span>
|
</div>
|
||||||
|
<div class="RequestPasswordOnlineOption">
|
||||||
|
<input type="checkbox" id="chkUserEmailRequestPasswordOnline" class="UserEmailRequestPasswordOnline" name="UserEmailRequestPasswordOnline" value="1" /> <span onclick="$('#chkUserEmailRequestPasswordOnline').click()">@Localiser["user.email.request.password.online"]</span>
|
||||||
|
</div>
|
||||||
|
<div class="RequestPasswordAdminOption">
|
||||||
|
<input type="checkbox" id="chkUserEmailRequestPasswordAdmin" class="UserEmailRequestPasswordAdmin" name="UserEmailRequestPasswordAdmin" value="1" /> <span onclick="$('#chkUserEmailRequestPasswordAdmin').click()">@Localiser["user.email.request.password.admin"]</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sax-message"></div>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
<div class="spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -5,37 +5,38 @@
|
|||||||
(function (win, doc, undef)
|
(function (win, doc, undef)
|
||||||
{
|
{
|
||||||
"use strict";
|
"use strict";
|
||||||
|
let op = sax.mdl.organisations = sax.mdl.organisations || { data: {}, ajax: {} };
|
||||||
|
let $pnl = sax.$pnl, $frm = sax.$frm, $dlg = sax.$dlg;
|
||||||
sax.itemIdPrefix = 'Itm_';
|
sax.itemIdPrefix = 'Itm_';
|
||||||
var $results;
|
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.refreshResults = function (delay)
|
sax.refreshResults = function (delay)
|
||||||
{
|
{
|
||||||
if (!sax.awaitingRefreshResponse)
|
if (!op.awaitingRefreshResponse)
|
||||||
{
|
{
|
||||||
var $items = $('.sax-panel-item-list', $results).fadeOut(200).empty();
|
var $items = $('.sax-panel-item-list', $pnl.results).fadeOut(200).empty();
|
||||||
var $msgs = $('.sax-panel-messages', $results).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||||
}
|
}
|
||||||
sax.ajax.refreshResults = sax.ajax.refreshResults || { url: sax.url.base + 'Organisation/Ajax/GetList', formId: 'frmOrganisationFilter', callbackFn: sax.doRefreshResults };
|
op.ajax.refreshResults = op.ajax.refreshResults || { url: sax.url.base + 'Organisation/Ajax/GetList', formId: 'frmOrganisationFilter', callbackFn: op.doRefreshResults };
|
||||||
sax.doAjaxRequest(sax.ajax.refreshResults, delay || 50);
|
sax.doAjaxRequest(op.ajax.refreshResults, delay || 50);
|
||||||
sax.awaitingRefreshResponse = true;
|
op.awaitingRefreshResponse = true;
|
||||||
}
|
}
|
||||||
sax.getItemTemplate = function ()
|
op.getItemTemplate = function ()
|
||||||
{
|
{
|
||||||
return $('.sax-panel-item-template .sax-panel-item.Organisation', $results);
|
return $('.sax-panel-item-template .sax-panel-item.Organisation', $pnl.results);
|
||||||
}
|
}
|
||||||
sax.getDropdownItemTemplate = function ()
|
op.getDropdownItemTemplate = function ()
|
||||||
{
|
{
|
||||||
return $('.sax-panel-item-template .sax-dropdown-menu.Organisation li.sax-dropdown-item', $results);
|
return $('.sax-panel-item-template .sax-dropdown-menu.Organisation li.sax-dropdown-item', $pnl.results);
|
||||||
}
|
}
|
||||||
sax.doRefreshResults = function (response)
|
op.doRefreshResults = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('doRefreshResults', response);
|
//sax.debug('doRefreshResults', response);
|
||||||
delete sax.awaitingRefreshResponse;
|
delete op.awaitingRefreshResponse;
|
||||||
sax.refreshControlValues(response.controlValues);
|
sax.refreshControlValues(response.controlValues);
|
||||||
var $msgs = $('.sax-panel-messages', $results).hide().empty();
|
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
var $items = $('.sax-panel-item-list', $results).hide().empty();
|
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||||
var $tmpl = sax.getItemTemplate();
|
var $tmpl = op.getItemTemplate();
|
||||||
sax.refreshPaging(response, '#frmOrganisationFilter', sax.refreshResults);
|
sax.refreshPaging(response, '#frmOrganisationFilter', sax.refreshResults);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
// Reference data - Statuses.
|
// Reference data - Statuses.
|
||||||
@@ -50,12 +51,12 @@
|
|||||||
{
|
{
|
||||||
let item = items[itemIdx];
|
let item = items[itemIdx];
|
||||||
let $item = $tmpl.clone();
|
let $item = $tmpl.clone();
|
||||||
sax.populateItem($item, item);
|
op.populateItem($item, item);
|
||||||
$items.append($item);
|
$items.append($item);
|
||||||
}
|
}
|
||||||
$items.fadeIn(50);
|
$items.fadeIn(50);
|
||||||
}
|
}
|
||||||
sax.populateItem = function ($item, item)
|
op.populateItem = function ($item, item)
|
||||||
{
|
{
|
||||||
if (!item) return;
|
if (!item) return;
|
||||||
$item.prop('id', sax.itemIdPrefix + item.id);
|
$item.prop('id', sax.itemIdPrefix + item.id);
|
||||||
@@ -70,233 +71,210 @@
|
|||||||
if (!item.deleted)
|
if (!item.deleted)
|
||||||
{
|
{
|
||||||
let $mnu = $('ul.sax-dropdown-menu', $item);
|
let $mnu = $('ul.sax-dropdown-menu', $item);
|
||||||
$mnu.append(sax.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.edit).end().on('click', function () { sax.updateItem(item.id) }));
|
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.edit).end().on('click', function () { sax.updateItem(item.id) }));
|
||||||
if (item.awaiting)
|
if (item.awaiting)
|
||||||
$mnu.append(sax.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.activate).end().on('click', function () { sax.activateItem(item.id) }));
|
$mnu.append(op.getDropdownItemTemplate().clone().find('div.sax-label').text(sax.lbl.activate).end().on('click', function () { sax.activateItem(item.id) }));
|
||||||
$('.sax-header .sax-action.sax-item-update', $item).off('click').on('click', function () { sax.updateItem(item.id) });
|
$('.sax-header .sax-action.sax-item-update', $item).off('click').on('click', function () { sax.updateItem(item.id) });
|
||||||
$item.off('dblclick').on('dblclick', function () { sax.updateItem(item.id) });
|
$item.off('dblclick').on('dblclick', function () { sax.updateItem(item.id) });
|
||||||
}
|
}
|
||||||
$('.sax-burger', $item).toggle(!!$('.sax-burger .sax-dropdown-menu .sax-dropdown-item', $item).length);
|
$('.sax-burger', $item).toggle(!!$('.sax-burger .sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||||
$('.sax-panel-messages', $results).hide().empty();
|
$('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
return $item;
|
return $item;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
op.selectFilterSport = function ()
|
||||||
|
{
|
||||||
|
if (!op.data.sports)
|
||||||
|
op.populateSports(op.showSelectFilterSport);
|
||||||
|
else op.showSelectFilterSport();
|
||||||
|
}
|
||||||
|
op.showSelectFilterSport = function ()
|
||||||
|
{
|
||||||
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: op.data.sports, fnCallback: op.onFilterSportSelected });
|
||||||
|
}
|
||||||
|
op.onFilterSportSelected = function (spt)
|
||||||
|
{
|
||||||
|
let frm = $frm.filter;
|
||||||
|
$('.FilterOrganisationSportId', frm).val(spt.id);
|
||||||
|
$('.FilterOrganisationSportCaption', frm).val(spt.name);
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
op.clearFilterSport = function ()
|
||||||
|
{
|
||||||
|
$('.FilterOrganisationSportId,.FilterOrganisationSportCaption', $frm.filter).val('');
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
op.populateSports = function (nextFn)
|
||||||
|
{
|
||||||
|
let handleResponse = function (response)
|
||||||
|
{
|
||||||
|
if (response && response.success && response.sports)
|
||||||
|
op.data.sports = response.sports;
|
||||||
|
if (nextFn) nextFn();
|
||||||
|
}
|
||||||
|
op.ajax.sports = op.ajax.sports || { url: sax.url.base + 'Sport/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleResponse };
|
||||||
|
sax.doAjaxRequest(op.ajax.sports, 50);
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.selectSport = function ()
|
sax.selectSport = function ()
|
||||||
{
|
{
|
||||||
if (!sax.data.sports)
|
if (!op.data.sports)
|
||||||
{
|
op.populateSports(sax.showSelectSport);
|
||||||
let handleSportsResponse = function (response)
|
|
||||||
{
|
|
||||||
if (response && response.success && response.sports)
|
|
||||||
sax.data.sports = response.sports;
|
|
||||||
sax.showSelectSport();
|
|
||||||
}
|
|
||||||
sax.ajax.sports = sax.ajax.sports || { url: sax.url.base + 'Sport/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleSportsResponse };
|
|
||||||
sax.doAjaxRequest(sax.ajax.sports, 50);
|
|
||||||
}
|
|
||||||
else sax.showSelectSport();
|
else sax.showSelectSport();
|
||||||
}
|
}
|
||||||
sax.showSelectSport = function ()
|
sax.showSelectSport = function ()
|
||||||
{
|
{
|
||||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: sax.data.sports, fnCallback: sax.onSportSelected });
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: op.data.sports, fnCallback: sax.onSportSelected });
|
||||||
}
|
}
|
||||||
sax.onSportSelected = function (spt)
|
sax.onSportSelected = function (spt)
|
||||||
{
|
{
|
||||||
let $frm = sax.$frm.organisation;
|
let frm = $frm.org;
|
||||||
$('.OrganisationSportId', $frm).val(spt.id);
|
$('.OrganisationSportId', frm).val(spt.id);
|
||||||
$('.OrganisationSportCaption', $frm).val(spt.name);
|
$('.OrganisationSportCaption', frm).val(spt.name);
|
||||||
sax.clearControlError($('.OrganisationSportCaption', $frm));
|
sax.clearControlError($('.OrganisationSportCaption', frm));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.selectFilterSport = function ()
|
op.selectFilterRegion = function ()
|
||||||
{
|
{
|
||||||
if (!sax.data.sports)
|
if (!op.data.regions)
|
||||||
|
op.populateRegions(op.showSelectFilterRegion);
|
||||||
|
else op.showSelectFilterRegion();
|
||||||
|
}
|
||||||
|
op.showSelectFilterRegion = function ()
|
||||||
|
{
|
||||||
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectFilterRegion, items: op.data.regions, fnCallback: op.onFilterRegionSelected });
|
||||||
|
}
|
||||||
|
op.onFilterRegionSelected = function (rgn)
|
||||||
|
{
|
||||||
|
//sax.debug('onFilterRegionSelected', rgn);
|
||||||
|
let frm = $frm.filter;
|
||||||
|
$('.FilterOrganisationRegionId', frm).val(rgn.id);
|
||||||
|
$('.FilterOrganisationRegionCaption', frm).val(rgn.name);
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
op.clearFilterRegion = function ()
|
||||||
|
{
|
||||||
|
$('.FilterOrganisationRegionId,.FilterOrganisationRegionCaption', $frm.filter).val('');
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
op.populateRegions = function (nextFn)
|
||||||
|
{
|
||||||
|
let handleResponse = function (response)
|
||||||
{
|
{
|
||||||
let handleFilterSportsResponse = function (response)
|
if (response && response.success && response.regions)
|
||||||
{
|
op.data.regions = response.regions;
|
||||||
if (response && response.success && response.sports)
|
if (nextFn) nextFn();
|
||||||
sax.data.sports = response.sports;
|
|
||||||
sax.showSelectFilterSport();
|
|
||||||
}
|
|
||||||
sax.ajax.filterSports = sax.ajax.filterSports || { url: sax.url.base + 'Sport/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleFilterSportsResponse };
|
|
||||||
sax.doAjaxRequest(sax.ajax.filterSports, 50);
|
|
||||||
}
|
}
|
||||||
else sax.showSelectFilterSport();
|
op.ajax.regions = op.ajax.regions || { url: sax.url.base + 'Region/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleResponse };
|
||||||
}
|
sax.doAjaxRequest(op.ajax.regions, 50);
|
||||||
sax.showSelectFilterSport = function ()
|
|
||||||
{
|
|
||||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: sax.data.sports, fnCallback: sax.onFilterSportSelected });
|
|
||||||
}
|
|
||||||
sax.onFilterSportSelected = function (spt)
|
|
||||||
{
|
|
||||||
//sax.debug('onFilterSportSelected', sax.$frm.filter)
|
|
||||||
let $frm = sax.$frm.filter;
|
|
||||||
$('.FilterOrganisationSportId', $frm).val(spt.id);
|
|
||||||
$('.FilterOrganisationSportCaption', $frm).val(spt.name);
|
|
||||||
sax.refreshResults();
|
|
||||||
}
|
|
||||||
sax.clearFilterSport = function ()
|
|
||||||
{
|
|
||||||
$('.FilterOrganisationSportId,.FilterOrganisationSportCaption', sax.$frm.filter).val('');
|
|
||||||
sax.refreshResults();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.selectRegion = function ()
|
sax.selectRegion = function ()
|
||||||
{
|
{
|
||||||
if (!sax.data.regions)
|
if (!op.data.regions)
|
||||||
{
|
op.populateRegions(sax.showSelectRegion);
|
||||||
let handleRegionsResponse = function (response)
|
|
||||||
{
|
|
||||||
if (response && response.success && response.regions)
|
|
||||||
sax.data.regions = response.regions;
|
|
||||||
sax.showSelectRegion();
|
|
||||||
}
|
|
||||||
sax.ajax.regions = sax.ajax.regions || { url: sax.url.base + 'Region/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleRegionsResponse };
|
|
||||||
sax.doAjaxRequest(sax.ajax.regions, 50);
|
|
||||||
}
|
|
||||||
else sax.showSelectRegion();
|
else sax.showSelectRegion();
|
||||||
}
|
}
|
||||||
sax.showSelectRegion = function ()
|
sax.showSelectRegion = function ()
|
||||||
{
|
{
|
||||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectRegion, items: sax.data.regions, fnCallback: sax.onRegionSelected });
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectRegion, items: op.data.regions, fnCallback: sax.onRegionSelected });
|
||||||
}
|
}
|
||||||
sax.onRegionSelected = function (rgn)
|
sax.onRegionSelected = function (rgn)
|
||||||
{
|
{
|
||||||
//sax.debug('onRegionSelected', rgn);
|
//sax.debug('onRegionSelected', rgn);
|
||||||
let $frm = sax.$frm.organisation;
|
let frm = $frm.org;
|
||||||
$('.OrganisationRegionIdCountry', $frm).val(rgn.id);
|
$('.OrganisationRegionIdCountry', frm).val(rgn.id);
|
||||||
$('.OrganisationRegionCaptionCountry', $frm).val(rgn.name);
|
$('.OrganisationRegionCaptionCountry', frm).val(rgn.name);
|
||||||
sax.clearControlError($('.OrganisationRegionCaptionCountry', $frm));
|
sax.clearControlError($('.OrganisationRegionCaptionCountry', frm));
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
|
||||||
sax.selectFilterRegion = function ()
|
|
||||||
{
|
|
||||||
if (!sax.data.regions)
|
|
||||||
{
|
|
||||||
let handleFilterRegionsResponse = function (response)
|
|
||||||
{
|
|
||||||
if (response && response.success && response.regions)
|
|
||||||
sax.data.regions = response.regions;
|
|
||||||
sax.showSelectFilterRegion();
|
|
||||||
}
|
|
||||||
sax.ajax.regions = sax.ajax.regions || { url: sax.url.base + 'Region/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleFilterRegionsResponse };
|
|
||||||
sax.doAjaxRequest(sax.ajax.regions, 50);
|
|
||||||
}
|
|
||||||
else sax.showSelectFilterRegion();
|
|
||||||
}
|
|
||||||
sax.showSelectFilterRegion = function ()
|
|
||||||
{
|
|
||||||
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectFilterRegion, items: sax.data.regions, fnCallback: sax.onFilterRegionSelected });
|
|
||||||
}
|
|
||||||
sax.onFilterRegionSelected = function (rgn)
|
|
||||||
{
|
|
||||||
//sax.debug('onFilterRegionSelected', rgn);
|
|
||||||
let $frm = sax.$frm.filter;
|
|
||||||
$('.FilterOrganisationRegionId', $frm).val(rgn.id);
|
|
||||||
$('.FilterOrganisationRegionCaption', $frm).val(rgn.name);
|
|
||||||
sax.refreshResults();
|
|
||||||
}
|
|
||||||
sax.clearFilterRegion = function ()
|
|
||||||
{
|
|
||||||
$('.FilterOrganisationRegionId,.FilterOrganisationRegionCaption', sax.$frm.filter).val('');
|
|
||||||
sax.refreshResults();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.createItem = function ()
|
sax.createItem = function ()
|
||||||
{
|
{
|
||||||
let $frm = sax.$frm.organisation;
|
let frm = $frm.org;
|
||||||
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', $frm).val('');
|
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', frm).val('');
|
||||||
$('.OrganisationStatus', $frm).val(sax.data.defaultStatusCode);
|
$('.OrganisationStatus', frm).val(sax.data.defaultStatusCode);
|
||||||
sax.clearControlErrors();
|
sax.clearControlErrors();
|
||||||
sax.$dlg.organisation.dialog('option', 'title', sax.dlg.title.createOrganisation);
|
$dlg.organisation.dialog('option', 'title', sax.dlg.title.createOrganisation);
|
||||||
sax.openDialog(sax.$dlg.organisation, 600, 600);
|
sax.openDialog($dlg.organisation, 600, 600);
|
||||||
}
|
|
||||||
sax.doCreateItem = function ()
|
|
||||||
{
|
|
||||||
sax.storeItem();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.updateItem = function (id)
|
sax.updateItem = function (id)
|
||||||
{
|
{
|
||||||
$('.OrganisationId', sax.$frm.organisationId).val(id);
|
$('.OrganisationId', $frm.orgId).val(id);
|
||||||
sax.ajax.updateItem = sax.ajax.updateItem || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: sax.onUpdateItem };
|
op.ajax.updateItem = op.ajax.updateItem || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: sax.onUpdateItem };
|
||||||
sax.doAjaxRequest(sax.ajax.updateItem, 50);
|
sax.doAjaxRequest(op.ajax.updateItem, 50);
|
||||||
}
|
}
|
||||||
sax.onUpdateItem = function (response)
|
sax.onUpdateItem = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('onUpdateItem', response);
|
//sax.debug('onUpdateItem', response);
|
||||||
let $frm = sax.$frm.organisation;
|
let frm = $frm.org;
|
||||||
$('.OrganisationId,input[type="text"],textarea,select', $frm).val('');
|
$('.OrganisationId,input[type="text"],textarea,select', frm).val('');
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
let item = response.organisation;
|
let item = response.organisation;
|
||||||
$('.OrganisationId', $frm).val(item.id);
|
$('.OrganisationId', frm).val(item.id);
|
||||||
$('.OrganisationName', $frm).val(item.name);
|
$('.OrganisationName', frm).val(item.name);
|
||||||
$('.OrganisationType', $frm).val(item.typeCode);
|
$('.OrganisationType', frm).val(item.typeCode);
|
||||||
$('.OrganisationCategory', $frm).val(item.categoryCode);
|
$('.OrganisationCategory', frm).val(item.categoryCode);
|
||||||
$('.OrganisationSportId', $frm).val(item.sportId);
|
$('.OrganisationSportId', frm).val(item.sportId);
|
||||||
$('.OrganisationSportCaption', $frm).val(item.sportName);
|
$('.OrganisationSportCaption', frm).val(item.sportName);
|
||||||
$('.OrganisationRegionIdCountry', $frm).val(item.regionIdCountry);
|
$('.OrganisationRegionIdCountry', frm).val(item.regionIdCountry);
|
||||||
$('.OrganisationRegionCaptionCountry', $frm).val(item.regionNameCountry);
|
$('.OrganisationRegionCaptionCountry', frm).val(item.regionNameCountry);
|
||||||
$('.OrganisationStatus', $frm).val(item.statusCode);
|
$('.OrganisationStatus', frm).val(item.statusCode);
|
||||||
sax.clearControlErrors();
|
sax.clearControlErrors();
|
||||||
sax.$dlg.organisation.dialog('option', 'title', sax.dlg.title.updateOrganisation);
|
$dlg.organisation.dialog('option', 'title', sax.dlg.title.updateOrganisation);
|
||||||
sax.openDialog(sax.$dlg.organisation, 600, 600);
|
sax.openDialog($dlg.organisation, 600, 600);
|
||||||
}
|
|
||||||
sax.doUpdateItem = function ()
|
|
||||||
{
|
|
||||||
sax.storeItem();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.storeItem = function ()
|
sax.storeItem = function ()
|
||||||
{
|
{
|
||||||
sax.ajax.storeItem = sax.ajax.storeItem || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisation', callbackFn: sax.onStoreItem };
|
op.ajax.storeItem = op.ajax.storeItem || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisation', callbackFn: sax.onStoreItem };
|
||||||
sax.doAjaxRequest(sax.ajax.storeItem, 50);
|
sax.doAjaxRequest(op.ajax.storeItem, 50);
|
||||||
}
|
}
|
||||||
sax.onStoreItem = function (response)
|
sax.onStoreItem = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('onStoreItem', response);
|
//sax.debug('onStoreItem', response);
|
||||||
sax.refreshControlValues(response.controlValues);
|
sax.refreshControlValues(response.controlValues);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
sax.$dlg.organisation.dialog('close');
|
$dlg.organisation.dialog('close');
|
||||||
sax.refreshItem(response.organisation);
|
sax.refreshItem(response.organisation);
|
||||||
}
|
}
|
||||||
sax.refreshItem=function(item)
|
sax.refreshItem = function (item)
|
||||||
{
|
{
|
||||||
var $item = $('#' + sax.itemIdPrefix + item.id);
|
var $item = $('#' + sax.itemIdPrefix + item.id);
|
||||||
if (!$item.length)
|
if (!$item.length)
|
||||||
{
|
{
|
||||||
$item = $('.sax-panel-item-template .sax-panel-item.Organisation', $results).clone();
|
$item = $('.sax-panel-item-template .sax-panel-item.Organisation', $pnl.results).clone();
|
||||||
$('.sax-panel-item-list', $results).prepend($item).show();
|
$('.sax-panel-item-list', $pnl.results).prepend($item).show();
|
||||||
}
|
}
|
||||||
$item.replaceWith(sax.populateItem(sax.getItemTemplate(), item));
|
$item.replaceWith(op.populateItem(op.getItemTemplate(), item));
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
sax.activateItem = function (id)
|
sax.activateItem = function (id)
|
||||||
{
|
{
|
||||||
//sax.debug('activateItem(' + id + ')')
|
//sax.debug('activateItem(' + id + ')')
|
||||||
$('.OrganisationId', sax.$frm.organisationId).val(id);
|
$('.OrganisationId', $frm.orgId).val(id);
|
||||||
sax.ajax.getActivationInfo = sax.ajax.getActivationInfo || { url: sax.url.base + 'Organisation/Ajax/GetActivationInfo', formId: 'frmOrganisationId', callbackFn: sax.showActivationInfo };
|
op.ajax.getActivationInfo = op.ajax.getActivationInfo || { url: sax.url.base + 'Organisation/Ajax/GetActivationInfo', formId: 'frmOrganisationId', callbackFn: sax.showActivationInfo };
|
||||||
sax.doAjaxRequest(sax.ajax.getActivationInfo, 50);
|
sax.doAjaxRequest(op.ajax.getActivationInfo, 50);
|
||||||
}
|
}
|
||||||
sax.showActivationInfo = function (response)
|
sax.showActivationInfo = function (response)
|
||||||
{
|
{
|
||||||
sax.debug('showActivationInfo', response);
|
sax.debug('showActivationInfo', response);
|
||||||
if (!response.success || !response.organisation) return;
|
if (!response.success || !response.organisation) return;
|
||||||
let item = response.organisation;
|
let item = response.organisation;
|
||||||
let $dlg = sax.$dlg.activate;
|
let $dlg = $dlg.activate;
|
||||||
let $frm = $('#frmOrganisationActivation');
|
let frm = $('#frmOrganisationActivation');
|
||||||
$('.OrganisationId', $frm).val($('.OrganisationId', sax.$frm.organisationId).val());
|
$('.OrganisationId', frm).val($('.OrganisationId', $frm.orgId).val());
|
||||||
let popItemValue = function (sel, val)
|
let popItemValue = function (sel, val)
|
||||||
{
|
{
|
||||||
$(sel, $frm).toggle(!!val).find('.sax-value').text(val);
|
$(sel, frm).toggle(!!val).find('.sax-value').text(val);
|
||||||
}
|
}
|
||||||
popItemValue('.OrganisationName', item.name);
|
popItemValue('.OrganisationName', item.name);
|
||||||
popItemValue('.OrganisationSport', item.sportName);
|
popItemValue('.OrganisationSport', item.sportName);
|
||||||
@@ -311,7 +289,7 @@
|
|||||||
let item = response.members[idx];
|
let item = response.members[idx];
|
||||||
let $item = $mbrTmpl.clone();
|
let $item = $mbrTmpl.clone();
|
||||||
$('.MemberId', $item).val(item.id);
|
$('.MemberId', $item).val(item.id);
|
||||||
$('.MemberActivate', $item).prop('name','MemberActivate_' + item.id)
|
$('.MemberActivate', $item).prop('name', 'MemberActivate_' + item.id)
|
||||||
$('.MemberEmail', $item).text(item.emailAddress);
|
$('.MemberEmail', $item).text(item.emailAddress);
|
||||||
$('.MemberName', $item).text(item.displayName);
|
$('.MemberName', $item).text(item.displayName);
|
||||||
$orgMbrs.append($item);
|
$orgMbrs.append($item);
|
||||||
@@ -321,15 +299,15 @@
|
|||||||
}
|
}
|
||||||
sax.activateOrganisation = function ()
|
sax.activateOrganisation = function ()
|
||||||
{
|
{
|
||||||
let $frm = $('#frmOrganisationActivation');
|
let frm = $('#frmOrganisationActivation');
|
||||||
sax.ajax.activateOrganisation = sax.ajax.activateOrganisation || { url: sax.url.base + 'Organisation/Ajax/Activate', formId: $frm.prop('id'), callbackFn: sax.handleAtivateResponse };
|
op.ajax.activateOrganisation = op.ajax.activateOrganisation || { url: sax.url.base + 'Organisation/Ajax/Activate', formId: frm.prop('id'), callbackFn: sax.handleAtivateResponse };
|
||||||
sax.doAjaxRequest(sax.ajax.activateOrganisation, 50);
|
sax.doAjaxRequest(op.ajax.activateOrganisation, 50);
|
||||||
}
|
}
|
||||||
sax.handleAtivateResponse = function (response)
|
sax.handleAtivateResponse = function (response)
|
||||||
{
|
{
|
||||||
sax.debug('handleAtivateResponse', response);
|
sax.debug('handleAtivateResponse', response);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
sax.$dlg.activate.dialog('close');
|
$dlg.activate.dialog('close');
|
||||||
sax.refreshItem(response.organisation);
|
sax.refreshItem(response.organisation);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -338,35 +316,40 @@
|
|||||||
{
|
{
|
||||||
if (!(id * 1)) return;
|
if (!(id * 1)) return;
|
||||||
sax.doPleaseWait();
|
sax.doPleaseWait();
|
||||||
let $frm = $('#frmOrganisationId');
|
let frm = $('#frmOrganisationId');
|
||||||
$('.OrganisationId', $frm).val(id);
|
$('.OrganisationId', frm).val(id);
|
||||||
$frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
$(function ()
|
$(function ()
|
||||||
{
|
{
|
||||||
$('.sax-panel-filter .sax-action.sax-item-create').on('click', function () { sax.createItem(); });
|
$pnl.orgs = $('.sax-panel.Organisations');
|
||||||
$('.sax-panel-filter .sax-action.sax-results-refresh').on('click', function () { sax.refreshResults(); });
|
$pnl.filter = $('.sax-panel-filter', $pnl.orgs);
|
||||||
$('.sax-input, .sax-textarea').on('input', function () { sax.clearControlError(this); });
|
$pnl.results = $('.sax-panel-results', $pnl.orgs);
|
||||||
$('.sax-select').on('change', function () { sax.clearControlError(this); });
|
|
||||||
|
|
||||||
sax.$frm.filter = $('#frmOrganisationFilter');
|
$('.sax-action.sax-item-create', $pnl.filter).on('click', function () { sax.createItem(); });
|
||||||
$('.FilterOrganisation', sax.$frm.filter).on('input', function () { sax.refreshResults(250); });
|
$('.sax-action.sax-results-refresh', $pnl.filter).on('click', function () { sax.refreshResults(); });
|
||||||
$('.FilterOrganisationCategory,.FilterOrganisationStatusCategory', sax.$frm.filter).on('change', function () { sax.refreshResults(50); });
|
|
||||||
sax.$frm.organisationId = $('#frmOrganisationId');
|
$frm.filter = $('#frmOrganisationFilter');
|
||||||
sax.$frm.organisation = $('#frmOrganisation');
|
$('.FilterOrganisation', $frm.filter).on('input', function () { sax.refreshResults(250); });
|
||||||
$results = $('.sax-panel-results');
|
$('.FilterOrganisationCategory,.FilterOrganisationStatusCategory', $frm.filter).on('change', function () { sax.refreshResults(50); });
|
||||||
|
$frm.filter.on('dblclick', '.FilterOrganisationSportCaption', op.selectFilterSport).on('click', '.FilterSportSelect', op.selectFilterSport).on('click', '.FilterSportClear', op.clearFilterSport);
|
||||||
|
$frm.filter.on('dblclick', '.FilterOrganisationRegionCaption', op.selectFilterRegion).on('click', '.FilterRegionSelect', op.selectFilterRegion).on('click', '.FilterRegionClear', op.clearFilterRegion);
|
||||||
|
$frm.orgId = $('#frmOrganisationId');
|
||||||
|
$frm.org = $('#frmOrganisation');
|
||||||
|
$('.sax-input, .sax-textarea', $frm.org).on('input', function () { sax.clearControlError(this); });
|
||||||
|
$('.sax-select', $frm.org).on('change', function () { sax.clearControlError(this); });
|
||||||
|
|
||||||
var opt = sax.dlgOpts();
|
var opt = sax.dlgOpts();
|
||||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.doCreateItem(); };
|
opt.buttons[sax.dlg.btn.ok] = function () { sax.storeItem(); };
|
||||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
sax.$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
||||||
|
|
||||||
var opt = sax.dlgOpts();
|
var opt = sax.dlgOpts();
|
||||||
opt.buttons[sax.dlg.btn.ok] = function () { sax.activateOrganisation(); };
|
opt.buttons[sax.dlg.btn.ok] = function () { sax.activateOrganisation(); };
|
||||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
sax.$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
||||||
|
|
||||||
setTimeout(sax.refreshResults, 250);
|
setTimeout(sax.refreshResults, 250);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -103,6 +103,74 @@
|
|||||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn);
|
return $opt.find('div.sax-label').text(lbl).end().on('click', fn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
sax.selectFilterSport = function ()
|
||||||
|
{
|
||||||
|
if (!sax.data.sports)
|
||||||
|
{
|
||||||
|
let handleFilterSportsResponse = function (response)
|
||||||
|
{
|
||||||
|
if (response && response.success && response.sports)
|
||||||
|
sax.data.sports = response.sports;
|
||||||
|
sax.showSelectFilterSport();
|
||||||
|
}
|
||||||
|
sax.ajax.filterSports = sax.ajax.filterSports || { url: sax.url.base + 'Sport/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleFilterSportsResponse };
|
||||||
|
sax.doAjaxRequest(sax.ajax.filterSports, 50);
|
||||||
|
}
|
||||||
|
else sax.showSelectFilterSport();
|
||||||
|
}
|
||||||
|
sax.showSelectFilterSport = function ()
|
||||||
|
{
|
||||||
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectSport, items: sax.data.sports, fnCallback: sax.onFilterSportSelected });
|
||||||
|
}
|
||||||
|
sax.onFilterSportSelected = function (spt)
|
||||||
|
{
|
||||||
|
//sax.debug('onFilterSportSelected', sax.$frm.filter)
|
||||||
|
let $frm = sax.$frm.filter;
|
||||||
|
$('.FilterUserSportId', $frm).val(spt.id);
|
||||||
|
$('.FilterUserSportCaption', $frm).val(spt.name);
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
sax.clearFilterSport = function ()
|
||||||
|
{
|
||||||
|
$('.FilterUserSportId,.FilterUserSportCaption', sax.$frm.filter).val('');
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
sax.selectFilterRegion = function ()
|
||||||
|
{
|
||||||
|
if (!sax.data.regions)
|
||||||
|
{
|
||||||
|
let handleFilterRegionsResponse = function (response)
|
||||||
|
{
|
||||||
|
if (response && response.success && response.regions)
|
||||||
|
sax.data.regions = response.regions;
|
||||||
|
sax.showSelectFilterRegion();
|
||||||
|
}
|
||||||
|
sax.ajax.regions = sax.ajax.regions || { url: sax.url.base + 'Region/Ajax/GetList', formId: 'frmNavigate', callbackFn: handleFilterRegionsResponse };
|
||||||
|
sax.doAjaxRequest(sax.ajax.regions, 50);
|
||||||
|
}
|
||||||
|
else sax.showSelectFilterRegion();
|
||||||
|
}
|
||||||
|
sax.showSelectFilterRegion = function ()
|
||||||
|
{
|
||||||
|
sax.data.selectItem.fn.selectItem({ caption: sax.dlg.title.selectFilterRegion, items: sax.data.regions, fnCallback: sax.onFilterRegionSelected });
|
||||||
|
}
|
||||||
|
sax.onFilterRegionSelected = function (rgn)
|
||||||
|
{
|
||||||
|
//sax.debug('onFilterRegionSelected', rgn);
|
||||||
|
let $frm = sax.$frm.filter;
|
||||||
|
$('.FilterUserRegionId', $frm).val(rgn.id);
|
||||||
|
$('.FilterUserRegionCaption', $frm).val(rgn.name);
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
sax.clearFilterRegion = function ()
|
||||||
|
{
|
||||||
|
$('.FilterUserRegionId,.FilterUserRegionCaption', sax.$frm.filter).val('');
|
||||||
|
sax.refreshResults();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
// User Roles.
|
// User Roles.
|
||||||
sax.selectUserRoles = function ()
|
sax.selectUserRoles = function ()
|
||||||
@@ -228,6 +296,7 @@
|
|||||||
|
|
||||||
$frm.filter = $('#frmUserFilter');
|
$frm.filter = $('#frmUserFilter');
|
||||||
$('.FilterUser', $frm.filter).on('input', function () { sax.refreshResults(250); });
|
$('.FilterUser', $frm.filter).on('input', function () { sax.refreshResults(250); });
|
||||||
|
$('.FilterUserStatusCategory', $frm.filter).on('change', function () { sax.refreshResults(50); });
|
||||||
$frm.userId = $('#frmUserId');
|
$frm.userId = $('#frmUserId');
|
||||||
$frm.user = $('#frmUser');
|
$frm.user = $('#frmUser');
|
||||||
$('.sax-input, .sax-textarea', $frm.user).on('input', function () { sax.clearControlError(this); });
|
$('.sax-input, .sax-textarea', $frm.user).on('input', function () { sax.clearControlError(this); });
|
||||||
|
|||||||
@@ -519,6 +519,12 @@
|
|||||||
<data name="label.upload" xml:space="preserve">
|
<data name="label.upload" xml:space="preserve">
|
||||||
<value>Upload</value>
|
<value>Upload</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.user" xml:space="preserve">
|
||||||
|
<value>User</value>
|
||||||
|
</data>
|
||||||
|
<data name="label.users" xml:space="preserve">
|
||||||
|
<value>Users</value>
|
||||||
|
</data>
|
||||||
<data name="label.very.good" xml:space="preserve">
|
<data name="label.very.good" xml:space="preserve">
|
||||||
<value>Very Good</value>
|
<value>Very Good</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -59,6 +59,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||||
RefreshModel(model);
|
RefreshModel(model);
|
||||||
|
|
||||||
|
// Ensure data is paged to avoid leaking large volumes.
|
||||||
|
model.Paging.PageNo = Math.Max(1, model.Paging.PageNo);
|
||||||
|
model.Paging.PageLength = Math.Max(Math.Min(Sax.Config.Online.Search.Organisations.PageLengthMax, model.Paging.PageLength), (ushort)1);
|
||||||
|
|
||||||
// Query organisations that user is a member of.
|
// Query organisations that user is a member of.
|
||||||
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
||||||
prmOrganisation.OrganisationFilter = model.Filter.Organisation;
|
prmOrganisation.OrganisationFilter = model.Filter.Organisation;
|
||||||
|
|||||||
@@ -0,0 +1,193 @@
|
|||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Saxonite.Net.Core.Web.Online.Models;
|
||||||
|
using Saxonite.Net.Core.Web.Base.App;
|
||||||
|
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Saxonite.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.App;
|
||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Dbas;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// Online Search Controller - Users - Ajax actions.
|
||||||
|
//=======================================================================
|
||||||
|
partial class SearchController
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Account - Get Users.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
private class UserListData
|
||||||
|
{
|
||||||
|
public String Id { get; set; }
|
||||||
|
public String Name { get; set; }
|
||||||
|
public String Location { get; set; }
|
||||||
|
}
|
||||||
|
private class AjaxResponse_Search_Users : AjaxResponse_Data
|
||||||
|
{
|
||||||
|
// Construction.
|
||||||
|
public AjaxResponse_Search_Users(SaxModel_Online model) : base(model) { }
|
||||||
|
// User list.
|
||||||
|
public List<UserListData> Users { get; } = new List<UserListData>();
|
||||||
|
}
|
||||||
|
// Ajax request.
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Search/Ajax/Users")]
|
||||||
|
[Route("Search/Ajax/GetUsers")]
|
||||||
|
public IActionResult GetProfileUsers(Model_Search_Users model)
|
||||||
|
{
|
||||||
|
String fn = GetType().Name + ".GetProfileUsers";
|
||||||
|
AjaxResponse_Search_Users responseData = new AjaxResponse_Search_Users(model);
|
||||||
|
String messageTitle = Localiser["label.users"];
|
||||||
|
|
||||||
|
// Validate session and referrer.
|
||||||
|
if (!ValidReferer) return Forbid();
|
||||||
|
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||||
|
RefreshModel(model);
|
||||||
|
|
||||||
|
// Ensure filter has something to restrict the list.
|
||||||
|
// ToDo May be able to show some results, such as friends when no filter provided.
|
||||||
|
if (StringUtil.IsEmpty(StringUtil.TrimAll(model.Filter.User)))
|
||||||
|
{
|
||||||
|
responseData.Success = true;
|
||||||
|
return Json(responseData);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure data is paged to avoid leaking large volumes.
|
||||||
|
model.Paging.PageNo = Math.Max(1, model.Paging.PageNo);
|
||||||
|
model.Paging.PageLength = Math.Max(Math.Min(Sax.Config.Online.Search.Users.PageLengthMax, model.Paging.PageLength), (ushort)1);
|
||||||
|
|
||||||
|
// Query users that user is a member of.
|
||||||
|
SaxUserAccount.Params prmUserAccount = new SaxUserAccount.Params();
|
||||||
|
prmUserAccount.UserFilter = model.Filter.User;
|
||||||
|
if (SysId.IsValid(model.FilterSportId))
|
||||||
|
prmUserAccount.SportIdsIncluded.Add(model.FilterSportId);
|
||||||
|
if (SysId.IsValid(model.FilterRegionId))
|
||||||
|
prmUserAccount.RegionIdsIncluded.Add(model.FilterRegionId);
|
||||||
|
prmUserAccount.StatusCat = SaxUserAccount.StatusCat.ActiveOnly;
|
||||||
|
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserAccountCount(prmUserAccount);
|
||||||
|
model.PopulatePagingTo(prmUserAccount.ResultsPaging);
|
||||||
|
|
||||||
|
List<SaxUserAccount> users = AccountMgr.GetUserAccountList(prmUserAccount);
|
||||||
|
List<SysId> userIds = users.GetIds();
|
||||||
|
|
||||||
|
// Item columns.
|
||||||
|
ColumnDfn colId = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.Id);
|
||||||
|
ColumnDfn colTitle = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.Title);
|
||||||
|
ColumnDfn colFirstName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.FirstName);
|
||||||
|
ColumnDfn colLastName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.LastName);
|
||||||
|
ColumnDfn colRegionCountryName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.RegionCountry_Name);
|
||||||
|
ColumnDfn colRegionProvinceName = AccountMgr.GetUserAccountColumnDfn(SaxUserAccount.Column.RegionProvince_Name);
|
||||||
|
List<ColumnDfn> columns = new List<ColumnDfn>()
|
||||||
|
{
|
||||||
|
colId, colTitle, colFirstName, colLastName,
|
||||||
|
colRegionCountryName,colRegionProvinceName,
|
||||||
|
};
|
||||||
|
|
||||||
|
// Sort columns.
|
||||||
|
colLastName.SortAscending = true;
|
||||||
|
prmUserAccount.SortColumns.Add(colLastName);
|
||||||
|
|
||||||
|
// Query items.
|
||||||
|
using (DbResultSet resultSet = AccountMgr.ExecuteUserAccountQuery(columns, prmUserAccount))
|
||||||
|
{
|
||||||
|
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||||
|
{
|
||||||
|
NamedValue.Map values = resultSet.GetRecordValues();
|
||||||
|
String displayName = SaxUserAccount.GetDisplayName(values.GetString(colTitle.DataName), values.GetString(colFirstName.DataName), values.GetString(colLastName.DataName));
|
||||||
|
List<String> location = new List<string>() { values.GetString(colRegionProvinceName.DataName), values.GetString(colRegionCountryName.DataName) };
|
||||||
|
UserListData userData = new UserListData()
|
||||||
|
{
|
||||||
|
Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))),
|
||||||
|
Name = displayName,
|
||||||
|
Location = location.Concat(", ", "", "", true, true),
|
||||||
|
};
|
||||||
|
responseData.Users.Add(userData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (model.Paging.IsPaged)
|
||||||
|
model.Paging.ItemCount = (ushort)responseData.Users.Count;
|
||||||
|
|
||||||
|
// Complete response.
|
||||||
|
responseData.SetPaging(model);
|
||||||
|
responseData.Success = true;
|
||||||
|
return Json(responseData);
|
||||||
|
}
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Account - Get Users.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
private class UserData
|
||||||
|
{
|
||||||
|
public String Id { get; set; }
|
||||||
|
public String Name { get; set; }
|
||||||
|
public String Location { get; set; }
|
||||||
|
}
|
||||||
|
private class AjaxResponse_Search_User : AjaxResponse_Data
|
||||||
|
{
|
||||||
|
// Construction.
|
||||||
|
public AjaxResponse_Search_User(SaxModel_Online model) : base(model) { }
|
||||||
|
// User list.
|
||||||
|
public UserData User { get; set; }
|
||||||
|
}
|
||||||
|
// Ajax request.
|
||||||
|
[HttpPost]
|
||||||
|
[Route("Search/Ajax/User")]
|
||||||
|
[Route("Search/Ajax/GetUser")]
|
||||||
|
public IActionResult GetProfileUser(Model_Search_Users model)
|
||||||
|
{
|
||||||
|
String fn = GetType().Name + ".GetProfileUser";
|
||||||
|
AjaxResponse_Search_User responseData = new AjaxResponse_Search_User(model);
|
||||||
|
String messageTitle = Localiser["label.user"];
|
||||||
|
|
||||||
|
// Validate session and referrer.
|
||||||
|
if (!ValidReferer) return Forbid();
|
||||||
|
if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData);
|
||||||
|
RefreshModel(model);
|
||||||
|
|
||||||
|
// Record disposable items as they are created so all can be disposed when needed.
|
||||||
|
using (DisposableCollection<SacsHierarchyItem> disposableItems = new DisposableCollection<SacsHierarchyItem>())
|
||||||
|
{
|
||||||
|
// Retrieve user.
|
||||||
|
SysId userAccountId = model.ExtractSysId(model.UserId);
|
||||||
|
if (!SysId.IsValid(userAccountId))
|
||||||
|
{
|
||||||
|
SaLogger.Warn(fn + " User Id not supplied.");
|
||||||
|
return Json(responseData);
|
||||||
|
}
|
||||||
|
SaxUserAccount userAccount = AccountMgr.GetUserAccountById(userAccountId);
|
||||||
|
if (userAccount == null)
|
||||||
|
{
|
||||||
|
SaLogger.Warn(fn + " Failed to retrieve user. Id: " + model.UserId);
|
||||||
|
return Json(responseData);
|
||||||
|
}
|
||||||
|
disposableItems.Add(userAccount);
|
||||||
|
|
||||||
|
// Populate response.
|
||||||
|
List<String> location = new List<string>() { model.GetRegionCaption(userAccount.RegionIdProvince), model.GetRegionCaption(userAccount.RegionIdCountry) };
|
||||||
|
UserData userData = new UserData()
|
||||||
|
{
|
||||||
|
Id = model.EncryptId(userAccount.Id),
|
||||||
|
Name = userAccount.GetDisplayName(),
|
||||||
|
Location = location.Concat(", ", "", "", true, true),
|
||||||
|
};
|
||||||
|
responseData.User = userData;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Complete response.
|
||||||
|
responseData.Success = true;
|
||||||
|
return Json(responseData);
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ using Sarand.Net.Standard.Base.Dbas;
|
|||||||
using Sarand.Net.Standard.Base.Utils;
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
using Saxonite.Net.Core.Web.Base.App;
|
using Saxonite.Net.Core.Web.Base.App;
|
||||||
using Saxonite.Net.Core.Web.Online.Models;
|
using Saxonite.Net.Core.Web.Online.Models;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
using Saxonite.Net.Standard.Base.Bus;
|
using Saxonite.Net.Standard.Base.Bus;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -38,6 +39,25 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
return RedirectToAction("", "");
|
return RedirectToAction("", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>
|
||||||
|
/// Search - Users.
|
||||||
|
/// </summary>
|
||||||
|
[HttpGet]
|
||||||
|
public IActionResult Users()
|
||||||
|
{
|
||||||
|
// Validate session.
|
||||||
|
if (!ValidUserSession)
|
||||||
|
return RedirectToAction("", "");
|
||||||
|
|
||||||
|
// Model.
|
||||||
|
Model_Search_Users model = new Model_Search_Users(Localiser);
|
||||||
|
model.Paging.PageNo = 1;
|
||||||
|
model.Paging.PageLength = Sax.Config.Online.Search.Organisations.PageLengthDefault;
|
||||||
|
|
||||||
|
return View(model);
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Search - Organisations.
|
/// Search - Organisations.
|
||||||
@@ -52,7 +72,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
// Model.
|
// Model.
|
||||||
Model_Search_Organisations model = new Model_Search_Organisations(Localiser);
|
Model_Search_Organisations model = new Model_Search_Organisations(Localiser);
|
||||||
model.Paging.PageNo = 1;
|
model.Paging.PageNo = 1;
|
||||||
model.Paging.PageLength = 12;
|
model.Paging.PageLength = Sax.Config.Online.Search.Users.PageLengthDefault;
|
||||||
|
|
||||||
return View(model);
|
return View(model);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,53 @@
|
|||||||
|
using Sarand.Net.Standard.Base.Bus;
|
||||||
|
using Sarand.Net.Standard.Base.Core;
|
||||||
|
using Sarand.Net.Standard.Base.Helpers;
|
||||||
|
using Sarand.Net.Standard.Base.Utils;
|
||||||
|
using Saxonite.Net.Core.Web.Base.App;
|
||||||
|
using Saxonite.Net.Core.Web.Base.Controllers;
|
||||||
|
using Saxonite.Net.Core.Web.Base.Models;
|
||||||
|
using Saxonite.Net.Standard.Base.App;
|
||||||
|
using Saxonite.Net.Standard.Base.Bus;
|
||||||
|
using Saxonite.Net.Standard.Base.Helpers;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Core.Web.Online.Models
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
public class Model_Search_Users : SaxModel_Online
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Construction.
|
||||||
|
public Model_Search_Users(SaxLocaliser localiser) :
|
||||||
|
base(localiser)
|
||||||
|
{
|
||||||
|
//AdditionalFiles_CSS.Add("css/sax-src-usr.css");
|
||||||
|
AdditionalFiles_JS.Add("js/sax-src-usr.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Page configuration.
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Form properties.
|
||||||
|
public class FilterData
|
||||||
|
{
|
||||||
|
public String User { get; set; }
|
||||||
|
public String RegionId { get; set; }
|
||||||
|
public String SportId { get; set; }
|
||||||
|
}
|
||||||
|
public FilterData Filter { get; } = new FilterData();
|
||||||
|
public SysId FilterSportId { get { return ExtractSysId(Filter.SportId); } }
|
||||||
|
public SysId FilterRegionId { get { return ExtractSysId(Filter.RegionId); } }
|
||||||
|
public String UserId { get; set; }
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Validation.
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
@model Model_Search_Users
|
||||||
|
@inject SaxLocaliser Localiser
|
||||||
|
@{
|
||||||
|
/* User dialog panel */
|
||||||
|
}
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
</script>
|
||||||
|
|
||||||
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserId", @class = "sax-form" }))
|
||||||
|
{
|
||||||
|
<input type="hidden" name="UserId" class="UserId" />
|
||||||
|
}
|
||||||
|
<div id="dlgUser" class="sax-dialog" title="">
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
|
|
||||||
|
<div class="row UserLocation">
|
||||||
|
<div class="col-sm-5"><div class="sax-label text-sm-right">@Localiser["label.location"]</div></div>
|
||||||
|
<div class="col-sm"><div class="sax-value"></div></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
|
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,154 @@
|
|||||||
|
@model Model_Search_Users
|
||||||
|
@inject SaxLocaliser Localiser
|
||||||
|
@{
|
||||||
|
ViewData["Title"] = "Search Users";
|
||||||
|
}
|
||||||
|
|
||||||
|
<div class="sax-panel Users sax-alpha">
|
||||||
|
|
||||||
|
<script type="text/javascript">
|
||||||
|
sax.lbl.view = '@(Localiser.GetJavascriptText("label.view"))';
|
||||||
|
sax.lbl.follow = '@(Localiser.GetJavascriptText("label.follow"))';
|
||||||
|
sax.dlg.title.user = '@(Localiser.GetJavascriptText("label.user"))';
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-sm-5">
|
||||||
|
|
||||||
|
@* Filter Form *@
|
||||||
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmUserFilter", @class = "sax-form", @action = "#", @method = "POST", onsubmit = "return false;" }))
|
||||||
|
{
|
||||||
|
|
||||||
|
@* Filter panel *@
|
||||||
|
<div class="sax-panel-filter mr-sm-2">
|
||||||
|
@* Filter header *@
|
||||||
|
<div class="sax-header row">
|
||||||
|
@* Filter caption *@
|
||||||
|
<div class="col"><div class="sax-caption">@Localiser["label.users"]</div></div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="col">
|
||||||
|
<partial name="~/Views/Common/ResultsPaging.cshtml" />
|
||||||
|
</div>
|
||||||
|
<div class="fixed">
|
||||||
|
@* Burger menu *@
|
||||||
|
<ul class="nav navbar-nav navbar-dark navbar-right sax-burger">
|
||||||
|
<li class="dropdown-toggle caret-off">
|
||||||
|
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-content">
|
||||||
|
|
||||||
|
@* Generic User filter - name etc. *@
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col-sm-4"><div class="sax-label text-left text-sm-right">@Localiser["label.search"]</div></div>
|
||||||
|
<div class="col-sm row">
|
||||||
|
<div class="col"><input type="search" name="Filter.User" class="sax-input FilterUser" maxlength="32" autocomplete="off" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* User sport *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-4 sax-label text-left text-sm-right">@Localiser["label.sport"]</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="row">
|
||||||
|
@Html.HiddenFor(model => model.Filter.SportId, new { @id = "", @class = "FilterSportId" })
|
||||||
|
<div class="col"><input type="text" class="FilterSportCaption sax-input" readonly="readonly" ondblclick="sax.searchUsers.selectFilterSport()" /> </div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action" onclick="sax.searchUsers.selectFilterSport();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
|
<div class="sax-action" onclick="sax.searchUsers.clearFilterSport();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* User region *@
|
||||||
|
<div class="row pb4">
|
||||||
|
<div class="col-sm-4 sax-label text-left text-sm-right">@Localiser["label.region"]</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="row">
|
||||||
|
@Html.HiddenFor(model => model.Filter.RegionId, new { @id = "", @class = "FilterRegionId" })
|
||||||
|
<div class="col"><input type="text" class="FilterRegionCaption sax-input" readonly="readonly" ondblclick="sax.searchUsers.selectFilterRegion()" /> </div>
|
||||||
|
<div class="fixed row">
|
||||||
|
<div class="sax-action" onclick="sax.searchUsers.selectFilterRegion();"><img src="~/img/action/search24.png" alt="@(Localiser["label.search"])" title="@(Localiser["label.search"])" /></div>
|
||||||
|
<div class="sax-action" onclick="sax.searchUsers.clearFilterRegion();"><img src="~/img/action/delete24.png" alt="@(Localiser["label.clear"])" title="@(Localiser["label.clear"])" /></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Filter item templates *@
|
||||||
|
<div class="sax-panel-item-template">
|
||||||
|
@* Burger dropdown item template - ul is ignored *@
|
||||||
|
<ul class="sax-dropdown-menu Users">
|
||||||
|
<li class="sax-dropdown-item sax-action"><div class="sax-label">...</div></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col">
|
||||||
|
|
||||||
|
@* Results Panel *@
|
||||||
|
<div class="sax-panel-results">
|
||||||
|
<div class="sax-panel-messages"></div>
|
||||||
|
<div class="sax-panel-item-list"></div>
|
||||||
|
|
||||||
|
@* Element templates *@
|
||||||
|
<div class="sax-panel-item-template">
|
||||||
|
|
||||||
|
@* Item template *@
|
||||||
|
<div class="sax-panel-item User">
|
||||||
|
<div class="sax-header row">
|
||||||
|
<div class="col">
|
||||||
|
@* User caption *@
|
||||||
|
<div class="sax-caption"><div class="sax-action"><span class="UserName"></span></div></div>
|
||||||
|
</div>
|
||||||
|
<div class="fixed">
|
||||||
|
<div class="UserCategory"></div>
|
||||||
|
</div>
|
||||||
|
<div class="fixed sax-actions">
|
||||||
|
@* Burger menu *@
|
||||||
|
<ul class="nav navbar-nav navbar-light navbar-right sax-burger">
|
||||||
|
<li class="dropdown-toggle caret-off">
|
||||||
|
<a href="#" class="dropdown" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><span class="navbar-toggler-icon"></span></a>
|
||||||
|
<ul class="dropdown-menu dropdown-menu-right sax-dropdown-menu">@* Menu items will be inserted here. *@</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-6"><div class="UserLocation"></div></div>
|
||||||
|
<div class="col-sm-6 text-sm-right"><div class=""></div></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Burger dropdown item template - ul is ignored *@
|
||||||
|
<ul class="sax-dropdown-menu User">
|
||||||
|
<li class="sax-dropdown-item sax-action"><div class="sax-label">...</div></li>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<partial name="~/Views/Common/RegionSelect.cshtml" />
|
||||||
|
<partial name="~/Views/Common/SportSelect.cshtml" />
|
||||||
|
<partial name="Panel-UserDialog.cshtml" />
|
||||||
@@ -149,6 +149,7 @@
|
|||||||
@Localiser["label.search"]
|
@Localiser["label.search"]
|
||||||
</a>
|
</a>
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
||||||
|
<div class="dropdown-item text-dark sax-action" onclick="sax.goToPage('Search/Users');">@Localiser["label.users"]</div>
|
||||||
<div class="dropdown-item text-dark sax-action" onclick="sax.goToPage('Search/Organisations');">@Localiser["organisation.caption.organisations"]</div>
|
<div class="dropdown-item text-dark sax-action" onclick="sax.goToPage('Search/Organisations');">@Localiser["organisation.caption.organisations"]</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
let context = rp.fn.getContext(contextSel, refreshFn);
|
let context = rp.fn.getContext(contextSel, refreshFn);
|
||||||
rp.fn.init(context);
|
rp.fn.init(context);
|
||||||
context.paging = paging = paging || {};
|
context.paging = paging = paging || {};
|
||||||
context.$rp.toggle(paging.paged);
|
context.$rp.toggle(!!paging.paged);
|
||||||
context.$pageNo.val(paging.pageNo);
|
context.$pageNo.val(paging.pageNo);
|
||||||
context.$pageLen.val(paging.pageLength);
|
context.$pageLen.val(paging.pageLength);
|
||||||
$('.sax-paging-info', context.$rp).text(sax.mdl.resultsPaging.msg.pageInfo.format(paging.pageNo, paging.pageCount));
|
$('.sax-paging-info', context.$rp).text(sax.mdl.resultsPaging.msg.pageInfo.format(paging.pageNo, paging.pageCount));
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
}
|
}
|
||||||
so.doRefreshResults = function (response)
|
so.doRefreshResults = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('doRefreshResults', response);
|
|
||||||
delete sax.awaitingRefreshResponse;
|
delete sax.awaitingRefreshResponse;
|
||||||
sax.refreshControlValues(response.controlValues);
|
sax.refreshControlValues(response.controlValues);
|
||||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
@@ -135,7 +134,6 @@
|
|||||||
}
|
}
|
||||||
so.onViewItem = function (response)
|
so.onViewItem = function (response)
|
||||||
{
|
{
|
||||||
sax.debug('onViewItem', response);
|
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
let dlg = $dlg.org;
|
let dlg = $dlg.org;
|
||||||
let item = so.data.organisation = response.organisation;
|
let item = so.data.organisation = response.organisation;
|
||||||
|
|||||||
@@ -0,0 +1,169 @@
|
|||||||
|
/*
|
||||||
|
* Search - Users.
|
||||||
|
*/
|
||||||
|
|
||||||
|
(function (win, doc, undef)
|
||||||
|
{
|
||||||
|
"use strict";
|
||||||
|
let su = sax.searchUsers = {};
|
||||||
|
su.ajax = {}; su.data = {}; su.fn = {};
|
||||||
|
let $pnl = su.$pnl = {}, $frm = su.$frm = {}, $dlg = su.$dlg = {};
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
su.refreshResults = function (delay)
|
||||||
|
{
|
||||||
|
if (!su.awaitingRefreshResponse)
|
||||||
|
{
|
||||||
|
$('.sax-burger', $pnl.filter).hide();
|
||||||
|
$('.sax-panel-item-list', $pnl.results).fadeOut(200).empty();
|
||||||
|
$('.sax-panel-messages', $pnl.results).hide().empty().append($('<div class="sax-message">' + sax.msg.dataQuerying + '</div>')).fadeIn(200);
|
||||||
|
}
|
||||||
|
su.ajax.refreshResults = su.ajax.refreshResults || { url: sax.url.base + 'Search/Ajax/Users', formId: 'frmUserFilter', callbackFn: su.doRefreshResults };
|
||||||
|
sax.doAjaxRequest(su.ajax.refreshResults, delay || 50);
|
||||||
|
su.awaitingRefreshResponse = true;
|
||||||
|
}
|
||||||
|
su.doRefreshResults = function (response)
|
||||||
|
{
|
||||||
|
delete sax.awaitingRefreshResponse;
|
||||||
|
sax.refreshControlValues(response.controlValues);
|
||||||
|
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
|
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||||
|
if (!response.success) return;
|
||||||
|
sax.refreshPaging(response, '#frmUserFilter', su.refreshResults);
|
||||||
|
// Menu.
|
||||||
|
let $bgr = $('.sax-burger', $pnl.filter);
|
||||||
|
let $mnu = $('ul.sax-dropdown-menu', $bgr).empty();
|
||||||
|
$mnu.append(su.getFilterMenuOption(sax.lbl.refresh, function () { su.refreshResults(); }, 'sax-refresh'));
|
||||||
|
$bgr.toggle(!!$('.sax-dropdown-item', $mnu).length);
|
||||||
|
// Items.
|
||||||
|
var items = response.users;
|
||||||
|
if (!items.length)
|
||||||
|
return $msgs.append($('<div class="sax-message">' + sax.msg.dataNoneFound + '</div>')).fadeIn(500);
|
||||||
|
for (let itemIdx = 0; itemIdx < items.length; itemIdx++)
|
||||||
|
$items.append(su.populateItem(su.getItemTemplate(), items[itemIdx]));
|
||||||
|
$items.fadeIn(50);
|
||||||
|
}
|
||||||
|
su.populateItem = function ($item, item)
|
||||||
|
{
|
||||||
|
if (!item) return;
|
||||||
|
$('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
|
$('.UserName', $item).text(item.name);
|
||||||
|
$('.UserLocation', $item).text(item.location);
|
||||||
|
let $bgr = $('.sax-burger', $item);
|
||||||
|
let $mnu = $('ul.sax-dropdown-menu', $bgr).empty();
|
||||||
|
{
|
||||||
|
let fnView = function () { su.viewItem(item) };
|
||||||
|
// ToDo $mnu.append(su.getItemMenuOption(sax.lbl.view, fnView, 'sax-view'));
|
||||||
|
$('.sax-caption .sax-action', $item).off('click').on('click', fnView);
|
||||||
|
$('.sax-content', $item).off('dblclick').on('dblclick', fnView);
|
||||||
|
}
|
||||||
|
$bgr.toggle(!!$('.sax-dropdown-menu .sax-dropdown-item', $item).length);
|
||||||
|
return $item;
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
su.getFilterDropdownTemplate = function ()
|
||||||
|
{
|
||||||
|
return $('.sax-panel-item-template .sax-dropdown-menu.Users li.sax-dropdown-item', $pnl.filter).clone();
|
||||||
|
}
|
||||||
|
su.getFilterMenuOption = function (lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return su.getMenuOption(su.getFilterDropdownTemplate(), lbl, fn, cls);
|
||||||
|
}
|
||||||
|
su.getItemTemplate = function ()
|
||||||
|
{
|
||||||
|
return $('.sax-panel-item-template .sax-panel-item.User', $pnl.results).clone();
|
||||||
|
}
|
||||||
|
su.getItemDropdownTemplate = function ()
|
||||||
|
{
|
||||||
|
return $('.sax-panel-item-template .sax-dropdown-menu.User li.sax-dropdown-item', $pnl.results).clone();
|
||||||
|
}
|
||||||
|
su.getItemMenuOption = function (lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return su.getMenuOption(su.getItemDropdownTemplate(), lbl, fn, cls);
|
||||||
|
}
|
||||||
|
su.getMenuOption = function ($opt, lbl, fn, cls)
|
||||||
|
{
|
||||||
|
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
su.selectFilterSport = function ()
|
||||||
|
{
|
||||||
|
let excludeIds = [];
|
||||||
|
sax.mdl.selectSport.fn.selectSport({ caption: sax.dlg.title.selectSport, sportId: $('.FilterSportId', $frm.filter).val(), excludeIds: excludeIds, fnCallback: su.onFilterSportSelected })
|
||||||
|
}
|
||||||
|
su.onFilterSportSelected = function (spt)
|
||||||
|
{
|
||||||
|
$('.FilterSportId', $frm.filter).val(spt ? spt.id : '');
|
||||||
|
$('.FilterSportCaption', $frm.filter).val(spt ? spt.name : '');
|
||||||
|
su.refreshResults();
|
||||||
|
}
|
||||||
|
su.clearFilterSport = function ()
|
||||||
|
{
|
||||||
|
$('.FilterSportId,.FilterSportCaption', $frm.filter).val('');
|
||||||
|
su.refreshResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
su.selectFilterRegion = function ()
|
||||||
|
{
|
||||||
|
let excludeIds = [];
|
||||||
|
sax.mdl.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.FilterRegionId', $frm.filter).val(), excludeIds: excludeIds, fnCallback: su.onFilterRegionSelected })
|
||||||
|
}
|
||||||
|
su.onFilterRegionSelected = function (rgn)
|
||||||
|
{
|
||||||
|
$('.FilterRegionId', $frm.filter).val(rgn ? rgn.id : '');
|
||||||
|
$('.FilterRegionCaption', $frm.filter).val(rgn ? rgn.name : '');
|
||||||
|
su.refreshResults();
|
||||||
|
}
|
||||||
|
su.clearFilterRegion = function ()
|
||||||
|
{
|
||||||
|
$('.FilterRegionId,.FilterRegionCaption', $frm.filter).val('');
|
||||||
|
su.refreshResults();
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
su.viewItem = function (item)
|
||||||
|
{
|
||||||
|
$('.UserId', $frm.usrId).val(item.id);
|
||||||
|
su.ajax.user = su.ajax.user || { url: sax.url.base + 'Search/Ajax/GetUser', formId: 'frmUserId', callbackFn: su.onViewItem };
|
||||||
|
sax.doAjaxRequest(su.ajax.user, 50);
|
||||||
|
}
|
||||||
|
su.onViewItem = function (response)
|
||||||
|
{
|
||||||
|
if (!response.success) return;
|
||||||
|
let dlg = $dlg.usr;
|
||||||
|
let item = su.data.user = response.user;
|
||||||
|
$('.UserName', dlg).val(item.name);
|
||||||
|
$('.UserLocation', dlg).toggle(!!item.location).find('.sax-value').text(item.location);
|
||||||
|
sax.clearControlErrors();
|
||||||
|
$dlg.usr.dialog('option', 'title', item.name || sax.dlg.title.user);
|
||||||
|
sax.openDialog($dlg.usr, 600, 600);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
$(function ()
|
||||||
|
{
|
||||||
|
$pnl.usrs = $('.sax-panel.Users');
|
||||||
|
$pnl.filter = $('.sax-panel-filter', $pnl.usrs);
|
||||||
|
$pnl.results = $('.sax-panel-results', $pnl.usrs);
|
||||||
|
|
||||||
|
$frm.filter = $('#frmUserFilter', $pnl.usrs);
|
||||||
|
$('.FilterUser', $frm.filter).on('input', function () { su.refreshResults(250); }).on('keypress', function (event)
|
||||||
|
{
|
||||||
|
if (event.keyCode == 13) setTimeout(su.refreshResults, 50);
|
||||||
|
});
|
||||||
|
$('.FilterCategory', $frm.filter).on('change', function () { su.refreshResults(); });
|
||||||
|
|
||||||
|
var opt = sax.dlgOpts();
|
||||||
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
|
$dlg.usr = $('#dlgUser').dialog(opt);
|
||||||
|
$frm.usrId = $('#frmUserId');
|
||||||
|
|
||||||
|
setTimeout(su.refreshResults, 250);
|
||||||
|
});
|
||||||
|
|
||||||
|
}(window, window.document));
|
||||||
|
|
||||||
|
/* The End */
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
using Sarand.Net.Standard.Base.App;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Saxonite.Net.Standard.Base.App
|
||||||
|
{
|
||||||
|
//=======================================================================
|
||||||
|
// S A X S y s t e m - C o n f i g
|
||||||
|
//=======================================================================
|
||||||
|
static partial class Sax
|
||||||
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
// Application configuration defaults.
|
||||||
|
public static class Config
|
||||||
|
{
|
||||||
|
public static String Context_Defaults { get; } = "Defaults";
|
||||||
|
public static class Security
|
||||||
|
{
|
||||||
|
public static class Password
|
||||||
|
{
|
||||||
|
}
|
||||||
|
public static class Activation
|
||||||
|
{
|
||||||
|
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
||||||
|
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
||||||
|
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
||||||
|
}
|
||||||
|
public static class SignIn
|
||||||
|
{
|
||||||
|
public static class PasswordRequest
|
||||||
|
{
|
||||||
|
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
||||||
|
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
||||||
|
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
||||||
|
}
|
||||||
|
public static class KeepLoggedIn
|
||||||
|
{
|
||||||
|
public static bool Allowed_Default { get; } = true;
|
||||||
|
public static int CookieExpiresDays_Default { get; } = 10;
|
||||||
|
public static int CookieExpiresDays_Min { get; } = 1;
|
||||||
|
public static int CookieExpiresDays_Max { get; } = 30;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class Online
|
||||||
|
{
|
||||||
|
public static class Session
|
||||||
|
{
|
||||||
|
public static class Cookie
|
||||||
|
{
|
||||||
|
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
||||||
|
public static String Name { get; } = "Saxonite.Online.Session";
|
||||||
|
public static bool HttpOnly { get; } = true;
|
||||||
|
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(60);
|
||||||
|
public static long RememberMeTimeoutMilis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static class DataCache
|
||||||
|
{
|
||||||
|
public static class RefreshIntervalSecs
|
||||||
|
{
|
||||||
|
public static int Initial { get; } = SacsSystem.DebugMode ? 2 : 5;
|
||||||
|
public static int Periodic { get; } = SacsSystem.DebugMode ? 60 : 1800;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static class Search
|
||||||
|
{
|
||||||
|
public static class Users
|
||||||
|
{
|
||||||
|
public static ushort PageLengthDefault { get; } = 12;
|
||||||
|
public static ushort PageLengthMax { get; } = 20;
|
||||||
|
}
|
||||||
|
public static class Organisations
|
||||||
|
{
|
||||||
|
public static ushort PageLengthDefault { get; } = 12;
|
||||||
|
public static ushort PageLengthMax { get; } = 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public class Admin
|
||||||
|
{
|
||||||
|
public static class Session
|
||||||
|
{
|
||||||
|
public static class Cookie
|
||||||
|
{
|
||||||
|
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
||||||
|
public static String Name { get; } = "Saxonite.Admin.Session";
|
||||||
|
public static bool HttpOnly { get; } = true;
|
||||||
|
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(15);
|
||||||
|
public static long KeepLoggedInTimeoutMillis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
private static String version { get; } = "1.1.7.1";
|
private static String version { get; } = "1.1.8.0";
|
||||||
// Retrieve version.
|
// Retrieve version.
|
||||||
public static String GetFullVersion () { return version; }
|
public static String GetFullVersion () { return version; }
|
||||||
public static String GetAppVersion ()
|
public static String GetAppVersion ()
|
||||||
@@ -40,8 +40,9 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Version history.
|
// Version history.
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// 1.1.8 ?-Oct-2021 ?
|
// 1.1.8 21-Oct-2021 Online Users Search
|
||||||
// -
|
// - ONlien Search - Users.
|
||||||
|
// - Admin Account Users filter.
|
||||||
// 1.1.7 14-Oct-2021 Online Organisation Search
|
// 1.1.7 14-Oct-2021 Online Organisation Search
|
||||||
// - Online Profile Sport About & snags.
|
// - Online Profile Sport About & snags.
|
||||||
// - Online Organisation Search.
|
// - Online Organisation Search.
|
||||||
|
|||||||
@@ -8,77 +8,6 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
public static partial class Sax
|
public static partial class Sax
|
||||||
{
|
{
|
||||||
//-------------------------------------------------------------------
|
|
||||||
// Application configuration defaults.
|
|
||||||
public static class Config
|
|
||||||
{
|
|
||||||
public static String Context_Defaults { get; } = "Defaults";
|
|
||||||
public static class Security
|
|
||||||
{
|
|
||||||
public static class Password
|
|
||||||
{
|
|
||||||
}
|
|
||||||
public static class Activation
|
|
||||||
{
|
|
||||||
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
|
||||||
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
|
||||||
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
|
||||||
}
|
|
||||||
public static class SignIn
|
|
||||||
{
|
|
||||||
public static class PasswordRequest
|
|
||||||
{
|
|
||||||
public static int EmailLinkExpiresMins_Default { get; } = 60;
|
|
||||||
public static int EmailLinkExpiresMins_Min { get; } = 30;
|
|
||||||
public static int EmailLinkExpiresMins_Max { get; } = 60 * 24;
|
|
||||||
}
|
|
||||||
public static class KeepLoggedIn
|
|
||||||
{
|
|
||||||
public static bool Allowed_Default { get; } = true;
|
|
||||||
public static int CookieExpiresDays_Default { get; } = 10;
|
|
||||||
public static int CookieExpiresDays_Min { get; } = 1;
|
|
||||||
public static int CookieExpiresDays_Max { get; } = 30;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class Online
|
|
||||||
{
|
|
||||||
public static class Session
|
|
||||||
{
|
|
||||||
public static class Cookie
|
|
||||||
{
|
|
||||||
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
|
||||||
public static String Name { get; } = "Saxonite.Online.Session";
|
|
||||||
public static bool HttpOnly { get; } = true;
|
|
||||||
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(60);
|
|
||||||
public static long RememberMeTimeoutMilis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public static class DataCache
|
|
||||||
{
|
|
||||||
public static class RefreshIntervalSecs
|
|
||||||
{
|
|
||||||
public static int Initial { get; } = SacsSystem.DebugMode ? 2 : 5;
|
|
||||||
public static int Periodic { get; } = SacsSystem.DebugMode ? 60 : 1800;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public class Admin
|
|
||||||
{
|
|
||||||
public static class Session
|
|
||||||
{
|
|
||||||
public static class Cookie
|
|
||||||
{
|
|
||||||
/// <summary>Default cookie name: '.AspNetCore.Session'</summary>
|
|
||||||
public static String Name { get; } = "Saxonite.Admin.Session";
|
|
||||||
public static bool HttpOnly { get; } = true;
|
|
||||||
public static TimeSpan IdleTimeout { get; } = SacsSystem.DebugMode ? TimeSpan.FromMinutes(5) : TimeSpan.FromMinutes(15);
|
|
||||||
public static long KeepLoggedInTimeoutMillis { get; } = (long)(SacsSystem.DebugMode ? TimeSpan.FromMinutes(2) : TimeSpan.FromMinutes(10)).TotalMilliseconds;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Code types (static lists).
|
/// Code types (static lists).
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using Sarand.Net.Standard.Base.Utils;
|
|||||||
using Saxonite.Net.Standard.Base.App;
|
using Saxonite.Net.Standard.Base.App;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Saxonite.Net.Standard.Base.Bus
|
namespace Saxonite.Net.Standard.Base.Bus
|
||||||
@@ -74,7 +75,7 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
public byte DateOfBirthMonth { get; set; }
|
public byte DateOfBirthMonth { get; set; }
|
||||||
public short DateOfBirthYear { get; set; }
|
public short DateOfBirthYear { get; set; }
|
||||||
public SysId RegionIdCountry { get; set; }
|
public SysId RegionIdCountry { get; set; }
|
||||||
public SysId RegionIdProvince{ get; set; }
|
public SysId RegionIdProvince { get; set; }
|
||||||
// Security.
|
// Security.
|
||||||
public String PasswordHashed { get; set; } = String.Empty;
|
public String PasswordHashed { get; set; } = String.Empty;
|
||||||
public List<String> PasswordHistory { get; } = new List<string>();
|
public List<String> PasswordHistory { get; } = new List<string>();
|
||||||
@@ -493,12 +494,19 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
public List<SysId> IdsExcluded { get; } = new List<SysId>();
|
public List<SysId> IdsExcluded { get; } = new List<SysId>();
|
||||||
public String EmailAddress { get; set; }
|
public String EmailAddress { get; set; }
|
||||||
public String NamePartial { get; set; }
|
public String NamePartial { get; set; }
|
||||||
/// <summary>Partial match on various user account properties including name, countries etc.</summary>
|
/// <summary>Exact match on various user account properties including name, email etc.</summary>
|
||||||
public String UserAccountFilter { get; set; }
|
public String UserFilter { get; set; }
|
||||||
|
/// <summary>Partial match on various user account properties including name, countries etc. Not to be use din Online application!</summary>
|
||||||
|
public String UserFilterPartial { get; set; }
|
||||||
|
public List<SysId> SportIdsIncluded { get; } = new List<SysId>();
|
||||||
|
public List<SysId> RegionIdsIncluded { get; } = new List<SysId>();
|
||||||
public List<Sax.UserRole> ActiveRoles { get; } = new List<Sax.UserRole>();
|
public List<Sax.UserRole> ActiveRoles { get; } = new List<Sax.UserRole>();
|
||||||
// Common properties.
|
// Common properties.
|
||||||
public String NotesPartial { get; set; }
|
public String NotesPartial { get; set; }
|
||||||
public StatusCat StatusCat { get; set; } = StatusCat.ActiveOnly;
|
public StatusCat StatusCat { get; set; } = StatusCat.ActiveOnly;
|
||||||
|
// Table aliases - blank if not linked.
|
||||||
|
public String Alias_UserSport { get; set; }
|
||||||
|
public String Alias_UserRole { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -507,6 +515,25 @@ namespace Saxonite.Net.Standard.Base.Bus
|
|||||||
// Item list extension methods.
|
// Item list extension methods.
|
||||||
public static class SaxUserAccountList
|
public static class SaxUserAccountList
|
||||||
{
|
{
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>
|
||||||
|
/// Extract the User Account Ids.
|
||||||
|
/// </summary>
|
||||||
|
public static List<SysId> GetIds(this List<SaxUserAccount> values)
|
||||||
|
{
|
||||||
|
return values.Select(item => item.Id).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
|
/// <summary>
|
||||||
|
/// Extract the first User Account in list with the specified Id.
|
||||||
|
/// </summary>
|
||||||
|
public static SaxUserAccount GetUserAccountById(this List<SaxUserAccount> values, SysId userAccountId)
|
||||||
|
{
|
||||||
|
return values.Find(item => item.Id.Equals(userAccountId));
|
||||||
|
}
|
||||||
|
|
||||||
|
//-------------------------------------------------------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|||||||
@@ -289,6 +289,10 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
private static readonly String prefixUserAccount_Region_Country = "UsrAct_Ctr_";
|
private static readonly String prefixUserAccount_Region_Country = "UsrAct_Ctr_";
|
||||||
private static readonly String aliasUserAccount_Region_Province = "UsrAct_Prv";
|
private static readonly String aliasUserAccount_Region_Province = "UsrAct_Prv";
|
||||||
private static readonly String prefixUserAccount_Region_Province = "UsrAct_Prv_";
|
private static readonly String prefixUserAccount_Region_Province = "UsrAct_Prv_";
|
||||||
|
private static readonly String aliasUserAccount_UserSport = "UsrAct_UsrSpt";
|
||||||
|
//private static readonly String prefixUserAccount_UserSport = "UsrAct_UsrSpt_";
|
||||||
|
private static readonly String aliasUserAccount_UserRole = "UsrAct_UsrRol";
|
||||||
|
//private static readonly String prefixUserAccount_UserRole = "UsrAct_UsrRol_";
|
||||||
private static readonly String colUserAccount_UserRoleCount = "UsrAct_RoleCount";
|
private static readonly String colUserAccount_UserRoleCount = "UsrAct_RoleCount";
|
||||||
private static readonly String colUserAccount_SystemAdminRole = "UsrAct_SystemAdminRole";
|
private static readonly String colUserAccount_SystemAdminRole = "UsrAct_SystemAdminRole";
|
||||||
private void SetUserAccountColDfn
|
private void SetUserAccountColDfn
|
||||||
@@ -462,18 +466,73 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Name.
|
// Name.
|
||||||
if (!StringUtil.IsEmpty(prm.NamePartial))
|
if (!StringUtil.IsEmpty(prm.NamePartial))
|
||||||
{
|
{
|
||||||
List<String> nameFilter = new List<string>();
|
// Split filter into words.
|
||||||
nameFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Title, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(prm.NamePartial) + "%'");
|
List<String> filterWords = prm.NamePartial.Split((char[])null, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
nameFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(prm.NamePartial) + "%'");
|
filterWords.RemoveDuplicatesCI();
|
||||||
nameFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(prm.NamePartial) + "%'");
|
filterWords.RemoveBlanks();
|
||||||
filter.Add(nameFilter.Concat(" OR ", "(", ")"));
|
foreach (String filterWord in filterWords)
|
||||||
|
{
|
||||||
|
List<String> userFilter = new List<string>();
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Title, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(filterWord) + "%'");
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(filterWord) + "%'");
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName, aliasUserAccount) + "Like'%" + DbQuery.FormatForLike(filterWord) + "%'");
|
||||||
|
filter.Add(userFilter.Concat(" OR ", "(", ")"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// User Account filter.
|
// Sport Ids.
|
||||||
if (!StringUtil.IsEmpty(prm.UserAccountFilter))
|
String sportIdsIncluded = prm.SportIdsIncluded.Concat(",");
|
||||||
|
if (!sportIdsIncluded.IsEmpty())
|
||||||
|
{
|
||||||
|
if (prm.Alias_UserSport.IsEmpty())
|
||||||
|
{
|
||||||
|
// User Sport table is not linked in query.
|
||||||
|
DbQuery userSportQuery = new DbQuery(CoreDatabase.DbmsType);
|
||||||
|
userSportQuery.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserSport), aliasUserAccount_UserSport);
|
||||||
|
userSportQuery.Columns.Add("1");
|
||||||
|
userSportQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_UserAccountId, aliasUserAccount_UserSport) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserAccount));
|
||||||
|
userSportQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_SportId, aliasUserAccount_UserSport) + " IN (" + sportIdsIncluded + ")");
|
||||||
|
filter.Add("Exists(" + userSportQuery.BuildQuery() + ")");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// User Sport table is already linked in th equery.
|
||||||
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserSport_SportId, prm.Alias_UserSport) + " IN (" + sportIdsIncluded + ")");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Region Ids.
|
||||||
|
String regionIdsIncluded = prm.RegionIdsIncluded.Concat(",");
|
||||||
|
if (!regionIdsIncluded.IsEmpty())
|
||||||
|
{
|
||||||
|
List<String> regionFilter = new List<string>();
|
||||||
|
regionFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_RegionIdCountry, aliasUserAccount) + " IN (" + regionIdsIncluded + ")");
|
||||||
|
regionFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_RegionIdProvince, aliasUserAccount) + " IN (" + regionIdsIncluded + ")");
|
||||||
|
filter.Add(regionFilter.Concat(" OR ", "(", ")"));
|
||||||
|
}
|
||||||
|
|
||||||
|
// User filter.
|
||||||
|
if (!StringUtil.IsEmpty(prm.UserFilter))
|
||||||
{
|
{
|
||||||
// Split filter into words.
|
// Split filter into words.
|
||||||
List<String> filterWords = prm.UserAccountFilter.Split((char[])null).ToList();
|
List<String> filterWords = prm.UserFilter.Split((char[])null, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
|
filterWords.RemoveDuplicatesCI();
|
||||||
|
filterWords.RemoveBlanks();
|
||||||
|
foreach (String filterWord in filterWords)
|
||||||
|
{
|
||||||
|
List<String> userFilter = new List<string>();
|
||||||
|
// Exact match for each word to avoid Online user search allowing partial lookup.
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress, aliasUserAccount) + "='" + DbQuery.FormatForCondition(filterWord) + "'");
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Title, aliasUserAccount) + "='" + DbQuery.FormatForCondition(filterWord) + "'");
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName, aliasUserAccount) + "='" + DbQuery.FormatForCondition(filterWord) + "'");
|
||||||
|
userFilter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName, aliasUserAccount) + "='" + DbQuery.FormatForCondition(filterWord) + "'");
|
||||||
|
filter.Add(userFilter.Concat(" OR ", "(", ")"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// User filter - partial.
|
||||||
|
if (!StringUtil.IsEmpty(prm.UserFilterPartial))
|
||||||
|
{
|
||||||
|
// Split filter into words.
|
||||||
|
List<String> filterWords = prm.UserFilterPartial.Split((char[])null, StringSplitOptions.RemoveEmptyEntries).ToList();
|
||||||
filterWords.RemoveDuplicatesCI();
|
filterWords.RemoveDuplicatesCI();
|
||||||
filterWords.RemoveBlanks();
|
filterWords.RemoveBlanks();
|
||||||
foreach (String filterWord in filterWords)
|
foreach (String filterWord in filterWords)
|
||||||
@@ -488,21 +547,27 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Active roles.
|
// Active roles.
|
||||||
if (!prm.ActiveRoles.IsEmpty())
|
List<String> roleCodes = new List<string>();
|
||||||
|
foreach (Sax.UserRole userRole in prm.ActiveRoles)
|
||||||
|
roleCodes.Add(UserRoleCodes.GetCodeForType(userRole));
|
||||||
|
if (roleCodes.Exists(item => !item.Trim().IsEmpty()))
|
||||||
{
|
{
|
||||||
String aliasUserRole = "UsrRol";
|
if (prm.Alias_UserRole.IsEmpty())
|
||||||
DbQuery roleQuery = new DbQuery(CoreDatabase.DbmsType);
|
|
||||||
roleQuery.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserRole), aliasUserRole);
|
|
||||||
roleQuery.Columns.Add("1");
|
|
||||||
roleQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserAccountId, aliasUserRole) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserAccount));
|
|
||||||
|
|
||||||
foreach (Sax.UserRole userRole in prm.ActiveRoles)
|
|
||||||
{
|
{
|
||||||
roleQuery.Filters.Clear();
|
// User Role table is not linked in the query.
|
||||||
roleQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserAccountId, aliasUserRole) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserAccount));
|
DbQuery roleQuery = new DbQuery(CoreDatabase.DbmsType);
|
||||||
roleQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserRoleCode, aliasUserRole) + "='" + UserRoleCodes.GetCodeForType(userRole) + "'");
|
roleQuery.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserRole), aliasUserAccount_UserRole);
|
||||||
|
roleQuery.Columns.Add("1");
|
||||||
|
roleQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserAccountId, aliasUserAccount_UserRole) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserAccount));
|
||||||
|
roleQuery.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserRoleCode, aliasUserAccount_UserRole) + " IN (" + DbQuery.FormatForIn(roleCodes) + ")");
|
||||||
filter.Add("Exists(" + roleQuery.BuildQuery() + ")");
|
filter.Add("Exists(" + roleQuery.BuildQuery() + ")");
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// User Role table is already linked in the query.
|
||||||
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserAccountId, prm.Alias_UserRole) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserAccount));
|
||||||
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserRole_UserRoleCode, prm.Alias_UserRole) + " IN (" + DbQuery.FormatForIn(roleCodes) + ")");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Notes.
|
// Notes.
|
||||||
|
|||||||
@@ -445,20 +445,19 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// User Account status.
|
// User Account status.
|
||||||
if (prm.UserAccountStatusCat != SaxUserAccount.StatusCat.Any)
|
if (prm.UserAccountStatusCat != SaxUserAccount.StatusCat.Any)
|
||||||
{
|
{
|
||||||
String aliasUserOrganisation_UserAccount = StringUtil.OnEmpty(prm.Alias_UserAccount, SaxAccountMgr_Dbas.aliasUserOrganisation_UserAccount);
|
|
||||||
if (StringUtil.IsEmpty(prm.Alias_UserAccount))
|
if (StringUtil.IsEmpty(prm.Alias_UserAccount))
|
||||||
{
|
{
|
||||||
// User Account table isn't linked.
|
// User Account table isn't linked.
|
||||||
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
||||||
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserAccount), aliasUserOrganisation_UserAccount);
|
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.UserAccount), aliasUserOrganisation_UserAccount);
|
||||||
qry.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserOrganisation_UserAccount));
|
qry.Columns.Add("1");
|
||||||
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserOrganisation_UserAccount) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserOrganisation_UserAccountId, aliasUserOrganisation));
|
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Id, aliasUserOrganisation_UserAccount) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserOrganisation_UserAccountId, aliasUserOrganisation));
|
||||||
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Status, aliasUserOrganisation_UserAccount) + GetUserAccountStatusCatFilterCondition(prm.UserAccountStatusCat));
|
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Status, aliasUserOrganisation_UserAccount) + GetUserAccountStatusCatFilterCondition(prm.UserAccountStatusCat));
|
||||||
filter.Add("Exists (" + qry.BuildQuery() + ")");
|
filter.Add("Exists (" + qry.BuildQuery() + ")");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// User Account table is linked - filter directly.
|
// User Account table is linked - filter directly.
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Status, aliasUserOrganisation_UserAccount) + GetUserAccountStatusCatFilterCondition(prm.UserAccountStatusCat));
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserAccount_Status, prm.Alias_UserAccount) + GetUserAccountStatusCatFilterCondition(prm.UserAccountStatusCat));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Organisations.
|
// Organisations.
|
||||||
@@ -469,20 +468,19 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
// Organisation status.
|
// Organisation status.
|
||||||
if (prm.OrganisationStatusCat != SaxOrganisation.StatusCat.Any)
|
if (prm.OrganisationStatusCat != SaxOrganisation.StatusCat.Any)
|
||||||
{
|
{
|
||||||
String aliasUserOrganisation_Organisation = StringUtil.OnEmpty(prm.Alias_Organisation, SaxAccountMgr_Dbas.aliasUserOrganisation_Organisation);
|
|
||||||
if (StringUtil.IsEmpty(prm.Alias_Organisation))
|
if (StringUtil.IsEmpty(prm.Alias_Organisation))
|
||||||
{
|
{
|
||||||
// User Account table isn't linked.
|
// User Account table isn't linked.
|
||||||
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
DbQuery qry = new DbQuery(CoreDatabase.DbmsType);
|
||||||
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.Organisation), aliasUserOrganisation_Organisation);
|
qry.Tables.Add(SaxDbDfn_Core.GetTableName(SaxDbDfn_Core.TableIdx.Organisation), aliasUserOrganisation_Organisation);
|
||||||
qry.Columns.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Id, aliasUserOrganisation_Organisation));
|
qry.Columns.Add("1");
|
||||||
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Id, aliasUserOrganisation_Organisation) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserOrganisation_OrganisationId, aliasUserOrganisation));
|
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Id, aliasUserOrganisation_Organisation) + "=" + SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.UserOrganisation_OrganisationId, aliasUserOrganisation));
|
||||||
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Status, aliasUserOrganisation_Organisation) + GetOrganisationStatusCatFilterCondition(prm.OrganisationStatusCat));
|
qry.Filters.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Status, aliasUserOrganisation_Organisation) + GetOrganisationStatusCatFilterCondition(prm.OrganisationStatusCat));
|
||||||
filter.Add("Exists (" + qry.BuildQuery() + ")");
|
filter.Add("Exists (" + qry.BuildQuery() + ")");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
// User Account table is linked - filter directly.
|
// User Account table is linked - filter directly.
|
||||||
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Status, aliasUserOrganisation_Organisation) + GetOrganisationStatusCatFilterCondition(prm.OrganisationStatusCat));
|
filter.Add(SaxDbDfn_Core.GetColumnNameQual(SaxDbDfn_Core.ColumnIdx.Organisation_Status, prm.Alias_Organisation) + GetOrganisationStatusCatFilterCondition(prm.OrganisationStatusCat));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Organisation roles.
|
// Organisation roles.
|
||||||
|
|||||||
Reference in New Issue
Block a user