fixing bugs
This commit is contained in:
parent
b9e6bafc1e
commit
54fade88c8
16 changed files with 81 additions and 109 deletions
|
@ -3025,4 +3025,14 @@ UPDATE EnterpriseFolders SET
|
|||
FolderName = @FolderName,
|
||||
FolderQuota = @FolderQuota
|
||||
WHERE ItemID = @ItemID AND FolderName = @FolderID
|
||||
GO
|
||||
|
||||
-- Enterprise Storage Quotas
|
||||
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'EnterpriseStorage.DiskStorageSpace')
|
||||
BEGIN
|
||||
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (430, 44, 1,N'EnterpriseStorage.DiskStorageSpace',N'Disk Storage Space (Mb)',2, 0 , NULL)
|
||||
END
|
||||
GO
|
||||
|
||||
UPDATE [dbo].[Quotas] SET [QuotaDescription] = N'Disk Storage Space (Mb)' WHERE [QuotaName] = 'EnterpriseStorage.DiskStorageSpace'
|
||||
GO
|
|
@ -828,19 +828,16 @@ namespace WebsitePanel.EnterpriseServer
|
|||
rule.Users.Add(permission.Account);
|
||||
}
|
||||
|
||||
if (permission.Access.ToLower().Contains("read"))
|
||||
if (permission.Access.ToLower().Contains("read-only"))
|
||||
{
|
||||
rule.Read = true;
|
||||
rule.Source = true;
|
||||
}
|
||||
|
||||
if (permission.Access.ToLower().Contains("write"))
|
||||
if (permission.Access.ToLower().Contains("read-write"))
|
||||
{
|
||||
rule.Write = true;
|
||||
}
|
||||
|
||||
if (permission.Access.ToLower().Contains("source"))
|
||||
{
|
||||
rule.Source = true;
|
||||
rule.Read = true;
|
||||
}
|
||||
|
||||
rule.Pathes.Add("*");
|
||||
|
@ -888,24 +885,13 @@ namespace WebsitePanel.EnterpriseServer
|
|||
permission.DisplayName = userObj.DisplayName;
|
||||
}
|
||||
|
||||
if (rule.Read)
|
||||
if (rule.Read && !rule.Write)
|
||||
{
|
||||
permission.Access += "Read,";
|
||||
permission.Access = "Read-Only";
|
||||
}
|
||||
|
||||
if (rule.Write)
|
||||
{
|
||||
permission.Access += "Write,";
|
||||
}
|
||||
|
||||
if (rule.Source)
|
||||
{
|
||||
permission.Access += "Source";
|
||||
}
|
||||
|
||||
if (permission.Access[permission.Access.Length - 1] == ',')
|
||||
{
|
||||
permission.Access = permission.Access.Remove(permission.Access.Length - 1);
|
||||
permission.Access = "Read-Write";
|
||||
}
|
||||
|
||||
permissions.Add(permission);
|
||||
|
|
|
@ -961,7 +961,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
stats.CreatedEnterpriseStorageFolders = folders.Count();
|
||||
|
||||
stats.UsedEnterpriseStorageSpace = folders.Where(x => x.FRSMQuotaGB != -1).Sum(x => x.FRSMQuotaGB);
|
||||
stats.UsedEnterpriseStorageSpace = folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1025,7 +1025,7 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
stats.CreatedEnterpriseStorageFolders += folders.Count();
|
||||
|
||||
stats.UsedEnterpriseStorageSpace += folders.Where(x => x.FRSMQuotaGB != -1).Sum(x => x.FRSMQuotaGB);
|
||||
stats.UsedEnterpriseStorageSpace += folders.Where(x => x.FRSMQuotaMB != -1).Sum(x => x.FRSMQuotaMB);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage
|
|||
{
|
||||
folder.Size = FileUtils.BytesToMb(FileUtils.CalculateFolderSize(dir.FullName));
|
||||
}
|
||||
|
||||
|
||||
folder.Url = string.Format("https://{0}/{1}/{2}", UsersDomain, organizationId, dir.Name);
|
||||
folder.Rules = webdav.GetFolderWebDavRules(organizationId, dir.Name);
|
||||
folder.FRSMQuotaMB = quota.Size;
|
||||
|
|
|
@ -5114,7 +5114,7 @@
|
|||
<value>Recoverable Items Storage, MB</value>
|
||||
</data>
|
||||
<data name="Quota.EnterpriseStorage.DiskStorageSpace" xml:space="preserve">
|
||||
<value>Disk Storage Space, Gb</value>
|
||||
<value>Disk Storage Space, Mb</value>
|
||||
</data>
|
||||
<data name="Quota.EnterpriseStorage.Folders" xml:space="preserve">
|
||||
<value>Number of Root Folders</value>
|
||||
|
|
|
@ -205,6 +205,6 @@
|
|||
<value>Folders:</value>
|
||||
</data>
|
||||
<data name="lblEnterpriseStorage.Text" xml:space="preserve">
|
||||
<value>Enterprise Storage:</value>
|
||||
<value>Enterprise Storage, MB:</value>
|
||||
</data>
|
||||
</root>
|
|
@ -214,7 +214,7 @@
|
|||
<value>Folders:</value>
|
||||
</data>
|
||||
<data name="lnkEnterpriseStorageSpace.Text" xml:space="preserve">
|
||||
<value>Used Diskspace (Gb):</value>
|
||||
<value>Used Diskspace (Mb):</value>
|
||||
</data>
|
||||
<data name="locEnterpriseStorage.Text" xml:space="preserve">
|
||||
<value>Enterprise Storage</value>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<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="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"></asp:RequiredFieldValidator>
|
||||
<asp:RangeValidator ID="rangeFolderSize" runat="server" ControlToValidate="txtFolderSize" MaximumValue="99999" MinimumValue="1"
|
||||
<asp:RangeValidator ID="rangeFolderSize" runat="server" ControlToValidate="txtFolderSize" MaximumValue="99999999" MinimumValue="1" Type="Integer"
|
||||
ValidationGroup="EditFolder" Display="Dynamic" Text="*" SetFocusOnError="True"
|
||||
ErrorMessage="The quota you’ve entered exceeds the available quota for tenant" />
|
||||
</td>
|
||||
|
|
|
@ -45,6 +45,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
public partial class EnterpriseStorageFolderGeneralSettings : WebsitePanelModuleBase
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const int OneGb = 1024;
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
|
@ -56,16 +62,16 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
}
|
||||
|
||||
BindSettings();
|
||||
}
|
||||
|
||||
OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||
|
||||
if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
|
||||
{
|
||||
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||
OrganizationStatistics organizationStats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID);
|
||||
|
||||
rangeFolderSize.MaximumValue = (tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace + Utils.ParseInt(txtFolderSize.Text, 0)).ToString();
|
||||
rangeFolderSize.ErrorMessage = string.Format("The quota you’ve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
|
||||
if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
|
||||
{
|
||||
OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID);
|
||||
|
||||
rangeFolderSize.MaximumValue = ((tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace)/OneGb + Utils.ParseInt(txtFolderSize.Text, 0)).ToString();
|
||||
rangeFolderSize.ErrorMessage = string.Format("The quota you’ve entered exceeds the available quota for tenant ({0}Gb)", rangeFolderSize.MaximumValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,7 +163,7 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
folder,
|
||||
permissions.GetPemissions(),
|
||||
chkDirectoryBrowsing.Checked,
|
||||
int.Parse(txtFolderSize.Text),
|
||||
int.Parse(txtFolderSize.Text) * OneGb,
|
||||
rbtnQuotaSoft.Checked ? QuotaType.Soft : QuotaType.Hard);
|
||||
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<asp:TemplateField HeaderText="gvFolderSize" SortExpression="Size">
|
||||
<ItemStyle Width="20%"></ItemStyle>
|
||||
<ItemTemplate>
|
||||
<asp:Literal id="litFolderSize" runat="server" Text='<%# Eval("Size").ToString() + " Mb" %>'></asp:Literal>
|
||||
<asp:Literal id="litFolderSize" runat="server" Text='<%# (ConvertMBytesToGB(Eval("Size"))).ToString("f1") + " Gb" %>'></asp:Literal>
|
||||
</ItemTemplate>
|
||||
</asp:TemplateField>
|
||||
<asp:TemplateField HeaderText="gvFolderUrl">
|
||||
|
|
|
@ -37,6 +37,12 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
{
|
||||
public partial class EnterpriseStorageFolders : WebsitePanelModuleBase
|
||||
{
|
||||
#region Constants
|
||||
|
||||
private const int OneGb = 1024;
|
||||
|
||||
#endregion
|
||||
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
|
@ -61,6 +67,11 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
"ItemID=" + PanelRequest.ItemID);
|
||||
}
|
||||
|
||||
public decimal ConvertMBytesToGB(object size)
|
||||
{
|
||||
return Convert.ToDecimal(size) / OneGb;
|
||||
}
|
||||
|
||||
protected void BindEnterpriseStorageStats()
|
||||
{
|
||||
btnAddFolder.Enabled = true;
|
||||
|
@ -74,15 +85,24 @@ namespace WebsitePanel.Portal.ExchangeServer
|
|||
if (organizationStats.AllocatedEnterpriseStorageFolders != -1)
|
||||
{
|
||||
int folderAvailable = foldersQuota.QuotaAvailable = tenantStats.AllocatedEnterpriseStorageFolders - tenantStats.CreatedEnterpriseStorageFolders;
|
||||
int spaceAvailable = tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace;
|
||||
|
||||
if (folderAvailable <= 0 || spaceAvailable <= 0)
|
||||
if (folderAvailable <= 0)
|
||||
{
|
||||
btnAddFolder.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
spaceQuota.QuotaValue = organizationStats.UsedEnterpriseStorageSpace;
|
||||
if (organizationStats.AllocatedEnterpriseStorageSpace != -1)
|
||||
{
|
||||
int spaceAvailable = (int)ConvertMBytesToGB(tenantStats.AllocatedEnterpriseStorageSpace - tenantStats.UsedEnterpriseStorageSpace);
|
||||
|
||||
if (spaceAvailable <= 0)
|
||||
{
|
||||
btnAddFolder.Enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
spaceQuota.QuotaValue = (int)ConvertMBytesToGB(organizationStats.UsedEnterpriseStorageSpace);
|
||||
}
|
||||
|
||||
protected void btnAddFolder_Click(object sender, EventArgs e)
|
||||
|
|
|
@ -129,17 +129,11 @@
|
|||
<data name="btnDelete.Text" xml:space="preserve">
|
||||
<value>Delete</value>
|
||||
</data>
|
||||
<data name="btnSet.Text" xml:space="preserve">
|
||||
<value>Set Permissions</value>
|
||||
<data name="btnSetReadOnly.Text" xml:space="preserve">
|
||||
<value>Set Read-Only</value>
|
||||
</data>
|
||||
<data name="chkRead" xml:space="preserve">
|
||||
<value>Read</value>
|
||||
</data>
|
||||
<data name="chkSource" xml:space="preserve">
|
||||
<value>Source</value>
|
||||
</data>
|
||||
<data name="chkWrite" xml:space="preserve">
|
||||
<value>Write</value>
|
||||
<data name="btnSetReadWrite.Text" xml:space="preserve">
|
||||
<value>Set Read-Write</value>
|
||||
</data>
|
||||
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
|
||||
<value>Display Name</value>
|
||||
|
|
|
@ -38,11 +38,8 @@
|
|||
</asp:GridView>
|
||||
<br />
|
||||
<div class="FormButtonsBarClean">
|
||||
<asp:CheckBox ID="chkRead" runat="server" Text="Read" meta:resourcekey="chkRead" />
|
||||
<asp:CheckBox ID="chkWrite" runat="server" Text="Write" meta:resourcekey="chkWrite" />
|
||||
<asp:CheckBox ID="chkSource" runat="server" Text="Source" meta:resourcekey="chkSource" />
|
||||
<br />
|
||||
<asp:Button ID="btnSet" runat="server" Text="Set Permissions" CssClass="Button1" OnClick="btn_UpdateAccess" meta:resourcekey="btnSet" />
|
||||
<asp:Button ID="btnSetReadOnly" runat="server" Text="Set Read-Only" CssClass="Button1" OnClick="btn_UpdateAccess" CommandArgument="Read-Only" meta:resourcekey="btnSetReadOnly" />
|
||||
<asp:Button ID="btnSetReadWrite" runat="server" Text="Set Read-Write" CssClass="Button1" OnClick="btn_UpdateAccess" CommandArgument="Read-Write" meta:resourcekey="btnSetReadWrite"/>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
{
|
||||
Account = account.AccountName,
|
||||
DisplayName = account.DisplayName,
|
||||
Access = "Read",
|
||||
Access = "Read-Only",
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -274,41 +274,16 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
|
|||
|
||||
CheckBox chkSelect = (CheckBox)row.FindControl("chkSelect");
|
||||
Literal litAccess = (Literal)row.FindControl("litAccess");
|
||||
|
||||
|
||||
if (chkSelect == null || litAccess == null)
|
||||
continue;
|
||||
|
||||
if (chkSelect.Checked)
|
||||
{
|
||||
chkSelect.Checked = false;
|
||||
|
||||
litAccess.Text = "";
|
||||
|
||||
if (chkRead.Checked)
|
||||
{
|
||||
litAccess.Text = "Read,";
|
||||
}
|
||||
|
||||
if (chkWrite.Checked)
|
||||
{
|
||||
litAccess.Text += "Write,";
|
||||
}
|
||||
|
||||
if (chkSource.Checked)
|
||||
{
|
||||
litAccess.Text += "Source";
|
||||
}
|
||||
|
||||
if (litAccess.Text[litAccess.Text.Length - 1] == ',')
|
||||
{
|
||||
litAccess.Text = litAccess.Text.Remove(litAccess.Text.Length - 1);
|
||||
}
|
||||
litAccess.Text = ((Button)sender).CommandArgument;
|
||||
}
|
||||
}
|
||||
|
||||
chkRead.Checked = false;
|
||||
chkWrite.Checked = false;
|
||||
chkSource.Checked = false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -49,40 +49,22 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls {
|
|||
protected global::System.Web.UI.WebControls.GridView gvPermissions;
|
||||
|
||||
/// <summary>
|
||||
/// chkRead control.
|
||||
/// btnSetReadOnly 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 chkRead;
|
||||
protected global::System.Web.UI.WebControls.Button btnSetReadOnly;
|
||||
|
||||
/// <summary>
|
||||
/// chkWrite control.
|
||||
/// btnSetReadWrite 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 chkWrite;
|
||||
|
||||
/// <summary>
|
||||
/// chkSource 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 chkSource;
|
||||
|
||||
/// <summary>
|
||||
/// btnSet 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 btnSet;
|
||||
protected global::System.Web.UI.WebControls.Button btnSetReadWrite;
|
||||
|
||||
/// <summary>
|
||||
/// AddAccountsPanel control.
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="ExchangeServer\EnterpriseStorageFolders.ascx.designer.cs">
|
||||
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
|
||||
<DependentUpon>EnterpriseStorageFolders.ascx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="ExchangeServer\OrganizationSecurityGroupMemberOf.ascx.cs">
|
||||
<DependentUpon>OrganizationSecurityGroupMemberOf.ascx</DependentUpon>
|
||||
|
@ -5278,12 +5278,14 @@
|
|||
</Content>
|
||||
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolders.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</Content>
|
||||
<Content Include="UserControls\App_LocalResources\OrgPolicyEditor.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageCreateFolder.ascx.resx" />
|
||||
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolderGeneralSettings.ascx.resx" />
|
||||
<Content Include="ExchangeServer\App_LocalResources\EnterpriseStorageFolderGeneralSettings.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ExchangeServer\UserControls\App_LocalResources\EnterpriseStoragePermissions.ascx.resx" />
|
||||
<Content Include="Lync\App_LocalResources\LyncPhoneNumbers.ascx.resx">
|
||||
<SubType>Designer</SubType>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue