v1.2.6.3
@@ -79,7 +79,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
||||||
}
|
}
|
||||||
// Address.
|
// Address.
|
||||||
if (address != null)
|
if (address != null && !address.IsStatusDeleted)
|
||||||
{
|
{
|
||||||
data.Address = new AjaxResponse_Data.AddressData();
|
data.Address = new AjaxResponse_Data.AddressData();
|
||||||
data.Address.Id = address.Id.ToString();
|
data.Address.Id = address.Id.ToString();
|
||||||
@@ -351,6 +351,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (model.Address.IsSpecified())
|
if (model.Address.IsSpecified())
|
||||||
|
{
|
||||||
|
// The form includes address fields.
|
||||||
|
if (model.Address.IsPopulated())
|
||||||
{
|
{
|
||||||
// Organisation regions.
|
// Organisation regions.
|
||||||
SaxRegion.Data regionCountry = Internals.GetRegion(organisation.RegionIdPrimary);
|
SaxRegion.Data regionCountry = Internals.GetRegion(organisation.RegionIdPrimary);
|
||||||
@@ -395,6 +398,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
organisationAddress.Country = model.Address.Country;
|
organisationAddress.Country = model.Address.Country;
|
||||||
}
|
}
|
||||||
organisationAddress.PostalCode = model.Address.PostalCode;
|
organisationAddress.PostalCode = model.Address.PostalCode;
|
||||||
|
organisationAddress.Status = SaxItemAddress.DefaultStatus;
|
||||||
|
|
||||||
|
// Store address.
|
||||||
if (!SysId.IsValid(organisationAddress.Id))
|
if (!SysId.IsValid(organisationAddress.Id))
|
||||||
{
|
{
|
||||||
// Create new address.
|
// Create new address.
|
||||||
@@ -414,6 +420,16 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Address not populated - delete it.
|
||||||
|
if (!ItemDataMgr.DeleteItemAddress(organisationAddress, DbUpdateInfo))
|
||||||
|
{
|
||||||
|
SaLogger.Warn(fn + " Failed to delete organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||||
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
PopulateOrganisationResponseItemData(organisation, organisationAddress, responseData.organisation);
|
PopulateOrganisationResponseItemData(organisation, organisationAddress, responseData.organisation);
|
||||||
|
|||||||
@@ -19,22 +19,19 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Region data.
|
// Region data.
|
||||||
private class RegionData_List
|
private class RegionListData : AjaxResponse_Data.ItemData_Base
|
||||||
{
|
{
|
||||||
public String Id { get; set; }
|
|
||||||
public String RegionTypeCode { get; set; }
|
public String RegionTypeCode { get; set; }
|
||||||
public String RegionTypeDesc { get; set; }
|
public String RegionTypeDesc { get; set; }
|
||||||
public String CountryIso2Code { get; set; }
|
public String CountryIso2Code { get; set; }
|
||||||
public String Name { get; set; }
|
public String Name { get; set; }
|
||||||
public String ParentName { get; set; }
|
public String ParentName { get; set; }
|
||||||
public String StatusCode { get; set; }
|
|
||||||
public String StatusDesc { get; set; }
|
|
||||||
}
|
}
|
||||||
private class RegionData_Full : RegionData_List
|
private class RegionItemData : RegionListData
|
||||||
{
|
{
|
||||||
public int RegionIdParent { get; set; }
|
public String RegionIdParent { get; set; }
|
||||||
}
|
}
|
||||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_List data)
|
private void PopulateRegionResponseListData(SaxRegion region, RegionListData data)
|
||||||
{
|
{
|
||||||
data.Id = SysId.ToString(region.Id);
|
data.Id = SysId.ToString(region.Id);
|
||||||
data.RegionTypeCode = RegionTypeCodes.GetCodeForType(region.RegionType);
|
data.RegionTypeCode = RegionTypeCodes.GetCodeForType(region.RegionType);
|
||||||
@@ -48,10 +45,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
data.StatusCode = region.StatusCode;
|
data.StatusCode = region.StatusCode;
|
||||||
data.StatusDesc = region.StatusDesc;
|
data.StatusDesc = region.StatusDesc;
|
||||||
}
|
}
|
||||||
private void PopulateRegionResponseData(SaxRegion region, RegionData_Full data)
|
private void PopulateRegionResponseItemData(SaxRegion region, RegionItemData data)
|
||||||
{
|
{
|
||||||
PopulateRegionResponseData(region, data as RegionData_List);
|
PopulateRegionResponseListData(region, data);
|
||||||
data.RegionIdParent = SysId.ToInt(region.RegionIdParent);
|
data.RegionIdParent = SysId.ToString(region.RegionIdParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -62,7 +59,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Construction.
|
// Construction.
|
||||||
public AjaxResponse_RegionList(SaxModel_Admin model) : base(model) { }
|
public AjaxResponse_RegionList(SaxModel_Admin model) : base(model) { }
|
||||||
// Region list.
|
// Region list.
|
||||||
public List<RegionData_List> Regions { get; } = new List<RegionData_List>();
|
public List<RegionListData> Regions { get; } = new List<RegionListData>();
|
||||||
// Reference data.
|
// Reference data.
|
||||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||||
public String DefaultStatusCode { get; set; }
|
public String DefaultStatusCode { get; set; }
|
||||||
@@ -121,7 +118,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
NamedValue.Map values = resultSet.GetRecordValues();
|
NamedValue.Map values = resultSet.GetRecordValues();
|
||||||
Sax.RegionType regionType = (Sax.RegionType)values.GetLong(colType.DataName);
|
Sax.RegionType regionType = (Sax.RegionType)values.GetLong(colType.DataName);
|
||||||
RegionData_List regionData = new RegionData_List()
|
RegionListData regionData = new RegionListData()
|
||||||
{
|
{
|
||||||
Id = values.GetString(colId.DataName),
|
Id = values.GetString(colId.DataName),
|
||||||
RegionTypeCode = RegionTypeCodes.GetCodeForType(regionType),
|
RegionTypeCode = RegionTypeCodes.GetCodeForType(regionType),
|
||||||
@@ -152,7 +149,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Construction.
|
// Construction.
|
||||||
public AjaxResponse_Region(SaxModel_Admin model) : base(model) { }
|
public AjaxResponse_Region(SaxModel_Admin model) : base(model) { }
|
||||||
// Region details.
|
// Region details.
|
||||||
public RegionData_Full region { get; } = new RegionData_Full();
|
public RegionItemData region { get; } = new RegionItemData();
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -186,7 +183,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
PopulateRegionResponseData(region, responseData.region);
|
PopulateRegionResponseItemData(region, responseData.region);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Complete response.
|
// Complete response.
|
||||||
@@ -267,7 +264,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
PopulateRegionResponseData(region, responseData.region);
|
PopulateRegionResponseItemData(region, responseData.region);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Complete response.
|
// Complete response.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Sport data.
|
// Sport data.
|
||||||
private class SportData_List : AjaxResponse_Data.ItemData_Base
|
private class SportListData : AjaxResponse_Data.ItemData_Base
|
||||||
{
|
{
|
||||||
public String Name { get; set; }
|
public String Name { get; set; }
|
||||||
public String SportIdParent { get; set; }
|
public String SportIdParent { get; set; }
|
||||||
@@ -27,10 +27,10 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
public String SpecialityLabelCode { get; set; }
|
public String SpecialityLabelCode { get; set; }
|
||||||
public String SpecialityLabelDesc { get; set; }
|
public String SpecialityLabelDesc { get; set; }
|
||||||
}
|
}
|
||||||
private class SportData_Full : SportData_List
|
private class SportItemData : SportListData
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
private void PopulateSportResponseData(SaxSport sport, SaxSport parentSport, SportData_List data)
|
private void PopulateSportResponseListData(SaxSport sport, SaxSport parentSport, SportListData data)
|
||||||
{
|
{
|
||||||
data.Id = SysId.ToString(sport.Id);
|
data.Id = SysId.ToString(sport.Id);
|
||||||
data.SportNameParent = parentSport?.Name ?? null;
|
data.SportNameParent = parentSport?.Name ?? null;
|
||||||
@@ -41,9 +41,9 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
data.StatusCode = sport.StatusCode;
|
data.StatusCode = sport.StatusCode;
|
||||||
data.StatusDesc = sport.StatusDesc;
|
data.StatusDesc = sport.StatusDesc;
|
||||||
}
|
}
|
||||||
private void PopulateSportResponseData(SaxSport sport, SaxSport parentSport, SportData_Full data)
|
private void PopulateSportResponseItemData(SaxSport sport, SaxSport parentSport, SportItemData data)
|
||||||
{
|
{
|
||||||
PopulateSportResponseData(sport, parentSport, data as SportData_List);
|
PopulateSportResponseListData(sport, parentSport, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -54,7 +54,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Construction.
|
// Construction.
|
||||||
public AjaxResponse_SportList(SaxModel_Admin model) : base(model) { }
|
public AjaxResponse_SportList(SaxModel_Admin model) : base(model) { }
|
||||||
// Sport list.
|
// Sport list.
|
||||||
public List<SportData_List> Sports { get; } = new List<SportData_List>();
|
public List<SportListData> Sports { get; } = new List<SportListData>();
|
||||||
// Reference data.
|
// Reference data.
|
||||||
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
public List<CodeDesc> Statuses { get; } = new List<CodeDesc>();
|
||||||
public String DefaultStatusCode { get; set; }
|
public String DefaultStatusCode { get; set; }
|
||||||
@@ -107,7 +107,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
{
|
{
|
||||||
NamedValue.Map values = resultSet.GetRecordValues();
|
NamedValue.Map values = resultSet.GetRecordValues();
|
||||||
Sax.SportSpecialityLabel specialityLabel = (Sax.SportSpecialityLabel)values.GetLong(colSpecialityLabel.DataName);
|
Sax.SportSpecialityLabel specialityLabel = (Sax.SportSpecialityLabel)values.GetLong(colSpecialityLabel.DataName);
|
||||||
SportData_List sportData = new SportData_List()
|
SportListData sportData = new SportListData()
|
||||||
{
|
{
|
||||||
Id = values.GetString(colId.DataName),
|
Id = values.GetString(colId.DataName),
|
||||||
SportIdParent = values.GetString(colParentId.DataName),
|
SportIdParent = values.GetString(colParentId.DataName),
|
||||||
@@ -138,7 +138,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
// Construction.
|
// Construction.
|
||||||
public AjaxResponse_Sport(SaxModel_Admin model) : base(model) { }
|
public AjaxResponse_Sport(SaxModel_Admin model) : base(model) { }
|
||||||
// Sport details.
|
// Sport details.
|
||||||
public SportData_Full sport { get; } = new SportData_Full();
|
public SportItemData sport { get; } = new SportItemData();
|
||||||
}
|
}
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
@@ -176,7 +176,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(parentSport);
|
disposableItems.Add(parentSport);
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
PopulateSportResponseData(sport, parentSport, responseData.sport);
|
PopulateSportResponseItemData(sport, parentSport, responseData.sport);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Complete response.
|
// Complete response.
|
||||||
@@ -259,7 +259,7 @@ namespace Saxonite.Net.Core.Web.Admin.Controllers
|
|||||||
disposableItems.Add(parentSport);
|
disposableItems.Add(parentSport);
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
PopulateSportResponseData(sport, parentSport, responseData.sport);
|
PopulateSportResponseItemData(sport, parentSport, responseData.sport);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Complete response.
|
// Complete response.
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/// <summary>Have any address values been populated on the form.</summary>
|
||||||
|
public bool IsPopulated()
|
||||||
|
{
|
||||||
|
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Validation.
|
// Validation.
|
||||||
@@ -58,6 +65,8 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
// Address.
|
// Address.
|
||||||
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
||||||
{
|
{
|
||||||
|
// Are any properties populated.
|
||||||
|
bool populated = IsPopulated();
|
||||||
|
|
||||||
// Address Line 1 - optional.
|
// Address Line 1 - optional.
|
||||||
if (Line1 != null)
|
if (Line1 != null)
|
||||||
@@ -89,11 +98,11 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Address Town - mandatory.
|
// Address Town - mandatory if any value populated.
|
||||||
if (Town != null)
|
if (Town != null)
|
||||||
{
|
{
|
||||||
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
||||||
if (StringUtil.IsEmpty(Town))
|
if (StringUtil.IsEmpty(Town) && populated)
|
||||||
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.mandatory.value"]);
|
||||||
else if (StringUtil.GetLength(Town) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town))
|
else if (StringUtil.GetLength(Town) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town))
|
||||||
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]);
|
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]);
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
base(localiser)
|
base(localiser)
|
||||||
{
|
{
|
||||||
AdditionalFiles_JS.Add("js/sax-org.js");
|
AdditionalFiles_JS.Add("js/sax-org.js");
|
||||||
Address = new ModelData_Address(this, "Address");
|
Address = new ModelData_Address(this, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
@@ -224,6 +224,10 @@ namespace Saxonite.Net.Core.Web.Admin.Models
|
|||||||
responseData.SetControlError(nameof(OrganisationStatus), Localiser["msg.validation.invalid.value"]);
|
responseData.SetControlError(nameof(OrganisationStatus), Localiser["msg.validation.invalid.value"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Validate address fields.
|
||||||
|
if (Address != null)
|
||||||
|
Address.ValidateAddressData(responseData);
|
||||||
|
|
||||||
return !responseData.HasControlErrors();
|
return !responseData.HasControlErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,9 @@
|
|||||||
<data name="caption.contact.method" xml:space="preserve">
|
<data name="caption.contact.method" xml:space="preserve">
|
||||||
<value>Contact Method</value>
|
<value>Contact Method</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="caption.organisation.address" xml:space="preserve">
|
||||||
|
<value>Organisation Address</value>
|
||||||
|
</data>
|
||||||
<data name="company.name" xml:space="preserve">
|
<data name="company.name" xml:space="preserve">
|
||||||
<value>Sportierre</value>
|
<value>Sportierre</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -255,6 +258,9 @@
|
|||||||
<data name="label.forgotten.password" xml:space="preserve">
|
<data name="label.forgotten.password" xml:space="preserve">
|
||||||
<value>Forgotten password?</value>
|
<value>Forgotten password?</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.images" xml:space="preserve">
|
||||||
|
<value>Images</value>
|
||||||
|
</data>
|
||||||
<data name="label.index" xml:space="preserve">
|
<data name="label.index" xml:space="preserve">
|
||||||
<value>Index</value>
|
<value>Index</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -282,6 +288,9 @@
|
|||||||
<data name="label.last.name" xml:space="preserve">
|
<data name="label.last.name" xml:space="preserve">
|
||||||
<value>Last name</value>
|
<value>Last name</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.location" xml:space="preserve">
|
||||||
|
<value>Location</value>
|
||||||
|
</data>
|
||||||
<data name="label.logs" xml:space="preserve">
|
<data name="label.logs" xml:space="preserve">
|
||||||
<value>Logs</value>
|
<value>Logs</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -348,6 +357,9 @@
|
|||||||
<data name="label.password.current" xml:space="preserve">
|
<data name="label.password.current" xml:space="preserve">
|
||||||
<value>Current password</value>
|
<value>Current password</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.postal.code" xml:space="preserve">
|
||||||
|
<value>Postcode</value>
|
||||||
|
</data>
|
||||||
<data name="label.previous" xml:space="preserve">
|
<data name="label.previous" xml:space="preserve">
|
||||||
<value>Previous</value>
|
<value>Previous</value>
|
||||||
</data>
|
</data>
|
||||||
@@ -420,6 +432,9 @@
|
|||||||
<data name="label.title" xml:space="preserve">
|
<data name="label.title" xml:space="preserve">
|
||||||
<value>Title</value>
|
<value>Title</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="label.town" xml:space="preserve">
|
||||||
|
<value>Town</value>
|
||||||
|
</data>
|
||||||
<data name="label.type" xml:space="preserve">
|
<data name="label.type" xml:space="preserve">
|
||||||
<value>Type</value>
|
<value>Type</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -0,0 +1,99 @@
|
|||||||
|
@* Controls - Item Address *@
|
||||||
|
@model SaxModel_Admin
|
||||||
|
@inject SaxLocaliser Localiser
|
||||||
|
|
||||||
|
@if (!Model.RegisterView("Views/Common/Controls-ItemAddress")) return;
|
||||||
|
|
||||||
|
@* Item address - Line 1 *@
|
||||||
|
<div class="sax-form-control AddressLine1">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<div class="sax-caption">
|
||||||
|
<label for=""><span>@Localiser["label.address"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.Line1" class="AddressLine1 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Item address - Line 2 *@
|
||||||
|
<div class="sax-form-control AddressLine2">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3"></div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.Line2" class="AddressLine2 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Item address - Line 3 *@
|
||||||
|
<div class="sax-form-control AddressLine3">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3"></div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.Line3" class="AddressLine3 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Item address - Town *@
|
||||||
|
<div class="sax-form-control AddressTown">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for=""><span>@Localiser["label.town"]</span><span class="required"> (*)</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.Town" class="AddressTown sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Item address - Province *@
|
||||||
|
<div class="sax-form-control AddressProvince">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for=""><span>@Localiser["label.province"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.Province" class="AddressProvince sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@* Item address - PostalCode *@
|
||||||
|
<div class="sax-form-control AddressPostalCode">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<div class="sax-label">
|
||||||
|
<label for=""><span>@Localiser["label.postal.code"]</span></label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-sm">
|
||||||
|
<div class="sax-control row">
|
||||||
|
<div class="col"><input type="text" name="Address.PostalCode" class="AddressPostalCode sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)" /> </div>
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -11,6 +11,8 @@
|
|||||||
sax.lbl.refresh = '@(Localiser.GetJavascriptText("label.refresh"))';
|
sax.lbl.refresh = '@(Localiser.GetJavascriptText("label.refresh"))';
|
||||||
sax.lbl.create = '@(Localiser.GetJavascriptText("label.create"))';
|
sax.lbl.create = '@(Localiser.GetJavascriptText("label.create"))';
|
||||||
sax.lbl.edit = '@(Localiser.GetJavascriptText("label.edit"))';
|
sax.lbl.edit = '@(Localiser.GetJavascriptText("label.edit"))';
|
||||||
|
sax.lbl.location = '@(Localiser.GetJavascriptText("label.location"))';
|
||||||
|
sax.lbl.images = '@(Localiser.GetJavascriptText("label.images"))';
|
||||||
sax.lbl.activate = '@(Localiser.GetJavascriptText("label.activate"))';
|
sax.lbl.activate = '@(Localiser.GetJavascriptText("label.activate"))';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -163,5 +165,6 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<partial name="Panel-OrganisationDialog.cshtml" />
|
<partial name="Panel-OrganisationDialog.cshtml" />
|
||||||
|
<partial name="Panel-OrganisationAddressDialog.cshtml" />
|
||||||
<partial name="~/Views/Common/SelectItem.cshtml" />
|
<partial name="~/Views/Common/SelectItem.cshtml" />
|
||||||
<partial name="Panel-ActivationDialog.cshtml" />
|
<partial name="Panel-ActivationDialog.cshtml" />
|
||||||
|
|||||||
@@ -0,0 +1,36 @@
|
|||||||
|
@model Model_Organisation
|
||||||
|
@inject SaxLocaliser Localiser
|
||||||
|
@{
|
||||||
|
/* Organisations - Organisation Address dialog panel */
|
||||||
|
}
|
||||||
|
|
||||||
|
<div id="dlgOrganisationAddress" class="sax-dialog" title="@Localiser["caption.organisation.address"]">
|
||||||
|
|
||||||
|
<div class="spacer"></div>
|
||||||
|
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisationAddress", @class = "sax-form", @onSubmit = "return false;" }))
|
||||||
|
{
|
||||||
|
@Html.HiddenFor(model => model.OrganisationId, new { @id = "", @class = "OrganisationId" })
|
||||||
|
|
||||||
|
@* Organisation name *@
|
||||||
|
<div class="sax-form-control OrganisationName">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-sm-3">
|
||||||
|
<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), disabled = true })
|
||||||
|
</div>
|
||||||
|
<div class="sax-message"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<partial name="~/Views/Common/Controls-ItemAddress.cshtml" />
|
||||||
|
|
||||||
|
}
|
||||||
|
<div class="spacer"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@
|
|||||||
@Html.HiddenFor(model => model.RegionId, new { @id = "", @class = "RegionId" })
|
@Html.HiddenFor(model => model.RegionId, new { @id = "", @class = "RegionId" })
|
||||||
|
|
||||||
@* Region type *@
|
@* Region type *@
|
||||||
<div class="sax-form-control RegionType">
|
<div class="sax-form-control RegionTypeCode">
|
||||||
<div class="sax-label">
|
<div class="sax-label">
|
||||||
<label for="cbRegionType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
<label for="cbRegionType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -161,6 +161,16 @@
|
|||||||
background-image: url('../img/action/mail24.png');
|
background-image: url('../img/action/mail24.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-location
|
||||||
|
{
|
||||||
|
background-image: url('../img/action/location-24.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-image
|
||||||
|
{
|
||||||
|
background-image: url('../img/action/image-24.png');
|
||||||
|
}
|
||||||
|
|
||||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
||||||
{
|
{
|
||||||
background-image: url('../img/action/process24.png');
|
background-image: url('../img/action/process24.png');
|
||||||
|
|||||||
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 794 B |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -420,17 +420,14 @@
|
|||||||
{
|
{
|
||||||
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||||
sax.clearControlErrors(context);
|
sax.clearControlErrors(context);
|
||||||
var values = (controlValues || []);
|
for (let ctrlValue of controlValues || [])
|
||||||
var valuesLen = values.length;
|
|
||||||
for (var valIdx = 0; valIdx < (controlValues || []).length; valIdx++)
|
|
||||||
{
|
{
|
||||||
let ctrlValue = controlValues[valIdx];
|
|
||||||
$frmCtrls.each(function (idx, frmCtrl)
|
$frmCtrls.each(function (idx, frmCtrl)
|
||||||
{
|
{
|
||||||
var $frmCtrl = $(frmCtrl);
|
var $frmCtrl = $(frmCtrl);
|
||||||
var $ctrl = $('input,textarea,select', $frmCtrl);
|
if (!$frmCtrl.hasClass(ctrlValue.controlName)) return;
|
||||||
if ($ctrl.prop('name') != ctrlValue.controlName) return;
|
var $ctrl = $('sax-input,sax-textarea,sax-select', $frmCtrl);
|
||||||
if (ctrlValue.value)
|
if ($ctrl.length && sax.isDef(ctrlValue.value))
|
||||||
$ctrl.val(ctrlValue.value);
|
$ctrl.val(ctrlValue.value);
|
||||||
if (ctrlValue.error)
|
if (ctrlValue.error)
|
||||||
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
||||||
|
|||||||
@@ -25,15 +25,13 @@
|
|||||||
{
|
{
|
||||||
//sax.debug('doRefreshResults', response);
|
//sax.debug('doRefreshResults', response);
|
||||||
delete op.awaitingRefreshResponse;
|
delete op.awaitingRefreshResponse;
|
||||||
sax.refreshControlValues(response.controlValues);
|
|
||||||
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
var $msgs = $('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
var $items = $('.sax-panel-item-list', $pnl.results).hide().empty();
|
||||||
sax.refreshPaging(response, '#frmOrganisationFilter', op.refreshResults);
|
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
|
sax.refreshPaging(response, '#frmOrganisationFilter', op.refreshResults);
|
||||||
// Reference data.
|
// Reference data.
|
||||||
op.data.contactMethods = response.contactMethods;
|
op.data.contactMethods = response.contactMethods;
|
||||||
if (response.defaultStatusCode) op.data.defaultStatusCode = response.defaultStatusCode;
|
op.data.defaultStatusCode = response.defaultStatusCode;
|
||||||
if (response.statuses)
|
|
||||||
sax.populateSelectCodeDesc('#cbOrganisationStatus', response.statuses);
|
sax.populateSelectCodeDesc('#cbOrganisationStatus', response.statuses);
|
||||||
// Menu.
|
// Menu.
|
||||||
var $bgr = $('.sax-burger', $pnl.filter).hide();
|
var $bgr = $('.sax-burger', $pnl.filter).hide();
|
||||||
@@ -65,10 +63,12 @@
|
|||||||
if (!item.deleted)
|
if (!item.deleted)
|
||||||
{
|
{
|
||||||
let fnUpdItm = function () { op.updateItem(item, $item) };
|
let fnUpdItm = function () { op.updateItem(item, $item) };
|
||||||
|
$item.on('click', '.sax-header .sax-action.sax-item-update', fnUpdItm).on('dblclick', fnUpdItm);
|
||||||
$mnu.append(op.getItemMenuOption(sax.lbl.edit, fnUpdItm, 'sax-edit'));
|
$mnu.append(op.getItemMenuOption(sax.lbl.edit, fnUpdItm, 'sax-edit'));
|
||||||
if (item.awaiting)
|
if (item.awaiting)
|
||||||
$mnu.append(op.getItemMenuOption(sax.lbl.activate, function () { op.activateItem(item) }, 'sax-unlock'));
|
$mnu.append(op.getItemMenuOption(sax.lbl.activate, function () { op.activateItem(item) }, 'sax-unlock'));
|
||||||
$item.on('click', '.sax-header .sax-action.sax-item-update', fnUpdItm).on('dblclick', fnUpdItm);
|
$mnu.append(op.getItemMenuOption(sax.lbl.images, function () { op.updateItemImages(item, $item) }, 'sax-image'));
|
||||||
|
$mnu.append(op.getItemMenuOption(sax.lbl.location, function () { op.updateItemAddress(item, $item) }, 'sax-location'));
|
||||||
}
|
}
|
||||||
$('.sax-burger', $item).toggle(!!$('.sax-dropdown-item', $mnu).length);
|
$('.sax-burger', $item).toggle(!!$('.sax-dropdown-item', $mnu).length);
|
||||||
$('.sax-panel-messages', $pnl.results).hide().empty();
|
$('.sax-panel-messages', $pnl.results).hide().empty();
|
||||||
@@ -101,6 +101,16 @@
|
|||||||
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
return $opt.find('div.sax-label').text(lbl).end().on('click', fn).addClass(cls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------
|
||||||
|
op.onClickMemberCount = function (id)
|
||||||
|
{
|
||||||
|
if (!(id * 1)) return;
|
||||||
|
sax.doPleaseWait();
|
||||||
|
let frm = $('#frmOrganisationId');
|
||||||
|
$('.OrganisationId', frm).val(id);
|
||||||
|
frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
||||||
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
op.getFilterSport = function ()
|
op.getFilterSport = function ()
|
||||||
{
|
{
|
||||||
@@ -242,6 +252,7 @@
|
|||||||
{
|
{
|
||||||
let frm = $frm.org;
|
let frm = $frm.org;
|
||||||
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', frm).val('');
|
$('.OrganisationId,.OrganisationSportId,.OrganisationRegionIdCountry,input[type="text"],textarea,select', frm).val('');
|
||||||
|
$pnl.tblconMths.empty();
|
||||||
$('.OrganisationStatus', frm).val(op.data.defaultStatusCode);
|
$('.OrganisationStatus', frm).val(op.data.defaultStatusCode);
|
||||||
sax.clearControlErrors();
|
sax.clearControlErrors();
|
||||||
}
|
}
|
||||||
@@ -289,17 +300,7 @@
|
|||||||
$pnl.tblconMths.append(op.getConMthEl(conMth.method, conMth.methodCaption, conMth.value));
|
$pnl.tblconMths.append(op.getConMthEl(conMth.method, conMth.methodCaption, conMth.value));
|
||||||
}
|
}
|
||||||
op.sortConMths();
|
op.sortConMths();
|
||||||
// Address.
|
sax.clearControlErrors(frm);
|
||||||
let address = item.address || {};
|
|
||||||
$('input.OrganisationAddressId', $frm.org).val(address.id);
|
|
||||||
$('input.OrganisationAddressLine1', $frm.org).val(address.line1);
|
|
||||||
$('input.OrganisationAddressLine2', $frm.org).val(address.line2);
|
|
||||||
$('input.OrganisationAddressLine3', $frm.org).val(address.line3);
|
|
||||||
$('input.OrganisationAddressTown', $frm.org).val(address.town);
|
|
||||||
$('input.OrganisationAddressProvince', $frm.org).val(address.province);
|
|
||||||
$('input.OrganisationAddressCountry', $frm.org).val(address.country);
|
|
||||||
$('input.OrganisationAddressPostalCode', $frm.org).val(address.postalCode);
|
|
||||||
sax.clearControlErrors();
|
|
||||||
$dlg.organisation.dialog('option', 'title', sax.dlg.title.updateOrganisation);
|
$dlg.organisation.dialog('option', 'title', sax.dlg.title.updateOrganisation);
|
||||||
sax.openOrgDialog();
|
sax.openOrgDialog();
|
||||||
}
|
}
|
||||||
@@ -312,7 +313,7 @@
|
|||||||
}
|
}
|
||||||
op.getUsedMths = function ()
|
op.getUsedMths = function ()
|
||||||
{
|
{
|
||||||
return $('input[name="Organisation.ContactMethod"]', $frm.org).map(function () { return $(this).val(); }).get();
|
return $('input[name="ContactMethod"]', $frm.org).map(function () { return $(this).val(); }).get();
|
||||||
}
|
}
|
||||||
op.addConMth = function ()
|
op.addConMth = function ()
|
||||||
{
|
{
|
||||||
@@ -366,7 +367,7 @@
|
|||||||
op.onStoreItem = function (response)
|
op.onStoreItem = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('onStoreItem', response);
|
//sax.debug('onStoreItem', response);
|
||||||
sax.refreshControlValues(response.controlValues);
|
sax.refreshControlValues(response.controlValues, $frm.org);
|
||||||
if (!response.success) return;
|
if (!response.success) return;
|
||||||
$dlg.organisation.dialog('close');
|
$dlg.organisation.dialog('close');
|
||||||
op.refreshItem(response.organisation);
|
op.refreshItem(response.organisation);
|
||||||
@@ -437,13 +438,53 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
op.onClickMemberCount = function (id)
|
op.updateItemImages = function (item, $item)
|
||||||
{
|
{
|
||||||
if (!(id * 1)) return;
|
sax.debug('updateItemImages');
|
||||||
sax.doPleaseWait();
|
}
|
||||||
let frm = $('#frmOrganisationId');
|
|
||||||
$('.OrganisationId', frm).val(id);
|
//--------------------------------------------------------------
|
||||||
frm.prop('action', sax.url.base + 'Organisation/Members').submit();
|
op.updateItemAddress = function (item, $item)
|
||||||
|
{
|
||||||
|
sax.debug('updateItemAddress');
|
||||||
|
$('.OrganisationId', $frm.orgId).val(item.id);
|
||||||
|
op.ajax.updateItemAddr = op.ajax.updateItemAddr || { url: sax.url.base + 'Organisation/Ajax/GetItem', formId: 'frmOrganisationId', callbackFn: op.onUpdateItemAddress };
|
||||||
|
sax.doAjaxRequest(op.ajax.updateItemAddr, 50);
|
||||||
|
}
|
||||||
|
op.onUpdateItemAddress = function (response)
|
||||||
|
{
|
||||||
|
sax.debug('onUpdateItemAddress', response);
|
||||||
|
if (!response.success) return;
|
||||||
|
// Address.
|
||||||
|
let item = response.organisation;
|
||||||
|
let address = item.address || {};
|
||||||
|
let frm = $frm.orgAddr;
|
||||||
|
$('input.OrganisationId', frm).val(item.id);
|
||||||
|
$('.OrganisationName', frm).val(item.name);
|
||||||
|
$('input.AddressId', frm).val(address.id);
|
||||||
|
$('input.AddressLine1', frm).val(address.line1);
|
||||||
|
$('input.AddressLine2', frm).val(address.line2);
|
||||||
|
$('input.AddressLine3', frm).val(address.line3);
|
||||||
|
$('input.AddressTown', frm).val(address.town);
|
||||||
|
$('input.AddressProvince', frm).val(address.province);
|
||||||
|
$('input.AddressCountry', frm).val(address.country);
|
||||||
|
$('input.AddressPostalCode', frm).val(address.postalCode);
|
||||||
|
sax.clearControlErrors(frm);
|
||||||
|
sax.openDialog($dlg.orgAddr, 640, 480);
|
||||||
|
}
|
||||||
|
op.storeItemAddress = function ()
|
||||||
|
{
|
||||||
|
sax.debug('storeItemAddress');
|
||||||
|
op.ajax.storeItemAddr = op.ajax.storeItemAddr || { url: sax.url.base + 'Organisation/Ajax/StoreItem', formId: 'frmOrganisationAddress', callbackFn: op.onStoreItemAddress };
|
||||||
|
sax.doAjaxRequest(op.ajax.storeItemAddr, 50);
|
||||||
|
}
|
||||||
|
op.onStoreItemAddress = function (response)
|
||||||
|
{
|
||||||
|
sax.debug('onStoreItemAddress', response);
|
||||||
|
sax.refreshControlValues(response.controlValues, $frm.orgAddr);
|
||||||
|
if (!response.success) return;
|
||||||
|
$dlg.orgAddr.dialog('close');
|
||||||
|
op.refreshItem(response.organisation);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------
|
//--------------------------------------------------------------
|
||||||
@@ -459,13 +500,15 @@
|
|||||||
$frm.filter.on('dblclick', '.FilterOrganisationSportCaption', op.selectFilterSport).on('click', '.FilterSportSelect', op.selectFilterSport).on('click', '.FilterSportClear', op.clearFilterSport);
|
$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.filter.on('dblclick', '.FilterOrganisationRegionCaption', op.selectFilterRegion).on('click', '.FilterRegionSelect', op.selectFilterRegion).on('click', '.FilterRegionClear', op.clearFilterRegion);
|
||||||
|
|
||||||
|
$frm.orgId = $('#frmOrganisationId');
|
||||||
|
|
||||||
|
// Organisation dialog and form.
|
||||||
var opt = sax.dlgOpts();
|
var opt = sax.dlgOpts();
|
||||||
opt.open = sax.onOpenOrgDialog;
|
opt.open = sax.onOpenOrgDialog;
|
||||||
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItem(); };
|
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItem(); };
|
||||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
$dlg.organisation = $('#dlgOrganisation').dialog(opt);
|
||||||
|
|
||||||
$frm.orgId = $('#frmOrganisationId');
|
|
||||||
$frm.org = $('#frmOrganisation');
|
$frm.org = $('#frmOrganisation');
|
||||||
$frm.org.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
$frm.org.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||||
$frm.org.on('dblclick', '.OrganisationSportCaption', op.selectOrgSport).on('click', '#pbSelectSport', op.selectOrgSport).on('click', '.OrganisationSportClear', op.clearOrgSport);
|
$frm.org.on('dblclick', '.OrganisationSportCaption', op.selectOrgSport).on('click', '#pbSelectSport', op.selectOrgSport).on('click', '.OrganisationSportClear', op.clearOrgSport);
|
||||||
@@ -474,11 +517,21 @@
|
|||||||
$pnl.conMths = $('.ItemContactMethods', $frm.org);
|
$pnl.conMths = $('.ItemContactMethods', $frm.org);
|
||||||
$pnl.tblconMths = $('table.sax-data', $pnl.conMths);
|
$pnl.tblconMths = $('table.sax-data', $pnl.conMths);
|
||||||
|
|
||||||
|
// Activate Organisation dialog.
|
||||||
var opt = sax.dlgOpts();
|
var opt = sax.dlgOpts();
|
||||||
opt.buttons[sax.dlg.btn.ok] = function () { op.activateOrganisation(); };
|
opt.buttons[sax.dlg.btn.ok] = function () { op.activateOrganisation(); };
|
||||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
$dlg.activate = $('#dlgOrganisationActivation').dialog(opt);
|
||||||
|
|
||||||
|
// Activate Organisation Address dialog and form.
|
||||||
|
var opt = sax.dlgOpts();
|
||||||
|
opt.buttons[sax.dlg.btn.ok] = function () { op.storeItemAddress(); };
|
||||||
|
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); };
|
||||||
|
$dlg.orgAddr = $('#dlgOrganisationAddress').dialog(opt);
|
||||||
|
|
||||||
|
$frm.orgAddr = $('#frmOrganisationAddress');
|
||||||
|
$frm.orgAddr.on('input', '.sax-input, .sax-textarea', function () { sax.clearControlError(this); }).on('change', '.sax-select', function () { sax.clearControlError(this); });
|
||||||
|
|
||||||
setTimeout(op.refreshResults, 250);
|
setTimeout(op.refreshResults, 250);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
{
|
{
|
||||||
//sax.debug('doRefreshResults', response);
|
//sax.debug('doRefreshResults', response);
|
||||||
delete sax.awaitingRefreshResponse;
|
delete sax.awaitingRefreshResponse;
|
||||||
sax.refreshControlValues(response.controlValues);
|
|
||||||
var $results = $('.sax-panel-results');
|
var $results = $('.sax-panel-results');
|
||||||
var $msgs = $('.sax-panel-messages', $results).hide().empty();
|
var $msgs = $('.sax-panel-messages', $results).hide().empty();
|
||||||
var $items = $('.sax-panel-item-list', $results).hide().empty();
|
var $items = $('.sax-panel-item-list', $results).hide().empty();
|
||||||
|
|||||||
@@ -486,7 +486,7 @@
|
|||||||
<data name="label.position" xml:space="preserve">
|
<data name="label.position" xml:space="preserve">
|
||||||
<value>Position</value>
|
<value>Position</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="label.postalCode" xml:space="preserve">
|
<data name="label.postal.code" xml:space="preserve">
|
||||||
<value>Postal code</value>
|
<value>Postal code</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="label.previous" xml:space="preserve">
|
<data name="label.previous" xml:space="preserve">
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
data.ContactMethods.Add(new AjaxResponse_Data.ContactMethodData() { Method = method.ToString(), MethodCaption = Localiser.GetContactMethodCaption(method), Value = contactData.GetContactMethodValue(method) });
|
||||||
}
|
}
|
||||||
// Address.
|
// Address.
|
||||||
if (address != null)
|
if (address != null && !address.IsStatusDeleted)
|
||||||
{
|
{
|
||||||
data.Address = new AjaxResponse_Data.AddressData();
|
data.Address = new AjaxResponse_Data.AddressData();
|
||||||
data.Address.Id = model.EncryptId(address.Id);
|
data.Address.Id = model.EncryptId(address.Id);
|
||||||
@@ -384,7 +384,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
organisationAddress = ItemDataMgr.CreateItemAddress(organisation.GetItemId(), SaxItemAddress.DefaultOrganisationAddressType);
|
organisationAddress = ItemDataMgr.CreateItemAddress(organisation.GetItemId(), SaxItemAddress.DefaultOrganisationAddressType);
|
||||||
disposableItems.Add(organisationAddress);
|
disposableItems.Add(organisationAddress);
|
||||||
}
|
}
|
||||||
else
|
else if (!organisationAddress.IsStatusDeleted)
|
||||||
{
|
{
|
||||||
SaLogger.Warn(fn + " Organisation Address Id not supplied but no address found for Organisation. Id: " + organisationAddress.Id + ". " + GetLogSuffix());
|
SaLogger.Warn(fn + " Organisation Address Id not supplied but no address found for Organisation. Id: " + organisationAddress.Id + ". " + GetLogSuffix());
|
||||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
@@ -450,6 +450,12 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store address.
|
// Store address.
|
||||||
|
if (model.Organisation.Address.IsSpecified())
|
||||||
|
{
|
||||||
|
// The form includes address fields.
|
||||||
|
if (model.Organisation.Address.IsPopulated())
|
||||||
|
{
|
||||||
|
// At least one address field has been populated.
|
||||||
if (model.Organisation.Address.Line1 != null)
|
if (model.Organisation.Address.Line1 != null)
|
||||||
organisationAddress.Line1 = model.Organisation.Address.Line1;
|
organisationAddress.Line1 = model.Organisation.Address.Line1;
|
||||||
if (model.Organisation.Address.Line2 != null)
|
if (model.Organisation.Address.Line2 != null)
|
||||||
@@ -479,6 +485,9 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
organisationAddress.Country = model.Organisation.Address.Country;
|
organisationAddress.Country = model.Organisation.Address.Country;
|
||||||
}
|
}
|
||||||
organisationAddress.PostalCode = model.Organisation.Address.PostalCode;
|
organisationAddress.PostalCode = model.Organisation.Address.PostalCode;
|
||||||
|
organisationAddress.Status = SaxItemAddress.DefaultStatus;
|
||||||
|
|
||||||
|
// Store address.
|
||||||
if (!SysId.IsValid(organisationAddress.Id))
|
if (!SysId.IsValid(organisationAddress.Id))
|
||||||
{
|
{
|
||||||
// Create new address.
|
// Create new address.
|
||||||
@@ -497,6 +506,17 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
|||||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Address not specified - delete it.
|
||||||
|
if (!ItemDataMgr.DeleteItemAddress(organisationAddress, DbUpdateInfo))
|
||||||
|
{
|
||||||
|
SaLogger.Warn(fn + " Failed to delete organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||||
|
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Construct response.
|
// Construct response.
|
||||||
responseData.Organisation = new ProfileOrganisationItemData();
|
responseData.Organisation = new ProfileOrganisationItemData();
|
||||||
|
|||||||
@@ -51,6 +51,13 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
/// <summary>Have any address values been populated on the form.</summary>
|
||||||
|
public bool IsPopulated()
|
||||||
|
{
|
||||||
|
if (SysId.IsValid(Id.ToSysId()) || !StringUtil.IsEmpty(Line1) || !StringUtil.IsEmpty(Town) || !StringUtil.IsEmpty(Province) || !StringUtil.IsEmpty(Country) || !StringUtil.IsEmpty(PostalCode))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
// Validation.
|
// Validation.
|
||||||
@@ -58,6 +65,8 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
// Address.
|
// Address.
|
||||||
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
public bool ValidateAddressData(SaxController_Base.AjaxResponse_Data responseData)
|
||||||
{
|
{
|
||||||
|
// Are any properties populated.
|
||||||
|
bool populated = IsPopulated();
|
||||||
|
|
||||||
// Address Line 1 - optional.
|
// Address Line 1 - optional.
|
||||||
if (Line1 != null)
|
if (Line1 != null)
|
||||||
@@ -89,11 +98,11 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Address Town - mandatory.
|
// Address Town - mandatory if any value populated.
|
||||||
if (Town != null)
|
if (Town != null)
|
||||||
{
|
{
|
||||||
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
responseData.SetControlValue(ControlNameSuffix + "Town", Town);
|
||||||
if (StringUtil.IsEmpty(Town))
|
if (StringUtil.IsEmpty(Town) && populated)
|
||||||
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.mandatory.value"]);
|
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.mandatory.value"]);
|
||||||
else if (StringUtil.GetLength(Town) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town))
|
else if (StringUtil.GetLength(Town) > Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town))
|
||||||
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]);
|
responseData.SetControlError(ControlNameSuffix + "Town", Model.Localiser["msg.validation.maximum.length", Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]);
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
@* Action buttons *@
|
@* Action buttons *@
|
||||||
<div class="spacer2"></div>
|
<div class="spacer2"></div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6 text-right"><button type="button" class="sax-button" value="" onclick="sax.closeProfileSportExperience();">@Localiser["label.close"]</button></div>
|
<div class="col text-right pr12"><button type="button" class="sax-button" value="" onclick="sax.closeProfileSportExperience();">@Localiser["label.close"]</button></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
@* Organisation controls - Address *@
|
@* Organisation controls - Address *@
|
||||||
@model SaxModel_Online
|
@model SaxModel_Online
|
||||||
@inject SaxLocaliser Localiser
|
@inject SaxLocaliser Localiser
|
||||||
|
@* NB Organisation address controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Address")) return;
|
|
||||||
|
|
||||||
@* Organisation address - Line 1 *@
|
@* Organisation address - Line 1 *@
|
||||||
<div class="sax-form-control OrganisationAddressLine1">
|
<div class="sax-form-control OrganisationAddressLine1">
|
||||||
@@ -52,7 +51,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="sax-label">
|
<div class="sax-label">
|
||||||
<label for=""><span>@Localiser["label.town"]</span><span class="required"> *</span></label>
|
<label for=""><span>@Localiser["label.town"]</span><span class="required"> (*)</span></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
@@ -86,7 +85,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-3">
|
<div class="col-sm-3">
|
||||||
<div class="sax-label">
|
<div class="sax-label">
|
||||||
<label for=""><span>@Localiser["label.postalCode"]</span></label>
|
<label for=""><span>@Localiser["label.postal.code"]</span></label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm">
|
<div class="col-sm">
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
@* Organisation controls - Contact *@
|
@* Organisation controls - Contact *@
|
||||||
@model SaxModel_Online
|
@model SaxModel_Online
|
||||||
@inject SaxLocaliser Localiser
|
@inject SaxLocaliser Localiser
|
||||||
|
@* NB Organisation contact controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||||
|
|
||||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Contact")) return;
|
|
||||||
<style>
|
<style>
|
||||||
.OrganisationContactMethods .ContactMethods
|
.OrganisationContactMethods .ContactMethods
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
@* Organisation controls - Core *@
|
@* Organisation controls - Core *@
|
||||||
@model SaxModel_Online
|
@model SaxModel_Online
|
||||||
@inject SaxLocaliser Localiser
|
@inject SaxLocaliser Localiser
|
||||||
|
@* NB Core Organisation controls may be present more than once on a page, eg. Profile Organisation. *@
|
||||||
@if (!Model.RegisterView("Views/Common/OrganisationControls-Core")) return;
|
|
||||||
|
|
||||||
@* Organisation name *@
|
@* Organisation name *@
|
||||||
<div class="sax-form-control OrganisationName">
|
<div class="sax-form-control OrganisationName">
|
||||||
|
|||||||
@@ -154,6 +154,21 @@
|
|||||||
background-image: url('../img/action/users24.png');
|
background-image: url('../img/action/users24.png');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-mail
|
||||||
|
{
|
||||||
|
background-image: url('../img/action/mail24.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-location
|
||||||
|
{
|
||||||
|
background-image: url('../img/action/location-24.png');
|
||||||
|
}
|
||||||
|
|
||||||
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-image
|
||||||
|
{
|
||||||
|
background-image: url('../img/action/image-24.png');
|
||||||
|
}
|
||||||
|
|
||||||
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
.sax-header ul.nav.sax-burger ul.sax-dropdown-menu li.sax-action.sax-dropdown-item.sax-process
|
||||||
{
|
{
|
||||||
background-image: url('../img/action/process24.png');
|
background-image: url('../img/action/process24.png');
|
||||||
|
|||||||
|
After Width: | Height: | Size: 542 B |
|
After Width: | Height: | Size: 794 B |
|
After Width: | Height: | Size: 1001 B |
|
After Width: | Height: | Size: 811 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
@@ -420,17 +420,14 @@
|
|||||||
{
|
{
|
||||||
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
var $frmCtrls = $('.sax-form-control', $(context || doc.body)).removeClass('sax-error');
|
||||||
sax.clearControlErrors(context);
|
sax.clearControlErrors(context);
|
||||||
var values = (controlValues || []);
|
for (let ctrlValue of controlValues || [])
|
||||||
var valuesLen = values.length;
|
|
||||||
for (var valIdx = 0; valIdx < valuesLen; valIdx++)
|
|
||||||
{
|
{
|
||||||
let ctrlValue = values[valIdx];
|
|
||||||
$frmCtrls.each(function (idx, frmCtrl)
|
$frmCtrls.each(function (idx, frmCtrl)
|
||||||
{
|
{
|
||||||
var $frmCtrl = $(frmCtrl);
|
var $frmCtrl = $(frmCtrl);
|
||||||
if (!$frmCtrl.hasClass(ctrlValue.controlName)) return;
|
if (!$frmCtrl.hasClass(ctrlValue.controlName)) return;
|
||||||
var $ctrl = $('input,textarea,select', $frmCtrl);
|
var $ctrl = $('sax-input,sax-textarea,sax-select', $frmCtrl);
|
||||||
if ($ctrl.length && $ctrl.prop('name') == ctrlValue.controlName && ctrlValue.value)
|
if ($ctrl.length && sax.isDef(ctrlValue.value))
|
||||||
$ctrl.val(ctrlValue.value);
|
$ctrl.val(ctrlValue.value);
|
||||||
if (ctrlValue.error)
|
if (ctrlValue.error)
|
||||||
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
$frmCtrl.addClass('sax-error').find('.sax-message').text(ctrlValue.error);
|
||||||
|
|||||||
@@ -133,7 +133,7 @@
|
|||||||
$('input.OrganisationAddressProvince', $frm.org).val(address.province);
|
$('input.OrganisationAddressProvince', $frm.org).val(address.province);
|
||||||
$('input.OrganisationAddressCountry', $frm.org).val(address.country);
|
$('input.OrganisationAddressCountry', $frm.org).val(address.country);
|
||||||
$('input.OrganisationAddressPostalCode', $frm.org).val(address.postalCode);
|
$('input.OrganisationAddressPostalCode', $frm.org).val(address.postalCode);
|
||||||
sax.openDialog($dlg.org, 640, 800);
|
sax.openDialog($dlg.org, 720, 840);
|
||||||
}
|
}
|
||||||
po.storeOrganisation = function ()
|
po.storeOrganisation = function ()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
{
|
{
|
||||||
let frm = se.$frm.sportExp;
|
let frm = se.$frm.sportExp;
|
||||||
$('.sax-input,.sax-textarea,.sax-select,.UserSportExperienceId,.UserSportExperienceExists', frm).val('').prop('autofocus', null);
|
$('.sax-input,.sax-textarea,.sax-select,.UserSportExperienceId,.UserSportExperienceExists', frm).val('').prop('autofocus', null);
|
||||||
|
sax.clearControlErrors(frm);
|
||||||
}
|
}
|
||||||
se.fn.updateSportExperience = function (item, $item)
|
se.fn.updateSportExperience = function (item, $item)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -57,11 +57,15 @@
|
|||||||
ps.addProfileSport = function ()
|
ps.addProfileSport = function ()
|
||||||
{
|
{
|
||||||
//sax.debug('addProfileSport');
|
//sax.debug('addProfileSport');
|
||||||
|
ps.clearProfileSport();
|
||||||
|
sax.openDialog($dlg.proSpt.dialog('option', 'title', sax.dlg.title.addUserSport), 640, 480);
|
||||||
|
}
|
||||||
|
ps.clearProfileSport = function ()
|
||||||
|
{
|
||||||
let dlg = $dlg.proSpt;
|
let dlg = $dlg.proSpt;
|
||||||
$('.UserSportId,.ProfileSportExists,#ifProfileSportId,input.sax-input,textarea.sax-textarea,select.sax-select', dlg).val('');
|
$('.UserSportId,.ProfileSportExists,#ifProfileSportId,input.sax-input,textarea.sax-textarea,select.sax-select', dlg).val('');
|
||||||
$('.SelectSport', dlg).show();
|
$('.SelectSport', dlg).show();
|
||||||
dlg.dialog('option', 'title', sax.dlg.title.addUserSport);
|
sax.clearControlErrors(dlg);
|
||||||
sax.openDialog(dlg, 640, 480);
|
|
||||||
}
|
}
|
||||||
ps.updateProfileSport = function (item)
|
ps.updateProfileSport = function (item)
|
||||||
{
|
{
|
||||||
@@ -73,6 +77,7 @@
|
|||||||
ps.doUpdateProfileSport = function (response)
|
ps.doUpdateProfileSport = function (response)
|
||||||
{
|
{
|
||||||
//sax.debug('doUpdateProfileSport', response);
|
//sax.debug('doUpdateProfileSport', response);
|
||||||
|
ps.clearProfileSport();
|
||||||
let dlg = $dlg.proSpt;
|
let dlg = $dlg.proSpt;
|
||||||
let item = response.sport;
|
let item = response.sport;
|
||||||
$('.UserSportId', dlg).val(item.id);
|
$('.UserSportId', dlg).val(item.id);
|
||||||
@@ -83,8 +88,7 @@
|
|||||||
$('#cbProfileSportParticipation', dlg).val(item.sportParticipationCode);
|
$('#cbProfileSportParticipation', dlg).val(item.sportParticipationCode);
|
||||||
$('#cbProfileSportOfficiating', dlg).val(item.sportOfficiatingCode);
|
$('#cbProfileSportOfficiating', dlg).val(item.sportOfficiatingCode);
|
||||||
$('.SelectSport', dlg).hide();
|
$('.SelectSport', dlg).hide();
|
||||||
dlg.dialog('option', 'title', sax.dlg.title.updateUserSport);
|
sax.openDialog(dlg.dialog('option', 'title', sax.dlg.title.updateUserSport), 640, 480);
|
||||||
sax.openDialog(dlg, 640, 480);
|
|
||||||
}
|
}
|
||||||
sax.selectUserSport = function (sport)
|
sax.selectUserSport = function (sport)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
public static class Version
|
public static class Version
|
||||||
{
|
{
|
||||||
private static String version { get; } = "1.2.6.2";
|
private static String version { get; } = "1.2.6.3";
|
||||||
// Retrieve version.
|
// Retrieve version.
|
||||||
public static String GetFullVersion () { return version; }
|
public static String GetFullVersion () { return version; }
|
||||||
public static String GetAppVersion ()
|
public static String GetAppVersion ()
|
||||||
@@ -43,7 +43,8 @@ namespace Saxonite.Net.Standard.Base.App
|
|||||||
// 1.2.6 16-May-2022 Image resizing
|
// 1.2.6 16-May-2022 Image resizing
|
||||||
// - Profile and article images resized to maximum width/height.
|
// - Profile and article images resized to maximum width/height.
|
||||||
// - Organisation About and Facilities properties.
|
// - Organisation About and Facilities properties.
|
||||||
// - Online profile organisation contact methods.
|
// - Online profile and search organisation contact methods.
|
||||||
|
// - Admin organisation address.
|
||||||
// 1.2.5 20-Apr-2022 Article feedback
|
// 1.2.5 20-Apr-2022 Article feedback
|
||||||
// - Online Activity/Article feedback 5 stars, summary on Article list/popup.
|
// - Online Activity/Article feedback 5 stars, summary on Article list/popup.
|
||||||
// - Online Activity filter.
|
// - Online Activity filter.
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
{
|
{
|
||||||
ClearErrorState();
|
ClearErrorState();
|
||||||
|
|
||||||
|
// Some mandatory properties become optional if the address is deleted.
|
||||||
|
bool deleted = data.IsStatusDeleted;
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
// Item Id.
|
// Item Id.
|
||||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemId))
|
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && !ItemId.IsValid(data.ItemId))
|
||||||
@@ -100,7 +103,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
errField.Line3 = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Line3 = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), true))
|
if (errField.Town != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Town, "town", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town), !deleted))
|
||||||
{
|
{
|
||||||
errField.Town = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Town = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return false;
|
return false;
|
||||||
@@ -119,7 +122,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
|
errField.RegionIdCountry = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return SetErrorState("Country region must be specified");
|
return SetErrorState("Country region must be specified");
|
||||||
}
|
}
|
||||||
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), true))
|
if (errField.Country != SacsHierarchyItem.ValidValue.Ignore && !IsValidValue(data.Country, "country", (long)SaxDbDfn_Core.GetColTextLen(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country), !deleted))
|
||||||
{
|
{
|
||||||
errField.Country = SacsHierarchyItem.ValidValue.Invalid;
|
errField.Country = SacsHierarchyItem.ValidValue.Invalid;
|
||||||
return false;
|
return false;
|
||||||
@@ -176,7 +179,7 @@ namespace Saxonite.Net.Standard.Base.Mgr
|
|||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
// Associated data.
|
// Associated data.
|
||||||
if (data.Status != SaStatus.Deleted)
|
if (!data.IsStatusDeleted)
|
||||||
{
|
{
|
||||||
// Item must exists.
|
// Item must exists.
|
||||||
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && ItemId.IsValid(data.ItemId))
|
if (errField.ItemId != SacsHierarchyItem.ValidValue.Ignore && ItemId.IsValid(data.ItemId))
|
||||||
|
|||||||
@@ -226,6 +226,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
dbItemAddress._RegionIdProvince = SysId.ToInt(itemAddress.RegionIdProvince);
|
dbItemAddress._RegionIdProvince = SysId.ToInt(itemAddress.RegionIdProvince);
|
||||||
dbItemAddress._Country = StringUtil.EmptyOnNull(itemAddress.Country);
|
dbItemAddress._Country = StringUtil.EmptyOnNull(itemAddress.Country);
|
||||||
dbItemAddress._RegionIdCountry = SysId.ToInt(itemAddress.RegionIdCountry);
|
dbItemAddress._RegionIdCountry = SysId.ToInt(itemAddress.RegionIdCountry);
|
||||||
|
dbItemAddress._PostalCode = StringUtil.EmptyOnNull(itemAddress.PostalCode);
|
||||||
// Location.
|
// Location.
|
||||||
dbItemAddress._LocationSource = StringUtil.EmptyOnNull(itemAddress.LocationSource);
|
dbItemAddress._LocationSource = StringUtil.EmptyOnNull(itemAddress.LocationSource);
|
||||||
dbItemAddress._LocationStoredAt = itemAddress.LocationStoredAt;
|
dbItemAddress._LocationStoredAt = itemAddress.LocationStoredAt;
|
||||||
@@ -263,6 +264,7 @@ namespace Saxonite.Net.Standard.Dbas.Mgr
|
|||||||
itemAddress.RegionIdProvince = new SysId(dbItemAddress._RegionIdProvince);
|
itemAddress.RegionIdProvince = new SysId(dbItemAddress._RegionIdProvince);
|
||||||
itemAddress.Country = dbItemAddress._Country;
|
itemAddress.Country = dbItemAddress._Country;
|
||||||
itemAddress.RegionIdCountry = new SysId(dbItemAddress._RegionIdCountry);
|
itemAddress.RegionIdCountry = new SysId(dbItemAddress._RegionIdCountry);
|
||||||
|
itemAddress.PostalCode= dbItemAddress._PostalCode;
|
||||||
// Location.
|
// Location.
|
||||||
itemAddress.LocationSource = dbItemAddress._LocationSource;
|
itemAddress.LocationSource = dbItemAddress._LocationSource;
|
||||||
itemAddress.LocationStoredAt = dbItemAddress._LocationStoredAt;
|
itemAddress.LocationStoredAt = dbItemAddress._LocationStoredAt;
|
||||||
|
|||||||