Add CRM2013 support and update CRM2011 provider

This commit is contained in:
dev_amdtel 2014-01-31 15:46:30 +04:00
parent c4c09fa739
commit 20f64c90b5
68 changed files with 191845 additions and 2304 deletions

View file

@ -5380,4 +5380,49 @@
<data name="Quota.HostedCRM.ESSUsers" xml:space="preserve">
<value>ESS licenses per organization</value>
</data>
<data name="ResourceGroup.Hosted CRM2013" xml:space="preserve">
<value>Hosted CRM 2013</value>
</data>
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_0" xml:space="preserve">
<value>CRM users quota (Professional license) has been reached.</value>
</data>
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_2" xml:space="preserve">
<value>CRM users quota (Basic license) has been reached.</value>
</data>
<data name="HostedCRM.USER_QUOTA_HAS_BEEN_REACHED2013_5" xml:space="preserve">
<value>CRM users quota (Essential license) has been reached.</value>
</data>
<data name="Quota.HostedCRM2013.BasicUsers" xml:space="preserve">
<value>Basic licenses per organization</value>
</data>
<data name="Quota.HostedCRM2013.EssentialUsers" xml:space="preserve">
<value>Essential licenses per organization</value>
</data>
<data name="Quota.HostedCRM2013.MaxDatabaseSize" xml:space="preserve">
<value>Max Database Size, MB</value>
</data>
<data name="Quota.HostedCRM2013.Organization" xml:space="preserve">
<value>CRM Organization</value>
</data>
<data name="Quota.HostedCRM2013.ProfessionalUsers" xml:space="preserve">
<value>Professional licenses per organization</value>
</data>
<data name="HostedCRM.LicenseBasic" xml:space="preserve">
<value>Basic</value>
</data>
<data name="HostedCRM.LicenseESS" xml:space="preserve">
<value>ESS</value>
</data>
<data name="HostedCRM.LicenseEssential" xml:space="preserve">
<value>Essential</value>
</data>
<data name="HostedCRM.LicenseFull" xml:space="preserve">
<value>Full</value>
</data>
<data name="HostedCRM.LicenseLimited" xml:space="preserve">
<value>Limited</value>
</data>
<data name="HostedCRM.LicenseProfessional" xml:space="preserve">
<value>Professional</value>
</data>
</root>

View file

@ -59,6 +59,11 @@
<td><asp:DropDownList runat="server" ID="ddlCollation" /></td>
</tr>
<tr height="23px">
<td class="FormLabel150"><asp:Label runat="server" ID="lblBaseLanguage" meta:resourcekey="lblBaseLanguage" Text="Base Language"/></td>
<td><asp:DropDownList runat="server" ID="ddlBaseLanguage" /></td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button runat="server" meta:resourcekey="btnCreate" ID="btnCreate" CssClass="Button2" OnClick="btnCreate_Click" />

View file

