var outString = ""; var firstDay = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = application.ptCalendar.date.calculateMonthsYears(inDate=firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var hDay = 1; var eventDataList = ""; var appConfig = getAppConfig(); var viewLinkData = StructNew(); var qParamDelimiter = "?"; var height = 24; var width = 30; var currentDayClass = "month-grid-small-day-current"; var eventDayClass = "month-grid-small-day-event"; var standardDayClass = "month-grid-small-day-standard"; var dayHeaderClass = "month-grid-small-subheader"; var prevNextClass = "month-grid-small-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 currentView = application.ptCalendar.defaultView; var monthlabelLink = cgi.script_name; var nextPrevLink = cgi.script_name; var viewParamName = application.ptCalendar.viewParamName; var gridLabelTxt = DateFormat(firstDay, 'mmmm yyyy'); var gridLabelLink = ""; var gridPrevLink = ""; var gridNextLink = ""; // Get Grid Cell Width if ( structKeyExists(appConfig,"calendar_small_grid_cell_width") AND LEN(TRIM(appConfig['calendar_small_grid_cell_width'])) ) width = appConfig['calendar_small_grid_cell_width']; // Get Grid Cell Height if ( structKeyExists(appConfig,"calendar_small_grid_cell_height") AND LEN(TRIM(appConfig['calendar_small_grid_cell_height'])) ) height = appConfig['calendar_small_grid_cell_height']; // Get the view link data structure if ( application.ptCalendar.viewPageMode EQ "Single" ) { if ( LEN(TRIM(arguments.linkedPage)) ) viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(pageURL=arguments.linkedPage); else viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(); // Reset the query param initial delimiter to & qParamDelimiter = "&"; // update the nextPrevLink URL ... for the Small Grid Calendar keep the current calendar view if ( StructKeyExists(request.params,viewParamName) ) currentView = request.params[viewParamName]; nextPrevLink = nextPrevLink & "?" & viewParamName & "=" & currentView; } else { if ( LEN(TRIM(arguments.linkedSubsite)) ) viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(subsiteID=linkedSubsite); else viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(); } // Set Page Mapping Variables if( structKeyExists(viewLinkData, "detailPage") and len(viewLinkData.detailPage) ) detailLink = viewLinkData.detailPage; if( structKeyExists(viewLinkData, "dailyPage") and len(viewLinkData.dailyPage) ) dailyLink = viewLinkData.dailyPage; if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) ) weeklyListLink = viewLinkData.weeklyListPage; if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) ) weeklyGridLink = viewLinkData.weeklyGridPage; if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) ) monthlyListLink = viewLinkData.monthlyListPage; if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) ) monthlyGridLink = viewLinkData.monthlyGridPage; // Get the Default Calendar View Link to use for the MonthLableLink monthlabelLink = monthlyGridLink; defaultViewPageVar = application.ptcalendar.calRenderViewDAO.getCalendarDefaultViewPageVar(); if( structKeyExists(viewLinkData,defaultViewPageVar) and LEN(TRIM(viewLinkData[defaultViewPageVar])) ) monthlabelLink = viewLinkData[defaultViewPageVar]; // Build the Grid Header Nav Links gridLabelLink = "#monthlabelLink##qParamDelimiter#day=1&month=#arguments.curMonth#&year=#arguments.curYear#&clicked=1"; gridPrevLink = "#nextPrevLink##qParamDelimiter#month=#dates.lastMonth#&year=#dates.lastYear#&clicked=1"; gridNextLink = "#nextPrevLink##qParamDelimiter#month=#dates.nextMonth#&year=#dates.nextYear#&clicked=1"; // TODO: replace with the app settings data /* // determine some of the default rendering properties if( structKeyExists(metadata, "calendarProps") ) { 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; }*/ // END TODO // 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][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 = application.ptCalendar.date.createValidDate(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 application.ptCalendar.date.createValidDate(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 & "
#buildMonthGridHeaderNavSmall(labelText=gridLabelTxt,labelLink=gridLabelLink,prevLink=gridPrevLink,nextLink=gridNextLink)#
#Left(DayOfWeekAsString(hDay), 1)#
 
#dayText#
 
"; return outString;
var outString = ""; var firstDay = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = application.ptCalendar.date.calculateMonthsYears(inDate=firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var hDay = 1; var eventDataStruct = structNew(); var appConfig = getAppConfig(); var viewLinkData = StructNew(); var qParamDelimiter = "?"; 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 uiTheme = getUItheme(); var useEventToolTip = getUseToolTipStatus(); var qTipStyleName = getToolTipTheme(); var eventDetailOptions = StructNew(); var gridLabelTxt = DateFormat(firstDay, 'mmmm yyyy'); var gridLabelLink = ""; var gridPrevLink = ""; var gridNextLink = ""; // Set the Event Detailed Day Text Options to pass to the BuildDetailedDayText function eventDetailOptions.showTime = false; eventDetailOptions.showLocation = false; eventDetailOptions.showCategoryIcons = true; // Get Grid Cell Width if ( structKeyExists(appConfig,"calendar_large_grid_cell_width") AND LEN(TRIM(appConfig['calendar_large_grid_cell_width'])) ) width = appConfig['calendar_large_grid_cell_width']; // Get Grid Cell Height if ( structKeyExists(appConfig,"calendar_large_grid_cell_height") AND LEN(TRIM(appConfig['calendar_large_grid_cell_height'])) ) height = appConfig['calendar_large_grid_cell_height']; // Set Page Mapping Variables if ( !arguments.showAdminTools ) { // Get the view link data structure if ( application.ptCalendar.viewPageMode EQ "Single" ) { viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(); qParamDelimiter = "&"; } else { viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(); } if( structKeyExists(viewLinkData, "detailPage") and len(viewLinkData.detailPage) ) detailLink = viewLinkData.detailPage; if( structKeyExists(viewLinkData, "dailyPage") and len(viewLinkData.dailyPage) ) dailyLink = viewLinkData.dailyPage; if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) ) weeklyListLink = viewLinkData.weeklyListPage; if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) ) weeklyGridLink = viewLinkData.weeklyGridPage; if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) ) monthlyListLink = viewLinkData.monthlyListPage; if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) ) monthlyGridLink = viewLinkData.monthlyGridPage; // set the nextPrevLink to the current view link nextPrevLink = monthlyGridLink; // Build the Grid Header Nav Links gridLabelLink = "#monthlyGridLink##qParamDelimiter#day=1&month=#arguments.curMonth#&year=#arguments.curYear#&clicked=1"; gridPrevLink = "#nextPrevLink##qParamDelimiter#month=#dates.lastMonth#&year=#dates.lastYear#&clicked=1"; gridNextLink = "#nextPrevLink##qParamDelimiter#month=#dates.nextMonth#&year=#dates.nextYear#&clicked=1"; } // Admin Tools specific settings if ( arguments.showAdminTools ) { // override for the config Tool tip setting useEventToolTip = true; formID = getCalEventDetailsFormID(); } // TODO: replace with the app settings data /* // determine some of the default rendering properties if( structKeyExists(metadata, "calendarProps") ) { 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; }*/ // END TODO // 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][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.ptCalendar.scripts.loadJQuery(); #buildEventToolTipScript(showAdminTools=arguments.showAdminTools)# #buildAdminToolsScript()#
// if it isn't sunday, then we need to 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 = application.ptCalendar.date.createValidDate(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 application.ptCalendar.date.createValidDate(year(now()),month(now()),day(now())) ) classTxt = ' class="#currentDayClass#"'; // has event for this date if ( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { classTxt = ' class="calEventDayCell #eventDayClass#"'; if ( !arguments.showAdminTools ) dayText = '#dayText#'; } // Add the ADD new link if Admin Tools are needed if ( arguments.showAdminTools ) dayText = dayText & ''; //+Event /*  */ if ( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { detailedDayText = buildDetailedDayTextGrid(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip,eventDetailOptions,arguments.showAdminTools); 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 & ""; } } // Calendar Table End outString=outString & "
align="center"> #buildMonthGridHeaderNav(labelText=gridLabelTxt,labelLink=gridLabelLink,prevLink=gridPrevLink,nextLink=gridNextLink)# #gridLabelTxt#
#Left(DayOfWeekAsString(hDay), 3)#
 
#dayText#
 
"; // calendarWrapper END outString=outString & "
"; return outString;
var outString = ""; var firstDay = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, 1); // retrieve the next/last month and year dates var dates = application.ptCalendar.date.calculateMonthsYears(inDate=firstDay); var firstDayDigit = DayOfWeek(FirstDay); var itm = 1; var i = 1; var h = 1; var eventDataStruct = structNew(); var eventCounter = 0; var currentDate = application.ptCalendar.date.createValidDate(year(now()),month(now()),day(now())); var isThisDatePastDate = true; var appConfig = getAppConfig(); var viewLinkData = StructNew(); var qParamDelimiter = "?"; 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 pastEventsDayClass = "calPastEventListWrapper"; var pastDayTextPreText = '
'; var pastDayTextPostText = '
'; 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 collapseCurrMonthPastEvents = getCollapseCurrentMonthsPastEventsStatus(); var useEventToolTip = getUseToolTipStatus(); var qTipStyleName = getToolTipTheme(); var eventDetailOptions = StructNew(); var listLabelTxt = "Events List for #DateFormat(firstDay,'mmmm yyyy')#"; var listLabelLink = ""; var listPrevTxt = "<< #monthAsString(dates.lastMonth)# #dates.lastYear#"; var listPrevLink = ""; var listNextTxt = "#monthAsString(dates.nextMonth)# #dates.nextYear# >>"; var listNextLink = ""; // Set the Event Detailed Day Text Options to pass to the BuildDetailedDayText function eventDetailOptions.showTime = true; eventDetailOptions.showLocation = true; eventDetailOptions.showCategoryIcons = true; // Get the view link data structure if ( application.ptCalendar.viewPageMode EQ "Single" ) { viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(); qParamDelimiter = "&"; } else { viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(); } if( structKeyExists(viewLinkData, "detailPage") and len(viewLinkData.detailPage) ) detailLink = viewLinkData.detailPage; if( structKeyExists(viewLinkData, "dailyPage") and len(viewLinkData.dailyPage) ) dailyLink = viewLinkData.dailyPage; if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) ) weeklyListLink = viewLinkData.weeklyListPage; if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) ) weeklyGridLink = viewLinkData.weeklyGridPage; if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) ) monthlyListLink = viewLinkData.monthlyListPage; if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) ) monthlyGridLink = viewLinkData.monthlyGridPage; // set the nextPrevLink to the current view link nextPrevLink = monthlyListLink; // Build the List Header Nav Links listPrevLink = "#nextPrevLink##qParamDelimiter#month=#dates.lastMonth#&year=#dates.lastYear#&clicked=1"; listNextLink = "#nextPrevLink##qParamDelimiter#month=#dates.nextMonth#&year=#dates.nextYear#&clicked=1"; // 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][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); } if ( !arrayLen(arguments.calendarData) ) collapseCurrMonthPastEvents = false;
application.ptCalendar.scripts.loadJQuery(); #buildEventToolTipScript()#
#buildMonthListHeaderNav(labelText=listLabelTxt,prevText=listPrevTxt,nextText=listNextTxt,prevLink=listPrevLink,nextLink=listNextLink)#
Show Past Events
// Start to build the Calender List //outString = outString & "
"; 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 = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, i); // Determine if the rendered date occurred in the past isThisDatePastDate = false; if ( IsDate(thisDate) AND DateCompare(currentDate,thisDate,"d") EQ 1 ) isThisDatePastDate = true; //determine the class for the current day or if the day has an event if ( isThisDatePastDate ) { dayclassTxt = ' class="#standardDayClass# calPastEventsDayWrapper"'; dayHeaderClassTxt = ' class="calEventListHeader #eventDayHeaderClass# calPastDayHeader"'; } else if ( thisDate EQ currentDate ) { // todays date dayclassTxt = ' class="#currentDayClass#"'; dayHeaderClassTxt = ' class="calEventListHeader #eventDayHeaderClass#"'; } else { dayclassTxt = ' class="#standardDayClass#"'; dayHeaderClassTxt = ' class="calEventListHeader #eventDayHeaderClass#"'; } dayText = ""; // has event for this date if ( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { dayText = '#DateFormat(thisDate,"full")#
'; detailedDayText = buildDetailedDayTextList(calendarData=arguments.calendarData,eventField=arguments.eventField,indexList=eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailPageURL=detailLink,useTooltips=useEventToolTip,detailTextOptions=eventDetailOptions,flagPastEvents=isThisDatePastDate); if ( isThisDatePastDate ) dayText = dayText & pastDayTextPreText & detailedDayText & pastDayTextPostText; else 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 & ""; // calendarWrapper END outString=outString & ""; return outString;
var refDay = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, arguments.curDay); // retrieve the date struct for the surrounding weeks var weekStruct = application.ptCalendar.date.calculateWeekDates(inDate=refDay); var outString = ""; var itm = 1; var i = 1; var h = 1; var hDay = 1; var eventDataStruct = StructNew(); var appConfig = getAppConfig(); var viewLinkData = StructNew(); var qParamDelimiter = "?"; var height = 150; var width = 130; var currentDayClass = "week-grid-day-current"; var eventDayClass = "week-grid-day-event"; var standardDayClass = "week-grid-day-standard"; var dayHeaderClass = "week-grid-subheader"; var prevNextClass = "week-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 useEventToolTip = getUseToolTipStatus(); var qTipStyleName = getToolTipTheme(); var eventDetailOptions = StructNew(); var gridLabelTxt = "Week of #weekStruct.formattedThisWeek#"; var gridLabelLink = ""; var gridPrevTxt = "<< Week of #dateFormat(weekStruct.formattedLastWeek,"mmmm dd")#"; var gridPrevLink = ""; var gridNextTxt = "Week of #dateFormat(weekStruct.formattedNextWeek,"mmmm dd")# >>"; var gridNextLink = ""; // Set the Event Detailed Day Text Options to pass to the BuildDetailedDayText function eventDetailOptions.showTime = false; eventDetailOptions.showLocation = false; eventDetailOptions.showCategoryIcons = true; // Get the view link data structure if ( application.ptCalendar.viewPageMode EQ "Single" ) { viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(); qParamDelimiter = "&"; } else { viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(); } if( structKeyExists(viewLinkData, "detailPage") and len(viewLinkData.detailPage) ) detailLink = viewLinkData.detailPage; if( structKeyExists(viewLinkData, "dailyPage") and len(viewLinkData.dailyPage) ) dailyLink = viewLinkData.dailyPage; if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) ) weeklyListLink = viewLinkData.weeklyListPage; if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) ) weeklyGridLink = viewLinkData.weeklyGridPage; if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) ) monthlyListLink = viewLinkData.monthlyListPage; if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) ) monthlyGridLink = viewLinkData.monthlyGridPage; // set the nextPrevLink to the current view link nextPrevLink = weeklyGridLink; // Build the Grid Header Nav Links gridPrevLink = "#nextPrevLink##qParamDelimiter#clicked=1&day=#day(weekStruct.firstOfLastWeek)#&month=#month(weekStruct.firstOfLastWeek)#&year=#year(weekStruct.firstOfLastWeek)#"; gridNextLink = "#nextPrevLink##qParamDelimiter#clicked=1&day=#day(weekStruct.firstOfNextWeek)#&month=#month(weekStruct.firstOfNextWeek)#&year=#year(weekStruct.firstOfNextWeek)#"; // 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][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.ptCalendar.scripts.loadJQuery(); #buildEventToolTipScript()#
#buildWeekGridHeaderNav(labelText=gridLabelTxt,prevText=gridPrevTxt,nextText=gridNextTxt,prevLink=gridPrevLink,nextLink=gridNextLink)# 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 = application.ptCalendar.date.createValidDate(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 application.ptCalendar.date.createValidDate(year(now()),month(now()),day(now())) ) classTxt = ' class="#currentDayClass#"'; // has event for this date if ( structKeyExists(eventDataStruct, dateFormat(thisDate, 'yyyymmdd')) ) { classTxt = ' class="calEventDayCell #eventDayClass#"'; dayText = '#dateFormat(thisDate, 'd')#'; detailedDayText = buildDetailedDayTextGrid(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip,eventDetailOptions); dayText = dayText & detailedDayText; } // output the day cell outString = outString & " "; } outString = outString & ""; outString = outString & "
#Left(DayOfWeekAsString(hDay), 3)#
#dayText#
"; // calendarWrapper END outString = outString & "
"; return outString;
var refDay = application.ptCalendar.date.createValidDate(arguments.curYear, arguments.curMonth, arguments.curDay); // retrieve the date struct for the surrounding weeks var weekStruct = application.ptCalendar.date.calculateWeekDates(inDate=refDay); var outString = ""; var i = 1; var itm = 1; var h = 1; var eventDataStruct = structNew(); var eventCounter = 0; var appConfig = getAppConfig(); var viewLinkData = StructNew(); var qParamDelimiter = "?"; var weekWrapperClass = "week-list-wrapper"; var currentDayClass = "week-list-day-current"; var eventDayHeaderClass = "week-list-day-header"; var standardDayClass = "week-list-day-standard"; var eventDayClass = "week-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 useEventToolTip = getUseToolTipStatus(); var qTipStyleName = getToolTipTheme(); var eventDetailOptions = StructNew(); var listLabelTxt = "Week of #weekStruct.formattedThisWeek#"; var listLabelLink = ""; var listPrevTxt = "<< Week of #dateFormat(weekStruct.formattedLastWeek,"mmmm dd")#"; var listPrevLink = ""; var listNextTxt = "Week of #dateFormat(weekStruct.formattedNextWeek,"mmmm dd")# >>"; var listNextLink = ""; // Set the Event Detailed Day Text Options to pass to the BuildDetailedDayText function eventDetailOptions.showTime = true; eventDetailOptions.showLocation = true; eventDetailOptions.showCategoryIcons = true; if ( application.ptCalendar.viewPageMode EQ "Single" ) { viewLinkData = application.ptCalendar.calRenderViewService.getCalViewPageStruct(); qParamDelimiter = "&"; } else { viewLinkData = application.ptCalendar.calPageMapDAO.getCalPageMapStruct(); } if( structKeyExists(viewLinkData, "detailPage") and len(viewLinkData.detailPage) ) detailLink = viewLinkData.detailPage; if( structKeyExists(viewLinkData, "dailyPage") and len(viewLinkData.dailyPage) ) dailyLink = viewLinkData.dailyPage; if( structKeyExists(viewLinkData, "weeklyListPage") and len(viewLinkData.weeklyListPage) ) weeklyListLink = viewLinkData.weeklyListPage; if( structKeyExists(viewLinkData, "weeklyGridPage") and len(viewLinkData.weeklyGridPage) ) weeklyGridLink = viewLinkData.weeklyGridPage; if( structKeyExists(viewLinkData, "monthlyListPage") and len(viewLinkData.monthlyListPage) ) monthlyListLink = viewLinkData.monthlyListPage; if( structKeyExists(viewLinkData, "monthlyGridPage") and len(viewLinkData.monthlyGridPage) ) monthlyGridLink = viewLinkData.monthlyGridPage; // set the nextPrevLink to the current view link nextPrevLink = weeklyListLink; // Build the List Header Nav Links listPrevLink = "#nextPrevLink##qParamDelimiter#clicked=1&day=#day(weekStruct.firstOfLastWeek)#&month=#month(weekStruct.firstOfLastWeek)#&year=#year(weekStruct.firstOfLastWeek)#"; listNextLink = "#nextPrevLink##qParamDelimiter#clicked=1&day=#day(weekStruct.firstOfNextWeek)#&month=#month(weekStruct.firstOfNextWeek)#&year=#year(weekStruct.firstOfNextWeek)#"; // 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][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.ptCalendar.scripts.loadJQuery(); //if ( useEventToolTip IS true ) // application.ptCalendar.scripts.loadQTip(version='1.0'); #buildEventToolTipScript()#
#buildWeekListHeaderNav(labelText=listLabelTxt,prevText=listPrevTxt,nextText=listNextTxt,prevLink=listPrevLink,nextLink=listNextLink)# // Start to build the Calender List //outString = outString & "
"; 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 = application.ptCalendar.date.createValidDate(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="calEventListHeader #eventDayHeaderClass#"'; dayText = DateFormat(thisDate,"full"); // todays date if ( thisDate eq application.ptCalendar.date.createValidDate(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 = buildDetailedDayTextList(arguments.calendarData,arguments.eventField,eventDataStruct[dateFormat(thisDate, 'yyyymmdd')],detailLink,useEventToolTip,eventDetailOptions); dayText = dayText & detailedDayText; } else { dayText = '#dayText#
'; detailedDayText = '
No events listed for this date
'; detailedDayText = detailedDayText & '
'; 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 & ""; // calendarWrapper END outString=outString & ""; return outString;
var gridNavStr = ""; var gridNavStr = ""; var gridNavStr = "";

