Exchange Shared and Resource mailboxes : AccountType fix

This commit is contained in:
dev_amdtel 2014-11-27 19:10:06 +04:00
parent f54b1b8466
commit b4ce9904b4
13 changed files with 43 additions and 32 deletions

View file

@ -6122,9 +6122,9 @@ END
IF -1 IN (SELECT B.MailboxSizeMB FROM ExchangeAccounts AS A INNER JOIN ExchangeMailboxPlans AS B ON A.MailboxPlanId = B.MailboxPlanId WHERE A.ItemID=@ItemID)
BEGIN
SELECT
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 10) AND ItemID = @ItemID) AS CreatedSharedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 11) AND ItemID = @ItemID) AS CreatedResourceMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedResourceMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders,
@ -6136,9 +6136,9 @@ END
ELSE
BEGIN
SELECT
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1 OR AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 1) AND ItemID = @ItemID) AS CreatedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 10) AND ItemID = @ItemID) AS CreatedSharedMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 11) AND ItemID = @ItemID) AS CreatedResourceMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE (AccountType = 5 OR AccountType = 6) AND ItemID = @ItemID) AS CreatedResourceMailboxes,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 2 AND ItemID = @ItemID) AS CreatedContacts,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 3 AND ItemID = @ItemID) AS CreatedDistributionLists,
(SELECT COUNT(*) FROM ExchangeAccounts WHERE AccountType = 4 AND ItemID = @ItemID) AS CreatedPublicFolders,

View file

@ -1679,7 +1679,7 @@ namespace WebsitePanel.EnterpriseServer
if ((orgStats.AllocatedSharedMailboxes > -1) && (orgStats.CreatedSharedMailboxes >= orgStats.AllocatedSharedMailboxes))
return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT;
}
else if (accountType == ExchangeAccountType.ResourceMailbox)
else if ((accountType == ExchangeAccountType.Room) || (accountType == ExchangeAccountType.Equipment))
{
if ((orgStats.AllocatedResourceMailboxes > -1) && (orgStats.CreatedResourceMailboxes >= orgStats.AllocatedResourceMailboxes))
return BusinessErrorCodes.ERROR_EXCHANGE_MAILBOXES_QUOTA_LIMIT;

View file

@ -40,7 +40,6 @@ namespace WebsitePanel.Providers.HostedSolution
User = 7,
SecurityGroup = 8,
DefaultSecurityGroup = 9,
SharedMailbox = 10,
ResourceMailbox = 11
SharedMailbox = 10
}
}

View file

@ -1944,8 +1944,6 @@ namespace WebsitePanel.Providers.HostedSolution
cmd.Parameters.Add("Room");
else if (accountType == ExchangeAccountType.SharedMailbox)
cmd.Parameters.Add("Shared");
else if (accountType == ExchangeAccountType.ResourceMailbox)
cmd.Parameters.Add("Equipment");
result = ExecuteShellCommand(runSpace, cmd);

View file

@ -371,8 +371,6 @@ namespace WebsitePanel.Providers.HostedSolution
cmd.Parameters.Add("Room");
else if (accountType == ExchangeAccountType.SharedMailbox)
cmd.Parameters.Add("Shared");
else if (accountType == ExchangeAccountType.ResourceMailbox)
cmd.Parameters.Add("Equipment");
result = ExecuteShellCommand(runSpace, cmd);

View file

@ -5599,10 +5599,13 @@
<data name="Quota.Exchange2013.SharedMailboxes" xml:space="preserve">
<value>Shared Mailboxes per Organization</value>
</data>
<data name="ResourceMailbox.Text" xml:space="preserve">
<value> (resource mailbox)</value>
<data name="RoomMailbox.Text" xml:space="preserve">
<value> (room mailbox)</value>
</data>
<data name="SharedMailbox.Text" xml:space="preserve">
<value> (shared mailbox)</value>
</data>
<data name="EquipmentMailbox.Text" xml:space="preserve">
<value> (equipment mailbox)</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 B

View file

@ -186,9 +186,6 @@
<data name="valRequireSubscriberNumber.Text" xml:space="preserve">
<value>*</value>
</data>
<data name="ResourceMailbox.Text" xml:space="preserve">
<value>Resource Mailbox</value>
</data>
<data name="SharedMailbox.Text" xml:space="preserve">
<value>Shared Mailbox</value>
</data>

View file

