fixes for hosted organization users list and mailbox list

This commit is contained in:
dev_amdtel 2015-02-11 11:36:11 +04:00
parent 7c0a92fae3
commit e2baedadf3
10 changed files with 167 additions and 313 deletions

View file

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="btnCreateMailbox.Text" xml:space="preserve"> <data name="btnCreateMailbox.Text" xml:space="preserve">
<value>Create New Mailbox</value> <value>New Mailbox</value>
</data> </data>
<data name="cmdDelete.OnClientClick" xml:space="preserve"> <data name="cmdDelete.OnClientClick" xml:space="preserve">
<value>if(!confirm('Are you sure you want to delete this mailbox?')) return false; else ShowProgressDialog('Deleting mailbox...');</value> <value>if(!confirm('Are you sure you want to delete this mailbox?')) return false; else ShowProgressDialog('Deleting mailbox...');</value>

View file

@ -30,22 +30,22 @@
<div class="FormButtonsBarClean"> <div class="FormButtonsBarClean">
<div class="FormButtonsBarCleanLeft"> <div class="FormButtonsBarCleanLeft">
<asp:Button ID="btnCreateMailbox" runat="server" meta:resourcekey="btnCreateMailbox" <asp:Button ID="btnCreateMailbox" runat="server" meta:resourcekey="btnCreateMailbox"
Text="Create New Mailbox" CssClass="Button1" OnClick="btnCreateMailbox_Click" /> Text="New Mailbox" CssClass="Button1" OnClick="btnCreateMailbox_Click" />
</div> </div>
<div class="FormButtonsBarCleanMiddle"> <div class="FormButtonsBarCleanMiddle">
<table> <table>
<tr> <tr>
<td> <td>
<wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" /> <wsp:UserActions ID="userActions" runat="server" OnExecutingUserAction="userActions_OnExecutingUserAction" ShowSetMailboxPlan="true" />
</td> </td>
<td class="FormButtonsBarCleanSeparatorSmall"></td> <td class="FormButtonsBarCleanSeparatorSmall"></td>
<td> <td>
<asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch"> <asp:Panel ID="SearchPanel" runat="server" DefaultButton="cmdSearch">
<asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" /> <asp:CheckBox ID="chkMailboxes" runat="server" meta:resourcekey="chkMailboxes" Text="Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
<asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" /> <asp:CheckBox ID="chkResourceMailboxes" runat="server" meta:resourcekey="chkResourceMailboxes" Text="Resource Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
<asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" /> <asp:CheckBox ID="chkSharedMailboxes" runat="server" meta:resourcekey="chkSharedMailboxes" Text="Shared Mailboxes" AutoPostBack="true" OnCheckedChanged="chkMailboxes_CheckedChanged" CssClass="Small" />
<asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True" <asp:DropDownList ID="ddlPageSize" runat="server" AutoPostBack="True"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged"> OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged" Width="50">
<asp:ListItem>10</asp:ListItem> <asp:ListItem>10</asp:ListItem>
<asp:ListItem Selected="True">20</asp:ListItem> <asp:ListItem Selected="True">20</asp:ListItem>
<asp:ListItem>50</asp:ListItem> <asp:ListItem>50</asp:ListItem>
@ -60,8 +60,9 @@
<asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem> <asp:ListItem Value="AccountName" meta:resourcekey="ddlSearchColumnAccountName">AccountName</asp:ListItem>
<asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem> <asp:ListItem Value="SubscriberNumber" meta:resourcekey="ddlSearchColumnSubscriberNumber">Account Number</asp:ListItem>
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem> <asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Login</asp:ListItem>
</asp:DropDownList><asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton ID="cmdSearch" runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" </asp:DropDownList>
CausesValidation="false" /> <asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox>
<asp:ImageButton ID="cmdSearch" runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton" CausesValidation="false" />
</asp:Panel> </asp:Panel>
</td> </td>
</tr> </tr>
@ -74,11 +75,6 @@
OnRowCommand="gvMailboxes_RowCommand" AllowPaging="True" AllowSorting="True" OnRowCommand="gvMailboxes_RowCommand" AllowPaging="True" AllowSorting="True"
DataSourceID="odsAccountsPaged" PageSize="20"> DataSourceID="odsAccountsPaged" PageSize="20">
<Columns> <Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox> <asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
@ -87,6 +83,11 @@
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox> <asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvMailboxesDisplayName" SortExpression="DisplayName"> <asp:TemplateField HeaderText="gvMailboxesDisplayName" SortExpression="DisplayName">
<ItemStyle Width="20%"></ItemStyle> <ItemStyle Width="20%"></ItemStyle>
<ItemTemplate> <ItemTemplate>

