Mailboxplans: New control assigned to those attributes that can be set

to unlimited
This commit is contained in:
robvde 2012-09-04 22:17:20 +04:00
parent 92133e2c20
commit 69bee32868
8 changed files with 100 additions and 110 deletions

View file

@ -169,16 +169,16 @@
<value>Keep deleted items for:</value>
</data>
<data name="locMailboxSize.Text" xml:space="preserve">
<value>Mailbox size:</value>
<value>Mailbox size (Mb):</value>
</data>
<data name="locMaxReceiveMessageSizeKB.Text" xml:space="preserve">
<value>Maximum Receive Message Size:</value>
<value>Maximum Receive Message Size (Kb):</value>
</data>
<data name="locMaxRecipients.Text" xml:space="preserve">
<value>Maximum Recipients:</value>
</data>
<data name="locMaxSendMessageSizeKB.Text" xml:space="preserve">
<value>Maximum Send Message Size:</value>
<value>Maximum Send Message Size (Kb):</value>
</data>
<data name="locProhibitSend.Text" xml:space="preserve">
<value>Prohibit send at:</value>

View file

@ -151,16 +151,16 @@
<value>Keep deleted items for:</value>
</data>
<data name="locMailboxSize.Text" xml:space="preserve">
<value>Mailbox size:</value>
<value>Mailbox size (Mb):</value>
</data>
<data name="locMaxReceiveMessageSizeKB.Text" xml:space="preserve">
<value>Maximum Receive Message Size:</value>
<value>Maximum Receive Message Size (Kb):</value>
</data>
<data name="locMaxRecipients.Text" xml:space="preserve">
<value>Maximum Recipients:</value>
</data>
<data name="locMaxSendMessageSizeKB.Text" xml:space="preserve">
<value>Maximum Send Message Size:</value>
<value>Maximum Send Message Size (Kb):</value>
</data>
<data name="locProhibitSend.Text" xml:space="preserve">
<value>Prohibit send at:</value>

View file

@ -6,6 +6,7 @@
<%@ Register Src="UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/QuotaEditor.ascx" TagName="QuotaEditor" TagPrefix="uc1" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
@ -101,25 +102,49 @@
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td>
<td>
<wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false"/>
<div class="Right">
<uc1:QuotaEditor id="mailboxSize" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxRecipients" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxSendMessageSizeKB" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxReceiveMessageSizeKB" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>

View file

