diff --git a/Site5/App_Code/MasterV5Base.cs b/Site5/App_Code/MasterV5Base.cs index 076b3653..8b612115 100644 --- a/Site5/App_Code/MasterV5Base.cs +++ b/Site5/App_Code/MasterV5Base.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; using System.Web; +using Activizr.Logic.Pirates; +using Activizr.Logic.Security; +using Activizr.Logic.Structure; /// /// Summary description for MasterV4Base @@ -15,6 +18,12 @@ public class MasterV5Base : System.Web.UI.MasterPage public string CurrentPageTitle = string.Empty; public string CurrentPageIcon = string.Empty; + public string CurrentPageInfoBoxLiteral = string.Empty; + + protected Person _currentUser = null; // These are set in Master-v5.master.cs + protected Authority _authority = null; + protected Organization _currentOrganization = null; + public DateTime PermissionCacheTimestamp { get @@ -32,6 +41,22 @@ public class MasterV5Base : System.Web.UI.MasterPage Session["MainMenu-v5_Enabling_TimeStamp"] = value.Ticks; } } + + public Person CurrentUser + { + get { return this._currentUser; } + } + + public Organization CurrentOrganization + { + get { return this._currentOrganization; } + } + + public Authority CurrentAuthority + { + get { return this._authority; } + } + } diff --git a/Site5/App_Code/PageV5Base.cs b/Site5/App_Code/PageV5Base.cs index 23dfaf68..0d4318dd 100644 --- a/Site5/App_Code/PageV5Base.cs +++ b/Site5/App_Code/PageV5Base.cs @@ -19,10 +19,6 @@ public class PageV5Base : System.Web.UI.Page public PermissionSet pagePermissionDefault = new PermissionSet(Permission.CanSeeSelf); //Use from menu; public Access PageAccessRequired = null; // v5 mechanism - public Person _currentUser = null; - public Authority _authority = null; - public Organization _currentOrganization = null; - /// An that contains the event data. protected override void OnInitComplete(System.EventArgs e) { @@ -39,9 +35,6 @@ public class PageV5Base : System.Web.UI.Page currentUserId = Convert.ToInt32(userIdentityString); currentOrganizationId = Convert.ToInt32(organizationIdentityString); - _currentUser = Person.FromIdentity(currentUserId); - _currentOrganization = Organization.FromIdentity(currentOrganizationId); - _authority = _currentUser.GetAuthority(); } protected new MasterV5Base Master @@ -59,6 +52,27 @@ public class PageV5Base : System.Web.UI.Page set { this.Master.CurrentPageIcon = value; } } + protected string InfoBoxLiteral + { + get { return this.Master.CurrentPageInfoBoxLiteral; } + set { this.Master.CurrentPageInfoBoxLiteral = value; } + } + + protected Person CurrentUser + { + get { return this.Master.CurrentUser; } + } + + protected Organization CurrentOrganization + { + get { return this.Master.CurrentOrganization; } + } + + protected Authority CurrentAuthority + { + get { return this.Master.CurrentAuthority; } + } + protected override void OnPreInit(EventArgs e) { // Unlock Telerik @@ -121,7 +135,7 @@ public class PageV5Base : System.Web.UI.Page { // Check security of page against users's credentials - if (!_currentUser.HasAccess (this.PageAccessRequired)) + if (!CurrentUser.HasAccess (this.PageAccessRequired)) { Response.Redirect("/Pages/v5/Security/AccessDenied.aspx"); } diff --git a/Site5/App_GlobalResources/Pages.Finance.resx b/Site5/App_GlobalResources/Pages.Finance.resx index d733cc56..09450fa1 100644 --- a/Site5/App_GlobalResources/Pages.Finance.resx +++ b/Site5/App_GlobalResources/Pages.Finance.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - If you are about to make a purchase on behalf of the organization, but need the money in advance rather than claiming them back afterwards, you can request a cash advance for a specific purpose here. + If you are about to make a purchase on behalf of the organization, but need the money in advance rather than claiming them back afterwards, you can request a cash advance for a specific purpose. Request Cash Advance diff --git a/Site5/Default.aspx b/Site5/Default.aspx index 86b6b44f..84b4c41f 100644 --- a/Site5/Default.aspx +++ b/Site5/Default.aspx @@ -10,36 +10,5 @@ -

