diff --git a/SaxoniteCoreWeb/Base/Consoles/SaxActivityConsole_Web.cs b/SaxoniteCoreWeb/Base/Consoles/SaxActivityConsole_Web.cs index a397c19..0523fb5 100644 --- a/SaxoniteCoreWeb/Base/Consoles/SaxActivityConsole_Web.cs +++ b/SaxoniteCoreWeb/Base/Consoles/SaxActivityConsole_Web.cs @@ -100,6 +100,8 @@ namespace Saxonite.Net.Core.Web.Base.Consoles prmActivityIndex.EffectiveFrom = context.EffectiveFrom; prmActivityIndex.EffectiveTo = context.EffectiveTo; prmActivityIndex.Alias_ActivityIndex = alias_ActivityIndex; + prmActivityIndex.ResultsPaging.PageNo = 1; + prmActivityIndex.ResultsPaging.PageLength = 100; query.Filters.AddRange(internals.ActivityMgr.GetActivityIndexQueryFilter(prmActivityIndex)); // First pass, note the activity Item and effective date. @@ -137,7 +139,8 @@ namespace Saxonite.Net.Core.Web.Base.Consoles { PopulateUserActivityDetails(context, activities); PopulateArticleDetails(context, activities); - PopulateOrganisationOpportunitiesDetails(context, activities); + PopulateOrganisationEventDetails(context, activities); + PopulateOrganisationOpportunityDetails(context, activities); } //------------------------------------------------------------------- @@ -247,9 +250,67 @@ namespace Saxonite.Net.Core.Web.Base.Consoles } } + //------------------------------------------------------------------- + // Organisation Event details. + private void PopulateOrganisationEventDetails(IndexContext context, List activities) + { + // Extract organisationEvent Ids. + List organisationEventIds = activities.FindAll(item => item.ItemId.Type == (int)Sax.DataItemType.OrganisationEvent).Select(ItemId => ItemId.ItemId.Id).ToList(); + if (organisationEventIds.IsEmpty()) return; + + // Event columns - limit to essential information. + ColumnDfn colId = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Id); + ColumnDfn colOrganisationId = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.OrganisationId); + ColumnDfn colOrganisation = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Organisation_Name); + ColumnDfn colEventAt = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.EventAt_DateTime); + ColumnDfn colSummary = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Summary); + ColumnDfn colDetails = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Details); + ColumnDfn colSportId = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.SportIdPrimary); + ColumnDfn colSportName = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Sport_Name); + ColumnDfn colRegionId = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.RegionIdCountry); + ColumnDfn colRegionName = Internals.ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Region_Name); + List columns = new List() { colId, colOrganisationId, colOrganisation, colEventAt, colSummary, colDetails, colSportId, colSportName, colRegionId, colRegionName }; + + // Event filter. + SaxOrganisationEvent.Params prmEvent = new SaxOrganisationEvent.Params(); + prmEvent.IdsIncluded.AddRange(organisationEventIds); + prmEvent.StatusCat = SaxOrganisationEvent.StatusCat.ActiveOnly; + + using (DbResultSet dbResultSet = Internals.ActivityMgr.ExecuteOrganisationEventQuery(columns, prmEvent)) + { + while (dbResultSet != null && dbResultSet.NextRecord()) + { + NamedValue.Map values = dbResultSet.GetRecordValues(); + ItemId itemId = new ItemId((short)Sax.DataItemType.OrganisationEvent, new SysId(values.GetLong(colId.DataName))); + SysId organisationId = new SysId(values.GetLong(colOrganisationId.DataName)); + String organisation = values.GetString(colOrganisation.DataName); + DateTime eventAt = values.GetDateTime(colEventAt.DataName); + String eventAtDisplay = DateUtil.Format(eventAt, "d-MMM-yy"); + if (eventAt.Hour > 0 || eventAt.Minute > 0) + eventAtDisplay += DateUtil.Format(values.GetDateTime(colEventAt.DataName), " HH:mm"); + String eventSummary = values.GetString(colSummary.DataName); + String eventDetails = values.GetString(colDetails.DataName); + SysId sportId = new SysId(values.GetLong(colSportId.DataName)); + String sportName = values.GetString(colSportName.DataName); + SysId regionId = new SysId(values.GetLong(colRegionId.DataName)); + String regionName = values.GetString(colRegionName.DataName); + + // Populate to corresponding activities. + foreach (ActivityData_Web activity in activities.FindAll(item => item.ItemId.Equals(itemId))) + { + activity.SetOrganisation(organisationId, organisation); + activity.SetCaption(eventAtDisplay); + activity.SetBlurb(eventSummary); + activity.SetSport(sportId, sportName); + activity.SetRegion(regionId, regionName); + } + } + } + } + //------------------------------------------------------------------- // Organisation Opportunity details. - private void PopulateOrganisationOpportunitiesDetails(IndexContext context, List activities) + private void PopulateOrganisationOpportunityDetails(IndexContext context, List activities) { // Extract opportunity Ids. List opportunityIds = activities.FindAll(item => item.ItemId.Type == (int)Sax.DataItemType.OrganisationOpportunity).Select(ItemId => ItemId.ItemId.Id).ToList(); @@ -258,14 +319,14 @@ namespace Saxonite.Net.Core.Web.Base.Consoles // Opportunity columns - limit to essential information. ColumnDfn colId = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Id); ColumnDfn colOrganisationId = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.OrganisationId); - ColumnDfn colOrganisation= Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Organisation_Name); + ColumnDfn colOrganisation = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Organisation_Name); ColumnDfn colPosition = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Position); ColumnDfn colOutline = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Outline); ColumnDfn colSportId = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.SportIdPrimary); ColumnDfn colSportName = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Sport_Name); ColumnDfn colRegionId = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.RegionIdPrimary); ColumnDfn colRegionName = Internals.ActivityMgr.GetOrganisationOpportunityColumnDfn(SaxOrganisationOpportunity.Column.Region_Name); - List columns = new List() { colId, colPosition, colOutline, colSportId, colSportName, colRegionId, colRegionName }; + List columns = new List() { colId, colOrganisationId, colOrganisation, colPosition, colOutline, colSportId, colSportName, colRegionId, colRegionName }; // Opportunity filter. SaxOrganisationOpportunity.Params prmOpportunity = new SaxOrganisationOpportunity.Params(); diff --git a/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs b/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs index 63c06ef..7e29b86 100644 --- a/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs +++ b/SaxoniteCoreWeb/Base/Controllers/SaxController_Base.cs @@ -238,19 +238,19 @@ namespace Saxonite.Net.Core.Web.Base.Controllers String fn = nameof(ControllerBase) + ".EncryptParameters"; try { - // Copy the list of parameters, adding a random name/value pair to randomise the encryption. + // Copy the list of parameters and sort the keys. NameValueCollection parametersToEncrypt = new NameValueCollection(parameters); - // NB Range 10-189 intended to have equal chance of 2 or 3 digit number. - parametersToEncrypt.Add("!" + SacsRandomHelper.getRandomLengthNumber(4), null); - - // Sort the keys to ensure that the random '!' param is first in the query string. String[] paramKeys = parametersToEncrypt.AllKeys; Array.Sort(paramKeys); // Serialise parameters as if in a URL query string - so that they can be deserialised in DecryptParameters() below. - string queryString = String.Join("&", paramKeys.Select(a => a + "=" + HttpUtility.UrlEncode(parametersToEncrypt[a]))); + // Start with a random length parameter name at start of list to obscure the encryption. + string queryString = SacsRandomHelper.getRandomLengthNumber(4) + "&"; + queryString += String.Join("&", paramKeys.Select(a => a + "=" + HttpUtility.UrlEncode(parametersToEncrypt[a]))); + + // Encrypt data. String encrypted = SacsEncryptionHelper.Encrypt(queryString, base64IV, base64Key); - if (SacsSystem.DebugMode) SaLogger.Debug(fn + "\n\tData: " + queryString + " \n\tEncrypted: " + encrypted); + //if (SacsSystem.DebugMode) SaLogger.Debug(fn + "\n\tData: " + queryString + " \n\tEncrypted: " + encrypted); return encrypted; } catch (Exception exc) { SaLogger.Warn(fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); } @@ -262,7 +262,7 @@ namespace Saxonite.Net.Core.Web.Base.Controllers try { String queryString = SacsEncryptionHelper.Decrypt(encrypted, base64IV, base64Key); - if (SacsSystem.DebugMode) SaLogger.Debug(fn + " \n\tEncrypted: " + encrypted + "\n\tData: " + queryString); + //if (SacsSystem.DebugMode) SaLogger.Debug(fn + " \n\tEncrypted: " + encrypted + "\n\tData: " + queryString); return HttpUtility.ParseQueryString(queryString); } catch (Exception exc) { SaLogger.Warn(fn + " " + ExceptionUtil.GetErrorStateMessage(exc)); } diff --git a/SaxoniteCoreWebAdmin/Views/Security/ChangePassword.cshtml b/SaxoniteCoreWebAdmin/Views/Security/ChangePassword.cshtml index 4b8a301..be0cb60 100644 --- a/SaxoniteCoreWebAdmin/Views/Security/ChangePassword.cshtml +++ b/SaxoniteCoreWebAdmin/Views/Security/ChangePassword.cshtml @@ -10,6 +10,7 @@
@Localiser["security.caption.change.password"]
+
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmChangePassword", @class = "sax-form" })) { diff --git a/SaxoniteCoreWebAdmin/Views/Security/RequestPassword.cshtml b/SaxoniteCoreWebAdmin/Views/Security/RequestPassword.cshtml index 0ce0462..44ca7d9 100644 --- a/SaxoniteCoreWebAdmin/Views/Security/RequestPassword.cshtml +++ b/SaxoniteCoreWebAdmin/Views/Security/RequestPassword.cshtml @@ -10,6 +10,7 @@
@Localiser["security.caption.request.password"]
+
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmRequestPassword", @class = "sax-form" })) { diff --git a/SaxoniteCoreWebAdmin/Views/Security/Signin.cshtml b/SaxoniteCoreWebAdmin/Views/Security/Signin.cshtml index 0b4a538..2b7fa1a 100644 --- a/SaxoniteCoreWebAdmin/Views/Security/Signin.cshtml +++ b/SaxoniteCoreWebAdmin/Views/Security/Signin.cshtml @@ -11,6 +11,7 @@
@Localiser["security.caption.signin"]
+
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmSignIn", @class = "sax-form" })) { diff --git a/SaxoniteCoreWebOnline/Localisation/SaxOnlineProperties.resx b/SaxoniteCoreWebOnline/Localisation/SaxOnlineProperties.resx index 01a4a9b..8f10be9 100644 --- a/SaxoniteCoreWebOnline/Localisation/SaxOnlineProperties.resx +++ b/SaxoniteCoreWebOnline/Localisation/SaxOnlineProperties.resx @@ -237,6 +237,9 @@ Article + + At + Calendar @@ -276,6 +279,9 @@ Created + + Date + Date of birth @@ -285,6 +291,9 @@ Delete + + Details + Discipline @@ -294,6 +303,9 @@ Drag your image here. + + Duration + Edit @@ -306,6 +318,9 @@ Email address + + Events + Excellent @@ -375,12 +390,18 @@ Not specified + + Occurs + Officiating OK + + On + Opportunities @@ -501,6 +522,9 @@ Team + + Time + Title @@ -620,6 +644,12 @@ You will then be able to publicise your sporting activities. Event + + Create Event + + + Update event + Events diff --git a/SaxoniteCoreWebOnline/Online/Controllers/ActivityController-Ajax.cs b/SaxoniteCoreWebOnline/Online/Controllers/ActivityController-Ajax.cs index b5807fd..0ae7747 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/ActivityController-Ajax.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/ActivityController-Ajax.cs @@ -37,7 +37,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers { public short ItemType { get; set; } public String ItemTypeClass { get; set; } - public long ItemIdx { get; set; } + public String ItemId { get; set; } public String Organisation { get; set; } public String Author { get; set; } public String Caption { get; set; } @@ -102,6 +102,29 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } public ContentData Content { get; } = new ContentData(); } + /// Event activity info. + private class ActivityResponseData_Event + { + public ActivityResponseData_Event(SaxModel_Online model, SaxOrganisationEvent organisationEvent) + { + Organisation = model.GetOrganisationName(organisationEvent.OrganisationId); + EventAt = DateUtil.Format(organisationEvent.EventAt, "d-MMM-yy"); + if (organisationEvent.EventAt.Hour>0 || organisationEvent.EventAt.Minute > 0) + EventAt += DateUtil.Format(organisationEvent.EventAt, " HH:ss"); + Summary = organisationEvent.Summary; + Details = organisationEvent.Details; + Sport = model.GetSportCaption(organisationEvent.SportIdPrimary); + Region = model.GetRegionCaption(organisationEvent.RegionIdCountry); + PublishedOnFmt = model.Localiser.FormatDate(organisationEvent.PublishedAt); + } + public String Organisation { get; set; } + public String EventAt{ get; set; } + public String Summary { get; set; } + public String Details { get; set; } + public String Sport { get; set; } + public String Region { get; set; } + public String PublishedOnFmt { get; set; } + } /// Opportunity activity info. private class ActivityResponseData_Opportunity { @@ -115,7 +138,6 @@ namespace Saxonite.Net.Core.Web.Online.Controllers PublishedOnFmt = model.Localiser.FormatDate(opportunity.PublishedAt); } public String Organisation { get; set; } - public String Author { get; set; } public String Position { get; set; } public String Outline { get; set; } public String Sport { get; set; } @@ -170,10 +192,12 @@ namespace Saxonite.Net.Core.Web.Online.Controllers activityData.ItemType = itemData.ItemId.Type; if (itemData.ItemId.Type == (int)Sax.DataItemType.Article) activityData.ItemTypeClass = "Article"; + else if (itemData.ItemId.Type == (int)Sax.DataItemType.OrganisationEvent) + activityData.ItemTypeClass = "Event"; else if (itemData.ItemId.Type == (int)Sax.DataItemType.OrganisationOpportunity) activityData.ItemTypeClass = "Opportunity"; // ToDo Mask activity index Id with cross-reference stored in session data. - activityData.ItemIdx = SysId.ToLong(itemData.ItemId.Id); + activityData.ItemId = model.EncryptId(itemData.ItemId.Id); activityData.Organisation = itemData.Organisation; activityData.Author = itemData.Author; activityData.Caption = itemData.Caption; @@ -199,6 +223,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers private class AjaxResponse_ActivityInfo : AjaxResponse_Base { public ActivityResponseData_Article Article { get; set; } + public ActivityResponseData_Event Event { get; set; } public ActivityResponseData_Opportunity Opportunity { get; set; } } //------------------------------------------------------------------- @@ -224,8 +249,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers { // Identify activity. - Sax.DataItemType itemType = (Sax.DataItemType)StringUtil.ToShort(model.ActivityType); - SysId itemId = model.ExtractSysId(model.ActivityIdx); + Sax.DataItemType itemType = (Sax.DataItemType)StringUtil.ToShort(model.ActivityItemType); + SysId itemId = model.ExtractSysId(model.ActivityItemId); if (itemType <= 0 || !SysId.IsValid(itemId)) { SaLogger.Warn(fn + " Activity type/Id inncorrectly specified." + GetLogSuffix()); @@ -247,6 +272,18 @@ namespace Saxonite.Net.Core.Web.Online.Controllers disposableItems.Add(organisation); responseData.Article = new ActivityResponseData_Article(this, model, article, organisation); } + else if (itemType == Sax.DataItemType.OrganisationEvent) + { + // Organisation Event. + SaxOrganisationEvent organisationEvent = ActivityMgr.GetOrganisationEventById(itemId); + disposableItems.Add(organisationEvent); + if (organisationEvent == null) + { + SaLogger.Warn(fn + " Event not found for Activity Id: " + itemId.ToString() + "." + GetLogSuffix()); + return Json(responseData); + } + responseData.Event = new ActivityResponseData_Event(model, organisationEvent); + } else if (itemType == Sax.DataItemType.OrganisationOpportunity) { // Organisation Opportunity. @@ -297,8 +334,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers SaxSessionData_Online sessionData = SessionData_Online; // Identify activity. - Sax.DataItemType itemType = (Sax.DataItemType)StringUtil.ToShort(model.ActivityType); - SysId itemId = model.ExtractSysId(model.ActivityIdx); + Sax.DataItemType itemType = (Sax.DataItemType)StringUtil.ToShort(model.ActivityItemType); + SysId itemId = model.ExtractSysId(model.ActivityItemId); if (itemType <= 0 || !SysId.IsValid(itemId)) { SaLogger.Warn(fn + " Activity type/Id inncorrectly specified." + GetLogSuffix()); diff --git a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Events.cs b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Events.cs index 482197f..b5df19a 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Events.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Events.cs @@ -27,31 +27,34 @@ namespace Saxonite.Net.Core.Web.Online.Controllers public String EventTimeFmt { get; set; } public String TypeCode { get; set; } public String TypeDesc { get; set; } - public String About { get; set; } - public String RegionCaption { get; set; } - public String SportCaption { get; set; } + public String Summary { get; set; } + public String Details { get; set; } + public String SportCaptionPrimary { get; set; } + public String RegionCaptionCountry { get; set; } public String PublishedOnFmt { get; set; } public String ExpiresOnFmt { get; set; } } private class EventData_Detail : EventData_List { - public String EventAt_YYYYMMDD { get; set; } + public String EventOn_Calendar { get; set; } + public String EventOn_YYYYMMDD { get; set; } public String EventAt_HHMM { get; set; } - public String RegionIdCountry { get; set; } public String SportIdPrimary { get; set; } + public String RegionIdCountry { get; set; } public String PublishedOn_YYYYMMDD { get; set; } public String ExpiresOn_YYYYMMDD { get; set; } } private void PopulateEventResponseData(Model_Organisation_Events model, SaxOrganisationEvent organisationEvent, EventData_List data) { - data.Id = SysId.ToString(organisationEvent.Id); + data.Id = model.EncryptId(organisationEvent.Id); data.EventDateFmt = Localiser.FormatDate(organisationEvent.EventAt); data.EventTimeFmt = DateUtil.Format(organisationEvent.EventAt, "HH:mm"); data.TypeCode = EventTypeCodes.GetCodeForType(organisationEvent.EventType); data.TypeDesc = Localiser.GetEventTypeCaption(organisationEvent.EventType); - data.About = organisationEvent.About; - data.RegionCaption = model.GetRegionCaption(organisationEvent.RegionIdCountry); - data.SportCaption = model.GetSportCaption(organisationEvent.SportIdPrimary); + data.Summary = organisationEvent.Summary; + data.Details = organisationEvent.Details; + data.SportCaptionPrimary = model.GetSportCaption(organisationEvent.SportIdPrimary); + data.RegionCaptionCountry = model.GetRegionCaption(organisationEvent.RegionIdCountry); data.CreatedOnFmt = Localiser.FormatDate(organisationEvent.CreateStamp.On); data.PublishedOnFmt = Localiser.FormatDate(organisationEvent.PublishedAt); data.ExpiresOnFmt = Localiser.FormatDate(organisationEvent.ExpiresAt); @@ -61,7 +64,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers private void PopulateEventResponseData(Model_Organisation_Events model, SaxOrganisationEvent organisationEvent, EventData_Detail data) { PopulateEventResponseData(model, organisationEvent, data as EventData_List); - data.EventAt_YYYYMMDD = DateUtil.Format(organisationEvent.EventAt, "yyyyMMdd"); + data.EventOn_Calendar = model.FormatDateForForm(organisationEvent.EventAt); + data.EventOn_YYYYMMDD = DateUtil.Format(organisationEvent.EventAt, "yyyyMMdd"); data.EventAt_HHMM = DateUtil.Format(organisationEvent.EventAt, "HH:mm"); data.RegionIdCountry = model.GetEncryptedRegionId(organisationEvent.RegionIdCountry); data.SportIdPrimary = model.GetEncryptedSportId(organisationEvent.SportIdPrimary); @@ -175,7 +179,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers ColumnDfn colId = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Id); ColumnDfn colEventAt = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.EventAt_DateTime); ColumnDfn colEventTypeCode = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.EventTypeCode); - ColumnDfn colAbout = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.About); + ColumnDfn colSummary = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Summary); + ColumnDfn colDetails = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Details); ColumnDfn colRegionId = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.RegionIdCountry); ColumnDfn colRegionName = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.Region_Name); ColumnDfn colSportId = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.SportIdPrimary); @@ -186,7 +191,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers ColumnDfn colCreatedOn = ActivityMgr.GetOrganisationEventColumnDfn(SaxOrganisationEvent.Column.CreateOn_Date); List columns = new List() { - colId, colEventAt, colEventTypeCode, colAbout, + colId, colEventAt, colEventTypeCode, colSummary, colDetails, colRegionId, colRegionName, colSportId, colSportName, colPublishedOn, colExpiresOn, colStatus, colCreatedOn @@ -204,14 +209,15 @@ namespace Saxonite.Net.Core.Web.Online.Controllers NamedValue.Map values = resultSet.GetRecordValues(); EventData_List eventData = new EventData_List() { - Id = values.GetLong(colId.DataName).ToString(), + Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))), EventDateFmt = Localiser.FormatDate(values.GetDateTime(colEventAt.DataName)), EventTimeFmt = DateUtil.Format(values.GetDateTime(colEventAt.DataName), "HH:mm"), TypeCode = values.GetString(colEventTypeCode.DataName), TypeDesc = Localiser.GetEventTypeCaption((Sax.EventType)EventTypeCodes.GetTypeForCode(values.GetString(colEventTypeCode.DataName))), - About = values.GetString(colAbout.DataName), - RegionCaption = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()), - SportCaption = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()), + Summary = ActivityMgr.GetOrganisationEventDataValue(colSummary, values).AsString(), + Details = ActivityMgr.GetOrganisationEventDataValue(colDetails, values).AsString(), + RegionCaptionCountry = model.GetRegionCaption(values.GetString(colRegionId.DataName).ToSysId()), + SportCaptionPrimary = model.GetSportCaption(values.GetString(colSportId.DataName).ToSysId()), CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)), PublishedOnFmt = Localiser.FormatDate(values.GetDateTime(colPublishedOn.DataName)), ExpiresOnFmt = Localiser.FormatDate(values.GetDateTime(colExpiresOn.DataName)), @@ -390,8 +396,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } if (model.EventTypeCode != null) organisationEvent.EventType = (Sax.EventType)EventTypeCodes.GetTypeForCode(model.EventTypeCode); - if (model.EventAbout != null) - organisationEvent.About = model.EventAbout; + if (model.EventSummary != null) + organisationEvent.Summary = model.EventSummary; + if (model.EventDetails != null) + organisationEvent.Details = model.EventDetails; if (model.EventStatusCode != null) organisationEvent.Status = model.EventStatus; @@ -414,7 +422,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } // Store Event Activity Index data. -// ToDo ActivityConsole.StoreActivityIndex(organisationEvent, DbUpdateInfo); + ActivityConsole.StoreActivityIndex(organisationEvent, DbUpdateInfo); // Construct response. PopulateEventResponseData(model, organisationEvent, responseData.Event); diff --git a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Members.cs b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Members.cs index ea3837c..e932226 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Members.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Members.cs @@ -29,6 +29,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers public bool? CurrentUser { get; set; } = null; public String EmailAddress { get; set; } public String DisplayName { get; set; } + public String MemberRoles { get; set; } public List RoleCodes { get; set; } = new List(); public List Roles { get; set; } = new List(); public String AdminComment { get; set; } @@ -41,8 +42,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } private void PopulateMemberResponseData(Model_Organisation_Members model, SaxUserOrganisation userOrganisation, SaxUserAccount userAccount, SaxOrganisation organisation, MemberData_List data) { - data.Id = SysId.ToString(userOrganisation.Id); - data.UserAccountId = SysId.ToString(userOrganisation.UserAccountId); + data.Id = model.EncryptId(userOrganisation.Id); + data.UserAccountId = model.EncryptId(userOrganisation.UserAccountId); if (userOrganisation.UserAccountId.Equals(UserAccountId)) data.CurrentUser = true; data.EmailAddress = userAccount.EmailAddress; data.DisplayName = userAccount.GetDisplayName(); @@ -56,6 +57,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers data.RoleCodes.Add(memberRoleCode); data.Roles.Add(memberRoleCode, Localiser.GetOrganisationRoleCaption(organisationRole)); } + data.MemberRoles = data.Roles.Select(item => item.Desc).ToList().Concat(", "); data.AdminComment = userOrganisation.AdminComment; // NB UserAccount status (not UserOrganisation). data.StatusCode = userAccount.StatusCode; @@ -138,7 +140,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers prmMember.OrganisationIdsIncluded.Add(organisationId); prmMember.UserAccountStatusCat = responseData.User.CanManage ? SaxUserAccount.StatusCat.AwaitingOrActive : SaxUserAccount.StatusCat.ActiveOnly; prmMember.OrganisationMembersOnly = true; - //prmMember.MemberFilter = model.Filter.Member; + prmMember.UserFilterPartial = model.Filter.Member; prmMember.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmMember); model.PopulatePagingTo(prmMember.ResultsPaging); @@ -171,8 +173,8 @@ namespace Saxonite.Net.Core.Web.Online.Controllers NamedValue.Map values = resultSet.GetRecordValues(); MemberData_List memberData = new MemberData_List() { - Id = values.GetLong(colId.DataName).ToString(), - UserAccountId = values.GetString(colUserAccountId.DataName), + Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))), + UserAccountId = model.EncryptId(new SysId(values.GetLong(colUserAccountId.DataName))), EmailAddress = values.GetString(colEmailAddress.DataName), DisplayName = AccountMgr.GetUserOrganisationDataValue(colDisplayName, values).ToString(), CreatedOnFmt = Localiser.FormatDate(values.GetDateTime(colCreatedOn.DataName)), @@ -191,6 +193,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers memberData.RoleCodes.Add(memberRoleCode); memberData.Roles.Add(memberRoleCode, Localiser.GetOrganisationRoleCaption(organisationRole)); } + memberData.MemberRoles = memberData.Roles.Select(item => item.Desc).ToList().Concat(", "); responseData.Members.Add(memberData); } } diff --git a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Opportunities.cs b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Opportunities.cs index 56a0444..0b1fa34 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Opportunities.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax-Opportunities.cs @@ -41,7 +41,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } private void PopulateOpportunityResponseData(Model_Organisation_Opportunities model, SaxOrganisationOpportunity opportunity, OpportunityData_List data) { - data.Id = SysId.ToString(opportunity.Id); + data.Id = model.EncryptId(opportunity.Id); data.TypeCode = OpportunityTypeCodes.GetCodeForType(opportunity.OpportunityType); data.TypeDesc = Localiser.GetOpportunityTypeCaption(opportunity.OpportunityType); data.Position = opportunity.Position; @@ -198,7 +198,7 @@ namespace Saxonite.Net.Core.Web.Online.Controllers NamedValue.Map values = resultSet.GetRecordValues(); OpportunityData_List opportunityData = new OpportunityData_List() { - Id = values.GetLong(colId.DataName).ToString(), + Id = model.EncryptId(new SysId(values.GetLong(colId.DataName))), TypeCode = values.GetString(colOpportunityTypeCode.DataName), TypeDesc = Localiser.GetOpportunityTypeCaption((Sax.OpportunityType)OpportunityTypeCodes.GetTypeForCode(values.GetString(colOpportunityTypeCode.DataName))), Position = values.GetString(colPosition.DataName), diff --git a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax.cs b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax.cs index 4f50e37..1eec56b 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController-Ajax.cs @@ -24,11 +24,11 @@ namespace Saxonite.Net.Core.Web.Online.Controllers // Organisation data. public class OrganisationResponseData { - public long Id { get; set; } + public String Id { get; set; } public String Name { get; set; } - public long RegionId { get; set; } + public String RegionId { get; set; } public String RegionName { get; set; } - public long SportId { get; set; } + public String SportId { get; set; } public String SportName { get; set; } } @@ -86,11 +86,11 @@ namespace Saxonite.Net.Core.Web.Online.Controllers NamedValue.Map values = resultSet.GetRecordValues(); OrganisationResponseData organisationData = new OrganisationResponseData() { - Id = values.GetLong(colOrganisationId.DataName), + Id = model.EncryptId(new SysId(values.GetLong(colOrganisationId.DataName))), Name = values.GetString(colOrganisationName.DataName), - RegionId = values.GetLong(colRegionId.DataName), + RegionId = model.EncryptId(new SysId(values.GetLong(colRegionId.DataName))), RegionName = values.GetString(colRegionName.DataName), - SportId = values.GetLong(colSportId.DataName), + SportId = model.EncryptId(new SysId(values.GetLong(colSportId.DataName))), SportName = values.GetString(colSportName.DataName), }; responseData.Organisations.Add(organisationData); @@ -106,23 +106,23 @@ namespace Saxonite.Net.Core.Web.Online.Controllers } //------------------------------------------------------------------- - // Get Member Organisation List ajax request. + // Get Member Admin Organisation List ajax request. //------------------------------------------------------------------- - private class AjaxResponse_MemberOrganisationList : AjaxResponse_Data + private class AjaxResponse_MemberAdminOrganisationList : AjaxResponse_Data { // Construction. - public AjaxResponse_MemberOrganisationList(SaxModel_Online model) : base(model) { } + public AjaxResponse_MemberAdminOrganisationList(SaxModel_Online model) : base(model) { } // Organisation list. public List Organisations { get; } = new List(); } //------------------------------------------------------------------- [HttpPost] - [Route("Organisation/Ajax/GetMemberOrganisationList")] - public IActionResult Ajax_GetMemberOrganisationList(Model_Organisation model) + [Route("Organisation/Ajax/GetMemberAdminOrganisationList")] + public IActionResult Ajax_GetMemberAdminOrganisationList(Model_Organisation model) { - String fn = GetType().Name + ".Ajax_GetMemberOrganisationList"; + String fn = GetType().Name + ".Ajax_GetMemberAdminOrganisationList"; String messageTitle = Localiser["organisation.caption.organisations"]; - AjaxResponse_MemberOrganisationList responseData = new AjaxResponse_MemberOrganisationList(model); + AjaxResponse_MemberAdminOrganisationList responseData = new AjaxResponse_MemberAdminOrganisationList(model); // Validate session and referrer. if (!ValidReferer) return Forbid(); @@ -146,7 +146,10 @@ namespace Saxonite.Net.Core.Web.Online.Controllers // Organisation filter SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); + prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly; prmUserOrganisation.OrganisationMembersOnly = true; + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.MemberAdmin); prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; prmUserOrganisation.SortColumns.Add(colOrganisationName); model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmUserOrganisation); @@ -158,11 +161,161 @@ namespace Saxonite.Net.Core.Web.Online.Controllers NamedValue.Map values = resultSet.GetRecordValues(); OrganisationResponseData organisationData = new OrganisationResponseData() { - Id = values.GetLong(colOrganisationId.DataName), + Id = model.EncryptId(new SysId(values.GetLong(colOrganisationId.DataName))), Name = values.GetString(colOrganisationName.DataName), - RegionId = values.GetLong(colRegionId.DataName), + RegionId = model.EncryptId(new SysId(values.GetLong(colRegionId.DataName))), RegionName = values.GetString(colRegionName.DataName), - SportId = values.GetLong(colSportId.DataName), + SportId = model.EncryptId(new SysId(values.GetLong(colSportId.DataName))), + SportName = values.GetString(colSportName.DataName), + }; + responseData.Organisations.Add(organisationData); + } + } + if (model.Paging.IsPaged) + model.Paging.ItemCount = (ushort)responseData.Organisations.Count; + + // Complete response. + responseData.SetPaging(model); + responseData.Success = true; + return Json(responseData); + } + + //------------------------------------------------------------------- + // Get Event Admin Organisation List ajax request. + //------------------------------------------------------------------- + private class AjaxResponse_EventAdminOrganisationList : AjaxResponse_Data + { + // Construction. + public AjaxResponse_EventAdminOrganisationList(SaxModel_Online model) : base(model) { } + // Organisation list. + public List Organisations { get; } = new List(); + } + //------------------------------------------------------------------- + [HttpPost] + [Route("Organisation/Ajax/GetEventAdminOrganisationList")] + public IActionResult Ajax_GetEventAdminOrganisationList(Model_Organisation model) + { + String fn = GetType().Name + ".Ajax_GetEventAdminOrganisationList"; + String messageTitle = Localiser["organisation.caption.organisations"]; + AjaxResponse_EventAdminOrganisationList responseData = new AjaxResponse_EventAdminOrganisationList(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Query columns. + ColumnDfn colOrganisationId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.OrganisationId); + ColumnDfn colOrganisationName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Name); + ColumnDfn colRegionId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_RegionId); + ColumnDfn colRegionName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Region_Name); + ColumnDfn colSportId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_SportId); + ColumnDfn colSportName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Sport_Name); + List columns = new List() + { + colOrganisationId, colOrganisationName, + colRegionId, colRegionName, + colSportId, colSportName + }; + + // Organisation filter + SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); + prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); + prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly; + prmUserOrganisation.OrganisationMembersOnly = true; + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.ScheduleAdmin); + prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; + prmUserOrganisation.SortColumns.Add(colOrganisationName); + model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmUserOrganisation); + model.PopulatePagingTo(prmUserOrganisation.ResultsPaging); + using (DbResultSet resultSet = AccountMgr.ExecuteUserOrganisationQuery(columns, prmUserOrganisation)) + { + while (resultSet != null && resultSet.HasRows && resultSet.NextRecord()) + { + NamedValue.Map values = resultSet.GetRecordValues(); + OrganisationResponseData organisationData = new OrganisationResponseData() + { + Id = model.EncryptId(new SysId(values.GetLong(colOrganisationId.DataName))), + Name = values.GetString(colOrganisationName.DataName), + RegionId = model.EncryptId(new SysId(values.GetLong(colRegionId.DataName))), + RegionName = values.GetString(colRegionName.DataName), + SportId = model.EncryptId(new SysId(values.GetLong(colSportId.DataName))), + SportName = values.GetString(colSportName.DataName), + }; + responseData.Organisations.Add(organisationData); + } + } + if (model.Paging.IsPaged) + model.Paging.ItemCount = (ushort)responseData.Organisations.Count; + + // Complete response. + responseData.SetPaging(model); + responseData.Success = true; + return Json(responseData); + } + + //------------------------------------------------------------------- + // Get Opportunity Admin Organisation List ajax request. + //------------------------------------------------------------------- + private class AjaxResponse_OpportunityAdminOrganisationList : AjaxResponse_Data + { + // Construction. + public AjaxResponse_OpportunityAdminOrganisationList(SaxModel_Online model) : base(model) { } + // Organisation list. + public List Organisations { get; } = new List(); + } + //------------------------------------------------------------------- + [HttpPost] + [Route("Organisation/Ajax/GetOpportunityAdminOrganisationList")] + public IActionResult Ajax_GetOpportunityAdminOrganisationList(Model_Organisation model) + { + String fn = GetType().Name + ".Ajax_GetOpportunityAdminOrganisationList"; + String messageTitle = Localiser["organisation.caption.organisations"]; + AjaxResponse_OpportunityAdminOrganisationList responseData = new AjaxResponse_OpportunityAdminOrganisationList(model); + + // Validate session and referrer. + if (!ValidReferer) return Forbid(); + if (!ValidUserSession) return GetAjaxResult_InvalidSession(responseData); + RefreshModel(model); + + // Query columns. + ColumnDfn colOrganisationId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.OrganisationId); + ColumnDfn colOrganisationName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Name); + ColumnDfn colRegionId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_RegionId); + ColumnDfn colRegionName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Region_Name); + ColumnDfn colSportId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_SportId); + ColumnDfn colSportName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Sport_Name); + List columns = new List() + { + colOrganisationId, colOrganisationName, + colRegionId, colRegionName, + colSportId, colSportName + }; + + // Organisation filter + SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); + prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); + prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly; + prmUserOrganisation.OrganisationMembersOnly = true; + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); + prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.OpportunityAdmin); + prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; + prmUserOrganisation.SortColumns.Add(colOrganisationName); + model.Paging.ItemTotal = (ulong)AccountMgr.GetUserOrganisationCount(prmUserOrganisation); + model.PopulatePagingTo(prmUserOrganisation.ResultsPaging); + using (DbResultSet resultSet = AccountMgr.ExecuteUserOrganisationQuery(columns, prmUserOrganisation)) + { + while (resultSet != null && resultSet.HasRows && resultSet.NextRecord()) + { + NamedValue.Map values = resultSet.GetRecordValues(); + OrganisationResponseData organisationData = new OrganisationResponseData() + { + Id = model.EncryptId(new SysId(values.GetLong(colOrganisationId.DataName))), + Name = values.GetString(colOrganisationName.DataName), + RegionId = model.EncryptId(new SysId(values.GetLong(colRegionId.DataName))), + RegionName = values.GetString(colRegionName.DataName), + SportId = model.EncryptId(new SysId(values.GetLong(colSportId.DataName))), SportName = values.GetString(colSportName.DataName), }; responseData.Organisations.Add(organisationData); diff --git a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController.cs b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController.cs index 9730536..e1a1f2f 100644 --- a/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController.cs +++ b/SaxoniteCoreWebOnline/Online/Controllers/OrganisationController.cs @@ -6,6 +6,7 @@ using Sarand.Net.Standard.Base.Dbas; using Sarand.Net.Standard.Base.Utils; using Saxonite.Net.Core.Web.Base.App; using Saxonite.Net.Core.Web.Online.Models; +using Saxonite.Net.Standard.Base.App; using Saxonite.Net.Standard.Base.Bus; using System; using System.Collections.Generic; @@ -38,6 +39,33 @@ namespace Saxonite.Net.Core.Web.Online.Controllers return RedirectToAction("", ""); } + //------------------------------------------------------------------- + [HttpGet] + public IActionResult Members() + { + // Validate session. + if (!ValidUserSession) + return RedirectToAction("", ""); + + // Model. + Model_Organisation_Members model = new Model_Organisation_Members(Localiser); + + // Get a suitable organisation for the filter. + SysId filterOrganisationId = SessionData_Online.Filter.OrganisationIdMember; + String filterOrganisationCaption = SessionData_Online.Filter.OrganisationCaptionMember; + OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption, Sax.OrganisationRole.MemberAdmin); + if (organisationData == null) + return RedirectToAction("", ""); + + // Make a note of the filter values. + model.Filter.OrganisationId = model.EncryptId(organisationData.Id); + model.Filter.OrganisationCaption = organisationData.Caption; + SessionData_Online.Filter.OrganisationIdMember = organisationData.Id; + SessionData_Online.Filter.OrganisationCaptionMember = organisationData.Caption; + + return View(model); + } + //------------------------------------------------------------------- [HttpGet] public IActionResult Events() @@ -52,12 +80,12 @@ namespace Saxonite.Net.Core.Web.Online.Controllers // Get a suitable organisation for the filter. SysId filterOrganisationId = SessionData_Online.Filter.OrganisationIdMember; String filterOrganisationCaption = SessionData_Online.Filter.OrganisationCaptionMember; - OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption); + OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption, Sax.OrganisationRole.ScheduleAdmin); if (organisationData == null) return RedirectToAction("", ""); // Make a note of the filter values. - model.Filter.OrganisationId = SysId.ToString(organisationData.Id); + model.Filter.OrganisationId = model.EncryptId(organisationData.Id); model.Filter.OrganisationCaption = organisationData.Caption; SessionData_Online.Filter.OrganisationIdMember = organisationData.Id; SessionData_Online.Filter.OrganisationCaptionMember = organisationData.Caption; @@ -79,39 +107,12 @@ namespace Saxonite.Net.Core.Web.Online.Controllers // Get a suitable organisation for the filter. SysId filterOrganisationId = SessionData_Online.Filter.OrganisationIdMember; String filterOrganisationCaption = SessionData_Online.Filter.OrganisationCaptionMember; - OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption); + OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption, Sax.OrganisationRole.OpportunityAdmin); if (organisationData == null) return RedirectToAction("", ""); // Make a note of the filter values. - model.Filter.OrganisationId = SysId.ToString(organisationData.Id); - model.Filter.OrganisationCaption = organisationData.Caption; - SessionData_Online.Filter.OrganisationIdMember = organisationData.Id; - SessionData_Online.Filter.OrganisationCaptionMember = organisationData.Caption; - - return View(model); - } - - //------------------------------------------------------------------- - [HttpGet] - public IActionResult Members() - { - // Validate session. - if (!ValidUserSession) - return RedirectToAction("", ""); - - // Model. - Model_Organisation_Members model = new Model_Organisation_Members(Localiser); - - // Get a suitable organisation for the filter. - SysId filterOrganisationId = SessionData_Online.Filter.OrganisationIdMember; - String filterOrganisationCaption = SessionData_Online.Filter.OrganisationCaptionMember; - OrganisationData organisationData = GetOrganisationForFilter(filterOrganisationId, filterOrganisationCaption); - if (organisationData == null) - return RedirectToAction("", ""); - - // Make a note of the filter values. - model.Filter.OrganisationId = SysId.ToString(organisationData.Id); + model.Filter.OrganisationId = model.EncryptId(organisationData.Id); model.Filter.OrganisationCaption = organisationData.Caption; SessionData_Online.Filter.OrganisationIdMember = organisationData.Id; SessionData_Online.Filter.OrganisationCaptionMember = organisationData.Caption; @@ -126,27 +127,46 @@ namespace Saxonite.Net.Core.Web.Online.Controllers public SysId Id { get; } public String Caption { get; set; } } - private OrganisationData GetOrganisationForFilter(SysId filterOrganisationId, String filterOrganisationCaption) + private OrganisationData GetOrganisationForFilter(SysId filterOrganisationId, String filterOrganisationCaption, Sax.OrganisationRole organisationRole) { // Check that user is associated with organisations. SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); + prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly; prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; if (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) < 1) return null; - // Filter organisation. - OrganisationData organisationData = new OrganisationData(filterOrganisationId); - organisationData.Caption = filterOrganisationCaption; - if (!SysId.IsValid(filterOrganisationId) || StringUtil.IsEmpty(filterOrganisationCaption)) + // Roles (any) required for organisation list. + List requiredRoles = new List() { Sax.OrganisationRole.Admin }; + if (organisationRole > 0) + requiredRoles.Add(organisationRole); + + // Retrieve specified organisation. + OrganisationData organisationData = null; + if (SysId.IsValid(filterOrganisationId)) { - // Pick the first Organisation that the user is a member of. + organisationData = new OrganisationData(filterOrganisationId) { Caption = filterOrganisationCaption }; + using (SaxOrganisation organisation = AccountMgr.GetOrganisationById(organisationData.Id)) + { + // Validate organisation. + if (organisation != null && organisation.IsStatusActive && AccountMgr.UserHasAnyOrganisationRole(UserAccountId, organisation.Id, requiredRoles)) + organisationData.Caption = organisation.Name; + else + organisationData = null; + } + } + + if (organisationData == null) + { + // Pick the first valid Organisation that the user is a member of. ColumnDfn colOrganisationId = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.OrganisationId); ColumnDfn colOrganisationName = AccountMgr.GetUserOrganisationColumnDfn(SaxUserOrganisation.Column.Organisation_Name); prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); - if (SysId.IsValid(filterOrganisationId)) - prmUserOrganisation.OrganisationIdsIncluded.Add(filterOrganisationId); + if (organisationData != null && SysId.IsValid(organisationData.Id)) + prmUserOrganisation.OrganisationIdsIncluded.Add(organisationData.Id); + prmUserOrganisation.OrganisationStatusCat = SaxOrganisation.StatusCat.ActiveOnly; prmUserOrganisation.OrganisationMembersOnly = true; prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; prmUserOrganisation.SortColumns.Add(colOrganisationName); diff --git a/SaxoniteCoreWebOnline/Online/Models/Model_Activity.cs b/SaxoniteCoreWebOnline/Online/Models/Model_Activity.cs index 11c1fe3..56d9556 100644 --- a/SaxoniteCoreWebOnline/Online/Models/Model_Activity.cs +++ b/SaxoniteCoreWebOnline/Online/Models/Model_Activity.cs @@ -13,7 +13,7 @@ using System.Threading.Tasks; namespace Saxonite.Net.Core.Web.Online.Models { //======================================================================= - public class Model_Activity: SaxModel_Online + public class Model_Activity : SaxModel_Online { //------------------------------------------------------------------- // Construction. @@ -32,14 +32,14 @@ namespace Saxonite.Net.Core.Web.Online.Models // Activity identity. // ToDo Replace Type + Idx (Id) with Idx and cross-reference stored in Session data. - public String ActivityType { get; set; } - public String ActivityIdx { get; set; } - public String ActivityReaction{ get; set; } + public String ActivityItemType { get; set; } + public String ActivityItemId { get; set; } + public String ActivityReaction { get; set; } public Sax.ActivityReaction GetActivityReaction() { Sax.ActivityReaction reaction = EnumUtil.ParseEnum(ActivityReaction, Sax.ActivityReaction.Unknown); if (reaction <= 0 && StringUtil.IsNumeric(ActivityReaction)) - reaction = (Sax.ActivityReaction)StringUtil.ToShort(ActivityReaction); + reaction = (Sax.ActivityReaction)StringUtil.ToShort(ActivityReaction); return reaction; } diff --git a/SaxoniteCoreWebOnline/Online/Models/Model_Organisation_Events.cs b/SaxoniteCoreWebOnline/Online/Models/Model_Organisation_Events.cs index 5a29361..cecf2b2 100644 --- a/SaxoniteCoreWebOnline/Online/Models/Model_Organisation_Events.cs +++ b/SaxoniteCoreWebOnline/Online/Models/Model_Organisation_Events.cs @@ -49,7 +49,8 @@ namespace Saxonite.Net.Core.Web.Online.Models public String EventDate { get; set; } public String EventTime { get; set; } public String EventTypeCode { get; set; } - public String EventAbout { get; set; } + public String EventSummary { get; set; } + public String EventDetails { get; set; } public String EventStatusCode { get; set; } public SaStatus EventStatus { get { return SacsSystem.GetStatusForCode(EventStatusCode); } } @@ -69,6 +70,9 @@ namespace Saxonite.Net.Core.Web.Online.Models // Event date. if (EventDate != null) { + DateTime eventOn = ParseDateFromForm(EventDate); + if (!DateUtil.IsValid(eventOn)) + responseData.SetControlError(nameof(EventDate), Localiser["msg.validation.mandatory.value"]); } // Event time. @@ -76,14 +80,22 @@ namespace Saxonite.Net.Core.Web.Online.Models { } - // Event about. - if (EventAbout != null) + // Event summary. + if (EventSummary != null) { - responseData.SetControlValue(nameof(EventAbout), EventAbout); - if (StringUtil.IsEmpty(EventAbout)) - responseData.SetControlError(nameof(EventAbout), Localiser["msg.validation.mandatory.value"]); - else if (StringUtil.GetLength(EventAbout) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_About)) - responseData.SetControlError(nameof(EventAbout), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_About)]); + responseData.SetControlValue(nameof(EventSummary), EventSummary); + if (StringUtil.IsEmpty(EventSummary)) + responseData.SetControlError(nameof(EventSummary), Localiser["msg.validation.mandatory.value"]); + else if (StringUtil.GetLength(EventSummary) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Summary)) + responseData.SetControlError(nameof(EventSummary), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Summary)]); + } + + // Event details. + if (EventDetails != null) + { + responseData.SetControlValue(nameof(EventDetails), EventDetails); + if (StringUtil.GetLength(EventDetails) > GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Details)) + responseData.SetControlError(nameof(EventDetails), Localiser["msg.validation.maximum.length", GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Details)]); } // Event sport. @@ -91,7 +103,7 @@ namespace Saxonite.Net.Core.Web.Online.Models { SysId articleSportId = ExtractSysId(EventSportIdPrimary); if (!SysId.IsValid(articleSportId)) - responseData.SetControlError(nameof(EventSportIdPrimary), Localiser["msg.validation.mandatory.value"]); + responseData.SetControlError("EventSportPrimary", Localiser["msg.validation.mandatory.value"]); } // Event region. @@ -99,16 +111,16 @@ namespace Saxonite.Net.Core.Web.Online.Models { SysId articleRegionId = ExtractSysId(EventRegionIdCountry); if (!SysId.IsValid(articleRegionId)) - responseData.SetControlError(nameof(EventRegionIdCountry), Localiser["msg.validation.mandatory.value"]); + responseData.SetControlError("EventRegionCountry", Localiser["msg.validation.mandatory.value"]); } // Event status. if (EventStatusCode != null) { if (StringUtil.IsEmpty(EventStatusCode)) - responseData.SetControlError(nameof(EventStatusCode), Localiser["msg.validation.mandatory.value"]); + responseData.SetControlError(nameof(EventStatus), Localiser["msg.validation.mandatory.value"]); else if (!SaxOrganisationEvent.ValidStatuses.Contains(EventStatus)) - responseData.SetControlError(nameof(EventStatusCode), Localiser["msg.validation.invalid.value"]); + responseData.SetControlError(nameof(EventStatus), Localiser["msg.validation.invalid.value"]); } return !responseData.HasControlErrors(); diff --git a/SaxoniteCoreWebOnline/Online/Models/SaxModel_Online.cs b/SaxoniteCoreWebOnline/Online/Models/SaxModel_Online.cs index 9854741..37a9e30 100644 --- a/SaxoniteCoreWebOnline/Online/Models/SaxModel_Online.cs +++ b/SaxoniteCoreWebOnline/Online/Models/SaxModel_Online.cs @@ -21,10 +21,14 @@ namespace Saxonite.Net.Core.Web.Online.Models { //------------------------------------------------------------------- // Data members. - private bool? userCanManageOrganisationMembers = null; - private bool? userCanManageOrganisationOpportunities = null; - private bool? userCanManageOrganisationSchedule = null; - private bool? userCanManageOrganisationArticles = null; + private class UserCanManageOptions + { + public bool? OrganisationMembers { get; set; } = null; + public bool? OrganisationOpportunities { get; set; } = null; + public bool? OrganisationSchedule { get; set; } = null; + public bool? OrganisationArticles { get; set; } = null; + } + private readonly UserCanManageOptions userCanManage = new UserCanManageOptions(); //------------------------------------------------------------------- // Protected construction. @@ -42,9 +46,10 @@ namespace Saxonite.Net.Core.Web.Online.Models //------------------------------------------------------------------- // Menu options. - public bool MembersAllowed { get { return UserCanManageOrganisationMembers; } } + public bool OrganisationMembersAllowed { get { return UserCanManageOrganisationMembers; } } public bool ArticlesAllowed { get { return UserIsJournalist || UserCanManageOrganisationArticles; } } - public bool OpportunitiesAllowed { get { return UserCanManageOrganisationOpportunities; } } + public bool OrganisationOpportunitiesAllowed { get { return UserCanManageOrganisationOpportunities; } } + public bool OrganisationEventsAllowed { get { return UserCanManageOrganisationSchedule; } } //------------------------------------------------------------------- // Security profile. @@ -53,7 +58,7 @@ namespace Saxonite.Net.Core.Web.Online.Models { get { - if (userCanManageOrganisationMembers == null && ValidUserSession) + if (userCanManage.OrganisationMembers == null && ValidUserSession) { SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); @@ -61,16 +66,16 @@ namespace Saxonite.Net.Core.Web.Online.Models prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.MemberAdmin); prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; - userCanManageOrganisationMembers = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); + userCanManage.OrganisationMembers = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); } - return userCanManageOrganisationMembers == true ? true : false; + return userCanManage.OrganisationMembers == true ? true : false; } } public bool UserCanManageOrganisationOpportunities { get { - if (userCanManageOrganisationOpportunities == null && ValidUserSession) + if (userCanManage.OrganisationOpportunities == null && ValidUserSession) { SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); @@ -78,16 +83,16 @@ namespace Saxonite.Net.Core.Web.Online.Models prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.OpportunityAdmin); prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; - userCanManageOrganisationOpportunities = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); + userCanManage.OrganisationOpportunities = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); } - return userCanManageOrganisationOpportunities == true ? true : false; + return userCanManage.OrganisationOpportunities == true ? true : false; } } public bool UserCanManageOrganisationSchedule { get { - if (userCanManageOrganisationSchedule == null && ValidUserSession) + if (userCanManage.OrganisationSchedule == null && ValidUserSession) { SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); @@ -95,16 +100,16 @@ namespace Saxonite.Net.Core.Web.Online.Models prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.ScheduleAdmin); prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; - userCanManageOrganisationSchedule = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); + userCanManage.OrganisationSchedule = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); } - return userCanManageOrganisationSchedule == true ? true : false; + return userCanManage.OrganisationSchedule == true ? true : false; } } public bool UserCanManageOrganisationArticles { get { - if (userCanManageOrganisationArticles == null && ValidUserSession) + if (userCanManage.OrganisationArticles == null && ValidUserSession) { SaxUserOrganisation.Params prmUserOrganisation = new SaxUserOrganisation.Params(); prmUserOrganisation.UserAccountIdsIncluded.Add(UserAccountId); @@ -112,9 +117,9 @@ namespace Saxonite.Net.Core.Web.Online.Models prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.Admin); prmUserOrganisation.OrganisationRolesAny.Add(Sax.OrganisationRole.ArticleAdmin); prmUserOrganisation.StatusCat = SaxUserOrganisation.StatusCat.ActiveOnly; - userCanManageOrganisationArticles = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); + userCanManage.OrganisationArticles = (AccountMgr.GetUserOrganisationCount(prmUserOrganisation) > 0); } - return userCanManageOrganisationArticles == true ? true : false; + return userCanManage.OrganisationArticles == true ? true : false; } } diff --git a/SaxoniteCoreWebOnline/Views/Home/Index.cshtml b/SaxoniteCoreWebOnline/Views/Home/Index.cshtml index fb64610..eb2c359 100644 --- a/SaxoniteCoreWebOnline/Views/Home/Index.cshtml +++ b/SaxoniteCoreWebOnline/Views/Home/Index.cshtml @@ -86,15 +86,15 @@ else @* Activity Id form - to retrieve details for the selected activity. *@ @using (@Html.BeginForm(FormMethod.Post, new { @id = "frmActivityId", @class = "", @action = "#", onsubmit = "return false;" })) { - - + + } @* Activity React form - to record reaction to the selected activity. *@ @using (@Html.BeginForm(FormMethod.Post, new { @id = "frmActivityReact", @class = "", @action = "#", onsubmit = "return false;" })) { - - + + } @@ -121,6 +121,12 @@ else
+
+
+
+
+
+
diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Events.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Events.cshtml new file mode 100644 index 0000000..57e3533 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Organisation/Events.cshtml @@ -0,0 +1,109 @@ +@model Model_Organisation_Events +@inject SaxLocaliser Localiser +@{ + ViewData["Title"] = "Organisation - Events"; +} + +
+ + + + @* Filter Form *@ + @using (@Html.BeginForm(FormMethod.Post, new { @id = "frmEventFilter", @class = "sax-form", @action = "#", @method = "POST", onsubmit = "return false;" })) + { + + @* Filter Panel *@ +
+ @* Filter header *@ +
+
@Localiser["organisation.caption.events"]
+
+ @* Burger menu *@ + +
+
+
+
+
@Localiser["label.organisation"]
+
+ @Html.HiddenFor(model => model.Filter.OrganisationId, new { @id = "ifFilterOrganisationId", @class = "FilterOrganisationId" }) +
+
+
+
+
+
@Localiser["label.search"]
+
+
+
+ + @* Filter item templates *@ +
+ @* Burger dropdown item template - ul is ignored *@ +
    +
  • ...
  • +
+
+ +
+ + } + + @* Results Panel *@ +
+
+
+ + @* Element templates *@ +
+ + @* Item template *@ +
+
+
+
+
+
+ @* Burger menu *@ + +
+
+
+
+
+
+
+
+
+
@Localiser["label.created"]: 
+
@Localiser["label.published"]: 
+
+
+
+
+ + @* Burger dropdown item template - ul is ignored *@ +
    +
  • ...
  • +
