📄 flowprcss.jsp
字号:
<%@ page contentType="text/html; charset=gb2312"%>
<%@ page import="billflow.*, java.util.*,java.io.*,com.cyberway.dynaform.web.DocumentForm"%>
<%@ page import="com.cyberway.dynaform.ejb.DocumentVO,com.cyberway.dynaform.ejb.FormVO"%>
<%@ page import="billflow.engine.WFRunner,com.cyberway.utility.UserListUtil"%>
<%@ page import="com.cyberway.utility.*,com.cyberway.constants.Web, com.cyberway.framework.web.WebUser"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<%@ taglib uri="/smartweb" prefix="s" %>
<%
String contextPath = request.getContextPath();
String path = pageContext.getServletContext().getInitParameter("UPLOADPATH");
DocumentVO dvo = (DocumentVO)request.getAttribute("DOCUMENTVO");
WebUser user = (WebUser)session.getAttribute(Web.SESSION_ATTRIBUTE_USER);
%>
<html:html>
<head>
<title><s:Language key="flow_process"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="<%= contextPath %>/css/default.css" type="text/css">
<script src="<%= contextPath %>/js/billlist.js"></script>
<script src="<%= contextPath %>/js/billitem.js"></script>
<script src="<%= contextPath %>/js/check.js"></script>
<script src="<%= contextPath %>/js/util.js"></script>
<script src="<%= contextPath %>/js/category.js"></script>
<script src="<%= contextPath %>/js/info.js"></script>
<script language="JavaScript">
<!--
var contextPath = '<%= contextPath %>';
cmdReturn = '/dynaform/document/view.do?id=<c:out value="${param.id}"/>';
cmdSave = '/dynaform/document/flowprcss.do?id=<c:out value="${param.id}"/>';
cmdLink = '/dynaform/document/flowprcss.do?id=<c:out value="${param.id}"/>';
function ev_flow(){
var e = document.all("flowstate");
if(e != null){
for(var i=0; i<e.length; i++){
if(e[i].checked){
var tv = e[i].value;
try{
if (document.all("flow")!=null){
flow.style.display="none";
if(tv=="<%=WFRunner.RUNNING2RUNNING_NEXT%>"){
flow.style.display="";
}
}
if(document.all("back")!=null){
back.style.display="none";
if(tv=="<%=WFRunner.RUNNING2RUNNING_BACK%>"){
back.style.display="";
}
}
}catch(e){}
}
}
}
}
function ev_checkval() {
var e = formItem.flowstate;
var b = false;
if(e != null){
for(var i=0; i<e.length; i++){
if(e[i].checked){
try{
if(e[i].value=="<%=WFRunner.RUNNING2RUNNING_NEXT%>"){
var n = formItem.nodeid;
if(n != null){
if(n.checked){
b = true;
}
for(var j=0;j<=n.length;j++){
if(n[j].checked){
b = true;
}
}
}
if(b==false){
alert("<s:Language key="plz_sel_next_auditor"/>!!!");
return;
}
}else if(e[i].value=="<%=WFRunner.RUNNING2RUNNING_BACK%>"){
var back = formItem.backid;
if(back.checked){
b = true;
}
for(var j=0;j<back.length;j++){
if(back[j].checked){
b = true;
}
}
if(b==false){
alert("<s:Language key="plz_sel_flow_back_step"/>!!!");
return;
}
}else{
b = true;
}
}catch(e){}
}
}
}
if(b==false){
alert("<s:Language key="plz_sel_flow_action"/>!!!");
}
return b;
}
//-->
</script>
</head>
<body>
<html:form action="/dynaform/document/view.do" styleId="formItem" method="post">
<table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td height="38" class="list-toolbar">
<%
//
String writers = dvo.getWriters();
String userId = user.getId();
if(writers == null || writers.trim().length() == 0 || (writers.indexOf(userId +";") !=-1)){
%>
<input type="button" name="btnSave" value="<s:Language key="ok"/>" class="bt" onclick="doSave();">
<% }%>
<input type="button" name="btnReturn" value="<s:Language key="return"/>" class="bt" onclick="doReturn()" >
</td>
</tr>
<tr class="row-hd">
<td height="2"> </td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="1" border="0">
<tr>
<td>
<%
Node node = null;
if(dvo.getFlow() != null){
WFRunner wfr = new WFRunner(dvo.getFlow());
node = wfr.getCurrentNode();
String name = "";
boolean isCurrentUser = false;
if(node!=null){
name=node.name;
StringList wl = new StringList();
// String[] names = node.namelist.split(";");
// for (int i = 0; i < names.length; i++) {
// String[] codes = StringUtil.split(names[i], '|');
// if(user.getDeptid().indexOf(codes[0]) >= 0 ||
// user.getGroupid().indexOf(codes[0]) >= 0 ||
// codes[0].equals(user.getId())){
UserListUtil userUtil = new UserListUtil(dvo.getReaders());
if(userUtil.isPermByUser(user)){
isCurrentUser = true;
}
// }
// }
}else{
isCurrentUser = true;
}
if(isCurrentUser){
int flowstatus = wfr.getFlowstatus();
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_NOSTART){//
out.println("<br><center><s:Language key="flow_state"/>:<s:Language key="state_isstart"/></center>");
out.println("<input type='radio' name='flowstate' value='" + WFRunner.START2RUNNING + "' onClick=\"ev_flow();\" ><s:Language key="start_flow"/><br>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_NOSTART){//
out.println("<input type='radio' name='flowstate' value='" + WFRunner.START2TERMINATE + "' onClick=\"ev_flow();\" ><s:Language key="end_flow"/><br>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_RUNNING){//
out.println("<br><center><s:Language key="flow_state"/>:<s:Language key="state_isrunning"/></center>");
out.println("<input type='radio' name='flowstate' value='" + WFRunner.RUNNING2SUSPEND + "' onClick=\"ev_flow();\" ><s:Language key="hold_flow"/><br>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_RUNNING){//
if(node.isend){//
out.println("<input type='radio' name='flowstate' value='" + WFRunner.RUNNING2COMPLETE + "' onClick=\"ev_flow();\" ><s:Language key="finish_flow"/><br>");
}
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_RUNNING){//
out.println("<input type='radio' name='flowstate' value='" + WFRunner.RUNNING2TERMIATE + "' onClick=\"ev_flow();\" ><s:Language key="end_flow"/><br>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_RUNNING){//
Vector rs = wfr.getNodeNextRelation(node);
if (rs.size()>0) {
out.println("<input type='radio' name='flowstate' value='"+ WFRunner.RUNNING2RUNNING_NEXT + "' onClick=\"ev_flow();\"><s:Language key="pass_and_send"/><br>");
out.println(" <table id='flow'><tr><td>");
Iterator iter = rs.iterator();
while (iter.hasNext()) {
Relation r = (Relation) iter.next();
Node nextNode = wfr.getNextNode(r);
if (nextNode != null && wfr.isCondition(r.condition)) {
out.println(" <input type='radio' id='nodeid' name='nodeid' value='"+ nextNode.id + "' ><s:Language key="song"/>" + nextNode.name + "<br>");
}
}
out.println("</td></tr></table>");
}
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_RUNNING){//
Collection colls = wfr.getFlowpath();
if (colls.size()>=2) {
out.println("<input type='radio' name='flowstate' value='" + WFRunner.RUNNING2RUNNING_BACK + "' onClick=\"ev_flow();\"><s:Language key="return_flow"/><br>");
out.println("<table id='back' style='display:none'><tr><td>");
Iterator paths = colls.iterator();
while (paths.hasNext()) {
String[] p = (String[]) paths.next();
if (p != null && p.length > 0) {
Node pathn = (Node) wfr.getElementByID(p[0]);
if(WFRunner.RUNNING2RUNNING_NEXT.equals(p[1])){
out.println(" <input type='radio' name='backid' value='" + p[0] + "' >" + pathn.name + "<br>");
}
}
}
out.println(" </td></tr></table>");
}
}
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_SUSPEND){//
out.println("<br><center><s:Language key="flow_state"/>:<s:Language key="state_ishold"/></center>");
out.println("<input type='radio' name='flowstate' value='" + WFRunner.SUSPEND2RUNNING + "' onClick=\"ev_flow();\" ><s:Language key="resume_flow"/><br>");
}
// if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_NOSTART){//
// out.println("<input type='radio' name='flowstate' value='" + WFRunner.SUSPEND2SUSPEND + "' onClick=\"ev_flow();\" checked><s:Language key="state_continue_suspend"/><br>");
// }
if(flowstatus == FlowDiagram.FLOWSTATUS_OPEN_RUN_SUSPEND){//
out.println("<input type='radio' name='flowstate' value='" + WFRunner.SUSPEND2ABORT + "' onClick=\"ev_flow();\" ><s:Language key="cancel_flow"/><br>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_CLOSE_ABORT){//
out.println("<br><center><s:Language key="flow_state"/>:<s:Language key="state_iscancel"/></center>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_CLOSE_COMPLETE){//
out.println("<br><center><s:Language key="flow_state"/>:<s:Language key="state_isfinish"/></center>");
}
if(flowstatus == FlowDiagram.FLOWSTATUS_CLOSE_TERMINAT){//
out.println("<br><center><s:Language key="flow_state"/>:<center><s:Language key="state_isabort"/></center>");
}
}else{
out.println("<s:Language key="u_cannot_process_this_flow"/>!");
}
}
%>
</td>
</tr>
</table></td>
</tr>
</table>
</html:form>
</body>
</html:html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -