diff --git a/Logic/Communications/Payload/ParticipantMailPayload.cs b/Logic/Communications/Payload/ParticipantMailPayload.cs
index aa0c8ede..4448cd6e 100644
--- a/Logic/Communications/Payload/ParticipantMailPayload.cs
+++ b/Logic/Communications/Payload/ParticipantMailPayload.cs
@@ -32,15 +32,26 @@ namespace Swarmops.Logic.Communications.Payload
switch (mailType)
{
case ParticipantMailType.ParticipantAddedWelcome:
+ case ParticipantMailType.ParticipantAddedWelcome_NoExpiry:
Strings[MailPayloadString.ActingPerson] = actingPerson.Name;
Strings[MailPayloadString.MembershipExpiry] = participation.Expires.ToLongDateString();
Strings[MailPayloadString.OrganizationName] = participation.Organization.Name;
Strings[MailPayloadString.Regularship] =
Participant.Localized (participation.Organization.RegularLabel, TitleVariant.Ship);
+ Strings[MailPayloadString.ExternalUrl] = SystemSettings.ExternalUrl;
- BodyTemplate =
- Resources.Logic_Communications_Transmission_DefaultCommTemplates
- .ParticipantManualAddWelcome_Body;
+ if (mailType == ParticipantMailType.ParticipantAddedWelcome)
+ {
+ BodyTemplate =
+ Resources.Logic_Communications_Transmission_DefaultCommTemplates
+ .ParticipantManualAddWelcome_Body;
+ }
+ else
+ {
+ BodyTemplate =
+ Resources.Logic_Communications_Transmission_DefaultCommTemplates
+ .ParticipantManualAddWelcome_NoExpiry_Body;
+ }
SubjectTemplate =
Resources.Logic_Communications_Transmission_DefaultCommTemplates
@@ -136,7 +147,8 @@ namespace Swarmops.Logic.Communications.Payload
public enum ParticipantMailType
{
Unknown = 0,
- ParticipantAddedWelcome
+ ParticipantAddedWelcome,
+ ParticipantAddedWelcome_NoExpiry
}
[Serializable]
@@ -148,7 +160,8 @@ namespace Swarmops.Logic.Communications.Payload
MembershipExpiry,
Regularship,
ActingPerson,
- OrganizationName
+ OrganizationName,
+ ExternalUrl
}
}
diff --git a/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.Designer.cs b/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.Designer.cs
index b799a38a..90764197 100644
--- a/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.Designer.cs
+++ b/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.Designer.cs
@@ -103,15 +103,6 @@ namespace Swarmops.Logic.Resources {
}
}
- ///
- /// Looks up a localized string similar to [[OrganizationName]] Welcome to [OrganizationName]!.
- ///
- internal static string ParticipantManualAddWelcome_Subject {
- get {
- return ResourceManager.GetString("ParticipantManualAddWelcome_Subject", resourceCulture);
- }
- }
-
///
/// Looks up a localized string similar to Welcome to [OrganizationName]!
///
@@ -124,18 +115,27 @@ namespace Swarmops.Logic.Resources {
///
///You should log on and c [rest of string was truncated]";.
///
- internal static string ParticipantManualAddWelcomeNoExpiry_Body {
+ internal static string ParticipantManualAddWelcome_NoExpiry_Body {
get {
- return ResourceManager.GetString("ParticipantManualAddWelcomeNoExpiry_Body", resourceCulture);
+ return ResourceManager.GetString("ParticipantManualAddWelcome_NoExpiry_Body", resourceCulture);
}
}
///
/// Looks up a localized string similar to [[OrganizationName]] Welcome to [OrganizationName]!.
///
- internal static string ParticipantManualAddWelcomeNoExpiry_Subject {
+ internal static string ParticipantManualAddWelcome_NoExpiry_Subject {
get {
- return ResourceManager.GetString("ParticipantManualAddWelcomeNoExpiry_Subject", resourceCulture);
+ return ResourceManager.GetString("ParticipantManualAddWelcome_NoExpiry_Subject", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to [[OrganizationName]] Welcome to [OrganizationName]!.
+ ///
+ internal static string ParticipantManualAddWelcome_Subject {
+ get {
+ return ResourceManager.GetString("ParticipantManualAddWelcome_Subject", resourceCulture);
}
}
}
diff --git a/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.resx b/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.resx
index c85dcbad..c5ccf9b3 100644
--- a/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.resx
+++ b/Logic/Resources/Logic.Communications.Transmission.DefaultCommTemplates.resx
@@ -132,23 +132,6 @@ Welcome as [Aspirant] and we hope to see you as a [Regular] soon!
[[OrganizationName]] Welcome as [Aspirant] to [OrganizationName]!
-
- Welcome to [OrganizationName]!
-
-You have been granted a [Regularship] by [ActingPerson]. It does not expire automatically by any particular time or date, so there's no rush to take action.
-
-You should already have been contacted by people from [OrganizationName] for more information on how to get active. If not, then expect correspondence soon.
-
-Your initial and randomly generated password to Swarmops, the software used as a back-end system, is as follows:
-[RandomPassword]
-
-You should log on and change this password to something more secure of your own choosing as soon as possible. You do so by logging on at [ExternalUrl] , and then clicking the "User" icon in the top right corner, selecting the Security tab (the one with the padlock), entering this temporary password, and then writing your new one. You should also consider enabling two-factor authentication, just as a good practice.
-
-Welcome aboard!
-
-
- [[OrganizationName]] Welcome to [OrganizationName]!
-
Welcome to [OrganizationName]!
@@ -163,6 +146,23 @@ You should log on and change this password to something more secure of your own
Welcome aboard!
+
+ Welcome to [OrganizationName]!
+
+You have been granted a [Regularship] by [ActingPerson]. It does not expire automatically by any particular time or date, so there's no rush to take action.
+
+You should already have been contacted by people from [OrganizationName] for more information on how to get active. If not, then expect correspondence soon.
+
+Your initial and randomly generated password to Swarmops, the software used as a back-end system, is as follows:
+[RandomPassword]
+
+You should log on and change this password to something more secure of your own choosing as soon as possible. You do so by logging on at [ExternalUrl] , and then clicking the "User" icon in the top right corner, selecting the Security tab (the one with the padlock), entering this temporary password, and then writing your new one. You should also consider enabling two-factor authentication, just as a good practice.
+
+Welcome aboard!
+
+
+ [[OrganizationName]] Welcome to [OrganizationName]!
+
[[OrganizationName]] Welcome to [OrganizationName]!
diff --git a/Logic/Resources/Logic.Swarm.Position.Designer.cs b/Logic/Resources/Logic.Swarm.Position.Designer.cs
index 7457d389..972ec009 100644
--- a/Logic/Resources/Logic.Swarm.Position.Designer.cs
+++ b/Logic/Resources/Logic.Swarm.Position.Designer.cs
@@ -303,6 +303,24 @@ namespace Swarmops.Logic.Resources {
}
}
+ ///
+ /// Looks up a localized string similar to First Gentleman.
+ ///
+ internal static string Position_Executive_FirstGentleman {
+ get {
+ return ResourceManager.GetString("Position_Executive_FirstGentleman", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to First Lady.
+ ///
+ internal static string Position_Executive_FirstLady {
+ get {
+ return ResourceManager.GetString("Position_Executive_FirstLady", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Human Resources Assistant.
///
diff --git a/Logic/Resources/Logic.Swarm.Position.resx b/Logic/Resources/Logic.Swarm.Position.resx
index f4968242..1eacdd54 100644
--- a/Logic/Resources/Logic.Swarm.Position.resx
+++ b/Logic/Resources/Logic.Swarm.Position.resx
@@ -198,6 +198,14 @@
Chief Technology Officer
+
+ First Gentleman
+ For government-type organizations only, with a female President
+
+
+ First Lady
+ For government-type organizations only
+
Human Resources Assistant
diff --git a/Logic/Structure/OrganizationParameters.cs b/Logic/Structure/OrganizationParameters.cs
index 1a194dbf..cd8ee309 100644
--- a/Logic/Structure/OrganizationParameters.cs
+++ b/Logic/Structure/OrganizationParameters.cs
@@ -1,3 +1,4 @@
+using System;
using Swarmops.Common.Enums;
using Swarmops.Logic.Support;
@@ -149,7 +150,7 @@ namespace Swarmops.Logic.Structure
public string ParticipationDuration
{
- get { return this.data.GetOptionalDataString(ObjectOptionalDataType.OrgParticipationDuration); }
+ get { return CustomOrDefault(this.data.GetOptionalDataString(ObjectOptionalDataType.OrgParticipationDuration), "12"); }
set { this.data.SetOptionalDataString(ObjectOptionalDataType.OrgParticipationDuration, value); }
}
public string ParticipationAcceptedMail
@@ -182,5 +183,18 @@ namespace Swarmops.Logic.Structure
get { return this.data.GetOptionalDataInt(ObjectOptionalDataType.OrgApplicationQualifyingScore); }
set { this.data.SetOptionalDataInt(ObjectOptionalDataType.OrgApplicationQualifyingScore, value); }
}
+
+
+ private string CustomOrDefault(string customString, string defaultString)
+ {
+ if (String.IsNullOrEmpty(customString.Trim()))
+ {
+ return defaultString;
+ }
+
+ return customString; // not trimmed, on purpose
+ }
+
+
}
}
\ No newline at end of file
diff --git a/Site/App_GlobalResources/Global.designer.cs b/Site/App_GlobalResources/Global.designer.cs
index 45b77d2b..26319e24 100644
--- a/Site/App_GlobalResources/Global.designer.cs
+++ b/Site/App_GlobalResources/Global.designer.cs
@@ -1059,6 +1059,15 @@ namespace Resources {
}
}
+ ///
+ /// Looks up a localized string similar to You are entering the <strong>Sandbox</strong> organization.<br/><br/>This is a safe environment where you can play around with Swarmops without risking any damage to production data. Have fun all you want, and return to your production environment when you're done experimenting..
+ ///
+ internal static string Global_EnteringSandbox {
+ get {
+ return ResourceManager.GetString("Global_EnteringSandbox", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Unable to connect WebSocket. Live updates will not be available..
///
diff --git a/Site/App_GlobalResources/Global.resx b/Site/App_GlobalResources/Global.resx
index 134e4753..2fa56cac 100644
--- a/Site/App_GlobalResources/Global.resx
+++ b/Site/App_GlobalResources/Global.resx
@@ -985,4 +985,7 @@
General Ledger
+
+ You are entering the <strong>Sandbox</strong> organization.<br/><br/>This is a safe environment where you can play around with Swarmops without risking any damage to production data. Have fun all you want, and return to your production environment when you're done experimenting.
+
\ No newline at end of file
diff --git a/Site/Automation/FinancialFunctions.aspx.cs b/Site/Automation/FinancialFunctions.aspx.cs
index 47f9394e..6b6d654a 100644
--- a/Site/Automation/FinancialFunctions.aspx.cs
+++ b/Site/Automation/FinancialFunctions.aspx.cs
@@ -34,6 +34,13 @@ namespace Swarmops.Frontend.Automation
bitcoinAddress = bitcoinAddress.Replace (" ", string.Empty);
+ // Remove a possible start of "bitcoincash:"
+
+ if (bitcoinAddress.StartsWith("bitcoincash:"))
+ {
+ bitcoinAddress = bitcoinAddress.Substring("bitcoincash:".Length);
+ }
+
if (string.IsNullOrEmpty (authData.CurrentUser.BitcoinPayoutAddress))
{
if (!BitcoinUtility.IsValidBitcoinAddress (bitcoinAddress))
diff --git a/Site/Pages/v5/Public/Initialize.aspx.cs b/Site/Pages/v5/Public/Initialize.aspx.cs
index 18d777a1..03e98c4e 100644
--- a/Site/Pages/v5/Public/Initialize.aspx.cs
+++ b/Site/Pages/v5/Public/Initialize.aspx.cs
@@ -782,7 +782,7 @@ namespace Swarmops.Frontend.Pages.v5.Public
string.Empty, string.Empty, new DateTime(1972,1,21), PersonGender.Unknown);
// Add membership in Sandbox
- newPerson.AddParticipation(Organization.Sandbox, DateTime.UtcNow.AddYears(25));
+ newPerson.AddParticipation(Organization.Sandbox, Constants.DateTimeHigh); // expires never
// Initialize staffing to System and Sandbox with the new user
Positions.CreateSysadminPositions();
diff --git a/Site/Pages/v5/Security/SetCurrentOrganization.aspx.cs b/Site/Pages/v5/Security/SetCurrentOrganization.aspx.cs
index e389cef8..c34e2473 100644
--- a/Site/Pages/v5/Security/SetCurrentOrganization.aspx.cs
+++ b/Site/Pages/v5/Security/SetCurrentOrganization.aspx.cs
@@ -2,8 +2,10 @@
using System.Globalization;
using System.Web;
using System.Web.Security;
+using Swarmops.Common;
using Swarmops.Logic.Security;
using Swarmops.Logic.Structure;
+using Swarmops.Logic.Swarm;
namespace Swarmops.Frontend.Pages.v5.Security
{
@@ -31,7 +33,14 @@ namespace Swarmops.Frontend.Pages.v5.Security
suggestedOrganization = null;
}
- if (suggestedOrganization == null || !CurrentUser.ParticipatesInOrganization (suggestedOrganization))
+ if (suggestedOrganization.Identity == Organization.SandboxIdentity &&
+ !CurrentUser.ParticipatesInOrganization(suggestedOrganization))
+ {
+ // Add a forever participation in Sandbox
+
+ Participation.Create(CurrentUser, Organization.Sandbox, Constants.DateTimeHigh);
+ }
+ else if (suggestedOrganization == null || !CurrentUser.ParticipatesInOrganization (suggestedOrganization))
{
// Some work here on PPSE pilot - we want everybody to be able to switch to Sandbox, which is #1
// except for in PPSE installation, where it is... #3 or something
@@ -51,6 +60,10 @@ namespace Swarmops.Frontend.Pages.v5.Security
newAuthority.SetOrganization (suggestedOrganization); // will/can also modify Position
CurrentUser.LastLogonOrganizationId = suggestedOrganization.Identity;
+ // Set a dashboard message that the user is now working in Sandbox
+
+ Response.SetCookie(new HttpCookie("DashboardMessage", Resources.Global.Global_EnteringSandbox);
+
if (!string.IsNullOrEmpty (returnUrlString))
{
FormsAuthentication.SetAuthCookie (newAuthority.ToEncryptedXml(), true);
diff --git a/Site/Pages/v5/Swarm/AddPerson.aspx.cs b/Site/Pages/v5/Swarm/AddPerson.aspx.cs
index 168f6a01..1629ebc5 100644
--- a/Site/Pages/v5/Swarm/AddPerson.aspx.cs
+++ b/Site/Pages/v5/Swarm/AddPerson.aspx.cs
@@ -4,6 +4,7 @@ using System.Runtime.Versioning;
using System.Web.UI;
using System.Web.UI.WebControls;
using Resources;
+using Swarmops.Common;
using Swarmops.Common.Enums;
using Swarmops.Logic.Communications;
using Swarmops.Logic.Communications.Payload;
@@ -108,9 +109,19 @@ namespace Swarmops.Frontend.Pages.v5.Swarm
street, this.TextPostal.Text, this.TextCity.Text, this.DropCountries.SelectedValue, dateOfBirth,
(PersonGender)Enum.Parse(typeof(PersonGender), this.DropGenders.SelectedValue));
- Participation newParticipation = Participation.Create (newPerson, CurrentOrganization, DateTime.Today.AddYears (1));
+ DateTime participationExpiry = Constants.DateTimeHigh;
+ ParticipantMailType welcomeMailType = ParticipantMailType.ParticipantAddedWelcome_NoExpiry;
- OutboundComm.CreateParticipantMail (ParticipantMailType.ParticipantAddedWelcome, newParticipation, CurrentUser);
+ int participationDurationMonths = Int32.Parse(CurrentOrganization.Parameters.ParticipationDuration);
+ if (participationDurationMonths < 1000)
+ {
+ participationExpiry = DateTime.Today.AddMonths(participationDurationMonths);
+ welcomeMailType = ParticipantMailType.ParticipantAddedWelcome;
+ }
+
+ Participation newParticipation = Participation.Create (newPerson, CurrentOrganization, participationExpiry);
+
+ OutboundComm.CreateParticipantMail (welcomeMailType, newParticipation, CurrentUser);
newPerson.LastLogonOrganizationId = CurrentOrganization.Identity;
diff --git a/Site/Pages/v5/Swarm/Json-ListFindPeople.aspx.cs b/Site/Pages/v5/Swarm/Json-ListFindPeople.aspx.cs
index b3f9b0eb..74d6cdba 100644
--- a/Site/Pages/v5/Swarm/Json-ListFindPeople.aspx.cs
+++ b/Site/Pages/v5/Swarm/Json-ListFindPeople.aspx.cs
@@ -75,7 +75,7 @@ namespace Swarmops.Frontend.Pages.Swarm
person.Identity,
JsonSanitize (person.Canonical),
person.GetSecureAvatarLink (16),
- JsonSanitize (person.Geography.Name),
+ JsonSanitize (person.Geography.Localized),
JsonSanitize (person.Mail),
JsonSanitize (person.Phone),
JsonSanitize(notes)) + "," +