View file

@ -73,11 +73,11 @@ namespace WebsitePanel.Portal.ExchangeServer
{ {
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
{ {
gvMailboxes.Columns[4].Visible = false; gvMailboxes.Columns[6].Visible = false;
} }
} }
gvMailboxes.Columns[3].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); gvMailboxes.Columns[4].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
} }
private void BindServiceLevels() private void BindServiceLevels()

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.

View file

@ -73,11 +73,6 @@
OnRowCommand="gvUsers_RowCommand" AllowPaging="True" AllowSorting="True" OnRowCommand="gvUsers_RowCommand" AllowPaging="True" AllowSorting="True"
DataSourceID="odsAccountsPaged" PageSize="20"> DataSourceID="odsAccountsPaged" PageSize="20">
<Columns> <Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField> <asp:TemplateField>
<HeaderTemplate> <HeaderTemplate>
<asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox> <asp:CheckBox ID="selectAll" Runat="server" onclick="javascript:SelectAllCheckboxes(this);" CssClass="HeaderCheckbox"></asp:CheckBox>
@ -86,6 +81,11 @@
<asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox> <asp:CheckBox runat="server" ID="chkSelectedUsersIds"></asp:CheckBox>
</ItemTemplate> </ItemTemplate>
</asp:TemplateField> </asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<asp:Image ID="img2" runat="server" Width="16px" Height="16px" ImageUrl='<%# GetStateImage((bool)Eval("Locked"),(bool)Eval("Disabled")) %>' ImageAlign="AbsMiddle" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvUsersDisplayName" SortExpression="DisplayName"> <asp:TemplateField HeaderText="gvUsersDisplayName" SortExpression="DisplayName">
<ItemStyle Width="25%"></ItemStyle> <ItemStyle Width="25%"></ItemStyle>
<ItemTemplate> <ItemTemplate>

View file

@ -56,10 +56,10 @@ namespace WebsitePanel.Portal.HostedSolution
{ {
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1) if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
{ {
gvUsers.Columns[5].Visible = false; gvUsers.Columns[6].Visible = false;
} }
} }
gvUsers.Columns[3].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels); gvUsers.Columns[4].Visible = cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels);
} }
private void BindServiceLevels() private void BindServiceLevels()

View file

