<%@ 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.ejb.sys.SecurityService" %>
<%@ page import = "zr.zrpower.flowengine.mode.config.FLOW_CONFIG_PROCESS"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowConfig"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowSetup"%>
<%@ page import = "zr.zrpower.flowengine.service.FlowControl"%>
<%@ page import = "zr.zrpower.ejb.sys.UserService"%>

<%@ page import = "zr.zrpower.common.util.DateWork" %>
<%@ page import = "java.lang.Object"%>
<%@ page import = "java.util.*"%>
<%@ page import = "java.text.*"%>

<HTML>
<%
SessionUser user = (SessionUser)session.getAttribute("userinfo");
UIService userUI =new UIService();
SecurityService SeService =new SecurityService();
FlowConfig Flow = new FlowConfig();
FlowSetup FlowPackage= new FlowSetup();
FlowControl FControl = new FlowControl();
String ID = request.getParameter("SelectedItems");
FLOW_CONFIG_PROCESS Pr = Flow.getPROCESSID(ID);
UserService name=new UserService();
String truename = name.GetUserName(Pr.getCREATEPSN());
String helptruename = "";

%>
<HTML>
<HEAD>
<TITLE><%=SysPreperty.getProperty().SystemName%><%=SysPreperty.getProperty().Versoin%></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="../../js/DealList.js"></SCRIPT>
<script src="../../../zrsysmanage/html5/script/jquery-2.0.3.min.js" type="text/jscript" ></script>
<script src="../../../zrsysmanage/html5/layer/layer.js" type="text/jscript" ></script>

<script type="text/javascript" src="../../../ZrwebGui/tab/tab.js"></script>
<link rel="stylesheet" type="text/css" href="../../../ZrwebGui/tab/tab.css">
<STYLE type=text/css>
#con { FONT-SIZE: 12px; MARGIN: 0px auto; WIDTH: 98% }
#tags { PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px 0px 0px 10px; WIDTH: 98% ; PADDING-TOP: 0px; HEIGHT: 23px }
#tags LI { BACKGROUND: url(../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagleft.gif) no-repeat left bottom; FLOAT: left; MARGIN-RIGHT: 1px; LIST-STYLE-TYPE: none; HEIGHT: 23px }
#tags LI A { PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: url(../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/tagright.gif) no-repeat right bottom; FLOAT: left; PADDING-BOTTOM: 0px; COLOR: #999;
LINE-HEIGHT: 23px; PADDING-TOP: 0px; HEIGHT: 23px; TEXT-DECORATION: none }
.tagContent { PADDING-RIGHT: 10px; DISPLAY: none; PADDING-LEFT: 10px; BACKGROUND: url(../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/bg.gif) repeat-x; PADDING-BOTTOM: 10px; WIDTH: 100%; COLOR: #474747;
PADDING-TOP: 10px; HEIGHT: 92% }
</STYLE>

<script language="JavaScript" type="">
function Check(theForm){
    RegForm.Act.value='edit';
    if(theForm.NAME.value.length=="") {
      alert("请输入流程名称！");
	 theForm.NAME.focus();
	 return;
        }

   if (!(ListAll())){
    return false;
       }
   if (!(ListAll1())){
     return false;
       }

   return true;
 }


function showimage(){
  document.images.icoshow.src="../../images/Flow"+document.RegForm.ICO.options[document.RegForm.ICO.selectedIndex].value+".gif";
}
function openDoc()
{
   OpenMenuWindow("opendoc.jsp?ID="+document.RegForm.DOCID.value);
}

</script>
</HEAD>
<BODY class="BodyMain">
<FORM name="RegForm" method="post" action="../../../flowprocess.do"  onsubmit="return Check(this);">
<input type="hidden" name="Act" value="edit">
<input type="hidden" name="ID" value="<%=ID%>">
<input type="hidden" name="formfields" value="">
<input type="hidden" name="formfields1" value="">
<input type="hidden" name="FLOWPACKAGE" value="<%=Pr.getFLOWPACKAGE()%>">
<input type="hidden" name="TYPE" value="<%=Pr.getTYPE()%>">
<input type="hidden" name="ICO" value="1">

