Account Home Organization module

This commit is contained in:
dev_amdtel 2014-08-05 18:32:21 +04:00
parent 45b1f20102
commit 6acb71d4b3
10 changed files with 955 additions and 324 deletions

View file

@ -54,7 +54,12 @@
<Control key="create_space" src="WebsitePanel/UserCreateSpace.ascx" title="UserCreateSpace" type="View" icon="sphere_add_48.png" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="UserNotes">
<ModuleDefinition id="UserOrganization">
<Controls>
<Control key="" src="WebsitePanel/UserOrganization.ascx" title="Organization" type="View" />
</Controls>
</ModuleDefinition>
<ModuleDefinition id="UserNotes">
<Controls>
<Control key="" src="WebsitePanel/UserAccountNotes.ascx" title="UserAccountNotes" type="View" />
</Controls>

View file

@ -38,6 +38,7 @@
<Module moduleDefinitionID="UserSpaces" title="UserSpaces" container="Browse.ascx" viewRoles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" icon="sphere_48.png">
<ModuleData ref="SpaceIcons"/>
</Module>
<Module moduleDefinitionID="UserOrganization" title="UserOrganization" container="Browse.ascx" viewRoles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk,User" icon="sphere_48.png" />
<Module moduleDefinitionID="UserNotes" title="UserNotes" container="Browse.ascx" viewRoles="Administrator,Reseller,PlatformCSR,ResellerCSR,PlatformHelpdesk,ResellerHelpdesk" icon="notes_48.png" />
</Content>
<Content id="RightPane">

View file

@ -786,4 +786,7 @@
<data name="ModuleTitle.PhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="ModuleTitle.UserOrganization" xml:space="preserve">
<value>Hosted Organization</value>
</data>
</root>

View file

@ -0,0 +1,252 @@
<?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="gvPackagesCreationDate.Header" xml:space="preserve">
<value>Creation Date</value>
</data>
<data name="gvPackagesHostingPlan.Header" xml:space="preserve">
<value>Hosting Plan</value>
</data>
<data name="gvPackagesName.Header" xml:space="preserve">
<value>Name</value>
</data>
<data name="gvPackagesPricing.Header" xml:space="preserve">
<value>Pricing</value>
</data>
<data name="gvPackagesServer.Header" xml:space="preserve">
<value>Server</value>
</data>
<data name="gvPackagesStatus.Header" xml:space="preserve">
<value>Status</value>
</data>
<data name="selPackage.AlternateText" xml:space="preserve">
<value>Switch to this Space</value>
</data>
<data name="Text.ActiveSyncPolicy" xml:space="preserve">
<value>ActiveSync Policy</value>
</data>
<data name="Text.BlackBerryGroup" xml:space="preserve">
<value>BlackBerry</value>
</data>
<data name="Text.BlackBerryUsers" xml:space="preserve">
<value>BlackBerry Users</value>
</data>
<data name="Text.Contacts" xml:space="preserve">
<value>Contacts</value>
</data>
<data name="Text.CRM2013Group" xml:space="preserve">
<value>CRM 2013</value>
</data>
<data name="Text.CRMGroup" xml:space="preserve">
<value>CRM</value>
</data>
<data name="Text.CRMOrganization" xml:space="preserve">
<value>CRM Organization</value>
</data>
<data name="Text.CRMUsers" xml:space="preserve">
<value>CRM Users</value>
</data>
<data name="Text.Disclaimers" xml:space="preserve">
<value>Disclaimers</value>
</data>
<data name="Text.DistributionLists" xml:space="preserve">
<value>Distribution Lists</value>
</data>
<data name="Text.DomainNames" xml:space="preserve">
<value>Domains</value>
</data>
<data name="Text.EnterpriseStorageDriveMaps" xml:space="preserve">
<value>Drive Maps</value>
</data>
<data name="Text.EnterpriseStorageFolders" xml:space="preserve">
<value>Folders</value>
</data>
<data name="Text.EnterpriseStorageGroup" xml:space="preserve">
<value>Enterprise Storage</value>
</data>
<data name="Text.ExchangeDomainNames" xml:space="preserve">
<value>Accepted Domains</value>
</data>
<data name="Text.ExchangeGroup" xml:space="preserve">
<value>Exchange</value>
</data>
<data name="Text.LyncFederationDomains" xml:space="preserve">
<value>Lync Federation Domains</value>
</data>
<data name="Text.LyncGroup" xml:space="preserve">
<value>Lync</value>
</data>
<data name="Text.LyncPhoneNumbers" xml:space="preserve">
<value>Phone Numbers</value>
</data>
<data name="Text.LyncUserPlans" xml:space="preserve">
<value>Lync User Plans</value>
</data>
<data name="Text.LyncUsers" xml:space="preserve">
<value>Lync Users</value>
</data>
<data name="Text.Mailboxes" xml:space="preserve">
<value>Mailboxes</value>
</data>
<data name="Text.MailboxPlans" xml:space="preserve">
<value>Mailbox Plans</value>
</data>
<data name="Text.OCSGroup" xml:space="preserve">
<value>OCS</value>
</data>
<data name="Text.OCSUsers" xml:space="preserve">
<value>OCS Users</value>
</data>
<data name="Text.OrganizationGroup" xml:space="preserve">
<value>Organization</value>
</data>
<data name="Text.OrganizationHome" xml:space="preserve">
<value>Organization Home</value>
</data>
<data name="Text.PublicFolders" xml:space="preserve">
<value>Public Folders</value>
</data>
<data name="Text.RetentionPolicy" xml:space="preserve">
<value>Retention Policy</value>
</data>
<data name="Text.RetentionPolicyTag" xml:space="preserve">
<value>Retention Policy Tag</value>
</data>
<data name="Text.SecurityGroups" xml:space="preserve">
<value>Groups</value>
</data>
<data name="Text.Setup" xml:space="preserve">
<value>Setup</value>
</data>
<data name="Text.SharePointGroup" xml:space="preserve">
<value>SharePoint</value>
</data>
<data name="Text.SiteCollections" xml:space="preserve">
<value>Site Collections</value>
</data>
<data name="Text.StorageLimits" xml:space="preserve">
<value>Storage Settings</value>
</data>
<data name="Text.StorageUsage" xml:space="preserve">
<value>Storage Usage</value>
</data>
<data name="Text.Users" xml:space="preserve">
<value>Users</value>
</data>
</root>