@ -28,14 +28,59 @@
using System;
using System.Web.UI.WebControls;
using System.Globalization;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.CRM
{
public partial class CRMOrganizationDetails : WebsitePanelModuleBase
{
private StringDictionary ConvertArrayToDictionary(string[] settings)
{
StringDictionary r = new StringDictionary();
foreach (string setting in settings)
{
int idx = setting.IndexOf('=');
r.Add(setting.Substring(0, idx), setting.Substring(idx + 1));
}
return r;
}
private StringDictionary serviceSettings = null;
private StringDictionary ServiceSettings
{
get
{
if (serviceSettings != null)
return serviceSettings;
PackageInfo pi = PackagesHelper.GetCachedPackage(PanelSecurity.PackageId);
ServiceInfo[] si = ES.Services.Servers.GetServicesByServerIdGroupName(pi.ServerId, ResourceGroups.HostedCRM2013);
if (si.Length == 0) si = ES.Services.Servers.GetServicesByServerIdGroupName(pi.ServerId, ResourceGroups.HostedCRM);
if (si.Length > 0)
{
int serviceId = si[0].ServiceId;
string[] settings = ES.Services.Servers.GetServiceSettings(serviceId);
serviceSettings = ConvertArrayToDictionary(settings);
}
else
serviceSettings = new StringDictionary();
return serviceSettings;
}
}
private StringArrayResultObject BindCollations()
{
StringArrayResultObject res = ES.Services.CRM.GetCollation(PanelSecurity.PackageId);
@ -43,8 +88,10 @@ namespace WebsitePanel.Portal.CRM
{
ddlCollation.DataSource = res.Value;
ddlCollation.DataBind();
ddlCollation.SelectedValue = "Latin1_General_CI_AI";
Utils.SelectListItem(ddlCollation, "Latin1_General_CI_AI"); // default
Utils.SelectListItem(ddlCollation, ServiceSettings[Constants.Collation]);
}
return res;
}
@ -66,14 +113,34 @@ namespace WebsitePanel.Portal.CRM
}));
ddlCurrency.Items.Add(item);
}
ddlCurrency.SelectedValue = "USD|US Dollar|$|United States";
Utils.SelectListItem(ddlCurrency, "USD|US Dollar|$|United States"); // default
Utils.SelectListItem(ddlCurrency, ServiceSettings[Constants.Currency]);
}
return res;
}
private void BindBaseLanguage()
{
ddlBaseLanguage.Items.Clear();
int[] langPacksId = ES.Services.CRM.GetInstalledLanguagePacks(PanelSecurity.PackageId);
if (langPacksId != null)
{
foreach (int langId in langPacksId)
{
CultureInfo ci = CultureInfo.GetCultureInfo(langId);
ListItem item = new ListItem(ci.EnglishName, langId.ToString());
ddlBaseLanguage.Items.Add(item);
}
Utils.SelectListItem(ddlBaseLanguage, "1033"); // default
Utils.SelectListItem(ddlBaseLanguage, ServiceSettings[Constants.BaseLanguage]);
}
}
@ -82,6 +149,7 @@ namespace WebsitePanel.Portal.CRM
btnCreate.Visible = false;
ddlCollation.Enabled = false;
ddlCurrency.Enabled = false;
ddlBaseLanguage.Enabled = false;
administrator.Visible = false;
lblAdmin.Visible = true;
lblAdmin.Text = admin;
@ -89,7 +157,6 @@ namespace WebsitePanel.Portal.CRM
hlOrganizationPage.Visible = true;
hlOrganizationPage.NavigateUrl = org.CrmUrl;
hlOrganizationPage.Text = org.CrmUrl;
}
private void ShowOrganizationDetails()
@ -97,12 +164,12 @@ namespace WebsitePanel.Portal.CRM
btnCreate.Visible = true;
ddlCollation.Enabled = true;
ddlCurrency.Enabled = true;
ddlBaseLanguage.Enabled = true;
administrator.Visible = true;
lblAdmin.Visible = false;
btnDelete.Visible = false;
hlOrganizationPage.Visible = false;
}
@ -125,22 +192,20 @@ namespace WebsitePanel.Portal.CRM
return;
}
BindBaseLanguage();
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
lblCrmOrgId.Text = org.OrganizationId;
lblCrmOrgName.Text = org.Name;
if (!string.IsNullOrEmpty(org.CrmCurrency))//CRM organization
if (!string.IsNullOrEmpty(org.CrmCurrency)) //CRM organization
{
OrganizationUser admin =
ES.Services.Organizations.GetUserGeneralSettings(org.Id, org.CrmAdministratorId);
ddlCurrency.SelectedValue = org.CrmCurrency;
ddlCollation.SelectedValue = org.CrmCollation;
Utils.SelectListItem(ddlCurrency, org.CrmCurrency);
Utils.SelectListItem(ddlCollation, org.CrmCollation);
Utils.SelectListItem(ddlBaseLanguage, org.CrmLanguadgeCode);
ShowCrmOrganizationDetails(admin.DisplayName, org);
}
@ -172,13 +237,15 @@ namespace WebsitePanel.Portal.CRM
return;
}
int baseLanguage = 0;
int.TryParse(ddlBaseLanguage.SelectedValue, out baseLanguage);
EnterpriseServer.esCRM CRM = ES.Services.CRM;
CRM.Timeout = 7200000; //# Set longer timeout
OrganizationResult res = CRM.CreateOrganization(org.Id, cuurrencyData[0], cuurrencyData[1], cuurrencyData[2], cuurrencyData[3],
administrator.GetAccountId(), ddlCollation.SelectedValue);
administrator.GetAccountId(), ddlCollation.SelectedValue, baseLanguage);
messageBox.ShowMessage(res, "CreateCrmOrganization", "HostedCRM");
if (res.IsSuccess)