<%if(user.getUserWINDOWTYPE().equals("6")){%>
<!--HTML Head表单头显示[显示内容，用户肤色的图片文件夹]-->
<%=userUI.ShowHeadHtml("编辑流程",user.getUserImage())%>
<!--HTML Body Start显示表单开始部分-->
<%=userUI.ShowBodyStartHtml()%>
<%}%>
<table width="100%"><tr><td height="470"  valign="top">




<DIV id="con">
  <UL id="tags">
    <LI class="selectTag">
      <A onClick="selectTag('tagContent0',this)"  href="javascript:void(0)">
      <IMG src="../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
      基本属性
      </A>
    </LI>
     <LI>
       <A onClick="selectTag('tagContent1',this)" href="javascript:void(0)">
       <IMG src="../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         监控属性
       </A>
     </LI>
     <LI>
       <A onClick="selectTag('tagContent2',this)" href="javascript:void(0)">
       <IMG src="../../../ZrwebGui/tab/skin/<%=user.getUserImage()%>/page.gif" align='absmiddle' border=0>
         重分配属性
       </A>
     </LI>

  </UL>





<DIV id="tagContent">
    <DIV class="tagContent selectTag" id="tagContent0">

                 <fieldset style="width: 98%">
                 <legend>基本属性管理</legend>
                 <table border='0' width="100%" cellspacing="0" cellpadding="0" align=center>
                 <tr>
                      <td colspan=2 height=2></td>
                 </tr>
                  <tr>
                  <td class="PutdSet" width="30%">流程标识：</td>
                  <td><input class="text" type="text" name="IDENTIFICATION" size="56" value="<%=Pr.getIDENTIFICATION()%>" readonly="readonly" maxlength="50"></td>
                 </tr>
                 <tr>
                  <td class="PutdSet" width="30%">流程名称：</td>
                  <td><input class="text" type="text" name="NAME" size="56" value="<%=Pr.getNAME()%>" maxlength="50"></td>
                 </tr>
                 <tr>
                  <td class="PutdSet">流程描述：</td>
                  <td><input class="text" type="text" name="DESC1" size="56" value="<%=Pr.getDESC1()%>" maxlength="300"></td>
                 </tr>
                  <tr>
                 <td class="PutdSet">发布状态：</td>
                 <td>
                  <input type="radio" name="STATUS" value=1 onclick="document.RegForm.STATUS.value='1'" <% if (Pr.getSTATUS().equals("1")){%>checked<%}%>>启用　　
		  <input type="radio" name="STATUS" value=0 onclick="document.RegForm.STATUS.value='0'" <% if (Pr.getSTATUS().equals("0")){%>checked<%}%>>停用
                 </td>
                 </tr>

                <tr>
                 <td class="PutdSet">序号：</td>
                 <td><input class="text" type="text" name="CODE" size="3" value="<%=Pr.getCODE()%>" maxlength="3">
                 说明：可定义流程在设计视图中的顺序。
                 </td>
                </tr>


                <tr>
                 <td class="PutdSet">能新建的个数：</td>
                 <td><input class="text" type="text" name="CNUM" size="3" value="<%=Pr.getCNUM()%>" maxlength="3">说明：0不限制,多个流程间有关联且控制新建数量时可启用此项。</td>
                </tr>

                <tr>
                 <td class="PutdSet">创建者：</td>
                 <td><input class="text" type="text" name="CREATEPSNNAME" value="<%=truename%>" readonly="readonly" size="56" ><input type="hidden" name="CREATEPSN" value="<%=Pr.getCREATEPSN()%>"></td>
               </tr>
               <tr>
                <td class="PutdSet">创建日期：</td>
                <td><input class="text" type="text" name="CREATEDATE" value="<%=Pr.getCREATEDATE().toString().substring(0,10)%>" readonly="readonly" size="56"> </td>
               </tr>
               </table>
               <br>
              </fieldset>

            <fieldset style="width: 98%">
                 <legend>表单属性管理</legend>
		 <table border='0' width="100%" cellspacing="0" cellpadding="0" align=center>
                 <tr>
                      <td colspan=2 height=5></td>
                 </tr>
                 <tr>
                      <td class="PutdSet">
                         表单类别:
                      </td>
                      <td>
                         <input type="radio"  onclick="FORMTYPE.value=1;div1.style.display='';div2.style.display='';" name="FORMTYPE1" value=1 <% if (Pr.getFORMTYPE().equals("1")) {out.print("checked");}%>>表单引擎配置
                         <input type="radio"  onclick="FORMTYPE.value=2;div1.style.display='none';div2.style.display='none';" name="FORMTYPE1" value=2 <% if (Pr.getFORMTYPE().equals("2")) {out.print("checked");}%>>自定义
                         <input type="hidden" name="FORMTYPE" value="<%=Pr.getFORMTYPE()%>">

                      </td>

                 </tr>
                  <tr>
                    <td class="PutdSet">
                      <div  id="div1" <% if (Pr.getFORMTYPE().equals("1")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>电脑表单配置：</div>

                      </td>
                   <td>
                   <div  id="div2" <% if (Pr.getFORMTYPE().equals("1")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>

                   <table cellspacing="0" cellpadding="0" border='0'><tr>
                       <td> <select name="DOCID" style="width=258">
                       <%=FlowPackage.ShowDocnameSelect("COLL_DOC_CONFIG",Pr.getDOCID())%>
                       </select></td>
                       <%=userUI.ClickButton("查看模板","JavaScript:openDoc()","IcoBrowse.gif",user.getUserImage())%>
                  </tr></table>
                  </div>
                   </td>
                  </tr>
                  <tr>
                    <td class="PutdSet">
                      <div  id="div1" <% if (Pr.getFORMTYPE().equals("1")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>客户端表单配置：</div>

                      </td>
                   <td>
                   <div  id="div2" <% if (Pr.getFORMTYPE().equals("1")){%>style="display:'';"<%} else {%>style="display:none;"<%}%>>

                   <table cellspacing="0" cellpadding="0" border='0'><tr>
                       <td> <select name="DOCIDPHO" style="width=258">
                       <%=FlowPackage.ShowDocnameSelect("COLL_DOC_CONFIG",Pr.getDOCIDPHO())%>
                       </select></td>
                       <%=userUI.ClickButton("查看模板","JavaScript:openDoc()","IcoBrowse.gif",user.getUserImage())%>
                  </tr></table>
                  </div>
                   </td>
                  </tr>

            <tr>
               <td colspan="2">删除流程时是否删除表单数据：
                   <input type="radio" name="ISDELETEFORM" value=1 onclick="document.RegForm.ISDELETEFORM.value='1'" <% if (Pr.getISDELETEFORM().equals("1")){%>checked<%}%>>是　　
                   <input type="radio" name="ISDELETEFORM" value=0 onclick="document.RegForm.ISDELETEFORM.value='0'" <% if (Pr.getISDELETEFORM().equals("0")){%>checked<%}%>>否
               </td>
            </tr>
                </table>
               <br>
              </fieldset>



 </DIV>


<DIV class="tagContent" id="tagContent1">


                 <br>&nbsp;
            <fieldset style="width: 98%">
                 <legend>监控属性管理</legend>
		 <table border='0' width="100%" cellspacing="0" cellpadding="0" align=center>
                 <tr>
                      <td colspan=2 height=23></td>
                 </tr>
                  <tr>
              <td colspan="2">

                <table border='0' width="70%"  cellspacing="0" cellpadding="0" align=center>
                  <tr>
                    <td colspan=3 height=23></td>
                  </tr>
                  <tr>
                    <td width="45%" align="center" height=23><font class="AlertSign">待选流程用户组</font></td>
                    <td width="10%" align="center"><font class="AlertSign">操作</font></td>
                    <td width="45%" align="center"><font class="AlertSign">已选流程用户组</font></td>
                  </tr>
                  <tr>
                    <td valign="top">
                      <%=Flow.Group_AllList("srcList")%>
                      <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'srcList');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                         <br>是否只对本部门
                         <input type="radio"  onclick="ISDEPT1.value=1" name="ONISDEPT1" value=1>是　
                         <input type="radio" onclick="ISDEPT1.value=0" name="ONISDEPT1" value=0 checked>否
                         <input type="hidden" name="ISDEPT1" value="0">
                    </td>
                    <td align=center valign="middle">
                       <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:var isdept=ISDEPT1.value;addSrcToDestListPu1(srcList,destList,isdept)"><br><br>
                        <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_L.gif"  style="cursor:pointer" title="删除用户组" onclick="javascript:deleteFromDestListPu(destList);"><br><br>
                         <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_D.gif"  style="cursor:pointer" title="下移" onclick="javascript:downFromDestList();"><br><br><br><br>
                    </td>
                    <td valign="top">
                      <%=Flow.Flow_Group_List(ID,"destList","")%>
                      <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>




</DIV>


<DIV class="tagContent" id="tagContent2">


                 <br>&nbsp;
            <fieldset style="width: 98%">
                 <legend>重分配属性管理</legend>
		 <table border='0' width="100%" cellspacing="0" cellpadding="0" align=center>
                 <tr>
                      <td colspan=2 height=23></td>
                 </tr>
            <td colspan="2">

                <table border='0' width="70%"  cellspacing="0" cellpadding="0" align=center>
                  <tr>
                    <td colspan=3 height=23></td>
                  </tr>
                  <tr>
                    <td width="45%" align="center" height=23><font class="AlertSign">待选流程用户组</font></td>
                    <td width="10%" align="center"><font class="AlertSign">操作</font></td>
                    <td width="45%" align="center"><font class="AlertSign">已选流程用户组</font></td>
                  </tr>
                  <tr>
                    <td valign="top">
                      <%=Flow.Group_AllList("srcList1")%>
                      <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'srcList1');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                         <br>是否只对本部门
                         <input type="radio"  onclick="ISDEPT2.value=1" name="ONISDEPT2" value=1>是　
                         <input type="radio" onclick="ISDEPT2.value=0" name="ONISDEPT2" value=0 checked>否
                         <input type="hidden" name="ISDEPT2" value="0">
                    </td>
                    <td align=center valign="middle">
                     <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_U.gif"  style="cursor:pointer" title="上移" onclick="javascript:upFromDestList1();"><br><br>
                     <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_R.gif"  style="cursor:pointer" title="增加用户组" onClick="javascript:var isdept=ISDEPT2.value;addSrcToDestListPu1(srcList1,destList1,isdept)"><br><br>
                     <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_L.gif"  style="cursor:pointer" title="删除用户组" onclick="javascript:deleteFromDestListPu(destList1);"><br><br>
                     <img src="<%=SysPreperty.getProperty().AppUrl%>zrsysmanage/images/<%=user.getUserImage()%>/PuArrow_D.gif"  style="cursor:pointer" title="下移" onclick="javascript:downFromDestList1();"><br><br><br><br>
                      </td>
                    <td valign="top">
                     <%=Flow.Flow_Group_List1(ID,"destList1","")%>
                     <br><input type="checkbox" name="SelAllX" onclick="JavaScript:CheckBoxSel(this.checked,'destList1');">全选&nbsp;&nbsp;<Font class="WriteSign">注：使用Ctrl键可选择多个</Font><br>
                    </td>
                  </tr>
                </table>

              </td>
                </table>
               <br>
              </fieldset>



    </DIV>
  </DIV>
</DIV>


</td></tr>
<tr><td height="3"></td></tr>
<tr valign="top"><td valign="top">
 <center>
              <table cellspacing="0" cellpadding="0" border='0'><tr>
                 <%=userUI.ClickButton("保存","JavaScript:if(Check(document.RegForm)){document.RegForm.submit();}","buttonSave.gif",user.getUserImage())%>

                 <% if("6".equals(user.getUserWINDOWTYPE())){%>
                 <%=userUI.ClickButton1("关闭","window.parent.document.location.reload();parent.layer.closeAll();","buttonClose.gif",user.getUserImage())%>
                 <% }else{%>
                 <%=userUI.ClickButton("关闭","JavaScript:window.opener.document.location.reload();window.close();","buttonReturn.gif",user.getUserImage())%>
                 <% }%>

              </tr></table>
              </center>
 </td></tr>
</table>
<%if(user.getUserWINDOWTYPE().equals("6")){%>
<!--HTML Foot显示表单尾-->
<%=userUI.ShowFootHtml()%>
<%}%>
</FORM>
</BODY>
</HTML>
<%
//清空相关对象
user = null;
userUI = null;
SeService = null;
Flow = null;
FlowPackage = null;
Pr = null;
FControl = null;
%>
