<%@ page contentType="text/html;charset=gbk" %>
<%@ page import="java.util.Iterator" %>
<%@ page import="java.util.Collection" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="net.sz600.basicdata.*" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzPageInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%@ page import="net.sz600.system.SzLevelNumber" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.flow.*" %>
<%@ page import="net.sz600.formEngine2.*" %>
<%@ page import="net.sz600.weboffice.*" %>
<%@ include file="/sessionInfo.jsp"%>
<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 sOPERATOR = "add";
    String name = SzConvert.toSpaceStr(request.getParameter("name"));
    
	OfficePrintTemp officePrintTemp = new OfficePrintTemp(0);
	OfficeTemplate officeTemplate = null;    
	if (!name.equals("")) {
		officeTemplate = officePrintTemp.getTemplate(name);	
	}
	String desc = "";
	String note = "";
	String path = "share/wordtemp/";
	String saveDir = "upload/exportword/";
	if (officeTemplate != null) {
		desc = SzConvert.toSpaceStr( officeTemplate.getAttrs().get("desc"));
		note = SzConvert.toSpaceStr( officeTemplate.getAttrs().get("note"));
		path = officeTemplate.getAttrs().get("path");
		saveDir = officeTemplate.getAttrs().get("saveDir");
		sOPERATOR = "update";
	}
	
	
%>
<!-----上面的工具栏------>
<%@ include file="/xml/formEngine2/title.jsp"%>
<table width="100%">
  <form name="formBar" method="post">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <tr>
    <td>    
      <%=SzPageHelp.saveButton()%>
      <%=SzPageHelp.backButton()%>
    </td>
  </tr>
  </form>
</table>
<!-----信息列表----->
<table width="100%" border="1" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF" class="tableClass" cellpadding="1" cellspacing="0">
  <form name="formUpdate" method="post">
  <input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  <tr>
    <td>名称</td>
    <td><input type="text" class="txtClass2" name="name" value="<%=name %>">
    <font color="red">*</font>[可用字母、数字、下划线的组合]</td>
  </tr>
  <tr>
    <td>说明</td>
    <td><input type="text" class="txtClass2" name="desc" value="<%=desc%>">
    <font color="red">*</font></td>
  </tr>
  <tr>
    <td>描述</td>
    <td><input type="text" class="txtClass2" name="note" value="<%=note%>"></td>
  </tr>  
  <tr>
    <td>模板文件</td>
    <td><input type="text" class="txtClass2" name="path" value="<%=path%>">
    <font color="red">*</font></td>
  </tr>
  <tr>
    <td>输出文件夹</td>
    <td><input type="text" class="txtClass2" name="saveDir" value="<%=saveDir%>">
    <font color="red">*</font></td>
  </tr>      
  </form>  
</table>  

<!-----下面的工具栏------>
<table width="100%">
  <form name="formPage" method="post">
	<input type="hidden" name="OPERATOR" value="<%=sOPERATOR%>">
  </form>
</table>
<script language="javascript" src="../../../share/js/commonTool.js"></script>
<script language="javascript">

  function FormSave(formName, url) {
    //检查是否可以保存
    if (!notSpace(formName.name, "名称")) {
      return false;
    }    
    if (!notSpace(formName.desc, "说明")) {
      return false;
    }  
    if (!notSpace(formName.path, "模板文件")) {
      return false;
    }
    if (!notSpace(formName.saveDir, "输出文件夹")) {
      return false;
    }            

    formName.action = url;
    formName.submit();
  }
</script>