View file

@ -31,16 +31,20 @@ using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.WebPortal;
using WebsitePanel.Portal.UserControls;
namespace WebsitePanel.Portal
{
public partial class OrganizationMenu : WebsitePanelModuleBase
public partial class OrganizationMenu : OrganizationMenuControl
{
private const string PID_SPACE_EXCHANGE_SERVER = "SpaceExchangeServer";
protected void Page_Load(object sender, EventArgs e)
{
ShortMenu = false;
ShowImg = false;
// organization
bool orgVisible = (PanelRequest.ItemID > 0 && Request[DefaultPage.PAGE_ID_PARAM].Equals(PID_SPACE_EXCHANGE_SERVER, StringComparison.InvariantCultureIgnoreCase));
@ -53,331 +57,18 @@ namespace WebsitePanel.Portal
menu.Items.Add(rootItem);
//Add "Organization Home" menu item
MenuItem item = new MenuItem(
GetLocalizedString("Text.OrganizationHome"),
"",
"",
PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", "SpaceID=" + PanelSecurity.PackageId));
rootItem.ChildItems.Add(item);
BindMenu(rootItem.ChildItems);
}
}
private void BindMenu(MenuItemCollection items)
{
PackageContext cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
string imagePath = String.Concat("~/", DefaultPage.THEMES_FOLDER, "/", Page.Theme, "/", "Images/Exchange", "/");
//Add "Organization Home" menu item
MenuItem item = new MenuItem(
GetLocalizedString("Text.OrganizationHome"),
"",
"",
PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), "organization_home", "SpaceID=" + PanelSecurity.PackageId));
items.Add(item);
//Organization menu group;
if (cntx.Groups.ContainsKey(ResourceGroups.HostedOrganizations))
PrepareOrganizationMenuRoot(cntx, items, imagePath);
//Exchange menu group;
if (cntx.Groups.ContainsKey(ResourceGroups.Exchange))
PrepareExchangeMenuRoot(cntx, items, imagePath);
//BlackBerry Menu
if (cntx.Groups.ContainsKey(ResourceGroups.BlackBerry))
PrepareBlackBerryMenuRoot(cntx, items, imagePath);
//SharePoint menu group;
if (cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
PrepareSharePointMenuRoot(cntx, items, imagePath);
//CRM Menu
if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
PrepareCRM2013MenuRoot(cntx, items, imagePath);
else if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
PrepareCRMMenuRoot(cntx, items, imagePath);
//OCS Menu
if (cntx.Groups.ContainsKey(ResourceGroups.OCS))
PrepareOCSMenuRoot(cntx, items, imagePath);
//Lync Menu
if (cntx.Groups.ContainsKey(ResourceGroups.Lync))
PrepareLyncMenuRoot(cntx, items, imagePath);
//EnterpriseStorage Menu
if (cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage))
PrepareEnterpriseStorageMenuRoot(cntx, items, imagePath);
}
private void PrepareOrganizationMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
bool hideItems = false;
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx)))
hideItems = true;
}
if (!hideItems)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.OrganizationGroup"), "", "", null);
item.Selectable = false;
PrepareOrganizationMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareOrganizationMenu(PackageContext cntx, MenuItemCollection items)
{
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx) == false)
{
if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, cntx))
items.Add(CreateMenuItem("DomainNames", "org_domains"));
}
if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, cntx))
items.Add(CreateMenuItem("Users", "users"));
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPS, cntx))
items.Add(CreateMenuItem("SecurityGroups", "secur_groups"));
}
private void PrepareExchangeMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
bool hideItems = false;
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, cntx)))
hideItems = true;
}
MenuItem item = new MenuItem(GetLocalizedString("Text.ExchangeGroup"), "", "", null);
item.Selectable = false;
PrepareExchangeMenu(cntx, item.ChildItems, hideItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareExchangeMenu(PackageContext cntx, MenuItemCollection exchangeItems, bool hideItems)
{
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeItems.Add(CreateMenuItem("Mailboxes", "mailboxes"));
if (Utils.CheckQouta(Quotas.EXCHANGE2007_CONTACTS, cntx))
exchangeItems.Add(CreateMenuItem("Contacts", "contacts"));
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, cntx))
exchangeItems.Add(CreateMenuItem("DistributionLists", "dlists"));
if (Utils.CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, cntx))
exchangeItems.Add(CreateMenuItem("PublicFolders", "public_folders"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, cntx))
exchangeItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, cntx))
exchangeItems.Add(CreateMenuItem("RetentionPolicy", "retentionpolicy"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, cntx))
exchangeItems.Add(CreateMenuItem("RetentionPolicyTag", "retentionpolicytag"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeItems.Add(CreateMenuItem("ExchangeDomainNames", "domains"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))
exchangeItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISCLAIMERSALLOWED, cntx))
exchangeItems.Add(CreateMenuItem("Disclaimers", "disclaimers"));
}
private void PrepareCRMMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.CRMGroup"), "", "", null);
item.Selectable = false;
PrepareCRMMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareCRMMenu(PackageContext cntx, MenuItemCollection crmItems)
{
crmItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails"));
crmItems.Add(CreateMenuItem("CRMUsers", "CRMUsers"));
crmItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
}
private void PrepareCRM2013MenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.CRM2013Group"), "", "", null);
item.Selectable = false;
PrepareCRM2013Menu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareCRM2013Menu(PackageContext cntx, MenuItemCollection crmItems)
{
crmItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails"));
crmItems.Add(CreateMenuItem("CRMUsers", "CRMUsers"));
crmItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
}
private void PrepareBlackBerryMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.BlackBerryGroup"), "", "", null);
item.Selectable = false;
PrepareBlackBerryMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareBlackBerryMenu(PackageContext cntx, MenuItemCollection bbItems)
{
bbItems.Add(CreateMenuItem("BlackBerryUsers", "blackberry_users"));
}
private void PrepareSharePointMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.SharePointGroup"), "", "", null);
item.Selectable = false;
PrepareSharePointMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareSharePointMenu(PackageContext cntx, MenuItemCollection spItems)
{
spItems.Add(CreateMenuItem("SiteCollections", "sharepoint_sitecollections"));
spItems.Add(CreateMenuItem("StorageUsage", "sharepoint_storage_usage"));
spItems.Add(CreateMenuItem("StorageLimits", "sharepoint_storage_settings"));
}
private void PrepareOCSMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.OCSGroup"), "", "", null);
item.Selectable = false;
PrepareOCSMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareOCSMenu(PackageContext cntx, MenuItemCollection osItems)
{
osItems.Add(CreateMenuItem("OCSUsers", "ocs_users"));
}
private void PrepareLyncMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.LyncGroup"), "", "", null);
item.Selectable = false;
PrepareLyncMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareLyncMenu(PackageContext cntx, MenuItemCollection lyncItems)
{
lyncItems.Add(CreateMenuItem("LyncUsers", "lync_users"));
lyncItems.Add(CreateMenuItem("LyncUserPlans", "lync_userplans"));
if (Utils.CheckQouta(Quotas.LYNC_FEDERATION, cntx))
lyncItems.Add(CreateMenuItem("LyncFederationDomains", "lync_federationdomains"));
if (Utils.CheckQouta(Quotas.LYNC_PHONE, cntx))
lyncItems.Add(CreateMenuItem("LyncPhoneNumbers", "lync_phonenumbers"));
}
private void PrepareEnterpriseStorageMenuRoot(PackageContext cntx, MenuItemCollection items, string imagePath)
{
MenuItem item = new MenuItem(GetLocalizedString("Text.EnterpriseStorageGroup"), "", "", null);
item.Selectable = false;
PrepareEnterpriseStorageMenu(cntx, item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
private void PrepareEnterpriseStorageMenu(PackageContext cntx, MenuItemCollection enterpriseStorageItems)
{
enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageFolders", "enterprisestorage_folders"));
if(Utils.CheckQouta(Quotas.ENTERPRICESTORAGE_DRIVEMAPS, cntx))
enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageDriveMaps", "enterprisestorage_drive_maps"));
}
private MenuItem CreateMenuItem(string text, string key)
{
MenuItem item = new MenuItem();
item.Text = GetLocalizedString("Text." + text);
item.NavigateUrl = PortalUtils.EditUrl("ItemID", PanelRequest.ItemID.ToString(), key,
"SpaceID=" + PanelSecurity.PackageId);
return item;
}
}
}