View file

@ -1,10 +1,37 @@
// Copyright (c) 2014, 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.
// Runtime Version:2.0.50727.4927
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -184,6 +211,24 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlCollation;
/// <summary>
/// lblBaseLanguage 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 lblBaseLanguage;
/// <summary>
/// ddlBaseLanguage 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.DropDownList ddlBaseLanguage;
/// <summary>
/// btnCreate control.
/// </summary>
@ -201,14 +246,5 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDelete;
/// <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

@ -63,7 +63,11 @@ namespace WebsitePanel.Portal
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
int limitDBSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
string quotaName = "";
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013)) quotaName = Quotas.CRM2013_MAXDATABASESIZE;
else if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM)) quotaName = Quotas.CRM_MAXDATABASESIZE;
int limitDBSize = cntx.Quotas[quotaName].QuotaAllocatedValue;
//maxStorageSettingsValue.ParentQuotaValue = limitDBSize;
maxStorageSettingsValue.ParentQuotaValue = -1;
@ -86,7 +90,12 @@ namespace WebsitePanel.Portal
try
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
long limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
string quotaName = "";
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013)) quotaName = Quotas.CRM2013_MAXDATABASESIZE;
else if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM)) quotaName = Quotas.CRM_MAXDATABASESIZE;
long limitSize = cntx.Quotas[quotaName].QuotaAllocatedValue;
long maxSize = maxStorageSettingsValue.QuotaValue;

View file

@ -54,9 +54,6 @@
<td class="FormLabel150"><asp:Localize runat="server" meta:resourcekey="locLicenseType" Text="License Type:" /></td>
<td>
<asp:DropDownList ID="ddlLicenseType" runat="server" CssClass="NormalTextBox" AutoPostBack="false">
<asp:ListItem Value="0" meta:resourcekey="ddlLicenseTypeFull">Full</asp:ListItem>
<asp:ListItem Value="2" meta:resourcekey="ddlLicenseTypeLimited">Limited</asp:ListItem>
<asp:ListItem Value="22" meta:resourcekey="ddlLicenseTypeESS">ESS</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

View file

