Fix up sharepoint 2013 mess

This commit is contained in:
robvde 2015-04-05 11:30:57 +08:00
parent fed079a14b
commit 42b4d87301
26 changed files with 141 additions and 144 deletions

View file

@ -204,8 +204,8 @@
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
<value>SharePoint Foundation</value>
</data>
<data name="Text.SharePointServerGroup" xml:space="preserve">
<value>SharePoint Server</value>
<data name="Text.SharePointEnterpriseServerGroup" xml:space="preserve">
<value>SharePoint Enterprise Server</value>
</data>
<data name="Text.SiteCollections" xml:space="preserve">
<value>Site Collections</value>

View file

@ -237,8 +237,8 @@
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
<value>Hosted Organization - SharePoint Foundation Server</value>
</data>
<data name="Text.SharePointServerGroup" xml:space="preserve">
<value>Hosted Organization - SharePoint Server</value>
<data name="Text.SharePointEnterpriseServerGroup" xml:space="preserve">
<value>Hosted Organization - SharePoint Enterprise Server</value>
</data>
<data name="Text.SiteCollections" xml:space="preserve">
<value>Sharepoint Sites</value>

View file

@ -37,7 +37,6 @@ using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.Providers.SharePoint;
using System.Collections.Generic;
using WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
{
@ -45,28 +44,19 @@ namespace WebsitePanel.Portal
{
SharePointSiteCollectionListPaged result;
public int GetSharePointSiteCollectionPagedCount(int packageId, int organizationId, string groupName, string filterColumn, string filterValue)
public int GetSharePointSiteCollectionPagedCount(int packageId, int organizationId, string filterColumn, string filterValue)
{
return result.TotalRowCount;
}
public List<SharePointSiteCollection> GetSharePointSiteCollectionPaged(int packageId, int organizationId, string groupName, string filterColumn, string filterValue, int maximumRows, int startRowIndex, string sortColumn)
public List<SharePointSiteCollection> GetSharePointSiteCollectionPaged(int packageId, int organizationId, string filterColumn, string filterValue, int maximumRows, int startRowIndex, string sortColumn)
{
if (!String.IsNullOrEmpty(filterValue))
{
filterValue = filterValue + "%";
}
if (ResourceGroups.SharepointFoundationServer.Replace(" ", "").Equals(groupName))
{
groupName = ResourceGroups.SharepointFoundationServer;
}
else if (ResourceGroups.SharepointServer.Replace(" ", "").Equals(groupName))
{
groupName = ResourceGroups.SharepointServer;
}
result = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, sortColumn, startRowIndex, maximumRows, groupName);
result = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, sortColumn, startRowIndex, maximumRows);
return result.SiteCollections;
}

View file

@ -168,8 +168,8 @@
<data name="Text.SharePointFoundationServerGroup" xml:space="preserve">
<value>SharePoint Foundation</value>
</data>
<data name="Text.SharePointServerGroup" xml:space="preserve">
<value>SharePoint Server</value>
<data name="Text.SharePointEnterpriseServerGroup" xml:space="preserve">
<value>SharePoint Enterprise</value>
</data>
<data name="Text.OCSGroup" xml:space="preserve">
<value>OCS</value>

View file

@ -319,9 +319,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointFoundationServerGroup"));
}
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointServer))
if (cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer))
{
PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointServerGroup"));
PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointEnterpriseServerGroup"));
}
//CRM Menu

View file

@ -14,7 +14,6 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="sharepoint_sitecollections" />
</div>
<div class="Content">
<div class="Center">

View file

@ -21,15 +21,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <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>

View file

@ -15,7 +15,6 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="sharepoint_sitecollections" />
</div>
<div class="Content">
<div class="Center">

View file

