This commit is contained in:
Virtuworks 2013-12-03 15:59:39 -05:00
commit bfc44c2648
13 changed files with 92 additions and 24 deletions

View file

@ -270,6 +270,7 @@ namespace WebsitePanel.EnterpriseServer
PackageContext cntx = PackageController.GetPackageContext(org.PackageId); PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
int maxDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue; int maxDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
if (maxDBSize != -1) maxDBSize = maxDBSize * 1024 * 1024;
org.CrmAdministratorId = user.AccountId; org.CrmAdministratorId = user.AccountId;
org.CrmCurrency = org.CrmCurrency =
@ -1011,7 +1012,8 @@ namespace WebsitePanel.EnterpriseServer
} }
if (!quotaRes.Value) if (!quotaRes.Value)
{ {
CompleteTask(res, CrmErrorCodes.USER_QUOTA_HAS_BEEN_REACHED, null, "CRM user quota has been reached."); CompleteTask(res, CrmErrorCodes.USER_QUOTA_HAS_BEEN_REACHED + CALType.ToString(), null, "CRM user quota " +
(CALType==0 ? "(full license)" : "(limited license)") +" has been reached.");
return res; return res;
} }
@ -1159,6 +1161,7 @@ namespace WebsitePanel.EnterpriseServer
if (limitSize != -1) if (limitSize != -1)
{ {
limitSize = limitSize * 1024 * 1024;
if (maxSize == -1) maxSize = limitSize; if (maxSize == -1) maxSize = limitSize;
if (maxSize > limitSize) maxSize = limitSize; if (maxSize > limitSize) maxSize = limitSize;
} }

View file

@ -1520,6 +1520,8 @@ namespace WebsitePanel.Providers.HostedSolution
return res; return res;
} }
static string excludedRolesStr = ";пользователь поддержки;support user;";
private static List<CrmRole> FillCrmRoles(EntityCollection entities, bool isUserRole, Guid businessUnitId) private static List<CrmRole> FillCrmRoles(EntityCollection entities, bool isUserRole, Guid businessUnitId)
{ {
List<CrmRole> res = new List<CrmRole>(); List<CrmRole> res = new List<CrmRole>();
@ -1536,10 +1538,16 @@ namespace WebsitePanel.Providers.HostedSolution
continue; continue;
} }
string roleName = role.Name;
if (roleName!=null)
if (excludedRolesStr.IndexOf(";" + roleName.ToLower() + ";") != -1)
continue;
CrmRole crmRole = new CrmRole(); CrmRole crmRole = new CrmRole();
crmRole.IsCurrentUserRole = isUserRole; crmRole.IsCurrentUserRole = isUserRole;
crmRole.RoleId = (Guid)role.RoleId; crmRole.RoleId = (Guid)role.RoleId;
crmRole.RoleName = role.Name; crmRole.RoleName = roleName;
res.Add(crmRole); res.Add(crmRole);
} }

View file

@ -3643,8 +3643,8 @@
<data name="HostedCRM.CANONT_GET_CRM_USER_GENERAL_ERROR" xml:space="preserve"> <data name="HostedCRM.CANONT_GET_CRM_USER_GENERAL_ERROR" xml:space="preserve">
<value>General error has been occurred while getting crm user.</value> <value>General error has been occurred while getting crm user.</value>
</data> </data>
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED" xml:space="preserve"> <data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED0" xml:space="preserve">
<value>CRM users quota has been reached.</value> <value>CRM users quota (full license) has been reached.</value>
</data> </data>
<data name="HostedCRM.CANNOT_ADD_ORGANIZATION_OWNER_TO_ORGANIZATIO_USER" xml:space="preserve"> <data name="HostedCRM.CANNOT_ADD_ORGANIZATION_OWNER_TO_ORGANIZATIO_USER" xml:space="preserve">
<value>Unable to add organization owner to organization users.</value> <value>Unable to add organization owner to organization users.</value>
@ -5371,4 +5371,7 @@
<data name="Quota.HostedCRM.MaxDatabaseSize" xml:space="preserve"> <data name="Quota.HostedCRM.MaxDatabaseSize" xml:space="preserve">
<value>Max Database Size, MB</value> <value>Max Database Size, MB</value>
</data> </data>
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2" xml:space="preserve">
<value>CRM users quota (limited license) has been reached.</value>
</data>
</root> </root>

