RejectNodeSetFree.jsp
9.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="weaver.general.Util,java.util.Comparator" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="java.util.*" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="RequestRejectManager" class="weaver.workflow.request.RequestRejectManager" scope="page" />
<jsp:useBean id="WorkflowIsFreeStartNode" class="weaver.workflow.request.WorkflowIsFreeStartNode" scope="page" />
<%
int requestid=Util.getIntValue(Util.null2String(request.getParameter("requestid")),0);
int workflowid=Util.getIntValue(Util.null2String(request.getParameter("workflowid")),0);
int isrejecttype=Util.getIntValue(Util.null2String(request.getParameter("isrejecttype")),0);
int nodeid=Util.getIntValue(Util.null2String(request.getParameter("nodeid")),0);
int isFreeNode=Util.getIntValue(Util.null2String(request.getParameter("isFreeNode")),0);//是否自由节点
int isrejectremind=Util.getIntValue(Util.null2String(request.getParameter("isrejectremind")),0);
int ischangrejectnode=Util.getIntValue(Util.null2String(request.getParameter("ischangrejectnode")),0);
RecordSet.executeSql("select startnodeid from workflow_nodebase where id="+nodeid);
String startnodeid="";//自由流程的开始节点
if(RecordSet.next()){
startnodeid=RecordSet.getString("startnodeid");
}
String startnodeid01="";
String sql02="";
if("oracle".equals(RecordSet.getDBType())){
sql02="select nodeid from workflow_nodelink where nvl(isreject,0)!=1 and destnodeid="+nodeid;
}else if(RecordSet.getDBType().equals("mysql")){
sql02="select nodeid from workflow_nodelink where ifnull(isreject,0)!=1 and destnodeid="+nodeid;
}else{
sql02="select nodeid from workflow_nodelink where isnull(isreject,0)!=1 and destnodeid="+nodeid;
}
RecordSet.executeSql(sql02);
if(RecordSet.next()){
startnodeid01=RecordSet.getString("nodeid");
}
ArrayList list=new ArrayList();
List listnodeid=WorkflowIsFreeStartNode.getAllNodeid(""+nodeid,""+workflowid,""+startnodeid,list);
Collections.sort(listnodeid);
Collections.sort(listnodeid, new Comparator() {
public int compare(Object o1, Object o2) {
return new Double((String) o1).compareTo(new Double((String) o2));
}
});
%>
<html>
<head>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<link rel="stylesheet" type="text/css" href="/css/xpSpin_wev8.css">
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
</head>
<BODY style="overflow:hidden">
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="workflow"/>
<jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelName(84508,user.getLanguage())%>"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td>
</td>
<td class="rightSearchSpan" style="text-align:right;">
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage())%>" class="cornerMenu"></span>
</td>
</tr>
</table>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(826,user.getLanguage())+",javascript:onsave(),_self} " ;
RCMenuHeight += RCMenuHeightStep;
RCMenu += "{"+SystemEnv.getHtmlLabelName(201,user.getLanguage())+",javascript:btnclose_onclick(),_self} " ;
RCMenuHeight += RCMenuHeightStep;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<wea:layout>
<%
if(isrejecttype!=1){
%>
<wea:group context='<%=SystemEnv.getHtmlLabelName(26437,user.getLanguage())%>'>
<wea:item attributes="{'isTableList':'true'}">
<table class="ListStyle" id="oTable" cellspacing=0>
<COLGROUP>
<COL width="30%">
<COL width="70%">
</COLGROUP>
<tr class=header>
<td><%=SystemEnv.getHtmlLabelName(18214,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(15070,user.getLanguage())%></td>
</tr>
<%
for(int i=0;i<listnodeid.size();i++){
String nodeidst=(String)listnodeid.get(i);
RecordSet.executeSql("select nodename from workflow_nodebase where id="+nodeidst);
String nodename="";
if(RecordSet.next()){
nodename=RecordSet.getString("nodename");
}
%>
<tr class=DataDark>
<td>
<input type="radio" name="rejectnodeid" onchange="checkIfSingle(this)" value="<%=nodeidst %>" <%if(nodeidst.equals(startnodeid01)){%>checked<%}%>>
</td>
<td>
<%=nodename %>
</td>
</tr>
<%}%>
</table>
</wea:item>
</wea:group>
<%}%>
<%if(isrejectremind==1&&ischangrejectnode==1){ %>
<wea:group context='<%=SystemEnv.getHtmlLabelName(26438,user.getLanguage())%>'>
<wea:item attributes="{'isTableList':'true'}">
<table class="ListStyle" id="oTable" cellspacing=0>
<COLGROUP>
<COL width="30%">
<COL width="70%">
</COLGROUP>
<tr class=header>
<td><input type="checkbox" value="-1" id="checkall" checked onclick="oncheckall(this)"><%=SystemEnv.getHtmlLabelName(556,user.getLanguage())%></td>
<td><%=SystemEnv.getHtmlLabelName(15070,user.getLanguage())%></td>
</tr>
<%
for(int i=0;i<listnodeid.size();i++){
String nodeidst=(String)listnodeid.get(i);
RecordSet.executeSql("select nodename from workflow_nodebase where id="+nodeidst);
String nodename="";
if(RecordSet.next()){
nodename=RecordSet.getString("nodename");
}
%>
<tr class=DataLight>
<td>
<input type="checkbox" name="nodeid_<%=nodeidst%>" value="<%=nodeidst%>" checked onclick="clearcheckall()">
</td>
<td>
<%=nodename %>
</td>
</tr>
<%}%>
<%
RecordSet.executeSql("select nodename from workflow_nodebase where id="+nodeid);
String nodename="";
if(RecordSet.next()){
nodename=RecordSet.getString("nodename");
}
%>
<tr class=DataLight>
<td>
<input type="checkbox" name="nodeid_<%=nodeid%>" value="<%=nodeid%>" checked onclick="clearcheckall()">
</td>
<td>
<%=nodename %>
</td>
</tr>
</table>
</wea:item>
</wea:group>
<%}%>
</wea:layout>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="" attributes='{\"groupDisplay\":\"none\"}'>
<wea:item type="toolbar">
<input type="button" value="<%="O-"
+ SystemEnv.getHtmlLabelName(826, user.getLanguage())%>"
id="zd_btn_submit_0" class="zd_btn_submit" onclick="onsave();">
<input type="button" accessKey=T id=btncancel
value="<%="T-"
+ SystemEnv.getHtmlLabelName(201, user.getLanguage())%>"
id="zd_btn_cancle" class="zd_btn_cancle" onclick="btnclose_onclick();">
</wea:item>
</wea:group>
</wea:layout>
</div>
<script language=javascript>
var parentWin = null;
var dialog = null;
try{
parentWin = parent.parent.getParentWindow(parent);
dialog = parent.parent.getDialog(parent);
}catch(e){
}
// 关闭
function btnclose_onclick(){
if(dialog){
try{
dialog.close();
}catch(e){
}
}else{
window.parent.close();
}
}
function callback(returnjson){
if(dialog){
try{
dialog.callback(returnjson);
}catch(e){
}
dialog.close(returnjson);
}else{
window.parent.returnValue = returnjson;
window.parent.close();
}
}
function oncheckall(obj){
if(jQuery(obj).is(":checked")){
jQuery("input[name^=nodeid_]").each(function(){
changeCheckboxStatus($(this),true);
});
}else{
jQuery("input[name^=nodeid_]").each(function(){
changeCheckboxStatus($(this),false);
});
}
}
function clearcheckall(){
if($G("checkall").checked){
changeCheckboxStatus($("#checkall"),false);
}
}
function getRadioValue(name){
if(document.getElementsByName(name)){
var radioes = document.getElementsByName(name);
for(var i=0;i<radioes.length;i++)
{
if(radioes[i].checked){
return radioes[i].value;
}
}
}
return "";
}
function onsave(){
var nodeids="";
var rejectnodeid="";
<%if(ischangrejectnode==1){%>
if($G("checkall").checked){
nodeids="-1";
}else{
<%
for(int j=0;j<listnodeid.size();j++){
%>
if($G("nodeid_<%=listnodeid.get(j)%>").checked){
if(nodeids.length>0){
nodeids+=","+$G("nodeid_<%=listnodeid.get(j)%>").value;
}else{
nodeids=$G("nodeid_<%=listnodeid.get(j)%>").value;
}
}
<%}%>
if($G("nodeid_<%=nodeid%>").checked){
if(nodeids.length>0){
nodeids+=","+$G("nodeid_<%=nodeid%>").value;
}else{
nodeids=$G("nodeid_<%=nodeid%>").value;
}
}
//alert(nodeids);
}
<%}%>
<%
if(isrejecttype!=1){
%>
rejectnodeid=getRadioValue("rejectnodeid");
if(rejectnodeid==""){
alert("<%=SystemEnv.getHtmlLabelName(26436,user.getLanguage())%>");
return false;
}
<%}%>
if(nodeids==""){
nodeids=rejectnodeid;
}
var returnjson = {id:nodeids,name:nodeids+'|'+rejectnodeid+"|0"}
callback(returnjson);
}
function checkIfSingle(obj){
if(jQuery(obj).is(":checked")){
jQuery(obj).next(".jNiceRadio").addClass("jNiceChecked");
}
}
</script>
</body>
</html>