LdapSettingList.jsp 13.9 KB
<%@ page import="com.api.integration.ldap.constant.LdapConstant" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea" %>
<HTML>
<HEAD>
    <LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
    <SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
    <link rel="stylesheet" href="/css/ecology8/request/requestTopMenu_wev8.css" type="text/css"/>
    <link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/zDialog_e8_wev8.css" type="text/css"/>
    <script type="text/javascript" src="/js/dragBox/parentShowcol_wev8.js"></script>
    <link rel="stylesheet" href="/css/ecology8/request/requestView_wev8.css" type="text/css"/>
</head>
<%
    if (!HrmUserVarify.checkUserRight(LdapConstant.LDAP_RIGHT_KEY, user)) {
        response.sendRedirect("/notice/noright.jsp");
        return;
    }

    String titlename =  "LDAP" + SystemEnv.getHtmlLabelName(26267, user.getLanguage());
%>
<BODY>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
    RCMenu += "{" + SystemEnv.getHtmlLabelName(82, user.getLanguage()) + ",javascript:doAdd(),_self} ";
    RCMenuHeight += RCMenuHeightStep;
    //RCMenu += "{" + SystemEnv.getHtmlLabelName(23777, user.getLanguage()) + ",javascript:doDelete(),_self} ";
    //RCMenuHeight += RCMenuHeightStep;
    //RCMenu += "{" + SystemEnv.getHtmlLabelName(83, user.getLanguage()) + ",javascript:viewAllLog(),_self} ";
    //RCMenuHeight += RCMenuHeightStep;

    String searchValue = Util.null2String(request.getParameter("searchValue"));

    String sqlwhere = " where 1=1 ";
    if (!searchValue.isEmpty()) {
        sqlwhere += " and (ldapid like '%" + searchValue + "%' or ldapname like '%" + searchValue + "%') ";
    }

    //列表控件数据准备
    String backfields = " * ";
    String PageConstId = "Ldap_Setting_table";
    String fromSql = " LDAP_SETTING ";
    String sqlorderby = " CREATEDATE DESC, CREATETIME DESC ";
    String tableString = " <table instanceid=\"ListTable\" tabletype=\"none\"  pagesize=\"" + PageIdConst.getPageSize(PageConstId, user.getUID(), PageIdConst.Browser) + "\" >";
    tableString += " <checkboxpopedom    popedompara=\"column:ldapid\" showmethod=\"weaver.general.SplitPageTransmethod.getCheckBox\" />" +
            " <sql backfields=\"" + backfields + "\" sqlform=\"" + fromSql + "\" sqlwhere=\"" + Util.toHtmlForSplitPage(sqlwhere) + "\"  sqlorderby=\"" + sqlorderby + "\"  sqlprimarykey=\"ldapid\" sqlsortway=\"Aesc\" sqlisdistinct=\"true\" />" +
            "       <head>" +
            //标识
            "<col column=\"ldapid\" width=\"5%\" pkey=\"ldapid+com.api.integration.util.TableShowFormart.formartToEdit\"  text=\"" + SystemEnv.getHtmlLabelName(84, user.getLanguage()) + "\" transmethod=\"com.api.integration.util.TableShowFormart.formartToEdit\" otherpara=\"column:ldapid\" target=\"_self\"/>" +
            //名称
            "           <col column=\"ldapname\" width=\"5%\" pkey=\"ldapname\"  text=\"" + SystemEnv.getHtmlLabelName(195, user.getLanguage()) + "\" />" +
            //LDAP服务地址
            "           <col column=\"ip\" width=\"50%\" pkey=\"ip+com.api.integration.util.TableShowFormart.formartLdapURL\" text=\"" + SystemEnv.getHtmlLabelName(32286, user.getLanguage()) + "\" transmethod=\"com.api.integration.util.TableShowFormart.formartLdapURL\" otherpara=\"column:protocol+column:ip+column:port\" target=\"_self\"/>" +
            //LDAP 类别
            "           <col column=\"ldaptype\" width=\"5%\" pkey=\"ldaptype\" text=\"" + SystemEnv.getHtmlLabelName(33234, user.getLanguage()) + "\" />" +
            //启动标志
            "           <col column=\"isused\" width=\"5%\" pkey=\"isused+com.api.integration.util.TableShowFormart.formartOCFailedStauts\" text=\"" + SystemEnv.getHtmlLabelName(125504, user.getLanguage()) + "\" transmethod=\"com.api.integration.util.TableShowFormart.formartOCFailedStauts\" otherpara=\"" + user.getLanguage() + "\" target=\"_self\"/>" +
            //正向同步
            "           <col column=\"ispull\" width=\"5%\" pkey=\"ispullorg+com.api.integration.util.TableShowFormart.formartOCFailedStauts\" text=\"" + SystemEnv.getHtmlLabelName(131194, user.getLanguage()) + "\" transmethod=\"com.api.integration.util.TableShowFormart.formartOCFailedStauts\" otherpara=\"" + user.getLanguage() + "\" target=\"_self\"/>" +
            //反向同步
            "           <col column=\"ispush\" width=\"5%\" pkey=\"ispushorg+com.api.integration.util.TableShowFormart.formartOCFailedStauts\" text=\"" + SystemEnv.getHtmlLabelName(131272, user.getLanguage()) + "\" transmethod=\"com.api.integration.util.TableShowFormart.formartOCFailedStauts\" otherpara=\"" + user.getLanguage() + "\" target=\"_self\"/>" +
            "       </head>" +
            "<operates width=\"20%\">" +
            " <popedom transmethod=\"weaver.general.SplitPageTransmethod.getOpratePopedom\" otherpara=\"5\" ></popedom> " +
            "     <operate href=\"javascript:doTestById()\" text=\"" + SystemEnv.getHtmlLabelName(25496, user.getLanguage()) + "\" target=\"_self\" index=\"0\"/>" +
            "     <operate href=\"javascript:doEditById()\" text=\"" + SystemEnv.getHtmlLabelName(93, user.getLanguage()) + "\" target=\"_self\" index=\"1\"/>" +
            "     <operate href=\"javascript:doEditPullById()\" text=\"" + SystemEnv.getHtmlLabelName(131194, user.getLanguage()) + "\" target=\"_self\" index=\"2\"/>" +
            "     <operate href=\"javascript:doEditPushById()\" text=\"" + SystemEnv.getHtmlLabelName(131272, user.getLanguage()) + "\" target=\"_self\" index=\"3\"/>" +
            "     <operate href=\"javascript:doDeleteById()\" text=\"" + SystemEnv.getHtmlLabelName(23777, user.getLanguage()) + "\" target=\"_fullwindow\" index=\"4\"/>" +
            //"     <operate href=\"javascript:viewLog()\" text=\"" + SystemEnv.getHtmlLabelName(83, user.getLanguage()) + "\" target=\"_self\" index=\"3\"/>" +
            "</operates>" +
            " </table>";
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>

