CRM Module fixes
This commit is contained in:
parent
18cd090671
commit
6738c1611a
10 changed files with 46 additions and 11 deletions
|
@ -270,6 +270,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
PackageContext cntx = PackageController.GetPackageContext(org.PackageId);
|
||||
int maxDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
|
||||
if (maxDBSize != -1) maxDBSize = maxDBSize * 1024 * 1024;
|
||||
|
||||
org.CrmAdministratorId = user.AccountId;
|
||||
org.CrmCurrency =
|
||||
|
@ -1011,7 +1012,8 @@ namespace WebsitePanel.EnterpriseServer
|
|||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -1159,6 +1161,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
if (limitSize != -1)
|
||||
{
|
||||
limitSize = limitSize * 1024 * 1024;
|
||||
if (maxSize == -1) maxSize = limitSize;
|
||||
if (maxSize > limitSize) maxSize = limitSize;
|
||||
}
|
||||
|
|
|
@ -1520,6 +1520,8 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
return res;
|
||||
}
|
||||
|
||||
static string excludedRolesStr = ";пользователь поддержки;support user;";
|
||||
|
||||
private static List<CrmRole> FillCrmRoles(EntityCollection entities, bool isUserRole, Guid businessUnitId)
|
||||
{
|
||||
List<CrmRole> res = new List<CrmRole>();
|
||||
|
@ -1536,10 +1538,16 @@ namespace WebsitePanel.Providers.HostedSolution
|
|||
continue;
|
||||
}
|
||||
|
||||
string roleName = role.Name;
|
||||
|
||||
if (roleName!=null)
|
||||
if (excludedRolesStr.IndexOf(";" + roleName.ToLower() + ";") != -1)
|
||||
continue;
|
||||
|
||||
CrmRole crmRole = new CrmRole();
|
||||
crmRole.IsCurrentUserRole = isUserRole;
|
||||
crmRole.RoleId = (Guid)role.RoleId;
|
||||
crmRole.RoleName = role.Name;
|
||||
crmRole.RoleName = roleName;
|
||||
|
||||
res.Add(crmRole);
|
||||
}
|
||||
|
|
|
@ -3643,8 +3643,8 @@
|
|||
<data name="HostedCRM.CANONT_GET_CRM_USER_GENERAL_ERROR" xml:space="preserve">
|
||||
<value>General error has been occurred while getting crm user.</value>
|
||||
</data>
|
||||
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED" xml:space="preserve">
|
||||
<value>CRM users quota has been reached.</value>
|
||||
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED0" xml:space="preserve">
|
||||
<value>CRM users quota (full license) has been reached.</value>
|
||||
</data>
|
||||
<data name="HostedCRM.CANNOT_ADD_ORGANIZATION_OWNER_TO_ORGANIZATIO_USER" xml:space="preserve">
|
||||
<value>Unable to add organization owner to organization users.</value>
|
||||
|
@ -5371,4 +5371,7 @@
|
|||
<data name="Quota.HostedCRM.MaxDatabaseSize" xml:space="preserve">
|
||||
<value>Max Database Size, MB</value>
|
||||
</data>
|
||||
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2" xml:space="preserve">
|
||||
<value>CRM users quota (limited license) has been reached.</value>
|
||||
</data>
|
||||
</root>
|
|
@ -41,11 +41,16 @@
|
|||
<td class="FormLabel200" align="right"><asp:Localize runat="server" meta:resourcekey="locUsageStorage" >Current usage (MB):</asp:Localize></td>
|
||||
<td>
|
||||
<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>
|
||||
<td class="FormLabel200" align="right"><asp:Localize ID="locMaxStorage" runat="server" meta:resourcekey="locMaxStorage" >Reassign storage space (MB):</asp:Localize></td>
|
||||
<td>
|
||||
<uc1:QuotaEditor QuotaTypeId="2" ID="maxStorageSettingsValue" runat="server" />
|
||||
<uc1:QuotaEditor QuotaTypeId="2" ID="maxStorageSettingsValue" runat="server"/>
|
||||
</td>
|
||||
</tr>
|
||||
<!--
|
||||
|
|
|
@ -54,7 +54,9 @@ namespace WebsitePanel.Portal
|
|||
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
|
||||
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 DBSize = ES.Services.CRM.GetDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
|
||||
|
@ -66,6 +68,8 @@ namespace WebsitePanel.Portal
|
|||
|
||||
lblDBSize.Text = SizeValueToString(DBSize);
|
||||
lblMAXDBSize.Text = SizeValueToString(maxDBSize);
|
||||
|
||||
lblLimitDBSize.Text = SizeValueToString(limitDBSize);
|
||||
}
|
||||
|
||||
private void Save()
|
||||
|
|
|
@ -121,6 +121,15 @@ namespace WebsitePanel.Portal {
|
|||
/// </remarks>
|
||||
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>
|
||||
/// locMaxStorage control.
|
||||
/// </summary>
|
||||
|
|
|
@ -125,9 +125,9 @@ namespace WebsitePanel.Portal.CRM
|
|||
CALType);
|
||||
|
||||
if (!res2.IsSuccess)
|
||||
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
|
||||
messageBox.ShowMessage(res2, "UPDATE_CRM_USER_ROLES", "HostedCRM");
|
||||
else if (!res.IsSuccess)
|
||||
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
|
||||
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
|
||||
else
|
||||
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
|
||||
}
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
</tr>
|
||||
<tr class="OrgStatsRow">
|
||||
<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>
|
||||
<wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />
|
||||
|
|
|
@ -248,6 +248,9 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
|
||||
lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
|
||||
|
||||
lnkCRMDBSize.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crm_storage_settings",
|
||||
"SpaceID=" + PanelSecurity.PackageId);
|
||||
|
||||
crmUsersStats.QuotaUsedValue = stats.CreatedCRMUsers;
|
||||
crmUsersStats.QuotaValue = stats.AllocatedCRMUsers;
|
||||
|
||||
|
|
|
@ -554,13 +554,13 @@ namespace WebsitePanel.Portal.ExchangeServer {
|
|||
protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats;
|
||||
|
||||
/// <summary>
|
||||
/// locCRMDBSize control.
|
||||
/// lnkCRMDBSize 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 locCRMDBSize;
|
||||
protected global::System.Web.UI.WebControls.HyperLink lnkCRMDBSize;
|
||||
|
||||
/// <summary>
|
||||
/// crmDBSize control.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue