diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs
index 27a541d6..865e8665 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.cs
@@ -128,23 +128,35 @@ namespace WebsitePanel.Portal.HostedSolution
if (user.LevelId > 0 && secServiceLevels.Visible)
{
+ secServiceLevels.IsCollapsed = false;
+
ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(user.LevelId);
+ litServiceLevel.Visible = true;
+ litServiceLevel.Text = serviceLevel.LevelName;
+ litServiceLevel.ToolTip = serviceLevel.LevelDescription;
+
bool addLevel = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) == null;
addLevel = addLevel && cntx.Quotas.ContainsKey(Quotas.SERVICE_LEVELS + serviceLevel.LevelName);
- addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue > 0 : addLevel;
+ addLevel = addLevel ? cntx.Quotas[Quotas.SERVICE_LEVELS + serviceLevel.LevelName].QuotaAllocatedValue != 0 : addLevel;
if (addLevel)
{
ddlServiceLevels.Items.Add(new ListItem(serviceLevel.LevelName, serviceLevel.LevelId.ToString()));
+ }
+ bool levelInDDL = ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()) != null;
+
+ if (levelInDDL)
+ {
ddlServiceLevels.Items.FindByValue(string.Empty).Selected = false;
ddlServiceLevels.Items.FindByValue(serviceLevel.LevelId.ToString()).Selected = true;
}
}
chkVIP.Checked = user.IsVIP && secServiceLevels.Visible;
+ imgVipUser.Visible = user.IsVIP && secServiceLevels.Visible;
if (cntx.Quotas.ContainsKey(Quotas.ORGANIZATION_ALLOWCHANGEUPN))
@@ -235,7 +247,7 @@ namespace WebsitePanel.Portal.HostedSolution
{
foreach (var serviceLevel in ES.Services.Organizations.GetSupportServiceLevels())
{
- if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value, serviceLevel.LevelId))
+ if (quota.Key.Replace(Quotas.SERVICE_LEVELS, "") == serviceLevel.LevelName && CheckServiceLevelQuota(quota.Value))
{
enabledServiceLevels.Add(serviceLevel);
}
@@ -256,9 +268,8 @@ namespace WebsitePanel.Portal.HostedSolution
}
- private bool CheckServiceLevelQuota(QuotaValueInfo quota, int levelID)
+ private bool CheckServiceLevelQuota(QuotaValueInfo quota)
{
- quota.QuotaUsedValue = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true).Where(x => x.LevelId == levelID).Count();
if (quota.QuotaAllocatedValue != -1)
{
@@ -322,6 +333,18 @@ namespace WebsitePanel.Portal.HostedSolution
if (!chkLocked.Checked)
chkLocked.Enabled = false;
+ litServiceLevel.Visible = !string.IsNullOrEmpty(ddlServiceLevels.SelectedValue) && secServiceLevels.Visible;
+ if (litServiceLevel.Visible)
+ {
+ ServiceLevel serviceLevel = ES.Services.Organizations.GetSupportServiceLevel(int.Parse(ddlServiceLevels.SelectedValue));
+
+ litServiceLevel.Text = serviceLevel.LevelName;
+ litServiceLevel.ToolTip = serviceLevel.LevelDescription;
+ }
+
+ imgVipUser.Visible = chkVIP.Checked && secServiceLevels.Visible;
+
+
messageBox.ShowSuccessMessage("ORGANIZATION_UPDATE_USER_SETTINGS");
}
catch (Exception ex)
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs
index a68bb55e..fef1a739 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUserGeneralSettings.ascx.designer.cs
@@ -48,6 +48,24 @@ namespace WebsitePanel.Portal.HostedSolution {
///
protected global::System.Web.UI.WebControls.Literal litDisplayName;
+ ///
+ /// imgVipUser control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Image imgVipUser;
+
+ ///
+ /// litServiceLevel control.
+ ///
+ ///
+ /// Auto-generated field.
+ /// To modify move field declaration from designer file to code-behind file.
+ ///
+ protected global::System.Web.UI.WebControls.Label litServiceLevel;
+
///
/// UserTabsId control.
///
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
index 6b8ba886..0f3c717e 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx
@@ -109,9 +109,25 @@
-
-
-
+
+
+
+
+
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
index ffe51701..6c15a98a 100644
--- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
+++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationUsers.ascx.cs
@@ -43,6 +43,8 @@ namespace WebsitePanel.Portal.HostedSolution
protected void Page_Load(object sender, EventArgs e)
{
+ cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
+
if (!IsPostBack)
{
BindStats();
@@ -50,7 +52,6 @@ namespace WebsitePanel.Portal.HostedSolution
BindServiceLevels();
- cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (cntx.Quotas.ContainsKey(Quotas.EXCHANGE2007_ISCONSUMER))
{
if (cntx.Quotas[Quotas.EXCHANGE2007_ISCONSUMER].QuotaAllocatedValue != 1)
@@ -74,6 +75,32 @@ namespace WebsitePanel.Portal.HostedSolution
usersQuota.QuotaUsedValue = stats.CreatedUsers;
usersQuota.QuotaValue = stats.AllocatedUsers;
if (stats.AllocatedUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedUsers - tenantStats.CreatedUsers;
+
+ if(cntx != null && cntx.Groups.ContainsKey(ResourceGroups.ServiceLevels)) BindServiceLevelsStats();
+ }
+
+ private void BindServiceLevelsStats()
+ {
+ ServiceLevels = ES.Services.Organizations.GetSupportServiceLevels();
+ OrganizationUser[] accounts = ES.Services.Organizations.SearchAccounts(PanelRequest.ItemID, "", "", "", true);
+
+ List