@ -46,14 +46,10 @@ namespace WebsitePanel.Portal.ExchangeServer
{
Providers.HostedSolution.ExchangeMailboxPlan plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(PanelRequest.ItemID, PanelRequest.GetInt("MailboxPlanId"));
txtMailboxPlan.Text = plan.MailboxPlan;
if (plan.MailboxSizeMB != -1)
mailboxSize.ValueKB = plan.MailboxSizeMB;
if (plan.MaxRecipients != -1)
maxRecipients.ValueKB = plan.MaxRecipients;
if (plan.MaxSendMessageSizeKB != -1)
maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB;
if (plan.MaxReceiveMessageSizeKB != -1)
maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB;
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;
@ -99,39 +95,24 @@ namespace WebsitePanel.Portal.ExchangeServer
switch (quota.QuotaId)
{
case 77:
if (quota.QuotaAllocatedValue != -1)
{
mailboxSize.RequireValidatorEnabled = true;
}
else
mailboxSize.RequireValidatorEnabled = false;
break;
case 365:
if (quota.QuotaAllocatedValue != -1)
{
maxRecipients.ValueKB = quota.QuotaAllocatedValue;
maxRecipients.RequireValidatorEnabled = true;
maxRecipients.QuotaValue = quota.QuotaAllocatedValue;
}
else
maxRecipients.RequireValidatorEnabled = false;
break;
case 366:
if (quota.QuotaAllocatedValue != -1)
{
maxSendMessageSizeKB.ValueKB = quota.QuotaAllocatedValue;
maxSendMessageSizeKB.RequireValidatorEnabled = true;
maxSendMessageSizeKB.QuotaValue = quota.QuotaAllocatedValue;
}
else
maxSendMessageSizeKB.RequireValidatorEnabled = false;
break;
case 367:
if (quota.QuotaAllocatedValue != -1)
{
maxReceiveMessageSizeKB.ValueKB = quota.QuotaAllocatedValue;
maxReceiveMessageSizeKB.RequireValidatorEnabled = true;
maxReceiveMessageSizeKB.QuotaValue = quota.QuotaAllocatedValue;
}
else
maxReceiveMessageSizeKB.RequireValidatorEnabled = false;
break;
case 83:
chkPOP3.Checked = Convert.ToBoolean(quota.QuotaAllocatedValue);
@ -183,12 +164,12 @@ namespace WebsitePanel.Portal.ExchangeServer
Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB;
plan.MailboxSizeMB = mailboxSize.QuotaValue;
plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB;
plan.MaxRecipients = maxRecipients.QuotaValue;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
plan.EnablePOP = chkPOP3.Checked;
plan.EnableIMAP = chkIMAP.Checked;
plan.EnableOWA = chkOWA.Checked;

View file

@ -226,7 +226,7 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox mailboxSize;
protected global::WebsitePanel.Portal.QuotaEditor mailboxSize;
/// <summary>
/// locMaxRecipients control.
@ -244,7 +244,7 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxRecipients;
protected global::WebsitePanel.Portal.QuotaEditor maxRecipients;
/// <summary>
/// locMaxSendMessageSizeKB control.
@ -262,7 +262,7 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxSendMessageSizeKB;
protected global::WebsitePanel.Portal.QuotaEditor maxSendMessageSizeKB;
/// <summary>
/// locMaxReceiveMessageSizeKB control.
@ -280,7 +280,7 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxReceiveMessageSizeKB;
protected global::WebsitePanel.Portal.QuotaEditor maxReceiveMessageSizeKB;
/// <summary>
/// locWhenSizeExceeds control.
@ -398,14 +398,5 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
/// <summary>
/// FormComments 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 FormComments;
}
}

View file

@ -4,6 +4,7 @@
<%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %>
<%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
<%@ Register Src="UserControls/QuotaEditor.ascx" TagName="QuotaEditor" TagPrefix="uc1" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server"/>
@ -128,25 +129,49 @@
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMailboxSize" runat="server" meta:resourcekey="locMailboxSize" Text="Mailbox size:"></asp:Localize></td>
<td>
<wsp:SizeBox id="mailboxSize" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="true" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
<div class="Right">
<uc1:QuotaEditor id="mailboxSize" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxRecipients" runat="server" meta:resourcekey="locMaxRecipients" Text="Maximum Recipients:"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxRecipients" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="false" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxRecipients" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxSendMessageSizeKB" runat="server" meta:resourcekey="locMaxSendMessageSizeKB" Text="Maximum Send Message Size (Kb):"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxSendMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxSendMessageSizeKB" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxReceiveMessageSizeKB" runat="server" meta:resourcekey="locMaxReceiveMessageSizeKB" Text="Maximum Receive Message Size (Kb):"></asp:Localize></td>
<td>
<wsp:SizeBox id="maxReceiveMessageSizeKB" runat="server" ValidationGroup="CreateMailboxPlan" DisplayUnitsKB="true" DisplayUnitsMB="false" DisplayUnitsPct="false" RequireValidatorEnabled="false"/>
<div class="Right">
<uc1:QuotaEditor id="maxReceiveMessageSizeKB" runat="server"
QuotaTypeID="2"
QuotaValue="0"
ParentQuotaValue="-1">
</uc1:QuotaEditor>
</div>
</td>
</tr>

View file