@ -117,16 +117,13 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="btnDisableCancel.Text" xml:space="preserve"> <data name="btnApply.Text" xml:space="preserve">
<value>Apply</value>
</data>
<data name="btnMailboxPlanCancel.Text" xml:space="preserve">
<value>Cancel</value> <value>Cancel</value>
</data> </data>
<data name="btnDisableOk.Text" xml:space="preserve"> <data name="btnMailboxPlanOk.Text" xml:space="preserve">
<value>Ok</value>
</data>
<data name="btnEnableCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnEnableOk.Text" xml:space="preserve">
<value>Ok</value> <value>Ok</value>
</data> </data>
<data name="btnServiceLevelCancel.Text" xml:space="preserve"> <data name="btnServiceLevelCancel.Text" xml:space="preserve">
@ -135,12 +132,6 @@
<data name="btnServiceLevelOk.Text" xml:space="preserve"> <data name="btnServiceLevelOk.Text" xml:space="preserve">
<value>Ok</value> <value>Ok</value>
</data> </data>
<data name="btnVIPCancel.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="btnVIPOk.Text" xml:space="preserve">
<value>Ok</value>
</data>
<data name="ddlUserActionsItem.Actions" xml:space="preserve"> <data name="ddlUserActionsItem.Actions" xml:space="preserve">
<value>- Actions -</value> <value>- Actions -</value>
</data> </data>
@ -150,35 +141,26 @@
<data name="ddlUserActionsItem.Enable" xml:space="preserve"> <data name="ddlUserActionsItem.Enable" xml:space="preserve">
<value>Enable</value> <value>Enable</value>
</data> </data>
<data name="ddlUserActionsItem.SetMailboxPlan" xml:space="preserve">
<value>Set Mailbox Plan</value>
</data>
<data name="ddlUserActionsItem.SetServiceLevel" xml:space="preserve"> <data name="ddlUserActionsItem.SetServiceLevel" xml:space="preserve">
<value>Set Service Level</value> <value>Set Service Level</value>
</data> </data>
<data name="ddlUserActionsItem.SetVIP" xml:space="preserve"> <data name="ddlUserActionsItem.SetVIP" xml:space="preserve">
<value>Set VIP</value> <value>Set VIP</value>
</data> </data>
<data name="ddlVIPItem.SetVIP" xml:space="preserve"> <data name="ddlUserActionsItem.UnsetVIP" xml:space="preserve">
<value>Set VIP</value>
</data>
<data name="ddlVIPItem.UnsetVIP" xml:space="preserve">
<value>Unset VIP</value> <value>Unset VIP</value>
</data> </data>
<data name="headerDisable.Text" xml:space="preserve"> <data name="headerMailboxPlanLabel.Text" xml:space="preserve">
<value>Disable users</value> <value>Mailbox Plan</value>
</data>
<data name="headerEnable.Text" xml:space="preserve">
<value>Enable users</value>
</data> </data>
<data name="headerServiceLevel.Text" xml:space="preserve"> <data name="headerServiceLevel.Text" xml:space="preserve">
<value>Service Level</value> <value>Service Level</value>
</data> </data>
<data name="headerVIP.Text" xml:space="preserve"> <data name="litMailboxPlan.text" xml:space="preserve">
<value>Set VIP</value> <value>Please select a Mailbox Plan for the all checked mailboxes</value>
</data>
<data name="litDisable.Text" xml:space="preserve">
<value>Do you wish to disable all selected users?</value>
</data>
<data name="litEnable.Text" xml:space="preserve">
<value>Do you wish to enable all selected users?</value>
</data> </data>
<data name="litServiceLevel.text" xml:space="preserve"> <data name="litServiceLevel.text" xml:space="preserve">
<value>Please select a Service Level for the all checked users</value> <value>Please select a Service Level for the all checked users</value>

View file