#arguments.labelText#

var listNavStr = "";

#arguments.labelText#

var listNavStr = "";

#arguments.labelText#

var appConfig = getAppConfig(); var uiTheme = getUItheme(); var rtnString = ""; var i = ""; var eventItm = ""; var eventArray = ArrayNew(1); var categoryArray = ArrayNew(1); var itm = ""; var icn = ""; var toolTipContent = ""; var newEventStr = ""; var timeStr = ""; var iconImgStr = ""; var iconStruct = StructNew(); var eventDetailLink = ""; var qParamDelimiter = "?"; //var eventID = ""; //var UID = ""; //var UIDvarName = ""; var currentDate = application.ptCalendar.date.createValidDate(year(now()),month(now()),day(now())); var isThisEventPast = false; var eventTypeClassList = ""; var detailURL = ""; var showEventTime = false; var showEventLocation = false; var showEventCategoryIcons = true; var actionApp = getAppBeanName(); var actionForms = "calEventsForms"; var eventCatIconClass = "calEventGridCatIcon"; //var showNoEventsText = false; //var noEventsListedText = "No events listed for this date"; if ( application.ptCalendar.viewPageMode EQ "Single" ) qParamDelimiter = "&"; if ( LEN(TRIM(arguments.detailPageURL)) ) detailURL = TRIM(arguments.detailPageURL); if ( structKeyExists(arguments.detailTextOptions,"showTime") ) showEventTime = detailTextOptions.showTime; if ( structKeyExists(arguments.detailTextOptions,"showLocation") ) showEventLocation = detailTextOptions.showLocation; if ( structKeyExists(arguments.detailTextOptions,"showCategoryIcons") ) showEventCategoryIcons = detailTextOptions.showCategoryIcons; /* 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; */ // Determine if this event as occurred int he past if ( IsDate(thisDate) AND DateCompare(currentDate,thisDate,"d") EQ 1 ) isThisEventPast = true; // 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]; } // Check if we have data to sort if ( ArrayLen(eventArray) ) { // Sort the retArray by eventDate, AllDay and StartTime eventArray = application.ptCalendar.data.arrayOfStructsSortMultiKeys( aOfS=eventArray ,orderByKeyList="eventDate,AllDay DESC,StartTime" ); } #categoryArray[icn].values.name# [ALL DAY] #timeFormat(eventArray[itm].startTime, "h:mm tt")# - #timeFormat(eventArray[itm].endTime, "h:mm tt")#
#timeStr#
Location: #eventArray[itm].location#
#application.ptCalendar.ui.buildLightboxProxyLink( linkTitle="Edit Event" ,bean=actionForms ,method="renderEditTypeConfirmHTMLForm" ,urlParams=urlPamams ,lbTitle="Edit Event" ,linkClass="calendar-event-remove ui-icon ui-icon-pencil" ,appName=actionApp ,uiTheme=uiTheme ,linkText="" )# #application.ptCalendar.ui.buildLightboxProxyLink( linkTitle="Delete Event" ,bean=actionForms ,method="renderDeleteTypeConfirmHTMLForm" ,urlParams=urlPamams ,lbTitle="Delete Event" ,linkClass="calendar-event-remove ui-icon ui-icon-trash" ,appName=actionApp ,uiTheme=uiTheme ,linkText="" )#  
var toolTipScriptStr = ""; var ADFminVersionForQTip2 = "1.6.2"; var ADFversionCompare = application.ptCalendar.utils.versionCompare(versionA=application.ADF.version,versionB=ADFminVersionForQTip2); var uiTheme = getUItheme(); var qTipStyleName = getToolTipTheme(); var useUItheme = false; if ( qTipStyleName EQ "UI" OR arguments.showAdminTools ) useUItheme = true; application.ptCalendar.scripts.loadJQuery(); if ( useUItheme ) application.ptCalendar.scripts.loadJQueryUI(themeName=uiTheme); if ( ADFversionCompare GTE 0 ) { application.ptCalendar.scripts.loadQTip(); application.ptCalendar.scripts.loadJQueryImagesLoaded(); } else { application.ptCalendar.scripts.loadQTip(version='1.0'); } //var formID = getCalendarFormID(); var eventStruct = arguments.eventData; var toolTipStr = ""; var detailURL = ""; var eventDetailLink = ""; var cfDateDisplayMask = application.ptCalendar.getDisplayCFdateMask(); // "M/D/YYYY" - DATE FORMAT FOR DISPLAY var cfTimeDisplayMask = application.ptCalendar.getDisplayCFtimeMask(); // "h:mm tt" - TIME FORMAT FOR DISPLAY // Cat String and Icon Variables var iconImgStr = ""; var catName = ""; var iconStruct = StructNew(); var cat = 0; var icn = 0; var catTextStr = ""; var orgTextStr = ""; // Time String Variables var timeStr = ""; // Contact String Variables var contactStr = ""; var descriptText = ""; var descriptMaxWordCnt = getToolTipDescriptionMaxWordCount(); var qParamDelimiter = "?"; if ( application.ptCalendar.viewPageMode EQ "Single" ) qParamDelimiter = "&"; if ( LEN(TRIM(arguments.detailPageURL)) ) detailURL = TRIM(arguments.detailPageURL); // Build the event details link with URL params for the occurrence // There may be many Event Records with the the same calEventID (recurring events or an event with multiple date times) // - Each ocurrence of a recurring event gets a unique dtHashID // - Each "date/time" record for an event gets a unique dateTimeID eventDetailLink = buildEventDetailsLinkURL(eventDataStruct=eventData,detailsLinkURL=detailURL);
#catName#
- #categoryArray[cat].values.name#
[ALL DAY] #timeFormat(eventStruct.startTime, cfTimeDisplayMask)# - #timeFormat(eventStruct.endTime, cfTimeDisplayMask)#
#eventStruct.contactName#
#eventStruct.contactPhone#

