this.ElementName = "Calendar2";
this.CCAPIName = "Calendar2";
this.ElementIDfield = "uniqueID";
var newEventStruct = StructNew();
//var reHTML = "";
//var ceArray = ArrayNew(1);
var srcEventStruct = Structnew();
var idfieldname = "uniqueID";
var formID = getCalendarFormID();
var dataPageID = "";
//var lbAction = "refreshparent";
//var customizedFinalHtml = "";
//var renderResult = "false";
neweventStruct = Application.ptCalendar2.calendarDAO.copyCalendarEventByUniqueID(TRIM(arguments.uniqueID),TRIM(arguments.interval));
if ( LEN(TRIM(neweventStruct.newUniqueID)) )
srcEventStruct = Application.ptCalendar2.calendarDAO.getCalendarEventByUniqueID(neweventStruct.newUniqueID);
//ceArray = application.ptCalendar2.ceData.getCEData(this.ElementName,idfieldname,neweventStruct.newUniqueID);
//if ( ArrayLen(ceArray) )
// dataPageID = ceArray[1].PageID;
if ( structKeyExists(srcEventStruct,"PageID") )
neweventStruct["dataPageID"] = srcEventStruct.PageID;
/* Moved to inside the AJAX GET after to open a new light box window */
//if ( IsNumeric(dataPageID) )
//reHTML = Application.ptCalendar2.forms.renderAddEditForm(formID,dataPageID,lbAction,URLEncodedFormat(customizedFinalHtml),renderResult);
//reHTML = Application.ptCalendar2.eventForms.renderEventForm(formID,dataPageID,lbAction,URLEncodedFormat(customizedFinalHtml),renderResult);
///neweventStruct["formHTML"] = reHTML;
return neweventStruct;