Calendar_home.jsp
资源名称:NetOffice.rar [点击查看]
上传用户:guhaomin
上传日期:2007-06-10
资源大小:23203k
文件大小:14k
源码类别:
电子政务应用
开发平台:
Java
- <%@ page errorPage="/vnex/ErrorPage.jsp" %>
- <%@ page import="com.vnex.intranet.calendar.value.*"%>
- <%@ page import="com.vnex.intranet.calendar.proxy.*"%>
- <%@ page import="com.vnex.intranet.util.*"%>
- <%@ page import="com.vnex.intranet.communication.util.*"%>
- <%@ page import="java.util.*" %>
- <%@ page import="java.sql.*" %>
- <jsp:useBean id="calendarProxy" class="com.vnex.intranet.calendar.proxy.CalendarProxyBean" scope="application" />
- <jsp:useBean id="BusinessName" scope="session" class="com.vnex.intranet.pub.BusinessSession" />
- <%@ taglib uri="/vnex.tld" prefix="vnex" %>
- <%@ taglib uri="/vnex_organization.tld" prefix="org" %>
- <%@ taglib uri="/vnex_hr.tld" prefix="hr" %>
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
- <HTML>
- <jsp:include page="/vnex/page/FORM_HEAD.jsp" />
- <BODY text=#000000 vLink=#000000 aLink=#000000 link=#000000 bgColor=#ffffff topMargin=20 leftmargin="0" marginwidth="0" marginheight="0">
- <script Language="JavaScript" src="/vnex/intranet/calendar/Popup.js"></script>
- <script language="javascript" src="/vnex/validate.js" ></script>
- <script language=JavaScript>
- function changeIt()
- {
- document.myform.action = "/mainctrl/calendar/getCalendarList?search=ok&back=ok";
- document.myform.submit();
- }
- function linkTask(taskId)
- {
- document.myform.action = "/mainctrl/calendar/detailCalendar?taskId="+taskId;
- document.myform.submit();
- }
- function searchTask()
- {
- document.myform.action = "/mainctrl/calendar/getCalendarList?search=ok&start=1";
- document.myform.submit();
- }
- function removeTasks()
- {
- if( document.myform.calendarIds==null )
- {
- alert("没有要删除的任务。");
- return false;
- }
- if( document.myform.own.value=="false" )
- {
- alert("不能删除别人的任务。");
- return false;
- }
- if( !isChecked(document.myform.calendarIds) )
- {
- alert("请选择要删除的任务。");
- return false;
- }
- if(!confirm("是否确定删除?"))
- {
- return false;
- }
- document.myform.action = "/mainctrl/calendar/removeCalendarSuccess";
- document.myform.submit();
- }
- function modifyTask()
- {
- if( document.myform.own.value=="false" )
- {
- alert("不能修改别人的任务。");
- return false;
- }
- if( !isCheckedOne(document.myform.calendarIds) )
- {
- alert("请选择一个要修改的任务。");
- return false;
- }
- document.myform.action = "/mainctrl/calendar/modifyCalendar?type=0";
- document.myform.submit();
- }
- function createTask()
- {
- document.myform.action = "/mainctrl/calendar/createCalendar";
- document.myform.submit();
- }
- function CheckAll(form)
- {
- for (var i=0;i<form.elements.length;i++)
- {
- var e = form.elements[i];
- if (e.name != 'chkall')
- e.checked = form.chkall.checked;
- }
- }
- </script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu_person.js"></script>
- <script language="JavaScript1.2" src="/vnex/menu/dockmenu.js"></script>
- <DIV align=center>
- <form name="myform" method="post" action="">
- <%
- Collection coll = null;
- String condition = "";
- int empId = 0;
- String ssd = "";
- String sed = "";
- Timestamp sStartDate = null;
- Timestamp sEndDate = null;
- if( request.getParameter("search")!=null && request.getParameter("search").equals("ok") )
- {
- if(request.getParameter("back")!=null && request.getParameter("back").equals("ok"))
- {
- empId = Integer.parseInt( request.getParameter("ssempId") );
- if(request.getParameter("ssStartDate")!=null && !request.getParameter("ssStartDate").equals(""))
- {
- ssd = request.getParameter("ssStartDate");
- sStartDate = TimeStamp.toTimestamp(ssd+" 00:00:00");
- }
- if(request.getParameter("ssEndDate")!=null && !request.getParameter("ssEndDate").equals(""))
- {
- sed = request.getParameter("ssEndDate");
- sEndDate = TimeStamp.toTimestamp(sed+" 23:59:59");
- }
- }
- if( request.getParameter("empId")!=null && !request.getParameter("empId").equals("") && !request.getParameter("empId").equals("0"))
- {
- empId = Integer.parseInt( request.getParameter("empId") );
- }
- if(request.getParameter("sStartDate")!=null && !request.getParameter("sStartDate").equals(""))
- {
- ssd = request.getParameter("sStartDate");
- sStartDate = TimeStamp.toTimestamp(ssd+" 00:00:00");
- }
- if(request.getParameter("sEndDate")!=null && !request.getParameter("sEndDate").equals(""))
- {
- sed = request.getParameter("sEndDate");
- sEndDate = TimeStamp.toTimestamp(sed+" 23:59:59");
- }
- //是不是自己的任务
- if(empId!=BusinessName.getEmpId() && empId!=0)
- {
- condition = condition+ " and task_visible=1 ";
- out.println("<input type=hidden name=own value=false>");
- }
- else
- {
- out.println("<input type=hidden name=own value=true>");
- }
- if(empId!=0)
- {
- if(ssd!=null && !ssd.equals(""))
- {
- coll = calendarProxy.getCalendarList(empId, condition, sStartDate, sEndDate);
- }
- else
- {
- coll = calendarProxy.getCalendarList(empId, condition);
- }
- }
- else
- {
- if(ssd!=null && !ssd.equals(""))
- {
- coll = calendarProxy.getCalendarList(BusinessName.getEmpId(), condition, sStartDate, sEndDate);
- }
- else
- {
- coll = calendarProxy.getCalendarList(BusinessName.getEmpId(), condition);
- }
- }
- }
- else
- {
- out.println("<input type=hidden name=own value=true>");
- coll = calendarProxy.getCalendarList(BusinessName.getEmpId());
- }
- %>
- <TABLE class=outter cellSpacing=0 cellPadding=0 width=600 border=0>
- <TBODY>
- <jsp:include page="/vnex/page/TTOA_TABLE_TOP.jsp" />
- <TR>
- <TD colSpan=3 align="center" class="iframestyle" valign="top"> <!--菜单开始 -->
- <br>
- <table width="600" border="1" cellspacing="1" bordercolor="#666666">
- <tr valign="top">
- <td bgcolor="#fafafa">
- <table width="600" border="0" cellspacing="0" cellpadding="0">
- <tr bgcolor="#666666">
- <td><font class="strongw"><a href="/mainctrl/home/index"><font color="#FFFFFF">首页</font></a>>><a href="/mainctrl/personal/main"><font color="#FFFFFF">个人办公</font></a>>>日程安排</font>
- </td>
- </tr>
- <tr bgcolor="#fafafa">
- <td height="30">
- <font class="strong"> 选择部门:</font>
- <%
- String deptId = "0";
- if(request.getParameter("deptId") != null)
- {
- deptId = request.getParameter("deptId");
- }
- int deptId2 = Integer.parseInt(deptId);
- %>
- <org:DivisionList>
- <select name="deptId" onChange="changeIt()">
- <option value="0" selected>全部部门</option>
- <vnex:items select='<%=deptId %>'>
- <option value="<org:DivisionAttribute attribute="id"/>" <org:DivisionAttribute attribute="isSelected"/>>
- <org:DivisionAttribute attribute="levelStr"/>+<org:DivisionAttribute attribute="name"/>
- </option>
- </vnex:items>
- </select>
- </org:DivisionList>
- <font class="strong">选择员工:</font>
- <select name="empId" size="1">
- <option value="0">请选择</option>
- <hr:EmployeeList divisionId='<%=deptId2%>'>
- <vnex:items>
- <option value="<hr:EmployeeAttribute attribute='id' />" <hr:EmployeeAttribute attribute='isSelected' /> >
- <hr:EmployeeAttribute attribute="employee_name" />
- </option>
- </vnex:items>
- </hr:EmployeeList>
- </select>
- <input type="button" name="search" value="查询" onClick="return searchTask()" class="text">
- <input type="button" name="search" value="高级查询" onClick="location='/mainctrl/calendar/searchCalendar'" class="text" style="width:60px">
- </td>
- </tr>
- </table>
- <table class=title width="600" border="0" cellspacing="1" cellpadding="0">
- <tr>
- <td bgcolor="#fafafa" height="30" colspan="6">
- <input type="button" name="Submit22" value="新建" onClick="createTask()" class="text">
- <input type="button" name="Button" value="删除" onClick="return removeTasks()" class="text">
- </td>
- </tr>
- <tr>
- <td>
- <table cellpadding="0" width="100%" cellspacing="0" align="center">
- <tbody>
- <tr bgcolor="#cccccc">
- <td colspan="6">
- <table width="600" border="0" cellpadding="2" cellspacing="1" class="title">
- <tr align="center">
- <td width="7%"><font class="strong">选择</font></td>
- <td width="25%"><font class="strong">任务</font></td>
- <td width="20%"><font class="strong">开始日期</font></td>
- <td width="20%"><font class="strong">截止日期</font></td>
- <td width="10%"><font class="strong">重要度</font></td>
- <td width="15%"><font class="strong">创建人</font></td>
- </tr>
- <%
- CalendarValueBean cvb = null;
- int start = 1;
- if ( request.getParameter("start") !=null )
- {
- start = Integer.parseInt( request.getParameter("start") );
- }
- int rowPerPage = com.vnex.intranet.system.loader.ConfigParaLoader.getParameterByInt("rowNum");
- int size = coll.size();
- String action = null;
- if( empId!=0 )
- {
- action = "/mainctrl/calendar/getCalendarList?search=ok&empId="+empId;
- }
- else
- {
- action = "/mainctrl/calendar/getCalendarList?";
- }
- if(ssd!=null && !ssd.equals(""))
- {
- action += "&sStartDate=" + ssd;
- }
- if(sed!=null && !sed.equals(""))
- {
- action += "&sEndDate=" + sed + "&search=ok";
- }
- String nav = NavBar.makeNavbar(start, size, rowPerPage, action);
- int i = 0;
- if(coll != null && coll.size() != 0)
- {
- Iterator it = coll.iterator();
- int flag = 0;
- String bgcolor = null;
- while( it.hasNext() && i < size && i < ( start+rowPerPage-1) )
- {
- i++;
- cvb = (CalendarValueBean)it.next();
- if ( i < start ) continue;
- if( flag%2==0 )
- {
- bgcolor = "#e0e0e0";
- }
- else
- {
- bgcolor = "#fafafa";
- }
- Timestamp startDate = cvb.getStartDate();
- Timestamp endDate = cvb.getEndDate();
- Calendar cd = TimeStamp.convertTimestampToCalendar(startDate);
- int sYear = cd.get(Calendar.YEAR);
- int sMonth = cd.get(Calendar.MONTH) + 1;
- int sDay = cd.get(Calendar.DAY_OF_MONTH);
- int sHour = cd.get(Calendar.HOUR_OF_DAY);
- int sMinute = cd.get(Calendar.MINUTE);
- cd = TimeStamp.convertTimestampToCalendar(endDate);
- int eYear = cd.get(Calendar.YEAR);
- int eMonth = cd.get(Calendar.MONTH) + 1;
- int eDay = cd.get(Calendar.DAY_OF_MONTH);
- int eHour = cd.get(Calendar.HOUR_OF_DAY);
- int eMinute = cd.get(Calendar.MINUTE);
- %>
- <tr>
- <td bgcolor="<%= bgcolor%>" width="7%" align="center">
- <input type="checkbox" name="calendarIds" value="<%= cvb.getTaskId()%>">
- </td>
- <td bgcolor="<%= bgcolor%>" width="25%" align="center"><a href="JavaScript:linkTask(<%= cvb.getTaskId()%>)"><%= FieldUtil.filterScriptTag(cvb.getTaskName())%></a></td>
- <td bgcolor="<%= bgcolor%>" width="20%" align="center"><%= sYear%>-<%= sMonth%>-<%= sDay%> <%= sHour%>:<% if(sMinute==0) out.print(sMinute+"0"); else out.print(sMinute);%></td>
- <td bgcolor="<%= bgcolor%>" width="20%" align="center"><%= eYear%>-<%= eMonth%>-<%= eDay%> <%= eHour%>:<% if(eMinute==0) out.print(eMinute+"0"); else out.print(eMinute);%></td>
- <td bgcolor="<%= bgcolor%>" width="10%" align="center"><%= cvb.getTaskImport()%></td>
- <td bgcolor="<%= bgcolor%>" width="15%" align="center"><%= cvb.getCreatorName()%></td>
- </tr>
- <%
- flag++;
- }
- }
- out.println("<input type=hidden name=ssempId value=""+empId+"">");
- out.println("<input type=hidden name=ssStartDate value=""+ssd+"">");
- out.println("<input type=hidden name=ssEndDate value=""+sed+"">");
- out.println("<input type=hidden name=start value=""+start+"">");
- %>
- <%
- if(size!=0)
- {
- %>
- <tr>
- <td bgcolor="#fafafa" width="7%" align="center">
- <input type="checkbox" name="chkall" value="on" onclick="CheckAll(this.form)">
- </td>
- <td bgcolor="#fafafa" colspan="5"> 全选</td>
- </tr>
- <%
- }
- %>
- <tr bgcolor="#e0e0e0">
- <td colspan="6">
- <%= nav %>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- <!--个人信息结束 -->
- <jsp:include page="/vnex/page/TTOA_HELP.jsp" />
- </TD>
- </TR>
- <jsp:include page="/vnex/page/TTOA_TABLE_BOTTOM.jsp" />
- </TBODY>
- </TABLE>
- <BR>
- <jsp:include page="/vnex/page/TTOA_PRODUCER_LOGO.jsp" />
- </form></DIV>
- </BODY></HTML>