zoukankan      html  css  js  c++  java
  • 自定义webpart显示Lync状态球

    LYNC状态球显示

    参考了http://blogs.msdn.com/b/uksharepoint/archive/2010/05/07/office-communicator-integration-presence-in-a-custom-webpart-for-sharepoint-2010.aspx

    这边是用户集来显示状态球,我小改了一下,把用户集合改成单个用户

    public string GetPresenceHTMLFromUVC1(SPSite thisSite, SPFieldUserValue spuv)

            {

                StringBuilder abc = new StringBuilder("");

               

                SPSecurity.RunWithElevatedPrivileges(delegate

                {

                    using (SPWeb thisWeb = thisSite.RootWeb)

                    {

                        string sipAddress = "";

                        SPListItem user = thisWeb.SiteUserInfoList.GetItemById(spuv.LookupId);

                        if (user["EMail"] != null)

                        {

                            sipAddress = "sip:" + user["EMail"].ToString();

                        }

     

                        abc.Append(String.Concat(

                         "<img border="0" height="12" src="/_layouts/images/imnhdr.gif" onload="IMNRC('"

                        , sipAddress

                        , "')" ShowOfflinePawn="1" style="padding-right: 3px;" id="PresencePawn"

                        , sipAddress

                        , "" alt="presence pawn for "

                        , sipAddress

                        , ""/>"

                        , spuv.User.Name

                        ));

     

                    }

                });

                return abc.ToString();

    直接传单个用户,省去遍历用户的ID

    我这边SIP用的是EMAIL的地址,而SIP为空,这边取的是EMAIL的值

    效果如下(IMNRC这个只在IE中有效):

  • 相关阅读:
    cf 1179 C
    P5055 【模板】可持久化文艺平衡树 可持久化fhqtreap
    bzoj4605: 崂山白花蛇草水 权值线段树套KDtree
    luoguP4173 残缺的字符串 FFT
    [HNOI2016]序列 CDQ+DP
    [TJOI2017]不勤劳的图书管理员
    loj2058 「TJOI / HEOI2016」求和 NTT
    bzoj4503: 两个串
    luoguP4721 【模板】分治 FFT
    [Cqoi2016]K远点对 K-Dtree
  • 原文地址:https://www.cnblogs.com/rimtd/p/3284320.html
Copyright © 2011-2022 走看看