<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.tool.*" %>
<%@ page import="java.util.*" %>
<%@ include file="sessionInfo2.jsp"%>
<head>
<title>数飞表单自定义</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007.css" rel="stylesheet" type="text/css">
</head>

<%
    BdForm bdForm = new BdForm();
    String XML_str[] = new String[1];
    int iLen = XML_str.length;       
    String sModule = "simpleform.xml";
    XML_str[0] = sModule;    
%>
<!-----上面的工具栏------>
<%@ include file="/share/title.jsp"%>
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass"
       cellpadding="3" cellspacing="0" align="center">
  <tr class="trClassTitle">
    <td width="300">表单描述（中文名）</td>   
    <td>功能入口</td>
  </tr>
<%

    Iterator iterForm = null;
    String sFormName = "";
    String formID = "";
    BdFormInfo bdFormInfo = null;
    boolean hasFlow = false;

    String sTableName = "";
    String sTemp = "";
    BdRelateForm bdRelateForm = new BdRelateForm();
		String sRelateButton = "";
		int i = 0;
%>
<%
      //根据
      iterForm = bdForm.getFormInfoList(XML_str[i]).iterator();
      while (iterForm != null && iterForm.hasNext()) {
    		bdFormInfo = (BdFormInfo)iterForm.next();  
    		formID = bdFormInfo.getFormId();
        sFormName = bdFormInfo.getFormName();
        hasFlow = false;
        if ( bdFormInfo.getHasFlow().equals("1")) {
        	hasFlow = true;
        }
        sTableName  = bdForm.getTableStr(XML_str[i], sFormName);
        sTemp = "";
        sTemp += sFormName;
        
%>
  <tr onMouseOver="javascript:this.className='trMouseOver'" onMouseOut="javascript:this.className='trMouseOut'">
    <td align="center"><%=bdFormInfo.getFormDesc()%>&nbsp;</td> 
    <td align="left"> 
    
      <% if (!hasFlow) { %>    
				<a href="../../share/formEngine2/update.jsp?FormID=<%=formID%>&OPERATOR=add">【添加】</a>
        <a href="../../share/formEngine2/index.jsp?FormID=<%=formID%>">【数据列表】</a>
        <a href="../../share/formEngine2/search.jsp?FormID=<%=formID%>">【综合查询】</a>
       
      <% } else { %>
      <a href="../../share/formEngine2/update.jsp?FormID=<%=formID%>&OPERATOR=add">【申请】</a>
      <a href="../../share/formEngine2/index.jsp?FormID=<%=formID%>">【申请列表】</a>
      <a href="../../share/formEngine2/index_transact.jsp?FormID=<%=formID%>">【待办列表】</a>
      <a href="../../share/formEngine2/index_transacted.jsp?FormID=<%=formID%>">【已办列表】</a>
      <a href="../../share/formEngine2/index_receive.jsp?FormID=<%=formID%>">【待阅列表】</a>
      <a href="../../share/formEngine2/index_manage.jsp?FormID=<%=formID%>">【管理列表】</a>
      <% } %> &nbsp; 
    </td>
  </tr>
<%
      }
%>
</table>
<script language="javascript" src="../../share/js/commonTool.js"></script>
<script language="javascript">
  //增加一个XML模块配置文件
  function SaveXMLModule() {
    if (form.moduleName.value == "") {
      form.moduleName.focus();
      alert("模块名称不能为空");
      return;
    }
    if (!isLetterOrNumOrLine(form.moduleName.value)) {
      alert("模块名称有不允许的字符");
      form.moduleName.focus();
      return false;
    }    
    form.action = "formControl.jsp";
    form.OPERATOR.value = "XMLModule";
    form.submit();
  }
  
  function EditUI(moduleName, formName) {
  	var url = "formEdit.jsp?moduleName=" + moduleName + "&formName=" + formName;
    window.open(url, '', 'left=20,top=20,scrollbars=yes,resizable=yes,status=yes,width=1100,height=720');
  }
  
  function DeleteModule(vModuleName) {
	var theResponse = window.prompt("请输入删除的密码：");
	if (theResponse == "xiaomutou") {
	  var vUrl = "formControl.jsp?moduleName=" + vModuleName + "&OPERATOR=DeleteModule";
	  document.location.href = vUrl;	  
	} else {
	  alert("密码不正确，不能删除模块");
	}  
  }
  
  function DeleteForm(moduleName, formName) {
  	if (confirm("确定要删除?")) {
  		var vUrl = "formControl.jsp?moduleName=" + moduleName + "&formName=" + formName + "&OPERATOR=DeleteForm";
  		document.location.href = vUrl;  	
  	}
  }
  
  //重新创建表
  function ReCreateTable(moduleName, formName, operator) {
  	var vUrl = "formControl.jsp?moduleName=" + moduleName;
  	if (formName != "") {
		vUrl += "&formName=" + formName;
		
  	}
  	vUrl += "&OPERATOR=" + operator;
  	if (confirm("重新创建表将丢失已录入的数据,是否继续?")) {
		document.location.href = vUrl;
  	}  	
  }
  
  function ReCheckTable(moduleName, formName, operator) {
  	var vUrl = "formCheck.jsp?moduleName=" + moduleName + "&formName=" + formName;
  	vUrl += "&OPERATOR=" + operator;
	document.location.href = vUrl;
  }  
</script>