View file

@ -0,0 +1,480 @@
// 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.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer;
using System.Xml;
using System.Collections.Generic;
using WebsitePanel.WebPortal;
namespace WebsitePanel.Portal.UserControls
{
public class OrganizationMenuControl : WebsitePanelModuleBase
{
virtual public string ImagePath
{
get { return String.Concat("~/", DefaultPage.THEMES_FOLDER, "/", Page.Theme, "/"); }
}
virtual public int PackageId
{
get { return PanelSecurity.PackageId; }
}
virtual public int ItemID
{
get { return PanelRequest.ItemID; }
}
private PackageContext cntx = null;
virtual public PackageContext Cntx
{
get
{
if (cntx == null) cntx = PackagesHelper.GetCachedPackageContext(PackageId);
return cntx;
}
}
public bool ShortMenu = false;
public bool ShowImg = false;
public void BindMenu(MenuItemCollection items)
{
//Organization menu group;
if (Cntx.Groups.ContainsKey(ResourceGroups.HostedOrganizations))
PrepareOrganizationMenuRoot(items);
//Exchange menu group;
if (Cntx.Groups.ContainsKey(ResourceGroups.Exchange))
PrepareExchangeMenuRoot(items);
//BlackBerry Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.BlackBerry))
PrepareBlackBerryMenuRoot(items);
//SharePoint menu group;
if (Cntx.Groups.ContainsKey(ResourceGroups.HostedSharePoint))
PrepareSharePointMenuRoot(items);
//CRM Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))
PrepareCRM2013MenuRoot(items);
else if (Cntx.Groups.ContainsKey(ResourceGroups.HostedCRM))
PrepareCRMMenuRoot(items);
//OCS Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.OCS))
PrepareOCSMenuRoot(items);
//Lync Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.Lync))
PrepareLyncMenuRoot(items);
//EnterpriseStorage Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.EnterpriseStorage))
PrepareEnterpriseStorageMenuRoot(items);
}
private void PrepareOrganizationMenuRoot(MenuItemCollection items)
{
bool hideItems = false;
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, Cntx)))
hideItems = true;
}
if (!hideItems)
{
if (ShortMenu)
{
PrepareOrganizationMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.OrganizationGroup"), "", "", null);
item.Selectable = false;
PrepareOrganizationMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
}
private void PrepareOrganizationMenu(MenuItemCollection items)
{
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, Cntx) == false)
{
if (Utils.CheckQouta(Quotas.ORGANIZATION_DOMAINS, Cntx))
items.Add(CreateMenuItem("DomainNames", "org_domains"));
}
if (Utils.CheckQouta(Quotas.ORGANIZATION_USERS, Cntx))
items.Add(CreateMenuItem("Users", "users", @"Icons/user_48.png"));
if (Utils.CheckQouta(Quotas.ORGANIZATION_SECURITYGROUPS, Cntx))
items.Add(CreateMenuItem("SecurityGroups", "secur_groups", @"Icons/group_48.png"));
}
private void PrepareExchangeMenuRoot(MenuItemCollection items)
{
bool hideItems = false;
UserInfo user = UsersHelper.GetUser(PanelSecurity.EffectiveUserId);
if (user != null)
{
if ((user.Role == UserRole.User) & (Utils.CheckQouta(Quotas.EXCHANGE2007_ISCONSUMER, Cntx)))
hideItems = true;
}
if (ShortMenu)
{
PrepareExchangeMenu(items, hideItems);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.ExchangeGroup"), "", "", null);
item.Selectable = false;
PrepareExchangeMenu(item.ChildItems, hideItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareExchangeMenu(MenuItemCollection exchangeItems, bool hideItems)
{
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, Cntx))
exchangeItems.Add(CreateMenuItem("Mailboxes", "mailboxes", @"Icons/accounting_mail_48.png"));
if (ShortMenu) return;
if (Utils.CheckQouta(Quotas.EXCHANGE2007_CONTACTS, Cntx))
exchangeItems.Add(CreateMenuItem("Contacts", "contacts"));
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISTRIBUTIONLISTS, Cntx))
exchangeItems.Add(CreateMenuItem("DistributionLists", "dlists"));
if (Utils.CheckQouta(Quotas.EXCHANGE2007_PUBLICFOLDERS, Cntx))
exchangeItems.Add(CreateMenuItem("PublicFolders", "public_folders"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_ACTIVESYNCALLOWED, Cntx))
exchangeItems.Add(CreateMenuItem("ActiveSyncPolicy", "activesync_policy"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, Cntx))
exchangeItems.Add(CreateMenuItem("MailboxPlans", "mailboxplans"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, Cntx))
exchangeItems.Add(CreateMenuItem("RetentionPolicy", "retentionpolicy"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWRETENTIONPOLICY, Cntx))
exchangeItems.Add(CreateMenuItem("RetentionPolicyTag", "retentionpolicytag"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, Cntx))
exchangeItems.Add(CreateMenuItem("ExchangeDomainNames", "domains"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, Cntx))
exchangeItems.Add(CreateMenuItem("StorageUsage", "storage_usage"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_DISCLAIMERSALLOWED, Cntx))
exchangeItems.Add(CreateMenuItem("Disclaimers", "disclaimers"));
}
private void PrepareCRMMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareCRMMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.CRMGroup"), "", "", null);
item.Selectable = false;
PrepareCRMMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareCRMMenu(MenuItemCollection crmItems)
{
crmItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails", @"Images/crm_48.png"));
crmItems.Add(CreateMenuItem("CRMUsers", "CRMUsers", @"Images/crm_48.png"));
if (ShortMenu) return;
crmItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
}
private void PrepareCRM2013MenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareCRM2013Menu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.CRM2013Group"), "", "", null);
item.Selectable = false;
PrepareCRM2013Menu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareCRM2013Menu(MenuItemCollection crmItems)
{
crmItems.Add(CreateMenuItem("CRMOrganization", "CRMOrganizationDetails", @"Images/crm_48.png"));
crmItems.Add(CreateMenuItem("CRMUsers", "CRMUsers", @"Images/crm_48.png"));
if (ShortMenu) return;
crmItems.Add(CreateMenuItem("StorageLimits", "crm_storage_settings"));
}
private void PrepareBlackBerryMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareBlackBerryMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.BlackBerryGroup"), "", "", null);
item.Selectable = false;
PrepareBlackBerryMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareBlackBerryMenu(MenuItemCollection bbItems)
{
bbItems.Add(CreateMenuItem("BlackBerryUsers", "blackberry_users", @"Images/blackberry48.png"));
}
private void PrepareSharePointMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareSharePointMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.SharePointGroup"), "", "", null);
item.Selectable = false;
PrepareSharePointMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareSharePointMenu(MenuItemCollection spItems)
{
spItems.Add(CreateMenuItem("SiteCollections", "sharepoint_sitecollections", @"Images/Exchange/storage_limits_48.png"));
if (ShortMenu) return;
spItems.Add(CreateMenuItem("StorageUsage", "sharepoint_storage_usage"));
spItems.Add(CreateMenuItem("StorageLimits", "sharepoint_storage_settings"));
}
private void PrepareOCSMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareOCSMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.OCSGroup"), "", "", null);
item.Selectable = false;
PrepareOCSMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareOCSMenu(MenuItemCollection osItems)
{
osItems.Add(CreateMenuItem("OCSUsers", "ocs_users"));
}
private void PrepareLyncMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareLyncMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.LyncGroup"), "", "", null);
item.Selectable = false;
PrepareLyncMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareLyncMenu(MenuItemCollection lyncItems)
{
lyncItems.Add(CreateMenuItem("LyncUsers", "lync_users", @"Images/lync48.png"));
if (ShortMenu) return;
lyncItems.Add(CreateMenuItem("LyncUserPlans", "lync_userplans"));
if (Utils.CheckQouta(Quotas.LYNC_FEDERATION, Cntx))
lyncItems.Add(CreateMenuItem("LyncFederationDomains", "lync_federationdomains"));
if (Utils.CheckQouta(Quotas.LYNC_PHONE, Cntx))
lyncItems.Add(CreateMenuItem("LyncPhoneNumbers", "lync_phonenumbers"));
}
private void PrepareEnterpriseStorageMenuRoot(MenuItemCollection items)
{
if (ShortMenu)
{
PrepareEnterpriseStorageMenu(items);
}
else
{
MenuItem item = new MenuItem(GetLocalizedString("Text.EnterpriseStorageGroup"), "", "", null);
item.Selectable = false;
PrepareEnterpriseStorageMenu(item.ChildItems);
if (item.ChildItems.Count > 0)
{
items.Add(item);
}
}
}
private void PrepareEnterpriseStorageMenu(MenuItemCollection enterpriseStorageItems)
{
enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageFolders", "enterprisestorage_folders", @"Images/folder_48.png"));
if (ShortMenu) return;
if (Utils.CheckQouta(Quotas.ENTERPRICESTORAGE_DRIVEMAPS, Cntx))
enterpriseStorageItems.Add(CreateMenuItem("EnterpriseStorageDriveMaps", "enterprisestorage_drive_maps"));
}
private MenuItem CreateMenuItem(string text, string key)
{
return CreateMenuItem(text, key, null);
}
private MenuItem CreateMenuItem(string text, string key, string img)
{
MenuItem item = new MenuItem();
item.Text = GetLocalizedString("Text." + text);
item.NavigateUrl = PortalUtils.EditUrl("ItemID", ItemID.ToString(), key,
"SpaceID=" + PackageId);
if (ShowImg)
{
if (img==null)
item.ImageUrl = ImagePath + "Icons/tool_48.png";
else
item.ImageUrl = ImagePath + img;
}
return item;
}
}
}