@ -32,6 +32,7 @@ using System.Web.UI.WebControls;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.CRM
{
@ -41,6 +42,27 @@ namespace WebsitePanel.Portal.CRM
{
if (!IsPostBack)
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
{
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseProfessional"), CRMUserLycenseTypes.PROFESSIONAL.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseBasic"), CRMUserLycenseTypes.BASIC.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseEssential"), CRMUserLycenseTypes.ESSENTIAL.ToString()));
}
else
{
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseFull"), CRMUserLycenseTypes.FULL.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseLimited"), CRMUserLycenseTypes.LIMITED.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseESS"), CRMUserLycenseTypes.ESS.ToString()));
}
try
{
OrganizationUser user =
@ -61,17 +83,7 @@ namespace WebsitePanel.Portal.CRM
int cALType = userResult.Value.CALType + ((int)userResult.Value.ClientAccessMode) * 10;
switch (cALType)
{
case 0 :
case 2 :
case 22:
ddlLicenseType.SelectedValue = cALType.ToString();
break;
default:
ddlLicenseType.SelectedIndex = 0;
break;
}
Utils.SelectListItem(ddlLicenseType, cALType);
}
else
{

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// Copyright (c) 2014, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,

View file

@ -80,33 +80,65 @@
</asp:ObjectDataSource>
<br />
<table>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Full licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locLimitedQuota" runat="server" meta:resourcekey="locLimitedQuota" Text="Limited licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="limitedusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locESSQuota" runat="server" meta:resourcekey="locESSQuota" Text="ESS licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="essusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
</table>
<asp:Panel ID="CRM2011Panel" runat="server">
<table>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Full licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locLimitedQuota" runat="server" meta:resourcekey="locLimitedQuota" Text="Limited licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="limitedusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locESSQuota" runat="server" meta:resourcekey="locESSQuota" Text="ESS licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="essusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
</table>
</asp:Panel>
<asp:Panel ID="CRM2013Panel" runat="server">
<table>
<tr>
<td align="right" nowrap>
<asp:Localize ID="Localize1" runat="server" meta:resourcekey="locQuota" Text="Professional licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="professionalusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locBasicQuota" runat="server" meta:resourcekey="locBasicQuota" Text="Basic licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="basicusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
<tr>
<td align="right" nowrap>
<asp:Localize ID="locEssentialQuota" runat="server" meta:resourcekey="locEssentialQuota" Text="Essential licenses :"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="essentialusersQuota" runat="server" QuotaTypeId="2" />
</td>
</tr>
</table>
</asp:Panel>
</div>
</div>
</div>

View file

@ -41,25 +41,42 @@ namespace WebsitePanel.Portal.CRM
{
messageBox.ShowErrorMessage("NOT_CRM_ORGANIZATION");
btnCreateUser.Enabled = false;
CRM2011Panel.Visible = false;
CRM2013Panel.Visible = false;
}
else
{
OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
int allocatedCrmUsers = stats.AllocatedCRMUsers;
int usedUsers = stats.CreatedCRMUsers;
usersQuota.QuotaUsedValue = usedUsers;
usersQuota.QuotaValue = allocatedCrmUsers;
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
{
CRM2011Panel.Visible = false;
CRM2013Panel.Visible = true;
limitedusersQuota.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
limitedusersQuota.QuotaValue = stats.AllocatedLimitedCRMUsers;
professionalusersQuota.QuotaUsedValue = stats.CreatedProfessionalCRMUsers;
professionalusersQuota.QuotaValue = stats.AllocatedProfessionalCRMUsers;
//if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedLimitedCRMUsers != -1) limitedusersQuota.QuotaAvailable = tenantStats.AllocatedLimitedCRMUsers - tenantStats.CreatedLimitedCRMUsers;
basicusersQuota.QuotaUsedValue = stats.CreatedBasicCRMUsers;
basicusersQuota.QuotaValue = stats.AllocatedBasicCRMUsers;
essusersQuota.QuotaUsedValue = stats.CreatedESSCRMUsers;
essusersQuota.QuotaValue = stats.AllocatedESSCRMUsers;
essentialusersQuota.QuotaUsedValue = stats.CreatedEssentialCRMUsers;
essentialusersQuota.QuotaValue = stats.AllocatedEssentialCRMUsers;
}
else
{
CRM2011Panel.Visible = true;
CRM2013Panel.Visible = false;
usersQuota.QuotaUsedValue = stats.CreatedCRMUsers;
usersQuota.QuotaValue = stats.AllocatedCRMUsers;
limitedusersQuota.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
limitedusersQuota.QuotaValue = stats.AllocatedLimitedCRMUsers;
essusersQuota.QuotaUsedValue = stats.CreatedESSCRMUsers;
essusersQuota.QuotaValue = stats.AllocatedESSCRMUsers;
}
}
}

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// Copyright (c) 2014, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
@ -166,6 +166,15 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::System.Web.UI.WebControls.ObjectDataSource odsAccountsPaged;
/// <summary>
/// CRM2011Panel 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.Panel CRM2011Panel;
/// <summary>
/// locQuota control.
/// </summary>
@ -219,5 +228,68 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer essusersQuota;
/// <summary>
/// CRM2013Panel 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.Panel CRM2013Panel;
/// <summary>
/// Localize1 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 Localize1;
/// <summary>
/// professionalusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer professionalusersQuota;
/// <summary>
/// locBasicQuota 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 locBasicQuota;
/// <summary>
/// basicusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer basicusersQuota;
/// <summary>
/// locEssentialQuota 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 locEssentialQuota;
/// <summary>
/// essentialusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer essentialusersQuota;
}
}

View file

@ -43,9 +43,6 @@
<td class="FormLabel150"><asp:Localize runat="server" meta:resourcekey="locLicenseType" Text="License Type: *" /></td>
<td>
<asp:DropDownList ID="ddlLicenseType" runat="server" CssClass="NormalTextBox" AutoPostBack="false">
<asp:ListItem Value="0" meta:resourcekey="ddlLicenseTypeFull">Full</asp:ListItem>
<asp:ListItem Value="2" meta:resourcekey="ddlLicenseTypeLimited">Limited</asp:ListItem>
<asp:ListItem Value="22" meta:resourcekey="ddlLicenseTypeESS">ESS</asp:ListItem>
</asp:DropDownList>
</td>
</tr>