View file

@ -41,6 +41,11 @@
<td class="FormLabel200" align="right"><asp:Localize runat="server" meta:resourcekey="locUsageStorage" >Current usage (MB):</asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize runat="server" meta:resourcekey="locUsageStorage" >Current usage (MB):</asp:Localize></td>
<td> <td>
<asp:Label ID="lblDBSize" runat="server" Text="0" /> of <asp:Label ID="lblMAXDBSize" runat="server" Text="0" /> <asp:Label ID="lblDBSize" runat="server" Text="0" /> of <asp:Label ID="lblMAXDBSize" runat="server" Text="0" />
</tr>
<tr>
<td class="FormLabel200" align="right"><asp:Localize runat="server" meta:resourcekey="locLimitStorage" >Maximum allowed (MB):</asp:Localize></td>
<td>
<asp:Label ID="lblLimitDBSize" runat="server" Text="0" />
</tr> </tr>
<tr> <tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxStorage" runat="server" meta:resourcekey="locMaxStorage" >Reassign storage space (MB):</asp:Localize></td> <td class="FormLabel200" align="right"><asp:Localize ID="locMaxStorage" runat="server" meta:resourcekey="locMaxStorage" >Reassign storage space (MB):</asp:Localize></td>

View file

@ -54,7 +54,9 @@ namespace WebsitePanel.Portal
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID); Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId); PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
maxStorageSettingsValue.ParentQuotaValue = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue; int limitDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
//maxStorageSettingsValue.ParentQuotaValue = limitDBSize;
maxStorageSettingsValue.ParentQuotaValue = -1;
long maxDBSize = ES.Services.CRM.GetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId); long maxDBSize = ES.Services.CRM.GetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
long DBSize = ES.Services.CRM.GetDBSize(PanelRequest.ItemID, PanelSecurity.PackageId); long DBSize = ES.Services.CRM.GetDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
@ -66,6 +68,8 @@ namespace WebsitePanel.Portal
lblDBSize.Text = SizeValueToString(DBSize); lblDBSize.Text = SizeValueToString(DBSize);
lblMAXDBSize.Text = SizeValueToString(maxDBSize); lblMAXDBSize.Text = SizeValueToString(maxDBSize);
lblLimitDBSize.Text = SizeValueToString(limitDBSize);
} }
private void Save() private void Save()

View file

@ -121,6 +121,15 @@ namespace WebsitePanel.Portal {
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Label lblMAXDBSize; protected global::System.Web.UI.WebControls.Label lblMAXDBSize;
/// <summary>
/// lblLimitDBSize 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.Label lblLimitDBSize;
/// <summary> /// <summary>
/// locMaxStorage control. /// locMaxStorage control.
/// </summary> /// </summary>

View file

@ -125,9 +125,9 @@ namespace WebsitePanel.Portal.CRM
CALType); CALType);
if (!res2.IsSuccess) if (!res2.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES"); messageBox.ShowMessage(res2, "UPDATE_CRM_USER_ROLES", "HostedCRM");
else if (!res.IsSuccess) else if (!res.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES"); messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
else else
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM"); messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
} }

View file

@ -224,7 +224,7 @@
</tr> </tr>
<tr class="OrgStatsRow"> <tr class="OrgStatsRow">
<td align="right" nowrap> <td align="right" nowrap>
<asp:Localize ID="locCRMDBSize" runat="server" meta:resourcekey="locCRMDBSize" Text="Storage size (ÌÂ):"></asp:Localize> <asp:HyperLink ID="lnkCRMDBSize" runat="server" meta:resourcekey="lnkCRMDBSize" Text="Storage size (ÌÂ):"></asp:HyperLink>
</td> </td>
<td> <td>
<wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" /> <wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />

View file

@ -248,6 +248,9 @@ namespace WebsitePanel.Portal.ExchangeServer
lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl; lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
lnkCRMDBSize.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crm_storage_settings",
"SpaceID=" + PanelSecurity.PackageId);
crmUsersStats.QuotaUsedValue = stats.CreatedCRMUsers; crmUsersStats.QuotaUsedValue = stats.CreatedCRMUsers;
crmUsersStats.QuotaValue = stats.AllocatedCRMUsers; crmUsersStats.QuotaValue = stats.AllocatedCRMUsers;

View file

@ -554,13 +554,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats; protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats;
/// <summary> /// <summary>
/// locCRMDBSize control. /// lnkCRMDBSize control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Localize locCRMDBSize; protected global::System.Web.UI.WebControls.HyperLink lnkCRMDBSize;
/// <summary> /// <summary>
/// crmDBSize control. /// crmDBSize control.

View file

@ -1,6 +1,7 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationUserSetupInstructions.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationUserSetupInstructions" %> <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="OrganizationUserSetupInstructions.ascx.cs" Inherits="WebsitePanel.Portal.ExchangeServer.OrganizationUserSetupInstructions" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/MailboxTabs.ascx" TagName="MailboxTabs" TagPrefix="wsp" %> <%@ Register Src="UserControls/MailboxTabs.ascx" TagName="MailboxTabs" TagPrefix="wsp" %>
<%@ Register src="UserControls/UserTabs.ascx" tagname="UserTabs" tagprefix="wsp" %>
<%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register Src="UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %>
<%@ Register Src="UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/DaysBox.ascx" TagName="DaysBox" TagPrefix="wsp" %>
@ -25,7 +26,8 @@
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Mailbox"></asp:Localize> <asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" Text="Edit Mailbox"></asp:Localize>
</div> </div>
<div class="FormBody"> <div class="FormBody">
<wsp:MailboxTabs id="tabs" runat="server" SelectedTab="organization_user_setup" IsADUserTabs="true" /> <wsp:UserTabs ID="UserTabs" runat="server" SelectedTab="organization_user_setup" />
<wsp:MailboxTabs id="MailboxTabs" runat="server" SelectedTab="organization_user_setup" IsADUserTabs="true" />
<wsp:SimpleMessageBox id="messageBox" runat="server" /> <wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="secEmail" runat="server" IsCollapsed="true" <wsp:CollapsiblePanel id="secEmail" runat="server" IsCollapsed="true"

View file

@ -39,6 +39,9 @@ namespace WebsitePanel.Portal.ExchangeServer
if (!IsPostBack) if (!IsPostBack)
{ {
BindInstructions(); BindInstructions();
MailboxTabs.Visible = (PanelRequest.Context == "Mailbox");
UserTabs.Visible = (PanelRequest.Context == "User");
} }
} }

View file

@ -1,4 +1,32 @@
//------------------------------------------------------------------------------ // 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> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// //
@ -58,13 +86,22 @@ namespace WebsitePanel.Portal.ExchangeServer {
protected global::System.Web.UI.WebControls.Localize locTitle; protected global::System.Web.UI.WebControls.Localize locTitle;
/// <summary> /// <summary>
/// tabs control. /// UserTabs control.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// Auto-generated field. /// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxTabs tabs; protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserTabs UserTabs;
/// <summary>
/// MailboxTabs control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.MailboxTabs MailboxTabs;
/// <summary> /// <summary>
/// messageBox control. /// messageBox control.
@ -164,14 +201,5 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// To modify move field declaration from designer file to code-behind file. /// To modify move field declaration from designer file to code-behind file.
/// </remarks> /// </remarks>
protected global::System.Web.UI.WebControls.Literal litContent; protected global::System.Web.UI.WebControls.Literal litContent;
/// <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;
} }
} }