<table id="topTitle" cellpadding="0" cellspacing="0">
    <tr>
        <td></td>
        <td class="rightSearchSpan" style="text-align:right; width:500px!important">
            <%--新建--%>
            <input type="button" value="<%=SystemEnv.getHtmlLabelName(82 ,user.getLanguage()) %>" class="e8_btn_top"
                   onclick="doAdd()"/>
            <%--批量删除--%>
            <%--<input type="button" value="<%=SystemEnv.getHtmlLabelName(23777 ,user.getLanguage()) %>"--%>
            <%--class="e8_btn_top" onclick="doDelete()"/>--%>
            <%--查看日志--%>

            <%--<input type="button" value="<%=SystemEnv.getHtmlLabelName(83 ,user.getLanguage()) %>" class="e8_btn_top"--%>
            <%--onclick="viewAllLog()"/>--%>
            <%--快速搜索--%>
            <input type="text" class="searchInput" name="searchValue" value="<%=searchValue%>"/>
            &nbsp;&nbsp;&nbsp;
            <%--菜单--%>
            <span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage()) %>" class="cornerMenu"></span>
        </td>
    </tr>
</table>
<div id="tabDiv">
    <span style="font-size:14px;font-weight:bold;"><%=titlename%></span>
</div>

<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv">
    <form action="LdapSettingList.jsp" method="post" name="datalist" id="datalist">
        <wea:layout type="4col">
            <wea:group context='<%= SystemEnv.getHtmlLabelName(20331,user.getLanguage())%>'>
                <wea:item><%=SystemEnv.getHtmlLabelName(84, user.getLanguage())%>
                    <input type="text" id="name" name="name" value="<%=searchValue%>" class="InputStyle">
                </wea:item>
                <wea:item><%=SystemEnv.getHtmlLabelName(195, user.getLanguage())%>
                </wea:item>
            </wea:group>
            <wea:group context="" attributes="{'groupDisplay':'none'}">
                <wea:item type="toolbar">
                    <input type="submit" value="<%=SystemEnv.getHtmlLabelName(197 ,user.getLanguage()) %>"
                           class="e8_btn_submit" id="e8_btn_submit"/>

                    <input type="button" value="<%=SystemEnv.getHtmlLabelName(2022 ,user.getLanguage()) %>"
                           class="e8_btn_cancel" onclick="resetCondtion();"/>

                    <input type="button" value="<%=SystemEnv.getHtmlLabelName(201 ,user.getLanguage()) %>"
                           class="e8_btn_cancel" id="cancel"/>
                </wea:item>
            </wea:group>
        </wea:layout>
    </form>
</div>

<TABLE width="100%">
    <tr>
        <td valign="top">
            <input type="hidden" name="pageId" id="pageId" value="<%=PageConstId %>"/>
            <wea:SplitPageTag tableString='<%=tableString%>' isShowTopInfo="true" mode="run"/>
        </td>
    </tr>
