This commit is contained in:
dev_amdtel 2014-03-13 14:10:34 +04:00
commit 1410f1b39c
40 changed files with 865 additions and 268 deletions

View file

@ -141,4 +141,28 @@
<data name="locTitle" xml:space="preserve">
<value>Create New Folder</value>
</data>
<data name="locAddDefaultGroup" xml:space="preserve">
<value>Add Default Group</value>
</data>
<data name="locFolderSize" xml:space="preserve">
<value>Folder Limit Size (Gb):</value>
</data>
<data name="locQuotaType" xml:space="preserve">
<value>Quota Type:</value>
</data>
<data name="rangeFolderSize" xml:space="preserve">
<value>*</value>
</data>
<data name="rbtnQuotaHard" xml:space="preserve">
<value>Hard</value>
</data>
<data name="rbtnQuotaSoft" xml:space="preserve">
<value>Soft</value>
</data>
<data name="valRequireFolderSize" xml:space="preserve">
<value>valRequireFolderSize</value>
</data>
<data name="valRequireFolderSize.ErrorMessage" xml:space="preserve">
<value>Enter Folder Size</value>
</data>
</root>

View file

@ -32,6 +32,31 @@
ErrorMessage="Enter Folder Name" ValidationGroup="CreateFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
</td>
</tr>
<tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locFolderSize" runat="server" meta:resourcekey="locFolderSize" Text="Folder Limit Size (Gb):"></asp:Localize></td>
<td>
<asp:TextBox ID="txtFolderSize" runat="server" CssClass="HugeTextBox200"></asp:TextBox>
<asp:RequiredFieldValidator ID="valRequireFolderSize" runat="server" meta:resourcekey="valRequireFolderSize" ControlToValidate="txtFolderSize"
ErrorMessage="Enter Folder Size" ValidationGroup="CreateFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
<asp:RangeValidator ID="rangeFolderSize" runat="server" ControlToValidate="txtFolderSize" MaximumValue="99999999" MinimumValue="0.01" Type="Double"
ValidationGroup="CreateFolder" Display="Dynamic" Text="*" SetFocusOnError="True"
ErrorMessage="The quota youve entered exceeds the available quota for tenant" />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locQuotaType" runat="server" meta:resourcekey="locQuotaType" Text="Quota Type:"></asp:Localize></td>
<td class="FormRBtnL">
<asp:RadioButton ID="rbtnQuotaSoft" runat="server" meta:resourcekey="rbtnQuotaSoft" Text="Soft" GroupName="QuotaType" Checked="true" />
<asp:RadioButton ID="rbtnQuotaHard" runat="server" meta:resourcekey="rbtnQuotaHard" Text="Hard" GroupName="QuotaType" />
</td>
</tr>
<tr>
<td class="FormLabel150"><asp:Localize ID="locAddDefaultGroup" runat="server" meta:resourcekey="locAddDefaultGroup" Text="Add Default Group:"></asp:Localize></td>
<td>
<asp:CheckBox id="chkAddDefaultGroup" runat="server" Checked="false"></asp:CheckBox>
</td>
</tr>
</table>
<div class="FormFooterClean">
<asp:Button id="btnCreate" runat="server" Text="Create Folder" CssClass="Button1" meta:resourcekey="btnCreate" ValidationGroup="CreateFolder" OnClick="btnCreate_Click"></asp:Button>

View file