+ +
+
+ +
+ + + + diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Members.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Members.cshtml index fa71b84..6747ad7 100644 --- a/SaxoniteCoreWebOnline/Views/Organisation/Members.cshtml +++ b/SaxoniteCoreWebOnline/Views/Organisation/Members.cshtml @@ -43,7 +43,7 @@
@Html.HiddenFor(model => model.Filter.OrganisationId, new { @id = "ifFilterOrganisationId", @class = "FilterOrganisationId" })
-
+
@@ -92,14 +92,11 @@
-
-
-
-
+
-
-
+
+
diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Opportunities.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Opportunities.cshtml index 9ba5494..dd41999 100644 --- a/SaxoniteCoreWebOnline/Views/Organisation/Opportunities.cshtml +++ b/SaxoniteCoreWebOnline/Views/Organisation/Opportunities.cshtml @@ -35,7 +35,7 @@
@Html.HiddenFor(model => model.Filter.OrganisationId, new { @id = "ifFilterOrganisationId", @class = "FilterOrganisationId" })
-
+
diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Panel-EventDialog.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Panel-EventDialog.cshtml new file mode 100644 index 0000000..9a0cc12 --- /dev/null +++ b/SaxoniteCoreWebOnline/Views/Organisation/Panel-EventDialog.cshtml @@ -0,0 +1,127 @@ +@model Model_Organisation_Events +@inject SaxLocaliser Localiser +@{ + /* Organisation Events - Event dialog panel */ +} + + +@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmEventId", @class = "sax-form" })) +{ + @Html.HiddenFor(model => model.EventId, new { @class = "EventId" }) +} +
+ +
+ @using (@Html.BeginForm(FormMethod.Post, new { @id = "frmEvent", @class = "sax-form", @onSubmit = "return false;" })) + { + + @Html.HiddenFor(model => model.EventId, new { @id = "ifEventId", @class = "EventId" }) + @Html.HiddenFor(model => model.EventExists, new { @id = "ifEventExists", @class = "EventExists" }) + + + @* Event type *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ + @* Event date and time *@ +
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+ + @* Event summary *@ +
+
+ +
+
+ @Html.TextAreaFor(model => model.EventSummary, new { @id = "ifEventSummary", @class = "EventSummary sax-textarea", @rows = 3, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Summary) }) +
+
+
+ + @* Event details *@ +
+
+ +
+
+ @Html.TextAreaFor(model => model.EventDetails, new { @id = "ifEventDetails", @class = "EventDetails sax-textarea", @rows = 6, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationEvent_Details) }) +
+
+
+ + @* Sport *@ +
+
+
+
+ +
+
+
+
+ @Html.HiddenFor(model => model.EventSportIdPrimary, new { @id = "ifEventSportIdPrimary", @class = "EventSportIdPrimary" }) +
+
+
+
+
+
+
+ + @* Region *@ +
+
+
+
+ +
+
+
+
+ @Html.HiddenFor(model => model.EventRegionIdCountry, new { @id = "ifEventRegionIdCountry", @class = "EventRegionIdCountry" }) +
+
+
+
+
+
+
+ + } +
+ +
+ + + diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Panel-MemberDialog.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Panel-MemberDialog.cshtml index 5bbbac6..4ef445b 100644 --- a/SaxoniteCoreWebOnline/Views/Organisation/Panel-MemberDialog.cshtml +++ b/SaxoniteCoreWebOnline/Views/Organisation/Panel-MemberDialog.cshtml @@ -16,6 +16,7 @@ }
+
@using (@Html.BeginForm(FormMethod.Post, new { @id = "frmMember", @class = "sax-form", @onSubmit = "return false;" })) { @@ -26,92 +27,121 @@ @* Member Email Address *@
-
- +
+
+
+ +
+
+
+
+ +
+
+
-
- -
-
@* Member Display Name *@
-
- +
+
+
+ +
+
+
+
+ +
+
+
-
- -
-
@* Member Name *@
+
+
+
-
- @* User Title *@ -
-
- +
+ @* User Title *@ +
+
+ +
+
+ +
+
+
-
- + +
+ @* User First Name *@ +
+
+ +
+
+ +
+
+
-
+ +
+ @* User Last Name *@ +
+
+ +
+
+ +
+
+
+
+
- -
- @* User First Name *@ -
-
- -
-
- -
-
-
-
- -
- @* User Last Name *@ -
-
- -
-
- -
-
-
-
-
@* Member roles *@
-
- +
+
+
+ +
+
+
+
+ +
+
+
+
+
-
- -
-
-
-
@* Admin Comment *@
-
- +
+
+
+ +
+
+
+
+ +
+
+
-
- -
-
} diff --git a/SaxoniteCoreWebOnline/Views/Organisation/Panel-OpportunityDialog.cshtml b/SaxoniteCoreWebOnline/Views/Organisation/Panel-OpportunityDialog.cshtml index 4e9d757..c2a8e9c 100644 --- a/SaxoniteCoreWebOnline/Views/Organisation/Panel-OpportunityDialog.cshtml +++ b/SaxoniteCoreWebOnline/Views/Organisation/Panel-OpportunityDialog.cshtml @@ -64,7 +64,7 @@
- @Html.TextAreaFor(model => model.OpportunityOutline, new { @id = "ifOpportunityOutline", @class = "OpportunityOutline sax-input", @rows = 4, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationOpportunity_Outline) }) + @Html.TextAreaFor(model => model.OpportunityOutline, new { @id = "ifOpportunityOutline", @class = "OpportunityOutline sax-textarea", @rows = 4, @maxlength = @Model.GetControlMaxLength(SaxDbDfn_Core.ColumnIdx.OrganisationOpportunity_Outline) })
@@ -80,8 +80,8 @@
@Html.HiddenFor(model => model.OpportunitySportId, new { @id = "ifOpportunitySportId", @class = "OpportunitySportId" }) -
-
+
+
@@ -99,8 +99,8 @@
@Html.HiddenFor(model => model.OpportunityRegionId, new { @id = "ifOpportunityRegionId", @class = "OpportunityRegionId" }) -
-
+
+
diff --git a/SaxoniteCoreWebOnline/Views/Shared/_Layout.cshtml b/SaxoniteCoreWebOnline/Views/Shared/_Layout.cshtml index adfb91a..0c31182 100644 --- a/SaxoniteCoreWebOnline/Views/Shared/_Layout.cshtml +++ b/SaxoniteCoreWebOnline/Views/Shared/_Layout.cshtml @@ -134,14 +134,18 @@ { } - @if (Model.MembersAllowed) + @if (Model.OrganisationMembersAllowed) { } - @if (Model.OpportunitiesAllowed) + @if (Model.OrganisationOpportunitiesAllowed) { } + @if (Model.OrganisationEventsAllowed) + { + + }