@ -1,72 +1,46 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserActions.ascx.cs" Inherits="WebsitePanel.Portal.UserActions" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserActions.ascx.cs" Inherits="WebsitePanel.Portal.UserActions" %>
<%@ Register Src="../ExchangeServer/UserControls/MailboxPlanSelector.ascx" TagName="MailboxPlanSelector" TagPrefix="wsp" %>
<script language="javascript"> <script language="javascript">
function CloseAndShowProgressDialog(text) { function CloseAndShowProgressDialog(text) {
$(".Popup").hide(); $(".Popup").hide();
return ShowProgressDialog(text); return ShowProgressDialog(text);
} }
function ShowProrgess(btn) {
var action = $(btn).prev().val();
if (action == 1) {
ShowProgressDialog('Disabling users...');
} else if (action == 2) {
ShowProgressDialog('Enabling users...');
} else if (action == 4) {
ShowProgressDialog('Setting VIP...');
} else if (action == 5) {
ShowProgressDialog('Unsetting VIP...');
}
}
</script> </script>
<asp:UpdatePanel ID="tblActions" runat="server" CssClass="NormalBold" UpdateMode="Conditional" ChildrenAsTriggers="true" > <asp:UpdatePanel ID="tblActions" runat="server" CssClass="NormalBold" UpdateMode="Conditional" ChildrenAsTriggers="true" >
<ContentTemplate> <ContentTemplate>
<asp:DropDownList ID="ddlUserActions" runat="server" CssClass="NormalTextBox" resourcekey="ddlUserActions" <asp:DropDownList ID="ddlUserActions" runat="server" CssClass="NormalTextBox" resourcekey="ddlUserActions"
AutoPostBack="True" OnSelectedIndexChanged="ddlUserActions_OnSelectedIndexChanged"> AutoPostBack="True">
<asp:ListItem Value="0">Actions</asp:ListItem> <asp:ListItem Value="0">Actions</asp:ListItem>
<asp:ListItem Value="1">Disable</asp:ListItem> <asp:ListItem Value="1">Disable</asp:ListItem>
<asp:ListItem Value="2">Enable</asp:ListItem> <asp:ListItem Value="2">Enable</asp:ListItem>
<asp:ListItem Value="3">SetServiceLevel</asp:ListItem> <asp:ListItem Value="3">SetServiceLevel</asp:ListItem>
<asp:ListItem Value="4">SetVIP</asp:ListItem> <asp:ListItem Value="4">SetVIP</asp:ListItem>
<asp:ListItem Value="5">UnsetVIP</asp:ListItem>
<asp:ListItem Value="6">SetMailboxPlan</asp:ListItem>
</asp:DropDownList> </asp:DropDownList>
<asp:Button ID="btnApply" runat="server" meta:resourcekey="btnApply"
Text="Apply" CssClass="Button1" OnClick="btnApply_Click" OnClientClick="return ShowProrgess(this);" />
<ajaxToolkit:ModalPopupExtender ID="Modal" runat="server" EnableViewState="true" TargetControlID="FakeModalPopupTarget" <ajaxToolkit:ModalPopupExtender ID="Modal" runat="server" EnableViewState="true" TargetControlID="FakeModalPopupTarget"
PopupControlID="EnablePanel" BackgroundCssClass="modalBackground" DropShadow="false" /> PopupControlID="FakeModalPopupTarget" BackgroundCssClass="modalBackground" DropShadow="false" />
<%-- Enable --%>
<asp:Panel ID="EnablePanel" runat="server" CssClass="Popup" Style="display: none">
<table class="Popup-Header">
<tr>
<td class="Popup-HeaderLeft"></td>
<td class="Popup-HeaderTitle"><asp:Localize ID="headerEnable" runat="server" meta:resourcekey="headerEnable"></asp:Localize></td>
<td class="Popup-HeaderRight"></td>
</tr>
</table>
<div class="Popup-Content">
<div class="Popup-Body">
<br/>
<asp:Literal ID="litEnable" runat="server" meta:resourcekey="litEnable"></asp:Literal>
<br/>
</div>
<div class="FormFooterMiddle">
<asp:Button ID="btnEnableOk" runat="server" CssClass="Button1" meta:resourcekey="btnEnableOk" Text="Ok"
OnClientClick="return CloseAndShowProgressDialog('Enabling users...')" OnClick="btnModalOk_Click" />
<asp:Button ID="btnEnableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnEnableCancel" Text="Cancel"
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
</div>
</div>
</asp:Panel>
<%-- Disable --%>
<asp:Panel ID="DisablePanel" runat="server" CssClass="Popup" Style="display: none">
<table class="Popup-Header">
<tr>
<td class="Popup-HeaderLeft"></td>
<td class="Popup-HeaderTitle"><asp:Localize ID="headerDisable" runat="server" meta:resourcekey="headerDisable"></asp:Localize></td>
<td class="Popup-HeaderRight"></td>
</tr>
</table>
<div class="Popup-Content">
<div class="Popup-Body">
<br/>
<asp:Literal ID="litDisable" runat="server" meta:resourcekey="litDisable"></asp:Literal>
<br/>
</div>
<div class="FormFooterMiddle">
<asp:Button ID="btnDisableOk" runat="server" CssClass="Button1" meta:resourcekey="btnDisableOk" Text="Ok"
OnClientClick="return CloseAndShowProgressDialog('Disabling users...')" OnClick="btnModalOk_Click" />
<asp:Button ID="btnDisableCancel" runat="server" CssClass="Button1" meta:resourcekey="btnDisableCancel" Text="Cancel"
OnClick="btnModalCancel_OnClick" CausesValidation="false" />
</div>
</div>
</asp:Panel>
<%--Set Service Level--%> <%--Set Service Level--%>
<asp:Panel ID="ServiceLevelPanel" runat="server" CssClass="Popup" Style="display: none"> <asp:Panel ID="ServiceLevelPanel" runat="server" CssClass="Popup" Style="display: none">
@ -94,42 +68,39 @@
</div> </div>
</asp:Panel> </asp:Panel>
<%-- VIP --%> <%--Set MailboxPlan--%>
<asp:Panel ID="VIPPanel" runat="server" CssClass="Popup" Style="display: none"> <asp:Panel ID="MailboxPlanPanel" runat="server" CssClass="Popup" Style="display: none">
<table class="Popup-Header"> <table class="Popup-Header">
<tr> <tr>
<td class="Popup-HeaderLeft"></td> <td class="Popup-HeaderLeft"></td>
<td class="Popup-HeaderTitle"><asp:Localize ID="headerVIP" runat="server" meta:resourcekey="headerVIP"></asp:Localize></td> <td class="Popup-HeaderTitle"><asp:Localize ID="headerMailboxPlanLabel" runat="server" meta:resourcekey="headerMailboxPlanLabel"></asp:Localize></td>
<td class="Popup-HeaderRight"></td> <td class="Popup-HeaderRight"></td>
</tr> </tr>
</table> </table>
<div class="Popup-Content"> <div class="Popup-Content">
<div class="Popup-Body"> <div class="Popup-Body">
<br/> <br/>
<asp:Literal ID="litVIP" runat="server" meta:resourcekey="litVIP"></asp:Literal> <asp:Literal ID="litMailboxPlan" runat="server" meta:resourcekey="litMailboxPlan"></asp:Literal>
<br/> <br/>
<asp:DropDownList ID="ddlVIP" runat="server" CssClass="NormalTextBox" resourcekey="ddlVIP"> <wsp:MailboxPlanSelector ID="mailboxPlanSelector" runat="server" />
<asp:ListItem Value="0">SetVIP</asp:ListItem>
<asp:ListItem Value="1">UnsetVIP</asp:ListItem>
</asp:DropDownList>
<br/> <br/>
</div> </div>
<div class="FormFooterMiddle"> <div class="FormFooterMiddle">
<asp:Button ID="btnVIPOk" runat="server" CssClass="Button1" meta:resourcekey="btnVIPOk" Text="Ok" <asp:Button ID="btnMailboxPlanOk" runat="server" CssClass="Button1" meta:resourcekey="btnMailboxPlanOk" Text="Ok"
OnClientClick="return CloseAndShowProgressDialog('Setting VIP...')" OnClick="btnModalOk_Click" /> OnClientClick="return CloseAndShowProgressDialog('Setting Mailbox Plan ...')" OnClick="btnModalOk_Click" />
<asp:Button ID="btnVIPCancel" runat="server" CssClass="Button1" meta:resourcekey="btnVIPCancel" Text="Cancel" <asp:Button ID="btnMailboxPlanCancel" runat="server" CssClass="Button1" meta:resourcekey="btnMailboxPlanCancel" Text="Cancel"
OnClick="btnModalCancel_OnClick" CausesValidation="false" /> OnClick="btnModalCancel_OnClick" CausesValidation="false" />
</div> </div>
</div> </div>
</asp:Panel> </asp:Panel>
<asp:Button ID="FakeModalPopupTarget" runat="server" Style="display: none;" /> <asp:Button ID="FakeModalPopupTarget" runat="server" Style="display: none;" />
</ContentTemplate> </ContentTemplate>
<Triggers> <Triggers>
<asp:PostBackTrigger ControlID="btnDisableOk" />
<asp:PostBackTrigger ControlID="btnEnableOk" />
<asp:PostBackTrigger ControlID="btnServiceLevelOk" /> <asp:PostBackTrigger ControlID="btnServiceLevelOk" />
<asp:PostBackTrigger ControlID="btnVIPOk" /> <asp:PostBackTrigger ControlID="btnMailboxPlanOk" />
<asp:PostBackTrigger ControlID="btnApply" />
</Triggers> </Triggers>
</asp:UpdatePanel> </asp:UpdatePanel>

