variables.ElementName = getEventCategoriesCEName();
variables.ElementIDfield = "catID";
//variables.CCAPIName = getEventCategoriesCCAPIname();
variables.CCAPIName = getCCAPIName(variables.elementName);
variables.elementViewName = getCEViewName(variables.elementName);
if ( LEN(arguments.uniqueID) )
return application.ptCalendar.ceData.getCEData(variables.ElementName, variables.ElementIDfield, TRIM(arguments.uniqueID));
else
return application.ptCalendar.ceData.getCEData(variables.ElementName);
var activefield = "Active";
var activeValue = 1;
return application.ptCalendar.ceData.getCEData(variables.ElementName, activefield, activeValue);
var dataList = "";
var fieldName = "name";
var dataArray = getEventCategories(uniqueID=uniqueID);
var itm = 1;
for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 )
{
if ( StructKeyExists(dataArray[itm],"values") AND StructKeyExists(dataArray[itm].values,fieldName) AND Len(Trim(dataArray[itm].values[fieldName])) )
dataList = ListAppend(dataList,dataArray[itm].values[fieldName]);
}
return dataList;
var catStruct = StructNew();
var fieldName = "name";
var catArray = application.ptCalendar.ceData.getCEData(variables.ElementName,fieldName,arguments.categoryName);
if ( ArrayLen(catArray) )
catStruct = catArray[1];
return catStruct;
var catArray = ArrayNew(1);
var catStruct = StructNew();
var i = 1;
var ceName = "";
for (i=1;i LTE ListLen(arguments.categoryNameList); i=i+1) {
catName = ListGetAt(arguments.categoryNameList, i);
catStruct = getEventCategoryByCatName(TRIM(catName));
if ( structKeyExists(catStruct,"PageID") AND IsNumeric(catStruct.PageID) )
arrayAppend(catArray,catStruct);
}
return catArray;
var dataList = "";
var fieldName = "catID";
var dataArray = getCategoryArrayByCatNameList(categoryNameList=arguments.categoryNameList);
var itm = 1;
for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 ) {
if ( StructKeyExists(dataArray[itm],"values") AND StructKeyExists(dataArray[itm].values,fieldName) AND Len(Trim(dataArray[itm].values[fieldName])) )
dataList = ListAppend(dataList,TRIM(dataArray[itm].values[fieldName]));
}
return dataList;
var catArray = ArrayNew(1);
var itemArray = ArrayNew(1);
var newItemIDlist = "";
var filteredArray = ArrayNew(1);
var sortedArray = ArrayNew(1);
var fieldName = "OrgIDList";
var numericSortField = "ordinal";
var itm = 1;
var x =1;
var z =1;
var itemID = "";
var newItem = "";
// Get the values from the element filtered by orgID if needed
if ( LEN(TRIM(arguments.orgID)) )
{
for ( x=1; x LTE ListLen(arguments.orgID); x=x+1 ){
itemID = ListGetAt(arguments.orgID,x);
if ( LEN(TRIM(itemID)) )
{
itemArray = application.ptCalendar.ceData.getCEData(
customElementName = variables.ElementName,
customElementFieldName = fieldName,
item = itemID,
queryType = "searchInList"
);
// Add the returned records to the catArray
for ( z=1; z LTE ArrayLen(itemArray); z=z+1 ){
if ( StructKeyExists(itemArray[z],"values") AND StructKeyExists(itemArray[z].values,"catID") )
{
newItem = itemArray[z].values.catID;
if ( ListFindNoCase(newItemIDlist,newItem) EQ 0 )
{
newItemIDlist = listAppend(newItemIDlist,newItem);
arrayAppend(catArray,itemArray[z]);
}
}
}
}
}
}
else
{
catArray = getEventCategories();
}
// Filter out records by the fitlerField and Value if needed
if ( LEN(TRIM(arguments.filterField)) )
{
for ( itm=1; itm LTE ArrayLen(catArray); itm=itm+1 ) {
if ( catArray[itm].values[arguments.filterField] EQ arguments.filterValue )
{
arrayAppend(filteredArray, catArray[itm]);
}
}
catArray = filteredArray;
}
// Sort the Data - if a SortField is Passed in... Sort the Array of Struct
if ( ArrayLen(catArray) AND LEN(TRIM(arguments.sortField)) AND StructKeyExists(catArray[1],"values") AND StructKeyExists(catArray[1].values,TRIM(arguments.sortField)) ) {
if ( arguments.sortField EQ numericSortField )
sortedArray = application.ptCalendar.ceData.arrayOfCEDataSort(catArray,TRIM(arguments.sortField),"asc","numeric");
else
sortedArray = application.ptCalendar.ceData.arrayOfCEDataSort(catArray,TRIM(arguments.sortField),"asc","textnocase");
catArray = sortedArray;
}
return catArray;
var catArray = getEventCategories(uniqueID=arguments.catIDlist);
var userList = "";
var userID = "";
var i = 1;
var u = 1;
// Loop ovar the Category Array
for (i=1;i LTE ArrayLen(catArray); i=i+1) {
// Loop over the List of users stored with each Category
for (u=1;u LTE ListLen(catArray[i].values.NotificationUserIDs); u=u+1) {
userID = ListGetAt(catArray[i].values.NotificationUserIDs,u);
if ( ListFindNoCase(userList,userID) EQ 0 ) {
userList = ListAppend(userList, userID);
}
}
}
return userList;
var catArray = getCategoryArrayByCatNameList(arguments.categoryNameList);
var userList = "";
var userID = "";
var i = 1;
var u = 1;
for (i=1;i LTE ArrayLen(catArray); i=i+1) {
for (u=1;u LTE ListLen(catArray[i].values.NotificationUserIDs); u=u+1) {
userID = ListGetAt(catArray[i].values.NotificationUserIDs,u);
if ( ListFindNoCase(userList,userID) EQ 0 ) {
userList = ListAppend(userList, userID);
}
}
}
return userList;
var dataQry = QueryNew("temp");
SELECT *
FROM #variables.elementViewName#
WHERE
var dataQry = QueryNew("temp");
var filterDataQry = QueryNew("temp");
var activefield = "Active";
var activeValue = 1;
SELECT *
FROM #variables.elementViewName#
WHERE #activefield# =
AND
var dataQry = QueryNew("temp");
var activefield = "Active";
var activeValue = 1;
SELECT *
FROM #variables.elementViewName#
WHERE 1=1
AND #activefield# =
AND
var retArray = ArrayNew(1);
var dataQry = getEventCategoriesNotSelectedQuery(catIDList=arguments.catIDList,activeOnly=arguments.activeOnly);
if ( dataQry.RecordCount )
retArray = application.ptCalendar.ceData.buildCEDataArrayFromQuery(ceDataQuery=dataQry);
return retArray;
var dataQry = getActiveEventCategoriesQuery();
var filterDataQry = QueryNew("temp");
var activefield = "Active";
var activeValue = 1;
//OrgIDList
--->
var catArray = ArrayNew(1);
var catData = StructNew();
var activefield = "Active";
var activeValue = 1;
var key = "";
if ( LEN(TRIM(arguments.orgID)) ) {
// Get ALL records or Only Active Records
// DO NOT SORT HERE... converting to struct will distory the sorting
if ( arguments.activeOnly )
catArray = getFilteredCategoriesByOrgID(orgID=arguments.orgID,filterField=activefield,filterValue=activeValue); //,sortField=arguments.sortField
else
catArray = getFilteredCategoriesByOrgID(orgID=arguments.orgID); //,sortField=arguments.sortField
// Convert the Array to a ID/NAME Struct
for ( itm=1; itm LTE ArrayLen(catArray); itm=itm+1 ) {
key = catArray[itm].values.catID;
if ( !StructKeyExists(catData,key) )
catData[key] = catArray[itm].values.name;
}
}
return catData;
var catArray = ArrayNew(1);
var newData = StructNew();
var newArray = ArrayNew(1);
var activefield = "Active";
var activeValue = 1;
var key = "";
if ( LEN(TRIM(arguments.orgID)) ) {
// Get ALL records or Only Active Records
if ( arguments.activeOnly )
catArray = getFilteredCategoriesByOrgID(orgID=arguments.orgID,filterField=activefield,filterValue=activeValue,sortField=arguments.sortField);
else
catArray = getFilteredCategoriesByOrgID(orgID=arguments.orgID,sortField=arguments.sortField);
// Convert the Array to a ID/NAME Struct
for ( itm=1; itm LTE ArrayLen(catArray); itm=itm+1 ) {
newData = StructNew();
newData.catID = catArray[itm].values.catID;
newData.name = catArray[itm].values.name;
newData.ordinal = catArray[itm].values.ordinal;
ArrayAppend(newArray,newData);
}
}
return newArray;
var retStatusStruct = application.ptCalendar.csContent.populateContent(variables.CCAPIName, arguments.dataValues);
/* retStatusStruct RETURNS: CONTENTUPDATED : true/false & CONTENTUPDATERESPONSE: Success:1 */
return retStatusStruct;