@ -30,11 +30,18 @@ using System;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.OS;
namespace WebsitePanel.Portal.ExchangeServer
{
public partial class EnterpriseStorageCreateFolder : WebsitePanelModuleBase
{
#region Constants
private const int OneGb = 1024;
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
@ -44,6 +51,17 @@ namespace WebsitePanel.Portal.ExchangeServer
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folders",
"ItemID=" + PanelRequest.ItemID));
}
OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
{
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
rangeFolderSize.MaximumValue = Math.Round((tenantStats.AllocatedEnterpriseStorageSpace - (decimal)tenantStats.UsedEnterpriseStorageSpace) / OneGb
+ Utils.ParseDecimal(txtFolderSize.Text, 0), 2).ToString();
rangeFolderSize.ErrorMessage = string.Format("The quota youve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
}
}
}
@ -69,13 +87,18 @@ namespace WebsitePanel.Portal.ExchangeServer
ES.Services.EnterpriseStorage.CreateEnterpriseStorage(PanelSecurity.PackageId, PanelRequest.ItemID);
}
ResultObject result = ES.Services.EnterpriseStorage.CreateEnterpriseFolder(PanelRequest.ItemID, txtFolderName.Text);
ResultObject result = ES.Services.EnterpriseStorage.CreateEnterpriseFolder(
PanelRequest.ItemID,
txtFolderName.Text,
(int)(decimal.Parse(txtFolderSize.Text) * OneGb),
rbtnQuotaSoft.Checked ? QuotaType.Soft : QuotaType.Hard,
chkAddDefaultGroup.Checked);
if (!result.IsSuccess && result.ErrorCodes.Count > 0)
/*if (!result.IsSuccess && result.ErrorCodes.Count > 0)
{
messageBox.ShowMessage(result, "ENTERPRISE_STORAGE_CREATE_FOLDER", "Enterprise Storage");
return;
}
}*/
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "enterprisestorage_folder_settings",
"FolderID=" + txtFolderName.Text,

View file

@ -121,6 +121,87 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.RequiredFieldValidator valRequireFolderName;
/// <summary>
/// locFolderSize 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 locFolderSize;
/// <summary>
/// txtFolderSize 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.TextBox txtFolderSize;
/// <summary>
/// valRequireFolderSize 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.RequiredFieldValidator valRequireFolderSize;
/// <summary>
/// rangeFolderSize 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.RangeValidator rangeFolderSize;
/// <summary>
/// locQuotaType 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 locQuotaType;
/// <summary>
/// rbtnQuotaSoft 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.RadioButton rbtnQuotaSoft;
/// <summary>
/// rbtnQuotaHard 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.RadioButton rbtnQuotaHard;
/// <summary>
/// locAddDefaultGroup 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 locAddDefaultGroup;
/// <summary>
/// chkAddDefaultGroup 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.CheckBox chkAddDefaultGroup;
/// <summary>
/// btnCreate control.
/// </summary>

View file

@ -339,14 +339,14 @@ namespace WebsitePanel.Portal.ExchangeServer
enterpriseStorageSpaceStats.QuotaUsedValue = stats.UsedEnterpriseStorageSpace;
if (stats.AllocatedEnterpriseStorageSpace != -1) enterpriseStorageSpaceStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace;
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
lnkEnterpriseStorageSpace.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
"SpaceID=" + PanelSecurity.PackageId.ToString());
enterpriseStorageFoldersStats.QuotaValue = stats.AllocatedEnterpriseStorageFolders;
enterpriseStorageFoldersStats.QuotaUsedValue = stats.CreatedEnterpriseStorageFolders;
if (stats.AllocatedEnterpriseStorageFolders != -1) enterpriseStorageFoldersStats.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
lnkBESUsers.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
lnkEnterpriseStorageFolders.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "enterprisestorage_folders",
"SpaceID=" + PanelSecurity.PackageId.ToString());
}

View file

@ -2,6 +2,6 @@
<asp:SiteMapDataSource ID="siteMapSource" runat="server" ShowStartingNode="False" />
<asp:Menu ID="topMenu" runat="server" DataSourceID="siteMapSource"
CssSelectorClass="TopMenu" Orientation="Horizontal"
CssSelectorClass="TopMenu" Orientation="Horizontal"
EnableViewState="False" onmenuitemdatabound="topMenu_MenuItemDataBound">
</asp:Menu>

View file

@ -41,6 +41,19 @@ namespace WebsitePanel.Portal.SkinControls
{
public partial class TopMenu : System.Web.UI.UserControl
{
public string Align
{
get
{
if (ViewState["Align"] == null)
{
return "top";
}
return ViewState["Align"].ToString();
}
set { ViewState["Align"] = value; }
}
protected void Page_Load(object sender, EventArgs e)
{
@ -48,7 +61,15 @@ namespace WebsitePanel.Portal.SkinControls
protected void topMenu_MenuItemDataBound(object sender, MenuEventArgs e)
{
string target = ((SiteMapNode)e.Item.DataItem)["target"];
var node = ((SiteMapNode)e.Item.DataItem);
if (node["align"] == Align)
{
topMenu.Items.Remove(e.Item);
return;
}
string target = node["target"];
if(!String.IsNullOrEmpty(target))
e.Item.Target = target;

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.3074
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

View file

@ -1,11 +1,9 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SpaceMenu.ascx.cs" Inherits="WebsitePanel.Portal.SpaceMenu" %>
<div class="MenuHeader">
<asp:Localize ID="locMenuTitle" runat="server" meta:resourcekey="locMenuTitle"></asp:Localize>
</div>
<div class="Menu">
<asp:Menu ID="menu" runat="server"
Orientation="Vertical"
EnableViewState="false"
CssSelectorClass="LeftMenu" >
</asp:Menu>
</div>
<asp:Localize ID="locMenuTitle" runat="server" meta:resourcekey="locMenuTitle" Visible="false"></asp:Localize>
<asp:Menu ID="menu" runat="server"
Orientation="Horizontal"
EnableViewState="false"
CssSelectorClass="TopMenu" >
</asp:Menu>

View file

@ -53,7 +53,12 @@ namespace WebsitePanel.Portal
cntx = PackagesHelper.GetCachedPackageContext(PanelSecurity.PackageId);
// bind root node
BindMenu(menu.Items, PortalUtils.GetModuleMenuItems(this));
MenuItem rootItem = new MenuItem(locMenuTitle.Text);
rootItem.Selectable = false;
menu.Items.Add(rootItem);
BindMenu(rootItem.ChildItems, PortalUtils.GetModuleMenuItems(this));
}
private void BindMenu(MenuItemCollection items, XmlNodeList nodes)

View file

@ -1,17 +1,61 @@
// 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.42
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class SpaceMenu {
protected System.Web.UI.WebControls.Localize locMenuTitle;
protected System.Web.UI.WebControls.Menu menu;
/// <summary>
/// locMenuTitle 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 locMenuTitle;
/// <summary>
/// menu 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.Menu menu;
}
}

View file

@ -1,11 +1,9 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UserAccountMenu.ascx.cs" Inherits="WebsitePanel.Portal.UserAccountMenu" %>
<div class="MenuHeader">
<asp:Localize ID="locMenuTitle" runat="server" meta:resourcekey="locMenuTitle"></asp:Localize>
</div>
<div class="Menu">
<asp:Menu ID="menu" runat="server"
Orientation="Vertical"
EnableViewState="false"
CssSelectorClass="LeftMenu" >
</asp:Menu>
</div>
<asp:Localize ID="locMenuTitle" runat="server" meta:resourcekey="locMenuTitle" Visible="false"></asp:Localize>
<asp:Menu ID="menu" runat="server"
Orientation="Horizontal"
EnableViewState="false"
CssSelectorClass="TopMenu" >
</asp:Menu>

View file

@ -47,7 +47,12 @@ namespace WebsitePanel.Portal
{
protected void Page_Load(object sender, EventArgs e)
{
BindMenu(menu.Items, PortalUtils.GetModuleMenuItems(this));
MenuItem rootItem = new MenuItem(locMenuTitle.Text);
rootItem.Selectable = false;
menu.Items.Add(rootItem);
BindMenu(rootItem.ChildItems, PortalUtils.GetModuleMenuItems(this));
}
private void BindMenu(MenuItemCollection items, XmlNodeList nodes)