@ -91,29 +91,36 @@ namespace WebsitePanel.Portal.ExchangeServer
if (plans.Length == 0)
btnCreate.Enabled = false;
bool allowResourceMailbox = false;
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER))
{
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
{
locSubscriberNumber.Visible = txtSubscriberNumber.Visible = valRequireSubscriberNumber.Enabled = false;
allowResourceMailbox = true;
}
}
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2013_RESOURCEMAILBOXES))
{
if (cntx.Quotas[Quotas.EXCHANGE2013_RESOURCEMAILBOXES].QuotaAllocatedValue != 0)
allowResourceMailbox = true;
}
if (allowResourceMailbox)
{
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("RoomMailbox.Text"), "5"));
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("EquipmentMailbox.Text"), "6"));
}
}
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2013_SHAREDMAILBOXES))
{
if (cntx.Quotas[Quotas.EXCHANGE2013_SHAREDMAILBOXES].QuotaAllocatedValue != 0)
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("SharedMailbox.Text"), "10"));
}
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2013_RESOURCEMAILBOXES))
{
if (cntx.Quotas[Quotas.EXCHANGE2013_RESOURCEMAILBOXES].QuotaAllocatedValue != 0)
rbMailboxType.Items.Add(new System.Web.UI.WebControls.ListItem(GetLocalizedString("ResourceMailbox.Text"), "11"));
}
rowRetentionPolicy.Visible = Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, cntx);
}

View file

@ -186,8 +186,11 @@ namespace WebsitePanel.Portal.ExchangeServer
if (account.AccountType == ExchangeAccountType.SharedMailbox)
litDisplayName.Text += GetSharedLocalizedString("SharedMailbox.Text");
if (account.AccountType == ExchangeAccountType.ResourceMailbox)
litDisplayName.Text += GetSharedLocalizedString("ResourceMailbox.Text");
if (account.AccountType == ExchangeAccountType.Room)
litDisplayName.Text += GetSharedLocalizedString("RoomMailbox.Text");
if (account.AccountType == ExchangeAccountType.Equipment)
litDisplayName.Text += GetSharedLocalizedString("EquipmentMailbox.Text");
}
catch (Exception ex)

View file

@ -74,8 +74,11 @@ namespace WebsitePanel.Portal.ExchangeServer
if (account.AccountType == ExchangeAccountType.SharedMailbox)
litDisplayName.Text += GetSharedLocalizedString("SharedMailbox.Text");
if (account.AccountType == ExchangeAccountType.ResourceMailbox)
litDisplayName.Text += GetSharedLocalizedString("ResourceMailbox.Text");
if (account.AccountType == ExchangeAccountType.Room)
litDisplayName.Text += GetSharedLocalizedString("RoomMailbox.Text");
if (account.AccountType == ExchangeAccountType.Equipment)
litDisplayName.Text += GetSharedLocalizedString("EquipmentMailbox.Text");
}
catch (Exception ex)

View file

@ -108,7 +108,7 @@
OnSelected="odsAccountsPaged_Selected">
<SelectParameters>
<asp:QueryStringParameter Name="itemId" QueryStringField="ItemID" DefaultValue="0" />
<asp:Parameter Name="accountTypes" DefaultValue="1,5,6,10,11" />
<asp:Parameter Name="accountTypes" DefaultValue="1,5,6,10" />
<asp:ControlParameter Name="filterColumn" ControlID="ddlSearchColumn" PropertyName="SelectedValue" />
<asp:ControlParameter Name="filterValue" ControlID="txtSearchValue" PropertyName="Text" />
<asp:Parameter Name="archiving" Type="Boolean" />

View file

@ -151,6 +151,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
ExchangeAccountType accountType = (ExchangeAccountType)accountTypeId;
string imgName = "mailbox_16.gif";
if (accountType == ExchangeAccountType.Contact)
imgName = "contact_16.gif";
else if (accountType == ExchangeAccountType.DistributionList)
@ -159,6 +160,8 @@ namespace WebsitePanel.Portal.ExchangeServer
imgName = "room_16.gif";
else if (accountType == ExchangeAccountType.Equipment)
imgName = "equipment_16.gif";
else if (accountType == ExchangeAccountType.SharedMailbox)
imgName = "shared_16.gif";
if (vip && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) imgName = "vip_user_16.png";
@ -259,13 +262,13 @@ namespace WebsitePanel.Portal.ExchangeServer
chkMailboxes.Checked = true;
if (chkMailboxes.Checked)
accountTypes.AddRange(new string[] {"1","5","6"});
accountTypes.Add("1");
if (chkSharedMailboxes.Checked)
accountTypes.Add("10");
if (chkResourceMailboxes.Checked)
accountTypes.Add("11");
accountTypes.AddRange(new string[] {"5","6"});
odsAccountsPaged.SelectParameters["accountTypes"].DefaultValue = string.Join(",", accountTypes);
}