</TABLE>
</BODY>
</HTML>
<script>

    var dialog = null; //弹框
    function closeDialog() {
        if (dialog)
            dialog.close();
    }

    function openDialog(url, title) {
        dialog = new window.top.Dialog();
        dialog.currentWindow = window;
        var url = url;
        dialog.Title = title;
        dialog.Width = 800;
        dialog.Height = 680;
        dialog.Drag = true;
        dialog.URL = url;
        dialog.maxiumnable = true;//允许最大化
        dialog.show();
    }
    //右侧操作区及查询区初始化
    jQuery(document).ready(function () {
        $("#topTitle").topMenuTitle({searchFn: doRefresh});
        $(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
        $("#tabDiv").remove();
        $("#advancedSearch").bind("click", function () {
            $(".searchInput").val('');
        });
    });

    //查询
    function doRefresh() {
        var searchValue = $("input[name='searchValue']", parent.document).val();
        window.location = "/integration/ldap/LdapSettingList.jsp?searchValue=" + searchValue;
    }
    //添加
    function doAdd() {
        var url = "/integration/ldap/LdapSettingTab.jsp?operate=add";
        var title = "<%=SystemEnv.getHtmlLabelName(365,user.getLanguage())%>LDAP<%=SystemEnv.getHtmlLabelName(26267,user.getLanguage())%>";
        openDialog(url, title);
    }

    function doEditById(ldapid) {
        if (ldapid == "") {
            return;
        }
        var url = "/integration/ldap/LdapSettingTab.jsp?operate=edit&ldapid=" + encodeURIComponent(ldapid);
        var title = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage())%>LDAP<%=SystemEnv.getHtmlLabelName(26267,user.getLanguage())%>";
        openDialog(url, title);
    }
	function doTestById(ldapid)
	{
		if(ldapid == "") {
			return ;
		}
		var url = "/integration/ldap/LdapSettingTab.jsp?operate=test&ldapid=" + encodeURIComponent(ldapid);
        var title = "<%=SystemEnv.getHtmlLabelName(25496,user.getLanguage())%>LDAP<%=SystemEnv.getHtmlLabelName(26267,user.getLanguage())%>";
        openDialog(url, title);
	}
    function doEditPullById(ldapid) {
        if (ldapid == "") {
            return;
        }
        var url = "/integration/ldap/LdapSettingTab.jsp?operate=pull&ldapid=" + encodeURIComponent(ldapid);
        var title = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage())%>LDAP<%=SystemEnv.getHtmlLabelName(26267,user.getLanguage())%>";
        openDialog(url, title);
    }

    function doEditPushById(ldapid) {
        if (ldapid == "") {
            return;
        }
        var url = "/integration/ldap/LdapSettingTab.jsp?operate=push&ldapid=" + encodeURIComponent(ldapid);
        var title = "<%=SystemEnv.getHtmlLabelName(93,user.getLanguage())%>LDAP<%=SystemEnv.getHtmlLabelName(26267,user.getLanguage())%>";
        openDialog(url, title);
    }

    function doDeleteById(ldapid) {
        if (ldapid == "") {
            return;
        }
        top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(15097,user.getLanguage())%>", function () {
            $.ajax({
                type: "post",
                data: "",
                url: "/api/integration/ldap/delete/" + encodeURIComponent(ldapid),
                success: function (data) {

                    data = jQuery.parseJSON(data);

                    //code == 100表示保存成功,其它都是失败。
                    if ("100" == data.code) {
                        doRefresh();
                    } else {
                        top.Dialog.alert(data.description, function(){
                            doRefresh();
                        });
                    }
                },
                error: function (jqXHR) {
                    top.Dialog.alert(jqXHR.statusText, function(){
                        doRefresh();
                    });
                }
            });
        }, function () {
        }, 320, 90);
    }

    function closeDlgARfsh() {
        closeDialog();
        _table.reLoad();
    }

    // 查看日志
    function viewLog(ldapid) {
        dialog = new window.top.Dialog();
        dialog.currentWindow = window;
        var url = "/integration/ldap/LdapSettingTab.jsp?operate=viewlog&isdialog=1&ldapid=" + encodeURIComponent(ldapid);
        dialog.Title = "<%=SystemEnv.getHtmlLabelNames("367,83",user.getLanguage())%>";
        dialog.Width = 1000;
        dialog.Height = 620;
        dialog.Drag = true;
        dialog.checkDataChange = false;
        dialog.maxiumnable = true;
        dialog.URL = url;
        dialog.show();
    }

    // 查看所有日志
    function viewAllLog() {
        dialog = new window.top.Dialog();
        dialog.currentWindow = window;
        var logsql = "";
        var url = "/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where " + logsql + "=382";
        dialog.Title = "<%=SystemEnv.getHtmlLabelNames("367,83",user.getLanguage())%>";
        dialog.Width = jQuery(window).width();
        dialog.Height = jQuery(window).height();
        dialog.Drag = true;
        dialog.checkDataChange = false;
        dialog.maxiumnable = true;
        dialog.URL = url;
        dialog.show();
    }
</script>