@ -101,12 +101,12 @@ namespace WebsitePanel.Portal
Providers.HostedSolution.ExchangeMailboxPlan plan = new Providers.HostedSolution.ExchangeMailboxPlan();
plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB;
plan.MailboxSizeMB = mailboxSize.QuotaValue;
plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB;
plan.MaxRecipients = maxRecipients.QuotaValue;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
plan.EnablePOP = chkPOP3.Checked;
plan.EnableIMAP = chkIMAP.Checked;
plan.EnableOWA = chkOWA.Checked;
@ -204,10 +204,10 @@ namespace WebsitePanel.Portal
ViewState["MailboxPlanID"] = null;
txtMailboxPlan.Text = string.Empty;
mailboxSize.ValueKB = -1;
maxRecipients.ValueKB = -1;
maxSendMessageSizeKB.ValueKB = -1;
maxReceiveMessageSizeKB.ValueKB = 01;
mailboxSize.QuotaValue = 0;
maxRecipients.QuotaValue = 0;
maxSendMessageSizeKB.QuotaValue = 0;
maxReceiveMessageSizeKB.QuotaValue = 0;
chkPOP3.Checked = false;
chkIMAP.Checked = false;
chkOWA.Checked = false;
@ -251,14 +251,10 @@ namespace WebsitePanel.Portal
plan = ES.Services.ExchangeServer.GetExchangeMailboxPlan(orgs[0].Id, mailboxPlanId);
txtMailboxPlan.Text = plan.MailboxPlan;
if (plan.MailboxSizeMB != -1)
mailboxSize.ValueKB = plan.MailboxSizeMB;
if (plan.MaxRecipients != -1)
maxRecipients.ValueKB = plan.MaxRecipients;
if (plan.MaxSendMessageSizeKB != -1)
maxSendMessageSizeKB.ValueKB = plan.MaxSendMessageSizeKB;
if (plan.MaxReceiveMessageSizeKB != -1)
maxReceiveMessageSizeKB.ValueKB = plan.MaxReceiveMessageSizeKB;
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;
@ -354,12 +350,12 @@ namespace WebsitePanel.Portal
plan.MailboxPlanId = (int)ViewState["MailboxPlanID"];
plan.MailboxPlan = txtMailboxPlan.Text;
plan.MailboxSizeMB = mailboxSize.ValueKB;
plan.MailboxSizeMB = mailboxSize.QuotaValue;
plan.IsDefault = false;
plan.MaxRecipients = maxRecipients.ValueKB;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.ValueKB;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.ValueKB;
plan.MaxRecipients = maxRecipients.QuotaValue;
plan.MaxSendMessageSizeKB = maxSendMessageSizeKB.QuotaValue;
plan.MaxReceiveMessageSizeKB = maxReceiveMessageSizeKB.QuotaValue;
plan.EnablePOP = chkPOP3.Checked;
plan.EnableIMAP = chkIMAP.Checked;
plan.EnableOWA = chkOWA.Checked;

View file

@ -1,32 +1,4 @@
// Copyright (c) 2012, 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>
// This code was generated by a tool.
//
@ -227,7 +199,7 @@ namespace WebsitePanel.Portal {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox mailboxSize;
protected global::WebsitePanel.Portal.QuotaEditor mailboxSize;
/// <summary>
/// locMaxRecipients control.
@ -245,7 +217,7 @@ namespace WebsitePanel.Portal {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxRecipients;
protected global::WebsitePanel.Portal.QuotaEditor maxRecipients;
/// <summary>
/// locMaxSendMessageSizeKB control.
@ -263,7 +235,7 @@ namespace WebsitePanel.Portal {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxSendMessageSizeKB;
protected global::WebsitePanel.Portal.QuotaEditor maxSendMessageSizeKB;
/// <summary>
/// locMaxReceiveMessageSizeKB control.
@ -281,7 +253,7 @@ namespace WebsitePanel.Portal {
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.SizeBox maxReceiveMessageSizeKB;
protected global::WebsitePanel.Portal.QuotaEditor maxReceiveMessageSizeKB;
/// <summary>
/// locWhenSizeExceeds control.