v1.1.2.0
This commit is contained in:
@@ -177,6 +177,15 @@
|
||||
<data name="home.caption.welcome" xml:space="preserve">
|
||||
<value>Welcome</value>
|
||||
</data>
|
||||
<data name="home.organisation.request.action" xml:space="preserve">
|
||||
<value>Register Your Organisation</value>
|
||||
</data>
|
||||
<data name="home.organisation.request.para1" xml:space="preserve">
|
||||
<value>Do you belong to a club or association that would benefit from participating on this platform?</value>
|
||||
</data>
|
||||
<data name="home.organisation.request.para2" xml:space="preserve">
|
||||
<value>Sign-up now with a few details and we'll let you know when you can login and get going.</value>
|
||||
</data>
|
||||
<data name="journalist.caption.article" xml:space="preserve">
|
||||
<value>Article</value>
|
||||
</data>
|
||||
@@ -195,6 +204,9 @@
|
||||
<data name="label.add" xml:space="preserve">
|
||||
<value>Add</value>
|
||||
</data>
|
||||
<data name="label.address" xml:space="preserve">
|
||||
<value>Address</value>
|
||||
</data>
|
||||
<data name="label.article" xml:space="preserve">
|
||||
<value>Article</value>
|
||||
</data>
|
||||
@@ -216,6 +228,9 @@
|
||||
<data name="label.close" xml:space="preserve">
|
||||
<value>Close</value>
|
||||
</data>
|
||||
<data name="label.contact.details" xml:space="preserve">
|
||||
<value>Contact details</value>
|
||||
</data>
|
||||
<data name="label.country" xml:space="preserve">
|
||||
<value>Country</value>
|
||||
</data>
|
||||
@@ -285,6 +300,12 @@
|
||||
<data name="label.organisation" xml:space="preserve">
|
||||
<value>Organisation</value>
|
||||
</data>
|
||||
<data name="label.organisation.address" xml:space="preserve">
|
||||
<value>Organisation address</value>
|
||||
</data>
|
||||
<data name="label.organsiation.details" xml:space="preserve">
|
||||
<value>Organisation details</value>
|
||||
</data>
|
||||
<data name="label.outline" xml:space="preserve">
|
||||
<value>Outline</value>
|
||||
</data>
|
||||
@@ -303,9 +324,15 @@
|
||||
<data name="label.password.current" xml:space="preserve">
|
||||
<value>Current password</value>
|
||||
</data>
|
||||
<data name="label.phone" xml:space="preserve">
|
||||
<value>Phone</value>
|
||||
</data>
|
||||
<data name="label.position" xml:space="preserve">
|
||||
<value>Position</value>
|
||||
</data>
|
||||
<data name="label.postalCode" xml:space="preserve">
|
||||
<value>Postal code</value>
|
||||
</data>
|
||||
<data name="label.province" xml:space="preserve">
|
||||
<value>Province</value>
|
||||
</data>
|
||||
@@ -369,6 +396,9 @@
|
||||
<data name="label.title" xml:space="preserve">
|
||||
<value>Title</value>
|
||||
</data>
|
||||
<data name="label.town" xml:space="preserve">
|
||||
<value>Town</value>
|
||||
</data>
|
||||
<data name="label.type" xml:space="preserve">
|
||||
<value>Type</value>
|
||||
</data>
|
||||
@@ -411,8 +441,10 @@
|
||||
<data name="msg.error.system" xml:space="preserve">
|
||||
<value>System error encountered.</value>
|
||||
</data>
|
||||
<data name="msg.signout.confirm" xml:space="preserve">
|
||||
<value>Are you sure that you want to sign-out?</value>
|
||||
<data name="msg.organisation.request.success" xml:space="preserve">
|
||||
<value>Thank you for registering your organisation.
|
||||
You will be contacted by email once the details have been confirmed.
|
||||
You will then be able to publicise your sporting activities.</value>
|
||||
</data>
|
||||
<data name="msg.something.gone.wrong" xml:space="preserve">
|
||||
<value>Unfortunately, something has gone wrong.\n\nYou will be returned to the home page.</value>
|
||||
|
||||
@@ -160,7 +160,7 @@ namespace Saxonite.Net.Core.Web.Online.App
|
||||
// JSON Deserialisation.
|
||||
[JsonExtensionData]
|
||||
#pragma warning disable IDE0044 // Add readonly modifier
|
||||
private IDictionary<string, JToken> _additionalData;
|
||||
private IDictionary<string, JToken> _additionalData = null;
|
||||
#pragma warning restore IDE0044 // Add readonly modifier
|
||||
[OnDeserialized]
|
||||
private void OnDeserialized(StreamingContext context)
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
SaxUserSport.Params prmUserSport = new SaxUserSport.Params();
|
||||
prmUserSport.UserAccountIdsIncluded.Add(SessionData.User.UserAccountId);
|
||||
prmUserSport.StatusCat = SaxUserSport.StatusCat.NotDeleted;
|
||||
model.DataItemTotal = (ulong)AccountMgr.GetUserSportCount(prmUserSport);
|
||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserSportCount(prmUserSport);
|
||||
model.PopulatePagingTo(prmUserSport.ResultsPaging);
|
||||
|
||||
// Item columns.
|
||||
@@ -106,12 +106,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmUserSport.SortColumns.Add(colSportName);
|
||||
|
||||
// Query items.
|
||||
model.DataItemCount = 0;
|
||||
using (DbResultSet resultSet = AccountMgr.ExecuteUserSportQuery(columns, prmUserSport))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
model.DataItemCount++;
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ProfileSportResponseData_List userSportData = new ProfileSportResponseData_List()
|
||||
{
|
||||
@@ -126,6 +124,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
responseData.Sports.Add(userSportData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Sports.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
|
||||
@@ -141,7 +141,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmArticle.UserAccountIdsJournalistIncluded.Add(sessionData.User.UserAccountId);
|
||||
prmArticle.ArticleFilter = model.Filter.Article;
|
||||
prmArticle.StatusCat = SaxJournalistArticle.StatusCat.NotDeleted;
|
||||
model.DataItemTotal = (ulong)ActivityMgr.GetJournalistArticleCount(prmArticle);
|
||||
model.Paging.ItemTotal = (ulong)ActivityMgr.GetJournalistArticleCount(prmArticle);
|
||||
model.PopulatePagingTo(prmArticle.ResultsPaging);
|
||||
|
||||
// Item columns.
|
||||
@@ -165,12 +165,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmArticle.SortColumns.Add(colCreatedOn);
|
||||
|
||||
// Query items.
|
||||
model.DataItemCount = 0;
|
||||
using (DbResultSet resultSet = ActivityMgr.ExecuteJournalistArticleQuery(columns, prmArticle))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
model.DataItemCount++;
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
ArticleData_List articleData = new ArticleData_List()
|
||||
{
|
||||
@@ -187,6 +185,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
responseData.Articles.Add(articleData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Articles.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
@@ -317,7 +317,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmItemImage.ItemIdsIncluded.Add(imageItemId);
|
||||
prmItemImage.ImageTypesIncluded.Add(Sax.ImageType.Article);
|
||||
prmItemImage.ImageTypesIncluded.Add(Sax.ImageType.ArticleUpload);
|
||||
prmItemImage.StatusCat = SaxItemImage.StatusCat.Deleted;
|
||||
prmItemImage.StatusCat = SaxItemImage.StatusCat.DeletedOnly;
|
||||
prmItemImage.ResultsPaging.PageLength = 1;
|
||||
prmItemImage.ResultsPaging.PageNo = 1;
|
||||
List<SaxItemImage> itemImages = ItemDataMgr.GetItemImageList(prmItemImage);
|
||||
|
||||
@@ -45,8 +45,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
|
||||
// Paging.
|
||||
Model_Journalist model = new Model_Journalist(Localiser);
|
||||
model.DataPageNo = 1;
|
||||
model.DataPageLength = 6;
|
||||
model.Paging.PageNo = 1;
|
||||
model.Paging.PageLength = 6;
|
||||
|
||||
return View(model);
|
||||
}
|
||||
|
||||
+3
-3
@@ -135,7 +135,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmOpportunity.OrganisationIdsIncluded.Add(organisationId);
|
||||
prmOpportunity.OpportunityFilter = model.Filter.Opportunity;
|
||||
prmOpportunity.StatusCat = SaxOrganisationOpportunity.StatusCat.NotDeleted;
|
||||
model.DataItemTotal = (ulong)ActivityMgr.GetOrganisationOpportunityCount(prmOpportunity);
|
||||
model.Paging.ItemTotal = (ulong)ActivityMgr.GetOrganisationOpportunityCount(prmOpportunity);
|
||||
model.PopulatePagingTo(prmOpportunity.ResultsPaging);
|
||||
|
||||
// Item columns.
|
||||
@@ -164,12 +164,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmOpportunity.SortColumns.Add(colCreatedOn);
|
||||
|
||||
// Query items.
|
||||
model.DataItemCount = 0;
|
||||
using (DbResultSet resultSet = ActivityMgr.ExecuteOrganisationOpportunityQuery(columns, prmOpportunity))
|
||||
{
|
||||
while (resultSet != null && resultSet.HasRows && resultSet.NextRecord())
|
||||
{
|
||||
model.DataItemCount++;
|
||||
NamedValue.Map values = resultSet.GetRecordValues();
|
||||
OpportunityData_List opportunityData = new OpportunityData_List()
|
||||
{
|
||||
@@ -190,6 +188,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
}
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Opportunities.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
|
||||
@@ -4,6 +4,7 @@ using Sarand.Net.Standard.Base.Bus;
|
||||
using Sarand.Net.Standard.Base.Core;
|
||||
using Sarand.Net.Standard.Base.Dbas;
|
||||
using Sarand.Net.Standard.Base.Utils;
|
||||
using Saxonite.Net.Core.Web.Online.App;
|
||||
using Saxonite.Net.Core.Web.Online.Models;
|
||||
using Saxonite.Net.Standard.Base.App;
|
||||
using Saxonite.Net.Standard.Base.Bus;
|
||||
@@ -77,7 +78,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmOrganisation.SportIdsIncluded.AddId(model.Filter.SportId.ToSysId());
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.ActiveOnly;
|
||||
prmOrganisation.SortColumns.Add(colOrganisationName);
|
||||
model.DataItemTotal = (ulong)AccountMgr.GetOrganisationCount(prmOrganisation);
|
||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetOrganisationCount(prmOrganisation);
|
||||
model.PopulatePagingTo(prmOrganisation.ResultsPaging);
|
||||
using (DbResultSet resultSet = AccountMgr.ExecuteOrganisationQuery(columns, prmOrganisation))
|
||||
{
|
||||
@@ -96,6 +97,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
responseData.Organisations.Add(organisationData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Organisations.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
@@ -103,6 +106,169 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Request Organisation ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
private class AjaxResponse_RequestOrganisation : AjaxResponse_Data
|
||||
{
|
||||
// Construction.
|
||||
public AjaxResponse_RequestOrganisation(SaxModel_Online model) : base(model) { }
|
||||
// Organisation list.
|
||||
public List<OrganisationResponseData> Organisations { get; } = new List<OrganisationResponseData>();
|
||||
}
|
||||
//-------------------------------------------------------------------
|
||||
[HttpPost]
|
||||
[Route("Organisation/Ajax/RequestOrganisation")]
|
||||
public IActionResult Ajax_RequestOrganisation(Model_Organisation model)
|
||||
{
|
||||
String fn = GetType().Name + ".Ajax_RequestOrganisation";
|
||||
String messageTitle = Localiser["organisation.caption.organisation.request"];
|
||||
AjaxResponse_RequestOrganisation responseData = new AjaxResponse_RequestOrganisation(model);
|
||||
|
||||
// Validate session and referrer. User does not need to be logged in.
|
||||
if (!ValidReferer)
|
||||
return Forbid();
|
||||
SaxSessionData_Online sessionData = SessionData_Online;
|
||||
|
||||
if (!model.ValidateOrganisationRequestData(responseData))
|
||||
return Json(responseData);
|
||||
|
||||
// Check Regions.
|
||||
SaxRegion regionCountry = Internals.GetRegion(model.OrganisationRegionIdCountry.ToSysId());
|
||||
if (SysId.IsValid(model.OrganisationRegionIdCountry.ToSysId()) && regionCountry == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Country region not found. Id: " + model.OrganisationRegionIdCountry + ". " + getLogSuffix());
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
SaxRegion regionProvince = Internals.GetRegion(model.OrganisationAddressRegionIdProvince.ToSysId());
|
||||
if (SysId.IsValid(model.OrganisationAddressRegionIdProvince.ToSysId()) && regionProvince == null)
|
||||
{
|
||||
SaLogger.Warn(fn + " Province region not found. Id: " + model.OrganisationAddressRegionIdProvince + ". " + getLogSuffix());
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// User does not need to be logged in, but user details must be supplied if not.
|
||||
SaxUserAccount userAccount = null;
|
||||
if (ValidUserSession)
|
||||
{
|
||||
// Check that an email address hasn't been supplied.
|
||||
// NB Shouldn't happen as contact controls aren't displayed if user is logged in,
|
||||
// hence 'System' error response and nothing more specific.
|
||||
if (!StringUtil.IsEmpty(model.ContactEmailAddress))
|
||||
{
|
||||
SaLogger.Warn(fn + " Contact Email supplied when user logged in. " + getLogSuffix());
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
// Retrieve user account.
|
||||
userAccount = AccountMgr.GetUserAccountById(sessionData.User.UserAccountId);
|
||||
if (userAccount == null)
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Double check that contact details have been supplied - validated by model above.
|
||||
if (StringUtil.IsEmpty(model.ContactEmailAddress) || StringUtil.IsEmpty(model.ContactFirstName) || StringUtil.IsEmpty(model.ContactLastName))
|
||||
{
|
||||
SaLogger.Warn(fn + " Incomplete contact details supplied.");
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
// Check that the email doesn't exist.
|
||||
// NB This is validated by the model and shouldn't be required here.
|
||||
userAccount = AccountMgr.GetUserAccountByEmailAddress(model.ContactEmailAddress);
|
||||
if (userAccount != null)
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
userAccount = AccountMgr.CreateUserAccount();
|
||||
userAccount.EmailAddress = model.ContactEmailAddress;
|
||||
userAccount.FirstName = model.ContactFirstName;
|
||||
userAccount.LastName = model.ContactLastName;
|
||||
if (!AccountMgr.InsertUserAccount(userAccount, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert user contact - " + AccountMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
}
|
||||
|
||||
if (SysId.IsValid(model.OrganisationSportId.ToSysId()))
|
||||
{
|
||||
// Add User Sport if not already present.
|
||||
// NB This will also reactivate an inactive or deleted User Sport.
|
||||
SaxUserSport.Params prmUserSport = new SaxUserSport.Params();
|
||||
prmUserSport.UserAccountIdsIncluded.Add(userAccount.Id);
|
||||
prmUserSport.SportIdsIncluded.Add(model.OrganisationSportId.ToSysId());
|
||||
prmUserSport.StatusCat = SaxUserSport.StatusCat.Any;
|
||||
SaxUserSport userSport = AccountMgr.GetUserSport(prmUserSport);
|
||||
if (userSport == null)
|
||||
userSport = AccountMgr.CreateUserSport(userAccount.Id, model.OrganisationSportId.ToSysId());
|
||||
userSport.Status = SaxUserSport.DefaultStatus;
|
||||
if (!SysId.IsValid(userSport.Id))
|
||||
{
|
||||
if (!AccountMgr.InsertUserSport(userSport, DbUpdateInfo))
|
||||
{
|
||||
// Logg error but don't abort the request.
|
||||
SaLogger.Warn(fn + " Failed to insert User Sport: " + AccountMgr.ErrorStateMessage);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!AccountMgr.UpdateUserSport(userSport, DbUpdateInfo))
|
||||
{
|
||||
// Logg error but don't abort the request.
|
||||
SaLogger.Warn(fn + " Failed to update User Sport: " + AccountMgr.ErrorStateMessage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create Organisation.
|
||||
SaxOrganisation organisation = AccountMgr.CreateOrganisation();
|
||||
organisation.Name = model.OrganisationName;
|
||||
organisation.OrganisationType = model.GetOrganisationType();
|
||||
organisation.OrganisationCategory = model.GetOrganisationCategory();
|
||||
organisation.SportIdPrimary = model.OrganisationSportId.ToSysId();
|
||||
organisation.RegionIdPrimary = model.OrganisationRegionIdCountry.ToSysId();
|
||||
organisation.PhoneMain = model.OrganisationPhoneMain;
|
||||
organisation.Status = SaStatus.Awaiting;
|
||||
if (!AccountMgr.InsertOrganisation(organisation, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert organisation - " + AccountMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Add user as member of organisation.
|
||||
SaxUserOrganisation userOrganisation = AccountMgr.CreateUserOrganisation(userAccount.Id, organisation.Id);
|
||||
userOrganisation.OrganisationRoles.Add(Sax.OrganisationRole.Member);
|
||||
if (!AccountMgr.InsertUserOrganisation(userOrganisation, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert user organisation - " + AccountMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Create Organisation address.
|
||||
SaxItemAddress organisationAddress = ItemDataMgr.CreateItemAddress(organisation.GetItemId(), Sax.AddressType.Office);
|
||||
organisationAddress.Line1 = model.OrganisationAddressLine1;
|
||||
organisationAddress.Line2 = model.OrganisationAddressLine2;
|
||||
organisationAddress.Line3 = model.OrganisationAddressLine3;
|
||||
organisationAddress.Town = model.OrganisationAddressTown;
|
||||
organisationAddress.Province = model.OrganisationAddressProvince;
|
||||
organisationAddress.RegionIdProvince = model.OrganisationAddressRegionIdProvince.ToSysId();
|
||||
if (SysId.IsValid(regionCountry.Id))
|
||||
{
|
||||
organisationAddress.Country = regionCountry.Name;
|
||||
organisationAddress.RegionIdCountry = regionCountry.Id;
|
||||
}
|
||||
else organisationAddress.Country = model.OrganisationAddressCountry;
|
||||
organisationAddress.PostalCode = model.OrganisationAddressPostalCode;
|
||||
if (!ItemDataMgr.InsertItemAddress(organisationAddress, DbUpdateInfo))
|
||||
{
|
||||
SaLogger.Warn(fn + " Failed to insert organisation address - " + ItemDataMgr.ErrorStateMessage);
|
||||
return Json(responseData.SetGoHome(messageTitle, Localiser["msg.error.system"]));
|
||||
}
|
||||
|
||||
// Complete response.
|
||||
responseData.SetMessage(messageTitle, Localiser["msg.organisation.request.success"].ToString().ReplaceAll("\n", "<br>"));
|
||||
responseData.Success = true;
|
||||
return Json(responseData);
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Get Member Organisation List ajax request.
|
||||
//-------------------------------------------------------------------
|
||||
@@ -148,7 +314,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
prmUserOrganisation.OrganisationMembersOnly = true;
|
||||
prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly;
|
||||
prmUserOrganisation.SortColumns.Add(colOrganisationName);
|
||||
model.DataItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmUserOrganisation);
|
||||
model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmUserOrganisation);
|
||||
model.PopulatePagingTo(prmUserOrganisation.ResultsPaging);
|
||||
using (DbResultSet resultSet = AccountMgr.ExecuteUserOrganisationQuery(columns, prmUserOrganisation))
|
||||
{
|
||||
@@ -167,6 +333,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
responseData.Organisations.Add(organisationData);
|
||||
}
|
||||
}
|
||||
if (model.Paging.IsPaged)
|
||||
model.Paging.ItemCount = (ushort)responseData.Organisations.Count;
|
||||
|
||||
// Complete response.
|
||||
responseData.SetPaging(model);
|
||||
|
||||
@@ -360,15 +360,15 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
private void PopulateRequestPasswordEmailBody(SaEmailData emailData, SaxUserAccount userAccount)
|
||||
{
|
||||
// Will need to handle culture (language/country) as and when introduced.
|
||||
emailData.MessageBody = SaxResourceHelper.GetTextResource(SaxResourceHelper.TextResource.Email_RequestPassword_Html);
|
||||
emailData.MessageBody = SaxResourceHelper.GetTextResource(SaxResourceHelper.TextResource.Email_Security_RequestPassword_Html);
|
||||
emailData.HtmlBody = true;
|
||||
|
||||
// Replace dynamic tags.
|
||||
EmailConsole.ReplaceDynamicEmailBodyTags(emailData, null, userAccount);
|
||||
|
||||
// Replace dynamic tag for link back to change password page.
|
||||
SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.RequestPassword]", GenerateRequestPasswordLink(userAccount.Id, userAccount.EmailAddress, ""));
|
||||
SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.ExpiresMinutes]", GetRequestPasswordEmailLinkExpiresMinutes().ToString());
|
||||
SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.RequestPassword]", GenerateRequestPasswordLink(this, userAccount.Id, userAccount.EmailAddress, ""));
|
||||
SaEmailConsole.ReplaceDynamicEmailTag(emailData, "[#Link.ExpiresMinutes]", GetRequestPasswordEmailLinkExpiresMinutes(this).ToString());
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
@@ -383,21 +383,21 @@ namespace Saxonite.Net.Core.Web.Online.Controllers
|
||||
private static String Base64Key_RequestPassword { get; } = SacsEncryptionHelper.EncodePlainKey("{~Saxonite@@Request^Password=}", SacsEncryptionHelper.KeyLength);
|
||||
private static String Base64IV_RequestPassword_Generated { get; } = SacsEncryptionHelper.InitSymmetricEncryptionIV(Base64Key_RequestPassword);
|
||||
private static String Base64IV_RequestPassword { get; } = "1VAWYTW6d72n/6HDNhbqow==";
|
||||
private String GenerateRequestPasswordLink(SysId userAccountId, String emailAddress, String requestPasswordToken)
|
||||
internal static String GenerateRequestPasswordLink(SaxController_Online controller, SysId userAccountId, String emailAddress, String requestPasswordToken)
|
||||
{
|
||||
NameValueCollection parameters = new NameValueCollection();
|
||||
parameters.Add(ParamName_UserAccountId, SysId.ToString(userAccountId));
|
||||
parameters.Add(ParamName_EmailAddress, emailAddress);
|
||||
parameters.Add(ParamName_ExpiresAt, DateUtil.Format(DateTime.Now.AddMinutes(GetRequestPasswordEmailLinkExpiresMinutes()), DateUtil.Format_XmlDateTime));
|
||||
parameters.Add(ParamName_ExpiresAt, DateUtil.Format(DateTime.Now.AddMinutes(GetRequestPasswordEmailLinkExpiresMinutes(controller)), DateUtil.Format_XmlDateTime));
|
||||
parameters.Add(ParamName_Token, requestPasswordToken);
|
||||
String link =
|
||||
GetRedirectLocation(RedirectLocation.WebAppBase) + "Security/ChangePassword?" +
|
||||
ParamName_RequestPasswordEncrypted + "=" + HttpUtility.UrlEncode(EncryptParameters(parameters, Base64IV_RequestPassword, Base64Key_RequestPassword));
|
||||
controller.GetRedirectLocation(RedirectLocation.WebAppBase) + "Security/ChangePassword?" +
|
||||
ParamName_RequestPasswordEncrypted + "=" + HttpUtility.UrlEncode(controller.EncryptParameters(parameters, Base64IV_RequestPassword, Base64Key_RequestPassword));
|
||||
return link;
|
||||
}
|
||||
private int GetRequestPasswordEmailLinkExpiresMinutes()
|
||||
internal static int GetRequestPasswordEmailLinkExpiresMinutes(SaxController_Online controller)
|
||||
{
|
||||
int expiresMinutes = SessionConfig.Security.SignIn.PasswordRequest.EmailLinkExpiresMins;
|
||||
int expiresMinutes = controller.SessionConfig.Security.SignIn.PasswordRequest.EmailLinkExpiresMins;
|
||||
int expiresMinutes_Min = Sax.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Min;
|
||||
int expiresMinutes_Max = Sax.Config.Security.SignIn.PasswordRequest.EmailLinkExpiresMins_Max;
|
||||
return Math.Max(expiresMinutes_Min, Math.Min(expiresMinutes_Max, expiresMinutes));
|
||||
|
||||
@@ -69,7 +69,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
if (StringUtil.IsEmpty(AccountTitle))
|
||||
responseData.SetControlError(nameof(AccountTitle), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(AccountTitle) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_Title))
|
||||
responseData.SetControlError(nameof(AccountTitle), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.JournalistArticle_Headline)]);
|
||||
responseData.SetControlError(nameof(AccountTitle), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_Title)]);
|
||||
}
|
||||
|
||||
// First Name.
|
||||
@@ -79,7 +79,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
if (StringUtil.IsEmpty(AccountFirstName))
|
||||
responseData.SetControlError(nameof(AccountFirstName), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(AccountFirstName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName))
|
||||
responseData.SetControlError(nameof(AccountFirstName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.JournalistArticle_Headline)]);
|
||||
responseData.SetControlError(nameof(AccountFirstName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName)]);
|
||||
}
|
||||
|
||||
// Last Name.
|
||||
@@ -89,7 +89,7 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
if (StringUtil.IsEmpty(AccountLastName))
|
||||
responseData.SetControlError(nameof(AccountLastName), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(AccountLastName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName))
|
||||
responseData.SetControlError(nameof(AccountLastName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.JournalistArticle_Headline)]);
|
||||
responseData.SetControlError(nameof(AccountLastName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName)]);
|
||||
}
|
||||
|
||||
// Country Region.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Sarand.Net.Standard.Base.App;
|
||||
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.Base.App;
|
||||
using Saxonite.Net.Core.Web.Base.App;
|
||||
@@ -39,19 +40,186 @@ namespace Saxonite.Net.Core.Web.Online.Models
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation properties.
|
||||
public String OrganisationName { get; set; }
|
||||
public String OrganisationTypeValue { get; set; }
|
||||
public Sax.OrganisationType OrganisationType { get { return (Sax.OrganisationType)OrganisationTypeCodes.GetTypeForCode(OrganisationTypeValue); } }
|
||||
public String OrganisationCategoryValue { get; set; }
|
||||
public Sax.OrganisationCategory OrganisationCategory { get { return (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(OrganisationCategoryValue); } }
|
||||
public String OrganisationType { get; set; }
|
||||
public Sax.OrganisationType GetOrganisationType() { return (Sax.OrganisationType)OrganisationTypeCodes.GetTypeForCode(OrganisationType); }
|
||||
public String OrganisationCategory { get; set; }
|
||||
public Sax.OrganisationCategory GetOrganisationCategory() { return (Sax.OrganisationCategory)OrganisationCategoryCodes.GetTypeForCode(OrganisationCategory); }
|
||||
public String OrganisationSportId { get; set; }
|
||||
public String OrganisationRegionId { get; set; }
|
||||
public String OrganisationRegionIdCountry { get; set; }
|
||||
public String OrganisationPhoneMain { get; set; }
|
||||
// Organisation address
|
||||
public String OrganisationAddressLine1 { get; set; }
|
||||
public String OrganisationAddressLine2 { get; set; }
|
||||
public String OrganisationAddressLine3 { get; set; }
|
||||
public String OrganisationAddressTown { get; set; }
|
||||
public String OrganisationAddressProvince { get; set; }
|
||||
public String OrganisationAddressRegionIdProvince { get; set; }
|
||||
public String OrganisationAddressCountry { get; set; }
|
||||
public String OrganisationAddressPostalCode { get; set; }
|
||||
// User - for organisation request.
|
||||
public String ContactEmailAddress { get; set; }
|
||||
public String ContactFirstName { get; set; }
|
||||
public String ContactLastName { get; set; }
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// Validation.
|
||||
//-------------------------------------------------------------------
|
||||
// Organisation.
|
||||
public bool ValidateOrganisationData(SaxController_Base.AjaxResponse_Data responseData)
|
||||
public bool ValidateOrganisationRequestData(SaxController_Base.AjaxResponse_Data responseData)
|
||||
{
|
||||
// User Email Address - mandatory when supplied.
|
||||
if (ContactEmailAddress != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(ContactEmailAddress), ContactEmailAddress);
|
||||
if (StringUtil.IsEmpty(ContactEmailAddress))
|
||||
responseData.SetControlError(nameof(ContactEmailAddress), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!SacsDataValidationHelper.IsValidEmailAddress(ContactEmailAddress))
|
||||
responseData.SetControlError(nameof(ContactEmailAddress), Localiser["msg.validation.invalid.value"]);
|
||||
else if (StringUtil.GetLength(ContactEmailAddress) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress))
|
||||
responseData.SetControlError(nameof(ContactEmailAddress), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress)]);
|
||||
else if (AccountMgr.UserAccountExistsByEmailAddress(ContactEmailAddress))
|
||||
responseData.SetControlError(nameof(ContactEmailAddress), Localiser["msg.validation.duplicate.value"]);
|
||||
}
|
||||
|
||||
// User First Name - mandatory when supplied.
|
||||
if (ContactFirstName != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(ContactFirstName), ContactFirstName);
|
||||
if (StringUtil.IsEmpty(ContactFirstName))
|
||||
responseData.SetControlError(nameof(ContactFirstName), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(ContactFirstName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName))
|
||||
responseData.SetControlError(nameof(ContactFirstName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName)]);
|
||||
}
|
||||
|
||||
// User Last Name - mandatory when supplied.
|
||||
if (ContactLastName != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(ContactLastName), ContactLastName);
|
||||
if (StringUtil.IsEmpty(ContactLastName))
|
||||
responseData.SetControlError(nameof(ContactLastName), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(ContactLastName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName))
|
||||
responseData.SetControlError(nameof(ContactLastName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName)]);
|
||||
}
|
||||
|
||||
// Organisation Name - mandatory.
|
||||
responseData.SetControlValue(nameof(OrganisationName), OrganisationName);
|
||||
if (StringUtil.IsEmpty(OrganisationName))
|
||||
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(OrganisationName) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name))
|
||||
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name)]);
|
||||
else if (SysId.IsValid(OrganisationRegionIdCountry.ToSysId()))
|
||||
{
|
||||
// Ensure that the organisation name is unique within the country.
|
||||
SaxOrganisation.Params prmOrganisation = new SaxOrganisation.Params();
|
||||
prmOrganisation.NameFull = OrganisationName;
|
||||
prmOrganisation.RegionIdsIncluded.Add(OrganisationRegionIdCountry.ToSysId());
|
||||
prmOrganisation.StatusCat = SaxOrganisation.StatusCat.Any;
|
||||
if (AccountMgr.GetOrganisationCount(prmOrganisation) > 0)
|
||||
responseData.SetControlError(nameof(OrganisationName), Localiser["msg.validation.duplicate.value"]);
|
||||
}
|
||||
|
||||
// Organisation Category - mandatory.
|
||||
if (StringUtil.IsEmpty(OrganisationCategory))
|
||||
responseData.SetControlError(nameof(OrganisationCategory), Localiser["msg.validation.mandatory.value"]);
|
||||
|
||||
// Organisation Type - mandatory.
|
||||
if (StringUtil.IsEmpty(OrganisationType))
|
||||
responseData.SetControlError(nameof(OrganisationType), Localiser["msg.validation.mandatory.value"]);
|
||||
|
||||
// Organisation Sport - mandatory for certain organisation categories.
|
||||
if (StringUtil.IsEmpty(OrganisationSportId) && SaxOrganisation.IsSportMandatory(GetOrganisationCategory()))
|
||||
responseData.SetControlError(nameof(OrganisationSportId), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!StringUtil.IsEmpty(OrganisationSportId) && !SysId.IsValid(OrganisationSportId.ToSysId()))
|
||||
responseData.SetControlError(nameof(OrganisationSportId), Localiser["msg.validation.invalid.value"]);
|
||||
|
||||
// Organisation Region Country - mandatory.
|
||||
if (StringUtil.IsEmpty(OrganisationRegionIdCountry))
|
||||
responseData.SetControlError(nameof(OrganisationRegionIdCountry), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (!SysId.IsValid(OrganisationRegionIdCountry.ToSysId()))
|
||||
responseData.SetControlError(nameof(OrganisationRegionIdCountry), Localiser["msg.validation.invalid.value"]);
|
||||
|
||||
// Organisation Address Line 1 - mandatory.
|
||||
responseData.SetControlValue(nameof(OrganisationAddressLine1), OrganisationAddressLine1);
|
||||
if (StringUtil.IsEmpty(OrganisationAddressLine1))
|
||||
responseData.SetControlError(nameof(OrganisationAddressLine1), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(OrganisationAddressLine1) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1))
|
||||
responseData.SetControlError(nameof(OrganisationAddressLine1), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)]);
|
||||
|
||||
// Organisation Address Line 2 - optional.
|
||||
if (OrganisationAddressLine2 != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationAddressLine2), OrganisationAddressLine2);
|
||||
if (!StringUtil.IsEmpty(OrganisationAddressLine2))
|
||||
{
|
||||
if (StringUtil.GetLength(OrganisationAddressLine2) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2))
|
||||
responseData.SetControlError(nameof(OrganisationAddressLine2), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Organisation Address Line 3 - optional.
|
||||
if (OrganisationAddressLine3 != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationAddressLine3), OrganisationAddressLine3);
|
||||
if (!StringUtil.IsEmpty(OrganisationAddressLine3))
|
||||
{
|
||||
if (StringUtil.GetLength(OrganisationAddressLine3) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3))
|
||||
responseData.SetControlError(nameof(OrganisationAddressLine3), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Organisation Address Town - mandatory.
|
||||
responseData.SetControlValue(nameof(OrganisationAddressTown), OrganisationAddressTown);
|
||||
if (StringUtil.IsEmpty(OrganisationAddressTown))
|
||||
responseData.SetControlError(nameof(OrganisationAddressTown), Localiser["msg.validation.mandatory.value"]);
|
||||
else if (StringUtil.GetLength(OrganisationAddressTown) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town))
|
||||
responseData.SetControlError(nameof(OrganisationAddressTown), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)]);
|
||||
|
||||
// Organisation Address Province - optional.
|
||||
if (OrganisationAddressProvince != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationAddressProvince), OrganisationAddressProvince);
|
||||
if (!StringUtil.IsEmpty(OrganisationAddressProvince))
|
||||
{
|
||||
if (StringUtil.GetLength(OrganisationAddressProvince) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province))
|
||||
responseData.SetControlError(nameof(OrganisationAddressProvince), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Organisation Address Country - optional.
|
||||
if (OrganisationAddressCountry != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationAddressCountry), OrganisationAddressCountry);
|
||||
if (!StringUtil.IsEmpty(OrganisationAddressCountry))
|
||||
{
|
||||
if (StringUtil.GetLength(OrganisationAddressCountry) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country))
|
||||
responseData.SetControlError(nameof(OrganisationAddressCountry), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Country)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Organisation Address PostalCode - optional.
|
||||
if (OrganisationAddressPostalCode != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationAddressPostalCode), OrganisationAddressPostalCode);
|
||||
if (!StringUtil.IsEmpty(OrganisationAddressPostalCode))
|
||||
{
|
||||
if (StringUtil.GetLength(OrganisationAddressPostalCode) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode))
|
||||
responseData.SetControlError(nameof(OrganisationAddressPostalCode), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)]);
|
||||
}
|
||||
}
|
||||
|
||||
// Organisation Phone Main - optional.
|
||||
if (OrganisationPhoneMain != null)
|
||||
{
|
||||
responseData.SetControlValue(nameof(OrganisationPhoneMain), OrganisationPhoneMain);
|
||||
if (!StringUtil.IsEmpty(OrganisationPhoneMain))
|
||||
{
|
||||
if (!SacsDataValidationHelper.IsValidPhone(OrganisationPhoneMain))
|
||||
responseData.SetControlError(nameof(OrganisationPhoneMain), Localiser["msg.validation.invalid.value"]);
|
||||
else if (StringUtil.GetLength(OrganisationPhoneMain) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_PhoneMain))
|
||||
responseData.SetControlError(nameof(OrganisationPhoneMain), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_PhoneMain)]);
|
||||
}
|
||||
}
|
||||
|
||||
return !responseData.HasControlErrors();
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="jQuery.UI.Combined" Version="1.12.1" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.13" />
|
||||
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.16" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -9,7 +9,14 @@
|
||||
<div class="row">
|
||||
<div class="col"><div class="sax-caption">@Localiser["account.caption.profile.organisations"]</div></div>
|
||||
<div class="fixed">
|
||||
<!-- <div class="sax-action sax-edit"><img src="~/img/action/edit24.png" alt="@(Localiser["label.update"])" title="@(Localiser["label.update"])" /></div> -->
|
||||
<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">
|
||||
<li><div class="sax-action sax-dropdown-item" onclick="sax.orgReq.fn.requestOrganisation();">@Localiser["organisation.caption.organisation.request"]</div></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,3 +63,5 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<partial name="~/Views/Common/OrganisationRequest.cshtml" />
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
@model SaxModel_Online
|
||||
@inject SaxLocaliser Localiser
|
||||
|
||||
@{
|
||||
int regionIdCountry = Model.ValidUserSession ? Model.SessionData.User.RegionIdCountry.ToInt() : 0;
|
||||
String regionNameCountry = Model.ValidUserSession ? Localiser.EscapeJavascriptText(Model.GetRegionCaption(Model.SessionData.User.RegionIdCountry)) : "";
|
||||
}
|
||||
<script type="text/javascript">
|
||||
sax.orgReq = {};
|
||||
sax.orgReq.dlgTitleRequestOrganisation = '@Localiser.GetJavascriptText("organisation.caption.organisation.request")';
|
||||
let or = sax.orgReq = {};
|
||||
or.dlgTitleRequestOrganisation = '@Localiser.GetJavascriptText("organisation.caption.organisation.request")';
|
||||
sax.data.regionIdCountryDefault = @regionIdCountry;
|
||||
sax.data.regionNameCountryDefault = '@regionNameCountry';
|
||||
</script>
|
||||
|
||||
<div id="dlgOrganisationRequest" class="sax-dialog sax-form">
|
||||
@@ -11,65 +16,213 @@
|
||||
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmOrganisationRequest", @class = "sax-form", @onSubmit = "return false;" }))
|
||||
{
|
||||
|
||||
@* Contact details are only required when user not logged in. *@
|
||||
@if (!Model.ValidUserSession)
|
||||
{
|
||||
|
||||
<div class="sax-form-control pt8">
|
||||
<div class="sax-caption">
|
||||
<label for="ifContactEmailAddress"><span>@Localiser["label.contact.details"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Contact Email Address *@
|
||||
<div class="sax-form-control ContactEmailAddress">
|
||||
<div class="sax-label">
|
||||
<label for="ifContactEmailAddress"><span><span class="required">*</span> @Localiser["label.email"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
<input type="text" id="ifContactEmailAddress" name="ContactEmailAddress" class="ContactEmailAddress sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_EmailAddress)" />
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Contact First Name *@
|
||||
<div class="sax-form-control ContactFirstName pr4">
|
||||
<div class="sax-label">
|
||||
<label for="cbContactFirstName"><span><span class="required">*</span> @Localiser["label.first.name"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
<input type="text" id="ifContactFirstName" name="ContactFirstName" class="ContactFirstName sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_FirstName)" />
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Contact Last Name *@
|
||||
<div class="sax-form-control ContactLastName pr4">
|
||||
<div class="sax-label">
|
||||
<label for="cbContactLastName"><span><span class="required">*</span> @Localiser["label.last.name"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
<input type="text" id="ifContactLastName" name="ContactLastName" class="ContactLastName sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.UserAccount_LastName)" />
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
}
|
||||
|
||||
<div class="sax-form-control">
|
||||
<div class="sax-caption">
|
||||
<label for="ifContactEmailAddress"><span>@Localiser["label.organsiation.details"]</span></label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@* Organisation name *@
|
||||
<div class="sax-form-control OrganisationName">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationName"><span><span class="required">*</span> @Localiser["label.name"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
<input type="text" id="ifOrganisationName" name="OrganisationName" class="OrganisationName sax-input" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name)" />
|
||||
<input type="text" id="ifOrganisationName" name="OrganisationName" class="OrganisationName sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Organisation_Name)" />
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation type *@
|
||||
<div class="sax-form-control OrganisationType">
|
||||
<div class="sax-label">
|
||||
<label for="cbOrganisationType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
@Html.DropDownList("", Model.OrganisationTypesForSelect, Localiser["label.select"], new { @id = "cbOrganisationType", @name = "OrganisationTypeValue", @class = "OrganisationType sax-select" })
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Organisation category *@
|
||||
<div class="sax-form-control OrganisationCategory pr4">
|
||||
<div class="sax-label">
|
||||
<label for="cbOrganisationCategory"><span><span class="required">*</span> @Localiser["label.category"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
@Html.DropDownList("", Model.OrganisationCategoriesForSelect, Localiser["label.select"], new { @id = "cbOrganisationCategory", @name = "OrganisationCategory", @class = "OrganisationCategory sax-select" })
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation category *@
|
||||
<div class="sax-form-control OrganisationCategory">
|
||||
<div class="sax-label">
|
||||
<label for="cbOrganisationCategory"><span><span class="required">*</span> @Localiser["label.category"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
@Html.DropDownList("", Model.OrganisationCategoriesForSelect, Localiser["label.select"], new { @id = "cbOrganisationCategory", @name = "OrganisationCategoryValue", @class = "OrganisationCategory sax-select" })
|
||||
|
||||
<div class="col-sm-6">
|
||||
|
||||
@* Organisation type *@
|
||||
<div class="sax-form-control OrganisationType">
|
||||
<div class="sax-label">
|
||||
<label for="cbOrganisationType"><span><span class="required">*</span> @Localiser["label.type"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control">
|
||||
@Html.DropDownList("", Model.OrganisationTypesForSelect, Localiser["label.select"], new { @id = "cbOrganisationType", @name = "OrganisationType", @class = "OrganisationType sax-select" })
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
|
||||
</div>
|
||||
|
||||
@* Organisation sport *@
|
||||
<div class="sax-form-control OrganisationSportId">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationSportId"><span><span class="required">*</span> @Localiser["label.sport"]</span></label>
|
||||
<label for="ifOrganisationSportCaption"><span><span class="required">*</span> @Localiser["label.sport"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<input type="hidden" id="ifOrganisationSportId" name="" OrganisationSportId"" class="OrganisationSportId" />
|
||||
<input type="hidden" id="ifOrganisationSportId" name="OrganisationSportId" OrganisationSportId"" 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.selectOrgSport()">@Localiser["label.select"]</button></div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation region *@
|
||||
<div class="sax-form-control OrganisationRegionId">
|
||||
@* Organisation country *@
|
||||
<div class="sax-form-control OrganisationRegionIdCountry">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationRegionId"><span><span class="required">*</span> @Localiser["label.region"]</span></label>
|
||||
<label for="ifOrganisationRegionCaption"><span><span class="required">*</span> @Localiser["label.country"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<input type="hidden" id="ifOrganisationRegionId" name="" OrganisationRegionId"" class="OrganisationRegionId" />
|
||||
<div class="col"><input type="text" id="ifOrganisationRegionCaption" class="OrganisationRegionCaption sax-input" readonly="readonly" ondblclick="sax.selectRegion()" /> </div>
|
||||
<input type="hidden" id="ifOrganisationRegionIdCountry" name="OrganisationRegionIdCountry" OrganisationRegionIdCountry"" 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.selectOrgRegion()">@Localiser["label.select"]</button></div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - Line 1 *@
|
||||
<div class="sax-form-control OrganisationAddressLine1">
|
||||
<div class="sax-caption">
|
||||
<label for="ifOrganisationAddressLine1"><span><span class="required">*</span> @Localiser["label.organisation.address"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressLine1" name="OrganisationAddressLine1" class="OrganisationAddressLine1 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line1)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - Line 2 *@
|
||||
<div class="sax-form-control OrganisationAddressLine2">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressLine2" name="OrganisationAddressLine2" class="OrganisationAddressLine2 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line2)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - Line 3 *@
|
||||
<div class="sax-form-control OrganisationAddressLine3">
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressLine3" name="OrganisationAddressLine3" class="OrganisationAddressLine3 sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Line3)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - Town *@
|
||||
<div class="sax-form-control OrganisationAddressTown">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationAddressTown"><span><span class="required">*</span> @Localiser["label.town"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressTown" name="OrganisationAddressTown" class="OrganisationAddressTown sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Town)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - Province *@
|
||||
<div class="sax-form-control OrganisationAddressProvince">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationAddressProvince"><span><span class="required">*</span> @Localiser["label.province"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressProvince" name="OrganisationAddressProvince" class="OrganisationAddressProvince sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_Province)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation address - PostalCode *@
|
||||
<div class="sax-form-control OrganisationAddressPostalCode">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationAddressPostalCode"><span><span class="required">*</span> @Localiser["label.postalCode"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationAddressPostalCode" name="OrganisationAddressPostalCode" class="OrganisationAddressPostalCode sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.ItemAddress_PostalCode)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
|
||||
@* Organisation PhoneMain *@
|
||||
@*
|
||||
<div class="sax-form-control OrganisationPhoneMain">
|
||||
<div class="sax-label">
|
||||
<label for="ifOrganisationPhoneMain"><span><span class="required">*</span> @Localiser["label.phone"]</span></label>
|
||||
</div>
|
||||
<div class="sax-control row">
|
||||
<div class="col"><input type="text" id="ifOrganisationPhoneMain" name="OrganisationPhoneMain" class="OrganisationPhoneMain sax-input" autocomplete="off" maxlength="@Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.Item_PhoneMain)" /> </div>
|
||||
</div>
|
||||
<div class="sax-message"></div>
|
||||
</div>
|
||||
*@
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
<div class="spacer8"></div>
|
||||
|
||||
@* Register Organisation *@
|
||||
@if (false)
|
||||
@if (true)
|
||||
{
|
||||
<div class="sax-panel-info">
|
||||
<div class="sax-content">
|
||||
<div class="sax-para">Do you belong to a club or association that would benefit from participating on this platform?</div>
|
||||
<div class="sax-para">Sign-up now with a few details and we'll let you know when you can login and get going.</div>
|
||||
<div class="sax-para center"><div class="sax-button-cta" onclick="sax.orgReq.fn.requestOrganisation()">Register Your Organisation</div></div>
|
||||
<div class="sax-para">@Localiser["home.organisation.request.para1"]</div>
|
||||
<div class="sax-para">@Localiser["home.organisation.request.para2"]</div>
|
||||
<div class="sax-para center"><div class="sax-button-cta" onclick="sax.orgReq.fn.requestOrganisation()">@Localiser["home.organisation.request.action"]</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<partial name="~/Views/Common/OrganisationRequest.cshtml" />
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SWP-Email-Prod",
|
||||
"Context": "SAX-SF-Prod",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [],
|
||||
"AddressesBcc": [ "dev@solumforti.com" ]
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
}
|
||||
},
|
||||
"Email": {
|
||||
"Context": "SWP-Email-Prod",
|
||||
"Context": "SAX-SF-Prod",
|
||||
"ContactUs": {
|
||||
"AddressesTo": [ ],
|
||||
"AddressesTo": [],
|
||||
"AddressesBcc": [ "dev@solumforti.com" ]
|
||||
},
|
||||
"Signup": {
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
.sax-panel-form > .sax-header .sax-caption
|
||||
{
|
||||
color:#f0f0f0;
|
||||
color: #f0f0f0;
|
||||
}
|
||||
|
||||
.sax-panel-info > .sax-header .sax-action img:hover,
|
||||
@@ -66,6 +66,24 @@
|
||||
box-shadow: 2px 2px 4px 0 #80808080;
|
||||
}
|
||||
|
||||
.sax-panel-info > .sax-header .dropdown-menu,
|
||||
.sax-panel-form > .sax-header .dropdown-menu
|
||||
{
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.sax-panel-info > .sax-header ul.nav,
|
||||
.sax-panel-form > .sax-header ul.nav
|
||||
{
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.sax-panel-info > .sax-header .dropdown-menu .sax-action,
|
||||
.sax-panel-form > .sax-header .dropdown-menu .sax-action
|
||||
{
|
||||
font-size: .8rem;
|
||||
}
|
||||
|
||||
.sax-panel-info > .sax-content,
|
||||
.sax-panel-form > .sax-content
|
||||
{
|
||||
@@ -110,6 +128,7 @@
|
||||
{
|
||||
}
|
||||
|
||||
.sax-form .sax-form-control .sax-caption,
|
||||
.sax-form .sax-form-control .sax-label
|
||||
{
|
||||
margin: 0 0 4px 0;
|
||||
@@ -117,6 +136,12 @@
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.sax-form .sax-form-control .sax-caption
|
||||
{
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.sax-form .sax-form-control .sax-label-text
|
||||
{
|
||||
font-size: 1rem;
|
||||
@@ -151,7 +176,7 @@
|
||||
|
||||
.sax-form .sax-input.sax-calendar
|
||||
{
|
||||
max-width:180px;
|
||||
max-width: 180px;
|
||||
}
|
||||
|
||||
.sax-form .sax-textarea, .sax-form .sax-select[multiple="multiple"]
|
||||
|
||||
@@ -143,7 +143,7 @@ a:focus
|
||||
.sax-action-link
|
||||
{
|
||||
display: inline-block;
|
||||
font-size: 16px;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
color: #000;
|
||||
cursor: pointer;
|
||||
@@ -254,6 +254,7 @@ a:focus
|
||||
}
|
||||
|
||||
/* --- Modal Please wait --- */
|
||||
|
||||
#sax-please-wait
|
||||
{
|
||||
display: none;
|
||||
@@ -267,7 +268,16 @@ a:focus
|
||||
background: rgba(250,250,250,.25) url('../img/animated/InProgress-01.gif') 50% 50% no-repeat;
|
||||
}
|
||||
|
||||
/* Drop down menus */
|
||||
|
||||
.dropdown-toggle.caret-off::before,
|
||||
.dropdown-toggle.caret-off::after
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Dialogs */
|
||||
|
||||
.sax-dialog
|
||||
{
|
||||
display: none;
|
||||
@@ -301,7 +311,7 @@ a:focus
|
||||
|
||||
.ui-dialog.ui-widget.sax-dialog-rounding-none.ui-widget-content.ui-corner-all
|
||||
{
|
||||
border-radius:0;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.ui-dialog.ui-widget .ui-widget-header
|
||||
@@ -349,7 +359,7 @@ a:focus
|
||||
{
|
||||
float: none;
|
||||
width: 100%;
|
||||
text-align:right;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.ui-dialog .ui-dialog-buttonpane button
|
||||
|
||||
@@ -62,10 +62,6 @@
|
||||
$item.off('dblclick').on('dblclick', function () { sax.updateItem(item.id) })
|
||||
$('.sax-panel-results .sax-panel-messages').hide().empty();
|
||||
}
|
||||
sax.refreshPaging = function (response)
|
||||
{
|
||||
sax.resultsPaging.fn.refreshPaging(response.paging);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
sax.segmentId = function (idx)
|
||||
|
||||
@@ -108,6 +108,11 @@
|
||||
{
|
||||
return $(sel).datepicker();
|
||||
}
|
||||
sax.refreshPaging = function (response, context, refreshFn)
|
||||
{
|
||||
if (sax.resultsPaging.fn.refreshPaging)
|
||||
sax.resultsPaging.fn.refreshPaging(response.paging, context, refreshFn);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Page navigation.
|
||||
@@ -380,9 +385,9 @@
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Data entry.
|
||||
sax.clearControlErrors = function ()
|
||||
sax.clearControlErrors = function (context)
|
||||
{
|
||||
var $ctrls = $('.sax-form-control').removeClass('sax-error');
|
||||
var $ctrls = $('.sax-form-control', $(context)).removeClass('sax-error');
|
||||
$('.sax-message', $ctrls).empty();
|
||||
}
|
||||
sax.clearControlError = function (sel)
|
||||
@@ -397,7 +402,7 @@
|
||||
}
|
||||
sax.refreshControlValues = function (controlValues, context)
|
||||
{
|
||||
var $frmCtrls = $('.sax-form-control', context).removeClass('sax-error');
|
||||
var $frmCtrls = $('.sax-form-control', $(context)).removeClass('sax-error');
|
||||
sax.clearControlErrors();
|
||||
var values = (controlValues || []);
|
||||
var valuesLen = values.length;
|
||||
|
||||
@@ -12,6 +12,10 @@
|
||||
or.fn.requestOrganisation = function ()
|
||||
{
|
||||
or.fn.init();
|
||||
$('input[type="text"],textarea,select,.OrganisationSportId,.OrganisationRegionIdCountry', or.$frm).val('');
|
||||
$('.OrganisationRegionIdCountry', or.$frm).val(sax.data.regionIdCountryDefault);
|
||||
$('.OrganisationRegionCaptionCountry', or.$frm).val(sax.data.regionNameCountryDefault);
|
||||
sax.clearControlErrors(or.$frm);
|
||||
sax.openDialog(or.$dlg, 640, 760);
|
||||
}
|
||||
or.fn.storeOrganisation = function ()
|
||||
@@ -23,8 +27,11 @@
|
||||
or.fn.handleRequestOrganisationResponse = function (response)
|
||||
{
|
||||
sax.debug('or.handleRequestOrganisationResponse', response);
|
||||
if (!response) return;
|
||||
sax.refreshControlValues(response.controlValues, or.$frm);
|
||||
if (!response.success) return;
|
||||
|
||||
or.$dlg.dialog('close');
|
||||
or.fn.cleanUp();
|
||||
}
|
||||
or.fn.cleanUp = function ()
|
||||
{
|
||||
@@ -44,12 +51,12 @@
|
||||
//--------------------------------------------------------------
|
||||
sax.selectOrgRegion = function ()
|
||||
{
|
||||
sax.data.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.OrganisationRegionId', or.$frm).val(), typesInc:[30], fnCallback: sax.onSelectOrgRegion })
|
||||
sax.data.selectRegion.fn.selectRegion({ caption: sax.dlg.title.selectRegion, regionId: $('.OrganisationRegionIdCountry', or.$frm).val(), typesInc:[30], fnCallback: sax.onSelectOrgRegion })
|
||||
}
|
||||
sax.onSelectOrgRegion = function (region)
|
||||
{
|
||||
sax.clearControlError($('.OrganisationRegionId', or.$frm).val(region.id));
|
||||
$('.OrganisationRegionCaption', or.$frm).val(region ? region.name : '');
|
||||
sax.clearControlError($('.OrganisationRegionIdCountry', or.$frm).val(region.id));
|
||||
$('.OrganisationRegionCaptionCountry', or.$frm).val(region ? region.name : '');
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------
|
||||
@@ -59,9 +66,11 @@
|
||||
var opt = sax.dlgOpts();
|
||||
opt.title = sax.orgReq.dlgTitleRequestOrganisation;
|
||||
opt.buttons[sax.dlg.btn.ok] = function () { or.fn.storeOrganisation(); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { or.fn.cleanUp(); $(this).dialog('close'); };
|
||||
opt.buttons[sax.dlg.btn.cancel] = function () { $(this).dialog('close'); or.fn.cleanUp(); };
|
||||
or.$dlg = $('#dlgOrganisationRequest').dialog(opt);
|
||||
or.$frm = $('#frmOrganisationRequest', or.$dlg);
|
||||
$('.sax-input, .sax-textarea', or.$frm).on('input', function () { sax.clearControlError(this); });
|
||||
$('.sax-select', or.$frm).on('change', function () { sax.clearControlError(this); });
|
||||
}
|
||||
|
||||
}(window, window.document));
|
||||
|
||||
Reference in New Issue
Block a user