View file

@ -29,6 +29,7 @@
using System;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.CRM
{
@ -38,6 +39,28 @@ namespace WebsitePanel.Portal.CRM
{
if (!IsPostBack)
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
{
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseProfessional"), CRMUserLycenseTypes.PROFESSIONAL.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseBasic"), CRMUserLycenseTypes.BASIC.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseEssential"), CRMUserLycenseTypes.ESSENTIAL.ToString()));
}
else
{
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseFull"), CRMUserLycenseTypes.FULL.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseLimited"), CRMUserLycenseTypes.LIMITED.ToString()));
ddlLicenseType.Items.Add(new System.Web.UI.WebControls.ListItem(
GetSharedLocalizedString("HostedCRM.LicenseESS"), CRMUserLycenseTypes.ESS.ToString()));
}
try
{
CRMBusinessUnitsResult res =

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// Copyright (c) 2014, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,

View file

@ -207,13 +207,16 @@ namespace WebsitePanel.Portal
public static void SelectListItem(ListControl ctrl, object value)
{
// unselect currently selected item
if (ctrl.SelectedIndex != -1)
ctrl.SelectedItem.Selected = false;
string val = (value != null) ? value.ToString() : "";
ListItem item = ctrl.Items.FindByValue(val);
if (item != null) item.Selected = true;
if (item != null)
{
// unselect currently selected item
if (ctrl.SelectedIndex != -1)
ctrl.SelectedItem.Selected = false;
item.Selected = true;
}
}
public static void SaveListControlState(ListControl ctrl)

View file

@ -240,6 +240,48 @@
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="crm2013StatsPanel">
<tr >
<td class="OrgStatsGroup" width="100%" colspan="2">
<asp:Localize ID="locCRM2013" runat="server" meta:resourcekey="locCRM2013"
Text="CRM 2013"></asp:Localize>
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkProfessionalCRMUsers" runat="server" meta:resourcekey="lnkProfessionalCRMUsers" Text="Professional licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmProfessionalUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkBasicCRMUsers" runat="server" meta:resourcekey="lnkBasicCRMUsers" Text="Basic licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmBasicUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkEssentialCRMUsers" runat="server" meta:resourcekey="lnkEssentialCRMUsers" Text="Essential licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmEssentialUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkCRM2013DBSize" runat="server" meta:resourcekey="lnkCRMDBSize" Text="Storage size (MB):"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crm2013DBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />
</td>
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="enterpriseStorageStatsPanel">
<tr>
<td class="OrgStatsGroup" width="100%" colspan="2">

View file

@ -225,11 +225,26 @@ namespace WebsitePanel.Portal.ExchangeServer
if (org.CrmOrganizationId != Guid.Empty)
{
crmStatsPanel.Visible = true;
BindCRMStats(orgStats, tenantStats);
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
{
crm2013StatsPanel.Visible = true;
crmStatsPanel.Visible = false;
BindCRM2013Stats(orgStats, tenantStats);
}
else if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
{
crmStatsPanel.Visible = true;
crm2013StatsPanel.Visible = false;
BindCRMStats(orgStats, tenantStats);
}
}
else
{
crmStatsPanel.Visible = false;
crm2013StatsPanel.Visible = false;
}
if (cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage))
@ -267,6 +282,30 @@ namespace WebsitePanel.Portal.ExchangeServer
crmDBSize.QuotaValue = Convert.ToInt32(stats.AllocatedCRMDiskSpace>0 ? stats.AllocatedCRMDiskSpace/(1024*1024) : -1);
}
private void BindCRM2013Stats(OrganizationStatistics stats, OrganizationStatistics tenantStats)
{
lnkProfessionalCRMUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crmusers",
"SpaceID=" + PanelSecurity.PackageId);
lnkBasicCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
lnkEssentialCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
lnkCRM2013DBSize.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crm_storage_settings",
"SpaceID=" + PanelSecurity.PackageId);
crmProfessionalUsersStats.QuotaUsedValue = stats.CreatedProfessionalCRMUsers;
crmProfessionalUsersStats.QuotaValue = stats.AllocatedProfessionalCRMUsers;
crmBasicUsersStats.QuotaUsedValue = stats.CreatedBasicCRMUsers;
crmBasicUsersStats.QuotaValue = stats.AllocatedBasicCRMUsers;
crmEssentialUsersStats.QuotaUsedValue = stats.CreatedEssentialCRMUsers;
crmEssentialUsersStats.QuotaValue = stats.AllocatedEssentialCRMUsers;
crm2013DBSize.QuotaUsedValue = Convert.ToInt32(stats.UsedCRMDiskSpace > 0 ? stats.UsedCRMDiskSpace / (1024 * 1024) : -1);
crm2013DBSize.QuotaValue = Convert.ToInt32(stats.AllocatedCRMDiskSpace > 0 ? stats.AllocatedCRMDiskSpace / (1024 * 1024) : -1);
}
private void BindOCSStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)
{
ocsUsersStats.QuotaValue = stats.AllocatedOCSUsers;

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// Copyright (c) 2014, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
@ -589,6 +589,96 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmDBSize;
/// <summary>
/// crm2013StatsPanel 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.Panel crm2013StatsPanel;
/// <summary>
/// locCRM2013 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 locCRM2013;
/// <summary>
/// lnkProfessionalCRMUsers 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.HyperLink lnkProfessionalCRMUsers;
/// <summary>
/// crmProfessionalUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmProfessionalUsersStats;
/// <summary>
/// lnkBasicCRMUsers 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.HyperLink lnkBasicCRMUsers;
/// <summary>
/// crmBasicUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmBasicUsersStats;
/// <summary>
/// lnkEssentialCRMUsers 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.HyperLink lnkEssentialCRMUsers;
/// <summary>
/// crmEssentialUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmEssentialUsersStats;
/// <summary>
/// lnkCRM2013DBSize 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.HyperLink lnkCRM2013DBSize;
/// <summary>
/// crm2013DBSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crm2013DBSize;
/// <summary>
/// enterpriseStorageStatsPanel control.
/// </summary>

View file

@ -213,4 +213,7 @@
<data name="Text.LyncPhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="Text.CRMGroup2013" xml:space="preserve">
<value>CRM 2013</value>
</data>
</root>

View file

@ -200,6 +200,19 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
}
private void PrepareCRMMenu2013(PackageContext cntx, List<MenuGroup> groups, string imagePath)
{
MenuGroup crmGroup = new MenuGroup(GetLocalizedString("Text.CRMGroup2013"), imagePath + "crm_16.png");
crmGroup.MenuItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails"));
crmGroup.MenuItems.Add(CreateMenuItem("CRMUsers", "CRMUsers"));
crmGroup.MenuItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
if (crmGroup.MenuItems.Count > 0)
groups.Add(crmGroup);
}
private void PrepareBlackBerryMenu(PackageContext cntx, List<MenuGroup> groups, string imagePath)
{
MenuGroup bbGroup = new MenuGroup(GetLocalizedString("Text.BlackBerryGroup"), imagePath + "blackberry16.png");
@ -292,7 +305,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
}
//CRM Menu
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
PrepareCRMMenu2013(cntx, groups, imagePath);
else if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
PrepareCRMMenu(cntx, groups, imagePath);

