From 394e92c469eea8d239acd422c3efa284f072464e Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 12 Feb 2024 14:22:46 +0100 Subject: [PATCH 01/20] migration to BEXIS v3 #147 --- BExIS.Modules.EMM.UI.csproj | 12 +- Controllers/EventController.cs | 5 +- Emm.Settings.json | 23 +++ .../BExIS.Emm.Entities.csproj | 3 +- Entities/BExIS.Emm.Entities/app.config | 8 +- Helper/Settings.cs | 132 ------------------ Orm/BExIS.Emm.Orm.NH/BExIS.Emm.Orm.NH.csproj | 3 +- .../BExIS.Emm.Services.csproj | 3 +- Services/BExIS.Emm.Services/app.config | 36 ++--- web.config | 106 +++++++------- 10 files changed, 120 insertions(+), 211 deletions(-) create mode 100644 Emm.Settings.json delete mode 100644 Helper/Settings.cs diff --git a/BExIS.Modules.EMM.UI.csproj b/BExIS.Modules.EMM.UI.csproj index be4ab77..c0c9d64 100644 --- a/BExIS.Modules.EMM.UI.csproj +++ b/BExIS.Modules.EMM.UI.csproj @@ -18,7 +18,7 @@ Properties BExIS.Modules.EMM.UI BExIS.Modules.EMM.UI - v4.5.2 + v4.8 false true @@ -30,6 +30,7 @@ ..\..\..\..\packages\WebGrease.1.5.2\lib + true @@ -74,13 +75,16 @@ - ..\..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll + + + + ..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.Helpers.dll @@ -108,11 +112,11 @@ ..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.3\lib\net45\System.Web.WebPages.Razor.dll - + ..\..\..\..\packages\TelerikMvcExtensions.2012.3.1018\lib\net40\Telerik.Web.Mvc.dll True @@ -165,7 +169,6 @@ - @@ -195,6 +198,7 @@ + diff --git a/Controllers/EventController.cs b/Controllers/EventController.cs index 135c3a6..1e6533c 100644 --- a/Controllers/EventController.cs +++ b/Controllers/EventController.cs @@ -22,6 +22,7 @@ using Vaiona.Persistence.Api; using System.Xml.Linq; using Newtonsoft.Json; +using Vaiona.Web.Mvc.Modularity; namespace BExIS.Modules.EMM.UI.Controllers { @@ -165,7 +166,9 @@ public ActionResult Save(EventModel model, HttpPostedFileBase file) using (EntityPermissionManager pManager = new EntityPermissionManager()) { Entity entityType = entityTypeManager.FindByName("Event"); - string[] eventAdminGroups = Helper.Settings.get("EventAdminGroups").ToString().Split(','); + var settings = ModuleManager.GetModuleSettings("emm"); + string[] eventAdminGroups = settings.GetValueByKey("EventAdminGroups").ToString().Split(','); + if (eventAdminGroups != null && eventAdminGroups.Length > 0) { foreach(var g in eventAdminGroups) diff --git a/Emm.Settings.json b/Emm.Settings.json new file mode 100644 index 0000000..db1cfc2 --- /dev/null +++ b/Emm.Settings.json @@ -0,0 +1,23 @@ +{ + "id": "emm", + "name": "Event management", + "description": "...", + "entries": [ + { + "key": "help", + "title": "Help URL", + "value": "", + "type": "String", + "description": "URL to the manual. If empty, it links to the latest manual from BEXIS2" + }, + { + "key": "EventAdminGroups", + "title": "Event admin groups", + "value": "beo, administrator", + "description": "", + "type": "String", + "options": [] + } + + ] +} \ No newline at end of file diff --git a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj index 8190d19..5c84c22 100644 --- a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj +++ b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj @@ -14,10 +14,11 @@ Properties BExIS.Emm.Entities BExIS.Emm.Entities - v4.5.2 + v4.8 512 + true diff --git a/Entities/BExIS.Emm.Entities/app.config b/Entities/BExIS.Emm.Entities/app.config index f6e7dca..ee3cc47 100644 --- a/Entities/BExIS.Emm.Entities/app.config +++ b/Entities/BExIS.Emm.Entities/app.config @@ -1,11 +1,11 @@ - + - - + + - \ No newline at end of file + diff --git a/Helper/Settings.cs b/Helper/Settings.cs deleted file mode 100644 index 2bec54e..0000000 --- a/Helper/Settings.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Xml; -using System.Xml.Linq; -using Vaiona.Utils.Cfg; - -namespace BExIS.Modules.EMM.UI.Helper -{ - static class Settings - { - - private static String filePath = Path.Combine(AppConfiguration.GetModuleWorkspacePath("EMM"), "Emm.settings.xml"); - private static Dictionary settings = new Dictionary(); - - /// - /// setup settings model - /// * load settings from settings.xml - /// - static Settings() - { - // intial loading of settings - reloadSettings(); - - // set up file watcher to listen for changes - using (FileSystemWatcher fw = new FileSystemWatcher()) - { - fw.Path = Path.GetDirectoryName(filePath); - fw.Filter = Path.GetFileName(filePath); - fw.Changed += new FileSystemEventHandler(fw_Changed); - fw.EnableRaisingEvents = true; - } - - } - - /// - /// retrieve a value from the settings file - /// - /// the key for the parameter - /// the respective value - public static object get(String key) - { - if (settings.ContainsKey(key)) - { - return settings[key]; - } - else - { - return null; - } - } - - /// - /// add or change an entry in the settings - /// TODO persist changes in workflow file - /// - /// - /// - public static void set(String key, object value) - { - if (settings.ContainsKey(key)) - { - settings[key] = value; - } - else - { - settings.Add(key, value); - } - } - - /// - /// Handler to listen for changes in settings file - /// - /// - /// - private static void fw_Changed(object sender, FileSystemEventArgs e) - { - reloadSettings(); - } - - /// - /// load settings anew from settings.xml - /// - private static void reloadSettings() - { - // get XML data - XDocument xDoc = XDocument.Load(filePath); - XmlDocument xmlDoc = new XmlDocument(); - xmlDoc.Load(xDoc.CreateReader()); - - // empty old settings list - settings.Clear(); - - // parse values - foreach (XmlNode node in xmlDoc.SelectNodes("//settings/entry")) - { - // shortcuts - var key = node.Attributes["key"] != null ? node.Attributes["key"].Value : null; - var value = node.Attributes["value"] != null ? node.Attributes["value"].Value : null; - var type = node.Attributes["type"] != null ? node.Attributes["type"].Value : null; - - // only parse valid entries - if ((null == key) || (null == value)) - { - continue; - } - - // convert types - switch (type) - { - case "int": - int intVal; - if (Int32.TryParse(value, out intVal)) - { - settings.Add(key, intVal); - } - else - { - settings.Add(key, value); - } - break; - - // default is string - default: - settings.Add(key, value); - break; - } - } - } - - } -} \ No newline at end of file diff --git a/Orm/BExIS.Emm.Orm.NH/BExIS.Emm.Orm.NH.csproj b/Orm/BExIS.Emm.Orm.NH/BExIS.Emm.Orm.NH.csproj index 729ff3d..68411ac 100644 --- a/Orm/BExIS.Emm.Orm.NH/BExIS.Emm.Orm.NH.csproj +++ b/Orm/BExIS.Emm.Orm.NH/BExIS.Emm.Orm.NH.csproj @@ -14,10 +14,11 @@ Properties BExIS.Emm.Orm.NH BExIS.Emm.Orm.NH - v4.5.2 + v4.8 512 + true diff --git a/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj b/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj index 0f23b1c..540e68c 100644 --- a/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj +++ b/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj @@ -14,10 +14,11 @@ Properties BExIS.Emm.Services BExIS.Emm.Services - v4.5.2 + v4.8 512 + true diff --git a/Services/BExIS.Emm.Services/app.config b/Services/BExIS.Emm.Services/app.config index 8e59a78..d8e6a28 100644 --- a/Services/BExIS.Emm.Services/app.config +++ b/Services/BExIS.Emm.Services/app.config @@ -1,39 +1,39 @@ - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - \ No newline at end of file + diff --git a/web.config b/web.config index 1b4ca9a..889f03e 100644 --- a/web.config +++ b/web.config @@ -1,97 +1,105 @@ - + + - - - - + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - - - + + + + - \ No newline at end of file + + \ No newline at end of file From 185a3093f4d9ce6c23a8a0feef4136af4d095729 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Tue, 16 Apr 2024 10:21:13 +0200 Subject: [PATCH 02/20] reload libs --- BExIS.Modules.EMM.UI.csproj | 59 ++++++++++--------- .../BExIS.Emm.Services.csproj | 21 ++++--- 2 files changed, 44 insertions(+), 36 deletions(-) diff --git a/BExIS.Modules.EMM.UI.csproj b/BExIS.Modules.EMM.UI.csproj index c0c9d64..d71fcbd 100644 --- a/BExIS.Modules.EMM.UI.csproj +++ b/BExIS.Modules.EMM.UI.csproj @@ -121,33 +121,6 @@ ..\..\..\..\packages\TelerikMvcExtensions.2012.3.1018\lib\net40\Telerik.Web.Mvc.dll True - - ..\..\..\..\Libraries\Vaiona\Vaiona.Entities.dll - False - - - False - ..\..\..\..\Libraries\Vaiona\Vaiona.Logging.dll - - - ..\..\..\..\Libraries\Vaiona\Vaiona.Model.dll - - - ..\..\..\..\Libraries\Vaiona\Vaiona.Persistence.Api.dll - - - ..\..\..\..\Libraries\Vaiona\Vaiona.Utils.dll - - - ..\..\..\..\Libraries\Vaiona\Vaiona.Web.dll - - - ..\..\..\..\Libraries\Vaiona\Vaiona.Web.Mvc.dll - - - False - ..\..\..\..\Libraries\Vaiona\Vaiona.Web.Mvc.Modularity.dll - ..\..\..\..\packages\WebActivatorEx.2.2.0\lib\net40\WebActivatorEx.dll @@ -263,6 +236,38 @@ {A7FBCC13-7E29-4710-82A1-BD6D6F811FDA} BExIS.Utils.Data + + {0815d220-3625-4e23-bbbc-8152345637fe} + Vaiona.Entities + + + {e8b37581-1cac-463d-903b-b4bee8b2b0e3} + Vaiona.Logging + + + {a60ac05f-8c9a-4efd-9826-452e6049da4d} + Vaiona.Model + + + {640bf81d-354a-4bf0-85fc-f0ad587cf8a2} + Vaiona.Persistence.Api + + + {63fcacaa-9534-4fdd-a082-78dcc06baf28} + Vaiona.Utils + + + {705f8751-e58a-453e-a7fd-0c310fd3cae8} + Vaiona.Web.Mvc.Modularity + + + {5f5d22e8-8c05-49cd-854e-8fe8eff1aa6c} + Vaiona.Web.Mvc + + + {5b48b5a8-eae8-4ef8-8f2c-7fedb1b095d3} + Vaiona.Web + {252f7872-a69c-43a6-84b4-4d2abdbdd9ab} BExIS.Xml.Helpers diff --git a/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj b/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj index 540e68c..0dec12f 100644 --- a/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj +++ b/Services/BExIS.Emm.Services/BExIS.Emm.Services.csproj @@ -46,15 +46,6 @@ - - ..\..\..\..\..\..\Libraries\Vaiona\Vaiona.Entities.dll - - - ..\..\..\..\..\..\Libraries\Vaiona\Vaiona.Persistence.Api.dll - - - ..\..\..\..\..\..\Libraries\Vaiona\Vaiona.Utils.dll - @@ -71,6 +62,18 @@ {b4e7b1bf-01b4-40af-8d19-b8f362167261} BExIS.Dlm.Entities + + {0815d220-3625-4e23-bbbc-8152345637fe} + Vaiona.Entities + + + {640bf81d-354a-4bf0-85fc-f0ad587cf8a2} + Vaiona.Persistence.Api + + + {63fcacaa-9534-4fdd-a082-78dcc06baf28} + Vaiona.Utils + {2a701141-381e-4ad0-a446-094e4d22bee4} BExIS.Emm.Entities From f9d0434a2ec45003285974c3cc73f16bdfdbdf99 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Tue, 16 Apr 2024 11:27:32 +0200 Subject: [PATCH 03/20] reload lib --- Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj index 5c84c22..dd4fd5d 100644 --- a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj +++ b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj @@ -46,11 +46,9 @@ - - ..\..\..\..\..\..\Libraries\Vaiona\Vaiona.Entities.dll - - - ..\..\..\..\..\..\Libraries\Vaiona\Vaiona.Persistence.Api.dll + + False + ..\..\..\..\..\..\Components\AAA\BExIS.Security.Services\bin\Debug\Vaiona.Entities.dll From 572bec1a1a13b91b20145e9e69a0a8ad7f910e1a Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Tue, 16 Apr 2024 11:42:44 +0200 Subject: [PATCH 04/20] reload libs --- Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj index dd4fd5d..75c2e7c 100644 --- a/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj +++ b/Entities/BExIS.Emm.Entities/BExIS.Emm.Entities.csproj @@ -46,10 +46,6 @@ - - False - ..\..\..\..\..\..\Components\AAA\BExIS.Security.Services\bin\Debug\Vaiona.Entities.dll - @@ -62,9 +58,13 @@ BExIS.Security.Entities - {b4e7b1bf-01b4-40af-8d19-b8f362167261} + {B4E7B1BF-01B4-40AF-8D19-B8F362167261} BExIS.Dlm.Entities + + {0815D220-3625-4E23-BBBC-8152345637FE} + Vaiona.Entities + From d09750db58fa6b6782dea6abc7b5a7469290232c Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 17 Jul 2024 10:49:00 +0200 Subject: [PATCH 05/20] libs --- Helper/FormHelper.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Helper/FormHelper.cs b/Helper/FormHelper.cs index 9cb0251..b57149b 100644 --- a/Helper/FormHelper.cs +++ b/Helper/FormHelper.cs @@ -1,5 +1,6 @@ -using BExIS.Dim.Entities.Mapping; -using BExIS.Dim.Helpers.Mapping; + +using BExIS.Dim.Entities.Mappings; +using BExIS.Dim.Helpers.Mappings; using BExIS.Dlm.Entities.Common; using BExIS.Dlm.Entities.DataStructure; using BExIS.Dlm.Entities.MetadataStructure; From 590a424887e05a0d6256bc49feea2ef41aa8efe6 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 12 Aug 2024 09:35:59 +0200 Subject: [PATCH 06/20] add server info --- Properties/PublishProfiles/BexisServer_2010-testsite.pubxml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml index 8fac3cf..789e96b 100644 --- a/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml +++ b/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml @@ -12,6 +12,8 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False + be2020-dev.inf-bb.uni-jena.de + 2010-TestSite C:\inetpub\wwwroot\2010-TestSite\Site\Areas\EMM False From 0dffd86e0a5a0e35d651528f8d49858fd88fc9c9 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 12 Aug 2024 13:20:40 +0200 Subject: [PATCH 07/20] change to 2030 Testsite --- Properties/PublishProfiles/BexisServer_2010-testsite.pubxml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml index 789e96b..929d270 100644 --- a/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml +++ b/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml @@ -12,9 +12,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False - be2020-dev.inf-bb.uni-jena.de - 2010-TestSite - C:\inetpub\wwwroot\2010-TestSite\Site\Areas\EMM + \\be2020-dev.inf-bb.uni-jena.de\2030-TestSite\Site\Areas\EMM False \ No newline at end of file From 59987f38e707adec96d7ddcfddfe17c270209dcb Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 12 Aug 2024 14:14:16 +0200 Subject: [PATCH 08/20] publish profile 2030 --- ...rver_2010-testsite.pubxml => BexisServer_2030-testsite.pubxml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Properties/PublishProfiles/{BexisServer_2010-testsite.pubxml => BexisServer_2030-testsite.pubxml} (100%) diff --git a/Properties/PublishProfiles/BexisServer_2010-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml similarity index 100% rename from Properties/PublishProfiles/BexisServer_2010-testsite.pubxml rename to Properties/PublishProfiles/BexisServer_2030-testsite.pubxml From a736ee47de1e8a4c727784b4659dd1975668ebff Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Tue, 24 Sep 2024 16:10:57 +0200 Subject: [PATCH 09/20] pub profile for v3 --- BExIS.Modules.EMM.UI.csproj | 2 +- Properties/PublishProfiles/BexisServer_2030-testsite.pubxml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/BExIS.Modules.EMM.UI.csproj b/BExIS.Modules.EMM.UI.csproj index d71fcbd..9f93ead 100644 --- a/BExIS.Modules.EMM.UI.csproj +++ b/BExIS.Modules.EMM.UI.csproj @@ -173,7 +173,7 @@ - + diff --git a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml index 929d270..2409a6e 100644 --- a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml +++ b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml @@ -12,7 +12,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False - \\be2020-dev.inf-bb.uni-jena.de\2030-TestSite\Site\Areas\EMM + Y:\EMM False \ No newline at end of file From 50f2c48fcba23f69d7019920acdaac19cc420b8a Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 25 Sep 2024 13:45:04 +0200 Subject: [PATCH 10/20] pub profile --- Properties/PublishProfiles/BexisServer_2030-testsite.pubxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml index 2409a6e..1d303b3 100644 --- a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml +++ b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml @@ -12,7 +12,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False - Y:\EMM + Y:\Site\Areas\EMM False \ No newline at end of file From 425f6b5ae63ed1c1a659ed33fe43238b877958ff Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Fri, 27 Sep 2024 14:22:28 +0200 Subject: [PATCH 11/20] pub --- Properties/PublishProfiles/BexisServer_2030-testsite.pubxml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml index 1d303b3..9ca7857 100644 --- a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml +++ b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml @@ -12,7 +12,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False - Y:\Site\Areas\EMM + C:\inetpub\wwwroot\2030-TestSite\Site\Areas\EMM False \ No newline at end of file From b0dddbe5c38d97c66b0dee519c3fb7a6c9215780 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 14 Oct 2024 10:59:29 +0200 Subject: [PATCH 12/20] EntityPermissionManager async in version 3.4.0 --- Controllers/EventController.cs | 4 ++-- Controllers/EventRegistrationResultController.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Controllers/EventController.cs b/Controllers/EventController.cs index 1e6533c..748c3f0 100644 --- a/Controllers/EventController.cs +++ b/Controllers/EventController.cs @@ -177,8 +177,8 @@ public ActionResult Save(EventModel model, HttpPostedFileBase file) var group = groupManager.FindByNameAsync(g).Result; if (group != null) { - if (pManager.GetRights(group.Id, entityType.Id, newEvent.Id) == 0) - pManager.Create(group.Id, entityType.Id, newEvent.Id, fullRights); + if (pManager.GetRightsAsync(group.Id, entityType.Id, newEvent.Id).Result == 0) + pManager.CreateAsync(group.Id, entityType.Id, newEvent.Id, fullRights); } } diff --git a/Controllers/EventRegistrationResultController.cs b/Controllers/EventRegistrationResultController.cs index 16f9d28..5798810 100644 --- a/Controllers/EventRegistrationResultController.cs +++ b/Controllers/EventRegistrationResultController.cs @@ -183,7 +183,7 @@ public ActionResult OnSelectTreeViewItem(long id) { var user = userManager.FindByNameAsync(HttpContext.User.Identity.Name).Result; Entity entity = entityTypeManager.FindByName("Event"); - model.UserHasRights = permissionManager.HasEffectiveRight(user.Name, entity.EntityType, id, RightType.Read); + model.UserHasRights = permissionManager.HasEffectiveRightsAsync(user.Name, entity.EntityType, id, RightType.Read).Result; } return View("EventRegistrationResults", model); From ae000daa7375e8000673d7e5b08373568417b920 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 13 Nov 2024 13:58:00 +0100 Subject: [PATCH 13/20] Create Event - xpath does not work fixed #148 --- Views/Event/EditEvent.cshtml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Views/Event/EditEvent.cshtml b/Views/Event/EditEvent.cshtml index d2c7995..810f9dd 100644 --- a/Views/Event/EditEvent.cshtml +++ b/Views/Event/EditEvent.cshtml @@ -298,10 +298,11 @@ $('#XPathToLastName').append(''); $.get('@Url.Action("GetMetadataNodes", "Event", new RouteValueDictionary { { "area", "EMM" } })', { id: id }, function (data) { var jsonData = JSON.parse(data); + console.log(data); jsonData.forEach(function (object) { - $('#XPathToEmail').append(''); - $('#XPathToFirstName').append(''); - $('#XPathToLastName').append(''); + $('#XPathToEmail').append(''); + $('#XPathToFirstName').append(''); + $('#XPathToLastName').append(''); }); }); }); From 59a58adbc5b671701374a62faa498f0312e19a74 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 18 Nov 2024 16:50:03 +0100 Subject: [PATCH 14/20] xpath does not work #148 --- Views/Event/EditEvent.cshtml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Views/Event/EditEvent.cshtml b/Views/Event/EditEvent.cshtml index 810f9dd..1c379b0 100644 --- a/Views/Event/EditEvent.cshtml +++ b/Views/Event/EditEvent.cshtml @@ -265,23 +265,23 @@ var jsonData = JSON.parse(data); jsonData.forEach(function (object) { if ('@Model.XPathToEmail' == object.XPath) { - $('#XPathToEmail').append(''); + $('#XPathToEmail').append(''); } else { - $('#XPathToEmail').append(''); + $('#XPathToEmail').append(''); } if ('@Model.XPathToFirstName' == object.XPath) { - $('#XPathToFirstName').append(''); + $('#XPathToFirstName').append(''); } else { - $('#XPathToFirstName').append(''); + $('#XPathToFirstName').append(''); } if ('@Model.XPathToLastName' == object.XPath) { - $('#XPathToLastName').append(''); + $('#XPathToLastName').append(''); } else { - $('#XPathToLastName').append(''); + $('#XPathToLastName').append(''); } }); }); From 05900aac234bab490a4497ab412b5c1eb5bbaf74 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 4 Dec 2024 14:17:26 +0100 Subject: [PATCH 15/20] fix bug event reg --- Controllers/EventRegistrationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/EventRegistrationController.cs b/Controllers/EventRegistrationController.cs index 863b8f3..91d9019 100644 --- a/Controllers/EventRegistrationController.cs +++ b/Controllers/EventRegistrationController.cs @@ -383,7 +383,7 @@ public ActionResult LoadForm(LogInToEventModel model) if (model.Edit) { - if(model.RefId.Length > 0) + if(model.RefId != null && model.RefId.Length > 0) { List regs = erManager.GetRegistrationsByRefIdAndEvent(model.RefId, e.Id); EventRegistration reg = regs.Where(a => a.Deleted == false).FirstOrDefault(); From 5f4549f8cd5ea24dbff3158bb675456e9fb3fdca Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Thu, 5 Dec 2024 13:12:32 +0100 Subject: [PATCH 16/20] email service update --- Controllers/EventRegistrationController.cs | 39 ++++++------- .../EventRegistrationResultController.cs | 41 +++++++------- Helper/EmailHelper.cs | 55 ++++++++++--------- 3 files changed, 69 insertions(+), 66 deletions(-) diff --git a/Controllers/EventRegistrationController.cs b/Controllers/EventRegistrationController.cs index 91d9019..8d5f12e 100644 --- a/Controllers/EventRegistrationController.cs +++ b/Controllers/EventRegistrationController.cs @@ -751,28 +751,29 @@ private void SendWaitingListNotification(XmlDocument data, Event e) emailStructure.bodyClosingName; - var es = new EmailService(); - - // If no explicit Reply to mail is set use the SystemEmail - string replyTo = ""; - if (String.IsNullOrEmpty(e.EmailReply)) - { - replyTo = ConfigurationManager.AppSettings["SystemEmail"]; - } - else + using (var es = new EmailService()) { - replyTo = e.EmailReply; - } - es.Send( - subject, - body, - new List { email }, // to - new List { e.EmailCC }, // CC - new List { ConfigurationManager.AppSettings["SystemEmail"], e.EmailBCC }, // Allways send BCC to SystemEmail + additional set - new List { replyTo } - ); + // If no explicit Reply to mail is set use the SystemEmail + string replyTo = ""; + if (String.IsNullOrEmpty(e.EmailReply)) + { + replyTo = ConfigurationManager.AppSettings["SystemEmail"]; + } + else + { + replyTo = e.EmailReply; + } + es.Send( + subject, + body, + new List { email }, // to + new List { e.EmailCC }, // CC + new List { ConfigurationManager.AppSettings["SystemEmail"], e.EmailBCC }, // Allways send BCC to SystemEmail + additional set + new List { replyTo } + ); + } } public ActionResult Save() diff --git a/Controllers/EventRegistrationResultController.cs b/Controllers/EventRegistrationResultController.cs index 5798810..e87232d 100644 --- a/Controllers/EventRegistrationResultController.cs +++ b/Controllers/EventRegistrationResultController.cs @@ -250,33 +250,34 @@ private void SendNotification(XmlDocument data, Event e) string subject = emailStructure.removeFromWaitingListSubject + e.Name; string body = emailStructure.bodyTitle + first_name + " " + last_name + ", " + "

" + - emailStructure.removeFromWaitingList1 + "

" + + emailStructure.removeFromWaitingList1 + "

" + emailStructure.bodyClosing + "
" + emailStructure.bodyClosingName; - var es = new EmailService(); - - // If no explicit Reply to mail is set use the SystemEmail - string replyTo = ""; - if (String.IsNullOrEmpty(e.EmailReply)) - { - replyTo = ConfigurationManager.AppSettings["SystemEmail"]; - } - else + using (var es = new EmailService()) { - replyTo = e.EmailReply; - } - es.Send( - subject, - body, - new List { email }, // to - new List { e.EmailCC }, // CC - new List { ConfigurationManager.AppSettings["SystemEmail"], e.EmailBCC }, // Allways send BCC to SystemEmail + additional set - new List { replyTo } - ); + // If no explicit Reply to mail is set use the SystemEmail + string replyTo = ""; + if (String.IsNullOrEmpty(e.EmailReply)) + { + replyTo = ConfigurationManager.AppSettings["SystemEmail"]; + } + else + { + replyTo = e.EmailReply; + } + es.Send( + subject, + body, + new List { email }, // to + new List { e.EmailCC }, // CC + new List { ConfigurationManager.AppSettings["SystemEmail"], e.EmailBCC }, // Allways send BCC to SystemEmail + additional set + new List { replyTo } + ); + } } #endregion diff --git a/Helper/EmailHelper.cs b/Helper/EmailHelper.cs index 97422b9..852e831 100644 --- a/Helper/EmailHelper.cs +++ b/Helper/EmailHelper.cs @@ -107,41 +107,42 @@ public static void SendEmailNotification(string notificationType, string email, body += emailStructure.bodyOpening + "
" + details + "