View file

@ -0,0 +1,20 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserOrganization.ascx.cs" Inherits="WebsitePanel.Portal.UserOrganization" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<%@ Register Src="UserControls/ServerDetails.ascx" TagName="ServerDetails" TagPrefix="uc3" %>
<%@ Register Src="UserControls/Comments.ascx" TagName="Comments" TagPrefix="uc4" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<asp:Panel ID="UserOrgPanel" runat="server" Visible="false">
<asp:DataList ID="OrgIcons" runat="server"
CellSpacing="1" RepeatColumns="5" RepeatDirection="Horizontal">
<ItemTemplate>
<asp:Panel ID="IconPanel" runat="server" CssClass="Icon">
<asp:HyperLink ID="imgLink" runat="server" NavigateUrl='<%# Eval("NavigateURL") %>'><asp:Image ID="imgIcon" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' /></asp:HyperLink>
<br />
<asp:HyperLink ID="lnkIcon" runat="server" NavigateUrl='<%# Eval("NavigateURL") %>'><%# Eval("Text") %></asp:HyperLink>
</asp:Panel>
</ItemTemplate>
</asp:DataList>
</asp:Panel>

View file

@ -0,0 +1,132 @@
// 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.
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Collections.Generic;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.WebPortal;
using WebsitePanel.Portal.UserControls;
namespace WebsitePanel.Portal
{
public partial class UserOrganization : OrganizationMenuControl
{
private void FindDefaultOrg()
{
DataSet rawPackages = new PackagesHelper().GetMyPackages();
if (rawPackages.Tables.Count<1) return;
DataTable packages = rawPackages.Tables[0];
for(int i=0;i<packages.Rows.Count;i++)
{
int pId = (int)packages.Rows[i]["PackageID"];
DataTable orgs = new OrganizationsHelper().GetOrganizations(pId, false);
for(int j=0;j<orgs.Rows.Count;j++)
{
DataRow org = orgs.Rows[j];
int iId = (int)org["ItemID"];
if (packageId==0)
{
packageId = pId;
itemID = iId;
}
object isDefault = org["IsDefault"];
if (isDefault is bool)
{
if ((bool)isDefault)
{
packageId = pId;
itemID = iId;
return;
}
}
}
}
}
int packageId = 0;
override public int PackageId
{
get
{
return packageId;
}
}
int itemID = 0;
override public int ItemID
{
get
{
return itemID;
}
}
protected void Page_Load(object sender, EventArgs e)
{
FindDefaultOrg();
ShortMenu = true;
ShowImg = true;
if (PackageId > 0)
{
MenuItemCollection items = new MenuItemCollection();
BindMenu(items);
UserOrgPanel.Visible = true;
OrgIcons.DataSource = items;
OrgIcons.DataBind();
}
else
UserOrgPanel.Visible = false;
}
}
}

