WFTitleSet.jsp
12.9 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
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="WFManager" class="weaver.workflow.workflow.WFManager" scope="session"/>
<jsp:useBean id="FieldComInfo" class="weaver.workflow.field.FieldComInfo" scope="page" />
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<%
String ajax=Util.null2String(request.getParameter("ajax"));
String isdialog = Util.null2String(request.getParameter("isdialog"));
String isclose = Util.null2String(request.getParameter("isclose"));
%>
<%
if(!HrmUserVarify.checkUserRight("WorkFlowTitleSet:ALL", user)){
response.sendRedirect("/notice/noright.jsp");
return;
}
%>
<html>
<%
String isbill = "";
int wfid=0;
int formid=0;
wfid=Util.getIntValue(Util.null2String(request.getParameter("wfid")),0);
String sql="";
WFManager.reset();
WFManager.setWfid(wfid);
WFManager.getWfInfo();
formid = WFManager.getFormid();
isbill = WFManager.getIsBill();
int detachable=Util.getIntValue(String.valueOf(session.getAttribute("detachable")),0);
int subCompanyId= -1;
int operatelevel=0;
if(detachable==1){
if(request.getParameter("subCompanyId")==null){
subCompanyId=Util.getIntValue(String.valueOf(session.getAttribute("managefield_subCompanyId")),-1);
}else{
subCompanyId=Util.getIntValue(request.getParameter("subCompanyId"),-1);
}
if(subCompanyId == -1){
subCompanyId = user.getUserSubCompany1();
}
session.setAttribute("managefield_subCompanyId",String.valueOf(subCompanyId));
operatelevel= CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(),"WorkflowManage:All",subCompanyId);
}else{
if(HrmUserVarify.checkUserRight("WorkflowManage:All", user))
operatelevel=2;
}
if (isbill.equals("0"))
{
sql="select workflow_formfield.fieldid, workflow_fieldlable.fieldlable from workflow_formfield,workflow_fieldlable where workflow_formfield.fieldid=workflow_fieldlable.fieldid and workflow_fieldlable.formid=workflow_formfield.formid and workflow_fieldlable.formid="+formid+" and (workflow_formfield.isdetail<>'1' or workflow_formfield.isdetail is null) and langurageid="+user.getLanguage();
//TD8709
sql += " order by workflow_formfield.isdetail desc, workflow_formfield.groupid, workflow_formfield.fieldorder";
}
else
{
sql="select id,fieldlabel from workflow_billfield where viewtype=0 and billid="+formid;
//TD8709
sql += " order by viewtype,detailtable,dsporder";
}
%>
<%
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(259,user.getLanguage());
String needfav ="";
String needhelp ="";
%>
<head>
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<style type="text/css">
#simpleTooltip { padding: 7px; border: 1px solid #A6A7AB!important; background: #F2F3F5!important; }
</style>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
</head>
<body>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
String saveMethodName = "";
if(operatelevel>0){
if(!ajax.equals("1")){
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:selectall(),_self} ";
saveMethodName = "selectall()";
}else{
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:flowTitleSave2(this),_self} ";
saveMethodName = "flowTitleSave2(this)";
}
RCMenuHeight += RCMenuHeightStep;
if(!ajax.equals("1")) {
RCMenu += "{"+SystemEnv.getHtmlLabelName(1290,user.getLanguage())+",addwf.jsp?src=editwf&wfid="+wfid+",_self} " ;
RCMenuHeight += RCMenuHeightStep;
}
if(!ajax.equals("1")){
if(RecordSet.getDBType().equals("db2")){
RCMenu += "{"+SystemEnv.getHtmlLabelName(83,user.getLanguage())+",/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where int(operateitem)=88 and relatedid="+wfid+",_self} " ;
}else{
RCMenu += "{"+SystemEnv.getHtmlLabelName(83,user.getLanguage())+",/systeminfo/SysMaintenanceLog.jsp?sqlwhere=where operateitem=88 and relatedid="+wfid+",_self} " ;
}
RCMenuHeight += RCMenuHeightStep ;
}
}
%>
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="workflow"/>
<jsp:param name="navName" value="<%=SystemEnv.getHtmlLabelName(19501,user.getLanguage())%>"/>
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input type="button" value="<%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%>" id="zd_btn_submit" class="e8_btn_top" onclick="<%=saveMethodName%>">
<span title="菜单" class="cornerMenu"></span>
</td>
</tr>
</table>
<%if(!ajax.equals("1")){%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<%}else{%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<%}%>
<form id="flowTitleForm" name="flowTitleForm" method=post action="WorkFlowTitleSetOperation.jsp" >
<%
if(ajax.equals("1")){
%>
<input type="hidden" name="ajax" value="1">
<%}%>
<%
String fieldid="";
RecordSet.execute("select * from workflow_TitleSet where flowid="+wfid +" order by gradation");
while(RecordSet.next()){
fieldid += RecordSet.getString("fieldid")+",";
}
%>
<%if(!ajax.equals("1")){%>
<table class=ListStyle cellspacing=1 id="oTable" style="width:100%;">
<%}else{%>
<table class=ListStyle cellspacing=1 id="oTable4port" style="width:100%;">
<%}%>
<tr class=header>
<td align=center class=field style="width:50%;cursor:default;"><%=SystemEnv.getHtmlLabelName(129513, user.getLanguage())%></td>
<td align=center class=field style="width:50px;cursor:default;"><%=SystemEnv.getHtmlLabelName(104,user.getLanguage())%></td>
<td align=center class=field style="width:50%;cursor:default;"><%=SystemEnv.getHtmlLabelName(15448,user.getLanguage())%></td>
</tr>
<tr>
<td vaglin="middle" style="height:270px;">
<select class=inputstyle size="15" name="srcList" multiple style="width:100%;height:100%;" onchange="childshowtitle(event)" ondblclick="childaddSrcToDestListTit()">
<%
RecordSet.execute(sql);
while(RecordSet.next()){
if(fieldid.indexOf(RecordSet.getString(1))==-1){
%>
<option class="vtip" title="<%if(isbill.equals("0")){%><%=RecordSet.getString(2)%><%}else{%><%=SystemEnv.getHtmlLabelName(RecordSet.getInt(2),user.getLanguage())%><%}%>" value=<%=RecordSet.getString(1)%>><%if(isbill.equals("0")){%><%=RecordSet.getString(2)%><%}else{%><%=SystemEnv.getHtmlLabelName(RecordSet.getInt(2),user.getLanguage())%><%}%></option>
<%
}
}
%>
</select>
</td>
<td align=center style="height:270px;">
<img class="rightimg" src="/js/dragBox/img/4_wev8.png" title="<%=SystemEnv.getHtmlLabelName(456,user.getLanguage())%>" onclick="javascript:childaddSrcToDestListTit();">
<br><br>
<img class="leftimg" src="/js/dragBox/img/5_wev8.png" title="<%=SystemEnv.getHtmlLabelName(91,user.getLanguage())%>" onClick="javascript:childdeleteFromDestListTit();">
</td>
<td align=center style="height:270px;">
<select class=inputstyle size=15 name="destList" multiple style="width:100%;height:100%;" onchange="childshowtitle(event)" ondblclick="childdeleteFromDestListTit()">
<%
ArrayList fieldids = Util.TokenizerString(fieldid,",");
RecordSet.execute(sql);
if(fieldids!=null && fieldids.size()>0){
for(int i=0;i<fieldids.size();i++){
while(RecordSet.next()){
if(fieldids.get(i).toString().equals(RecordSet.getString(1))){
%>
<option class="vtip" title="<%if(isbill.equals("0")){%><%=RecordSet.getString(2)%><%}else{%><%=SystemEnv.getHtmlLabelName(RecordSet.getInt(2),user.getLanguage())%><%}%>" value=<%=RecordSet.getString(1)%>><%if(isbill.equals("0")){%><%=RecordSet.getString(2)%><%}else{%><%=SystemEnv.getHtmlLabelName(RecordSet.getInt(2),user.getLanguage())%><%}%></option>
<%
}
}
RecordSet.beforFirst();
}
}
%>
</select>
</td>
</tr>
</table>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="true">
<wea:group context="" attributes="{\"groupDisplay\":\"none\"}">
<wea:item type="toolbar">
<%
if(!ajax.equals("1")){
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%>" id="zd_btn_submit" class="zd_btn_submit" onclick="javascript:selectall()">
<%
}else{
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%>" id="zd_btn_submit" class="zd_btn_submit" onclick="javascript:flowTitleSave2(this)">
<%
}
%>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" id="zd_btn_cancle" class="zd_btn_cancle" onclick="doClose()">
</wea:item>
</wea:group>
</wea:layout>
</div>
<br>
<center>
<input type="hidden" value="<%=wfid%>" name="wfid">
<input type="hidden" value="" name="postvalues">
<input type="hidden" value="<%=isdialog %>" name="isdialog">
</center>
</form>
<%if(!ajax.equals("1")){%>
<script language="JavaScript" src="/js/addRowBg_wev8.js" ></script>
<script language=javascript>
function selectall(){
setPreSpanInner();
window.document.flowTitleForm.submit();
}
var dialog = parent.getDialog(window);
var parentWin = parent.getParentWindow(window);
function childshowtitle(event){
parentWin.showtitle(event);
}
function childaddSrcToDestListTit(){
parentWin.addSrcToDestListTit();
}
function childdeleteFromDestListTit(){
parentWin.deleteFromDestListTit();
}
</script>
<%}%>
<script language=javascript>
jQuery(document).ready(function(){
initUDLR();
});
function initUDLR(){
jQuery(".leftimg").hover(function(){
jQuery(this).attr("src","/js/dragBox/img/5-h_wev8.png");
},function(){
jQuery(this).attr("src","/js/dragBox/img/5_wev8.png");
});
jQuery(".rightimg").hover(function(){
jQuery(this).attr("src","/js/dragBox/img/4-h_wev8.png");
},function(){
jQuery(this).attr("src","/js/dragBox/img/4_wev8.png");
});
}
var dialog = parent.getDialog(window);
var parentWin = parent.getParentWindow(window);
function childshowtitle(event){
parentWin.showtitle(event);
}
function childaddSrcToDestListTit(){
addSrcToDestListTit();
}
function childdeleteFromDestListTit(){
deleteFromDestListTit();
}
function addSrcToDestListTit() {
destList = window.document.flowTitleForm.destList;
srcList = window.document.flowTitleForm.srcList;
txtArray = new Array();
valArray = new Array();
var len = destList.length;
for (var i = srcList.length-1; i > -1; i--) {
if ((srcList.options[i] != null) && (srcList.options[i].selected)) {
txtArray.push(srcList.options[i].text);
valArray.push(srcList.options[i].value);
srcList.options[i]=null;
}
}
var arrayLength = txtArray.length||valArray.length;
for(var i=0;i<arrayLength;i++){
destList.options[len] = new Option(txtArray.pop(),
valArray.pop());
len++;
}
jQuery(".vtip").simpletooltip("click");
if($.browser.msie){
jQuery(".vtip").attr("title","");
}
}
function deleteFromDestListTit() {
var destList = window.document.flowTitleForm.destList;
var srcList = window.document.flowTitleForm.srcList;
var len = destList.options.length;
for ( var i = (len - 1); i >= 0; i--) {
if ((destList.options[i] != null)
&& (destList.options[i].selected == true)) {
srcList.add(new Option(destList.options[i].text,
destList.options[i].value),srcList.options[0]);
destList.options[i] = null;
}
}
}
function flowTitleSave2(obj) {
setPreSpanInner();
var rowindex4op = "";
var sel = document.flowTitleForm.destList;
for ( var i = 0; i < sel.options.length; i++) {
if (sel.options[i] != null) {
rowindex4op += sel.options[i].value + ",";
}
}
flowTitleForm.postvalues.value = rowindex4op;
flowTitleForm.submit();
obj.disabled = true;
}
function doClose(){
parent.getDialog(window).close();
}
function setPreSpanInner(){
var destList = window.document.flowTitleForm.destList;
if(destList.length>0){
jQuery("#titletemplateSpan",parentWin.document).html("<img src=\"/images/ecology8/checkright_wev8.png\" width=\"16\" height=\"17\" border=\"0\">");
}else{
jQuery("#titletemplateSpan",parentWin.document).html("");
}
}
if("<%=isclose%>"==1){
parentWin.cancelsaveAsWorkflow();
}
</script>
<script language=javascript src="/js/jquery/plugins/tooltip/jquery.tooltip_wev8.js"></script>
<LINK href="/js/jquery/plugins/tooltip/simpletooltip_wev8.css" type=text/css rel=STYLESHEET>
</body>
</html>