manage_left.jsp
9.99 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
<!DOCTYPE html>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %> <%@ include file="/systeminfo/init_wev8.jsp" %>
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="CompanyComInfo" class="weaver.hrm.company.CompanyComInfo" scope="page" />
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page" />
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="manageDetachComInfo" class="weaver.hrm.moduledetach.ManageDetachComInfo" scope="page" />
<HTML><HEAD>
<LINK REL=stylesheet type=text/css HREF=/css/Weaver_wev8.css>
<!-- added by cyril on 2008-08-20 for td:9215 -->
<script type="text/javascript" src="/js/xtree_wev8.js"></script>
<script type="text/javascript" src="/js/xmlextras_wev8.js"></script>
<script type="text/javascript" src="/js/cxloadtree_wev8.js"></script>
<link type="text/css" rel="stylesheet" href="/css/xtree_wev8.css" />
<!-- end by cyril on 2008-08-20 for td:9215 -->
<style type="text/css">
a {
word-break :break-all;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function () {
//jQuery("#deeptree").css("height", jQuery(document.body).height());
//jQuery(".ulDiv").height(jQuery(".webfx-tree-container").height());
//jQuery('#overFlowDiv').perfectScrollbar();
});
</script>
</HEAD>
<%
String needsystem = Util.null2String(request.getParameter("needsystem"));
String seclevelto=Util.fromScreen(request.getParameter("seclevelto"),user.getLanguage());
String isTemplate=Util.getIntValue(Util.null2String(request.getParameter("isTemplate")),0)+"";
String type=Util.null2String(request.getParameter("type"));
String id=Util.null2String(request.getParameter("id"));
String nodename=Util.null2String(request.getParameter("nodename"));
String level=Util.null2String(request.getParameter("level"));
String subid=Util.null2String(request.getParameter("subid"));
String rightStr=Util.null2String(request.getParameter("rightStr"));
String isWorkflowDoc = Util.null2String(request.getParameter("isWorkflowDoc"));
int uid=user.getUID();
int tabid=0;
//modified by cyril on 2008-08-20 for td:9215
String cnodeid=Util.null2String((String)session.getAttribute("treeleft_cnodeid"+isTemplate));
//out.println("1 cnodeid="+cnodeid);
String nodeid=Util.null2String(request.getParameter("nodeid"));
String rem=(String)session.getAttribute("treeleft"+isTemplate);
if(rem==null || cnodeid.equals("")){
Cookie[] cks= request.getCookies();
for(int i=0;i<cks.length;i++){
//System.out.println("ck:"+cks[i].getName()+":"+cks[i].getValue());
if(rem==null && cks[i].getName().equals("treeleft"+isTemplate+uid)){
rem=cks[i].getValue();
}
if(cnodeid.equals("") && cks[i].getName().equals("treeleft_cnodeid"+isTemplate+uid)){
cnodeid=cks[i].getValue();
}
if(rem!=null && !cnodeid.equals("")) break;
}
}
if(rem!=null){
session.setAttribute("treeleft"+isTemplate,rem);
Cookie ck = new Cookie("treeleft"+isTemplate+uid,rem);
ck.setMaxAge(30*24*60*60);
response.addCookie(ck);
nodeid=rem;
}
if(!cnodeid.equals("")) {
session.setAttribute("treeleft_cnodeid"+isTemplate,cnodeid);
Cookie ck = new Cookie("treeleft_cnodeid"+isTemplate+uid,cnodeid);
ck.setMaxAge(30*24*60*60);
response.addCookie(ck);
}
//out.println("nodeid="+nodeid+" cnodeid="+cnodeid);
//end by cyril on 2008-08-20 for td:9215
int subCompanyId=-1;
//如果客户单独进这个页面,就无法取到是否开启分权
int detachable=0;
boolean isUseWfManageDetach = manageDetachComInfo.isUseWfManageDetach();
if(isUseWfManageDetach){
detachable = 1 ;
session.setAttribute("detachable","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;
}
%>
<BODY onload="initTree()" style="overflow:hidden;">
<FORM NAME=SearchForm STYLE="margin-bottom:0" action="managewfTab.jsp" method=post target="wfmainFrame">
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<script>
rightMenu.style.visibility='hidden'
</script>
<%@ include file="/systeminfo/leftMenuCommon.jsp" %>
<table cellspacing="0" cellpadding="0" class="flowsTable" style="width:100%;height:100%;" >
<tr>
<td class="leftTypeSearch" style="display:table-cell;">
<div>
<span class="leftType">
<%=SystemEnv.getHtmlLabelName("1".equals(isTemplate)?33658:16483,user.getLanguage()) %>
<span id="totalDoc"></span>
</span>
<span class="leftSearchSpan">
<input type="text" class="leftSearchInput" style="width:110px;"/>
</span>
</div>
</td>
<td rowspan="2"></td>
</tr>
<tr>
<td style="width:23%;display:table-cell;" class="flowMenusTd">
<div class="flowMenuDiv" >
<div id="deeptree" class="cxtree" CfgXMLSrc="/css/TreeConfig.xml" style="width:219px;"/>
</div>
</td>
</tr>
</table>
<input class=inputstyle type="hidden" name="sqlwhere" value='<%=Util.null2String(request.getParameter("sqlwhere"))%>'>
<input class=inputstyle type="hidden" name="tabid" >
<input class=inputstyle type="hidden" name="companyid" >
<input class=inputstyle type="hidden" name="subCompanyId" >
<input class=inputstyle type="hidden" name="departmentid" >
<input class=inputstyle type="hidden" name="nodeid" >
<input class=inputstyle type="hidden" name="cnodeid" >
<input class=inputstyle type="hidden" name="isWorkflowDoc" value="<%=isWorkflowDoc %>" >
<input class=inputstyle type=hidden name=seclevelto value="<%=seclevelto%>">
<input class=inputstyle type=hidden name=needsystem value="<%=needsystem%>">
<input type="hidden" name="isTemplate" value="<%=isTemplate%>">
<!--########//Search Table End########-->
</FORM>
<script language="javascript">
function setHeight(){
var divHeight = $("#overFlowDivTree").height();
$(".ulDiv").height(divHeight);
return divHeight;
}
function initTree(){
//deeptree.init("/workflow/workflow/WorkflowXML.jsp?isTemplate=<%=isTemplate%>&init=true&subCompanyId=<%=subCompanyId%>&operatelevel=<%=operatelevel%>&nodeid=<%=nodeid%>");
//added by cyril on 2008-08-20 for td:9215
//设置选中的ID
<%
String cxtree_id = "workflowtype_1";
if(!cnodeid.equals("") && !cnodeid.equals("0")) {
cxtree_id = "workflow_"+cnodeid;
}
else {
if(!Util.null2String(nodeid).equals("") && !nodeid.equals("0"))
cxtree_id = "workflowtype_"+nodeid;
}
%>
cxtree_id = '<%=cxtree_id%>';
//alert(cxtree_id);
CXLoadTreeItem("", "/workflow/workflow/WorkflowXML.jsp?isWorkflowDoc=<%=isWorkflowDoc %>&isTemplate=<%=isTemplate%>&init=true&subCompanyId=<%=subCompanyId%>&operatelevel=<%=operatelevel%>&nodeid=<%=nodeid%>");
var tree = new WebFXTree();
tree.add(cxtree_obj);
//document.write(tree);
document.getElementById('deeptree').innerHTML = tree;
cxtree_obj.expand();
$("#overFlowDiv").height($("#wfmainFrame",window.parent.document).height());
$("#overFlowDivTree").height($("#wfmainFrame",window.parent.document).height());
//end by cyril on 2008-08-20 for td:9215
}
//to use xtree,you must implement top() and showcom(node) functions
function top2(){
<%if(nodeid!=null){%>
try{
deeptree.scrollTop=workflowtype_<%=nodeid%>.offsetTop;
deeptree.HighlightNode(workflowtype_<%=nodeid%>.parentElement);
deeptree.ExpandNode(workflowtype_<%=nodeid%>.parentElement);
}catch(e){}
<%}%>
}
function showcom(node){
}
function check(node){
alert(node);
if(typeof(select.selObj.length)=='undefined'){
highlight(node);
deeptree.ExpandNode(node.parentElement);
return;
}
for(i=0;i<select.selObj.length;i++){
highlight(select.selObj[i].previousSibling);
}
deeptree.ExpandNode(node.parentElement);
}
//end
//node is a SPAN object
function highlight(node){
if(node.nextSibling.checked)
node.style.color='red';
else
node.style.color='black';
}
function onSaveJavaScript(){
var idStr="";
var nameStr="";
var nodeidStr="";
if(typeof(select.selObj.length)=="undefined") {
if(select.selObj.checked) {
var kids = select.selObj.parentNode.childNodes;
for(var j=0;j<kids.length;j++){
if(kids[j].type=="label") {
nameStr +=kids[j].innerText;
nodeidStr+=kids[j].id;
var temp = select.selObj.value;
idStr+=temp;
break;
}
}
}
} else {
for(var i=0;i<select.selObj.length;i++) {
if(select.selObj[i].checked) {
var kids = select.selObj[i].parentNode.childNodes;
for(var j=0;j<kids.length;j++){
if(kids[j].type=="label") {
nameStr +=kids[j].innerText;
nodeidStr+=kids[j].id;
var temp = select.selObj[i].value;
idStr+=temp;
break;
}
}
}
}
}
return idStr +"_" + nameStr;
}
function setSubCompany(subCompanyId){
document.all("subCompanyId").value=subCompanyId;
document.SearchForm.submit();
}
</script>
<script language="vbScript">
sub onSave()
dim trunStr,returnVBArray
trunStr = onSaveJavaScript()
returnVBArray = Split(trunStr,"_",-1,0)
window.parent.returnValue = returnVBArray
window.parent.close
end sub
sub onClear()
window.parent.returnValue = Array(0,"","")
window.parent.close
end sub
</script>
</BODY>
</HTML>