View file

@ -94,4 +94,20 @@
</td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Default Currency</td>
<td><asp:DropDownList runat="server" ID="ddlCurrency"/></td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap/>Default Collation</td>
<td><asp:DropDownList runat="server" ID="ddlCollation" /></td>
</tr>
<tr>
<td class="SubHead" width="200" nowrap>Default Base Language</td>
<td><asp:DropDownList runat="server" ID="ddlBaseLanguage" /></td>
</tr>
</table>

View file

@ -27,8 +27,12 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using System.Web.UI.WebControls;
using System.Globalization;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal.ProviderControls
{
@ -60,8 +64,54 @@ namespace WebsitePanel.Portal.ProviderControls
int selectedAddressid = FindAddressByText(settings[Constants.CRMWebsiteIP]);
ddlCrmIpAddress.AddressId = (selectedAddressid > 0) ? selectedAddressid : 0;
ddlSchema.SelectedValue = settings[Constants.UrlSchema];
Utils.SelectListItem(ddlSchema, settings[Constants.UrlSchema]);
// Collation
StringArrayResultObject res = ES.Services.CRM.GetCollationByServiceId(PanelRequest.ServiceId);
if (res.IsSuccess)
{
ddlCollation.DataSource = res.Value;
ddlCollation.DataBind();
Utils.SelectListItem(ddlCollation, "Latin1_General_CI_AI"); // default
}
Utils.SelectListItem(ddlCollation, settings[Constants.Collation]);
// Currency
ddlCurrency.Items.Clear();
CurrencyArrayResultObject cres = ES.Services.CRM.GetCurrencyByServiceId(PanelRequest.ServiceId);
if (cres.IsSuccess)
{
foreach (Currency currency in cres.Value)
{
ListItem item = new ListItem(string.Format("{0} ({1})",
currency.RegionName, currency.CurrencyName),
string.Join("|",
new string[]
{
currency.CurrencyCode, currency.CurrencyName,
currency.CurrencySymbol, currency.RegionName
}));
ddlCurrency.Items.Add(item);
}
Utils.SelectListItem(ddlCurrency, "USD|US Dollar|$|United States"); // default
}
Utils.SelectListItem(ddlCurrency, settings[Constants.Currency]);
// Base Language
ddlBaseLanguage.Items.Clear();
int[] langPacksId = ES.Services.CRM.GetInstalledLanguagePacksByServiceId(PanelRequest.ServiceId);
if (langPacksId != null)
{
foreach (int langId in langPacksId)
{
CultureInfo ci = CultureInfo.GetCultureInfo(langId);
ListItem item = new ListItem(ci.EnglishName, langId.ToString());
ddlBaseLanguage.Items.Add(item);
}
Utils.SelectListItem(ddlBaseLanguage, "1033"); // default
}
Utils.SelectListItem(ddlBaseLanguage, settings[Constants.BaseLanguage]);
}
public void SaveSettings(System.Collections.Specialized.StringDictionary settings)
@ -97,6 +147,11 @@ namespace WebsitePanel.Portal.ProviderControls
}
settings[Constants.UrlSchema] = ddlSchema.SelectedValue;
settings[Constants.Collation] = ddlCollation.SelectedValue;
settings[Constants.Currency] = ddlCurrency.SelectedValue;
settings[Constants.BaseLanguage] = ddlBaseLanguage.SelectedValue;
}
private static int FindAddressByText(string address)

View file

@ -1,4 +1,4 @@
// Copyright (c) 2012, Outercurve Foundation.
// Copyright (c) 2014, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
@ -35,7 +35,6 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal.ProviderControls {
@ -166,5 +165,32 @@ namespace WebsitePanel.Portal.ProviderControls {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.TextBox txtPassword;
/// <summary>
/// ddlCurrency 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.DropDownList ddlCurrency;
/// <summary>
/// ddlCollation 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.DropDownList ddlCollation;
/// <summary>
/// ddlBaseLanguage 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.DropDownList ddlBaseLanguage;
}
}

View file

@ -210,6 +210,13 @@
<Compile Include="Code\ReportingServices\IResourceStorage.cs" />
<Compile Include="Code\ReportingServices\ReportingServicesUtils.cs" />
<Compile Include="Code\UserControls\Tab.cs" />
<Compile Include="CRM\CRMStorageSettings.ascx.cs">
<DependentUpon>CRMStorageSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="CRM\CRMStorageSettings.ascx.designer.cs">
<DependentUpon>CRMStorageSettings.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageFolderGeneralSettings.ascx.cs">
<DependentUpon>EnterpriseStorageFolderGeneralSettings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -229,7 +236,7 @@
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ExchangeServer\EnterpriseStorageFolders.ascx.designer.cs">
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
</Compile>
<Compile Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx.cs">
<DependentUpon>OrganizationSecurityGroupMemberOf.ascx</DependentUpon>
@ -4037,6 +4044,7 @@
</ItemGroup>
<ItemGroup>
<Content Include="ApplyEnableHardQuotaFeature.ascx" />
<Content Include="CRM\CRMStorageSettings.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageFolderGeneralSettings.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageCreateFolder.ascx" />
<Content Include="ExchangeServer\EnterpriseStorageFolders.ascx" />
@ -5278,7 +5286,7 @@
</Content>
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolders.ascx.resx">
<SubType>Designer</SubType>
</Content>
</Content>
<Content Include="UserControls\App_LocalResources\OrgPolicyEditor.ascx.resx">
<SubType>Designer</SubType>
</Content>