variables.ElementName = getEventDetailsCEName(); variables.ElementIDfield = "uniqueID"; variables.CCAPIName = getCCAPIName(variables.elementName); variables.elementViewName = getCEViewName(variables.elementName); variables.eventDateTimeCEName = getEventDateTimeCEName(); variables.eventDateTimeViewName = getCEViewName(variables.eventDateTimeCEName); variables.ElementFieldList = ""; var qry = ""; var fieldList = ""; SELECT * FROM #variables.elementViewName# WHERE 1= 0 fieldList = variables.ElementFieldList; if (arguments.tableName neq "") fieldList = arguments.tableName & "." & replaceNoCase(fieldList, ",", ",#arguments.tableName#.", "ALL"); return fieldList; if ( LEN(TRIM(arguments.uniqueID)) ) return getEventDetailsByIDfieldName(IDfieldName=variables.ElementIDfield,IDfieldValue=TRIM(arguments.uniqueID)); else return application.ptCalendar.ceData.getCEData(variables.ElementName); var retArray = ArrayNew(1); if ( LEN(TRIM(arguments.IDfieldName)) ) retArray = application.ptCalendar.ceData.getCEData(variables.ElementName,arguments.IDfieldName,arguments.IDfieldValue); return retArray; var calendarStruct = StructNew(); var calendarArray = getEventDetails(uniqueID=TRIM(arguments.uniqueID)); if ( ArrayLen(calendarArray) ) calendarStruct = calendarArray[1]; return calendarStruct; var ElementIDfield = "seriesParentID"; return application.ptCalendar.ceData.getCEData(variables.ElementName,ElementIDfield,TRIM(arguments.seriesParentID)); var retArray = ArrayNew(1); var eventQry = QueryNew("tmp"); var filterDataQry = QueryNew("tmp"); var currData = StructNew(); var eventTitle = ""; var eventDate = ""; var eventStartDate = ""; var eventEndDate = ""; var eventStartTime = ""; var eventEndTime = ""; var eventAllDay = ""; var dummyDate = application.ptCalendar.getTimeDummyDate(); var dummyDayBeginTime = application.ptCalendar.getDayBeginTime(); var dummyDayEndTime = application.ptCalendar.getDayEndTime(); // Search Fields if ( StructKeyExists(arguments.eventData,"values") ) { currData = arguments.eventData.values; if ( StructKeyExists(currData,"title") ) eventTitle = currData.title; if ( StructKeyExists(currData,"eventDate") ) { eventDate = currData.eventDate; eventStartDate = application.ptCalendar.date.csDateFormat(eventDate,dummyDayBeginTime); eventEndDate = application.ptCalendar.date.csDateFormat(eventDate,dummyDayBeginTime); } if ( StructKeyExists(currData,"starttime") AND LEN(TRIM(currData.starttime)) ) { eventStartTime = application.ptCalendar.date.csDateFormat(dummyDate,currData.starttime); if ( StructKeyExists(currData,"endtime") AND LEN(TRIM(currData.endtime)) ) { eventEndTime = application.ptCalendar.date.csDateFormat(dummyDate,currData.endtime); } } else { eventAllDay = 1; } } // Get the Event Details and DateTime join query if ( LEN(TRIM(eventDate)) ) eventQry = getEventDetailsDateTimeJoinQuery(startDate=eventStartDate,endDate=eventEndDate); SELECT * FROM eventQry WHERE title = AND CAST(startTime AS VARCHAR) = CAST( AS VARCHAR) AND CAST(endTime AS VARCHAR ) = CAST( AS VARCHAR) AND allDay = if ( eventQry.RecordCount ) retArray = Application.ptCalendar.ceData.buildCEDataArrayFromQuery(eventQry); return retArray; // Create the page var retStatusStruct = application.ptCalendar.csContent.populateContent(variables.CCAPIName, arguments.dataValues); /* retStatusStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */ return retStatusStruct; var dataQry = QueryNew("temp"); SELECT #getElementFieldList()#, uniqueID AS calEventID FROM #variables.elementViewName# WHERE #variables.ElementIDfield# = var dataQry = QueryNew("temp"); var filterDataQry = QueryNew("temp"); var extraStandardFieldsList = "recurrenceID"; var xfld = ""; SELECT #getElementFieldList("eventdetail")#, eventdetail.uniqueID AS calEventID ,datetime.dtHashID, datetime.parentRecurrenceID ,datetime.uniqueID AS dateTimeID ,datetime.eventDate ,datetime.startTime ,datetime.endTime ,datetime.allDay ,'' AS #xfld# FROM #variables.elementViewName# eventdetail, #variables.eventDateTimeViewName# datetime WHERE eventdetail.uniqueID = datetime.calEventID ORDER BY datetime.eventDate, datetime.AllDay DESC, datetime.StartTime SELECT * FROM dataQry WHERE 1 = 1 AND calEventID = AND CAST( eventDate AS DATE ) BETWEEN CAST( AS DATE ) AND CAST( AS DATE ) AND CAST( eventDate AS DATE ) >= CAST( AS DATE ) AND dateTimeID = AND dtHashID = ORDER BY eventDate, AllDay DESC, StartTime var dataQry = QueryNew("temp"); var eventDetailsQry = application.ptCalendar.calEventDetailsDAO.getEventDetailsQuery(eventID=arguments.eventID); var dateTimeQry = application.ptCalendar.calEventRecurrenceService.getRecurrenceDateTimeQuery(eventID=arguments.eventID,startDate=arguments.startDate,enddate=arguments.enddate); SELECT eventDetailsQry.* ,dateTimeQry.dtHashID, dateTimeQry.parentRecurrenceID ,dateTimeQry.dateTimeID, CAST(dateTimeQry.eventDate AS VARCHAR) AS eventDate ,CAST(dateTimeQry.startTime AS VARCHAR) AS startTime, CAST(dateTimeQry.endTime AS VARCHAR) AS endTime ,dateTimeQry.allDay, dateTimeQry.recurrenceID FROM eventDetailsQry, dateTimeQry WHERE eventDetailsQry.uniqueID = dateTimeQry.calEventID AND dateTimeQry.calEventID = AND CAST( dateTimeQry.eventDate AS DATE ) BETWEEN CAST( AS DATE ) AND CAST( AS DATE ) AND CAST( dateTimeQry.eventDate AS DATE ) >= CAST( AS DATE ) AND dateTimeID = AND dtHashID = ORDER BY eventDate, AllDay DESC, StartTime var dataQry = QueryNew("temp"); var approvedValue = 1; SELECT DISTINCT location FROM #variables.elementViewName# WHERE 1=1 AND approved = var dataQry = QueryNew("temp"); SELECT * FROM #variables.elementViewName# WHERE seriesParentID = var formID = getCalEventDetailsFormID(); var elementFields = application.ptCalendar.ceData.getElementFieldsByFormID(formID); var currPageID = 0; var i = 1; var j = 1; var retStruct = StructNew(); var fieldStruct = application.ptCalendar.getViewColumnStruct(ceName=variables.ElementName,useQueryDataTypes=arguments.useQueryDatatypes); var colNameStruct = StructNew(); var key = ""; var keyVal = ""; var x = 1; var xFld = ""; var xVal = ""; var extraFields = ""; var extraDataTypes = ""; // ntext, nvarchar, varchar var fieldExceptionList = "pageID,controlID,formID"; // Make sure we have at least one valid column from the dateTime VIEW if ( StructKeyExists(fieldStruct,"uniqueID") ) { // Add the dateTimeFieldStruct fields to the colNameStruct for (key in fieldStruct) { if ( !ListFindNoCase(fieldExceptionList,key) ) { // if needed convert the values to CF Query DataTypes if ( arguments.useQueryDatatypes ) keyVal = application.ptCalendar.convertSQLDataTypeToQueryDataType(fieldStruct[key]); else keyVal = fieldStruct[key]; // Add to the retStruct retStruct[key] = keyVal; } } // Loop over the extra fields and dataTypes to be used for the Query Columns if ( ListLen(extraFields) EQ ListLEN(extraDataTypes) ) { for ( x=1;x LTE ListLen(extraFields);x=x+1 ) { xFld = ListGetAt(extraFields,x); // if needed convert the values to CF Query DataTypes if ( arguments.useQueryDatatypes ) xVal = application.ptCalendar.convertSQLDataTypeToQueryDataType(ListGetAt(extraDataTypes,x)); else xVal = ListGetAt(extraDataTypes,x); // Add to the retStruct retStruct[xFld] = xVal; } } } return retStruct; return getEventDetailsColumnStruct(useQueryDataTypes=false); var retStruct = StructNew(); var fieldStruct = csFieldsDataTypeStructByCEName(ceName=variables.ElementName); var dbType = getCSDBType(); var validOverrideDBTypes = "Oracle,MySQL,SQLServer"; var key = ""; var fieldExceptionList = ""; var intType = ""; var vcharType = ""; var textType = ""; var bitType = ""; var csTextFieldTypeList = "Custom Text Area Field,large_textarea,formatted_text_block"; var csTextFieldLabelList = "Event Category,Organization,Event Dates and Times"; var csLongTextFieldLabelList = ""; // Check if an override DBtype was passed in if ( LEN(TRIM(arguments.overRideDBtype)) AND ListFindNoCase(validOverrideDBTypes,arguments.overRideDBtype) ) dbType = arguments.overRideDBtype; // Convert the Fields DataTypes for the dbType switch (dbtype) { case 'Oracle': intType = 'number(12)'; vcharType = "varchar2(850)"; //850 - matches the Data_FieldValue CS DB column size textType = "varchar2(2000)"; bitType = "bit"; longTextType = "long"; break; case 'MySQL': intType = 'UNSIGNED'; vcharType = "varchar(850)"; //850 - matches the Data_FieldValue CS DB column size textType = "mediumtext"; bitType = "bit"; longTextType = "longtext"; break; case 'SQLServer': intType = 'int'; vcharType = "varchar(850)"; //850 - matches the Data_FieldValue CS DB column size textType = "varchar(max)"; //nvarchar(4000) bitType = "bit"; longTextType = "text"; break; } if ( dbtype NEQ "MySQL" and application.ptCalendar.ceData.siteDBIsUnicode() ) { vcharType = replaceNoCase(vcharType, "varchar", "nvarchar"); textType = replaceNoCase(textType, "varchar", "nvarchar"); longTextType = replaceNoCase(longTextType, "text", "ntext"); } // Make sure we have at least one valid field from the element if ( StructKeyExists(fieldStruct,"uniqueID") ) { // Add the dateTimeFieldStruct fields to the colNameStruct for (key in fieldStruct) { if ( !ListFindNoCase(fieldExceptionList,key) ) { // convert the field type to a DB Datatype text if the field type is this list if ( ListFindNoCase(csTextFieldTypeList,fieldStruct[key]["type"]) ) { retStruct[lcase(key)] = lcase(textType); } // convert the field type to a DB Datatype text if the label is in this list else if ( ListFindNoCase(csTextFieldLabelList,fieldStruct[key]["label"]) ) { retStruct[lcase(key)] = lcase(textType); } else { retStruct[lcase(key)] = lcase(vcharType); } } } } return retStruct; var IDfield = "linkedCSPageID"; var filterDataQry = QueryNew("temp"); var dataQry = getEventDetailsDateTimeJoinQuery(); SELECT * FROM dataQry WHERE 1 = 1 AND #IDfield# = ORDER BY eventDate, AllDay DESC, StartTime var IDfield = "linkedCSPageID"; return getEventDetailsByIDfieldName(IDfieldName=IDfield,IDfieldValue=TRIM(arguments.csPageID));