CRM Module update

This commit is contained in:
dev_amdtel 2013-12-01 01:06:32 +04:00
parent 2b68bfb8bf
commit 18cd090671
37 changed files with 2067 additions and 204 deletions

View file

@ -0,0 +1,151 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnSave.Text" xml:space="preserve">
<value>Save</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value>&lt;p&gt;Storage settings are used to limit the amount of storage available on a SharePoint site collection, and they are used to send e-mail alerts to the site administrator when a specified value of space is used.&lt;/p&gt;
&lt;p&gt;These settings will be applied to the new site collections only. By clicking "Save and Apply to All Site Collections" button you can override these settings for all existing site collections.&lt;/p&gt;
&lt;p&gt;Please note, that you cannot specify storage settings higher than defined in the space hosting plan.&lt;/p&gt;</value>
</data>
<data name="locMaxStorage.Text" xml:space="preserve">
<value>Reassign storage space (MB):</value>
</data>
<data name="locWarningStorage.Text" xml:space="preserve">
<value>Send warning E-mail when site storage reaches (MB):</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="Text.PageName" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="secStorageLimits.Text" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="chkQuotaUnlimited.Text" xml:space="preserve">
<value>Don't use</value>
</data>
<data name="WarningUnlimitedValue" xml:space="preserve">
<value>Do not send</value>
</data>
</root>

View file

@ -130,7 +130,7 @@
<value>There are no CRM users</value>
</data>
<data name="locQuota.Text" xml:space="preserve">
<value>Total users created</value>
<value>Full licenses :</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>CRM Users</value>

View file

@ -0,0 +1,74 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="CRMStorageSettings.ascx.cs" Inherits="WebsitePanel.Portal.CRMStorageSettings" %>
<%@ Register Src="../ExchangeServer/UserControls/Breadcrumb.ascx" TagName="Breadcrumb"
TagPrefix="wsp" %>
<%@ Register Src="../UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport"
TagPrefix="wsp" %>
<%@ Register Src="../UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel"
TagPrefix="wsp" %>
<%@ Register Src="../ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %>
<%@ Register Src="../UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox"
TagPrefix="wsp" %>
<%@ Register Src="../ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
<%@ Register src="../UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %>
<div id="ExchangeContainer">
<div class="Module">
<div class="Header">
<wsp:Breadcrumb id="breadcrumb" runat="server" PageName="Text.PageName" />
</div>
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="storage_limits" />
</div>
<div class="Content">
<div class="Center">
<div class="Title">
<asp:Image ID="Image1" SkinID="ExchangeStorageConfig48" runat="server" />
<asp:Localize ID="locTitle" runat="server" meta:resourcekey="locTitle" ></asp:Localize>
</div>
<div class="FormBody">
<wsp:SimpleMessageBox id="messageBox" runat="server" />
<wsp:CollapsiblePanel id="secStorageLimits" runat="server"
TargetControlID="StorageLimits" meta:resourcekey="secStorageLimits" >
</wsp:CollapsiblePanel>
<asp:Panel ID="StorageLimits" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<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 ID="locMaxStorage" runat="server" meta:resourcekey="locMaxStorage" >Reassign storage space (MB):</asp:Localize></td>
<td>
<uc1:QuotaEditor QuotaTypeId="2" ID="maxStorageSettingsValue" runat="server" />
</td>
</tr>
<!--
<tr>
<td class="FormLabel200" align="right"><asp:Localize ID="locWarningStorage" runat="server" meta:resourcekey="locWarningStorage" ></asp:Localize></td>
<td>
<uc1:QuotaEditor QuotaTypeId="2" ID="warningValue" runat="server" />
</td>
</tr>
-->
</table>
<br />
</asp:Panel>
<div class="FormFooterClean">
<asp:Button id="btnSave" runat="server" Text="Save Changes" CssClass="Button1" meta:resourcekey="btnSave"
ValidationGroup="EditStorageSettings" OnClick="btnSave_Click" ></asp:Button>
</div>
</div>
</div>
</div>
</div>
</div>

View file

@ -0,0 +1,110 @@
// 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.
using System;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.HostedSolution;
namespace WebsitePanel.Portal
{
public partial class CRMStorageSettings : WebsitePanelModuleBase
{
public string SizeValueToString(long val)
{
return (val == -1) ? GetSharedLocalizedString("Text.Unlimited") : val.ToString();
}
protected void Page_Load(object sender, EventArgs e)
{
warningValue.UnlimitedText = GetLocalizedString("WarningUnlimitedValue");
if (!IsPostBack)
{
BindValues();
}
}
private void BindValues()
{
Organization org = ES.Services.Organizations.GetOrganization(PanelRequest.ItemID);
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
maxStorageSettingsValue.ParentQuotaValue = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
long maxDBSize = ES.Services.CRM.GetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
long DBSize = ES.Services.CRM.GetDBSize(PanelRequest.ItemID, PanelSecurity.PackageId);
DBSize = DBSize > 0 ? DBSize = DBSize / (1024 * 1024) : DBSize;
maxDBSize = maxDBSize > 0 ? maxDBSize = maxDBSize / (1024 * 1024) : maxDBSize;
maxStorageSettingsValue.QuotaValue = Convert.ToInt32(maxDBSize);
lblDBSize.Text = SizeValueToString(DBSize);
lblMAXDBSize.Text = SizeValueToString(maxDBSize);
}
private void Save()
{
try
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
int limitSize = cntx.Quotas[Quotas.CRM_MAXDATABASESIZE].QuotaAllocatedValue;
int maxSize = maxStorageSettingsValue.QuotaValue;
if (limitSize != -1)
{
if (maxSize == -1) maxSize = limitSize;
if (maxSize > limitSize) maxSize = limitSize;
}
if (maxSize > 0)
{
maxSize = maxSize * 1024 * 1024;
}
ES.Services.CRM.SetMaxDBSize(PanelRequest.ItemID, PanelSecurity.PackageId, maxSize);
messageBox.ShowSuccessMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS");
BindValues();
}
catch (Exception)
{
messageBox.ShowErrorMessage("HOSTED_SHAREPOINT_UPDATE_QUOTAS");
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
Save();
}
}
}

View file

@ -0,0 +1,169 @@
// 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>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class CRMStorageSettings {
/// <summary>
/// breadcrumb 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.Breadcrumb breadcrumb;
/// <summary>
/// menu 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.Menu menu;
/// <summary>
/// Image1 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.Image Image1;
/// <summary>
/// locTitle 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 locTitle;
/// <summary>
/// messageBox control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.UserControls.SimpleMessageBox messageBox;
/// <summary>
/// secStorageLimits control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.CollapsiblePanel secStorageLimits;
/// <summary>
/// StorageLimits 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 StorageLimits;
/// <summary>
/// lblDBSize 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 lblDBSize;
/// <summary>
/// lblMAXDBSize 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 lblMAXDBSize;
/// <summary>
/// locMaxStorage 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 locMaxStorage;
/// <summary>
/// maxStorageSettingsValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor maxStorageSettingsValue;
/// <summary>
/// locWarningStorage 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 locWarningStorage;
/// <summary>
/// warningValue control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaEditor warningValue;
/// <summary>
/// btnSave 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.Button btnSave;
}
}

View file

@ -49,6 +49,17 @@
onclick="btnActive_Click" meta:resourcekey="btnActivate" /><asp:Button CssClass="Button1" runat="server"
Text="Deactivate" ID="btnDeactivate" onclick="btnDeactivate_Click" meta:resourcekey="btnDeactivate"/></td>
</tr>
<tr>
<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:DropDownList>
</td>
</tr>
</table>
<br />
</div>

View file

@ -58,6 +58,19 @@ namespace WebsitePanel.Portal.CRM
lblDisplayName.Text = user.DisplayName;
lblEmailAddress.Text = user.PrimaryEmailAddress;
lblDomainName.Text = user.DomainUserName;
int cALType = userResult.Value.CALType;
switch (cALType)
{
case 0 :
case 2 :
ddlLicenseType.SelectedValue = cALType.ToString();
break;
default:
ddlLicenseType.SelectedIndex = 0;
break;
}
}
else
{
@ -103,7 +116,20 @@ namespace WebsitePanel.Portal.CRM
ES.Services.CRM.SetUserRoles(PanelRequest.ItemID, PanelRequest.AccountID, PanelSecurity.PackageId,
roles.ToArray());
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
int CALType = 0;
int.TryParse(ddlLicenseType.SelectedValue, out CALType);
ResultObject res2 =
ES.Services.CRM.SetUserCALType(PanelRequest.ItemID, PanelRequest.AccountID, PanelSecurity.PackageId,
CALType);
if (!res2.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
else if (!res.IsSuccess)
messageBox.ShowErrorMessage("UPDATE_CRM_USER_ROLES");
else
messageBox.ShowMessage(res, "UPDATE_CRM_USER_ROLES", "HostedCRM");
}
catch(Exception ex)
{

View file

@ -1,10 +1,37 @@
//------------------------------------------------------------------------------
// 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>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -166,6 +193,15 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnDeactivate;
/// <summary>
/// ddlLicenseType 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 ddlLicenseType;
/// <summary>
/// gvRoles control.
/// </summary>
@ -183,14 +219,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 btnUpdate;
/// <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

@ -67,7 +67,6 @@
</Columns>
</asp:GridView>
<asp:ObjectDataSource ID="odsAccountsPaged" runat="server" EnablePaging="True"
SelectCountMethod="GetCRMUsersPagedCount"
SelectMethod="GetCRMUsersPaged"
SortParameterName="sortColumn"
@ -80,9 +79,26 @@
</SelectParameters>
</asp:ObjectDataSource>
<br />
<asp:Localize ID="locQuota" runat="server" meta:resourcekey="locQuota" Text="Total Users Created:"></asp:Localize>
&nbsp;&nbsp;&nbsp;
<wsp:QuotaViewer ID="usersQuota" runat="server" QuotaTypeId="2" />
<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>
</table>
</div>
</div>
</div>

View file

@ -48,10 +48,15 @@ namespace WebsitePanel.Portal.CRM
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
int allocatedCrmUsers = stats.AllocatedCRMUsers;
int usedUsers = stats.CreatedCRMUsers;
usersQuota.QuotaUsedValue = usedUsers;
usersQuota.QuotaValue = allocatedCrmUsers;
if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
limitedusersQuota.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
limitedusersQuota.QuotaValue = stats.AllocatedLimitedCRMUsers;
//if (stats.AllocatedCRMUsers != -1) usersQuota.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedLimitedCRMUsers != -1) limitedusersQuota.QuotaAvailable = tenantStats.AllocatedLimitedCRMUsers - tenantStats.CreatedLimitedCRMUsers;
}
}

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>
// This code was generated by a tool.
//
@ -157,12 +185,21 @@ namespace WebsitePanel.Portal.CRM {
protected global::WebsitePanel.Portal.QuotaViewer usersQuota;
/// <summary>
/// FormComments control.
/// locLimitedQuota 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;
protected global::System.Web.UI.WebControls.Localize locLimitedQuota;
/// <summary>
/// limitedusersQuota control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer limitedusersQuota;
}
}

View file

@ -38,6 +38,16 @@
<td class="FormLabel150"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="locDisplayName" Text="Display Name: *"></asp:Localize></td>
<td><wsp:UserSelector id="userSelector" runat="server" IncludeMailboxes="true"></wsp:UserSelector></td>
</tr>
<tr>
<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:DropDownList>
</td>
</tr>
<tr>
<td class="FormLabel150">

View file