@ -44,11 +44,6 @@ namespace WebsitePanel.Portal
{
SharePointSiteCollection item = null;
public static string GroupName
{
get { return HttpContext.Current.Request["GroupName"]; }
}
private int OrganizationId
{
get
@ -230,7 +225,7 @@ namespace WebsitePanel.Portal
/// <returns> Reserved disk space vallue.</returns>
private int GetReservedDiskStorageSpace()
{
var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false, GroupName);
var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false);
return (int)existingCollections.Sum(siteCollection => siteCollection.MaxSiteStorage);
}
@ -257,20 +252,9 @@ namespace WebsitePanel.Portal
{
item = new SharePointSiteCollection();
string groupName = GroupName;
if (ResourceGroups.SharepointFoundationServer.Replace(" ", "").Equals(groupName))
{
groupName = ResourceGroups.SharepointFoundationServer;
}
else if (ResourceGroups.SharepointServer.Replace(" ", "").Equals(groupName))
{
groupName = ResourceGroups.SharepointServer;
}
if (!UseSharedSLL(PanelSecurity.PackageId))
if (!UseSharedSLL(PanelSecurity.PackageId))
{
SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue, groupName);
SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue);
foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections)
{
Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name);
@ -303,7 +287,7 @@ namespace WebsitePanel.Portal
item.MaxSiteStorage = maxStorage.QuotaValue;
item.WarningStorage = warningStorage.QuotaValue;
int result = ES.Services.HostedSharePointServers.AddSiteCollection(item, groupName);
int result = ES.Services.HostedSharePointServers.AddSiteCollection(item);
if (result < 0)
{
localMessageBox.ShowResultMessage(result);
@ -390,19 +374,19 @@ namespace WebsitePanel.Portal
protected void btnBackup_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName));
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString()));
}
protected void btnRestore_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName));
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString()));
}
private void RedirectToSiteCollectionsList()
{
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName));
Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString()));
}
private bool UseSharedSLL(int packageID)

View file

@ -21,15 +21,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <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>

View file

@ -17,7 +17,6 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="sharepoint_sitecollections" />
</div>
<div class="Content">
<div class="Center">

View file

@ -21,15 +21,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks;
/// <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>

View file

@ -14,7 +14,6 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="storage_limits" />
</div>
<div class="Content">
<div class="Center">

View file

@ -12,15 +12,6 @@ namespace WebsitePanel.Portal {
public partial class HostedSharePointStorageSettings {
/// <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>

View file

@ -11,7 +11,6 @@
<div id="ExchangeContainer">
<div class="Module">
<div class="Left">
<wsp:Menu id="menu" runat="server" SelectedItem="storage_limits" />
</div>
<div class="Content">
<div class="Center">

View file

@ -12,15 +12,6 @@ namespace WebsitePanel.Portal {
public partial class HostedSharePointStorageUsage {
/// <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>

View file

@ -161,7 +161,7 @@ namespace WebsitePanel.Portal
(resourceGroup.GroupName == ResourceGroups.Os)|
(resourceGroup.GroupName == ResourceGroups.HostedOrganizations) |
(resourceGroup.GroupName == ResourceGroups.SharepointFoundationServer) |
(resourceGroup.GroupName == ResourceGroups.SharepointServer) |
(resourceGroup.GroupName == ResourceGroups.SharepointEnterpriseServer) |
(resourceGroup.GroupName == ResourceGroups.Mail)|
(resourceGroup.GroupName == ResourceGroups.Lync)|
(resourceGroup.GroupName == ResourceGroups.Exchange)|

View file

@ -98,8 +98,8 @@ namespace WebsitePanel.Portal.UserControls
if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer))
PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointFoundationServerGroup"), ResourceGroups.SharepointFoundationServer.Replace(" ", ""));
if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointServer))
PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointServerGroup"), ResourceGroups.SharepointServer.Replace(" ", ""));
if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer))
PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointEnterpriseServerGroup"), ResourceGroups.SharepointEnterpriseServer.Replace(" ", ""));
//CRM Menu
if (Cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013))