// CUSTOM ELEMENT INFO variables.CUSTOM_ELEMENT = "Courses"; variables.CE_FIELD = "uniqueID"; variables.SEARCH_FIELDS = "Title,Code"; variables.ORDER_FIELD = "Title"; variables.FILTER_FIELD = "calendarYear"; // LAYOUT FLAGS variables.SHOW_SECTION1 = true; // Boolean variables.SHOW_SECTION2 = true; // Boolean // STYLES variables.MAIN_WIDTH = 580; variables.SECTION1_WIDTH = 570; variables.SECTION2_WIDTH = 270; variables.SECTION3_WIDTH = 570; variables.SELECT_BOX_HEIGHT = 320; variables.SELECT_BOX_WIDTH = 250; //variables.SELECT_ITEM_HEIGHT = 53; variables.SELECT_ITEM_HEIGHT = 46; //36 variables.SELECT_ITEM_WIDTH = 210; variables.SELECT_ITEM_CLASS = "ui-state-default"; variables.JQUERY_UI_THEME = "ui-lightness"; // ADDITIONS variables.SHOW_ALL_LINK = true; // Boolean variables.ADD_NEW_FLAG = false; // Boolean variables.ADD_NEW_URL = ""; variables.ADD_NEW_LB_WIDTH = 600; variables.ADD_NEW_LB_HEIGHT = 420; // Initialize the return variable var retHTML = ""; var itm = 1; var b = 1; // Get the CE Data var dataArray = ArrayNew(1); var newArray = ArrayNew(1); //var newArrayB = ArrayNew(1); // clean the search text if ( arguments.queryType eq "search" ) arguments.searchValues = cleanChooserSearchText(arguments.searchValues); // Get custom element data // Check if we are returning all the records when items is empty string and querytype is NOTselected if ( (arguments.queryType EQ "notselected") AND (LEN(arguments.item) LTE 0) ) dataArray = getCEData(variables.CUSTOM_ELEMENT); else dataArray = getCEData(variables.CUSTOM_ELEMENT, variables.CE_FIELD, arguments.item, arguments.queryType, arguments.searchValues, variables.SEARCH_FIELDS); // if are returning the selected items // sort the dataArray array order to match the passed in items ID order if ( arguments.queryType NEQ "selected" ) { // sort the dataArray dataArray = arrayOfCEDataSort(dataArray, variables.ORDER_FIELD); } if ( LEN(TRIM(variables.FILTER_FIELD)) AND LEN(TRIM(arguments.filterValue)) ) { for ( itm=1; itm LTE ArrayLen(dataArray); itm=itm+1 ) { // - Filter out records that do not match the 'Filter_Value' (ie. Feature) if ( TRIM(dataArray[itm].values[variables.FILTER_FIELD]) EQ arguments.filterValue ) { // - Filter out expired records arrayAppend(newArray, dataArray[itm]); } } // Convert newArray back the dataArray for the return dataArray = newArray; } //Filter out currentRecord (by uniqueID) from returned results /* for ( b=1; b LTE ArrayLen(dataArray); b=b+1 ) { if ( dataArray[b].values.uniqueID NEQ arguments.item ) { arrayAppend(newArrayB, dataArray[b]); } } dataArray = newArrayB; */ var retHTML = ""; var photoImgURL = ""; var ceDataArray = getChooserData(arguments.item, arguments.queryType, arguments.searchValues, arguments.csPageID, arguments.filterValue); var iconClass = ""; var retHTMLImg = ""; var imgData = StructNew(); // Loop over the data for ( i=1; i LTE ArrayLen(ceDataArray); i=i+1) { // set the return html image variable retHTMLImg = ""; photoImgURL = ""; // determine if the user has a photo with the profile /* if ( LEN(TRIM(ceDataArray[i].Values.PromoPhoto)) ) { imgData = Application.ADF.csData.decipherCPIMAGE(ceDataArray[i].values.PromoPhoto); if ( IsStruct(imgData) AND structKeyExists(imgData,"ResolvedURL") AND structKeyExists(imgData.ResolvedURL,"ServerRelative") AND LEN(TRIM(imgData.ResolvedURL.ServerRelative) ) ) photoImgURL = imgData.ResolvedURL.ServerRelative; retHTMLImg = ""; } */ if ( StructKeyExists(ceDataArray[i].Values,"#variables.ORDER_FIELD#") AND LEN(ceDataArray[i].Values[variables.ORDER_FIELD]) AND StructKeyExists(ceDataArray[i].Values,"#variables.CE_FIELD#") AND LEN(ceDataArray[i].Values[variables.CE_FIELD]) ) { // retHTML = retHTML & "
  • #retHTMLImg#
    #LEFT(ceDataArray[i].Values[variables.ORDER_FIELD],50)#
  • "; retHTML = retHTML & "
  • "; retHTML = retHTML & "
    "; // retHTML = retHTML & "
    #retHTMLImg#
    "; // retHTML = retHTML & "
    "; retHTML = retHTML & "[ #ceDataArray[i].Values.code# ]"; retHTML = retHTML & "
    "; retHTML = retHTML & "#LEFT(ceDataArray[i].Values[variables.ORDER_FIELD],50)#"; retHTML = retHTML & "
    "; retHTML = retHTML & "(#ceDataArray[i].Values.calendarYear#)"; // retHTML = retHTML & "
    "; retHTML = retHTML & "
  • "; } }
    Filter items by Calendar Years: