<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ include file="/xml/formEngine2/sessionInfo2.jsp"%>
<%
    strLevel_SESSION = "../../../";
    strSkin_SESSION = "../../../images/skin2_blue2";
%>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>
<%
	String moduleName = SzConvert.strWriteData(request.getParameter("moduleName"));
	String formName = SzConvert.strWriteData(request.getParameter("formName"));

	BdRelateForm relateForm = new BdRelateForm();
    int i = 0;
    //列出跟本表单关联的组合.
    Collection collRelate = relateForm.getRelateList(moduleName, formName);
    Iterator iterRelate = null;
    if (collRelate != null) {
    	iterRelate = collRelate.iterator();
    }
%>
<!-----上面的工具栏------>
<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.button("添加", "javascript:FormSubmit(formList, 'relateForm_update.jsp?OPERATOR=add&moduleName=" + moduleName + "&formName=" +formName + "');")%>
      <%=SzPageHelp.button("返回", "javascript:document.location.href='../formIndex.jsp?module=" + moduleName + "'")%>      
    </td>
  </tr>
</table>

<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formList" method="post">

  <tr class="trClassTitle">
    <td>关联说明</td>
    <td>模块名称</td>
    <td>表单名称</td>
    <td>权限类型</td>
    <td>被关联的主表</td>
    <td>被关联的表单</td>
    <td width="40">操作</td>
  </tr>
<%
    int iLen = 0;
    String temp = "";
    BdRelateFormInfo relateInfo = null;
    
    Collection collRelateForm = null;
    Iterator iterRelateForm = null;
    String s_relateForm[] = null;
    String str_relateForm = "";
    String popedom = "";
    while (iterRelate != null && iterRelate.hasNext()) {
    	relateInfo = (BdRelateFormInfo)iterRelate.next();
    	//列出被关联的表单
    	collRelateForm = relateInfo.getRelateForm();
    	str_relateForm = "";
    	if (collRelateForm != null) {
    		iterRelateForm = collRelateForm.iterator();
    		while (iterRelateForm.hasNext()) {
    			s_relateForm = (String[])iterRelateForm.next();
    			str_relateForm += s_relateForm[0] + "," + s_relateForm[1] + ";  ";
    		}
    	}
    	popedom = SzConvert.toZeroStr(relateInfo.getPopedom());
    	if (popedom.equals("0")) {
    		popedom = "权限被关联";
    	} else if (popedom.equals("1")) {
    		popedom = "独立权限";
    	} else if (popedom.equals("2")) {
    		popedom = "独立流程";
    	} else if (popedom.equals("3")) {
    		popedom = "关联主流程";
    	}
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td><%=relateInfo.getDesc() %>&nbsp;</td>
    <td><%=relateInfo.getModuleName() %>&nbsp;</td>
    <td><%=relateInfo.getFormName() %>&nbsp;</td>
    <td><%=popedom %>&nbsp;</td>
    <td><%=relateInfo.getRelateTable() %>&nbsp;</td>
    <td><%=str_relateForm%></td>
    <td><a href="relateForm_update.jsp?OPERATOR=update&id=<%=relateInfo.getId()%>">修改</a>
        <a href="relateForm_control.jsp?OPERATOR=delete&id=<%=relateInfo.getId()%>&moduleName=<%=moduleName %>&formName=<%=formName %>">删除</a>&nbsp;</td>
  </tr>
<%
    }
    out.println(SzPageHelp.outIndexTableTr(i, SzProperties.I_PageSize, 7));
%>
  </form>
</table>

<!-----下面的工具栏------>
<table width="100%" cellpadding="1" cellspacing="0">
  <form name="formPage" method="post">
  <tr>
    <td align="right">
      &nbsp;
    </td>
  </tr>
  </form>
</table>

<!-----这里包含要提交的内容--->
<form name="formHidden" method="post">
</form>
<script language="javascript" src="../../../share/js/commonTool.js"></script>