Decoupling of userprincipalName and PrimaryEmailAddress
OrganizationUsers updated with image buttons with the ability to go directly
to offering settings
When changing primaryemailaddress, sip address changes accordingly
Mailboxes list view updated with Login (=userprincipalName) with the ability
to go directly to user setting
Lync list view updated with Login (=userprincipalName) with the ability
to go directly to user setting
This commit is contained in:
robvde 2012-11-22 13:16:41 +04:00
parent bc1168a1a4
commit 6cf946b6b4
30 changed files with 869 additions and 121 deletions

View file

@ -135,4 +135,7 @@
<data name="locPlanName.Text" xml:space="preserve">
<value>Plan Name :</value>
</data>
<data name="locSipAddress.Text" xml:space="preserve">
<value>SIP Address:</value>
</data>
</root>

View file

@ -126,8 +126,8 @@
<data name="ddlSearchColumnDisplayName.Text" xml:space="preserve">
<value>Display name</value>
</data>
<data name="ddlSearchColumnEmail.Text" xml:space="preserve">
<value>Sign-in name</value>
<data name="ddlSearchColumnUserPrincipalName.Text" xml:space="preserve">
<value>Login</value>
</data>
<data name="FormComments.Text" xml:space="preserve">
<value>&lt;p&gt;Microsoft Lync Server delivers unified communications to the users, including software-powered VoIP, Web and audio/video conferencing, and enterprise instant messaging.&lt;/p&gt;
@ -138,7 +138,7 @@
<value>Display name</value>
</data>
<data name="gvUsersEmail.HeaderText" xml:space="preserve">
<value>Sign-in name</value>
<value>SIP Address</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Lync Users</value>
@ -152,4 +152,7 @@
<data name="gvUsers.Empty" xml:space="preserve">
<value>No users have been Lync enabled. To enable a user for Lync click "Create Lync User" button.</value>
</data>
<data name="gvUsersLogin.Header" xml:space="preserve">
<value>Login</value>
</data>
</root>

View file

@ -7,6 +7,7 @@
<%@ Register Src="../UserControls/QuotaViewer.ascx" TagName="QuotaViewer" TagPrefix="wsp" %>
<%@ Register src="../ExchangeServer/UserControls/MailboxSelector.ascx" tagname="MailboxSelector" tagprefix="uc1" %>
<%@ Register Src="UserControls/LyncUserPlanSelector.ascx" TagName="LyncUserPlanSelector" TagPrefix="wsp" %>
<%@ Register Src="UserControls/LyncUserSettings.ascx" TagName="LyncUserSettings" TagPrefix="wsp" %>
<wsp:EnableAsyncTasksSupport id="asyncTasks" runat="server" />
<div id="ExchangeContainer">
@ -38,6 +39,15 @@
<wsp:LyncUserPlanSelector ID="planSelector" runat="server" />
</td>
</tr>
<tr>
<td class="FormLabel150">
<asp:Localize ID="locSipAddress" runat="server" meta:resourcekey="locSipAddress" Text="SIP Address: *"></asp:Localize>
</td>
<td>
<wsp:LyncUserSettings ID="lyncUserSettings" runat="server" />
</td>
</tr>
</table>
<div class="FormFooterClean">

View file

