variables.eventDetailsCEName = getEventDetailsCEName();
variables.eventDetailsViewName = getCEViewName(variables.eventDetailsCEName);
variables.eventDateTimeCEName = getEventDateTimeCEName();
variables.eventDateTimeViewName = getCEViewName(variables.eventDateTimeCEName);
var dataQry = QueryNew("temp");
if ( LEN(TRIM(arguments.eventID)) ) {
if ( arguments.useCache ) {
// Get the events from the eventsCache based on a date range
dataQry = application.ptCalendar.calEventsCacheController.getEventsByEventID(eventID=TRIM(arguments.eventID));
}
else {
dataQry = getEventsByEventID(eventID=TRIM(arguments.eventID));
}
}
else if ( LEN(TRIM(arguments.hashID)) ) {
if ( arguments.useCache ) {
// Get the events from the eventsCache based on a date range
dataQry = application.ptCalendar.calEventsCacheController.getEventsByHashID(hashID=TRIM(arguments.hashID));
}
else {
dataQry = getEventsByHashID(hashID=TRIM(arguments.hashID));
}
}
else if ( LEN(TRIM(arguments.dateTimeID)) ) {
if ( arguments.useCache ) {
// Get the events from the eventsCache based on a date range
dataQry = application.ptCalendar.calEventsCacheController.getEventsByDateTimeID(dateTimeID=TRIM(arguments.dateTimeID));
}
else {
dataQry = getEventsByDateTimeID(dateTimeID=TRIM(arguments.dateTimeID));
}
}
else if ( LEN(TRIM(arguments.startdate)) ) {
if ( arguments.useCache ) {
// Get Events from the eventsCache based on a date range
dataQry = application.ptCalendar.calEventsCacheController.getEventsByDateRange(
startDate = TRIM(arguments.startDate)
,endDate = TRIM(arguments.endDate)
);
}
else {
// Get Events based on a date range
dataQry = getEventsByDateRange(
startDate = TRIM(arguments.startDate)
,endDate = TRIM(arguments.endDate)
);
}
}
else {
if ( arguments.useCache ) {
// Get Events from the eventsCache
dataQry = application.ptCalendar.calEventsCacheController.getEvents();
}
else {
// Get Events
dataQry = getEventsUnion();
}
}
return dataQry;
var dataQry = QueryNew("temp");
var dateTimeQry = application.ptCalendar.calEventDetailsDAO.getEventDetailsDateTimeJoinQuery(
startDate=TRIM(arguments.startDate)
,enddate=TRIM(arguments.enddate)
,eventID=TRIM(arguments.eventID)
,dateTimeID=TRIM(arguments.dateTimeID)
,hashID=TRIM(arguments.hashID)
);
var recurrenceQry = application.ptCalendar.calEventDetailsDAO.getEventDetailsRecurrenceJoinQuery(
startDate=TRIM(arguments.startDate)
,enddate=TRIM(arguments.enddate)
,eventID=TRIM(arguments.eventID)
,dateTimeID=TRIM(arguments.dateTimeID)
,hashID=TRIM(arguments.hashID)
);
SELECT dateTimeQry.*
FROM dateTimeQry
WHERE dateTimeID =
UNION ALL
SELECT recurrenceQry.*
FROM recurrenceQry
WHERE dateTimeID =
ORDER BY eventDate, AllDay DESC, StartTime
return getEventsUnion(startDate=TRIM(arguments.startDate),endDate=TRIM(arguments.endDate));
return getEventsUnion(eventID=TRIM(arguments.eventID));
return getEventsUnion(hashID=TRIM(arguments.hashID));
return getEventsUnion(dateTimeID=TRIM(arguments.dateTimeID));
var retStruct = StructNew();
var elementName = getEventDateTimeCEName();
var dateTimeFieldStruct = application.ptCalendar.getViewColumnStruct(ceName=elementName,useQueryDataTypes=arguments.useQueryDatatypes);
var colNameStruct = StructNew();
var key = "";
var keyVal = "";
var x = 1;
var xFld = "";
var xVal = "";
var extraFields = "recurrenceID";
var extraDataTypes = "nvarchar"; // ntext, nvarchar, varchar
var fieldExceptionList = "pageID,controlID,formID";
// Make sure we have at least one valid column from the dateTime VIEW
if ( StructKeyExists(dateTimeFieldStruct,"uniqueID") ) {
// Add the dateTimeFieldStruct fields to the colNameStruct
for (key in dateTimeFieldStruct) {
if ( !ListFindNoCase(fieldExceptionList,key) ) {
// if needed convert the values to CF Query DataTypes
if ( arguments.useQueryDatatypes )
keyVal = application.ptCalendar.convertSQLDataTypeToQueryDataType(dateTimeFieldStruct[key]);
else
keyVal = dateTimeFieldStruct[key];
// Convert the uniqueID field to a dateTimeID field
if ( key EQ "uniqueID" )
retStruct["dateTimeID"] = keyVal;
else
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);
retStruct[xFld] = xVal;
}
}
}
return retStruct;
var retStruct = StructNew();
var dateTimeFieldStruct = getDateTimeColumnStruct(useQueryDataTypes=true);
var colNameList = "";
var dataTypeList = "";
var key = "";
// Make sure we have populated structure from dateTime VIEW table
if ( NOT StructIsEmpty(dateTimeFieldStruct) ) {
// Create the list of Column Name to be used for query columns
colNameList = StructKeyList(dateTimeFieldStruct);
// Create the list of DataTypes to be used for query columns
for ( key in dateTimeFieldStruct ) {
dataTypeList = ListAppend(dataTypeList,dateTimeFieldStruct[key]);
}
// Build the query column/datatype struct
retStruct.columnNames = colNameList;
retStruct.dataTypes = dataTypeList;
}
return retStruct;
return getDateTimeColumnStruct(useQueryDataTypes=false);
var retData = {};
var cacheProcessType = "delete";
var deleteItemsList = application.ptCalendar.calEventDetailsService.deleteEventDetailsByEventID(eventID=arguments.eventID);
// Check to see if any Recurrence records were deleted
retData.status = false;
retData.deleteDetails = 'Error: Event Details Delete Failed!';
retData.deleteDetailsList = deleteItemsList;
retData.deleteDateTime = false;
retData.deleteRecurrence = false;
retData.cacheStatus = false;
if ( ListLen(deleteItemsList) )
{
retData.status = true;
retData.deleteDetails = "Event Details have been deleted!";
retData.deleteDateTime = application.ptCalendar.dateTimeBuilderController.processEventDateTimeDelete(parentID=arguments.eventID);
retData.deleteRecurrence = application.ptCalendar.recurrenceBuilderController.processEventRecurrenceDelete(parentID=arguments.eventID);
retData.cacheStatus = application.ptCalendar.calEventsCacheController.processEventCacheByEventID(eventID=arguments.eventID,process=cacheProcessType);
}
return retData;