From 4f500a356a1531d1e103ae6ddeb2b50a1f397863 Mon Sep 17 00:00:00 2001 From: dev_amdtel Date: Wed, 2 Apr 2014 14:44:15 +0400 Subject: [PATCH] Exchange archiving part 2 --- .../Data/DataProvider.cs | 5 +- .../ExchangeServerController.cs | 2 +- .../HostedSolution/ExchangeMailboxPlan.cs | 7 +++ .../App_Data/WebsitePanel_Modules.config | 2 +- ...ttingsExchangeMailboxPlansPolicy.ascx.resx | 4 +- .../ExchangeMailboxPlans.ascx.resx | 6 +-- .../ExchangeAddMailboxPlan.ascx | 5 ++ .../ExchangeAddMailboxPlan.ascx.cs | 20 ++++---- .../ExchangeAddMailboxPlan.ascx.designer.cs | 9 ++++ .../ExchangeServer/ExchangeMailboxPlans.ascx | 2 +- .../ExchangeMailboxPlans.ascx.cs | 10 ++-- .../App_LocalResources/Menu.ascx.resx | 4 +- .../ExchangeServer/UserControls/Menu.ascx.cs | 2 +- .../SettingsExchangeMailboxPlansPolicy.ascx | 9 +++- ...SettingsExchangeMailboxPlansPolicy.ascx.cs | 32 +++++++++++-- ...xchangeMailboxPlansPolicy.ascx.designer.cs | 9 ++++ .../UserAccountPolicySettings.ascx | 8 ++++ ...UserAccountPolicySettings.ascx.designer.cs | 47 +++++++------------ 18 files changed, 122 insertions(+), 61 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs index e28068b5..f2e3b43e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/Data/DataProvider.cs @@ -2785,7 +2785,7 @@ namespace WebsitePanel.EnterpriseServer bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients, int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType, bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg, - bool archiving) + bool archiving, bool EnableArchiving) { SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int); outParam.Direction = ParameterDirection.Output; @@ -2818,7 +2818,8 @@ namespace WebsitePanel.EnterpriseServer new SqlParameter("@RecoverableItemsSpace", recoverabelItemsSpace), new SqlParameter("@LitigationHoldUrl", litigationHoldUrl), new SqlParameter("@LitigationHoldMsg", litigationHoldMsg), - new SqlParameter("@Archiving", archiving) + new SqlParameter("@Archiving", archiving), + new SqlParameter("@EnableArchiving", EnableArchiving) ); return Convert.ToInt32(outParam.Value); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs index c1193f63..0ef790b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/ExchangeServer/ExchangeServerController.cs @@ -2881,7 +2881,7 @@ namespace WebsitePanel.EnterpriseServer mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients, mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType, mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct, - mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving); + mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving, mailboxPlan.EnableArchiving); } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs index cd4a69ec..4cee0582 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/ExchangeMailboxPlan.cs @@ -216,5 +216,12 @@ namespace WebsitePanel.Providers.HostedSolution get { return this.archiving; } set { this.archiving = value; } } + + bool enableArchiving; + public bool EnableArchiving + { + get { return this.enableArchiving; } + set { this.enableArchiving = value; } + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index 1d8d927a..379d1875 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -513,7 +513,7 @@ - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx index 84690666..fa042915 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsExchangeMailboxPlansPolicy.ascx.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Add New Mailbox plan + Add New Set Default Mailbox plan @@ -226,7 +226,7 @@ Restamp mailboxes - Update Mailbox Plan + Update Enable Litigation Hold diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx index c7831aaf..852a5164 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/ExchangeMailboxPlans.ascx.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Add New Mailbox plan + Add New Stamp mailboxes @@ -162,7 +162,7 @@ Mailbox plans - - Archiving Mailbox plans + + Retention Policy \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx index fec347e3..0f201cb2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx @@ -78,6 +78,11 @@ + + + + +
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs index f3aa61ee..b9a5e4ab 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.cs @@ -35,7 +35,7 @@ namespace WebsitePanel.Portal.ExchangeServer { public partial class ExchangeAddMailboxPlan : WebsitePanelModuleBase { - private bool ArchivingPlan + private bool RetentionPolicy { get { @@ -80,7 +80,9 @@ namespace WebsitePanel.Portal.ExchangeServer txtLitigationHoldMsg.Text = plan.LitigationHoldMsg; txtLitigationHoldUrl.Text = plan.LitigationHoldUrl; - ArchivingPlan = plan.Archiving; + RetentionPolicy = plan.Archiving; + + chkEnableArchiving.Checked = plan.EnableArchiving; locTitle.Text = plan.MailboxPlan; this.DisableControls = true; @@ -151,17 +153,17 @@ namespace WebsitePanel.Portal.ExchangeServer sizeProhibitSendReceive.ValueKB = 100; recoverableItemsWarning.ValueKB = 95; - ArchivingPlan = PanelRequest.GetBool("archiving", false); + RetentionPolicy = PanelRequest.GetBool("archiving", false); } } else this.DisableControls = true; } - locTitle.Text = ArchivingPlan ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text"); + locTitle.Text = RetentionPolicy ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text"); - secMailboxFeatures.Visible = !ArchivingPlan; - secMailboxGeneral.Visible = !ArchivingPlan; + secMailboxFeatures.Visible = !RetentionPolicy; + secMailboxGeneral.Visible = !RetentionPolicy; } @@ -205,7 +207,9 @@ namespace WebsitePanel.Portal.ExchangeServer plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); - plan.Archiving = ArchivingPlan; + plan.Archiving = RetentionPolicy; + + plan.EnableArchiving = chkEnableArchiving.Checked; int result = ES.Services.ExchangeServer.AddExchangeMailboxPlan(PanelRequest.ItemID, plan); @@ -217,7 +221,7 @@ namespace WebsitePanel.Portal.ExchangeServer return; } - Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), ArchivingPlan ? "archivingmailboxplans" : "mailboxplans", + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), RetentionPolicy ? "retentionpolicy" : "mailboxplans", "SpaceID=" + PanelSecurity.PackageId)); } catch (Exception ex) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs index ec1414e5..57d478fa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx.designer.cs @@ -174,6 +174,15 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::System.Web.UI.WebControls.CheckBox chkActiveSync; + /// + /// chkEnableArchiving control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving; + /// /// secMailboxGeneral control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx index 29237ac7..f21c460e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx @@ -28,7 +28,7 @@
+ Text="Add New" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
Archiving Mailboxes
- - Archiving Mailbox Plans + + Retention Policy \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 81b1a6e3..383497aa 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -142,7 +142,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls if (!hideItems) if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, cntx)) - exchangeGroup.MenuItems.Add(CreateMenuItem("ArchivingMailboxPlans", "archivingmailboxplans")); + exchangeGroup.MenuItems.Add(CreateMenuItem("RetentionPolicy", "retentionpolicy")); if (!hideItems) if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx)) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx index a55bc251..18c41cdd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx @@ -103,6 +103,11 @@ + + + + +
@@ -261,13 +266,13 @@
+ Text="Add New" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
+ Text="Update" CssClass="Button1" OnClick="btnUpdateMailboxPlan_Click" /> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs index f4e8d101..71e05fe9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs @@ -53,11 +53,27 @@ namespace WebsitePanel.Portal public partial class SettingsExchangeMailboxPlansPolicy : WebsitePanelControlBase, IUserSettingsEditorControl { + private bool RetentionPolicy + { + get + { + return Request["SettingsName"].ToLower().Contains("retentionpolicy"); + } + } + + public void BindSettings(UserSettings settings) { BindMailboxPlans(); txtStatus.Visible = false; + + secMailboxFeatures.Visible = !RetentionPolicy; + secMailboxGeneral.Visible = !RetentionPolicy; + + gvMailboxPlans.Columns[2].Visible = !RetentionPolicy; + gvMailboxPlans.Columns[3].Visible = !RetentionPolicy; + } @@ -81,7 +97,7 @@ namespace WebsitePanel.Portal if ((orgs != null) & (orgs.GetLength(0) > 0)) { - ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id, false); + ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id, RetentionPolicy); gvMailboxPlans.DataSource = list; gvMailboxPlans.DataBind(); @@ -125,8 +141,11 @@ namespace WebsitePanel.Portal plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB; if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); - plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); + plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); + plan.EnableArchiving = chkEnableArchiving.Checked; + + plan.Archiving = RetentionPolicy; if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator; @@ -231,7 +250,7 @@ namespace WebsitePanel.Portal txtLitigationHoldMsg.Text = string.Empty; txtLitigationHoldUrl.Text = string.Empty; - + chkEnableArchiving.Checked = false; btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true; @@ -285,6 +304,8 @@ namespace WebsitePanel.Portal recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct; txtLitigationHoldMsg.Text = plan.LitigationHoldMsg; txtLitigationHoldUrl.Text = plan.LitigationHoldUrl; + + chkEnableArchiving.Checked = plan.EnableArchiving; btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true; @@ -392,8 +413,11 @@ namespace WebsitePanel.Portal plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB; if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100; plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim(); - plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); + plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim(); + plan.EnableArchiving = chkEnableArchiving.Checked; + + plan.Archiving = RetentionPolicy; if (PanelSecurity.SelectedUser.Role == UserRole.Administrator) plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs index 3229e00d..401575ee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs @@ -138,6 +138,15 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.CheckBox chkActiveSync; + /// + /// chkEnableArchiving control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox chkEnableArchiving; + /// /// secMailboxGeneral control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx index ec8291a2..f9aa50a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserAccountPolicySettings.ascx @@ -13,6 +13,14 @@ +
  • + +
  • +
  • + +
  • // This code was generated by a tool. @@ -68,6 +39,24 @@ namespace WebsitePanel.Portal { /// protected global::System.Web.UI.WebControls.HyperLink lnkExchangeMailboxPlansPolicy; + /// + /// lnkExchangeRetentionPolicy control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkExchangeRetentionPolicy; + + /// + /// lnkExchangeRetentionPolicyTag control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkExchangeRetentionPolicyTag; + /// /// lnkLyncUserPlansPolicy control. ///