- -
-
- -
-
- -

- -
-
- - -
-
- -

- -
-
- -
-
-
diff --git a/Site5/Default.aspx.cs b/Site5/Default.aspx.cs index 166ed2ec..7c03b482 100644 --- a/Site5/Default.aspx.cs +++ b/Site5/Default.aspx.cs @@ -16,17 +16,12 @@ public partial class Default : PageV5Base this.PageTitle = Resources.Global.Dashboard_PageTitle; this.PageIcon = "iconshock-steering-wheel"; + /* this.LabelActionListMotions.Text = Resources.Pages.Governance.ListMotions_PageTitle; - this.LabelActionVote.Text = Resources.Pages.Governance.Vote_PageTitle; + this.LabelActionVote.Text = Resources.Pages.Governance.Vote_PageTitle;*/ - this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; - this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; - this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; - - this.LabelActionItemsHere.Text = Resources.Global.Sidebar_Todo_Placeholder; - this.LabelGoThere.Text = Resources.Global.Global_GoThere; this.LabelDashboardTemporaryContent.Text = Resources.Global.Dashboard_Main_Temporary; - this.LabelDashboardInfo.Text = Resources.Global.Dashboard_Info_Temporary; + this.InfoBoxLiteral = Resources.Global.Dashboard_Info_Temporary; this.LabelGoThere2.Text = Resources.Global.Global_GoThere; } } diff --git a/Site5/Master-v5.master b/Site5/Master-v5.master index a96a813f..f416cbe7 100644 --- a/Site5/Master-v5.master +++ b/Site5/Master-v5.master @@ -106,7 +106,7 @@
|
-
| 
+
| 
|
| 
@@ -251,8 +251,43 @@
+ + + diff --git a/Site5/Master-v5.master.cs b/Site5/Master-v5.master.cs index 112de9e9..9bdb338c 100644 --- a/Site5/Master-v5.master.cs +++ b/Site5/Master-v5.master.cs @@ -22,12 +22,30 @@ namespace Activizr this.LanguageSelector.LanguageChanged += new EventHandler(LanguageSelector_LanguageChanged); - // Titles etc + // Security stuff + // Current authentication + + string identity = HttpContext.Current.User.Identity.Name; + string[] identityTokens = identity.Split(','); + + string userIdentityString = identityTokens[0]; + string organizationIdentityString = identityTokens[1]; + + int currentUserId = Convert.ToInt32(userIdentityString); + int currentOrganizationId = Convert.ToInt32(organizationIdentityString); + + _currentUser = Person.FromIdentity(currentUserId); + _authority = _currentUser.GetAuthority(); + _currentOrganization = Organization.FromIdentity(currentOrganizationId); + + // Titles and other page elements this.IconPage.ImageUrl = "/Images/PageIcons/" + this.CurrentPageIcon + "-40px.png"; this.LabelPageTitle.Text = this.CurrentPageTitle; this.Page.Title = "Activizr - " + this.CurrentPageTitle; + this.LiteralSidebarInfo.Text = this.CurrentPageInfoBoxLiteral; + // Check for SSL and force it if (!Request.IsSecureConnection) @@ -40,25 +58,12 @@ namespace Activizr Localize(); - // Current authentication + this.LabelCurrentUserName.Text = _currentUser.Name; + this.LabelCurrentOrganizationName.Text = _currentOrganization.Name; - string identity = HttpContext.Current.User.Identity.Name; - string[] identityTokens = identity.Split(','); - - string userIdentityString = identityTokens[0]; - string organizationIdentityString = identityTokens[1]; - - int currentUserId = Convert.ToInt32(userIdentityString); - int currentOrganizationId = Convert.ToInt32(organizationIdentityString); - - this.LabelCurrentUserName.Text = Person.FromIdentity(currentUserId).Name; - this.LabelCurrentOrganizationName.Text = Organization.FromIdentity(currentOrganizationId).Name; - - // Security stuff - - _viewingPerson = Person.FromIdentity(currentUserId); - _authority = _viewingPerson.GetAuthority(); - _organization = Organization.FromIdentity(currentOrganizationId); + this.LabelActionPlaceholder1.Text = "Action shortcut 1 (TODO)"; + this.LabelActionPlaceholder2.Text = "Action shortcut 2 (TODO)"; + this.LabelActionItemsHere.Text = "Action items here (TODO)"; RadMenu mainMenu = FindControl("MainMenu") as RadMenu; @@ -104,14 +109,14 @@ namespace Activizr } } - private Person _viewingPerson; - private Organization _organization; - private Authority _authority; private static string _buildIdentity; - private void Localize() { + this.LabelSidebarInfo.Text = Resources.Global.Sidebar_Information; + this.LabelSidebarActions.Text = Resources.Global.Sidebar_Actions; + this.LabelSidebarTodo.Text = Resources.Global.Sidebar_Todo; + string cultureString = Thread.CurrentThread.CurrentCulture.ToString(); string cultureStringLower = cultureString.ToLowerInvariant(); @@ -187,9 +192,9 @@ namespace Activizr break; case "CloseLedgers": int year = DateTime.Today.Year; - int booksClosedUntil = _organization.Parameters.FiscalBooksClosedUntilYear; + int booksClosedUntil = _currentOrganization.Parameters.FiscalBooksClosedUntilYear; - if (_organization.Parameters.EconomyEnabled && booksClosedUntil < year - 1) + if (_currentOrganization.Parameters.EconomyEnabled && booksClosedUntil < year - 1) { item.Text = String.Format(Resources.Menu5.Menu5_Ledgers_CloseBooks, booksClosedUntil + 1); } @@ -341,7 +346,7 @@ namespace Activizr { // Received event from control - refire - _viewingPerson.PreferredCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; + _currentUser.PreferredCulture = System.Threading.Thread.CurrentThread.CurrentCulture.Name; this.LiteralCrowdinScript.Text = string.Empty; if (LanguageChanged != null) @@ -374,7 +379,7 @@ namespace Activizr protected void ButtonSwitchOrganizations_Click(object sender, EventArgs e) { - int currentUserId = _viewingPerson.Identity; + int currentUserId = _currentUser.Identity; int desiredOrganizationId = Int32.Parse(this.TextSwitchToOrganizationId.Text); if (desiredOrganizationId != 0) @@ -383,5 +388,6 @@ namespace Activizr Response.Redirect("/"); } } + } } \ No newline at end of file diff --git a/Site5/Pages/v5/Finance/RequestCashAdvance.aspx b/Site5/Pages/v5/Finance/RequestCashAdvance.aspx index 96fbdc34..bd411ab8 100644 --- a/Site5/Pages/v5/Finance/RequestCashAdvance.aspx +++ b/Site5/Pages/v5/Finance/RequestCashAdvance.aspx @@ -5,42 +5,27 @@ + +
+  
+  
+  
+ +
+
+ For example, 1000.
+ Describe briefly. For example, "Bus tickets to rally."
+ Where this money will come from.
+
+
- -

- -
-
- -
-
- -

- -
-
- - -
-
- -

- -
-
- -
-
-
diff --git a/Site5/Pages/v5/Finance/RequestCashAdvance.aspx.cs b/Site5/Pages/v5/Finance/RequestCashAdvance.aspx.cs index 15060b7c..c215e6c2 100644 --- a/Site5/Pages/v5/Finance/RequestCashAdvance.aspx.cs +++ b/Site5/Pages/v5/Finance/RequestCashAdvance.aspx.cs @@ -11,5 +11,6 @@ public partial class Pages_v5_Finance_RequestCashAdvance : PageV5Base { this.PageTitle = Resources.Pages.Finance.RequestCashAdvance_PageTitle; this.PageIcon = "iconshock-walletmoney"; + this.InfoBoxLiteral = Resources.Pages.Finance.RequestCashAdvance_Info; } } \ No newline at end of file diff --git a/Site5/Pages/v5/Governance/AddMotion.aspx b/Site5/Pages/v5/Governance/AddMotion.aspx index 77c58d65..ed7266de 100644 --- a/Site5/Pages/v5/Governance/AddMotion.aspx +++ b/Site5/Pages/v5/Governance/AddMotion.aspx @@ -12,13 +12,13 @@ -