server.jsp
9.84 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util"%>
<%@ page import="weaver.general.TimeUtil"%>
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.portal.PortalMenu" %>
<%@ page import="weaver.systeminfo.menuconfig.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="weaver.systeminfo.SystemEnv" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page"/>
<%
response.setHeader("cache-control", "no-cache");
response.setHeader("pragma", "no-cache");
response.setHeader("expires", "Mon 1 Jan 1990 00:00:00 GMT");
%>
<%
User user = HrmUserVarify.getUser (request , response) ;
if(user == null) return ;
int leftid = Util.getIntValue((request.getParameter("leftid")),0);
//System.out.println("leftid:"+leftid);
String method = Util.null2String((request.getParameter("method")));
if("navinfo".equals(method)){
PortalMenu pmenu=(PortalMenu)session.getValue("pmenu");
String srcUrl=pmenu.getMenuAddress(leftid);
String srcNav=pmenu.getMenuNav(leftid);
out.println(srcNav);
return;
} else if("getChild".equals(method)){
int parentid= Util.getIntValue((request.getParameter("mainMenuId")),0);
MenuUtil mu=new MenuUtil("top", 3,user.getUID(),user.getLanguage()) ;
rs=mu.getMenuRs(parentid);
String s="";
ArrayList menuIds=new ArrayList();
while(rs.next()){
boolean hasSubMenu = false;
int infoid=rs.getInt("infoid");
if(infoid==1 || infoid==10 || infoid==26 || infoid==27 || infoid==19) continue;
//TD4425=========================================
if(menuIds.contains(String.valueOf(infoid))) continue;
menuIds.add(String.valueOf(infoid));
//===============================================
int labelId = rs.getInt("labelId");
boolean useCustomName = rs.getInt("useCustomName") == 1 ? true: false;
String customName = rs.getString("customName");
String customName_e = rs.getString("customName_e");
String customName_t = rs.getString("customName_t");
boolean infoUseCustomName = rs.getInt("infoUseCustomName") == 1 ? true : false;
String infoCustomName = rs.getString("infoCustomName");
String infoCustomName_e = rs.getString("infoCustomName_e");
String infoCustomName_t = rs.getString("infoCustomName_t");
String baseTarget = rs.getString("baseTarget");
if("".equals(baseTarget)) baseTarget="mainFrame";
String text = mu.getMenuText(labelId, useCustomName, customName, customName_e,customName_t, infoUseCustomName, infoCustomName, infoCustomName_e,infoCustomName_t,user.getLanguage());
//System.out.println("text:"+text);
String sql = "SELECT id FROM MainMenuInfo WHERE parentid="+infoid;
rs2.executeSql(sql);
if(rs2.next()) hasSubMenu=true;
String linkAddress=Util.replace(rs.getString("linkAddress"), "&", "&", 0);
String subSpanStyle="";
String mainMenuId="";
if(hasSubMenu){
subSpanStyle="spanRight";
mainMenuId=infoid+"";
}else{
subSpanStyle="spanRightNone";
mainMenuId="";
}
%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'<%=infoid%>','<%=linkAddress%>','<%=baseTarget%>','<%=mainMenuId%>')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=text%>
</a>
</span>
<span onclick="showorhidden(this,'<%=mainMenuId%>')" class="<%=subSpanStyle%>">6</span>
</div>
</li>
<%}
} else if("news".equals(method)){
rs.executeSql("select * from newstype order by dspnum,id");
while (rs.next()){
%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=rs.getString("typename")%>
</a>
</span>
<%
String strSql="select id,frontpagename from DocFrontpage where isactive='1' and publishtype=1 and newstypeid="+rs.getString("id")+" order by typeordernum,id";
rs2.executeSql(strSql);
boolean isFirst=true;
String subSpanStyle="";
if(rs2.getCounts()>0){
subSpanStyle="spanRight";
} else {
subSpanStyle="spanRightNone";
}
%>
<span onclick="showorhidden(this,'')" class="<%=subSpanStyle%>">6</span>
</div>
<%while (rs2.next()){
if(isFirst) {
out.println("<ul>");
isFirst=false;
}
%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','/docs/news/NewsDsp.jsp?id=<%=rs2.getString("id")%>','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=rs2.getString("frontpagename")%>
</a>
</span>
<span onclick="showorhidden(this,'')" class="spanRightNone">6</span>
</div>
</li>
<%}
if(!isFirst) out.println("</ul>");
}
%>
</li>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=SystemEnv.getHtmlLabelName(811,user.getLanguage())%>
</a>
</span>
<%
String strSql="select id,frontpagename from DocFrontpage where isactive='1' and publishtype=1 and (newstypeid=0 or newstypeid is null) order by typeordernum,id";
rs2.executeSql(strSql);
boolean isFirst=true;
String subSpanStyle="";
if(rs2.getCounts()>0){
subSpanStyle="spanRight";
} else {
subSpanStyle="spanRightNone";
}
%>
<span onclick="showorhidden(this,'')" class="<%=subSpanStyle%>">6</span>
</div>
<%while (rs2.next()){
if(isFirst) {
out.println("<ul>");
isFirst=false;
}
%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','/docs/news/NewsDsp.jsp?id=<%=rs2.getString("id")%>','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=rs2.getString("frontpagename")%>
</a>
</span>
<span onclick="showorhidden(this,'')" class="spanRightNone">6</span>
</div>
</li>
<%}
if(!isFirst) out.println("</ul> </li>");
}else if("remind".equals(method)){
String strSql = "select a.type, sum(a.counts) as count, (select statistic from SysPoppupinfo where type=a.type) as statistic, (select typedescription from SysPoppupinfo where type=a.type) as typedescription, (select link from SysPoppupinfo where type=a.type) as link from SysPoppupRemindInfoNew a where a.userid="+user.getUID()+" and ( (a.type=0 and a.requestid in (select requestid from workflow_currentoperator where userid="+user.getUID()+" and islasttimes=1 and isremark in ('0','1','8','9','7') ) ) or (a.type=1 and a.requestid in (select requestid from workflow_currentoperator where userid="+user.getUID()+" and usertype='"+user.getUID()+"' and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and currentnodetype=3) ) ) or (a.type=14 and a.requestid in (select requestid from workflow_currentoperator where userid="+user.getUID()+" and islasttimes=1 and exists (select 1 from workflow_requestbase where workflow_requestbase.requestid=workflow_currentoperator.requestid and workflow_currentoperator.isremark in ('0','1','8','9','7')) ) ) or (type=10 and requestid in (select requestid from workflow_currentoperator where ((isremark='0' and (isprocessed='2' or isprocessed='3')) or isremark='5') and islasttimes=1)) or (a.type=9 and a.requestid in (select id from cowork_items t1 where t1.status=1 and (t1.coworkers like '%,"+user.getUID()+",%' or t1.creater="+user.getUID()+") and t1.isnew not like '%,"+user.getUID()+",%')) or type in (2,3,4,6,7,8,11,12,13)) group by a.type";
rs.executeSql(strSql);
while(rs.next()){
String strCount="";
if(rs.getString("statistic").equals("y")){
int count=rs.getInt("count");
strCount="("+count+")";
}else{
strCount="";
}%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','<%=rs.getString("link")%>','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=SystemEnv.getHtmlLabelName(rs.getInt("typedescription"),user.getLanguage())+strCount%>
</a>
</span>
<span onclick="showorhidden(this,'')" class="spanRightNone">6</span>
</div>
</li>
<%}
}else if("voting".equals(method)){
String CurrentDate=TimeUtil.getCurrentDateString();
String CurrentTime=TimeUtil.getOnlyCurrentTimeString();
//String strSql = "SELECT DISTINCT t1.id,t1.subject FROM voting t1,VotingShareDetail t2 WHERE t1.id=t2.votingid AND t2.resourceid="+user.getUID()+" AND t1.status=1 AND t1.id NOT IN (SELECT DISTINCT votingid FROM votingresource WHERE resourceid="+user.getUID()+")"+" and t1.beginDate<='"+CurrentDate+"' and (t1.beginTime is null or t1.beginTime='' or t1.beginTime<='"+CurrentTime+"') ";
String strSql ="SELECT DISTINCT t1.id,t1.subject from voting t1,VotingShareDetail t2 where t1.id=t2.votingid and t2.resourceid="+user.getUID()+" and t1.status=1 "+ " and t1.id not in (select distinct votingid from votingresource where resourceid ="+user.getUID()+")"
+" and (t1.beginDate<'"+CurrentDate+"' or (t1.beginDate='"+CurrentDate+"' and (t1.beginTime is null or t1.beginTime='' or t1.beginTime<='"+CurrentTime+"'))) ";
rs.executeSql(strSql);
//System.out.println(strSql);
while(rs.next()){
%>
<li>
<div>
<span class="spanLeft">
<a onclick="javascript:onLeftMenuClick(this,'','/voting/VotingPoll.jsp?votingid=<%=rs.getInt("id")%>','mainFrame','')" style="cursor:hand">
<img border="0" src="images/entitysub_wev8.jpg" />
<%=rs.getString("subject")%>
</a>
</span>
<span onclick="showorhidden(this,'')" class="spanRightNone">6</span>
</div>
</li>
<%}
}
%>