%@ page import="java.util.*,com.MHSoftware.dates.SaneDate,com.mhsoftware.cdaily.business.calitem,com.mhsoftware.cdaily.business.User,com.mhsoftware.cdaily.servlet.CalServlet,com.mhsoftware.cdaily.support.*" %> <% /* --Calendar item properties are:-- public int cal_item_id; public int calendar_id; public int item_type_id; public int owner; public int approved; public SaneDate starting_date; public SaneDate ending_date; public String starting_time; public String ending_time; public int rec_type; public String description; public String contact_name; public String contact_info; public String add_info_url; public Timestamp last_update; public String long_description; public String owner_name; // Virtual Field from View */ //NOTE: THE INCLUDE CALENDARS DEFAULT TO approved=1 (SHOW ONLY APPROVED) // PASS approved=0 IF NON-APPROVED EVENTS NEED TO BE SHOWN. User oUser=WebApp.getPublicUser(request); if (oUser==null) { return; } String absolutePrefix = request.getScheme() + "://" + request.getServerName() + request.getContextPath() + "/"; int DAYS_DISPLAY=7; // Set this to 7 for a week view, 1 for a single day boolean SHOW_EMPTY_DAYS=true; CalServlet cs=new CalServlet(); Locale lc=cs.getNegotiatedLocale(request); ResourceBundle rb=CalServlet.getResourceBundle(lc); SaneDate startDate=new SaneDate(); //This date will be the first day of the displayed interval SaneDate endDate=new SaneDate(); //This date will be the last day of the displayed interval SaneDate currentDate=new SaneDate(); //Current date w/in start/end interval (itterates) SaneDate today = new SaneDate(); //This date will *always* be today. SaneDate nextDate; SaneDate prevDate; int startMonthOffset = 0; //Number of months the start date is offset from the current month int endMonthOffset = 0; //Number of months the end date is offset from the current month boolean detail = true; //If set true, detail descriptions are shown (default) calitem ci; String cCriteria, cTime; String referrer = ""; //This page may be accessed by other pages, but includes nav links, //so it must know what URL to link to if (request.getParameter("referrer")!=null) { referrer = request.getParameter("referrer"); } else { referrer = "printable_week.jsp"; } //Look to see if a date or year/week was passed as an argument. if (request.getParameter("date")!=null) { //Date was passed startDate = new SaneDate(Integer.parseInt(request.getParameter("date"))); } else if (request.getParameter("year")!=null && request.getParameter("week")!=null) { //Year / week combination was passed int year = Integer.parseInt(request.getParameter("year")); int week = Integer.parseInt(request.getParameter("week")); SaneDate dayOne = new SaneDate(year, 1, 1); //First day of passed year if (dayOne.getDOW() != 1) { startDate = new SaneDate( (dayOne.getJulianDate() + (8 - dayOne.getDOW())) + ((week - 1) * 7) ); } else { startDate = new SaneDate( (dayOne.getJulianDate() + (8 - dayOne.getDOW())) + ((week - 1) * 7) ); } dayOne = null; } else if (request.getParameter("offset")!=null) { //Offset from todays date (in weeks) was passed int offset = Integer.parseInt(request.getParameter("offset")) * DAYS_DISPLAY; startDate.add(offset); } startDate.subtract(startDate.getDOW()-1); //Ensure current date is first day of week //Check to see if detail description should be hidden. (defaults to 1 - show detail) if (request.getParameter("detail") != null) { if (request.getParameter("detail").equals("0")) { detail = false; } } currentDate = new SaneDate(startDate.getJulianDate()); endDate = new SaneDate(startDate.getJulianDate() + DAYS_DISPLAY - 1); nextDate = new SaneDate(startDate.getJulianDate() + DAYS_DISPLAY); prevDate = new SaneDate(startDate.getJulianDate() - DAYS_DISPLAY); startMonthOffset = (startDate.getMonth() - today.getMonth()) + ( 12 * (startDate.getYear() - today.getYear()) ); endMonthOffset = (endDate.getMonth() - today.getMonth()) + ( 12 * (endDate.getYear() - today.getYear()) ); // // Call the helper method to get the item vector, and parse the options // Vector v=CalHelper.getItemVectorAndOptions(request,request.getLocale()); // // Get an array of vectors, where each element in the array corresponds // to one day. The vectors contain the calendar items that occurr on the // specified day. // Vector[] avDays=CalHelper.getDayVector(startDate,endDate,v,WebApp.getTimeZone().getID(),Locale.getDefault()); // // Get the criteria that was parsed out by getItemVectorAndOptions() // cCriteria = (String)request.getAttribute("Criteria"); //Debug - view passed criteria and query out.println(""); %>
Previous Week
Next Week
|
|||
|
|
|
|
<% if (detail) { %> [Hide Details] <% } else { %> [Show Details] <% } %> |
<%= startDate.toLongString() %> - <%= endDate.toLongString() %>
| <%=currentDate.toLongString()%> (No scheduled events found.) | ||
<%=currentDate.toLongString()%> |
||
![]() |
<%=cTime%> |
<%=ci.description%> |
<%=ci.long_description%> |
||
For more information visit: <%= infoURL %> |
||