"; if (notificationType != "deleted") - body += emailStructure.bodyHintToLink + "" + url + "/emm/EventRegistration/EventRegistration/?ref_id=" + ref_id + "

"; + body += emailStructure.bodyHintToLink + "" + url + "/emm/EventRegistration/EventRegistration/?ref_id=" + ref_id + "

"; body += emailStructure.bodyClosing + "
" + emailStructure.bodyClosingName; - var es = new EmailService(); + using (var es = new EmailService()) + { + List ccMails = new List(); + if (!String.IsNullOrEmpty(e.EmailCC)) + ccMails.AddRange(e.EmailCC.Split(',').ToList()); - List ccMails = new List(); - if (!String.IsNullOrEmpty(e.EmailCC)) - ccMails.AddRange(e.EmailCC.Split(',').ToList()); + List bccMails = new List(); + bccMails.Add(ConfigurationManager.AppSettings["SystemEmail"]); + if (!String.IsNullOrEmpty(e.EmailBCC)) + bccMails.AddRange(e.EmailBCC.Split(',').ToList()); - List bccMails = new List(); - bccMails.Add(ConfigurationManager.AppSettings["SystemEmail"]); - if (!String.IsNullOrEmpty(e.EmailBCC)) - bccMails.AddRange(e.EmailBCC.Split(',').ToList()); + // If no explicit Reply to mail is set use the SystemEmail + string replyTo = ""; + if (String.IsNullOrEmpty(e.EmailReply)) + { + replyTo = ConfigurationManager.AppSettings["SystemEmail"]; + } + else + { + replyTo = e.EmailReply; + } - // If no explicit Reply to mail is set use the SystemEmail - string replyTo = ""; - if (String.IsNullOrEmpty(e.EmailReply)) - { - replyTo = ConfigurationManager.AppSettings["SystemEmail"]; - } - else - { - replyTo = e.EmailReply; + es.Send( + subject, + body, + new List { email }, // to + ccMails, // CC + bccMails, // Allways send BCC to SystemEmail + additional set + new List { replyTo } + ); } - - es.Send( - subject, - body, - new List { email }, // to - ccMails, // CC - bccMails, // Allways send BCC to SystemEmail + additional set - new List { replyTo } - ); } public static string GetRefIdFromEmail(string email) From 3f3436703769e6b5187be0c5ed6f72078cbec5fb Mon Sep 17 00:00:00 2001 From: Eleonora Petzold <42029171+EleonoraPetzold@users.noreply.github.com> Date: Wed, 21 Jan 2026 09:46:49 +0100 Subject: [PATCH 17/20] Add files via upload add publish profile for v4 prod test https://github.com/bexis/BExIS-intern/issues/804 --- .../BexisServer_v4-ProdTestsite.pubxml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml diff --git a/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml b/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml new file mode 100644 index 0000000..1c9a5b2 --- /dev/null +++ b/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml @@ -0,0 +1,18 @@ + + + + + FileSystem + FileSystem + Release + Any CPU + + True + False + C:\inetpub\wwwroot\v4-ProdTestsite\Site\Areas\EMM + False + + \ No newline at end of file From 7a380dde98efa6d1cf1aba8faaa32271cab4f6f1 Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Mon, 2 Feb 2026 16:18:03 +0100 Subject: [PATCH 18/20] add PublishProfiles --- BExIS.Modules.EMM.UI.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/BExIS.Modules.EMM.UI.csproj b/BExIS.Modules.EMM.UI.csproj index 9f93ead..df890ef 100644 --- a/BExIS.Modules.EMM.UI.csproj +++ b/BExIS.Modules.EMM.UI.csproj @@ -175,6 +175,7 @@ + From 7504899bac9b20e30c6bde89c46d42046a9909eb Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 29 Apr 2026 11:15:31 +0200 Subject: [PATCH 19/20] Change security manager calls for B2 v4.3.0 #155 --- Controllers/EventController.cs | 12 ++- .../EventRegistrationResultController.cs | 85 +++++++++++++++---- 2 files changed, 78 insertions(+), 19 deletions(-) diff --git a/Controllers/EventController.cs b/Controllers/EventController.cs index 748c3f0..156da81 100644 --- a/Controllers/EventController.cs +++ b/Controllers/EventController.cs @@ -28,6 +28,13 @@ namespace BExIS.Modules.EMM.UI.Controllers { public class EventController : Controller { + private readonly GroupManager _groupManager; + + public EventController(GroupManager groupManager) + { + _groupManager = groupManager; + } + public ActionResult EventManager() { ViewBag.Title = PresentationModel.GetViewTitleForTenant("Manage Events", this.Session.GetTenant()); @@ -161,10 +168,9 @@ public ActionResult Save(EventModel model, HttpPostedFileBase file) eManager.UpdateEvent(newEvent); //add security - using (var groupManager = new GroupManager()) using (var entityTypeManager = new EntityManager()) - using (EntityPermissionManager pManager = new EntityPermissionManager()) { + EntityPermissionManager pManager = new EntityPermissionManager(); Entity entityType = entityTypeManager.FindByName("Event"); var settings = ModuleManager.GetModuleSettings("emm"); string[] eventAdminGroups = settings.GetValueByKey("EventAdminGroups").ToString().Split(','); @@ -174,7 +180,7 @@ public ActionResult Save(EventModel model, HttpPostedFileBase file) foreach(var g in eventAdminGroups) { int fullRights = (int)RightType.Read + (int)RightType.Write + (int)RightType.Delete + (int)RightType.Grant; - var group = groupManager.FindByNameAsync(g).Result; + var group = _groupManager.FindByNameAsync(g).Result; if (group != null) { if (pManager.GetRightsAsync(group.Id, entityType.Id, newEvent.Id).Result == 0) diff --git a/Controllers/EventRegistrationResultController.cs b/Controllers/EventRegistrationResultController.cs index e87232d..7687356 100644 --- a/Controllers/EventRegistrationResultController.cs +++ b/Controllers/EventRegistrationResultController.cs @@ -33,6 +33,12 @@ namespace BExIS.Modules.EMM.UI.Controllers { public class EventRegistrationResultController : Controller { + private readonly UserManager _userManager; + + public EventRegistrationResultController(UserManager userManager) + { + _userManager = userManager; + } private CreateTaskmanager TaskManager; @@ -177,11 +183,10 @@ public ActionResult OnSelectTreeViewItem(long id) model.EventId = id; //check rights on event - using (var permissionManager = new EntityPermissionManager()) using (var entityTypeManager = new EntityManager()) - using (var userManager = new UserManager()) { - var user = userManager.FindByNameAsync(HttpContext.User.Identity.Name).Result; + EntityPermissionManager permissionManager = new EntityPermissionManager(); + var user = _userManager.FindByNameAsync(HttpContext.User.Identity.Name).Result; Entity entity = entityTypeManager.FindByName("Event"); model.UserHasRights = permissionManager.HasEffectiveRightsAsync(user.Name, entity.EntityType, id, RightType.Read).Result; } @@ -366,7 +371,6 @@ private void setAdditionalFunctions() public ActionResult DeleteRegistration(long id) { using (EventRegistrationManager erManager = new EventRegistrationManager()) - using (UserManager userManager = new UserManager()) { EventRegistration reg = erManager.EventRegistrationRepo.Get(a => a.Id == id).FirstOrDefault(); if (reg != null) @@ -381,7 +385,7 @@ public ActionResult DeleteRegistration(long id) if (reg.Person != null) { - User user = userManager.FindByIdAsync(reg.Person.Id).Result; + User user = _userManager.FindByIdAsync(reg.Person.Id).Result; email = user.Email; } else @@ -502,23 +506,48 @@ private DataTable GetWaitingListResults(long eventId) // return results; //} + private static string MakeUniqueColumnName(DataTable dt, string desiredName) + { + var baseName = string.IsNullOrWhiteSpace(desiredName) ? "Column" : desiredName.Trim(); + + if (!dt.Columns.Contains(baseName)) + return baseName; + + int i = 2; + string candidate; + do + { + candidate = $"{baseName}__{i}"; + i++; + } while (dt.Columns.Contains(candidate)); + + return candidate; + } + + private DataTable CreateDataTableColums(DataTable dataTable, XElement x) { - DataTable dt = dataTable; - // build your DataTable - foreach (XElement xe in x.Descendants()) + var dt = dataTable; + + foreach (var xe in x.Descendants()) { if (!xe.HasElements) { - DataColumn dc = new DataColumn(); - string colName = xe.Name.ToString().Replace("Type", ""); - dc.Caption = colName; - dc.ColumnName = colName; - dt.Columns.Add(dc); // add columns to your dt + var displayName = xe.Name.ToString().Replace("Type", ""); + var internalName = MakeUniqueColumnName(dt, displayName); + + var dc = new DataColumn + { + Caption = displayName, // darf doppelt sein (UI) + ColumnName = internalName // MUSS eindeutig sein (DataTable) + }; + + dt.Columns.Add(dc); } } return dt; + } private DataRow AddDataRow(XElement x, DataTable dt, string deleted, long id) @@ -526,14 +555,37 @@ private DataRow AddDataRow(XElement x, DataTable dt, string deleted, long id) DataRow dr = dt.NewRow(); dr["Id"] = id; dr["Deleted"] = deleted; + + // Zähler je Feldname (z.B. Category -> wie oft schon befüllt) + var usageCounter = new Dictionary(StringComparer.OrdinalIgnoreCase); + foreach (XElement xe in x.Descendants()) { if (!xe.HasElements) { - string value = xe.Value.Replace("\r\n", " "); - value = value.Replace("\n", " "); + string displayName = xe.Name.ToString().Replace("Type", ""); + string value = xe.Value.Replace("\r\n", " ").Replace("\n", " "); value = HttpUtility.HtmlDecode(value); - dr[xe.Name.ToString().Replace("Type", "")] = value; //add in the values + + // wie oft kam dieses Feld schon? + if (!usageCounter.ContainsKey(displayName)) + usageCounter[displayName] = 0; + + int index = usageCounter[displayName]; + + // passende Spalte suchen (über Caption!) + var matchingColumns = dt.Columns + .Cast() + .Where(c => c.Caption.Equals(displayName, StringComparison.OrdinalIgnoreCase)) + .ToList(); + + if (index < matchingColumns.Count) + { + var targetColumn = matchingColumns[index]; + dr[targetColumn.ColumnName] = value; + usageCounter[displayName]++; + } + // else: mehr Werte als Spalten -> bewusst ignorieren oder loggen } } @@ -543,6 +595,7 @@ private DataRow AddDataRow(XElement x, DataTable dt, string deleted, long id) #endregion + } } From 5f7bc048b3a8f4414e49f4902b0d4bf93ece9c0d Mon Sep 17 00:00:00 2001 From: Eleonora Petzold Date: Wed, 10 Jun 2026 11:22:52 +0200 Subject: [PATCH 20/20] puplish profile dev instance https://github.com/bexis/BExIS-intern/issues/804 --- BExIS.Modules.EMM.UI.csproj | 4 +--- .../BexisServer_2030-testsite.pubxml | 18 ------------------ ...te.pubxml => BexisServer_BE_DevSite.pubxml} | 2 +- .../BexisServer_v4-ProdTestsite.pubxml | 18 ------------------ 4 files changed, 2 insertions(+), 40 deletions(-) delete mode 100644 Properties/PublishProfiles/BexisServer_2030-testsite.pubxml rename Properties/PublishProfiles/{BexisServer_BE-Website.pubxml => BexisServer_BE_DevSite.pubxml} (93%) delete mode 100644 Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml diff --git a/BExIS.Modules.EMM.UI.csproj b/BExIS.Modules.EMM.UI.csproj index df890ef..829fcb9 100644 --- a/BExIS.Modules.EMM.UI.csproj +++ b/BExIS.Modules.EMM.UI.csproj @@ -173,9 +173,7 @@ - - - + diff --git a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml b/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml deleted file mode 100644 index 9ca7857..0000000 --- a/Properties/PublishProfiles/BexisServer_2030-testsite.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - FileSystem - Release - Any CPU - - True - False - C:\inetpub\wwwroot\2030-TestSite\Site\Areas\EMM - False - - \ No newline at end of file diff --git a/Properties/PublishProfiles/BexisServer_BE-Website.pubxml b/Properties/PublishProfiles/BexisServer_BE_DevSite.pubxml similarity index 93% rename from Properties/PublishProfiles/BexisServer_BE-Website.pubxml rename to Properties/PublishProfiles/BexisServer_BE_DevSite.pubxml index 3ff4dc5..847e4c3 100644 --- a/Properties/PublishProfiles/BexisServer_BE-Website.pubxml +++ b/Properties/PublishProfiles/BexisServer_BE_DevSite.pubxml @@ -12,7 +12,7 @@ indem Sie diese MSBuild-Datei bearbeiten. Weitere Informationen hierzu finden Si True False - C:\inetpub\wwwroot\BE-Website\Site\Areas\EMM + C:\inetpub\wwwroot\BE_DevSite\Site\Areas\EMM False \ No newline at end of file diff --git a/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml b/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml deleted file mode 100644 index 1c9a5b2..0000000 --- a/Properties/PublishProfiles/BexisServer_v4-ProdTestsite.pubxml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - FileSystem - FileSystem - Release - Any CPU - - True - False - C:\inetpub\wwwroot\v4-ProdTestsite\Site\Areas\EMM - False - - \ No newline at end of file