<%@ 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.UserService"%>
<%@ 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"%>

<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
UserService name=new UserService();
FLOW_CONFIG_PROCESS[] PROCESS = null;
Package[] Package = null;
FlowConfig Fconfig =new FlowConfig();
FlowControl FControl = new FlowControl();
//定义弹出菜单的背景色
String menu_back_color = "#CFE7FF";
if (user.getUserImage().equals("blueimg"))
{menu_back_color = "#CFE7FF";}
if (user.getUserImage().equals("publicimg"))
{menu_back_color = "#E7FCDD";}
if (user.getUserImage().equals("windowimg"))
{menu_back_color = "#EFEFEF";}
if (user.getUserImage().equals("yellowimg"))
{menu_back_color = "#F7F8C5";}

String strPackageID =request.getParameter("PackageID");
%>
<HTML xmlns:v =
"urn:schemas-microsoft-com:vml"><HEAD><TITLE>WorkFlowDesign</TITLE>
<META content="MSHTML 6.00.3790.2440" name=GENERATOR>
<META content=C# name=CODE_LANGUAGE>
<META content=JavaScript name=vs_defaultClientScript>
<META content=http://schemas.microsoft.com/intellisense/ie5
name=vs_targetSchema>
<META http-equiv="Content-Type" content="text/html; charset=GBK">
<STYLE>v\:* {
	BEHAVIOR: url(#default#VML)
}
</STYLE>
 
<BODY  oncontextmenu='if(event.srcElement.tagName!="TEXTAREA")return false' onselectstart='if(event.srcElement.tagName!="TEXTAREA"&amp;&amp;event.srcElement.tagName!="INPUT")return false'  bottomMargin=0>

<FORM id=Form1 name=Form1 action=PackageList.jsp method=post>

<SPAN id=WorkFlowItemMenu style="DISPLAY: none; Z-INDEX: 102;WIDTH: 155px;POSITION: absolute;">
<!--弹出菜单-->
  <table height="100%" cellSpacing=0 cellPadding=0 width="125" border=0 background="../../images/<%=user.getUserImage()%>/flowmenuback1.gif">
  <tr><td height="10" background="../../images/<%=user.getUserImage()%>/flowmenuback2.gif"></td></tr>
   
  <tr><td height="30" align="left">
      <table cellSpacing=0 cellPadding=0 width="125" border=0">
      <tr><td height="22" width="5"></td>
      <td height="22" onclick="WorkFlowItemMenu.style.display='none';OpenFlowCopy1(thisobj,'<%=strPackageID%>');" onMouseOver="this.style.cursor='hand';this.style.backgroundColor='<%=menu_back_color%>'" onMouseOut="this.style.backgroundColor=''">
        <img src="../../images/FlowMenuIco4.gif" align="absmiddle">
        &nbsp;&nbsp;复制流程
      </td>
      <td height="22" width="5"></td>
      </tr></table>
  </td></tr>
 


  <tr><td height="30" align="left">
      <table cellSpacing=0 cellPadding=0 width="125" border=0">
      <tr><td height="22" width="5"></td> 
      <td height="22" onclick="WorkFlowItemMenu.style.display='none';javascript:OpenFlowMap('../../FlowShow/FlowShowMap/ShowActivity.jsp?Workflow_No='+thisobj.id+'&AID=0000000000');" onMouseOver="this.style.cursor='hand';this.style.backgroundColor='<%=menu_back_color%>'" onMouseOut="this.style.backgroundColor=''">
        <img src="../../images/FlowMenuIco5.gif" align="absmiddle">
        &nbsp;&nbsp;流程预览
      </td>
      <td height="22" width="5"></td>
      </tr></table>
  </td></tr>

  <tr><td height="10" background="../../images/<%=user.getUserImage()%>/flowmenuback3.gif"></td></tr>
  </table>
</SPAN>


<TABLE id=Table1 height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0>
  <TR>
    <TD vAlign=top noWrap align=left height="100%">
     <!--显示流程图开始部分-->
     <%=FControl.GetFlowStartLabel()%>
     <%
     int intX=100;
     int intY=100;
     int intLong = 0;
     String strX="";
     String strY="";
     int k=0;
     //得到查询的记录集
     PROCESS = Fconfig.GetFlowList();
     if (PROCESS!=null && PROCESS.length>0){
       for(int i=0;i<PROCESS.length;i++){

       if (k==10){k =0;intX=100;intY=intY+1000;}
       strX = String.valueOf(intX);
       strY = String.valueOf(intY);

       String strID = PROCESS[i].getID();
       String strName = PROCESS[i].getNAME();
       String strIco = PROCESS[i].getICO();

       intX=intX + 780;
       intLong = strName.length();
       
       if (intLong>5 && intLong<=10)
       {
        strName = strName.substring(0,5)+"<br>"+strName.substring(5);
       }
       if (intLong>10 && intLong<=15)
       {
        strName = strName.substring(0,5)+"<br>"+strName.substring(5,10)+"<br>"+strName.substring(10);
       }
       if (intLong>15)
       {
        strName = strName.substring(0,5)+"<br>"+strName.substring(5,10)+"<br>"+strName.substring(10,15)+"<br>"+strName.substring(15);

       }

       if (strIco.length()>0)
       {strIco="Flow"+strIco+".gif";}
       else
       {strIco="Flow1.gif";}
    
       %>
        
       <!--显示通用标签-->
       <%=FControl.GetFlowTPackageLabel(strX,strY,strID,strName,"显示信息","../../images/"+strIco)%>
       
       <%
       k = k+1;
       }
      }
      %>
    
    
    <!--显示流程图结束部分-->
    <%=FControl.GetFlowEndLabel()%>
</TD></TR></TABLE>


<SCRIPT language=jscript src="../../js/ControlPackage.js"></SCRIPT>
<link REL="stylesheet" type="text/css" href="../../../zrsysmanage/css/<%=user.getUserCSS()%>">
<SCRIPT LANGUAGE="JavaScript" src="../../../zrsysmanage/script/Public.js"></SCRIPT>
<SCRIPT LANGUAGE="JavaScript" src="../../js/Workflow.js"></SCRIPT>
<script language="JavaScript" type="text/JavaScript">

//打开复制流程
function OpenFlowCopy1(WorkFlowItemobj,PackageID)
{
      if (confirm("将复制流程及流程下的所有配置，确定要复制吗？"))
      {
      parent.location.href="../FlowProcess/FlowCopy1.jsp?PackageID="+PackageID+"&FlowID="+WorkFlowItemobj.id;
      }
}

</script>
</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
name = null;
Package = null;
FControl = null;
Fconfig = null;
%>
