WorkSpaceRight.jsp
8.02 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
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ page import="weaver.general.Util" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="resourceComInfo" class="weaver.hrm.resource.ResourceComInfo" scope="page"/>
<jsp:useBean id="wpRemind" class="weaver.WorkPlan.WorkPlanRemind" scope="page"/>
<%
Calendar cal = Calendar.getInstance();
String currDate = Util.add0(cal.get(Calendar.YEAR), 4) +"-"+
Util.add0(cal.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(cal.get(Calendar.DAY_OF_MONTH), 2);
String currUserId = String.valueOf(user.getUID());
String userId = Util.null2String(request.getParameter("selectUser"));
String userLanguage = String.valueOf(user.getLanguage());
if (userId.equals(""))
userId = currUserId;
String userType = "";
if (userType.equals(""))
userType = user.getLogintype();
String setDate = "";
String selectDate = Util.null2String(request.getParameter("selectdater"));
if (selectDate.equals(""))
selectDate = currDate;
String moveDate = Util.null2String(request.getParameter("movedater"));
int viewType = Util.getIntValue(request.getParameter("viewtyper"),2);
Calendar calSet = Calendar.getInstance();
int selectYear = Util.getIntValue(selectDate.substring(0,4));
int selectMonth = Util.getIntValue(selectDate.substring(5,7))-1;
int selectDay = Util.getIntValue(selectDate.substring(8,10));
calSet.set(selectYear,selectMonth,selectDay);
switch (viewType) {
case 1:
if (moveDate.equals("1"))
calSet.add(Calendar.DATE,1) ;
if (moveDate.equals("-1"))
calSet.add(Calendar.DATE,-1) ;
break ;
case 2:
Date thedate = calSet.getTime() ;
int diffdate = (-1)*thedate.getDay() ;//thedate.getDay()为当星期的第几天由于西方星期的第一天为星期日再-1
calSet.add(Calendar.DATE,diffdate) ;
if (moveDate.equals("1"))
calSet.add(Calendar.WEEK_OF_YEAR,1) ;
if (moveDate.equals("-1"))
calSet.add(Calendar.WEEK_OF_YEAR,-1) ;
calSet.add(Calendar.DATE,1);
break ;
case 3:
calSet.set(selectYear,selectMonth,1) ;
if (moveDate.equals("1"))
calSet.add(Calendar.MONTH,1) ;
if (moveDate.equals("-1"))
calSet.add(Calendar.MONTH,-1) ;
break;
}
setDate = Util.add0(calSet.get(Calendar.YEAR), 4) +"-"+
Util.add0(calSet.get(Calendar.MONTH) + 1, 2) +"-"+
Util.add0(calSet.get(Calendar.DAY_OF_MONTH), 2) ;
ArrayList reminds = wpRemind.getRemindWorkPlan(userId, userType, 3);
boolean hasMore = wpRemind.hasMore();
%>
<HTML xmlns:IE>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type="text/css" rel="STYLESHEET">
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></SCRIPT>
<TITLE>Calendar</TITLE>
<STYLE>
@media all
{
<%if(userLanguage.equals("8")){%>
IE\:Calendar
{
behavior: url(/htc/calendarEng.htc) ; //引入calendar的html组件
}
<%}else{%>
IE\:Calendar
{
behavior: url(/htc/calendarForWorkplan.htc) ; //引入calendar的html组件
}
<%}%>
}
</STYLE>
</HEAD>
<BODY scroll="no" onload="doSetCalendar('<%=setDate%>')">
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
<FORM name="frmmain" action="WorkPlanView.jsp" method="post" target="workSpaceLeft">
<INPUT type="hidden" name="selectdate" value="<%=currDate%>">
<INPUT type="hidden" name="selectUser" value="<%=userId%>">
<INPUT type="hidden" name="viewtype" value="<%=viewType%>">
<INPUT type="hidden" name="method" value="">
<TABLE width="100%" height="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#E3E3E3">
<COLGROUP>
<COL width="">
<COL width="5">
<TR bgcolor="#B3B3B3">
<TD height="5" colspan="2"></TD>
</TR>
<TR>
<TD valign="top">
<TABLE width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" class="ListStyle">
<TR>
<TD valign="top" height="140">
<IE:Calendar id="cal" style="height:140;width:195;border:0px solid black;" >
</IE:Calendar><BR>
<BUTTON class="WorkPlan" onclick="doMonth()"><%=SystemEnv.getHtmlLabelName(16654,user.getLanguage())%></BUTTON>  <BUTTON class="WorkPlan" onclick="doWeek()" ><%=SystemEnv.getHtmlLabelName(16655,user.getLanguage())%></BUTTON>  <BUTTON class="WorkPlan" onclick="doDay()" ><%=SystemEnv.getHtmlLabelName(16656,user.getLanguage())%></BUTTON>
</TD>
</TR>
<TR class="Header" height="20" align="left">
<TD><%=SystemEnv.getHtmlLabelName(179,user.getLanguage())%>
<BUTTON class="Browser" id="SelectUserID" onClick="onShowHrmID()"></BUTTON>
<SPAN id="selectuserspan"><%=resourceComInfo.getResourcename(userId)%></SPAN></TD>
</TR>
<TR><TD height="1"></TD></TR>
<TR class="Header" height="20" align="left">
<TD> <B><%=SystemEnv.getHtmlLabelName(17498,user.getLanguage())%></B></TD>
</TR>
<TR height="20">
<TD valign="top">
<TABLE>
<TR>
<TD><INPUT type="text" name="note" class="InputStyle"></TD>
<TD><A href="#" onclick="doAdd()"><%=SystemEnv.getHtmlLabelName(86,user.getLanguage())%></A>
</TD>
</TR>
</TABLE>
</TD>
</TR>
<TR><TD height="2"></TD></TR>
<TR class="Header" height="20" align="left">
<TD> <B><%=SystemEnv.getHtmlLabelName(17497,user.getLanguage())%></B></TD>
</TR>
<TR height="20">
<TD valign="top">
<TABLE class="ListStyle" border="0" cellspacing="1">
<%
boolean isLight = false;
String m_id = "";
String m_name = "";
for (int i = 0; i < reminds.size(); i++) {
m_id = ((String[]) reminds.get(i))[0];
m_name = ((String[]) reminds.get(i))[1];
isLight = !isLight;
%>
<TR class="<%=(isLight ? "DataLight" : "DataDark")%>">
<TD><A href="/workplan/data/WorkPlanDetail.jsp?workid=<%=m_id%>" target="workSpaceLeft"><%=m_name%></A></TD>
</TR>
<%}%>
<%if (hasMore) {%>
<TR>
<TD align="right"><A href="/workplan/data/WorkPlanRemind.jsp" target="_parent"><%=SystemEnv.getHtmlLabelName(17499,user.getLanguage())%>...</A></TD>
</TR>
<%}%>
</TABLE>
</TD>
</TR>
<TR align="left">
<TD></TD>
</TR>
</TABLE>
</FORM>
</TD>
<TD bgcolor="#B3B3B3"></TD>
</TR>
</TABLE>
<SCRIPT language="JavaScript">
function doSetCalendar(date) {
day = date.substring(8,10);
month = date.substring(5,7);
cal.year = date.substring(0,4);
if (month=="08") cal.month = 08; //??非常奇怪当为08号或09号就不行
else if (month=="09") cal.month = 09;
else cal.month = month;
if (day=="08") cal.day = 08; //??非常奇怪当为08号或09号就不行
else if (day=="09") cal.day = 09;
else cal.day = day;
document.frmmain.selectdate.value=date;
}
function doSubmit() {
themonth = cal.month;
theday = cal.day;
if (themonth < 10)
themonth = "0" + themonth;
if (theday < 10)
theday = "0" + theday;
document.frmmain.selectdate.value = cal.year + '-' + themonth + '-' + theday;
document.frmmain.submit();
}
function doMyWork() {
document.frmmain.selectUser.value = "<%=currUserId%>";
document.all("selectuserspan").innerHTML = "";
doSubmit();
}
function doDay() {
document.frmmain.viewtype.value = "1";
doSubmit();
}
function doWeek() {
document.frmmain.viewtype.value = "2";
doSubmit();
}
function doMonth() {
document.frmmain.viewtype.value = "3";
doSubmit();
}
function doAdd() {
if (check_form(document.frmmain, "note")) {
document.frmmain.action = "WorkSpaceHandler.jsp";
document.frmmain.target = "workSpaceLeft";
document.all("method").value = "addnote";
document.frmmain.submit();
document.frmmain.note.value = "";
document.frmmain.action = "WorkPlanView.jsp";
document.all("method").value = "";
}
}
</SCRIPT>
<SCRIPT language="VBS">
sub onShowHrmID()
id = window.showModalDialog("/systeminfo/BrowserMain.jsp?url=/hrm/resource/ResourceBrowser.jsp")
if (Not IsEmpty(id)) then
if id(0)<> "" then
selectuserspan.innerHtml = id(1)
frmmain.selectUser.value = id(0)
doSubmit()
else
selectuserspan.innerHtml = ""
frmmain.selectUser.value = ""
end if
end if
end sub
</SCRIPT>
</BODY>
</HTML>