<%@ page contentType="text/html; charset=GBK"%>
<%@ page import = "zr.zrpower.common.util.SysPreperty"%>
<%@ page import = "zr.zrpower.entity.sys.SessionUser"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService"%>
<%@ page import = "zr.zrpower.collectionengine.service.ConfigService"%>
<%@ page import = "java.lang.Object"%>

<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();

ConfigService ConfigService = new ConfigService();
String strID = request.getParameter("ID");//配置ID
if (strID==null){strID = "";}
String srcList =  ConfigService.getSFieldList("srcList",strID);

%>

<HTML>
<HEAD>
<TITLE>选择生成模板的字段管理</TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<link REL="stylesheet" type="text/css" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/DealList.js"></SCRIPT>
<%if("6".equals(user.getUserWINDOWTYPE())){ %>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/html5/layer/layer.js"></SCRIPT>
<%}%>
<SCRIPT language="javascript">
function buttonok(){
  if (!(ListAll())){
    return false;
  }
  
  var revalue = document.RegForm.formfields.value;
  if (revalue.length==0)
  {
    
     <%if("6".equals(user.getUserWINDOWTYPE())){%>
    parent.layer.alert('请先选择要生成的字段!', {icon: 7});
    <%}else{%>
     alert("请先选择要生成的字段。");
    <%}%>
  }else
  {
     if (revalue.length>1)
     {
        revalue = revalue.substring(0,revalue.length-1);
     }
     
     <%if("6".equals(user.getUserWINDOWTYPE())){%>
        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
        
        window.returnValue = revalue;
        //parent.layer.close(index);
    <%}else{%>
        window.returnValue = revalue;
        window.close();
    <%}%>
     
  }
}

</SCRIPT>
</HEAD>
<BODY class="BodyMain">
  <FORM name="RegForm" method="post" action="">
    <input type="hidden" name="formfields" value="">
    <DIV id="divMessage" style='padding-left:0;padding-top:0;width:100%;height:100%;overflow:auto'>
    <!--HTML Head表单头显示[显示内容，用户肤色的图片文件夹]-->
    <%=userUI.ShowHeadHtml("选择生成模板的字段管理",user.getUserImage())%>
    <!--HTML Body Start显示表单开始部分-->
    <%=userUI.ShowBodyStartHtml()%>
      <br>&nbsp;
      <fieldset style="width: 98%">
      <legend>选择生成模板的字段</legend>
      <table border='0' width="100%"  cellspacing="0" cellpadding="0" align=center>

        <tr>
          <td colspan="2">
      <table border='0' width="98%"  cellspacing="0" cellpadding="0" align=center>
              <tr>
                <td colspan=3 height=23></td>
              </tr>
              <tr>
                <td width="40%" align="center" height=23><font style="font-family: 宋体; font-size: 11pt">所有待选字段</font></td>
                <td width="20%" align="center"><font style="font-family: 宋体; font-size: 11pt">操作</font></td>
                <td width="40%" align="center"><font style="font-family: 宋体; font-size: 11pt">已选字段</font></td>
              </tr>
              <tr>
                <td>
                 <%=srcList%>
                  <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'srcList');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                </td>
                <td align=center>
                <%if("6".equals(user.getUserWINDOWTYPE())){%>
<a class="btn1 btn-medium btn-green btn-radius" href="#" onclick="javascript:upFromDestList();">上移</a>
<a class="btn1 btn-medium btn-orange  btn-radius" href="#" onClick="javascript:addSrcToDestList()">增加</a>
<a class="btn1 btn-medium btn-red btn-radius" href="#" onclick="javascript:deleteFromDestList();">删除</a>
<a class="btn1 btn-medium btn-gray btn-radius" href="#" onclick="javascript:downFromDestList();">下移</a>
<%}else{%>
                  <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_U.gif" style="cursor:pointer" title="上移" onclick="javascript:upFromDestList();"><br><br>
                    <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_R.gif" style="cursor:pointer" title="增加" onClick="javascript:addSrcToDestList()"><br><br>
                      <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_L.gif"  style="cursor:pointer" title="删除" onclick="javascript:deleteFromDestList();"><br><br>
                        <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_D.gif"  style="cursor:pointer" title="下移" onclick="javascript:downFromDestList();">
             <%} %>   </td>
                <td>
                  <select name='destList' class='SelectStyleMax' size=20 multiple >
                  </select>
                  <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'destList');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                </td>
              </tr>
            </table>

          </td>
        </tr>
      </table>

      <br>
      </fieldset>
      <center><br>
              <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton1("确定","buttonok();","buttonSave.gif",user.getUserImage())%>
                 <%if("6".equals(user.getUserWINDOWTYPE())){%>
                 <%=userUI.ClickButton("关闭","JavaScript:parent.layer.closeAll();","buttonClose.gif",user.getUserImage())%>
                
                <%}else{ %>
                <%=userUI.ClickButton1("关闭","window.close();","buttonReturn.gif",user.getUserImage())%>
                <%} %>
                 
              </tr></table>
      </center>

      <!--HTML Foot显示表单尾-->
      <%=userUI.ShowFootHtml()%>
      <!--HTML Head表单头显示[显示内容，用户肤色的图片文件夹]-->

</DIV>
</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
ConfigService = null;
%>
