From ea00181d7fbd26922b89dfcc31de29ffa58789fe Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Wed, 3 Feb 2021 10:09:56 +0100 Subject: [PATCH] Upgrade Framework to 4.6.1, MySql.Data to 8 --- Backend/Backend.csproj | 4 +- Backend/app.config | 12 +-- Backend/packages.config | 8 +- Basic/Basic.csproj | 4 +- Basic/Properties/Settings.Designer.cs | 4 +- Basic/app.config | 2 +- Common/Common.csproj | 5 +- Database/Database.csproj | 6 +- Database/app.config | 2 +- Database/packages.config | 2 +- DebugConsole/App.config | 2 +- DebugConsole/DebugConsole.csproj | 2 +- FrontSocket/App.config | 2 +- FrontSocket/Frontend-Socket.csproj | 4 +- Interface/Interface.csproj | 4 +- Interface/app.config | 12 +-- Logic/Logic.csproj | 8 +- ...tions.Transmission.MailPayload.Designer.cs | 2 +- .../Logic.Financial.Payout.Designer.cs | 2 +- .../Logic.Structure.Geography.Designer.cs | 2 +- .../Authentication.Designer.cs | 2 +- Logic/Swarm/Person.cs | 7 ++ Logic/app.config | 16 ++-- Logic/packages.config | 10 +-- .../Pages.Governance.designer.cs | 2 +- .../Pages.Swarm.designer.cs | 2 +- Site/Controls/v5/Base/MainMenu.ascx.cs | 4 + Site/Default.aspx.cs | 7 ++ Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs | 54 +++++++++-- Site/Security/Login.aspx.cs | 27 ++++++ Site/Site.csproj | 18 ++-- Site/packages.config | 10 +-- Site/web.config | 90 +++++++++---------- Tests/Tests.csproj | 3 +- Tests/app.config | 12 +-- .../EventProcessor.Designer.cs | 2 +- Utility/Utility.csproj | 4 +- Utility/app.config | 12 +-- 38 files changed, 223 insertions(+), 148 deletions(-) diff --git a/Backend/Backend.csproj b/Backend/Backend.csproj index 953b033a..87e64ca8 100644 --- a/Backend/Backend.csproj +++ b/Backend/Backend.csproj @@ -1,5 +1,5 @@  - + Debug AnyCPU @@ -10,7 +10,7 @@ Properties Swarmops.Backend Swarmops.Backend - v4.5 + v4.6.1 512 false 2280FA0F5C408893812C70CF59D1DEF99F19AAA5 diff --git a/Backend/app.config b/Backend/app.config index 279a8697..d41a13a5 100644 --- a/Backend/app.config +++ b/Backend/app.config @@ -1,15 +1,15 @@ - + - + - - + + - - + + diff --git a/Backend/packages.config b/Backend/packages.config index b41859c6..fac9a260 100644 --- a/Backend/packages.config +++ b/Backend/packages.config @@ -2,7 +2,7 @@ - + @@ -12,10 +12,10 @@ - + - + @@ -33,7 +33,7 @@ - + \ No newline at end of file diff --git a/Basic/Basic.csproj b/Basic/Basic.csproj index 3b73013d..3777e27a 100644 --- a/Basic/Basic.csproj +++ b/Basic/Basic.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -15,7 +15,7 @@ 3.5 - v4.5 + v4.6.1 ..\ true diff --git a/Basic/Properties/Settings.Designer.cs b/Basic/Properties/Settings.Designer.cs index 5f839afb..21cc8b1f 100644 --- a/Basic/Properties/Settings.Designer.cs +++ b/Basic/Properties/Settings.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -12,7 +12,7 @@ namespace Swarmops.Basic.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/Basic/app.config b/Basic/app.config index f180140e..9ea038a9 100644 --- a/Basic/app.config +++ b/Basic/app.config @@ -2,4 +2,4 @@ - + diff --git a/Common/Common.csproj b/Common/Common.csproj index 55c28ce3..83936e02 100644 --- a/Common/Common.csproj +++ b/Common/Common.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,8 +9,9 @@ Properties Swarmops.Common Swarmops.Common - v4.5 + v4.6.1 512 + true diff --git a/Database/Database.csproj b/Database/Database.csproj index 7a981f39..e269c336 100644 --- a/Database/Database.csproj +++ b/Database/Database.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -15,7 +15,7 @@ 3.5 - v4.5 + v4.6.1 @@ -47,6 +47,7 @@ false + ..\packages\MySql.Data.6.9.9\lib\net45\MySql.Data.dll True @@ -54,6 +55,7 @@ + diff --git a/Database/app.config b/Database/app.config index 66e5cf65..e4fd3e88 100644 --- a/Database/app.config +++ b/Database/app.config @@ -4,7 +4,7 @@ - + diff --git a/Database/packages.config b/Database/packages.config index d493efdc..d3e2b595 100644 --- a/Database/packages.config +++ b/Database/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/DebugConsole/App.config b/DebugConsole/App.config index d1428ad7..bae5d6d8 100644 --- a/DebugConsole/App.config +++ b/DebugConsole/App.config @@ -1,6 +1,6 @@ - + diff --git a/DebugConsole/DebugConsole.csproj b/DebugConsole/DebugConsole.csproj index 35a4d4cd..a215eb80 100644 --- a/DebugConsole/DebugConsole.csproj +++ b/DebugConsole/DebugConsole.csproj @@ -9,7 +9,7 @@ Properties DebugConsole DebugConsole - v4.5 + v4.6.1 512 true diff --git a/FrontSocket/App.config b/FrontSocket/App.config index d1428ad7..bae5d6d8 100644 --- a/FrontSocket/App.config +++ b/FrontSocket/App.config @@ -1,6 +1,6 @@ - + diff --git a/FrontSocket/Frontend-Socket.csproj b/FrontSocket/Frontend-Socket.csproj index f03db547..79833eac 100644 --- a/FrontSocket/Frontend-Socket.csproj +++ b/FrontSocket/Frontend-Socket.csproj @@ -1,5 +1,5 @@  - + Debug @@ -9,7 +9,7 @@ Properties Swarmops.Frontend.Socket Swarmops.Frontend.Socket - v4.5 + v4.6.1 512 true diff --git a/Interface/Interface.csproj b/Interface/Interface.csproj index 9837251c..c1c22c44 100644 --- a/Interface/Interface.csproj +++ b/Interface/Interface.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -15,7 +15,7 @@ 3.5 - v4.5 + v4.6.1 ..\ true diff --git a/Interface/app.config b/Interface/app.config index 51722df3..09bf17d4 100644 --- a/Interface/app.config +++ b/Interface/app.config @@ -1,15 +1,15 @@ - + - - + + - - + + - \ No newline at end of file + diff --git a/Logic/Logic.csproj b/Logic/Logic.csproj index 50af2d1a..3b10846a 100644 --- a/Logic/Logic.csproj +++ b/Logic/Logic.csproj @@ -1,5 +1,5 @@  - + 65001 Local @@ -16,7 +16,7 @@ 3.5 - v4.5 + v4.6.1 ..\ true @@ -113,10 +113,6 @@ - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - diff --git a/Logic/Resources/Logic.Communications.Transmission.MailPayload.Designer.cs b/Logic/Resources/Logic.Communications.Transmission.MailPayload.Designer.cs index 6f019727..590ffc6f 100644 --- a/Logic/Resources/Logic.Communications.Transmission.MailPayload.Designer.cs +++ b/Logic/Resources/Logic.Communications.Transmission.MailPayload.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Logic/Resources/Logic.Financial.Payout.Designer.cs b/Logic/Resources/Logic.Financial.Payout.Designer.cs index 96155c86..8fdccb48 100644 --- a/Logic/Resources/Logic.Financial.Payout.Designer.cs +++ b/Logic/Resources/Logic.Financial.Payout.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Logic/Resources/Logic.Structure.Geography.Designer.cs b/Logic/Resources/Logic.Structure.Geography.Designer.cs index 8639e656..4080b68f 100644 --- a/Logic/Resources/Logic.Structure.Geography.Designer.cs +++ b/Logic/Resources/Logic.Structure.Geography.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.34209 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Logic/Security/App_LocalResources/Authentication.Designer.cs b/Logic/Security/App_LocalResources/Authentication.Designer.cs index c3ac3f77..22ed0f83 100644 --- a/Logic/Security/App_LocalResources/Authentication.Designer.cs +++ b/Logic/Security/App_LocalResources/Authentication.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Logic/Swarm/Person.cs b/Logic/Swarm/Person.cs index 7db4fe46..fff77508 100644 --- a/Logic/Swarm/Person.cs +++ b/Logic/Swarm/Person.cs @@ -622,6 +622,12 @@ namespace Swarmops.Logic.Swarm FromBasic (new BasicPerson (personId, string.Empty, "Open Ledgers", string.Empty, string.Empty, string.Empty, string.Empty, 0, string.Empty, 0, Constants.DateTimeLow, PersonGender.Unknown, "")); } + else if (personId == Person.UnnamedAccountantIdentity) + { + return FromBasic(new BasicPerson(personId, string.Empty, "Accountant", string.Empty, string.Empty, + string.Empty, string.Empty, 0, string.Empty, 0, Constants.DateTimeLow, PersonGender.Unknown, + string.Empty)); + } throw new ArgumentException("No such PersonId: " + personId); } @@ -1218,6 +1224,7 @@ namespace Swarmops.Logic.Swarm // A couple of special cases public const int OpenLedgersIdentity = -1; + public const int UnnamedAccountantIdentity = -2; public Participation ParticipationOf (Organization organization) diff --git a/Logic/app.config b/Logic/app.config index 8fae5a73..0e42e3e5 100644 --- a/Logic/app.config +++ b/Logic/app.config @@ -1,20 +1,20 @@ - + - - + + - - + + - - + + - \ No newline at end of file + diff --git a/Logic/packages.config b/Logic/packages.config index cfdd4c8e..26c0c94d 100644 --- a/Logic/packages.config +++ b/Logic/packages.config @@ -7,12 +7,12 @@ - + - + @@ -21,10 +21,10 @@ - + - + @@ -42,7 +42,7 @@ - + \ No newline at end of file diff --git a/Site/App_GlobalResources/Pages.Governance.designer.cs b/Site/App_GlobalResources/Pages.Governance.designer.cs index 1bd483f2..666e5e08 100644 --- a/Site/App_GlobalResources/Pages.Governance.designer.cs +++ b/Site/App_GlobalResources/Pages.Governance.designer.cs @@ -19,7 +19,7 @@ namespace Resources.Pages { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option or rebuild the Visual Studio project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Governance { diff --git a/Site/App_GlobalResources/Pages.Swarm.designer.cs b/Site/App_GlobalResources/Pages.Swarm.designer.cs index d6be86ae..7712f43d 100644 --- a/Site/App_GlobalResources/Pages.Swarm.designer.cs +++ b/Site/App_GlobalResources/Pages.Swarm.designer.cs @@ -19,7 +19,7 @@ namespace Resources.Pages { // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option or rebuild the Visual Studio project. - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Web.Application.StronglyTypedResourceProxyBuilder", "14.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Swarm { diff --git a/Site/Controls/v5/Base/MainMenu.ascx.cs b/Site/Controls/v5/Base/MainMenu.ascx.cs index d2a03fb0..3765d39c 100644 --- a/Site/Controls/v5/Base/MainMenu.ascx.cs +++ b/Site/Controls/v5/Base/MainMenu.ascx.cs @@ -43,6 +43,10 @@ namespace Swarmops.Controls.Base { mainMenuFile = "~/MainMenu-v5-OpenLedgers.xml"; } + else if (CurrentUser.Identity == Person.UnnamedAccountantIdentity) + { + mainMenuFile = "~/MainMenu-v5-Accountant.xml"; + } using (TextReader reader = new StreamReader (Server.MapPath (mainMenuFile))) { diff --git a/Site/Default.aspx.cs b/Site/Default.aspx.cs index 57e7d727..259f9c54 100644 --- a/Site/Default.aspx.cs +++ b/Site/Default.aspx.cs @@ -35,6 +35,13 @@ namespace Swarmops.Frontend { Response.Redirect ("/Ledgers/Balance"); } + + // If Accountant, redirect to Accountant View + + if (CurrentUser.Identity == Person.UnnamedAccountantIdentity) + { + Response.Redirect("/Ledgers/Accountant"); + } } internal void InitializePositionPanel() diff --git a/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs b/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs index a1e26417..a18f258f 100644 --- a/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs +++ b/Site/Pages/v5/Ledgers/EndOfMonth.aspx.cs @@ -211,19 +211,29 @@ namespace Swarmops.Frontend.Pages.Ledgers // Group: Closure of Ledgers and Annual Reports int lastClosedYear = CurrentOrganization.Parameters.FiscalBooksClosedUntilYear; - if (lastClosedYear - 1 < DateTime.UtcNow.Year) + int currentYear = DateTime.UtcNow.Year; + string dependsOn = string.Empty; + + if (lastClosedYear - 1 < currentYear) { EomItemGroup groupReports = new EomItemGroup(); - groupReports.Header = Resources.Pages.Ledgers.EndOfMonth_Header_AnnualReports; - EomItem itemCloseYear = new EomItem(); - itemCloseYear.Id = "CloseLedgers"; - itemCloseYear.Callback = "CloseLedgers"; - itemCloseYear.Icon = "document"; - itemCloseYear.Name = String.Format(Resources.Pages.Ledgers.EndOfMonth_CloseLedgersFor, - lastClosedYear + 1); - groupReports.Items.Add(itemCloseYear); + while (lastClosedYear - 1 < currentYear) + { + lastClosedYear++; // we're using this as iterator, the year doesn't actually close on this command + + EomItem itemCloseYear = new EomItem(); + itemCloseYear.DependsOn = dependsOn; + itemCloseYear.Id = "CloseLedgers-" + (lastClosedYear).ToString(CultureInfo.InvariantCulture); + itemCloseYear.Callback = "PrepareCloseLedgers"; + itemCloseYear.Icon = "document"; + itemCloseYear.Name = String.Format(Resources.Pages.Ledgers.EndOfMonth_CloseLedgersFor, + lastClosedYear); + + groupReports.Items.Add(itemCloseYear); + dependsOn = itemCloseYear.Id; // Makes next year's close depend on this one being done + } ItemGroups.Add(groupReports); } } @@ -351,6 +361,32 @@ namespace Swarmops.Frontend.Pages.Ledgers } } + [WebMethod] + public static AjaxCallResult PrepareCloseLedgers(string itemId) + { + AuthenticationData authData = GetAuthenticationDataAndCulture(); + if (!authData.Authority.HasAccess(new Access(authData.CurrentOrganization, AccessAspect.BookkeepingDetails))) + { + throw new UnauthorizedAccessException(); + } + + int year = Int32.Parse(itemId.Substring("CloseLedgers-".Length)); + int ledgersClosedUntil = authData.CurrentOrganization.Parameters.FiscalBooksClosedUntilYear; + + if (year != ledgersClosedUntil + 1) + { + throw new InvalidOperationException("Can't close this year"); + } + + throw new NotImplementedException(); + } + + [WebMethod] + public static AjaxCallResult ActuallyCloseLedgers(string itemId) + { + throw new NotImplementedException(); + } + [WebMethod] public static AjaxCallResult CreateVatReport(string itemId) { diff --git a/Site/Security/Login.aspx.cs b/Site/Security/Login.aspx.cs index 3b08094c..d51d26ea 100644 --- a/Site/Security/Login.aspx.cs +++ b/Site/Security/Login.aspx.cs @@ -18,6 +18,7 @@ using Swarmops.Logic.Security; using Swarmops.Logic.Structure; using Swarmops.Logic.Support; using Swarmops.Logic.Swarm; +using WebSocketSharp; namespace Swarmops.Pages.Security { @@ -103,6 +104,32 @@ namespace Swarmops.Pages.Security } } + // If this is an Accountant Inspection link, autologin as Accountant + + string accountantInspection = Request.QueryString["Accountant"]; + if (!accountantInspection.IsNullOrEmpty()) + { + /* + * + * TODO TODO TODO + * + + DashboardMessage.Set(String.Format(Resources.Pages.Security.Login_AsUnnamedAccountant, organizationOpenLedgers.Name)); + FormsAuthentication.SetAuthCookie(Authority.FromLogin(Person.FromIdentity(Person.OpenLedgersIdentity), organizationOpenLedgers).ToEncryptedXml(), true); + if (HttpContext.Current.Request["ReturnUrl"] == "/") + { + Response.Redirect(@"/Ledgers/Balance"); + } + else + { + Response.Redirect(HttpContext.Current.Request["ReturnUrl"]); // Returns to the requested URL with auth cookie set + } + + + */ + } + + // Check for SSL and force it // Special case for CloudFlare deployments - there is a case where somebody will get their connections de-SSLed at the server diff --git a/Site/Site.csproj b/Site/Site.csproj index 10d33d14..3f815842 100644 --- a/Site/Site.csproj +++ b/Site/Site.csproj @@ -1,5 +1,5 @@  - + Debug @@ -13,7 +13,7 @@ Properties Swarmops.Frontend Swarmops.Frontend - v4.5 + v4.6.1 true @@ -22,6 +22,7 @@ ..\ true + true @@ -72,31 +73,24 @@ True + - - ..\..\..\..\Windows\Microsoft.NET\Framework64\v4.0.30319\System.Runtime.dll - - - ..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll - True - - - + - + ..\packages\WebSocketSharp.1.0.3-rc11\lib\websocket-sharp.dll True diff --git a/Site/packages.config b/Site/packages.config index 7fa3e00b..d5167073 100644 --- a/Site/packages.config +++ b/Site/packages.config @@ -4,11 +4,11 @@ - + - + @@ -16,10 +16,10 @@ - + - + @@ -37,7 +37,7 @@ - + \ No newline at end of file diff --git a/Site/web.config b/Site/web.config index b0d6a8e6..9cef4d95 100644 --- a/Site/web.config +++ b/Site/web.config @@ -1,4 +1,4 @@ - + - - + + - - - + + + - - + + - + - + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + - + - - - - + + + + - + - + - + - - + + - - - - + + + + - + - + diff --git a/Tests/Tests.csproj b/Tests/Tests.csproj index a1fe3d4f..06b929f9 100644 --- a/Tests/Tests.csproj +++ b/Tests/Tests.csproj @@ -9,10 +9,11 @@ Properties Swarmops.Tests Tests - v4.5 + v4.6.1 512 ..\ true + true diff --git a/Tests/app.config b/Tests/app.config index 51722df3..09bf17d4 100644 --- a/Tests/app.config +++ b/Tests/app.config @@ -1,15 +1,15 @@ - + - - + + - - + + - \ No newline at end of file + diff --git a/Utility/BotCode/App_LocalResources/EventProcessor.Designer.cs b/Utility/BotCode/App_LocalResources/EventProcessor.Designer.cs index ab183664..402a4f7f 100644 --- a/Utility/BotCode/App_LocalResources/EventProcessor.Designer.cs +++ b/Utility/BotCode/App_LocalResources/EventProcessor.Designer.cs @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.18444 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. diff --git a/Utility/Utility.csproj b/Utility/Utility.csproj index 515c1087..64988312 100644 --- a/Utility/Utility.csproj +++ b/Utility/Utility.csproj @@ -1,5 +1,5 @@  - + Local 9.0.30729 @@ -15,7 +15,7 @@ 3.5 - v4.5 + v4.6.1 ..\ true diff --git a/Utility/app.config b/Utility/app.config index 51722df3..09bf17d4 100644 --- a/Utility/app.config +++ b/Utility/app.config @@ -1,15 +1,15 @@ - + - - + + - - + + - \ No newline at end of file +