// If the ptCalendar bean name has been defined get the app config
appConfig = StructNew();
uiTheme = "";
useEventsCache = false;
appName = "ptCalendar";
if ( StructKeyExists(application,"ptCalendar") )
{
appConfig = application.ptCalendar.getAppConfig();
// Set the UI theme from the Configuration Element
uiTheme = application.ptCalendar.getUItheme();
// Set the useEventCache flag for the management events search filtering from the configuration element
useEventsCache = application.ptCalendar.getEventsManagementEventCacheStatus();
}
// - EventsCache Manual Override
// useEventsCache = false; // (true/false) - Use this as an override for the Global settings that are managed via the Configuration element
//Path to open the ligthbox to
ajaxPath = application.ADF.lightboxProxy;
//Bean to perform add/edit
EditBean = "calEventsForms";
EditMethod = "renderEventEditForm";
EditLBaction = "refreshparent";
EditLinkTitle = "Edit Event";
editIcon = "ui-icon-pencil"; // Default jQueryUI
//Bean to perform deletion
DeleteBean = "forms";
DeleteMethod = "renderDeleteForm";
DeleteLinkTitle = "Delete Event";
deleteIcon = "ui-icon-trash"; // Default jQueryUI
//Bean to perform copy
CopyBean = "calEventsForms";
CopyMethod = "renderCopyHTMLForm";
CopyLBaction = "refreshparent";
CopyLinkTitle = "Copy Event";
copyIcon = "ui-icon-copy"; // Default jQueryUI
eventID = "";
eventQry = QueryNew("temp");
addEditUrlParameters = "&callback=updateEvent_cbFunct"; // use standard callback
deleteUrlParameters="";
copyUrlParameters="";
displayEventCopyButton = true;
// Check for Local Button Rendering Overrides
if ( !StructKeyExists(request,"adfDSmodule") )
request.adfDSmodule = StructNew();
if ( !StructKeyExists(request.adfDSmodule,"renderEditBtn") OR !IsBoolean(request.adfDSmodule.renderEditBtn) )
request.adfDSmodule.renderEditBtn = true;
if ( !StructKeyExists(request.adfDSmodule,"renderDeleteBtn") OR !IsBoolean(request.adfDSmodule.renderDeleteBtn) )
request.adfDSmodule.renderDeleteBtn = true;
if ( !StructKeyExists(request.adfDSmodule,"useJQueryUI") OR !IsBoolean(request.adfDSmodule.useJQueryUI) )
request.adfDSmodule.useJQueryUI = true;
// Bootstrap and FontAwesome: set to False by default
if ( !StructKeyExists(request.adfDSmodule,"useBootstrap") OR !IsBoolean(request.adfDSmodule.useBootstrap) )
request.adfDSmodule.useBootstrap = false;
if ( !StructKeyExists(request.adfDSmodule,"useFontAwesome") OR !IsBoolean(request.adfDSmodule.useFontAwesome) )
request.adfDSmodule.useFontAwesome = false;
if ( !StructKeyExists(request.adfDSmodule,"buttonStyle") OR LEN(TRIM(request.adfDSmodule.buttonStyle)) EQ 0 )
request.adfDSmodule.buttonStyle = "";
if ( !StructKeyExists(request.adfDSmodule,"buttonSize") OR LEN(TRIM(request.adfDSmodule.buttonSize)) EQ 0 )
request.adfDSmodule.buttonSize = "";
if ( request.adfDSmodule.useBootstrap )
{
if ( LEN(TRIM(request.adfDSmodule.buttonStyle)) EQ 0 )
request.adfDSmodule.buttonStyle = "btn-primary";
if ( LEN(TRIM(request.adfDSmodule.buttonSize)) EQ 0 )
request.adfDSmodule.buttonSize = "btn-xs";
}
if ( request.adfDSmodule.useFontAwesome )
{
if ( LEN(TRIM(request.adfDSmodule.buttonStyle)) EQ 0 )
request.adfDSmodule.buttonStyle = "fa-square";
if ( LEN(TRIM(request.adfDSmodule.buttonSize)) EQ 0 )
request.adfDSmodule.buttonSize = "fa-1x";
}
//if ( len(trim(request.datasheet.currentColumnValue)) )
//parentID = request.datasheet.currentColumnValue;
if ( len(trim(request.datasheet.currentColumnValue)) )
{
eventID = request.datasheet.currentColumnValue;
eventQry = application.ptCalendar.calEventsDAO.getEvents(eventID=eventID,useCache=useEventsCache);
if ( eventQry.RecordCount )
{
// Check if the event is a Broken Recurrence event... if so set the flag to not show the copy button
if ( LEN(TRIM(eventQry.dateTimeID[1])) AND LEN(TRIM(eventQry.dthashID[1])) )
displayEventCopyButton = false;
}
}
if ( LEN(TRIM(eventID)) )
{
deleteUrlParameters="&callback=deleteEventChildren_cbFunct&cbIDlist=#eventID#"; //deleteDateTimeRecords_cbFunct
copyUrlParameters="&eventID=#eventID#";
}
sortColumn = "Title";
sortValue = request.DataSheetRow[sortColumn][Request.DataSheetRow.CurrentRow];
// *******Modification below this should not be needed.******* //
calendarDataSheetModHeaderCSS = "";
calendarDataSheetModFooterJS = "";
formID = edata.MetadataForm;
mouseoverJS = "";
mouseoutJS = "";
if ( request.adfDSmodule.useJQueryUI )
{
mouseoverJS = "jQuery(this).addClass('ui-state-hover')";
mouseoutJS = "jQuery(this).removeClass('ui-state-hover')";
}
addEditLink = "#ajaxPath#?bean=#EditBean#&method=#EditMethod#&appName=#appName#&formid=#formID#&dataPageId=#Request.DatasheetRow.pageid#&lbAction=#EditLBaction#&title=#EditLinkTitle##addEditUrlParameters#";
deleteLink = "#ajaxPath#?bean=#DeleteBean#&method=#DeleteMethod#&appName=#appName#&formid=#formID#&dataPageid=#Request.DatasheetRow.pageid#&title=#DeleteLinkTitle##deleteUrlParameters#";
copyLink = "#ajaxPath#?bean=#CopyBean#&method=#CopyMethod#&appName=#appName#&formid=#formID#&dataPageId=#Request.DatasheetRow.pageid#&lbAction=#CopyLBaction#&title=#CopyLinkTitle##copyUrlParameters#";
if ( request.adfDSmodule.useBootstrap )
{
editIcon = "glyphicon-pencil";
deleteIcon = "glyphicon-trash";
copyIcon = "glyphicon-duplicate";
}
else if ( request.adfDSmodule.useFontAwesome )
{
editIcon = "fa-pencil";
deleteIcon = "fa-trash-o";
copyIcon = "fa-files-o";
}
// Load the script headers
application.ptCalendar.scripts.loadJQuery();
//application.ptCalendar.scripts.loadJQueryUI(themeName=uiTheme);
application.ptCalendar.scripts.loadADFLightbox();
// Load Icon Library Script (if not already loaded)
if ( request.adfDSmodule.useBootstrap )
application.ptCalendar.scripts.loadBootstrap();
if ( request.adfDSmodule.useFontAwesome )
application.ptCalendar.scripts.loadFontAwesome();
if ( request.adfDSmodule.useJQueryUI )
application.ptCalendar.scripts.loadJQueryUI();
// Load the inline CSS as a CSS Resource
application.ptCalendar.scripts.addHeaderCSS(calDataSheetModHeaderCSS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
// Load the inline JS as a JS Resource
if ( eparam.permitClientSideSort )
application.ptCalendar.scripts.addFooterJS(calDataSheetModFooterJS, "TERTIARY"); // PRIMARY, SECONDARY, TERTIARY
|