application.ptCalendar.scripts.loadJQuery(); application.ptCalendar.scripts.loadFontAwesome(); application.ptCalendar.scripts.loadADFLightbox(); application.ptCalendar.scripts.loadJQuerySelectboxes(); // Add Full Calendar Resource application.ptCalendar.scripts.loadResources('fullcalendar_6_1_free'); application.ptCalendar.scripts.loadResources('popper_2'); application.ptCalendar.scripts.loadResources('tippyjs_6'); application.ptCalendar.scripts.loadResources('jQueryContextMenu_2'); // Moved below... // Added if useAdminTools is FALSE // application.ptCalendar.calService.loadCalendarCSS(); // Added if useAdminTools is TRUE // application.ptCalendar.calService.loadCalendarAdminCSS(); // Include ADF-layout.css AND Calendar-layout.css application.ptCalendar.scripts.loadResources('ADFlayout'); application.ptCalendar.scripts.loadResources('ptCalendarLayout'); application.ptCalendar.scripts.loadResources('ptCalendarLayoutSiteOverride'); // Set page as dynamic for now (DEV ONLY) request.element.isStatic = 0; debugRhMode = false; appName = application.ptCalendar.getAppBeanName(); // Get the Configuration and Page Map Values appConfig = application.ptCalendar.getAppConfig(); lightboxProxyUrl = application.ptCalendar.getLightboxProxyUrl(); eventDetailsFormID = application.ptCalendar.getCalEventDetailsFormID(); // Get the Event Cache status from the configuration element useEventsCache = application.ptCalendar.getEventCacheStatus(); approvedLabel = application.ptCalendar.getEventApprovedLabel(); deniedLabel = application.ptCalendar.getEventDeniedLabel(); pendingLabel = application.ptCalendar.getEventPendingLabel(); csmode = ""; if ( StructKeyExists(request,"renderstate") AND StructKeyExists(request.renderstate,"rendermode") ) csmode = request.renderstate.rendermode; resetConfig = false; // default: false - true for dev only!! if ( StructKeyExists(request,'params') AND StructKeyExists(request.params,'resetConfig') ) resetConfig = ( IsBoolean(request.params.resetConfig) ) ? request.params.resetConfig : false; if ( csmode IS "edit" OR csmode IS "author" ) { // Set Search Results as Dynamic request.element.isStatic = 0; resetConfig = true; if ( debugRhMode ) WriteOutput("Important: You are currently in #csmode# mode!"); } curPageID = request.page.id; curElementID = request.element.id; // RH Custom Element (LCE) Options // ------------------------------------------------------------------------------------------------- rhConfig = loadRhData(elementInfo=attributes.elementInfo); if ( debugRhMode ) WriteDump(var=rhConfig,expand=false,label="rhConfig"); if ( NOT StructKeyExists(Application,'ptCalendar') ) { WriteOutput('
The PT Calendar App must be installed to use this render handler!
'); exit; } if ( NOT StructKeyExists(Application.ptCalendar,'jsonFeedConfig') ) Application.ptCalendar.jsonFeedConfig = {}; if ( NOT StructKeyExists(Application.ptCalendar.jsonFeedConfig,curPageID) OR resetConfig ) { Application.ptCalendar.jsonFeedConfig[curPageID] = rhConfig; if ( debugRhMode AND (csmode IS "edit" OR csmode IS "author") ) WriteOutput('
Important: - Feed Config Reset: #YesNoFormat(resetConfig)#!
'); } lock scope="session" timeout="10" type ="exclusive" { if ( NOT StructKeyExists(session,'ptCalendar') ) session.ptCalendar = {}; if ( NOT StructKeyExists(session.ptCalendar,'userFeedSpecs') ) session.ptCalendar.userFeedSpecs = {}; // Overwrite Each Request session.ptCalendar.userFeedSpecs.PageId = request.page.id; session.ptCalendar.userFeedSpecs.GroupList = request.user.GroupList; } allowedUserGroups = ''; if ( StructKeyExists(rhConfig,'allowedGroups') AND TRIM(rhConfig.allowedGroups) NEQ '' ) allowedUserGroups = application.ADF.data.listUnion(list1=allowedUserGroups,list2=rhConfig.allowedGroups,removeDups=true); if ( StructKeyExists(rhConfig,'allowedUsers') AND TRIM(rhConfig.allowedUsers) NEQ '' ) allowedUserGroups = application.ADF.data.listUnion(list1=allowedUserGroups,list2=rhConfig.allowedUsers,removeDups=true); useAdminTools = false; if ( StructKeyExists(rhConfig,'enableAdminTools') AND IsBoolean(rhConfig.enableAdminTools) ) useAdminTools = rhConfig.enableAdminTools; // Do NOT show Admin Tools if allowedUserGroups is Empty or if no allowed user are part of this Pages's Group list if ( TRIM(allowedUserGroups) EQ '' OR ListLen(application.ADF.data.listInCommon(list1=request.user.GroupList,list2=allowedUserGroups)) EQ 0 ) useAdminTools = false; // Calendar Render Options from the LCE // ------------------------------------------------------------------------ calendarTheme = "standard"; // standard,bootstrap5,bootstrap if ( StructKeyExists(rhConfig,"calendarTheme") AND TRIM(rhConfig.calendarTheme) NEQ '' ) calendarTheme = rhConfig.calendarTheme; calenderViews = "dayGridMonth"; // multiMonthYear,dayGridMonth,timeGridWeek,timeGridDay,listMonth if ( StructKeyExists(rhConfig,"calenderViews") AND TRIM(rhConfig.calenderViews) NEQ '' ) calenderViews = rhConfig.calenderViews; defaultCalendarView = "dayGridMonth"; if ( StructKeyExists(rhConfig,"defaultCalendarView") AND TRIM(rhConfig.defaultCalendarView) NEQ '' ) defaultCalendarView = rhConfig.defaultCalendarView; buttonLibrary = ""; // jQueryUI, Bootstrap, etc. if ( StructKeyExists(rhConfig,"buttonLibrary") AND TRIM(rhConfig.buttonLibrary) NEQ '' ) buttonLibrary = rhConfig.buttonLibrary; filterButtonWrapperClass = ""; if ( StructKeyExists(rhConfig,"filterButtonWrapperClass") ) filterButtonWrapperClass = rhConfig.filterButtonWrapperClass; filterButtonLinkClass = ""; // ADF-btn ADF-btn-secondary ADF-btn-lg if ( StructKeyExists(rhConfig,"filterButtonLinkClass") ) filterButtonLinkClass = rhConfig.filterButtonLinkClass; footerButtonWrapperClass = ""; if ( StructKeyExists(rhConfig,"footerButtonWrapperClass") ) footerButtonWrapperClass = rhConfig.footerButtonWrapperClass; footerButtonLinkClass = ""; if ( StructKeyExists(rhConfig,"footerButtonLinkClass") ) footerButtonLinkClass = rhConfig.footerButtonLinkClass; /* **** */ useEventFilters = false; if ( StructKeyExists(rhConfig,'enableEventFilters') AND IsBoolean(rhConfig.enableEventFilters) ) useEventFilters = rhConfig.enableEventFilters; showAdvancedFilters = false; showApprovedStatusFilter = false; showOrgAndCatFilters = false; showOrganizationFilter = false; showCategoryFilter = false; showLocationFilter = false; if ( useEventFilters ) { filterBarTitle = ""; if ( StructKeyExists(rhConfig,"filterBarTitle") ) filterBarTitle = rhConfig.filterBarTitle; if ( useAdminTools ) showApprovedStatusFilter = true; if ( StructKeyExists(rhConfig,'enableAdvancedEventFilters') AND IsBoolean(rhConfig.enableAdvancedEventFilters) ) showAdvancedFilters = rhConfig.enableAdvancedEventFilters; if ( showAdvancedFilters ) { showOrganizationFilter = true; if ( StructKeyExists(rhConfig,'enableOrganizationFilter') AND IsBoolean(rhConfig.enableOrganizationFilter) ) showOrganizationFilter = rhConfig.enableOrganizationFilter; if ( showOrganizationFilter ) { showCategoryFilter = true; if ( StructKeyExists(rhConfig,'enableCategoryFilter') AND IsBoolean(rhConfig.enableCategoryFilter) ) showCategoryFilter = rhConfig.enableCategoryFilter; } showLocationFilter = true; if ( StructKeyExists(rhConfig,'enableLocatationFilter') AND IsBoolean(rhConfig.enableLocatationFilter) ) showLocationFilter = rhConfig.enableLocatationFilter; } } /* **** */ defaultFilterApprovalStatus = ''; if ( structKeyExists(rhConfig,"approvalStatus") AND TRIM(rhConfig.approvalStatus) NEQ '' ) defaultFilterApprovalStatus = rhConfig.approvalStatus; defaultFilterOrganizationID = ''; if ( structKeyExists(rhConfig,"organizationID") AND TRIM(rhConfig.organizationID) NEQ '' ) defaultFilterOrganizationID = rhConfig.organizationID; defaultFilterCategoryID = ''; if ( structKeyExists(rhConfig,"categoryID") AND TRIM(rhConfig.categoryID) NEQ '' ) defaultFilterCategoryID = rhConfig.categoryID; defaultFilterLocation = ''; if ( structKeyExists(rhConfig,"location") AND TRIM(rhConfig.location) NEQ '' ) defaultFilterLocation = rhConfig.location; // Include the file for shared management scripts // ------------------------------------------------------------ lightboxAction = "deferToCallback"; useEventsCacheCallbacks = useEventsCache;
editDisplayType = 'default'; // Orgs and Cats Sort Field from the Confing orgsFilterSortField = application.ptCalendar.getOrgsDisplaySortField(); catsFilterSortField = application.ptCalendar.getCatsDisplaySortField(); showToolsLinkText = 'Show Advanced Search Filters'; hideToolsLinkText = 'Hide Advanced Search Filters'; /* ***************************** */ // Filter Form Defaults selectedFilters = StructNew(); selectedFilters.dsFilterApprovedStatus = defaultFilterApprovalStatus; selectedFilters.dsFilterKeywords = ""; selectedFilters.dsFilterOrganizations = defaultFilterOrganizationID; selectedFilters.dsFilterCategories = defaultFilterCategoryID; selectedFilters.dsFilterLocation = defaultFilterLocation; /* ***************************** */ // Get the Active Organization orgArray = application.ptCalendar.calOrganizationsDAO.getCalOrgIDandNameArray(activeOnly=1,sortField=orgsFilterSortField); // Get the Active Categories for the selected Org catArray = application.ptCalendar.calEventCategoriesDAO.getFilteredCategoriesByOrgID(orgID=selectedFilters.dsFilterOrganizations,filterField="active",filterValue=1,sortField=catsFilterSortField); // Get the Locations list from the Event Details Records locationsQry = application.ptCalendar.calEventDetailsDAO.getUniqueLocationsQuery(); containerViewTypeClass = 'CAL-view-no-tools'; // Load Calendar Theme // - calendarTheme overrides 'buttonLibrary' for bootstrap options // ------------------------------------------------------------ if ( calendarTheme EQ 'bootstrap5' ) { application.ptCalendar.scripts.loadResources('Bootstrap_5'); buttonLibrary = 'bootstrap5'; } else if ( calendarTheme EQ 'bootstrap' ) { application.ptCalendar.scripts.loadResources('Bootstrap_4'); buttonLibrary = 'bootstrap4'; } // if useAdminTools=true // ------------------------------------------------------------ if ( useAdminTools ) { containerViewTypeClass = 'CAL-view-admin-tools'; application.ptCalendar.calService.loadCalendarAdminCSS(); } else { application.ptCalendar.calService.loadCalendarCSS(); } // Load Button Library // ------------------------------------------------------------ if ( buttonLibrary NEQ 'none' ) { if ( buttonLibrary EQ 'bootstrap5' ) application.ptCalendar.scripts.loadResources('Bootstrap_5'); else if ( buttonLibrary EQ 'bootstrap4' ) application.ptCalendar.scripts.loadResources('Bootstrap_4'); else if ( buttonLibrary EQ 'jqueryui' ) application.ptCalendar.scripts.loadResources('jqueryui'); else if ( buttonLibrary NEQ '' ) application.ptCalendar.scripts.loadResources(buttonLibrary); }
#filterBarTitle#
(From: Title, Description or Location)
#Server.CommonSpot.UDF.tag.input(type="hidden", name="organizationFilter", value="#selectedFilters.dsFilterOrganizations#")#
#Server.CommonSpot.UDF.tag.input(type="hidden", name="categoryFilter", value="#selectedFilters.dsFilterCategories#")#
#Server.CommonSpot.UDF.tag.input(type="hidden", name="organizationFilter", value="#selectedFilters.dsFilterOrganizations#")# #Server.CommonSpot.UDF.tag.input(type="hidden", name="categoryFilter", value="#selectedFilters.dsFilterCategories#")#
#Server.CommonSpot.UDF.tag.input(type="hidden", name="locationFilter", value="#selectedFilters.dsFilterLocation#")#
#Server.CommonSpot.UDF.tag.input(type="hidden", name="locationFilter", value="#selectedFilters.dsFilterLocation#")#
Loading events...
footerColA_classList = "ADF-col ADF-col-12"; footerColB_classList = ""; if ( useAdminTools ) { footerColA_classList = "ADF-col ADF-col-md-7 ADF-col-sm-12"; footerColB_classList = "ADF-col ADF-col-md-5 ADF-col-sm-12"; }
Status:
#approvedLabel#
#pendingLabel#
#deniedLabel#
application.ADF.scripts.addHeaderCss(fullCalHeaderCSS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY application.ADF.scripts.addFooterJS(fullCalFooterJS, "SECONDARY"); // PRIMARY, SECONDARY, TERTIARY var retData = {}; var rhDataArr = []; if ( StructKeyExists(Attributes.ElementInfo.ElementData, 'PropertyValues') ) rhDataArr = attributes.ElementInfo.ElementData.PropertyValues; if ( ArrayLen(rhDataArr) ) retData = rhDataArr[1].values; return retData; var retData = {}; var rhMetadataFormName = TRIM(arguments.MetadataFormName); var rhMetadata = {}; var rhPropsData = {}; if ( StructKeyExists(Attributes.ElementInfo, 'RenderHandlerMetaData') ) rhMetadata = arguments.ElementInfo.RenderHandlerMetaData; // Check for Props and Layout Binding // ---------------------------------------------- if( NOT hasPropsLayoutBinding(ElementInfo=arguments.elementInfo, metadataFormName=rhMetadataFormName, rhCaller=arguments.rhCaller, showDataError=arguments.showDataError) ) return retData; // Set default return data // ---------------------------------------------- //retData.buttonLibrary = ''; //retData.buttonLinkClass = ''; retData['enableAdvancedEventFilters'] = false; retData['enableEventFilters'] = false; // Get the selected Metadata and overwrite the default values // ---------------------------------------------- rhPropsData = rhMetadata[rhMetadataFormName]; // Overwrite the return with the metadata values // ---------------------------------------------- StructAppend(retData, rhPropsData, true); // convert and add new data if needed //retData['linkedCalendarPage_url'] = ''; //if( StructKeyExists(rhPropsData,"linkedCalendarPage") AND TRIM(rhPropsData.linkedCalendarPage) NEQ '' ) //retData['linkedCalendarPage_url'] = application.ptCalendar.csData.parseCSURL(str=TRIM(rhPropsData.linkedCalendarPage)); return retData; var errMsg = ''; var props = arguments.propsStruct; if( StructIsEmpty(props) ) return false; return true; var errMsg = ''; var rhFormBindingQry = ''; var mdCheckQry = ''; var mdQry = ''; var mdResultQry = QueryNew('tmp'); var errMsg = "Please bind the '#arguments.metadataFormName#' Metadata Form to this Layout!"; if( NOT StructIsEmpty(arguments.rhCaller) ) { // Render handler Custom Metadata Form Binding Error handling if( NOT StructKeyExists(arguments.rhCaller,"handlerforms") OR NOT IsQuery(arguments.rhCaller.handlerforms) OR arguments.rhCaller.handlerforms.RecordCount EQ 0 ) { if( request.user.id gt 0 AND server.commonspot.udf.security.authorok() == 1 ) WriteOutput('
#errMsg#
'); return false; } else { // Set the main RH Form Bind Query rhFormBindingQry = arguments.rhCaller.handlerforms; // Query of Queries mdQry = new Query(); mdQry.setDBType('query'); mdQry.setAttributes(mdCheckQry=rhFormBindingQry); // needed for QoQ mdQry.addParam(name='FormName', value='#Trim(Lcase(arguments.MetadataFormName))#', cfsqltype='cf_sql_varchar'); mdQry.setSQL('SELECT FormName FROM mdCheckQry where lower(FormName) = :FormName'); //mdQry.setSQL('SELECT * FROM mdCheckQry'); //mdQry.setMaxRows(1); // limit max rows mdResultQry = mdQry.execute().getResult(); } // Check if the RH has specific Metadata form if( NOT mdResultQry.RecordCount ) { if ( request.user.id gt 0 AND server.commonspot.udf.security.authorok() == 1 ) WriteOutput('
#errMsg#
'); return false; } } if( NOT StructKeyExists(arguments.ElementInfo,"RenderHandlerMetaData") OR NOT StructKeyExists(arguments.ElementInfo.RenderHandlerMetaData, arguments.MetadataFormName ) OR StructIsEmpty(arguments.ElementInfo.RenderHandlerMetaData[arguments.MetadataFormName]) ) { // Props data Missing Error Message errMsg = "No properties configured. Please open this element's menu and choose the 'Custom' menu option, then configure and save the dialog."; if ( arguments.showDataError AND request.user.id gt 0 AND server.commonspot.udf.security.authorok() == 1 ) WriteOutput('
#errMsg#
'); return false; } return true;