#iconImgStr# #titleText#  [R*]  [R]

  • Time: #timeStr#
  • Location: #locationStr#
  • Contact: #contactStr#
  • Categories: #catTextStr#
  • Organizations: #orgTextStr#
  • --->

#descriptText#

var linkParams = buildEventDetailsLinksParams(eventDataStruct=arguments.eventDataStruct); var retStr = buildLinkParamURL( linkURL=arguments.detailsLinkURL ,linkParamName=linkParams.UIDvarName ,linkParamValue=linkParams.UIDvalue ,urlParams=arguments.urlParams ); return retStr; var retData = StructNew(); retData.UIDvalue = ""; retData.UIDvarName = ""; retData.UIDstring = ""; // Build the event details URL params for the occurrence // There may be many Event Records with the the same calEventID (recurring events or an event with multiple date times) // - Each ocurrence of a recurring event gets a unique dtHashID // - Each static "date/time" record for an event gets a unique dateTimeID if ( StructKeyExists(arguments.eventDataStruct,"dtHashID") AND LEN(TRIM(arguments.eventDataStruct.dtHashID)) ) { retData.UIDvalue = arguments.eventDataStruct.dtHashID; retData.UIDvarName = "oid"; } else if ( StructKeyExists(arguments.eventDataStruct,"dateTimeID") AND LEN(TRIM(arguments.eventDataStruct.dateTimeID)) ) { retData.UIDvalue = arguments.eventDataStruct.dateTimeID; retData.UIDvarName = "dtid"; } retData.UIDstring = "eid-" & retData.UIDvarName & "-" & retData.UIDvalue; return retData; var retStr = ""; var uParams = ""; var qDelimiter = "?"; // If the linkURL already has a "?" set the query param delimiter to an & if ( Find("?",arguments.linkURL,1) ) qDelimiter = "&"; if ( LEN(TRIM(arguments.urlParams)) ) { uParams = TRIM(arguments.urlParams); if ( Find("&",uParams,"1") NEQ 1 ) uParams = "&" & uParams; } retStr = arguments.linkURL & qDelimiter & arguments.linkParamName & "=" & arguments.linkParamValue & uParams; return retStr; var adminScriptStr = ""; var uiTheme = getUItheme(); var newEventlbTitle="Add New Event"; var newEventlbAction = "refreshparent"; var eventAddBean = "calEventsForms"; var eventAddMethod = "renderEventEditForm"; var formid = 0; application.ptCalendar.scripts.loadJQuery(); application.ptCalendar.scripts.loadJQueryUI(themeName=uiTheme); application.ptCalendar.scripts.loadADFLightbox(); var catList = arguments.catTypeList; var classList = ""; var i = 1; var classItemPrefix = application.ptCalendar.getCatItemPrefix(); //"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"))); return stripName;