-
+
|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
index 948f2580..ded32126 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeCreateMailbox.ascx.designer.cs
@@ -328,13 +328,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxPlanSelector mailboxPlanSelector;
///
- /// locArchivingMailboxplanName control.
+ /// locRetentionPolicyName control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Localize locArchivingMailboxplanName;
+ protected global::System.Web.UI.WebControls.Localize locRetentionPolicyName;
///
/// archivingMailboxPlanSelector control.
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx
index b3278a57..10f3cfdb 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx
@@ -55,7 +55,7 @@
|
-
+
|
@@ -74,16 +74,10 @@
-
-
+
+
-
- |
-
-
- |
-
-
+
|
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs
index 8233dc9c..4d52a840 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.cs
@@ -67,8 +67,6 @@ namespace WebsitePanel.Portal.ExchangeServer
BindSettings();
- SetArchivingVisible();
-
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
@@ -124,12 +122,10 @@ namespace WebsitePanel.Portal.ExchangeServer
if (account.ArchivingMailboxPlanId<1)
{
mailboxRetentionPolicySelector.MailboxPlanId = "-1";
- chkArchiving.Checked = false;
}
else
{
mailboxRetentionPolicySelector.MailboxPlanId = account.ArchivingMailboxPlanId.ToString();
- chkArchiving.Checked = true;
}
mailboxSize.QuotaUsedValue = Convert.ToInt32(stats.TotalSize / 1024 / 1024);
@@ -182,8 +178,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
int planId = Convert.ToInt32(mailboxPlanSelector.MailboxPlanId);
int policyId = -1;
- if (chkArchiving.Checked)
- policyId = Convert.ToInt32(mailboxRetentionPolicySelector.MailboxPlanId);
+ int.TryParse(mailboxRetentionPolicySelector.MailboxPlanId, out policyId);
result = ES.Services.ExchangeServer.SetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.AccountID, planId,
policyId);
@@ -264,35 +259,5 @@ namespace WebsitePanel.Portal.ExchangeServer
return result;
}
- protected void chkArchiving_CheckedChanged(object sender, EventArgs e)
- {
- SetArchivingVisible();
- }
-
- private void SetArchivingVisible()
- {
- int id;
- if (!int.TryParse(mailboxPlanSelector.MailboxPlanId, out id))
- return;
-
- bool archiving = false;
-
- ExchangeMailboxPlan policy = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, id);
-
- if (policy != null)
- archiving = policy.EnableArchiving & Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, Cntx);
-
- if (!archiving)
- chkArchiving.Checked = false;
-
- secArchiving.Visible = archiving;
- mailboxArchivePlan.Visible = chkArchiving.Checked;
- }
-
- protected void mailboxPlanSelector_Changed(object sender, EventArgs e)
- {
- SetArchivingVisible();
- }
-
}
}
\ No newline at end of file
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs
index 9aea4c2d..31535520 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/ExchangeMailboxGeneralSettings.ascx.designer.cs
@@ -175,40 +175,22 @@ namespace WebsitePanel.Portal.ExchangeServer {
protected global::WebsitePanel.Portal.QuotaViewer mailboxSize;
///
- /// secArchiving control.
+ /// secRetentionPolicy control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving;
+ protected global::WebsitePanel.Portal.CollapsiblePanel secRetentionPolicy;
///
- /// Archiving control.
+ /// RetentionPolicy control.
///
///
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
///
- protected global::System.Web.UI.WebControls.Panel Archiving;
-
- ///
- /// chkArchiving control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.WebControls.CheckBox chkArchiving;
-
- ///
- /// mailboxArchivePlan control.
- ///
- ///
- /// Auto-generated field.
- /// To modify move field declaration from designer file to code-behind file.
- ///
- protected global::System.Web.UI.HtmlControls.HtmlTableRow mailboxArchivePlan;
+ protected global::System.Web.UI.WebControls.Panel RetentionPolicy;
///
/// locRetentionPolicyName control.
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx
index 9ba5ee59..855b6a24 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx
@@ -103,11 +103,6 @@
|
-
-
-
- |
-
@@ -260,6 +255,74 @@
+
+
+
+
+
+
+
+ |
+ |
+
+
+ |
+
+
+
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%# PortalAntiXSS.Encode((string)Eval("TagName"))%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs
index 1eb5b4b6..87185368 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.cs
@@ -70,10 +70,21 @@ namespace WebsitePanel.Portal
secMailboxFeatures.Visible = !RetentionPolicy;
secMailboxGeneral.Visible = !RetentionPolicy;
+ secStorageQuotas.Visible = !RetentionPolicy;
+ secDeleteRetention.Visible = !RetentionPolicy;
+ secLitigationHold.Visible = !RetentionPolicy;
+
+ secArchiving.Visible = RetentionPolicy;
+ secRetentionPolicyTags.Visible = RetentionPolicy;
gvMailboxPlans.Columns[4].Visible = !RetentionPolicy;
gvMailboxPlans.Columns[5].Visible = !RetentionPolicy;
+ btnAddMailboxPlan.CausesValidation = RetentionPolicy;
+ btnUpdateMailboxPlan.CausesValidation = RetentionPolicy;
+
+ UpdateTags();
+
}
@@ -109,44 +120,54 @@ namespace WebsitePanel.Portal
public void btnAddMailboxPlan_Click(object sender, EventArgs e)
{
- Page.Validate("CreateMailboxPlan");
+ if (!RetentionPolicy)
+ Page.Validate("CreateMailboxPlan");
if (!Page.IsValid)
return;
Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlan = txtMailboxPlan.Text;
-
- plan.MailboxSizeMB = mailboxSize.QuotaValue;
-
- plan.IsDefault = false;
- plan.MaxRecipients = maxRecipients.QuotaValue;
- plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
- plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
- plan.EnablePOP = chkPOP3.Checked;
- plan.EnableIMAP = chkIMAP.Checked;
- plan.EnableOWA = chkOWA.Checked;
- plan.EnableMAPI = chkMAPI.Checked;
- plan.EnableActiveSync = chkActiveSync.Checked;
- plan.IssueWarningPct = sizeIssueWarning.ValueKB;
- if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
- plan.ProhibitSendPct = sizeProhibitSend.ValueKB;
- if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100;
- plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB;
- if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100;
- plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
- plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
- plan.AllowLitigationHold = chkEnableLitigationHold.Checked;
- plan.RecoverableItemsSpace = recoverableItemsSpace.QuotaValue;
- plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB;
- if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
- plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
- plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
-
- plan.EnableArchiving = chkEnableArchiving.Checked;
-
plan.Archiving = RetentionPolicy;
+ if (RetentionPolicy)
+ {
+ plan.EnableArchiving = chkEnableArchiving.Checked;
+
+ plan.MailboxSizeMB = archiveQuota.QuotaValue;
+ plan.IssueWarningPct = archiveWarningQuota.ValueKB;
+ if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
+
+ }
+ else
+ {
+ plan.MailboxSizeMB = mailboxSize.QuotaValue;
+
+ plan.IsDefault = false;
+ plan.MaxRecipients = maxRecipients.QuotaValue;
+ plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
+ plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
+ plan.EnablePOP = chkPOP3.Checked;
+ plan.EnableIMAP = chkIMAP.Checked;
+ plan.EnableOWA = chkOWA.Checked;
+ plan.EnableMAPI = chkMAPI.Checked;
+ plan.EnableActiveSync = chkActiveSync.Checked;
+ plan.IssueWarningPct = sizeIssueWarning.ValueKB;
+ if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
+ plan.ProhibitSendPct = sizeProhibitSend.ValueKB;
+ if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100;
+ plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB;
+ if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100;
+ plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
+ plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
+ plan.AllowLitigationHold = chkEnableLitigationHold.Checked;
+ plan.RecoverableItemsSpace = recoverableItemsSpace.QuotaValue;
+ plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB;
+ if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
+ plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
+ plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
+ }
+
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;
else
@@ -172,13 +193,16 @@ namespace WebsitePanel.Portal
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
- int result = ES.Services.ExchangeServer.AddExchangeMailboxPlan(orgs[0].Id, plan);
+ int planId = ES.Services.ExchangeServer.AddExchangeMailboxPlan(orgs[0].Id, plan);
- if (result < 0)
+ if (planId < 0)
{
- messageBox.ShowResultMessage(result);
+ messageBox.ShowResultMessage(planId);
return;
}
+
+ if (RetentionPolicy)
+ SaveTags(orgs[0].Id, planId);
}
BindMailboxPlans();
@@ -251,6 +275,13 @@ namespace WebsitePanel.Portal
txtLitigationHoldUrl.Text = string.Empty;
chkEnableArchiving.Checked = false;
+ archiveQuota.QuotaValue = 0;
+ archiveWarningQuota.ValueKB = 0;
+ ViewState["Tags"] = null;
+ gvPolicy.DataSource = null;
+ gvPolicy.DataBind();
+ UpdateTags();
+
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
@@ -282,30 +313,48 @@ namespace WebsitePanel.Portal
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
-
txtMailboxPlan.Text = plan.MailboxPlan;
- mailboxSize.QuotaValue = plan.MailboxSizeMB;
- maxRecipients.QuotaValue = plan.MaxRecipients;
- maxSendMessageSizeKB.QuotaValue = plan.MaxSendMessageSizeKB;
- maxReceiveMessageSizeKB.QuotaValue = plan.MaxReceiveMessageSizeKB;
- chkPOP3.Checked = plan.EnablePOP;
- chkIMAP.Checked = plan.EnableIMAP;
- chkOWA.Checked = plan.EnableOWA;
- chkMAPI.Checked = plan.EnableMAPI;
- chkActiveSync.Checked = plan.EnableActiveSync;
- sizeIssueWarning.ValueKB = plan.IssueWarningPct;
- sizeProhibitSend.ValueKB = plan.ProhibitSendPct;
- sizeProhibitSendReceive.ValueKB = plan.ProhibitSendReceivePct;
- if (plan.KeepDeletedItemsDays != -1)
- daysKeepDeletedItems.ValueDays = plan.KeepDeletedItemsDays;
- chkHideFromAddressBook.Checked = plan.HideFromAddressBook;
- chkEnableLitigationHold.Checked = plan.AllowLitigationHold;
- recoverableItemsSpace.QuotaValue = plan.RecoverableItemsSpace;
- recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct;
- txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
- txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
- chkEnableArchiving.Checked = plan.EnableArchiving;
+ if (RetentionPolicy)
+ {
+ chkEnableArchiving.Checked = plan.EnableArchiving;
+
+ archiveQuota.QuotaValue = plan.MailboxSizeMB;
+ archiveWarningQuota.ValueKB = plan.IssueWarningPct;
+
+ List tags = new List();
+ tags.AddRange(ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(plan.MailboxPlanId));
+
+ ViewState["Tags"] = tags;
+ gvPolicy.DataSource = tags;
+ gvPolicy.DataBind();
+ UpdateTags();
+
+ }
+ else
+ {
+ mailboxSize.QuotaValue = plan.MailboxSizeMB;
+ maxRecipients.QuotaValue = plan.MaxRecipients;
+ maxSendMessageSizeKB.QuotaValue = plan.MaxSendMessageSizeKB;
+ maxReceiveMessageSizeKB.QuotaValue = plan.MaxReceiveMessageSizeKB;
+ chkPOP3.Checked = plan.EnablePOP;
+ chkIMAP.Checked = plan.EnableIMAP;
+ chkOWA.Checked = plan.EnableOWA;
+ chkMAPI.Checked = plan.EnableMAPI;
+ chkActiveSync.Checked = plan.EnableActiveSync;
+ sizeIssueWarning.ValueKB = plan.IssueWarningPct;
+ sizeProhibitSend.ValueKB = plan.ProhibitSendPct;
+ sizeProhibitSendReceive.ValueKB = plan.ProhibitSendReceivePct;
+ if (plan.KeepDeletedItemsDays != -1)
+ daysKeepDeletedItems.ValueDays = plan.KeepDeletedItemsDays;
+ chkHideFromAddressBook.Checked = plan.HideFromAddressBook;
+ chkEnableLitigationHold.Checked = plan.AllowLitigationHold;
+ recoverableItemsSpace.QuotaValue = plan.RecoverableItemsSpace;
+ recoverableItemsWarning.ValueKB = plan.RecoverableItemsWarningPct;
+ txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
+ txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
+ }
+
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
@@ -388,37 +437,48 @@ namespace WebsitePanel.Portal
plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlanId = (int)ViewState["MailboxPlanID"];
plan.MailboxPlan = txtMailboxPlan.Text;
-
- plan.MailboxSizeMB = mailboxSize.QuotaValue;
-
- plan.IsDefault = false;
- plan.MaxRecipients = maxRecipients.QuotaValue;
- plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
- plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
- plan.EnablePOP = chkPOP3.Checked;
- plan.EnableIMAP = chkIMAP.Checked;
- plan.EnableOWA = chkOWA.Checked;
- plan.EnableMAPI = chkMAPI.Checked;
- plan.EnableActiveSync = chkActiveSync.Checked;
- plan.IssueWarningPct = sizeIssueWarning.ValueKB;
- if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
- plan.ProhibitSendPct = sizeProhibitSend.ValueKB;
- if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100;
- plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB;
- if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100;
- plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
- plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
- plan.AllowLitigationHold = chkEnableLitigationHold.Checked;
- plan.RecoverableItemsSpace = recoverableItemsSpace.QuotaValue;
- plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB;
- if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
- plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
- plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
-
- plan.EnableArchiving = chkEnableArchiving.Checked;
-
plan.Archiving = RetentionPolicy;
+ if (RetentionPolicy)
+ {
+ plan.EnableArchiving = chkEnableArchiving.Checked;
+
+ plan.MailboxSizeMB = archiveQuota.QuotaValue;
+ plan.IssueWarningPct = archiveWarningQuota.ValueKB;
+ if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
+
+ }
+ else
+ {
+ plan.MailboxSizeMB = mailboxSize.QuotaValue;
+
+ plan.IsDefault = false;
+ plan.MaxRecipients = maxRecipients.QuotaValue;
+ plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
+ plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
+ plan.EnablePOP = chkPOP3.Checked;
+ plan.EnableIMAP = chkIMAP.Checked;
+ plan.EnableOWA = chkOWA.Checked;
+ plan.EnableMAPI = chkMAPI.Checked;
+ plan.EnableActiveSync = chkActiveSync.Checked;
+ plan.IssueWarningPct = sizeIssueWarning.ValueKB;
+ if ((plan.IssueWarningPct == 0)) plan.IssueWarningPct = 100;
+ plan.ProhibitSendPct = sizeProhibitSend.ValueKB;
+ if ((plan.ProhibitSendPct == 0)) plan.ProhibitSendPct = 100;
+ plan.ProhibitSendReceivePct = sizeProhibitSendReceive.ValueKB;
+ if ((plan.ProhibitSendReceivePct == 0)) plan.ProhibitSendReceivePct = 100;
+ plan.KeepDeletedItemsDays = daysKeepDeletedItems.ValueDays;
+ plan.HideFromAddressBook = chkHideFromAddressBook.Checked;
+ plan.AllowLitigationHold = chkEnableLitigationHold.Checked;
+ plan.RecoverableItemsSpace = recoverableItemsSpace.QuotaValue;
+ plan.RecoverableItemsWarningPct = recoverableItemsWarning.ValueKB;
+ if ((plan.RecoverableItemsWarningPct == 0)) plan.RecoverableItemsWarningPct = 100;
+ plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
+ plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
+ }
+
+
+
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;
else
@@ -436,8 +496,12 @@ namespace WebsitePanel.Portal
}
else
{
+ if (RetentionPolicy)
+ SaveTags(orgs[0].Id, mailboxPlanId);
+
messageBox.ShowSuccessMessage("EXCHANGE_UPDATEPLANS");
}
+
}
BindMailboxPlans();
@@ -518,5 +582,130 @@ namespace WebsitePanel.Portal
BindMailboxPlans();
}
+
+ protected void gvPolicy_RowCommand(object sender, GridViewCommandEventArgs e)
+ {
+
+ switch (e.CommandName)
+ {
+ case "DeleteItem":
+ try
+ {
+ int tagId;
+ if (!int.TryParse(e.CommandArgument.ToString(), out tagId))
+ return;
+
+ List tags = ViewState["Tags"] as List;
+ if (tags == null) return;
+
+ int i = tags.FindIndex(x => x.TagID == tagId);
+ if (i >= 0) tags.RemoveAt(i);
+
+ ViewState["Tags"] = tags;
+ gvPolicy.DataSource = tags;
+ gvPolicy.DataBind();
+ UpdateTags();
+ }
+ catch (Exception)
+ {
+ }
+
+ break;
+
+ }
+ }
+
+ protected void bntAddTag_Click(object sender, EventArgs e)
+ {
+ int addTagId;
+ if (!int.TryParse(ddTags.SelectedValue, out addTagId))
+ return;
+
+ Providers.HostedSolution.ExchangeRetentionPolicyTag tag = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTag(PanelRequest.ItemID, addTagId);
+ if (tag == null) return;
+
+ List res = ViewState["Tags"] as List;
+ if (res == null) res = new List();
+
+ ExchangeMailboxPlanRetentionPolicyTag add = new ExchangeMailboxPlanRetentionPolicyTag();
+ add.MailboxPlanId = PanelRequest.GetInt("MailboxPlanId");
+ add.TagID = tag.TagID;
+ add.TagName = tag.TagName;
+
+ res.Add(add);
+
+ ViewState["Tags"] = res;
+
+ gvPolicy.DataSource = res;
+ gvPolicy.DataBind();
+
+ UpdateTags();
+ }
+
+ protected void UpdateTags()
+ {
+ if (RetentionPolicy)
+ {
+ ddTags.Items.Clear();
+
+ Providers.HostedSolution.Organization[] orgs = null;
+
+ if (PanelSecurity.SelectedUserId != 1)
+ {
+ PackageInfo[] Packages = ES.Services.Packages.GetPackages(PanelSecurity.SelectedUserId);
+
+ if ((Packages != null) & (Packages.GetLength(0) > 0))
+ {
+ orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(Packages[0].PackageId, false);
+ }
+ }
+ else
+ {
+ orgs = ES.Services.ExchangeServer.GetExchangeOrganizations(1, false);
+ }
+
+ if ((orgs != null) & (orgs.GetLength(0) > 0))
+ {
+ Providers.HostedSolution.ExchangeRetentionPolicyTag[] allTags = ES.Services.ExchangeServer.GetExchangeRetentionPolicyTags(orgs[0].Id);
+ List selectedTags = ViewState["Tags"] as List;
+
+ foreach (Providers.HostedSolution.ExchangeRetentionPolicyTag tag in allTags)
+ {
+ if (selectedTags != null)
+ {
+ if (selectedTags.Find(x => x.TagID == tag.TagID) != null)
+ continue;
+ }
+
+ ddTags.Items.Add(new System.Web.UI.WebControls.ListItem(tag.TagName, tag.TagID.ToString()));
+ }
+ }
+
+ }
+ }
+
+ protected void SaveTags(int ItemId, int planId)
+ {
+ ExchangeMailboxPlanRetentionPolicyTag[] currenttags = ES.Services.ExchangeServer.GetExchangeMailboxPlanRetentionPolicyTags(planId);
+ foreach (ExchangeMailboxPlanRetentionPolicyTag tag in currenttags)
+ ES.Services.ExchangeServer.DeleteExchangeMailboxPlanRetentionPolicyTag(ItemId, planId, tag.PlanTagID);
+
+ List tags = ViewState["Tags"] as List;
+ if (tags != null)
+ {
+ foreach (ExchangeMailboxPlanRetentionPolicyTag tag in tags)
+ {
+ tag.MailboxPlanId = planId;
+ int result = ES.Services.ExchangeServer.AddExchangeMailboxPlanRetentionPolicyTag(ItemId, tag);
+ if (result < 0)
+ {
+ messageBox.ShowResultMessage(result);
+ return;
+ }
+ }
+ }
+
+ }
+
}
}
\ No newline at end of file
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 401575ee..6459f5b0 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsExchangeMailboxPlansPolicy.ascx.designer.cs
@@ -138,15 +138,6 @@ 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.
///
@@ -462,6 +453,123 @@ namespace WebsitePanel.Portal {
///
protected global::System.Web.UI.WebControls.TextBox txtLitigationHoldMsg;
+ ///
+ /// secArchiving control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.CollapsiblePanel secArchiving;
+
+ ///
+ /// Archiving control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel Archiving;
+
+ ///
+ /// 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;
+
+ ///
+ /// locArchiveQuota control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Localize locArchiveQuota;
+
+ ///
+ /// archiveQuota control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.QuotaEditor archiveQuota;
+
+ ///
+ /// locArchiveWarningQuota control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Localize locArchiveWarningQuota;
+
+ ///
+ /// archiveWarningQuota control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox archiveWarningQuota;
+
+ ///
+ /// secRetentionPolicyTags control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::WebsitePanel.Portal.CollapsiblePanel secRetentionPolicyTags;
+
+ ///
+ /// RetentionPolicyTags control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Panel RetentionPolicyTags;
+
+ ///
+ /// GeneralUpdatePanel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.UpdatePanel GeneralUpdatePanel;
+
+ ///
+ /// gvPolicy control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.GridView gvPolicy;
+
+ ///
+ /// ddTags control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.DropDownList ddTags;
+
+ ///
+ /// bntAddTag control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Button bntAddTag;
+
///
/// btnAddMailboxPlan control.
///
|