hrmInfo.jsp
11.8 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
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@ page import="java.io.*" %>
<%@ page import="java.util.*" %>
<%@ page import="weaver.hrm.HrmUserVarify"%>
<%@ page import="weaver.hrm.User"%>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.file.Prop" %>
<%@ page import="java.text.*" %>
<%@ page import="weaver.general.TimeUtil" %>
<%@ page import="weaver.systeminfo.SystemEnv"%>
<%@ page import="weaver.general.GCONST" %>
<%@ page import="weaver.general.Util,weaver.hrm.User,
weaver.rtx.RTXExtCom,
weaver.hrm.settings.BirthdayReminder,
weaver.hrm.settings.RemindSettings,
weaver.systeminfo.setting.HrmUserSettingHandler,
weaver.systeminfo.setting.HrmUserSetting,
weaver.general.TimeUtil,
weaver.hrm.report.schedulediff.HrmScheduleDiffUtil,
weaver.login.Account" %>
<%@page import="weaver.hrm.common.Tools"%>
<%@page import="java.sql.Timestamp"%>
<jsp:useBean id="DepartmentComInfo" class="weaver.hrm.company.DepartmentComInfo" scope="page"/>
<jsp:useBean id="PluginUserCheck" class="weaver.license.PluginUserCheck" scope="page" />
<jsp:useBean id="ResourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page"/>
<jsp:useBean id="JobTitlesComInfo" class="weaver.hrm.job.JobTitlesComInfo" scope="page"/>
<jsp:useBean id="signRs" class="weaver.conn.RecordSet" scope="page"/>
<%@ include file="/wui/common/page/initWui.jsp" %>
<%
/*用户验证*/
User user = HrmUserVarify.getUser (request , response) ;
if(user==null) {
response.sendRedirect("/login/Login.jsp");
return;
}
int userId=user.getUID();
boolean canMessager=false;
boolean isHaveEMessager=Prop.getPropValue("Messager2","IsUseEMessager").equalsIgnoreCase("1");
boolean isHaveMessager=Prop.getPropValue("Messager","IsUseWeaverMessager").equalsIgnoreCase("1");
int isHaveMessagerRight = PluginUserCheck.checkPluginUserRight("messager",userId+"");
if((isHaveMessager&&userId!=1&&isHaveMessagerRight==1)||isHaveEMessager){
canMessager=true;
}
String strDepartment=DepartmentComInfo.getDepartmentname(String.valueOf(user.getUserDepartment()));
%>
<%
Map pageConfigKv = getPageConfigInfo(session, user);
String islock = (String)pageConfigKv.get("islock");
%>
<script language=javascript>
//------------------------------------
//多账号 Start
//------------------------------------
function onCheckTime(obj){
window.location = "/login/IdentityShift.jsp?shiftid="+obj.value;
}
function changeAccount(obj){
window.location = "/login/IdentityShift.jsp?shiftid="+$(obj).attr("userid");
}
var firstTime = new Date().getTime();
function setAccountSelect(){
var nowTime = new Date().getTime();
if((nowTime-firstTime) < 10000){
setTimeout(function(){setAccountSelect();},1000);
}else{
try{
document.getElementById("accountSelect").disabled = false;
jQuery("#accountText").html(jQuery("#accountSelect").find("option:selected").text());
jQuery("#accountText").attr("title", jQuery("#accountSelect").find("option:selected").text());
jQuery("#accountSelect").hide();
jQuery("#accountText").show();
}catch(e){}
}
}
setAccountSelect();
jQuery(document).ready(function () {
if (jQuery("#accountSelect")[0]) {
jQuery("#leftBlockHrmDep").hover(function () {
jQuery("#accountText").html("");
jQuery("#accountText").hide();
jQuery("#accountSelect").show();
jQuery("#accountSelect").focus();
}, function () {
});
jQuery("#accountSelect").bind("blur", function () {
jQuery("#accountText").html(jQuery("#accountSelect").find("option:selected").text());
jQuery("#accountText").attr("title", jQuery("#accountSelect").find("option:selected").text());
jQuery("#accountSelect").hide();
jQuery("#accountText").show();
});
}
});
//设置个人头像
var userIconDialog;
function setUserIcon(){
userIconDialog = new Dialog();
userIconDialog.Width = 600;
userIconDialog.Height = 450;
userIconDialog.Title = "<%=SystemEnv.getHtmlLabelName(28062,user.getLanguage())%>";//设置个人头像
userIconDialog.Modal = false;
userIconDialog.URL = "/messager/GetUserIcon.jsp?loginid=<%=user.getLoginid()%>&requestFrom=homepage";
userIconDialog.show();
}
</script>
<div style="position:relative;height:100%">
<!-- 更换皮肤设置 Start -->
<div style="position:absolute;left:63px;top:16px;font-size:12px;height:16px;right:0px;">
<span style="float:right;">
</span>
</div>
<!-- 更换皮肤设置 End -->
<div title="<%=user.getLastname()%>" class="hrminfo_fontcolor leftColor hand" style="max-width:100px;float: left;white-space: nowrap;overflow: hidden;text-overflow:ellipsis;" onclick="window.open('/hrm/HrmTab.jsp?_fromURL=HrmResource','mainFrame')">
<%=user.getLastname() %>
</div>
<%
//多账号
String userid = ""+user.getUID() ;
%>
<%if(weaver.general.GCONST.getMOREACCOUNTLANDING()){%>
<%List accounts =(List)session.getAttribute("accounts");
if(accounts!=null&&accounts.size()>1){
Iterator iter=accounts.iterator();
int tmpCount = 0;
%>
<!-- <select id="accountSelect" name="accountSelect" onchange="onCheckTime(this);" disabled style="width:100px;height:20px;font-size:11px;">
</select>
-->
<div id="accountChange" class="" style="float:left;position: relative;margin-left:20px" >
<img onclick="showAccoutList()" id="accoutImg" src="/wui/theme/ecology8/page/images/hrminfo/accout_wev8.png" style="position:absolute;top:13px;cursor:pointer;">
<div class="accoutList" id="accoutList" style="display: none;">
<div style="height:10px;width:15px;z-index:101;top: 0px;position: absolute;background:url(/images/topnarrow.png) no-repeat;"></div>
<div class="accoutListBox" style="max-height: 600px;overflow: hidden;">
<% while(iter.hasNext()){
Account a=(Account)iter.next();
String subcompanyname=SubCompanyComInfo.getSubCompanyname(""+a.getSubcompanyid());
String departmentname=DepartmentComInfo.getDepartmentname(""+a.getDepartmentid());
String jobtitlename=JobTitlesComInfo.getJobTitlesname(""+a.getJobtitleid());
String userName = ResourceComInfo.getResourcename(""+a.getId());
%>
<div class="accountItem " userid="<%=a.getId() %>" onclick="changeAccount(this)">
<div class="accountText">
<font color="#363636" title="<%=userName %>"><%=userName%></font> <font color="#0071ca" title="<%=jobtitlename %>"><%=jobtitlename %></font>
<br>
<font color="#868686" title="<%=subcompanyname +"/"+departmentname %>"><%=subcompanyname +"/"+departmentname %></font>
</div >
<div class="accountIcon">
<%if(userid.equals(a.getId()+"")){ %>
<img style="width: 16px;height: 16px;vertical-align: middle;" src="/images/check.png">
<%} %>
</div>
<div style="clear:both;"></div>
</div>
<%if(++tmpCount < accounts.size()) {%>
<div style="background-color:#d4d4d4;height:1px;width:188px;"></div>
<%} %>
<%} %>
</div>
</div>
</div>
<%}else{%>
<div id="leftBlockHrmDep" style="float:left; cursor:default;overflow:hidden;width: 100px;" class="leftBlockHrmDep leftColor" title="<%=strDepartment%>"><%=strDepartment%></a></div>
<%}} else {%>
<div id="leftBlockHrmDep" style="float:left;cursor:default;overflow:hidden;width: 100px;" class="leftBlockHrmDep leftColor" title="<%=strDepartment%>"><%=strDepartment%></a></div>
<%} %>
<div style="position:absolute;width:41px;height:41px;left:14px;top:17px;display:none;">
<%
boolean isHaveMessagerUrl=false;
String messagerUrl=ResourceComInfo.getMessagerUrls(""+userId);
if(messagerUrl.indexOf("dummyContact_wev8.png")==-1) isHaveMessagerUrl=true;
%>
<%if(isHaveMessagerUrl){%>
<img src="<%=ResourceComInfo.getMessagerUrls(""+userId)%>" border="0" width="38" height="37" onclick="setUserIcon()" title="<%=SystemEnv.getHtmlLabelName(28062,user.getLanguage())%>" id="userIcon" style="cursor: pointer;">
<%}%>
</div>
<script type="text/javascript">
jQuery(document).ready(function(){
if("<%=userid%>"=="1"){
jQuery(userIcon).removeAttr("onclick");
jQuery(userIcon).removeAttr("title");
}
});
</script>
<div class="more" style="display:none;">
<table cellpadding="0px" cellspacing="0px" id="tblHrmToolbr" align="left">
<tr>
<!-- 解决因ie6下png透明引起img图片空白显示的bug -->
<td ><a href="/newportal/contactslist.jsp" title='<%=SystemEnv.getHtmlLabelName(1515,user.getLanguage())%>' target="mainFrame" style><span class="quickImg" style="background:url(/wui/theme/ecology8/page/images/hrminfo/address_wev8.png) no-repeat;"></span></a></td>
<td ><a href="/workflow/request/RequestView.jsp" title='<%=SystemEnv.getHtmlLabelName(1207,user.getLanguage())%>' target="mainFrame" style><span class="quickImg" style="background:url(/wui/theme/ecology8/page/images/request/unhandle_wev8.png) no-repeat;"></span></a></td>
<td><a href="#" title='<%=SystemEnv.getHtmlLabelName(27603,user.getLanguage())%>' target="mainFrame" style><span class="quickImg" style="background:url(/wui/theme/ecology8/page/images/email/email_wev8.png) no-repeat;"></span></a></td>
<td><a href="#" title='<%=SystemEnv.getHtmlLabelName(26274,user.getLanguage())%>' target="mainFrame" style><span class="quickImg" style="background:url(/wui/theme/ecology8/page/images/theme_wev8.png) no-repeat;"></span></a></td>
<!--<td width="24px"><a href="/hrm/resource/HrmResource.jsp?id=<%=userId%>"title='<%=SystemEnv.getHtmlLabelName(16415,user.getLanguage())%>' target="mainFrame" style><span style="cursor:pointer;height:16px;width:16px;display:block;overflow:hidden;background:url(/wui/theme/ecology8/page/images/hrminfo/card_wev8.png) no-repeat;"></span></a></td>-->
<td width="24px"><a href="/hrm/resource/HrmResourcePassword.jsp?id=<%=userId%>" title='<%=SystemEnv.getHtmlLabelName(17993,user.getLanguage())%>' target="mainFrame" style><span class="quickImg" style="background:url(/wui/theme/ecology8/page/images/hrminfo/psw_wev8.png) no-repeat;"></span></a></td>
<%if(canMessager){%>
<td ><div class="quickImg" id="tdMessageState" style="cursor:pointer;font-size:11px;color:#666;position:relative;background:url(/wui/theme/ecology8/page/images/request/info_wev8.png) no-repeat;"></div> </td>
<%}%>
<!--<td width="24px"><a href="/org/OrgChartHRM.jsp" title='<%=SystemEnv.getHtmlLabelName(16455,user.getLanguage())%>' target="mainFrame" style><span style="cursor:pointer;height:16px;width:16px;display:block;overflow:hidden;background:url(/wui/theme/ecology8/page/images/hrminfo/org_wev8.png) no-repeat;"></span></a></td>-->
<!-- <td width="24px"><a href="/workplan/data/WorkPlan.jsp" title='<%=SystemEnv.getHtmlLabelName(2211,user.getLanguage())%>' target="mainFrame" style><img src="/wui/theme/ecology8/page/images/hrminfo/cal_wev8.gif" border="0"></a></td>-->
<!--<td align="left">
<%if(canMessager){%>
<div id="tdMessageState" style="cursor:pointer;font-size:11px;color:#666;position:relative;"></div>
<%} else {%>
<%}%>
</td>-->
</tr>
</table>
</div>
</div>
<script type="text/javascript">
$('.accoutListBox').perfectScrollbar();
</script>
<%!
private String formatDate(String format, Date date) {
SimpleDateFormat sdf = new SimpleDateFormat(format);
Calendar calendar = Calendar.getInstance();
if (date == null) {
date = new Date();
}
calendar.setTime(date);
return sdf.format(calendar.getTime());
}
%>