File: scotts\widgets\gsp_calendar_debug\server.js
(function() {
/**
*
* @class GSPCalendarDebug.Server
* @constructor
* @extends Widget.Server
* @module Widgets
*/
/**
* The PortalCalendar for the active service portal.
* @property calendar
* @type GlideRecord | PortalCalendar
*/
var calendar = new GlideRecord("u_portal_calendar"),
/**
* The GlideRecord for the active ServicePortal from which to pull values
* such as the current calendar or owner information if needed.
* @property sp
* @type GlideRecord | ServicePortal
*/
sp = $sp.getPortalRecord(),
/**
* Used for retrieving necessary calendar information.
* @property utility
* @type CWTCalendarUtil
*/
utility;
calendar.get("u_sp_portal", sp.sys_id.getValue());
utility = new CWTCalendarUtil(calendar.getValue("sys_id"));
/**
* All active events for the currently associated Calendar.
*
* This may pose a memory issue at a future point, but the current
* use case lets this remain simple.
*
* See the Calendar utility for the details retrieved by the
* {{#crossLink "CWTCalendarUtil/getEvents:method"}}{{/crossLink}}
* method.
* @property data.events
* @type Object
*/
data.events = utility.getEvents();
})();