View file

@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <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 UserOrganization {
/// <summary>
/// UserOrgPanel 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 UserOrgPanel;
/// <summary>
/// OrgIcons 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.DataList OrgIcons;
}
}

View file

@ -602,6 +602,9 @@
<Compile Include="UserControls\EditFeedsList.ascx.designer.cs">
<DependentUpon>EditFeedsList.ascx</DependentUpon>
</Compile>
<Compile Include="UserControls\OrganizationMenuControl.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserControls\OrgIdPolicyEditor.ascx.cs">
<DependentUpon>OrgIdPolicyEditor.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -630,6 +633,13 @@
<Compile Include="Lync\UserControls\AllocatePackagePhoneNumbers.ascx.designer.cs">
<DependentUpon>AllocatePackagePhoneNumbers.ascx</DependentUpon>
</Compile>
<Compile Include="UserOrganization.ascx.cs">
<DependentUpon>UserOrganization.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="UserOrganization.ascx.designer.cs">
<DependentUpon>UserOrganization.ascx</DependentUpon>
</Compile>
<Compile Include="VPSForPC\MonitoringPage.aspx.cs">
<DependentUpon>MonitoringPage.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -4147,6 +4157,7 @@
<Content Include="UserControls\OrgPolicyEditor.ascx" />
<Content Include="UserControls\PackagePhoneNumbers.ascx" />
<Content Include="Lync\UserControls\AllocatePackagePhoneNumbers.ascx" />
<Content Include="UserOrganization.ascx" />
<Content Include="VPSForPC\MonitoringPage.aspx" />
<Content Include="VPSForPC\VdcAccountVLanAdd.ascx" />
<Content Include="VPSForPC\VdcAccountVLanNetwork.ascx" />
@ -5354,6 +5365,9 @@
<SubType>Designer</SubType>
</Content>
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageCreateDriveMap.ascx.resx" />
<Content Include="App_LocalResources\UserOrganization.ascx.resx">
<SubType>Designer</SubType>
</Content>
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType>
</EmbeddedResource>