@ -52,6 +52,8 @@ namespace WebsitePanel.Portal.Lync
litDisplayName.Text = lyncUser.DisplayName;
planSelector.planId = lyncUser.LyncUserPlanId.ToString();
lyncUserSettings.sipAddress = lyncUser.SipAddress;
}
protected void btnSave_Click(object sender, EventArgs e)
@ -61,11 +63,18 @@ namespace WebsitePanel.Portal.Lync
try
{
LyncUserResult res = ES.Services.Lync.SetUserLyncPlan(PanelRequest.ItemID, PanelRequest.AccountID, Convert.ToInt32(planSelector.planId));
if (res.IsSuccess && res.ErrorCodes.Count == 0)
{
res = ES.Services.Lync.SetLyncUserGeneralSettings(PanelRequest.ItemID, PanelRequest.AccountID, lyncUserSettings.sipAddress, string.Empty);
}
if (res.IsSuccess && res.ErrorCodes.Count == 0)
{
messageBox.ShowSuccessMessage("UPDATE_LYNC_USER");
return;
}
else
messageBox.ShowMessage(res, "UPDATE_LYNC_USER", "LYNC");
}
catch(Exception ex)
{

View file

@ -1,33 +1,4 @@
// 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.
//
@ -122,6 +93,24 @@ namespace WebsitePanel.Portal.Lync {
/// </remarks>
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserPlanSelector planSelector;
/// <summary>
/// locSipAddress 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 locSipAddress;
/// <summary>
/// lyncUserSettings control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.Lync.UserControls.LyncUserSettings lyncUserSettings;
/// <summary>
/// btnSave control.
/// </summary>
@ -130,14 +119,5 @@ namespace WebsitePanel.Portal.Lync {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnSave;
/// <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

@ -41,7 +41,7 @@
<asp:DropDownList ID="ddlSearchColumn" runat="server" CssClass="NormalTextBox">
<asp:ListItem Value="DisplayName" meta:resourcekey="ddlSearchColumnDisplayName">DisplayName</asp:ListItem>
<asp:ListItem Value="PrimaryEmailAddress" meta:resourcekey="ddlSearchColumnEmail">Email</asp:ListItem>
<asp:ListItem Value="UserPrincipalName" meta:resourcekey="ddlSearchColumnUserPrincipalName">Email</asp:ListItem>
</asp:DropDownList>
<asp:TextBox ID="txtSearchValue" runat="server" CssClass="NormalTextBox" Width="100"></asp:TextBox><asp:ImageButton
ID="cmdSearch" runat="server" meta:resourcekey="cmdSearch" SkinID="SearchButton"
@ -64,10 +64,17 @@
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="gvUsersEmail" meta:resourcekey="gvUsersEmail" DataField="PrimaryEmailAddress"
SortExpression="PrimaryEmailAddress" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="gvLyncUserPlan" meta:resourcekey="gvLyncUserPlan" DataField="LyncUserPlanName"
SortExpression="LyncUserPlanName" ItemStyle-Width="50%" />
<asp:TemplateField HeaderText="gvUsersLogin" SortExpression="UserPrincipalName">
<ItemStyle ></ItemStyle>
<ItemTemplate>
<asp:hyperlink id="lnk1" runat="server"
NavigateUrl='<%# GetOrganizationUserEditUrl(Eval("AccountId").ToString()) %>'>
<%# Eval("UserPrincipalName") %>
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField HeaderText="gvUsersEmail" meta:resourcekey="gvUsersEmail" DataField="SipAddress" SortExpression="PrimaryUri" ItemStyle-Width="25%" />
<asp:BoundField HeaderText="gvLyncUserPlan" meta:resourcekey="gvLyncUserPlan" DataField="LyncUserPlanName" SortExpression="LyncUserPlanName" ItemStyle-Width="25%" />
<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="cmdDelete" runat="server" SkinID="ExchangeDelete"

View file

@ -108,8 +108,17 @@ namespace WebsitePanel.Portal.Lync
// bind stats
BindStats();
}
}
public string GetOrganizationUserEditUrl(string accountId)
{
return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "edit_user",
"AccountID=" + accountId,
"ItemID=" + PanelRequest.ItemID,
"Context=User");
}
}
}

View file

@ -155,14 +155,5 @@ namespace WebsitePanel.Portal.Lync {
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer usersQuota;
/// <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

@ -0,0 +1,2 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="LyncUserSettings.ascx.cs" Inherits="WebsitePanel.Portal.Lync.UserControls.LyncUserSettings" %>
<asp:DropDownList ID="ddlSipAddresses" runat="server" CssClass="NormalTextBox"></asp:DropDownList>

View file

@ -0,0 +1,102 @@
// Copyright (c) 2011, 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.Web.UI.WebControls;
using EntServer = WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal.Lync.UserControls
{
public partial class LyncUserSettings : WebsitePanelControlBase
{
private string sipAddressToSelect;
public string sipAddress
{
get { return ddlSipAddresses.SelectedItem.Value; }
set
{
sipAddressToSelect = value;
foreach (ListItem li in ddlSipAddresses.Items)
{
if (li.Value == value)
{
ddlSipAddresses.ClearSelection();
li.Selected = true;
break;
}
}
}
}
public int plansCount
{
get
{
return this.ddlSipAddresses.Items.Count;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BindAddresses();
}
}
private void BindAddresses()
{
EntServer.ExchangeEmailAddress[] emails = ES.Services.ExchangeServer.GetMailboxEmailAddresses(PanelRequest.ItemID, PanelRequest.AccountID);
foreach (EntServer.ExchangeEmailAddress email in emails)
{
ListItem li = new ListItem();
li.Text = email.EmailAddress;
li.Value = email.EmailAddress;
li.Selected = email.IsPrimary;
ddlSipAddresses.Items.Add(li);
}
foreach (ListItem li in ddlSipAddresses.Items)
{
if (li.Value == sipAddressToSelect)
{
ddlSipAddresses.ClearSelection();
li.Selected = true;
break;
}
}
}
}
}

View file

@ -0,0 +1,24 @@
//------------------------------------------------------------------------------
// <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.Lync.UserControls {
public partial class LyncUserSettings {
/// <summary>
/// ddlSipAddresses 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 ddlSipAddresses;
}
}