if ( arguments.calendarType IS "small" ) rtnString = application.ptCalendar2.calendarService.createSmallCalendar(arguments.curMonth, arguments.curYear, arguments.calendarData, arguments.eventField); else if ( arguments.calendarType IS "large" ) rtnString = application.ptCalendar2.calendarService.createLargeCalendar(arguments.curMonth, arguments.curYear, arguments.calendarData, arguments.eventField); else if ( arguments.calendarType IS "list" ) rtnString = application.ptCalendar2.calendarService.createMonthAsList(arguments.curMonth, arguments.curYear, arguments.calendarData, arguments.eventField); return rtnString; var outString = ""; var firstDay = CreateDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = calculateMonthsYears(firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var eventDataList = ""; // START TODO // TODO: replace with the app settings data var height = 24; var width = 30; var currentDayClass = "month-grid-day-current"; var eventDayClass = "month-grid-day-event"; var standardDayClass = "month-grid-day-standard"; var dayHeaderClass = "month-grid-subheader"; var prevNextClass = "month-grid-header"; var nextImage = ""; var prevImage = ""; //var dateLink = cgi.script_name; var monthlySmallLink = cgi.script_name; var detailLink = cgi.script_name; var dailyLink = cgi.script_name; var weeklyListLink = cgi.script_name; var weeklyGridLink = cgi.script_name; var monthlyListLink = cgi.script_name; var monthlyGridLink = cgi.script_name; var nextPrevLink = cgi.script_name; var pageMap = getCalPageMap(); var calGlobalConfig = getAppConfig(); // Get Grid Cell Width if ( structKeyExists(calGlobalConfig,"calendar_small_grid_cell_width") AND LEN(TRIM(calGlobalConfig['calendar_small_grid_cell_width'])) ) width = calGlobalConfig['calendar_small_grid_cell_width']; // Get Grid Cell Height if ( structKeyExists(calGlobalConfig,"calendar_small_grid_cell_height") AND LEN(TRIM(calGlobalConfig['calendar_small_grid_cell_height'])) ) height = calGlobalConfig['calendar_small_grid_cell_height']; // TODO: this needs to be connected better into the Calendar Page Map element // Set Page Mapping Variables if( structKeyExists(pageMap, "detailPage") and len(pageMap.detailPage) ) detailLink = pageMap.detailPage; if( structKeyExists(pageMap, "dailyPage") and len(pageMap.dailyPage) ) dailyLink = pageMap.dailyPage; if( structKeyExists(pageMap, "weeklyListPage") and len(pageMap.weeklyListPage) ) weeklyListLink = pageMap.weeklyListPage; if( structKeyExists(pageMap, "weeklyGridPage") and len(pageMap.weeklyGridPage) ) weeklyGridLink = pageMap.weeklyGridPage; if( structKeyExists(pageMap, "monthlyListPage") and len(pageMap.monthlyListPage) ) monthlyListLink = pageMap.monthlyListPage; if( structKeyExists(pageMap, "monthlyGridPage") and len(pageMap.monthlyGridPage) ) monthlyGridLink = pageMap.monthlyGridPage; /*if( structKeyExists(request.ptCalendar, "calPages") and structKeyExists(request.ptCalendar.calPages, "calDayViewPageURL") ) dateLink = request.ptCalendar.calPages["calDayViewPageURL"]; // determine some of the default rendering properties if( structKeyExists(metadata, "calendarProps") ) { if( len(metadata.calendarProps.cellHeight) ) height = metadata.calendarProps.cellHeight; if( len(metadata.calendarProps.cellWidth) ) width = metadata.calendarProps.cellWidth; if( len(metadata.calendarProps.currentDayClass) ) currentDayClass = metadata.calendarProps.currentDayClass; if( len(metadata.calendarProps..eventDayClass) ) eventDayClass = metadata.calendarProps.eventDayClass; if( len(metadata.calendarProps..standardDayClass) ) standardDayClass = metadata.calendarProps.standardDayClass; if( len(metadata.calendarProps.dayHeaderClass) ) dayHeaderClass = metadata.calendarProps.dayHeaderClass; if( len(metadata.calendarProps.prevNextClass) ) prevNextClass = metadata.calendarProps.prevNextClass; if( len(metadata.calendarProps.nextImage) ) nextImage = metadata.calendarProps.nextImage; if( len(metadata.calendarProps.prevImage) ) prevImage = metadata.calendarProps.prevImage; if( len(metadata.calendarProps.dateLink) ) dateLink = metadata.calendarProps.dateLink; if( len(metadata.calendarProps.nextPrevLink) ) nextPrevLink = metadata.calendarProps.nextPrevLink; }*/ // TODO: replace with the app settings data // END TODO // set the next and previous months nextMonth = month(dateadd('M',1,firstDay)); nextYear = year(dateadd('Y',1,firstDay)); // reset year if next month is january if( nextMonth eq 1 ) nextYear = nextYear + 1; lastMonth = month(dateadd('M',-1,firstDay)); lastYear = year(dateadd('Y',-1,firstDay)); // reset year if last month is december //if( lastMonth eq 12 ) //lastYear = lastYear - 1; // check to make sure that next/last year is not more than 2 years away if( nextYear gt year(dateAdd("yyyy", 2, now())) ) { nextYear = year(now()); nextMonth = month(now()); } else if( lastYear lt year(dateAdd("yyyy", -2, now())) ) { lastYear = year(now()); lastMonth = month(now()); } // loop through the items in the element for (itm=1;itm LTE arrayLen(arguments.calendarData); itm=itm+1) { // set structure friendly variable for this event eventDate = dateFormat(arguments.calendarData[itm].values[arguments.eventField], "yyyymmdd"); // see if this events date exists in the eventDataStruct if( not listFind(eventDataList, eventDate) ) eventDataList = listAppend(eventDataList, eventDate); } // if it isn't sunday, then we need to if space over to start on the corrent day of week if (firstDayDigit neq 1) { for (h=1; h lt DayOfWeek(FirstDay); h = h+1) { outString = outString & ""; } } // loop thru all the dates in this month for (i=1; i lte DaysInMonth(firstDay); i = i+1) { // local variable for this date thisDate = CreateDate(arguments.curYear, arguments.curMonth, i); //is it Sunday? if so start new row. if (DayOfWeek(thisDate) eq 1) { outString = outString & ""; } //determine the class for the current day or if the day has an event classTxt = ' class="#standardDayClass#"'; dayText = i; // todays date if(thisDate eq CreateDate(year(now()),month(now()),day(now()))) classTxt = ' class="#currentDayClass#"'; // has event for this date if( listFind(eventDataList, dateFormat(thisDate, 'yyyymmdd')) ) { classTxt = ' class="#eventDayClass#"'; dayText = '#dayText#'; } // output the day cell outString = outString & " "; // is it the last day of the month? if so, fill row with blanks. if (i eq DaysInMonth(firstDay)) { for (h=1; h lte (7-DayOfWeek(thisDate)); h = h+1) { outString = outString & ""; } } if (DayOfWeek(thisDate) eq 7){ outString = outString & ""; } } outString=outString & "
#Left(DayOfWeekAsString(hDay), 1)#
 
#dayText#
 
"; return outString;
var outString = ""; var firstDay = CreateDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = calculateMonthsYears(firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var eventDataStruct = structNew(); // START TODO // TODO: replace with the app settings data var height = 150; var width = 130; var currentDayClass = "month-grid-day-current"; var eventDayClass = "month-grid-day-event"; var standardDayClass = "month-grid-day-standard"; var dayHeaderClass = "month-grid-subheader"; var prevNextClass = "month-grid-header"; var nextImage = ""; var prevImage = ""; var detailLink = cgi.script_name; //var dateLink = cgi.script_name; var dailyLink = cgi.script_name; var weeklyListLink = cgi.script_name; var weeklyGridLink = cgi.script_name; var monthlyListLink = cgi.script_name; var monthlyGridLink = cgi.script_name; var nextPrevLink = cgi.script_name; var calGlobalConfig = getAppConfig(); var pageMap = getCalPageMap(); var useEventToolTip = false; var qTipStyleName = "cream"; // TODO: this needs to be connected better into the Calendar Page Map element // Get useEventToolTip option from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_use_event_tooltip") AND LEN(TRIM(calGlobalConfig['calendar_app_use_event_tooltip'])) ) useEventToolTip = calGlobalConfig['calendar_app_use_event_tooltip']; // Get ToolTip Style from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_tooltip_theme") AND LEN(TRIM(calGlobalConfig['calendar_app_tooltip_theme'])) ) qTipStyleName = calGlobalConfig['calendar_app_tooltip_theme']; // Get Grid Cell Width if ( structKeyExists(calGlobalConfig,"calendar_large_grid_cell_width") AND LEN(TRIM(calGlobalConfig['calendar_large_grid_cell_width'])) ) width = calGlobalConfig['calendar_large_grid_cell_width']; // Get Grid Cell Height if ( structKeyExists(calGlobalConfig,"calendar_large_grid_cell_height") AND LEN(TRIM(calGlobalConfig['calendar_large_grid_cell_height'])) ) height = calGlobalConfig['calendar_large_grid_cell_height']; // Set Page Mapping Variables if( structKeyExists(pageMap, "detailPage") and len(pageMap.detailPage) ) detailLink = pageMap.detailPage; if( structKeyExists(pageMap, "dailyPage") and len(pageMap.dailyPage) ) dailyLink = pageMap.dailyPage; if( structKeyExists(pageMap, "weeklyListPage") and len(pageMap.weeklyListPage) ) weeklyListLink = pageMap.weeklyListPage; if( structKeyExists(pageMap, "weeklyGridPage") and len(pageMap.weeklyGridPage) ) weeklyGridLink = pageMap.weeklyGridPage; if( structKeyExists(pageMap, "monthlyListPage") and len(pageMap.monthlyListPage) ) monthlyListLink = pageMap.monthlyListPage; if( structKeyExists(pageMap, "monthlyGridPage") and len(pageMap.monthlyGridPage) ) monthlyGridLink = pageMap.monthlyGridPage; /*if( structKeyExists(request.ptCalendar, "calPages") and structKeyExists(request.ptCalendar.calPages, "calDayViewPageURL") ) dateLink = request.ptCalendar.calPages["calDayViewPageURL"]; // determine some of the default rendering properties if( structKeyExists(metadata, "calendarProps") ) { if( len(metadata.calendarProps.cellHeight) ) height = metadata.calendarProps.cellHeight; if( len(metadata.calendarProps.cellWidth) ) width = metadata.calendarProps.cellWidth; if( len(metadata.calendarProps.currentDayClass) ) currentDayClass = metadata.calendarProps.currentDayClass; if( len(metadata.calendarProps..eventDayClass) ) eventDayClass = metadata.calendarProps.eventDayClass; if( len(metadata.calendarProps..standardDayClass) ) standardDayClass = metadata.calendarProps.standardDayClass; if( len(metadata.calendarProps.dayHeaderClass) ) dayHeaderClass = metadata.calendarProps.dayHeaderClass; if( len(metadata.calendarProps.prevNextClass) ) prevNextClass = metadata.calendarProps.prevNextClass; if( len(metadata.calendarProps.nextImage) ) nextImage = metadata.calendarProps.nextImage; if( len(metadata.calendarProps.prevImage) ) prevImage = metadata.calendarProps.prevImage; if( len(metadata.calendarProps.dateLink) ) dateLink = metadata.calendarProps.dateLink; if( len(metadata.calendarProps.nextPrevLink) ) nextPrevLink = metadata.calendarProps.nextPrevLink; }*/ // TODO: replace with the app settings data // END TODO //set the next and previous months nextMonth = month(dateadd('M',1,firstDay)); nextYear = year(dateadd('Y',1,firstDay)); // reset year if next month is january if( nextMonth eq 1 ) nextYear = nextYear + 1; lastMonth = month(dateadd('M',-1,firstDay)); lastYear = year(dateadd('Y',-1,firstDay)); // reset year if last month is december //if( lastMonth eq 12 ) //lastYear = lastYear - 1; // check to make sure that next/last year is not more than 2 years away if( nextYear gt year(dateAdd("yyyy", 2, now())) ) { nextYear = year(now()); nextMonth = month(now()); } else if( lastYear lt year(dateAdd("yyyy", -2, now())) ) { lastYear = year(now()); lastMonth = month(now()); } // loop through the items in the element for (itm=1;itm LTE arrayLen(arguments.calendarData); itm=itm+1) { // set structure friendly variable for this event thisDateStruct = dateFormat(arguments.calendarData[itm].values[arguments.eventField], "yyyymmdd"); // see if this events date exists in the eventDataStruct if( not structKeyExists(eventDataStruct, thisDateStruct) ) eventDataStruct[thisDateStruct] = itm; else eventDataStruct[thisDateStruct] = listAppend(eventDataStruct[thisDateStruct], itm); } Application.ptCalendar2.scripts.loadJQuery(); if ( useEventToolTip IS true ) Application.ptCalendar2.scripts.loadQTip(); // if it isn't sunday, then we need to if space over to start on the corrent day of week if (firstDayDigit neq 1) { for (h=1; h lt DayOfWeek(FirstDay); h = h+1) { outString = outString & ""; } } // loop thru all the dates in this month for (i=1; i lte DaysInMonth(firstDay); i = i+1) { // local variable for this date thisDate = CreateDate(arguments.curYear, arguments.curMonth, i); //is it Sunday? if so start new row. if (DayOfWeek(thisDate) eq 1) { outString = outString & ""; } //determine the class for the current day or if the day has an event classTxt = ' class="#standardDayClass#"'; dayText = i; // todays date if ( thisDate eq CreateDate(year(now()),month(now()),day(now())) ) classTxt = ' class="#currentDayClass#"'; // has event for this date if ( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { classTxt = ' class="#eventDayClass#"'; dayText = '#dayText#'; detailedDayText = buildDetailedDayText(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip); dayText = dayText & detailedDayText; } // output the day cell outString = outString & " "; // is it the last day of the month? if so, fill row with blanks. if (i eq DaysInMonth(firstDay)) { for (h=1; h lte (7-DayOfWeek(thisDate)); h = h+1) { outString = outString & ""; } } if (DayOfWeek(thisDate) eq 7){ outString = outString & ""; } } outString=outString & "
#Left(DayOfWeekAsString(hDay), 3)#
 
#dayText#
 
"; return outString;
var outString = ""; var firstDay = CreateDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = calculateMonthsYears(firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var eventDataStruct = structNew(); var eventCounter = 0; // START TODO // TODO: replace with the app settings data var monthWrapperClass = "month-list-wrapper"; var currentDayClass = "month-list-day-current"; var eventDayHeaderClass = "month-list-day-header"; var standardDayClass = "month-list-day-standard"; var eventDayClass = "month-list-day-event"; //var dateLink = cgi.script_name; var detailLink = cgi.script_name; var dailyLink = cgi.script_name; var weeklyListLink = cgi.script_name; var weeklyGridLink = cgi.script_name; var monthlyListLink = cgi.script_name; var monthlyGridLink = cgi.script_name; var nextPrevLink = cgi.script_name; var calGlobalConfig = getAppConfig(); var pageMap = getCalPageMap(); var useEventToolTip = false; var qTipStyleName = "cream"; var eventDetailOptions = StructNew(); eventDetailOptions.showTime = true; eventDetailOptions.showLocation = true; // TODO: this needs to be connected better into the Calendar Page Map element // Get useEventToolTip option from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_use_event_tooltip") AND LEN(TRIM(calGlobalConfig['calendar_app_use_event_tooltip'])) ) useEventToolTip = calGlobalConfig['calendar_app_use_event_tooltip']; // Get ToolTip Style from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_tooltip_theme") AND LEN(TRIM(calGlobalConfig['calendar_app_tooltip_theme'])) ) qTipStyleName = calGlobalConfig['calendar_app_tooltip_theme']; if( structKeyExists(pageMap, "detailPage") and len(pageMap.detailPage) ) detailLink = pageMap.detailPage; if( structKeyExists(pageMap, "dailyPage") and len(pageMap.dailyPage) ) dailyLink = pageMap.dailyPage; if( structKeyExists(pageMap, "weeklyListPage") and len(pageMap.weeklyListPage) ) weeklyListLink = pageMap.weeklyListPage; if( structKeyExists(pageMap, "weeklyGridPage") and len(pageMap.weeklyGridPage) ) weeklyGridLink = pageMap.weeklyGridPage; if( structKeyExists(pageMap, "monthlyListPage") and len(pageMap.monthlyListPage) ) monthlyListLink = pageMap.monthlyListPage; if( structKeyExists(pageMap, "monthlyGridPage") and len(pageMap.monthlyGridPage) ) monthlyGridLink = pageMap.monthlyGridPage; // set the next and previous months nextMonth = month(dateadd('M',1,firstDay)); nextYear = year(dateadd('Y',1,firstDay)); // reset year if next month is january if( nextMonth eq 1 ) nextYear = nextYear + 1; lastMonth = month(dateadd('M',-1,firstDay)); lastYear = year(dateadd('Y',-1,firstDay)); // reset year if last month is december //if( lastMonth eq 12 ) //lastYear = lastYear - 1; // check to make sure that next/last year is not more than 2 years away if( nextYear gt year(dateAdd("yyyy", 2, now())) ) { nextYear = year(now()); nextMonth = month(now()); } else if( lastYear lt year(dateAdd("yyyy", -2, now())) ) { lastYear = year(now()); lastMonth = month(now()); } // loop through the items in the element for (itm=1;itm LTE arrayLen(arguments.calendarData); itm=itm+1) { // set structure friendly variable for this event thisDateStruct = dateFormat(arguments.calendarData[itm].values[arguments.eventField], "yyyymmdd"); // see if this events date exists in the eventDataStruct if( not structKeyExists(eventDataStruct, thisDateStruct) ) eventDataStruct[thisDateStruct] = itm; else eventDataStruct[thisDateStruct] = listAppend(eventDataStruct[thisDateStruct], itm); } Application.ptCalendar2.scripts.loadJQuery(); if ( useEventToolTip IS true ) Application.ptCalendar2.scripts.loadQTip();

Events List for #DateFormat(firstDay, 'mmmm yyyy')#

mthClassTxt = ' class="#monthWrapperClass#"'; outString = outString & ""; // loop thru all the dates in this month for (i=1; i lte DaysInMonth(firstDay); i = i+1) { // local variable for this date thisDate = CreateDate(arguments.curYear, arguments.curMonth, i); //determine the class for the current day or if the day has an event dayclassTxt = ' class="#standardDayClass#"'; dayHeaderClassTxt = ' class="#eventDayHeaderClass#"'; dayText = ""; // todays date if(thisDate eq CreateDate(year(now()),month(now()),day(now()))) dayclassTxt = ' class="#currentDayClass#"'; // has event for this date if( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { dayText = '#DateFormat(thisDate,"full")#'; detailedDayText = buildDetailedDayText(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip,eventDetailOptions); dayText = dayText & detailedDayText; // output the day cell outString = outString & "#dayText# "; eventCounter = eventCounter + 1; } } if ( eventCounter EQ 0 ) { outString = outString & ''; dayText = "No Events Scheduled for the Month"; outString = outString & "#dayText# "; } outString=outString & ""; return outString;
var refDay = CreateDate(arguments.curYear, arguments.curMonth, arguments.curDay); // retrieve the date struct for the surrounding weeks var weekStruct = calculateWeekDates(refDay); var outString = ""; var itm = 1; var i = 1; var h = 1; var eventDataStruct = structNew(); // START TODO // TODO: replace with the app settings data var height = 150; var width = 130; var currentDayClass = "month-grid-day-current"; var eventDayClass = "month-grid-day-event"; var standardDayClass = "month-grid-day-standard"; var dayHeaderClass = "month-grid-subheader"; var prevNextClass = "month-grid-header"; var nextImage = ""; var prevImage = ""; var detailLink = cgi.script_name; var dailyLink = cgi.script_name; var weeklyListLink = cgi.script_name; var weeklyGridLink = cgi.script_name; var monthlyListLink = cgi.script_name; var monthlyGridLink = cgi.script_name; var nextPrevLink = cgi.script_name; var calGlobalConfig = getAppConfig(); var pageMap = getCalPageMap(); var useEventToolTip = false; var qTipStyleName = "cream"; // Get useEventToolTip option from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_use_event_tooltip") AND LEN(TRIM(calGlobalConfig['calendar_app_use_event_tooltip'])) ) useEventToolTip = calGlobalConfig['calendar_app_use_event_tooltip']; // Get ToolTip Style from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_tooltip_theme") AND LEN(TRIM(calGlobalConfig['calendar_app_tooltip_theme'])) ) qTipStyleName = calGlobalConfig['calendar_app_tooltip_theme']; if( structKeyExists(pageMap, "detailPage") and len(pageMap.detailPage) ) detailLink = pageMap.detailPage; if( structKeyExists(pageMap, "dailyPage") and len(pageMap.dailyPage) ) dailyLink = pageMap.dailyPage; if( structKeyExists(pageMap, "weeklyListPage") and len(pageMap.weeklyListPage) ) weeklyListLink = pageMap.weeklyListPage; if( structKeyExists(pageMap, "weeklyGridPage") and len(pageMap.weeklyGridPage) ) weeklyGridLink = pageMap.weeklyGridPage; if( structKeyExists(pageMap, "monthlyListPage") and len(pageMap.monthlyListPage) ) monthlyListLink = pageMap.monthlyListPage; if( structKeyExists(pageMap, "monthlyGridPage") and len(pageMap.monthlyGridPage) ) monthlyGridLink = pageMap.monthlyGridPage; // loop through the items in the element for (itm=1;itm LTE arrayLen(arguments.calendarData); itm=itm+1) { // set structure friendly variable for this event thisDateStruct = dateFormat(arguments.calendarData[itm].values[arguments.eventField], "yyyymmdd"); // see if this events date exists in the eventDataStruct if( not structKeyExists(eventDataStruct, thisDateStruct) ) eventDataStruct[thisDateStruct] = itm; else eventDataStruct[thisDateStruct] = listAppend(eventDataStruct[thisDateStruct], itm); } Application.ptCalendar2.scripts.loadJQuery(); if ( useEventToolTip IS true ) Application.ptCalendar2.scripts.loadQTip();

Week of #weekStruct.formattedThisWeek#

outString = outString & ""; // loop thru all the dates in this month for (i=0; i lte 6; i = i+1) { // local variable for this date //thisDate = CreateDate(arguments.curYear, arguments.curMonth, i); thisDate = dateAdd("d", i, weekStruct.firstOfThisWeek); curDateKey = dateFormat(thisDate, "yyyymmdd"); //determine the class for the current day or if the day has an event classTxt = ' class="#standardDayClass#"'; dayText = dateFormat(thisDate, 'd'); // todays date if(thisDate eq CreateDate(year(now()),month(now()),day(now()))) classTxt = ' class="#currentDayClass#"'; // has event for this date if( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { classTxt = ' class="#eventDayClass#"'; dayText = '#dateFormat(thisDate, 'd')#'; detailedDayText = buildDetailedDayText(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip); dayText = dayText & detailedDayText; } // output the day cell outString = outString & " "; } outString = outString & ""; outString = outString & "
#Left(DayOfWeekAsString(hDay), 3)#
#dayText#
"; return outString;
var refDay = CreateDate(arguments.curYear, arguments.curMonth, arguments.curDay); // retrieve the date struct for the surrounding weeks var weekStruct = calculateWeekDates(refDay); var outString = ""; var i = 1; var itm = 1; var h = 1; var eventDataStruct = structNew(); var eventCounter = 0; // START TODO // TODO: replace with the app settings data var weekWrapperClass = "week-list-wrapper"; var currentDayClass = "month-list-day-current"; var eventDayHeaderClass = "month-list-day-header"; var standardDayClass = "month-list-day-standard"; var eventDayClass = "month-list-day-event"; var detailLink = cgi.script_name; var dailyLink = cgi.script_name; var weeklyListLink = cgi.script_name; var weeklyGridLink = cgi.script_name; var monthlyListLink = cgi.script_name; var monthlyGridLink = cgi.script_name; var nextPrevLink = cgi.script_name; var calGlobalConfig = getAppConfig(); var pageMap = getCalPageMap(); var useEventToolTip = false; var qTipStyleName = "cream"; var eventDetailOptions = StructNew(); eventDetailOptions.showTime = true; eventDetailOptions.showLocation = true; // Get useEventToolTip option from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_use_event_tooltip") AND LEN(TRIM(calGlobalConfig['calendar_app_use_event_tooltip'])) ) useEventToolTip = calGlobalConfig['calendar_app_use_event_tooltip']; // Get ToolTip Style from Config Element if ( structKeyExists(calGlobalConfig,"calendar_app_tooltip_theme") AND LEN(TRIM(calGlobalConfig['calendar_app_tooltip_theme'])) ) qTipStyleName = calGlobalConfig['calendar_app_tooltip_theme']; if( structKeyExists(pageMap, "detailPage") and len(pageMap.detailPage) ) detailLink = pageMap.detailPage; if( structKeyExists(pageMap, "dailyPage") and len(pageMap.dailyPage) ) dailyLink = pageMap.dailyPage; if( structKeyExists(pageMap, "weeklyListPage") and len(pageMap.weeklyListPage) ) weeklyListLink = pageMap.weeklyListPage; if( structKeyExists(pageMap, "weeklyGridPage") and len(pageMap.weeklyGridPage) ) weeklyGridLink = pageMap.weeklyGridPage; if( structKeyExists(pageMap, "monthlyListPage") and len(pageMap.monthlyListPage) ) monthlyListLink = pageMap.monthlyListPage; if( structKeyExists(pageMap, "monthlyGridPage") and len(pageMap.monthlyGridPage) ) monthlyGridLink = pageMap.monthlyGridPage; // loop through the items in the element for (itm=1;itm LTE arrayLen(arguments.calendarData); itm=itm+1) { // set structure friendly variable for this event thisDateStruct = dateFormat(arguments.calendarData[itm].values[arguments.eventField], "yyyymmdd"); // see if this events date exists in the eventDataStruct if( not structKeyExists(eventDataStruct, thisDateStruct) ) eventDataStruct[thisDateStruct] = itm; else eventDataStruct[thisDateStruct] = listAppend(eventDataStruct[thisDateStruct], itm); } Application.ptCalendar2.scripts.loadJQuery(); if ( useEventToolTip IS true ) Application.ptCalendar2.scripts.loadQTip();

Week of #weekStruct.formattedThisWeek#

wkClassTxt = ' class="#weekWrapperClass#"'; outString = outString & ""; // loop thru all the dates in this month for (i=0; i lte 6; i = i+1) { // local variable for this date //thisDate = CreateDate(arguments.curYear, arguments.curMonth, i); thisDate = dateAdd("d", i, weekStruct.firstOfThisWeek); curDateKey = dateFormat(thisDate, "yyyymmdd"); //determine the class for the current day or if the day has an event dayClassTxt = ' class="#standardDayClass#"'; dayHeaderClassTxt = ' class="#eventDayHeaderClass#"'; dayText = DateFormat(thisDate,"full"); // todays date if(thisDate eq CreateDate(year(now()),month(now()),day(now()))) dayClassTxt = ' class="#currentDayClass#"'; // has event for this date if( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { //dayClassTxt = ' class="#eventDayClass#"'; dayText = '#dayText#'; detailedDayText = buildDetailedDayText(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip,eventDetailOptions); dayText = dayText & detailedDayText; } else { dayText = '#dayText#'; detailedDayText = '
No events listed for this date
'; dayText = dayText & detailedDayText; } // output the day cell outString = outString & "#dayText# "; eventCounter = eventCounter + 1; } if ( eventCounter EQ 0 ) { outString = outString & ''; dayText = "No Events Scheduled for the Week"; outString = outString & "#dayText# "; } outString=outString & ""; return outString;
var rtnStruct = structNew(); var pageMap = structNew(); var pageMapAry = application.ptCalendar2.ceData.getCEData("Calendar2 Page Map"); var dates = structNew(); var refDate = createDate(year(arguments.theDate), month(arguments.theDate), 1); // set the next and previous months dates.nextMonth = month(dateadd('M',1,refDate)); dates.nextYear = year(dateadd('Y',1,refDate)); // reset year if next month is january if( dates.nextMonth eq 1 ) dates.nextYear = dates.nextYear + 1; dates.lastMonth = month(dateadd('M',-1,refDate)); dates.lastYear = year(dateadd('Y',-1,refDate)); // check to make sure that next/last year is not more than 2 years away if( dates.nextYear gt year(dateAdd("yyyy", 2, now())) ) { dates.nextYear = year(now()); dates.nextMonth = month(now()); } else if( dates.lastYear lt year(dateAdd("yyyy", -2, now())) ) { dates.lastYear = year(now()); dates.lastMonth = month(now()); } return dates; var dates = structNew(); var firstOfThisWeek = application.ptCalendar2.date.firstDayOfWeek(arguments.theDate); var lastOfThisWeek = dateAdd("d", 6, firstOfThisWeek); var firstOfLastWeek = dateAdd("d", -7, firstOfThisWeek); var firstOfNextWeek = dateAdd("d", 7, firstOfThisWeek); var formattedThisWeek = dateFormat(firstOfThisWeek, 'mmmm dd, yyyy'); var formattedLastWeek = dateFormat(firstOfLastWeek, 'mmmm dd'); var formattedNextWeek = dateFormat(firstOfNextWeek, 'mmmm dd'); // set the next and previous months dates["firstOfThisWeek"] = firstOfThisWeek; dates["lastOfThisWeek"] = lastOfThisWeek; dates["firstOfLastWeek"] = firstOfLastWeek; dates["firstOfNextWeek"] = firstOfNextWeek; dates["formattedThisWeek"] = formattedThisWeek; dates["formattedLastWeek"] = formattedLastWeek; dates["formattedNextWeek"] = formattedNextWeek; return dates; var formID = getCalendarFormID(); var rtnString = ""; var i = ""; var eventItm = ""; var eventArray = Arraynew(1); var itm = ""; var toolTipContent = ""; var newEventStr = ""; var timeStr = ""; var iconImgStr = ""; var eventDetailLink = ""; var eventID = ""; var eventTypeClassList = ""; var detailURL = ""; var showEventTime = false; var showEventLocation = false; var showEventCategoryIcons = true; var categoryArray = ArrayNew(1); var iconStruct = StructNew(); var icn = ""; //var showNoEventsText = false; //var noEventsListedText = "No events listed for this date"; if ( LEN(TRIM(arguments.detailPageURL)) ) detailURL = TRIM(arguments.detailPageURL); if ( structKeyExists(arguments.detailTextOptions,"showTime") AND detailTextOptions.showTime IS true ) showEventTime = true; if ( structKeyExists(arguments.detailTextOptions,"showLocation") AND detailTextOptions.showLocation IS true ) showEventLocation = true; if ( structKeyExists(arguments.detailTextOptions,"showLocation") AND detailTextOptions.showLocation IS true ) showEventLocation = true; if ( structKeyExists(arguments.detailTextOptions,"showCategoryIcons") AND detailTextOptions.showCategoryIcons IS true ) showEventCategoryIcons = true; /* if ( structKeyExists(arguments.detailTextOptions,"showNoEvents") AND detailTextOptions.showNoEvents IS true ) showNoEventsText = true; */ /* if ( structKeyExists(arguments.detailTextOptions,"noEventsText") AND LEN(TRIM(detailTextOptions.noEventsText)) ) noEventsListedText = detailTextOptions.noEventsText; */ // Grab the Days events from the calendarData and Put in a new eventArray for (i=1;i LTE ListLen(arguments.indexList); i=i+1) { eventItm = ListGetAt(arguments.indexList, i); eventArray[i] = arguments.calendarData[eventItm]; } // Sort the eventArray by starttime eventArray = application.ptCalendar2.ceData.arrayOfCEDataSort(eventArray,"starttime","asc","time",".","eventdate"); #timeFormat(eventArray[itm].Values.startTime, "h:mm tt")# - #timeFormat(eventArray[itm].Values.endTime, "h:mm tt")#
#timeStr#
#eventArray[itm].Values.location#
var catList = arguments.catTyleList; var classList = ""; var i = 1; var classItemPrefix = "catType-"; if ( LEN(TRIM(catList)) ) { for (i=1;i LTE ListLen(catList); i=i+1) { catItem = classItemPrefix & stripEventTypeChars(ListGetAt(catList, i)); classList = ListAppend(classList, catItem, " "); } } return classList; var stripName = ""; if ( LEN(TRIM(arguments.itemName)) ) stripName = TRIM(LCASE(REReplace(arguments.itemName,"[\W]+","","ALL"))); //stripName = TRIM(LCASE(REReplace(arguments.itemName,"[^A-Za-z_-]","","ALL"))); return stripName; var formID = getCalendarFormID(); var eventStruct = arguments.eventData; var toolTipStr = ""; var detailURL = ""; var linkStr = ""; var timeStr = ""; var contactStr = ""; if ( LEN(TRIM(arguments.detailPageURL)) ) detailURL = TRIM(arguments.detailPageURL);

#iconImgStr# #eventStruct.Values.title#

#eventStruct.Values.category#
    #timeFormat(eventStruct.Values.startTime, "h:mm tt")# - #timeFormat(eventStruct.Values.endTime, "h:mm tt")#
  • Time: #timeStr#
  • Location: #eventStruct.Values.location#
  • #eventStruct.Values.contactName#
    #eventStruct.Values.contactPhone#
  • Contact: #contactStr#

Description:
#eventStruct.Values.description#