@ -68,9 +68,12 @@ namespace WebsitePanel.Portal.CRM
try
{
OrganizationUser user = ES.Services.Organizations.GetUserGeneralSettings(PanelRequest.ItemID, accountId);
user.AccountId = accountId;
user.AccountId = accountId;
res = ES.Services.CRM.CreateCRMUser(user, PanelSecurity.PackageId, PanelRequest.ItemID, new Guid(ddlBusinessUnits.SelectedValue));
int cALType = 0;
int.TryParse(ddlLicenseType.SelectedValue, out cALType);
res = ES.Services.CRM.CreateCRMUser(user, PanelSecurity.PackageId, PanelRequest.ItemID, new Guid(ddlBusinessUnits.SelectedValue), cALType);
if (res.IsSuccess)
{

View file

@ -1,10 +1,37 @@
//------------------------------------------------------------------------------
// 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>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1873
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -94,6 +121,15 @@ namespace WebsitePanel.Portal.CRM {
/// </remarks>
protected global::WebsitePanel.Portal.ExchangeServer.UserControls.UserSelector userSelector;
/// <summary>
/// ddlLicenseType 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 ddlLicenseType;
/// <summary>
/// Localize2 control.
/// </summary>
@ -129,14 +165,5 @@ namespace WebsitePanel.Portal.CRM {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.ValidationSummary ValidationSummary1;
/// <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

@ -76,7 +76,7 @@ namespace WebsitePanel.Portal
else
email = filterValue;
IntResult res = ES.Services.CRM.GetCRMUserCount(itemId, name, email);
IntResult res = ES.Services.CRM.GetCRMUserCount(itemId, name, email, -1);
return res.Value;
}

View file

@ -145,7 +145,7 @@
<value>Contacts:</value>
</data>
<data name="lnkCRMUsers.Text" xml:space="preserve">
<value>CRM Users:</value>
<value>Full licenses :</value>
</data>
<data name="lnkDomains.Text" xml:space="preserve">
<value>Domain Names:</value>

View file

@ -208,12 +208,28 @@
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkCRMUsers" runat="server" meta:resourcekey="lnkCRMUsers"></asp:HyperLink>
<asp:HyperLink ID="lnkCRMUsers" runat="server" meta:resourcekey="lnkCRMUsers" Text="Full licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:HyperLink ID="lnkLimitedCRMUsers" runat="server" meta:resourcekey="lnkLimitedCRMUsers" Text="Limited licenses :"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="crmLimitedUsersStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
<tr class="OrgStatsRow">
<td align="right" nowrap>
<asp:Localize ID="locCRMDBSize" runat="server" meta:resourcekey="locCRMDBSize" Text="Storage size (ÌÂ):"></asp:Localize>
</td>
<td>
<wsp:QuotaViewer ID="crmDBSize" runat="server" QuotaTypeId="2" DisplayGauge="true" />
</td>
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="enterpriseStorageStatsPanel">

View file

@ -246,9 +246,18 @@ namespace WebsitePanel.Portal.ExchangeServer
lnkCRMUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "crmusers",
"SpaceID=" + PanelSecurity.PackageId);
lnkLimitedCRMUsers.NavigateUrl = lnkCRMUsers.NavigateUrl;
crmUsersStats.QuotaUsedValue = stats.CreatedCRMUsers;
crmUsersStats.QuotaValue = stats.AllocatedCRMUsers;
if (stats.AllocatedCRMUsers != -1) crmUsersStats.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
//if (stats.AllocatedCRMUsers != -1) crmUsersStats.QuotaAvailable = tenantStats.AllocatedCRMUsers - tenantStats.CreatedCRMUsers;
crmLimitedUsersStats.QuotaUsedValue = stats.CreatedLimitedCRMUsers;
crmLimitedUsersStats.QuotaValue = stats.AllocatedLimitedCRMUsers;
crmDBSize.QuotaUsedValue = Convert.ToInt32( stats.UsedCRMDiskSpace>0 ? stats.UsedCRMDiskSpace/(1024*1024) : -1);
crmDBSize.QuotaValue = Convert.ToInt32(stats.AllocatedCRMDiskSpace>0 ? stats.AllocatedCRMDiskSpace/(1024*1024) : -1);
}
private void BindOCSStats(OrganizationStatistics stats, OrganizationStatistics tenantStats)

View file

@ -535,6 +535,42 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmUsersStats;
/// <summary>
/// lnkLimitedCRMUsers 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 lnkLimitedCRMUsers;
/// <summary>
/// crmLimitedUsersStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmLimitedUsersStats;
/// <summary>
/// locCRMDBSize 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;
/// <summary>
/// crmDBSize control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer crmDBSize;
/// <summary>
/// enterpriseStorageStatsPanel control.
/// </summary>

View file

@ -193,6 +193,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
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);