More work on org switch - testing on Dev

This commit is contained in:
Rick Falkvinge
2012-11-27 02:17:04 +00:00
parent 769dffb006
commit de69e34230
2 changed files with 17 additions and 11 deletions
+14 -10
View File
@@ -257,16 +257,6 @@
</div>
<!-- Organization changer -->
<div id="DivModalOrganizationChanger" style="display:none">
You are currently logged into <strong>Sandbox</strong>. Would you like to switch to another organization?<br/><br/>
<asp:DropDownList ID="DropSwitchOrganizations" runat="server"/><br/><br/> <!-- TODO: Make this a tree dropdown -->
<asp:Button runat="server" ID="ButtonSwitchOrganizations" Text="Switch" CssClass="buttonAccentColor" OnClick="ButtonSwitchOrganizations_Click"/>
</div>
<!-- language selector popup -->
<telerik:RadToolTip ID="ToolTip" runat="server" AnimationDuration="150" AutoCloseDelay="200000" ShowDelay="0"
@@ -275,8 +265,22 @@
Skin="Telerik" >
<act5:LanguageSelector ID="LanguageSelector" runat="server" />
</telerik:RadToolTip>
<!-- Organization changer -->
<div id="DivModalOrganizationChanger" style="display:none">
You are currently logged into <strong>Sandbox</strong>. Would you like to switch to another organization?<br/><br/>
<asp:DropDownList ID="DropSwitchOrganizations" runat="server"/><br/><br/> <!-- TODO: Make this a tree dropdown -->
<!-- this is displayed out-of-form, so we must trigger an in-form button -->
<asp:Button runat="server" ID="ButtonSwitchOrganizations" Text="Switch" CssClass="buttonAccentColor"/>
</div>
<div style="display:none"><asp:TextBox runat="server" ID="TextSwitchToOrganizationId" /><asp:Button runat="server" ID="ButtonActuatorSwitchOrganizations" OnClick="ButtonSwitchOrganizations_Click"/></div>
</form>
</body>
</html>
+3 -1
View File
@@ -86,6 +86,8 @@ namespace Activizr
this.ImageCultureIndicator.Style[HtmlTextWriterStyle.Cursor] = "pointer";
SetupDropboxes();
this.ButtonSwitchOrganizations.Attributes.Add("onclick", "alert ('Foo!'); $('" + this.TextSwitchToOrganizationId.ClientID + "').val($('" + this.DropSwitchOrganizations.ClientID + "').val()); $('" + this.ButtonActuatorSwitchOrganizations.ClientID + "').click();");
}
private void SetupDropboxes()
@@ -373,7 +375,7 @@ namespace Activizr
protected void ButtonSwitchOrganizations_Click(object sender, EventArgs e)
{
int currentUserId = _viewingPerson.Identity;
int desiredOrganizationId = Int32.Parse(this.DropSwitchOrganizations.SelectedValue);
int desiredOrganizationId = Int32.Parse(this.TextSwitchToOrganizationId.Text);
if (desiredOrganizationId != 0)
{