sdataAction.jsp
16.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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="weaver.workflow.exchange.rdata.RDataUtil"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="java.util.*"%>
<%@ page import="weaver.general.Util"%>
<%@ page import="weaver.interfaces.datasource.DataSource"%>
<%@ page import="weaver.general.StaticObj"%>
<%@ page import="weaver.general.StaticObj,weaver.workflow.exchange.ExchangeUtil"%>
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="FieldComInfo" class="weaver.workflow.field.FieldComInfo" scope="page" />
<jsp:useBean id="GetFormDetailInfo" class="weaver.workflow.automatic.GetFormDetailInfo" scope="page" />
<jsp:useBean id="RDataUtil" class="weaver.workflow.exchange.rdata.RDataUtil" scope="page" />
<jsp:useBean id="manageDetachComInfo" class="weaver.hrm.moduledetach.ManageDetachComInfo" scope="page" />
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<%
if(!HrmUserVarify.checkUserRight("WFEC:SETTING", user))
{
response.sendRedirect("/notice/noright.jsp");
return;
}
boolean isUseWfManageDetach = manageDetachComInfo.isUseWfManageDetach();
int tempsubcomid = -1 ;
if(isUseWfManageDetach){
RecordSet.executeSql("select wfdftsubcomid from SystemSet");
RecordSet.next();
tempsubcomid = Util.getIntValue(RecordSet.getString(1),0);
}
int detachable = Util.getIntValue(request.getParameter("detachable"),0);
int operatelevel = -1 ;
if(isUseWfManageDetach){
detachable = 1 ;
}
if(detachable==1){
int subcompanyid = Util.getIntValue(request.getParameter("subcompanyid"),0);
if(request.getParameter("subcompanyid")==null){
subcompanyid=Util.getIntValue(String.valueOf(session.getAttribute("managefield_subCompanyId")),0);
}
if(subcompanyid == -1){
subcompanyid = user.getUserSubCompany1();
}
operatelevel = CheckSubCompanyRight.ChkComRightByUserRightCompanyId(user.getUID(),ExchangeUtil.WFEC_SETTING_RIGHTSTR,subcompanyid);
if(operatelevel < 0 ){
response.sendRedirect("/notice/noright.jsp");
return;
}
}
%>
<%
String workflowid = "";
String datasourceid = "";
String workflowname = "";
String outermaintable = "";
String datarecordtype = "";
String datarecordtable = "";
String outerdetailtables = "";
ArrayList outerdetailtablesArr = new ArrayList();
String typename = Util.null2String(request.getParameter("typename"));
String viewid = Util.null2String(request.getParameter("viewid"));
String formid = "";
String isbill = "";
RecordSet.executeSql("select * from wfec_indatawfset where id="+viewid);
if(RecordSet.next()){
workflowid = Util.null2String(RecordSet.getString("workflowid"));
datasourceid = Util.null2String(RecordSet.getString("datasourceid"));
formid = WorkflowComInfo.getFormId(workflowid);
isbill = WorkflowComInfo.getIsBill(workflowid);
workflowname = Util.null2String(WorkflowComInfo.getWorkflowname(workflowid));
outermaintable = Util.null2String(RecordSet.getString("outermaintable"));
outerdetailtables = Util.null2String(RecordSet.getString("outerdetailtables"));
outerdetailtablesArr = Util.TokenizerString(outerdetailtables,",");
}
if("".equals(datarecordtype)){
datarecordtype = "1";
}
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<LINK href="/css/Weaver_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/js/weaver_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/requestTopMenu_wev8.css" type="text/css" />
<link rel="stylesheet" href="/wui/theme/ecology8/jquery/js/zDialog_e8_wev8.css" type="text/css" />
<script type="text/javascript" src="/js/dragBox/parentShowcol_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/requestView_wev8.css" type="text/css" />
<script language=javascript src="/js/ecology8/request/e8.browser_wev8.js"></script>
<script src="/wui/theme/ecology8/weaveredittable/js/WeaverEditTable_wev8.js"></script>
<link rel="stylesheet" href="/wui/theme/ecology8/weaveredittable/css/WeaverEditTable_wev8.css">
<link href="/js/checkbox/jquery.tzCheckbox_wev8.css" type=text/css rel=STYLESHEET>
<script type="text/javascript" src="/js/ecology8/jNice/jNice/jquery.jNice_wev8.js"></script>
</head>
<%
String imagefilename = "/images/hdDOC_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(33085, user.getLanguage());
String needfav ="1";
String needhelp ="";
String fieldSql = "";
String modes = "<select name='isnode' id='isnode' onchange='clearLinkOrNode(this)'>"+
"<option value=1>"+SystemEnv.getHtmlLabelName(18010,user.getLanguage())+"</option>"+
"<option value=0>"+SystemEnv.getHtmlLabelName(386027,user.getLanguage())+"</option>";
String actions = "<select name='customervalue' id='customervalue'>"+
"<option value='ExchangeSetValueAction'>"+SystemEnv.getHtmlLabelName(129043, user.getLanguage())+"</option>";
String linkOrNodes = "<span id='descript'></span><span name='objid' class='browser' completeUrl='javascript:getCompleteUrl(objid_#rowIndex#)' browserUrl='#' getBrowserUrlFn='getBrowserUrlFn' getBrowserUrlFnParams='#objid_#rowIndex#' isSingle=true linkUrl='#' hasInput=true viewType=0 isMustInput=2></span>";
if("1".equals(isbill)){
fieldSql = "select distinct t.id,t2.labelname from workflow_billfield t, HtmlLabelInfo t2 where billid = "+formid+" and ((type in (9,37) and fieldhtmltype=3) or fieldhtmltype=6) and t.fieldlabel = t2.indexid and t2.languageid="+user.getLanguage();
}else{
fieldSql = "select fieldid,fieldlable from workflow_fieldlable t where formid= "+formid+" and langurageid="+user.getLanguage()+" and fieldid in (select id from workflow_formdict where ((type in (9,37) and fieldhtmltype=3) or fieldhtmltype=6))";
}
%>
<body>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(86,user.getLanguage())+",javascript:doSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<input type="button" id="doSubmit" value="<%=SystemEnv.getHtmlLabelName(86 ,user.getLanguage()) %>" class="e8_btn_top" onclick="doSubmit()"/>
<span title="<%=SystemEnv.getHtmlLabelName(23036 ,user.getLanguage()) %>" class="cornerMenu"></span>
</td>
</tr>
</table>
<form name="frmmain" method="post" action="sdataOperation.jsp">
<input type="hidden" id="operate" name="operate" value="saveActionList" />
<input type="hidden" id="wfid" name="wfid" value="<%=workflowid %>" />
<input type="hidden" id="rowNum" name="rowNum" value="0" />
<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv" style='display:none;'>
</div>
<wea:layout>
<wea:group context='<%=SystemEnv.getHtmlLabelName(33407,user.getLanguage())%>'>
<wea:item type="groupHead">
<input type="button" class="addbtn" title="<%= SystemEnv.getHtmlLabelName(611,user.getLanguage())%>" onclick="groupAction.addRow();"/>
<input type="button" class="delbtn" title="<%= SystemEnv.getHtmlLabelName(91,user.getLanguage())%>" onclick="deleteAction();"/>
</wea:item>
<wea:item attributes="{'isTableList':'true','colspan':'full'}">
<div id="actionList"></div>
<%
int initrows = 0 ;
RecordSet.executeSql("select * from workflowactionset where workflowid="+workflowid+" and interfacetype=3 and interfaceid='ExchangeSetValueAction'");//3:Action接口
initrows = RecordSet.getCounts() ;
String ajaxDatas = RDataUtil.getIntDatas("actionList",user,RecordSet);
%>
<input type="hidden" id="rowNum" name="rowNum" value="0" />
<input type="hidden" id="actiondeleterows" name="actiondeleterows" />
<input type="hidden" id="allrows" name="allrows" value="<%=initrows %>"/>
<input type="hidden" id="addrows" name="addrows" />
<script type="text/javascript">
var groupAction = null;
jQuery(document).ready(function(){
var ajaxDatas = <%=ajaxDatas%>
var itemhtml = "<input class=\"inputstyle\" tzCheckbox=\"true\" type=checkbox id=\"isused\" name=\"isused\" value=\"1\" />";
var items=[
{width:"10%",display:"",colname:"<%=SystemEnv.getHtmlLabelNames("19831",user.getLanguage())%>",itemhtml:"<%=actions%>"},
{width:"20%",colname:"<%=SystemEnv.getHtmlLabelNames("33408",user.getLanguage())%>",itemhtml:"<%=modes%>"},
{width:"40%",colname:"<%=SystemEnv.getHtmlLabelNames("33410",user.getLanguage())%>",itemhtml:"<%=linkOrNodes%>"},
{width:"20%",colname:"<%=SystemEnv.getHtmlLabelNames("18624",user.getLanguage())%>",itemhtml:itemhtml}
];
var option = {
basictitle:"",
optionHeadDisplay:"none",
colItems:items,
container:"#actionList",
toolbarshow:false,
openindex:true,
configCheckBox:true,
usesimpledata:true,
initdatas:ajaxDatas,
addrowCallBack:addrowcallback,
checkBoxItem:{"itemhtml":'<input name="actionChecbox" class="groupselectbox" type="checkbox" value="-1">',width:"5%"}
};
groupAction=new WeaverEditTable(option);
jQuery("#actionList").append(groupAction.getContainer());
});
function deleteAction(){
//top.Dialog.confirm("<%=SystemEnv.getHtmlLabelNames("15097",user.getLanguage())%>",function(){
groupAction.deleteRows();
jQuery("#actiondeleterows").val(groupAction.deleteRowIds);
//});
}
function getBrowserUrlFn(obj){
var mode = jQuery(obj).closest("tr").children("td").eq(2).children("select").val();
if(mode=="1"){
return "/systeminfo/BrowserMain.jsp?mouldID=workflow&url=/workflow/workflow/WorkFlowNodeBrowser.jsp?wfid=<%=workflowid%>";
}else{
return "/systeminfo/BrowserMain.jsp?mouldID=workflow&url=/workflow/workflow/WorkFlowLinkBrowser.jsp?wfid=<%=workflowid%>";
}
}
function getCompleteUrl(obj){
var mode = jQuery(obj).closest("tr").children("td").eq(2).children("select").val();
if(mode=="1"){
return "/data.jsp?type=workflowNodeBrowser&wfid=<%=workflowid%>";
}else{
return "/data.jsp?type=WorkflowNodePortalBrowserMulti&wfid=<%=workflowid%>";
}
}
function clearLinkOrNode(obj){
var e8_os = jQuery(obj).closest("tr").children("td").eq(3).find("div.e8_os");
var innerOs = jQuery(obj).closest("tr").children("td").eq(3).find("div.e8_innerShow");
e8_os.find("input[type='hidden']").val("");
e8_os.find("span.e8_showNameClass").remove();
innerOs.find("span[name$='spanimg']").html("<img src='/images/BacoError_wev8.gif' align='absmiddle'/>");
/*
var span = jQuery(obj).closest("tr").children("td").eq(5).children("span");
if(jQuery(obj).val()=="1"){
span.show();
}else{
span.hide();
}
*/
}
function addrowcallback($this,tr){
try{
jQuery("#allrows").val(groupAction.count);
var addidx = jQuery("#addrows").val();
jQuery("#addrows").val(addidx+","+groupAction.count);
var idx = groupAction.count - 1 ;
//console.log("idx = "+idx);
jQuery("input[name=isused_"+idx+"]").attr("checked",true);
//console.log("jQuery(\"input[name=isused_"+idx+"]\") = "+jQuery("input[name=isused_"+idx+"]").attr("checked"));
reshowCheckBox();
}catch(e){
}
return ;
}
</script>
</wea:item>
</wea:group>
</wea:layout>
</form>
</body>
</html>
<script type="text/javascript">
jQuery(document).ready(function () {
$("#topTitle").topMenuTitle();
$(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
$("#tabDiv").remove();
$("#advancedSearch").bind("click", function(){
});
reshowCheckBox();
});
function reshowCheckBox()
{
jQuery("input[type=checkbox]").each(function(){
if(jQuery(this).attr("tzCheckbox")=="true"){
jQuery(this).tzCheckbox({labels:['','']});
}
});
}
function doSubmit(){
var lastTR = jQuery("#actionList").find("table.grouptable tbody tr[class='contenttr']:last");
var name = lastTR.children("td:first").find("input[type='checkbox']").attr("name");
try{
var idx = "-1";
try{
idx = name.substring(name.lastIndexOf("_")+1,name.length);
}catch(e){
idx = "-1";
}
var actionData = {
wfid:<%=workflowid%>,
operate:"saveActionList",
actiondeleterows:jQuery("#__weaverDeleteRows").val(),
allrows:jQuery("#allrows").val(),
addrows:jQuery("#addrows").val()
};
var params = jQuery("#actionList").find("input[type='hidden'],input[type='checkbox'],select");
params.each(function(){
var pv = "" ;
if(jQuery(this).attr("type")=="checkbox" && !jQuery(this).hasClass("groupselectbox")){
pv = jQuery(this).attr("checked")?"1":"0";
}else{
if(jQuery(this).attr("name").indexOf("isused")!=-1){
pv = jQuery(this).attr("checked")?"1":"0";
}else{
pv = jQuery(this).val();
}
}
actionData[jQuery(this).attr("name")] = pv ;
});
jQuery.ajax({
url:"sdataOperation.jsp",
dataType:"text",
type:"post",
async:false,
data:actionData,
success:function(data){
if(data==1){
top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("83551",user.getLanguage())%>");//83280
}else{
top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("83280",user.getLanguage())%>");//83280
}
window.location.reload() ;
}
});
}catch(e){
top.Dialog.alert(e.message);
}
}
function disModalDialog(url, spanobj, inputobj, need, curl) {
var id = window.showModalDialog(url, "",
"dialogWidth:550px;dialogHeight:550px;");
if (id != null) {
if (wuiUtil.getJsonValueByIndex(id, 0) != "") {
if (curl != undefined && curl != null && curl != "") {
spanobj.innerHTML = "<A href='" + curl
+ wuiUtil.getJsonValueByIndex(id, 0) + "'>"
+ wuiUtil.getJsonValueByIndex(id, 1) + "</a>";
} else {
spanobj.innerHTML = wuiUtil.getJsonValueByIndex(id, 1);
}
inputobj.value = wuiUtil.getJsonValueByIndex(id, 0);
} else {
spanobj.innerHTML = need ? "<IMG src='/images/BacoError_wev8.gif' align=absMiddle>" : "";
inputobj.value = "";
}
}
}
function setIsUsedVal(obj)
{
if(obj.checked)
{
jQuery(obj).nextAll('input[name=isused]').val("1")
}
else
{
jQuery(obj).nextAll('input[name=isused]').val("0")
}
}
</script>