View file

@ -53,20 +53,33 @@ namespace WebsitePanel.Portal
Enable = 2, Enable = 2,
SetServiceLevel = 3, SetServiceLevel = 3,
SetVIP = 4, SetVIP = 4,
UnsetVIP = 5,
SetMailboxPlan = 6
} }
public partial class UserActions : WebsitePanelControlBase public partial class UserActions : WebsitePanelControlBase
{ {
public event EventHandler ExecutingUserAction; public event EventHandler ExecutingUserAction;
private bool showSetMailboxPlan = false;
public bool ShowSetMailboxPlan
{
get { return showSetMailboxPlan; }
set { showSetMailboxPlan = value; }
}
protected void Page_Load(object sender, EventArgs e) protected void Page_Load(object sender, EventArgs e)
{ {
// Remove Service Level item and VIP item from Action List if current Hosting plan does not allow Service Levels // Remove Service Level item and VIP item from Action List if current Hosting plan does not allow Service Levels
if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.ServiceLevels)) if (!PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId).Groups.ContainsKey(ResourceGroups.ServiceLevels))
{ {
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetServiceLevel.ToString())); ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetServiceLevel).ToString()));
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(UserActionTypes.SetVIP.ToString())); ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetVIP).ToString()));
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.UnsetVIP).ToString()));
} }
if (!ShowSetMailboxPlan)
ddlUserActions.Items.Remove(ddlUserActions.Items.FindByValue(((int)UserActionTypes.SetMailboxPlan).ToString()));
} }
public UserActionTypes SelectedAction public UserActionTypes SelectedAction
@ -77,28 +90,6 @@ namespace WebsitePanel.Portal
} }
} }
protected void ddlUserActions_OnSelectedIndexChanged(object sender, EventArgs e)
{
switch (SelectedAction)
{
case UserActionTypes.Disable:
Modal.PopupControlID = DisablePanel.ID;
break;
case UserActionTypes.Enable:
Modal.PopupControlID = EnablePanel.ID;
break;
case UserActionTypes.SetServiceLevel:
FillServiceLevelsList();
Modal.PopupControlID = ServiceLevelPanel.ID;
break;
case UserActionTypes.SetVIP:
Modal.PopupControlID = VIPPanel.ID;
break;
}
Modal.Show();
}
public int DoUserActions(List<int> userIds) public int DoUserActions(List<int> userIds)
{ {
switch (SelectedAction) switch (SelectedAction)
@ -110,17 +101,27 @@ namespace WebsitePanel.Portal
case UserActionTypes.SetServiceLevel: case UserActionTypes.SetServiceLevel:
return ChangeUsersSettings(userIds, null, SelectedServiceId, null); return ChangeUsersSettings(userIds, null, SelectedServiceId, null);
case UserActionTypes.SetVIP: case UserActionTypes.SetVIP:
return ChangeUsersSettings(userIds, null, null, SelectedVIP); return ChangeUsersSettings(userIds, null, null, true);
case UserActionTypes.UnsetVIP:
return ChangeUsersSettings(userIds, null, null, false);
case UserActionTypes.SetMailboxPlan:
return SetMailboxPlan(userIds);
} }
return 0; return 0;
} }
protected void btnModalOk_Click(object sender, EventArgs e) protected void DoExecutingUserAction()
{ {
if (ExecutingUserAction != null) if (ExecutingUserAction != null)
ExecutingUserAction(this, new EventArgs()); ExecutingUserAction(this, new EventArgs());
} }
protected void btnModalOk_Click(object sender, EventArgs e)
{
DoExecutingUserAction();
}
protected void btnModalCancel_OnClick(object sender, EventArgs e) protected void btnModalCancel_OnClick(object sender, EventArgs e)
{ {
ResetSelection(); ResetSelection();
@ -173,12 +174,11 @@ namespace WebsitePanel.Portal
user.ExternalEmail, user.ExternalEmail,
user.SubscriberNumber, user.SubscriberNumber,
serviceLevelId ?? user.LevelId, serviceLevelId ?? user.LevelId,
isVIP ?? user.IsVIP, false); isVIP ?? user.IsVIP,
user.UserMustChangePassword);
if (result < 0) if (result < 0)
{
return result; return result;
}
} }
return 0; return 0;
@ -187,6 +187,29 @@ namespace WebsitePanel.Portal
#region ServiceLevel #region ServiceLevel
protected int SetMailboxPlan(List<int> userIds)
{
int planId;
if (!int.TryParse(mailboxPlanSelector.MailboxPlanId, out planId))
return 0;
if (planId < 0) return 0;
foreach (int userId in userIds)
{
ExchangeAccount account = ES.Services.ExchangeServer.GetAccount(PanelRequest.ItemID, userId);
int result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, userId, planId,
account.ArchivingMailboxPlanId, account.EnableArchiving);
if (result < 0)
return result;
}
return 0;
}
protected int? SelectedServiceId protected int? SelectedServiceId
{ {
get get
@ -239,15 +262,29 @@ namespace WebsitePanel.Portal
#endregion #endregion
protected void btnApply_Click(object sender, EventArgs e)
#region VIP
protected bool? SelectedVIP
{ {
get { return ddlVIP.SelectedValue == "0"; } switch (SelectedAction)
} {
case UserActionTypes.Disable:
case UserActionTypes.Enable:
case UserActionTypes.SetVIP:
case UserActionTypes.UnsetVIP:
DoExecutingUserAction();
break;
case UserActionTypes.SetServiceLevel:
FillServiceLevelsList();
Modal.PopupControlID = ServiceLevelPanel.ID;
Modal.Show();
break;
case UserActionTypes.SetMailboxPlan:
Modal.PopupControlID = MailboxPlanPanel.ID;
Modal.Show();
break;
#endregion }
}
} }
} }

View file

@ -1,31 +1,3 @@
// Copyright (c) 2015, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
@ -58,6 +30,15 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlUserActions; protected global::System.Web.UI.WebControls.DropDownList ddlUserActions;
/// <summary>
/// btnApply control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnApply;
/// <summary> /// <summary>
/// Modal control. /// Modal control.
/// </summary> /// </summary>
@ -67,96 +48,6 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::AjaxControlToolkit.ModalPopupExtender Modal; protected global::AjaxControlToolkit.ModalPopupExtender Modal;
/// <summary>
/// EnablePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel EnablePanel;
/// <summary>
/// headerEnable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize headerEnable;
/// <summary>
/// litEnable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litEnable;
/// <summary>
/// btnEnableOk control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnEnableOk;
/// <summary>
/// btnEnableCancel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnEnableCancel;
/// <summary>
/// DisablePanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel DisablePanel;
/// <summary>
/// headerDisable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize headerDisable;
/// <summary>
/// litDisable control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Literal litDisable;
/// <summary>
/// btnDisableOk control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDisableOk;
/// <summary>
/// btnDisableCancel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDisableCancel;
/// <summary> /// <summary>
/// ServiceLevelPanel control. /// ServiceLevelPanel control.
/// </summary> /// </summary>
@ -212,58 +103,58 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.Button btnServiceLevelCancel; protected global::System.Web.UI.WebControls.Button btnServiceLevelCancel;
/// <summary> /// <summary>
/// VIPPanel control. /// MailboxPlanPanel control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Panel VIPPanel; protected global::System.Web.UI.WebControls.Panel MailboxPlanPanel;
/// <summary> /// <summary>
/// headerVIP control. /// headerMailboxPlanLabel control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize headerVIP; protected global::System.Web.UI.WebControls.Localize headerMailboxPlanLabel;
/// <summary> /// <summary>
/// litVIP control. /// litMailboxPlan control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Literal litVIP; protected global::System.Web.UI.WebControls.Literal litMailboxPlan;
/// <summary> /// <summary>
/// ddlVIP control. /// mailboxPlanSelector control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlVIP; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector;
/// <summary> /// <summary>
/// btnVIPOk control. /// btnMailboxPlanOk control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnVIPOk; protected global::System.Web.UI.WebControls.Button btnMailboxPlanOk;
/// <summary> /// <summary>
/// btnVIPCancel control. /// btnMailboxPlanCancel control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Button btnVIPCancel; protected global::System.Web.UI.WebControls.Button btnMailboxPlanCancel;
/// <summary> /// <summary>
/// FakeModalPopupTarget control. /// FakeModalPopupTarget control.