<%@ page contentType="text/html;charset=GBK" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.tool.SzDateHelp" %>
<%@ page import="net.sz600.system.*" %>
<%@ page import="net.sz600.docEngine.*" %>
<%@ include file="/sessionInfo.jsp"%>
<%
  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">
<style type="text/css">
  .readClass {
      background:#D4D0C8;
      readonly;
  }
  .selectClass {
      width:70;
  }  
</style>
<script language="javascript">
  function ChangePopedom(vType) {
    if (vType == "0") {
       formUpdate.TypeDepartManager[0].disabled = true;
       formUpdate.TypeDepartManager[1].disabled = true;    
       
       formUpdate.HasDepartLimit[0].disabled = true;
       formUpdate.HasDepartLimit[1].disabled = true;    
       formUpdate.HasUserLimit[0].disabled = true;
       formUpdate.HasUserLimit[1].disabled = true;
       
       formUpdate.ManagerCanSee[0].disabled = true;
	   formUpdate.TypeHasUserAdd[0].disabled = true;
	   formUpdate.UploadUserCanSeeAnnex[0].disabled = true;
       formUpdate.AnnexHasUserLimit[0].disabled = true;
       formUpdate.Alert[0].disabled = true;
       formUpdate.Stat[0].disabled = true;
       formUpdate.HasReadRecord[0].disabled = true;
       
       formUpdate.ManagerCanSee[1].disabled = true;
	   formUpdate.TypeHasUserAdd[1].disabled = true;
	   formUpdate.UploadUserCanSeeAnnex[1].disabled = true;
       formUpdate.AnnexHasUserLimit[1].disabled = true;
       formUpdate.Alert[1].disabled = true;
       formUpdate.Stat[1].disabled = true;     
       formUpdate.HasReadRecord[1].disabled = true;  

    } else if (vType == "1" || vType == "2" ) {
       formUpdate.TypeDepartManager[0].disabled = false;
       formUpdate.TypeDepartManager[1].disabled = false;  
       formUpdate.HasDepartLimit[0].disabled = false;   
       formUpdate.HasDepartLimit[1].disabled = false;  
       formUpdate.HasUserLimit[0].disabled = false;
       formUpdate.HasUserLimit[1].disabled = false;      
       
       formUpdate.ManagerCanSee[0].disabled = false;
	   formUpdate.TypeHasUserAdd[0].disabled = false;
	   formUpdate.UploadUserCanSeeAnnex[0].disabled = false;
       formUpdate.AnnexHasUserLimit[0].disabled = false;
       formUpdate.Alert[0].disabled = false;
       formUpdate.Stat[0].disabled = false;
       formUpdate.HasReadRecord[0].disabled = false;
              
       formUpdate.ManagerCanSee[1].disabled = false;
	   formUpdate.TypeHasUserAdd[1].disabled = false;
	   formUpdate.UploadUserCanSeeAnnex[1].disabled = false;
       formUpdate.AnnexHasUserLimit[1].disabled = false;
       formUpdate.Alert[1].disabled = false;
       formUpdate.Stat[1].disabled = false;     
       formUpdate.HasReadRecord[1].disabled = false;      
    }
  }
</script>
</head>
<%
    //获取提交的参数
    String id = SzConvert.toSpaceStr(request.getParameter("id"));
    String readonly = "";
    String sOPERATOR = SzConvert.toSpaceStr(request.getParameter("OPERATOR"));
    
    ReadDocEngineXml docEngine = new ReadDocEngineXml();
	DocEngineInfo docEngineInfo = new DocEngineInfo();
    
    if (!id.equals("")) {
    	docEngineInfo = docEngine.getDocEngineInfoFromXML(id);
    } 	
    
    String s_id[] = {"0","1"};
%>
<body>

<!-----上面的工具栏------>
<form name="formUpdate" method="post">
  <input type="hidden" name="oldid" value="<%=id%>">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">

<%@ include file="title.jsp"%>
<table width="100%">
  <tr>
    <td>
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
</table>

