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('
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('