This namespace contains functions that are used by the backend calendar page.
- Source:
Methods
-
<static> bindEventHandlers()
-
This method binds the default event handlers for the backend calendar page. If you do not need the default handlers then initialize the page by setting the "defaultEventHandlers" argument to "false".
- Source:
-
<static> calendarDayClick()
-
Calendar Day "Click" Callback When the user clicks on a day square on the calendar, then he will automatically be transfered to that day view calendar.
- Source:
-
<static> calendarEventClick()
-
Calendar Event "Click" Callback When the user clicks on an appointment object on the calendar, then a data preview popover is display above the calendar item.
- Source:
-
<static> calendarEventDrop()
-
Calendar Event "Drop" Callback This event handler is triggered whenever the user drags and drops an event into a different position on the calendar. We need to update the database with this change. This is done via an ajax call.
- Source:
-
<static> calendarEventResize()
-
Calendar Event "Resize" Callback The user can change the duration of an event by resizing an appointment object on the calendar. This change needs to be stored to the database too and this is done via an ajax call.
- Source:
- See:
-
- updateAppointmentData()
-
<static> calendarViewDisplay()
-
Calendar "View Display" Callback Whenever the calendar changes or refreshes its view certain actions need to be made, in order to display proper information to the user.
- Source:
-
<static> calendarWindowResize()
-
Calendar Window "Resize" Callback The calendar element needs to be resized too in order to fit into the window. Nevertheless, if the window becomes very small the the calendar won't shrink anymore.
- Source:
- See:
-
- getCalendarHeight()
-
<static> disableProviderSync(providerId)
-
This method disables the google synchronization for a specific provider.
Parameters:
Name Type Description providerId
int The selected provider record id. - Source:
-
<static> getCalendarHeight() → {int}
-
This method calculates the proper calendar height, in order to be displayed correctly, even when the browser window is resizing.
- Source:
Returns:
Returns the calendar element height in pixels.- Type
- int
-
<static> initialize(defaultEventHandlers)
-
This function makes the necessary initialization for the default backend calendar page. If this namespace is used in another page then this function might not be needed.
Parameters:
Name Type Description defaultEventHandlers
bool (OPTIONAL = TRUE) Determines whether the default event handlers will be set for the current page. - Source:
-
<static> refreshCalendarAppointments($calendar, recordId, filterType, startDate, endDate)
-
This method reloads the registered appointments for the selected date period and filter type.
Parameters:
Name Type Description $calendar
object The calendar jQuery object. recordId
int The selected record id. filterType
string The filter type, could be either FILTER_TYPE_PROVIDER or FILTER_TYPE_SERVICE startDate
date Visible start date of the calendar. endDate
type Visible end date of the calendar. - Source:
-
<static> resetAppointmentDialog()
-
This method resets the manage appointment dialog modal to its initial state. After that you can make any modification might be necessary in order to bring the dialog to the desired state.
- Source:
-
<static> resetUnavailableDialog()
-
Reset the "#manage-unavailable" dialog. Use this method to bring the dialog to the initial state before it becomes visible to the user.
- Source:
-
<static> saveAppointment(appointment, customer, successCallback, errorCallback)
-
This method stores the changes of an already registered appointment into the database, via an ajax call.
Parameters:
Name Type Description appointment
object Contain the new appointment data. The id of the appointment MUST be already included. The rest values must follow the database structure. customer
object (OPTIONAL) contains the customer data. successCallback
function (OPTIONAL) If defined, this function is going to be executed on post success. errorCallback
function (OPTIONAL) If defined, this function is going to be executed on post failure. - Source:
-
<static> saveUnavailable(unavailable, successCallback, errorCallback)
-
Save unavailable period to database.
Parameters:
Name Type Description unavailable
object Containts the unavailable period data. successCallback
function The ajax success callback function. errorCallback
function The ajax failure callback function. - Source:
-
<static> validateAppointmentForm() → {bool}
-
Validate the manage appointment dialog data. Validation checks need to run every time the data are going to be saved.
- Source:
Returns:
Returns the validation result.- Type
- bool