<!-----信息维护------>
<table width="600" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="3" cellspacing="0">
  <input type="hidden" name="id" class="txtClass2" value="<%=docEngineInfo.getId()%>">
  <tr>
    <td class="tdClassTitle2" width="200">模块</td>
    <td><input type="text" name="ModuleName" class="txtClass1" value="<%=docEngineInfo.getModuleName()%>">
    <font color="red">*</font>
    </td>
  </tr>
  <tr>
    <td class="tdClassTitle2">信息名称</td>
    <td><input type="text" name="InfoName" class="txtClass1" value="<%=docEngineInfo.getInfoName()%>">
    <font color="red">*</font>
    </td>
  </tr>  
  <tr>
    <td class="tdClassTitle2">分类名称</td>
    <td><input type="text" name="TypeName" class="txtClass1" value="<%=docEngineInfo.getTypeName()%>"></td>
  </tr>
  <tr>
    <td class="tdClassTitle2">模块权限</td>
    <td>
      <input type="radio" name="ModulePopedom" value="1" <%if (docEngineInfo.getModulePopedom().equals("1")) { %>checked<% } %> OnClick="ChangePopedom('1');" >管理资料
      <input type="radio" name="ModulePopedom" value="0" <%if (docEngineInfo.getModulePopedom().equals("0")) { %>checked<% } %> OnClick="ChangePopedom('0');" >私人资料
      <input type="radio" name="ModulePopedom" value="2" <%if (docEngineInfo.getModulePopedom().equals("2")) { %>checked<% } %> OnClick="ChangePopedom('2');" >审批资料
    </td>
  </tr>   
  <tr>
    <td class="tdClassTitle2">是否有附件</td>
    <td>
    <%
    	String s_name2[] = {"没有", "有"};
    	out.println(SzPageHelp.radio("HasAnnex",s_id, s_name2, docEngineInfo.getHasAnnex()));
    %>
    </td>    
  </tr>
  <tr>
    <td class="tdClassTitle2">jpg、bmp、gif附件jpg、bmp、gif直接显示</td>
    <td>
    <%
		String s_name20[] = {"不直接显示", "直接显示"};    
    	out.println(SzPageHelp.radio("Picture",s_id, s_name20, docEngineInfo.getPicture()));
    %>
    </td>      
  </tr>   
  <tr>
    <td class="tdClassTitle2">编辑器类型</td>
    <td>
    <%
		String s_id3[] = {"text", "html", ".doc", ".xls", ".ppt"};  
		String s_name3[] = {"文本", "html编辑器", "word", "excel", "ppt"};    
    	out.println(SzPageHelp.radio("Editor",s_id3, s_name3, docEngineInfo.getEditor()));
    %>
    </td>    
  </tr>   
  <tr>
    <td class="tdClassTitle2">分类是否可以指定人员管理</td>
    <td>
    <%
    	String s_name4[] = {"否", "是"};   
    	out.println(SzPageHelp.radio("TypeDepartManager",s_id, s_name4, docEngineInfo.getTypeDepartManager()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>    
  </tr>  
  <tr>
    <td class="tdClassTitle2">信息是否可以指定部门查看</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("HasDepartLimit",s_id, s_name4, docEngineInfo.getHasDepartLimit()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>     
  </tr>   
  <tr>
    <td class="tdClassTitle2">信息是否可以指定人员查看</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("HasUserLimit",s_id, s_name4, docEngineInfo.getHasUserLimit()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>     
  </tr>
  <tr>
    <td class="tdClassTitle2">分类是否可以指定部门查看</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("TypeHasDepartLimit",s_id, s_name4, docEngineInfo.getTypeHasDepartLimit()));
    %>
    </td>     
  </tr>   
  <tr>
    <td class="tdClassTitle2">分类是否可以指定人员查看</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("TypeHasUserLimit",s_id, s_name4, docEngineInfo.getTypeHasUserLimit()));
    %>
    </td>     
  </tr>  
  <tr>
    <td class="tdClassTitle2">是否记录阅读情况</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("HasReadRecord",s_id, s_name4, docEngineInfo.getHasReadRecord()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr>  
  <tr>
    <td class="tdClassTitle2">分类管理员是否可管理其他人数据</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("ManagerCanSee",s_id, s_name4, docEngineInfo.getManagerCanSee()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr> 
  
  <tr>
    <td class="tdClassTitle2">分类是否可指定人员添加</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("TypeHasUserAdd",s_id, s_name4, docEngineInfo.getTypeHasUserAdd()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr>  
  <tr>
    <td class="tdClassTitle2">上传人员是否可查看附件</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("UploadUserCanSeeAnnex",s_id, s_name4, docEngineInfo.getUploadUserCanSeeAnnex()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr>  
  <tr>
    <td class="tdClassTitle2">附件是否可指定人员查看</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("AnnexHasUserLimit",s_id, s_name4, docEngineInfo.getAnnexHasUserLimit()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr>  
  <tr>
    <td class="tdClassTitle2">是否默认树状分类展示</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("TypeShowTree",s_id, s_name4, docEngineInfo.getTypeShowTree()));
    %>
    </td>      
  </tr>  
  
  <tr>
    <td class="tdClassTitle2">显示在桌面</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("Desktop",s_id, s_name4, Integer.toString(docEngineInfo.getDesktop())));
    %>
    </td>      
  </tr>  
  <tr>
    <td class="tdClassTitle2">是否需要短信提醒</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("Alert",s_id, s_name4, docEngineInfo.getAlert()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr> 
  <tr>
    <td class="tdClassTitle2">是否需要统计阅读情况</td>
    <td>
    <%
    	out.println(SzPageHelp.radio("Stat",s_id, s_name4, docEngineInfo.getStat()));
    %>
    <font color='red'>[仅对管理资料有效]</font>
    </td>      
  </tr>           
</table>

</form>

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

  function FormSave(formName, url) {

    //检查是否可以保存
    if (!notSpace(formName.id, "ID")) {
      return false;
    }
    if (!notSpace(formName.ModuleName, "模块")) {
      return false;
    }     
    if (!notSpace(formName.InfoName, "信息名称")) {
      return false;
    }    

    formName.action = "control.jsp";
    formName.submit();
  }
  
  ChangePopedom("<%=docEngineInfo.getModulePopedom()%>");
</script>
</body>
