var reHTML = ""; var recurID = arguments.recurrenceID; var processAction = arguments.action; // Defualt process action: edit var appConfig = getAppConfig(); var uiTheme = getUItheme(); var timePickerType = "UItimepickerAddon"; var timePickerFormat = "h:mm TT"; var dataArray = ArrayNew(1); var currData = StructNew(); var actionApp = getAppBeanName(); var actionBean = "recurrenceBuilderController"; var actionMethod = "processRecurrenceForm"; var actionURL = application.ADF.lightboxProxy; var submitStatusICON = ""; var submitStatusHTML = submitStatusICON & " Processing..."; var endTimeRequired = getEndTimeRequiredStatus(); var recurPatternTypeList = "Daily,Weekly,Monthly,Yearly"; var recurPatternOptionList = "EveryXDays,EveryWeekday,WeeklyDays,MonthlyDayX,MonthlyXY,YearlyXY,YearlyXYofZ"; var recurRangeEndTypeOptions = "EndQuantity,EndDate"; //TODO: "NoEnd" - for advanced outlook style options //var recurWeekOrdinalList = "first,second,third,fourth,last"; //TODO: for advanced outlook style options var recurWeekOrdinalList = "first,last"; //var recurMonthlyDayOptions = "day,weekday,weekend day"; //TODO: for advanced outlook style options var cfDateFormatMask = getDisplayCFdateMask(); var cfTimeFormatMask = getDisplayCFtimeMask(); var jsDateFormatMask = 'm/d/yy'; // TODO: move to APP.cfc or to the Config element var jsTimeFormatMask = ''; // TODO: move to APP.cfc or to the Config element var dummyDate = getTimeDummyDate(); // Get from the App so all time fields use the same dummy date in date/time stamp var dummyDayBeginTime = getDayBeginTime(); // Get from the App so all date fields use the same dummy time in date/time stamp var dummyDayEndTime = getDayEndTime(); // Get from the App so all date fields use the same dummy time in date/time stamp var dateFieldSize = 12; var timeFieldSize = 12; // loop indexes var rpt = ''; var dow = 1; var wol = ''; var mdo = ''; var mdow = 1; var mth = 1; var ywmn = ''; var ymdo = ''; var ydow = 1; var ymth = 1; /* Set up Date, Time and Recurrence defualts */ var currDate = application.ptCalendar.date.createValidDate(year(arguments.defaultDate),month(arguments.defaultDate),day(arguments.defaultDate)); //now() var currDateTime = CreateDateTime(year(currDate),month(currDate),day(currDate),hour(now()),minute(now()),second(0)); var currentDayOfWeek = DayOfWeek(currDateTime); var currentDayOfWeekString = DayOfWeekAsString(currentDayOfWeek); var currentDayOfMonth = Day(currDateTime); var currentMonth = Month(currDateTime); var currentMonthString = MonthAsString(currentMonth); var currentWeekInMonth = application.ptCalendar.date.weekInMonth(inDate=currDateTime); var currentWeekInMonthOrdinal = application.ptCalendar.data.numberToOrdinal(number=currentWeekInMonth); var nextHour = DateAdd("h",1,CreateTime(hour(currDateTime), 0, 0)); var nextStartTimeValue = TimeFormat(nextHour,cfTimeFormatMask); var nextEndTimeValue = TimeFormat(DateAdd("h",1,nextStartTimeValue),cfTimeFormatMask); //var nextEndTimeValue = TimeFormat(DateAdd("n",30,nextStartTimeValue),cfTimeFormatMask); // half hour setting var nextAllDayValue = 0; // Time Details Defaults var selectedStartTimeValue = nextStartTimeValue; var selectedEndTimeValue = nextEndTimeValue; var selectedAllDayValue = nextAllDayValue; // Pattern Defaults var selectedPatternType = "Weekly"; var selectedPatternOption = "WeeklyDays"; // "WeeklyDays" only option for "weekly" type // Pattern - Daily Defaults var selectedPatternDayQty = 1; // Pattern - Weekly Defaults var selectedPatternWeekQty = 1; var selectedDayOfWeek = currentDayOfWeek; // Pattern - Monthly Defaults var selectedPatternMonthQty = 1; var selectedMonthlyDayNumber = currentDayOfMonth; var selectedMonthlyDayOrdinal = currentWeekInMonthOrdinal; //var selectedMonthlyWeekDay = currentDayOfWeekString; //TODO: for advanced outlook style options var selectedMonthlyWeekDay = "day"; // Pattern - Yearly Defaults var selectedPatternYearQty = 1; var selectedYearlyMonth = currentMonth; var selectedYearlyDayNumber = currentDayOfMonth; var selectedYearlyDayOrdinal = currentWeekInMonthOrdinal; //var selectedYearlyWeekDay = currentDayOfWeekString; //TODO: for advanced outlook style options var selectedYearlyWeekDay = "day"; var selectedYearlyWeekDayMonth = currentMonth; // Range Defaults var selectedRangeEndType = "EndDate"; // TODO: "NoEnd" - for advanced outlook style options var selectedStartDateValue = DateFormat(currDateTime,cfDateFormatMask); // TODO: add date format to Config element var selectedEndQtyOccurences = 10; var selectedEndDateValue = DateFormat(DateAdd("m",1,selectedStartDateValue),cfDateFormatMask); // TODO: Add date format to Config element // Set the Max Week In Month number ( from the first, second, third, fourth, last ) // This logic is for advanced outlook style options /* if ( currentWeekInMonth GTE 5 ) { currentWeekInMonth = 5; // Set the Week In Month string value from the MAX week in month value currentWeekInMonthOrdinal = ListGetAt(recurWeekOrdinalList,currentWeekInMonth); // Reset the selected default from the new current week in month ordinal selectedMonthlyDayOrdinal = currentWeekInMonthOrdinal; selectedYearlyDayOrdinal = currentWeekInMonthOrdinal; } */ // Since we are now only doing "first,last" just use the first item in the list for a default value selectedMonthlyDayOrdinal = ListFirst(currentWeekInMonthOrdinal); selectedYearlyDayOrdinal = ListFirst(currentWeekInMonthOrdinal); // Get the recurrence data for the passed in recurrenceID if ( LEN(TRIM(recurID)) ) { // Get the recurrence data by the recurrenceID (uniqueID) dataArray = application.ptCalendar.recurrenceBuilderDAO.getRecurrence(uniqueID=recurID); } // if recurID is does not return any data then override the process action and set a new recurID if ( NOT ArrayLen(dataArray) ) { recurID = CreateUUID(); processAction = "add"; } // if data exists OVERRIDE the defualt value if ( ArrayLen(dataArray) AND StructKeyExists(dataArray[1],"values") ) { currData = dataArray[1].values; // Recurrence Details Existing data if ( StructKeyExists(currData,"recurAllDay") AND currData.recurAllDay EQ 1 ) { selectedAllDayValue = 1; selectedStartTimeValue = ""; selectedEndTimeValue = ""; } else { selectedAllDayValue = 0; if ( StructKeyExists(currData,"recurStartTime") AND IsDate(currData.recurStartTime) ) { selectedStartTimeValue = TimeFormat(currData.recurStartTime,cfTimeFormatMask); if ( StructKeyExists(currData,"recurEndTime") AND IsDate(currData.recurEndTime) ) selectedEndTimeValue = TimeFormat(currData.recurEndTime,cfTimeFormatMask); else selectedEndTimeValue = ""; } } // Recurrence Pattern Existing data if ( StructKeyExists(currData,"patternType") AND LEN(TRIM(currData.patternType)) ) selectedPatternType = currData.patternType; if ( StructKeyExists(currData,"patternOption") AND LEN(TRIM(currData.patternOption)) ) selectedPatternOption = currData.patternOption; // Daily Pattern Data if ( StructKeyExists(currData,"patternDayQty") AND LEN(TRIM(currData.patternDayQty)) ) selectedPatternDayQty = currData.patternDayQty; // Weekly Pattern Data if ( StructKeyExists(currData,"patternWeekQty") AND LEN(TRIM(currData.patternWeekQty)) ) selectedPatternWeekQty = currData.patternWeekQty; if ( StructKeyExists(currData,"patternDOW") AND LEN(TRIM(currData.patternDOW)) ) selectedDayOfWeek = currData.patternDOW; // Monthly Pattern Data if ( StructKeyExists(currData,"patternMonthQty") AND LEN(TRIM(currData.patternMonthQty)) ) selectedPatternMonthQty = currData.patternMonthQty; if ( StructKeyExists(currData,"patternMonthlyDayNumber") AND LEN(TRIM(currData.patternMonthlyDayNumber)) ) selectedMonthlyDayNumber = currData.patternMonthlyDayNumber; if ( StructKeyExists(currData,"patternMonthlyDayOrdinal") AND LEN(TRIM(currData.patternMonthlyDayOrdinal)) ) selectedMonthlyDayOrdinal = currData.patternMonthlyDayOrdinal; if ( StructKeyExists(currData,"patternMonthlyWeekDay") AND LEN(TRIM(currData.patternMonthlyWeekDay)) ) { selectedMonthlyWeekDay = currData.patternMonthlyWeekDay; //TODO: for advanced outlook style options //selectedMonthlyWeekDay = "day"; } // Yearly Pattern Data if ( StructKeyExists(currData,"patternYearQty") AND LEN(TRIM(currData.patternYearQty)) ) selectedPatternYearQty = currData.patternYearQty; // Yearly Pattern Data - EveryXDayOfMonth if ( StructKeyExists(currData,"patternYearlyMonth") AND LEN(TRIM(currData.patternYearlyMonth)) ) selectedYearlyMonth = currData.patternYearlyMonth; if ( StructKeyExists(currData,"patternYearlyDayNumber") AND LEN(TRIM(currData.patternYearlyDayNumber)) ) selectedYearlyDayNumber = currData.patternYearlyDayNumber; // Yearly Pattern Data - EveryXYofMonth if ( StructKeyExists(currData,"patternYearlyDayOrdinal") AND LEN(TRIM(currData.patternYearlyDayOrdinal)) ) selectedYearlyDayOrdinal = currData.patternYearlyDayOrdinal; if ( StructKeyExists(currData,"patternYearlyWeekDay") AND LEN(TRIM(currData.patternYearlyWeekDay)) ) { selectedYearlyWeekDay = currData.patternYearlyWeekDay; //TODO: for advanced outlook style options //selectedYearlyWeekDay = "day"; } if ( StructKeyExists(currData,"patternYearlyWeekDayMonth") AND LEN(TRIM(currData.patternYearlyWeekDayMonth)) ) selectedYearlyWeekDayMonth = currData.patternYearlyWeekDayMonth; // Recurrence Range Existing data if ( StructKeyExists(currData,"rangeStartDate") AND IsDate(currData.rangeStartDate) ) selectedStartDateValue = DateFormat(currData.rangeStartDate,cfDateFormatMask); if ( StructKeyExists(currData,"rangeEndType") AND LEN(TRIM(currData.rangeEndType)) ) selectedRangeEndType = currData.rangeEndType; // Range End Types: NoEnd,EndQuantity,EndDate if ( selectedRangeEndType EQ "EndQuantity") { selectedEndDateValue = ""; // set to [empty string] if ( StructKeyExists(currData,"rangeQuantity") AND IsNumeric(currData.rangeQuantity) ) selectedEndQtyOccurences = currData.rangeQuantity; } else if ( selectedRangeEndType EQ "EndDate") { selectedEndQtyOccurences = ""; // set to [empty string] if ( StructKeyExists(currData,"rangeEndDate") AND IsDate(currData.rangeEndDate) ) selectedEndDateValue = DateFormat(currData.rangeEndDate,cfDateFormatMask); } } application.ptCalendar.scripts.loadJQuery(); application.ptCalendar.scripts.loadJQueryUI(themeName=uiTheme); application.ptCalendar.scripts.loadADFLightbox(); // Load the DateJS Plugin Headers application.ptCalendar.scripts.loadDateJS(); // Load the CFJS Plugin Headers application.ptCalendar.scripts.loadCFJS(); if ( timePickerType IS "anytime" ) { application.ptCalendar.scripts.loadJQueryAnytime(); if ( LEN(TRIM(timePickerFormat)) EQ 0 ) timePickerFormat = "%l:%i %p"; // "%m/%d/%Y" "%l:%i %p" "%m/%d/%Y %l:%i %p" } else if ( timePickerType IS "calendrical" ) { application.ptCalendar.scripts.loadJQueryCalendrical(); } else if ( timePickerType IS "UItimepickerAddon" ) { application.ptCalendar.scripts.loadJQueryUITimepickerAddon(); if ( LEN(TRIM(timePickerFormat)) EQ 0 ) timePickerFormat = "h:mm TT"; } else if ( timePickerType IS "UItimepickerFG" ) { application.ptCalendar.scripts.loadJQueryUITimepickerFG(); }
Recurrence Details:
checked="checked">
Recurrence Pattern:
checked="checked">  
--->
Range of Recurrence:
#submitStatusHTML#
 
 
var recurrenceformID = application.ptCalendar.getEventRecurrenceFormID(); // Get the Date/Time data based on the UUID var recurrenceArray = application.ptCalendar.recurrenceBuilderDAO.getRecurrence(uniqueID=arguments.recurrenceID); // Check that we have data if ( ArrayLen(recurrenceArray) ) dataPageID = recurrenceArray[1].pageid; else dataPageID = 0; // Call the FORMS delete function return application.ptCalendar.forms.renderDeleteForm( formID=recurrenceformID ,dataPageID=dataPageID ,title=arguments.title ,callback=arguments.callback ,cbIDlist=arguments.cbIDlist );