<%@ page contentType="text/html; charset=GBK" %>
<%@ page import = "zr.zrpower.common.util.SysPreperty" %>
<%@ page import = "zr.zrpower.entity.sys.SessionUser" %>
<%@ page import = "zr.zrpower.flowengine.mode.config.FLOW_CONFIG_PROCESS"%>
<%@ page import = "zr.zrpower.flowengine.mode.base.Package"%>
<%@ page import = "zr.zrpower.ejb.sys.UIService" %>
<%@ page import = "zr.zrpower.flowengine.service.FlowConfig" %>
<%@ page import = "zr.zrpower.flowengine.service.FlowControl"%>

<%@ page import = "java.lang.Object"%>

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

FLOW_CONFIG_PROCESS[] PROCESS = null;
Package[] Package = null;
FlowConfig Fconfig =new FlowConfig();
FlowControl FControl = new FlowControl();

String strflow_No = request.getParameter("flow_No");

//得到查询的记录集
PROCESS = Fconfig.GetFlowList1();
String strshow_data ="";
      String strName = "";
      if (PROCESS!=null && PROCESS.length>0){
        strshow_data = strshow_data + "[";
        for(int i=0;i<PROCESS.length;i++){
          strshow_data = strshow_data + "[";
          strshow_data = strshow_data + "\""+PROCESS[i].getID()+"\",";

          strName = PROCESS[i].getNAME();

          if (i < PROCESS.length-1 )
          {
             strshow_data = strshow_data + "\""+strName+"\"],\r\n";
          }else
          {
             strshow_data = strshow_data + "\""+strName+"\"]";
          }
        }

        strshow_data = strshow_data + "]";
        }else
        {
          strshow_data = "null";
        }

%>
<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>

<link rel="stylesheet" type="text/css" media="all" href="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-blue.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/calendar/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/gt_grid.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/vista/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/pink/skinstyle.css">
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/sigma_grid/grid/skin/mac/skinstyle.css">
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_msg_en.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_const.js"></script>
<script type="text/javascript" src="../../../ZrwebGui/sigma_grid/grid/gt_grid_all.js"></script>


<script type="text/javascript" >
var css = "<%=user.getUserCSS()%>";
var skincss = "vista";

if (css=="Blue.css")
{skincss = "vista";}
if (css=="Public.css")
{skincss = "default";}
if (css=="Window.css" || css=="nBlue.css")
{skincss = "mac";}
if (css=="Yellow.css")
{skincss = "pink";}


var grid_demo_id = "myGrid1" ;
var show_data= <%=strshow_data%>;

var dsOption= {

	fields :[
		{name : 'NAME1'  },
		{name : 'NAME2'  }
	],

	recordType : 'array',
	data : show_data
}



var colsOption = [
           {id: 'NAME1' , header: "<center>流程ID</center>" , width :10 , hidden:true  },
	   {id: 'NAME2' , header: "<center>流程名称</center>" , width :330 ,align : 'center' }
];


var gridOption={
	id : grid_demo_id,
	width: "99%",
	height: "400",
	container : 'gridbox',
	replaceContainer : true,
	dataset : dsOption ,
	columns : colsOption,
	pageSize : 2000,
	toolbarContent : null,
        skin : skincss,

        onCellDblClick:function(value, record , cell, row,  colNO, rowNO,columnObj,grid){
           okclick();
        },

       showIndexColumn : true
};


var mygrid=new Sigma.Grid( gridOption );
Sigma.Util.onLoad( Sigma.Grid.render(mygrid));

</script>



<SCRIPT language=javascript type=text/javascript>
<!--
function okclick(){
   var allvalue = mygrid.getSelectedRecords()+",0";
   var id = allvalue.split(",")[0];
   var name = allvalue.split(",")[1];
   window.returnValue=id+","+name;
   window.close();
}
// -->
</SCRIPT>
</HEAD>

<BODY class="BodyMain">
<form name="recordfrm" action="List.jsp">

<!--HTML Head表单头显示[显示内容,图标文件,用户肤色的图片文件夹]-->
<%=userUI.ShowHeadHtml("选择子流程","IcoTitle.gif",user.getUserImage())%>

<!--HTML Body Start显示表单开始部分-->
<%=userUI.ShowBodyStartHtml()%>

 <div id="gridbox" style="border:0px solid #cccccc;background-color:#f3f3f3;padding:5px;height:200px;width:700px;" ></div>



   <center><br>
          <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton1("确 定","okclick();","buttonSure.gif",user.getUserImage())%>
                 <%=userUI.ClickButton1("关 闭","window.close();","buttonCancel.gif",user.getUserImage())%>
          </tr></table>

   </center>


<!--HTML Foot显示表单尾-->
<%=userUI.ShowFootHtml()%>
</form>
</BODY>

<%
//清空相关对象
user = null;
userUI = null;
PROCESS = null;
Package = null;
Fconfig = null;
FControl = null;
%>
