survey.jsp
15.5 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
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
<!DOCTYPE html>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ page import="weaver.general.Util" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ taglib uri="/browserTag" prefix="brow"%>
<%request.setAttribute("getTempData","1") ;%>
<%@ include file="surveyData.jsp" %>
<%@ page import="weaver.systeminfo.setting.HrmUserSettingComInfo" %>
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="VotingManager" class="weaver.voting.VotingManager" scope="page" />
<%
String imagefilename = "/images/hdDOC_wev8.gif";
String titlename = SystemEnv.getHtmlLabelName(17599, user.getLanguage());
//其它
String other_qita = SystemEnv.getHtmlLabelName(811, user.getLanguage());
//单选
String single_danxuan = SystemEnv.getHtmlLabelName(28626, user.getLanguage());
//多选
String multi_duoxuan = SystemEnv.getHtmlLabelName(28627, user.getLanguage());
//必填
String required_bitian = SystemEnv.getHtmlLabelName(30036, user.getLanguage());
String least_zhishao = SystemEnv.getHtmlLabelName(83956, user.getLanguage());
String most_zhiduo = SystemEnv.getHtmlLabelName(83958, user.getLanguage());
String item_xiang = SystemEnv.getHtmlLabelName(83957, user.getLanguage());
String blank_tiankong = SystemEnv.getHtmlLabelName(83741, user.getLanguage());
//提交成功
String submitSuccess = SystemEnv.getHtmlLabelName(502637, user.getLanguage());
String needfav = "1";
String needhelp = "";
char flag = 2;
boolean islight = true;
String userid = user.getUID() + "";
RecordSet.executeSql("select status from voting where id=" + votingid);
RecordSet.next();
int status = RecordSet.getInt("status");
if(status != 1 && status != 2){
response.sendRedirect("/notice/noright.jsp");
return;
}
if(status == 2){
response.sendRedirect("/voting/VotingPollResult.jsp?votingid=" + votingid);
return;
}
HrmUserSettingComInfo userSetting=new HrmUserSettingComInfo();
String belongtoshow = userSetting.getBelongtoshowByUserId(user.getUID()+"");
String belongtoids = user.getBelongtoids();
String account_type = user.getAccount_type();
String votingshareids=""+user.getUID();
if(belongtoshow.equals("1")&&account_type.equals("0")&&!belongtoids.equals("")){
votingshareids+=","+belongtoids;
}
String realUserids="";
boolean hasPollRight=false;
Set hasPollRightUserSet=VotingManager.getHasPollRightUserSet(votingid);
String[] votingshareidsArr=votingshareids.split(",");
for(int i=0; i<votingshareidsArr.length; i++){
if(hasPollRightUserSet.contains(votingshareidsArr[i])){
hasPollRight=true;
realUserids += ","+votingshareidsArr[i];
}
}
if (!hasPollRight) {
response.sendRedirect("/notice/noright.jsp");
return;
}
/*检查是否已经参与投票*/
realUserids = Util.TrimComma(realUserids);
RecordSet.executeQuery("select distinct resourceid from votingremark where votingid=" + votingid + " and resourceid in (" + realUserids + ")");
int count = RecordSet.getCounts();
if(count == realUserids.split(",").length){//参与人范围的主次账号全部参与了投票
response.sendRedirect("/voting/VotingPollResult.jsp?votingid=" + votingid);
return;
}
Object sessionObject = request.getSession().getAttribute("votingMap");
Map<String,String> votingMap = null;
if(sessionObject != null){
votingMap = (Map)sessionObject;
}else{
votingMap = new HashMap<String,String>();
}
votingMap.put(votingid,"");
request.getSession().setAttribute("votingMap",votingMap);
RecordSet.executeProc("Voting_SelectByID", votingid);
RecordSet.next();
String subject = RecordSet.getString("subject");
String approverid = RecordSet.getString("approverid");
String begindate = RecordSet.getString("begindate");
String begintime = RecordSet.getString("begintime");
String enddate = RecordSet.getString("enddate");
String endtime = RecordSet.getString("endtime");
//强制调查
String forcevote = RecordSet.getString("forcevote");
//是否允许匿名提交,on 为允许
String isanony = RecordSet.getString("isanony");
String requestid = RecordSet.getString("requestid");
//是否需要刷新父窗口,为 1 时需要刷新
String freshparent= Util.null2String(request.getParameter("freshparent"));
int tempnum = -1;
if (Util.getIntValue(requestid) > 0) {
RecordSet
.executeSql("select min(requestid) requestid from workflow_currentoperator where userid="
+ userid);
RecordSet.next();
tempnum = Util.getIntValue(String.valueOf(session
.getAttribute("slinkwfnum")));
tempnum++;
session.setAttribute("resrequestid" + tempnum, requestid);
session.setAttribute("desrequestid", RecordSet
.getString("requestid"));
session.setAttribute("slinkwfnum", "" + tempnum);
session.setAttribute("haslinkworkflow", "1");
}
%>
<html>
<head>
<link rel="stylesheet" href="/voting/surveydesign/css/survey_wev8.css?version=1.0">
<link rel="stylesheet" type="text/css" href="/voting/surveydesign/css/surverydesign.css"/>
<style>
.image_div_show img,.survey_question img{
cursor:pointer;
}
</style>
<script>
this.doOperatorSave = "1"; //在页面操作时,是否保存操作。供survey_wev8.js中的saveAsTemp方法判断是否后台执行保存操作
</script>
</head>
<body>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{" + SystemEnv.getHtmlLabelName(615, user.getLanguage())
+ ",javascript:doVotingSubmit(),_self} ";
if(!"".equals(isanony) && isanony != null){//匿名提交
RCMenu += "{" + SystemEnv.getHtmlLabelName(500905, user.getLanguage())
+ ",javascript:doAnonyVotingSubmit(),_self} ";
}
RCMenuHeight += RCMenuHeightStep;
if("".equals(forcevote) || forcevote==null){//强制调查
RCMenu += "{" + SystemEnv.getHtmlLabelName(309, user.getLanguage())
+ ",javascript:parentDialog.close();,_self} ";
RCMenuHeight += RCMenuHeightStep;
}
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<div class="survey_preview_content">
<form id='surveyform' name="surveyform">
<input type='hidden' name='votingid' value='<%=votingid%>' >
<input type='hidden' name='formUserid' value='<%=user.getUID()%>' >
<input type='hidden' name='useranony' value='0' >
<input type='hidden' name='freshparent' value='<%=freshparent %>' >
<div class="survey_body">
<div class="survey_title">
</div>
<div class="survey_countdown" style="display:none">
<span id="countdown_day" style="display:none" title="<%=SystemEnv.getHtmlLabelName(32751,user.getLanguage())%>"></span> <span id="countdown_hour" title="<%=SystemEnv.getHtmlLabelName(391,user.getLanguage())%>"></span>
<span id="countdown_minute" title="<%=SystemEnv.getHtmlLabelName(15049,user.getLanguage())%>"></span> <span id="countdown_second" title="<%=SystemEnv.getHtmlLabelName(27954,user.getLanguage())%>"></span>
</div>
<div class="survey_descr" style="display:none">
<div style="float:left">
<b><%=SystemEnv.getHtmlLabelName(19917,user.getLanguage())%> : </b>
<%=Util.toScreen(ResourceComInfo.getResourcename(approverid),user.getLanguage())%>
<b><%=SystemEnv.getHtmlLabelName(24978,user.getLanguage())%> : </b>
<%=begindate%> : <%=begintime %>
<b><%=SystemEnv.getHtmlLabelName(22326,user.getLanguage())%> : </b>
<%=enddate%> : <%=endtime %>
</div>
<div style="float:right">
<input type="checkbox" name="" /> <b><%=SystemEnv.getHtmlLabelName(500905,user.getLanguage())%></b>
</div>
</div>
<div class="survey_content">
<div class="survey_question clone" style='display:none;'>
<div class="survey_quesname">
<span class="survey_quesnamedes"></span> <span class="require" style="display: inline;color: red;">*</span><label class="rules"></label>
</div>
<div class="survey_options">
</div>
</div>
</div>
</div>
</form>
</div>
<div class='placeholder' style="height:80px">
</div>
<div id="zDialog_div_bottom" class="zDialog_div_bottom">
<wea:layout type="2col">
<wea:group context="">
<wea:item type="toolbar">
<input type="button" value="<%=SystemEnv.getHtmlLabelName(615, user.getLanguage())%>" id="" class="e8_btn_cancel" onclick="doVotingSubmit();">
<% if(!"".equals(isanony) && isanony != null){ %>
<input type="button" value="<%=SystemEnv.getHtmlLabelName(18611, user.getLanguage())%><%=SystemEnv.getHtmlLabelName(615, user.getLanguage())%>" id="" class="e8_btn_cancel" onclick="doAnonyVotingSubmit();">
<% } %>
</wea:item>
</wea:group>
</wea:layout>
</div>
<iframe id="downloadFrame" style="display: none"></iframe>
<script src="/voting/surveydesign/js/jquery_wev8.js"></script>
<script src="/voting/surveydesign/js/survey_wev8.js?v=1.0"></script>
<script>
var votingId="<%=votingid%>";
var interval = 1000;
var showCountDownInterval;
var other_qita = "<%=other_qita%>";
var single_danxuan = "<%=single_danxuan%>";
var multi_duoxuan = "<%=multi_duoxuan%>";
var required_bitian = "<%=required_bitian%>";
var least_zhishao = "<%=least_zhishao%>";
var most_zhiduo = "<%=most_zhiduo%>";
var item_xiang = "<%=item_xiang%>";
var blank_tiankong = "<%=blank_tiankong%>";
var submitSuccess = "<%=submitSuccess%>";
jQuery(document).ready(function(){
jQuery(document.body).css("height","auto");
var pageitems=<%=pageitems%>;
var viewset=<%=viewset%>;
var surveytitle="<%=surveytitle%>";
survey.initSurvey(pageitems,viewset,surveytitle);
//启动倒计时
showCountDownInterval = window.setInterval(function(){showCountDown('2014/08/25 17:36');}, interval);
jQuery(".voting_image_show .image_div_show img,.survey_question img").click(function(){
var _wi = window.top.document.documentElement.clientWidth;
var _hi = window.top.document.documentElement.clientHeight;
var _html = "<div class='mengbanLayer' style='position: fixed; z-index: 99999; left: 0px; top: 0px; right: 0px; bottom: 0px; width: " + _wi + "px; height: " + _hi + "px; display: block;background-color:#0a0000;opacity:0.6;filter:alpha(opacity=60);'></div>"
+ "<div class='chatImgPagWrap' style='position: fixed; z-index: 99999; left: 0px; top: 0px; right: 0px; bottom: 0px; display: block; width: " + _wi + "px; height: " + _hi + "px;'>"
+ "<table style='width:100%;height:100%'><tr><td style='width:100%;height:100%;text-align:center;vertical-align:middle;'>"
+ "<div style='display:inline-block;position:relative'>"
+ "<div class='chatImgClose' style='background-color:#5bb4d8;border-radius:50%;color:#fff;font-size:25px;height:30px;line-height:25px;position:absolute;right:-12px;top:-12px;text-align:center;width:30px;cursor:pointer'>x</div>"
+ "<img style='max-width:"+(_wi-100)+"px;max-height:"+(_hi-100)+"px;' src='" + jQuery(this).attr("src") + "'/></div></td></tr></table>"
+ "</div>";
window.top.jQuery("body").append(_html).find(".chatImgPagWrap .chatImgClose").hover(function(){
jQuery(this).css("background-color","#de553f");
},function(){
jQuery(this).css("background-color","#5bb4d8");
}).click(function(){
window.top.jQuery(".chatImgPagWrap,.mengbanLayer").remove();
});
// window.top.jQuery("body").append(_html).find(".chatImgPagWrap,.mengbanLayer").click(function(){
// window.top.jQuery(".chatImgPagWrap,.mengbanLayer").remove();
// });
});
window.document.onkeydown = function(event){
if(event && event.keyCode && event.keyCode == 27){
window.top.jQuery(".chatImgPagWrap,.mengbanLayer").remove();
}
}
});
function doVotingSubmit(){
try{
var confirm = window.top.window.antd.Modal.confirm;
confirm({
title: '<%=SystemEnv.getHtmlLabelName(131329,user.getLanguage())%>',
content: '<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',
okText: '<%=SystemEnv.getHtmlLabelName(83446,user.getLanguage())%>',
cancelText:'<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>',
onOk: function(){survey.submitsurvey();},
zIndex:999999
});
}catch(err){
window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',function(){
survey.submitsurvey();
});
}
// window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',function(){
// survey.submitsurvey();
// });
}
function doAnonyVotingSubmit(){
try{
var confirm = window.top.window.antd.Modal.confirm;
confirm({
title: '<%=SystemEnv.getHtmlLabelName(131329,user.getLanguage())%>',
content: '<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',
okText: '<%=SystemEnv.getHtmlLabelName(83446,user.getLanguage())%>',
cancelText:'<%=SystemEnv.getHtmlLabelName(201,user.getLanguage())%>',
onOk: function(){document.surveyform.useranony.value = "1";survey.submitsurvey();},
zIndex:999999
});
}catch(err){
window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',function(){
document.surveyform.useranony.value = "1";
survey.submitsurvey();
});
}
// window.top.Dialog.confirm('<%=SystemEnv.getHtmlLabelNames("33703,725",user.getLanguage())%>?',function(){
// document.surveyform.useranony.value = "1";
// survey.submitsurvey();
// });
}
function showCountDown(enddatetime){
var now = new Date();
var endDate = new Date(enddatetime);
var countdown_leftTime=endDate.getTime()-now.getTime();
var countdown_leftSecond = parseInt(countdown_leftTime/1000);
var countdown_year;
var countdown_day;
var countdown_hour;
var countdown_minute;
var countdown_second;
if(countdown_leftSecond > 0){
countdown_day = Math.floor(countdown_leftSecond/(60*60*24));
countdown_hour = Math.floor((countdown_leftSecond-countdown_day*24*60*60)/3600);
countdown_minute = Math.floor((countdown_leftSecond-countdown_day*24*60*60-countdown_hour*3600)/60);
countdown_second = Math.floor(countdown_leftSecond-countdown_day*24*60*60-countdown_hour*3600-countdown_minute*60);
if(countdown_day !=0 ){
$("#countdown_day").html(countdown_day);
$("#countdown_day").css("display","");
}else{
$("#countdown_day").css("display","none");
}
if(countdown_hour <10 ){
$("#countdown_hour").html("0"+countdown_hour);
}else{
$("#countdown_hour").html(countdown_hour);
}
if(countdown_minute <10 ){
$("#countdown_minute").html("0"+countdown_minute);
}else{
$("#countdown_minute").html(countdown_minute);
}
$("#countdown_minute").css("display","");
if(countdown_second <10 ){
$("#countdown_second").html("0"+countdown_second);
}else{
$("#countdown_second").html(countdown_second);
}
}else if(countdown_leftSecond == 0){
//cc = document.getElementById(divname);
//cc.innerHTML = "结束";
window.clearInterval(showCountDownInterval);
parentDialog.close();
}
}
</script>
</body>
</html>