chooseHtmlTemplate.jsp
9.34 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%@ page import="weaver.workflow.exceldesign.FormTemplateManager" %>
<jsp:useBean id="WorkflowComInfo" class="weaver.workflow.workflow.WorkflowComInfo" scope="page" />
<jsp:useBean id="xssUtil" class="weaver.filter.XssUtil" scope="page" />
<%
String nodeid = Util.null2String(request.getParameter("nodeid"));
boolean isFormLayout = FormTemplateManager.isFormVirtualNode(nodeid);
String formid = Util.null2String(request.getParameter("formid"));
String isbill = Util.null2String(request.getParameter("isbill"));
String layouttype = Util.null2String(request.getParameter("layouttype"));
String curlayoutid = Util.null2String(request.getParameter("curlayoutid"));
String fromwhere = Util.null2String(request.getParameter("fromwhere"));
String search_wfid = Util.null2String(request.getParameter("search_wfid"));
String search_layoutname = Util.null2String(request.getParameter("search_layoutname"));
int search_active = Util.getIntValue(request.getParameter("search_active"));
boolean canClear = true;
if(!isFormLayout && FormTemplateManager.judgeLayoutBelForm(Util.getIntValue(curlayoutid))) //节点活动模板属于表单,无法清除
canClear = false;
String sqlwhere = xssUtil.put(" and formid="+formid+" and isbill="+isbill+" ");
String completeUrl = "/data.jsp?type=workflowBrowser&from=htmllayoutchoose&sqlwhere="+xssUtil.put(" formid="+formid+" and isbill="+isbill+" ");
String backfields = " id,workflowid,nodeid,layoutname,version,isactive";
String fromSql = " workflow_nodehtmllayout a";
String whereSql = " formid="+formid+" and isbill="+isbill+" and type="+layouttype;
if(canClear)
whereSql += " and id<>"+curlayoutid;
if(isFormLayout){ //表单模板选择
whereSql += " and nodeid="+FormTemplateManager.getFORMVIRTUALNODEID();
}else{ //节点可选表单模板
whereSql += " and not exists (select 1 from workflow_nodebase where id=nodeid and isfreenode='1')";
if(!"".equals(search_wfid))
whereSql += " and (workflowid="+search_wfid+" or nodeid="+FormTemplateManager.getFORMVIRTUALNODEID()+")";
}
if(search_active != -1)
whereSql += " and isactive="+search_active+" ";
if(!"".equals(search_layoutname))
whereSql += " and layoutname like '%"+search_layoutname+"%' ";
//System.err.println(whereSql);
String orderSql = " workflowid asc,(select nodeorder from workflow_flownode b where b.nodeid=a.nodeid) asc,isactive desc";
String tableString = " <table instanceid=\"htmlLayoutListTable\" tabletype=\"none\" pagesize=\""+PageIdConst.getPageSize(PageIdConst.WF_CHOOSELAYOUT,user.getUID())+"\" >"+
" <sql backfields=\""+backfields+"\" sqlform=\""+fromSql+"\" sqlwhere=\""+Util.toHtmlForSplitPage(whereSql)+"\" sqlorderby=\""+orderSql+"\" sqlprimarykey=\"id\" sqlsortway=\"desc\" sqlisdistinct=\"false\" />"+
" <head>"+
" <col width=\"8%\" text=\""+SystemEnv.getHtmlLabelName(33144,user.getLanguage())+"ID\" column=\"id\" />"+
" <col width=\"40%\" text=\""+SystemEnv.getHtmlLabelName(18151,user.getLanguage())+"\" column=\"layoutname\" otherpara=\"column:isactive+"+user.getLanguage()+"\" transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.reflectLayoutName\" />"+
" <col width=\"22%\" text=\""+SystemEnv.getHtmlLabelName(15070,user.getLanguage())+"\" column=\"nodeid\" transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.reflectNodename\" />"+
" <col width=\"30%\" text=\""+SystemEnv.getHtmlLabelName(81651,user.getLanguage())+"\" column=\"workflowid\" transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.reflectWorkflowname\" />"+
" <col hide=\"true\" text=\"\" column=\"version\" />"+
" <col hide=\"true\" text=\"\" column=\"nodeid\" transmethod=\"weaver.workflow.exceldesign.HtmlLayoutOperate.reflectLayoutBelForm\" />"+
" </head>"+
" </table>";
%>
<html>
<head>
</head>
<body style="overflow:hidden">
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(197,user.getLanguage())+",javascript:doSearch(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
if(canClear){
RCMenu += "{"+SystemEnv.getHtmlLabelName(311,user.getLanguage())+",javascript:doClear(),_top} " ;
RCMenuHeight += RCMenuHeightStep ;
}
RCMenu += "{"+SystemEnv.getHtmlLabelName(201,user.getLanguage())+",javascript:doClose(),_top} " ;
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" value="<%=SystemEnv.getHtmlLabelName(197,user.getLanguage()) %>" onclick="doSearch();" class="e8_btn_top">
<span title="<%=SystemEnv.getHtmlLabelName(23036,user.getLanguage()) %>" class="cornerMenu"></span>
</td>
</tr>
</table>
<form name="weaverform" method="post" action="chooseHtmlTemplate.jsp">
<wea:layout type="4col">
<wea:group context="<%=SystemEnv.getHtmlLabelName(15774,user.getLanguage()) %>">
<%if(!isFormLayout){ %>
<wea:item><%=SystemEnv.getHtmlLabelName(81651,user.getLanguage()) %></wea:item>
<wea:item attributes="{'colspan':'3'}">
<brow:browser viewType="0" name="search_wfid"
browserValue="<%=search_wfid %>" getBrowserUrlFn="getWfBrowUrl"
hasInput="true" isSingle="true" hasBrowser="true" isMustInput="1"
completeUrl="<%=completeUrl %>"
browserSpanValue="<%=WorkflowComInfo.getWorkflowname(search_wfid)%>">
</brow:browser>
</wea:item>
<%} %>
<wea:item><%=SystemEnv.getHtmlLabelName(18151,user.getLanguage()) %></wea:item>
<wea:item>
<input type="text" class="InputStyle" name="search_layoutname" value="<%=search_layoutname %>" />
</wea:item>
<wea:item><%=SystemEnv.getHtmlLabelName(501840,user.getLanguage()) %></wea:item>
<wea:item>
<select name="search_active">
<option value="-1" <%=search_active==-1?"selected":"" %>><%=SystemEnv.getHtmlLabelName(332,user.getLanguage()) %></option>
<option value="1" <%=search_active==1?"selected":"" %>><%=SystemEnv.getHtmlLabelName(678,user.getLanguage()) %></option>
<option value="0" <%=search_active==0?"selected":"" %>><%=SystemEnv.getHtmlLabelName(1477,user.getLanguage()) %></option>
</select>
</wea:item>
</wea:group>
<wea:group context="" attributes="{'groupDisplay':'none'}">
<wea:item attributes="{'isTableList':'true'}">
<wea:SplitPageTag tableString='<%=tableString%>' mode="run" />
<input type="hidden" name="pageId" id="pageId" _showCol="false" value="<%=PageIdConst.WF_CHOOSELAYOUT %>"/>
</wea:item>
</wea:group>
</wea:layout>
<input type="hidden" name="nodeid" value="<%=nodeid %>" />
<input type="hidden" name="formid" value="<%=formid %>" />
<input type="hidden" name="isbill" value="<%=isbill %>" />
<input type="hidden" name="layouttype" value="<%=layouttype %>" />
<input type="hidden" name="curlayoutid" value="<%=curlayoutid %>" />
<input type="hidden" name="fromwhere" value="<%=fromwhere %>" />
</form>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="" attributes="{'groupDisplay':'none'}">
<wea:item type="toolbar">
<%if(canClear){ %>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(311,user.getLanguage())%>" class="zd_btn_cancle" onclick="doClear();" />
<%} %>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>" class="zd_btn_cancle" onclick="doClose();" />
</wea:item>
</wea:group>
</wea:layout>
</div>
</body>
<script type="text/javascript">
var dialog;
jQuery(document).ready(function(){
dialog = window.parent.parent.getDialog(window.parent);
});
function afterDoWhenLoaded(){
var tablelist = jQuery("div#_xTable").find("table.ListStyle");
tablelist.find("tr").each(function(){
if(jQuery(this).is(".Spacing"))
return true;
jQuery(this).click(function(){
if(dialog){
var id = jQuery(this).find("td:eq(1)").html();
var name = jQuery(this).find("td:eq(2)").html();
var version = jQuery(this).find("td:eq(5)").html();
var belform = jQuery(this).find("td:eq(6)").html();
var retJson = {"id":id, "name":name.substring(0,name.length-4), "version":version, "belform":belform};
if("<%=fromwhere %>" == "showModule"){
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(127974, user.getLanguage())%>", function(){
window.parent.__setloaddingeffect();
dialog.callback(retJson);
});
}else{
dialog.callback(retJson);
}
}
});
});
//页面滚动条控制
window.setTimeout(function(){
tablelist.parent().css("max-height","400px");
},100);
}
function doClear(){
if(dialog){
var retJson = {"id":"-1", "name":""};
if("<%=fromwhere %>" == "showModule" ){
if("<%=curlayoutid %>" == "0"){
dialog.close();
}else{
window.top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(127976, user.getLanguage())%>", function(){
window.parent.__setloaddingeffect();
dialog.callback(retJson);
});
}
}else{
dialog.callback(retJson);
}
}
}
function doSearch(){
weaverform.submit();
}
function doClose(){
if(dialog)
dialog.close();
}
function getWfBrowUrl(){
return "/systeminfo/BrowserMain.jsp?url=/workflow/workflow/WorkflowTypeBrowser.jsp?from=htmllayoutchoose&sqlwhere=<%=sqlwhere %>";
}
</script>
</html>