easyappointments/doc/code/js/BackendCalendar.html

1773 lines
26 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Namespace: BackendCalendar</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Namespace: BackendCalendar</h1>
<section>
<header>
<h2>
BackendCalendar
</h2>
</header>
<article>
<div class="container-overview">
<div class="description">This namespace contains functions that are used by the backend calendar page.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1">line 1</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<dl>
<dt>
<h4 class="name" id="bindEventHandlers"><span class="type-signature">&lt;static> </span>bindEventHandlers<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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".
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line195">line 195</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarDayClick"><span class="type-signature">&lt;static> </span>calendarDayClick<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1309">line 1309</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarEventClick"><span class="type-signature">&lt;static> </span>calendarEventClick<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1322">line 1322</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarEventDrop"><span class="type-signature">&lt;static> </span>calendarEventDrop<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1421">line 1421</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarEventResize"><span class="type-signature">&lt;static> </span>calendarEventResize<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1163">line 1163</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>updateAppointmentData()</li>
</ul>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarViewDisplay"><span class="type-signature">&lt;static> </span>calendarViewDisplay<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1581">line 1581</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="calendarWindowResize"><span class="type-signature">&lt;static> </span>calendarWindowResize<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1298">line 1298</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>getCalendarHeight()</li>
</ul>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="disableProviderSync"><span class="type-signature">&lt;static> </span>disableProviderSync<span class="signature">(providerId)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
This method disables the google synchronization for a specific provider.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>providerId</code></td>
<td class="type">
<span class="param-type">int</span>
</td>
<td class="description last">The selected provider record id.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1604">line 1604</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="getCalendarHeight"><span class="type-signature">&lt;static> </span>getCalendarHeight<span class="signature">()</span><span class="type-signature"> &rarr; {int}</span></h4>
</dt>
<dd>
<div class="description">
This method calculates the proper calendar height, in order to be displayed
correctly, even when the browser window is resizing.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line830">line 830</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the calendar element height in pixels.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">int</span>
</dd>
</dl>
</dd>
<dt>
<h4 class="name" id="initialize"><span class="type-signature">&lt;static> </span>initialize<span class="signature">(defaultEventHandlers)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>defaultEventHandlers</code></td>
<td class="type">
<span class="param-type">bool</span>
</td>
<td class="description last">(OPTIONAL = TRUE) Determines whether the
default event handlers will be set for the current page.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line22">line 22</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="refreshCalendarAppointments"><span class="type-signature">&lt;static> </span>refreshCalendarAppointments<span class="signature">($calendar, recordId, filterType, startDate, endDate)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
This method reloads the registered appointments for the selected date period
and filter type.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>$calendar</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">The calendar jQuery object.</td>
</tr>
<tr>
<td class="name"><code>recordId</code></td>
<td class="type">
<span class="param-type">int</span>
</td>
<td class="description last">The selected record id.</td>
</tr>
<tr>
<td class="name"><code>filterType</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The filter type, could be either FILTER_TYPE_PROVIDER
or FILTER_TYPE_SERVICE</td>
</tr>
<tr>
<td class="name"><code>startDate</code></td>
<td class="type">
<span class="param-type">date</span>
</td>
<td class="description last">Visible start date of the calendar.</td>
</tr>
<tr>
<td class="name"><code>endDate</code></td>
<td class="type">
<span class="param-type">type</span>
</td>
<td class="description last">Visible end date of the calendar.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line847">line 847</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="resetAppointmentDialog"><span class="type-signature">&lt;static> </span>resetAppointmentDialog<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
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.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1629">line 1629</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="resetUnavailableDialog"><span class="type-signature">&lt;static> </span>resetUnavailableDialog<span class="signature">()</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Reset the "#manage-unavailable" dialog. Use this method to bring the dialog
to the initial state before it becomes visible to the user.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1734">line 1734</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="saveAppointment"><span class="type-signature">&lt;static> </span>saveAppointment<span class="signature">(appointment, customer, successCallback, errorCallback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
This method stores the changes of an already registered appointment
into the database, via an ajax call.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>appointment</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Contain the new appointment data. The
id of the appointment MUST be already included. The rest values must
follow the database structure.</td>
</tr>
<tr>
<td class="name"><code>customer</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">(OPTIONAL) contains the customer data.</td>
</tr>
<tr>
<td class="name"><code>successCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(OPTIONAL) If defined, this function is
going to be executed on post success.</td>
</tr>
<tr>
<td class="name"><code>errorCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">(OPTIONAL) If defined, this function is
going to be executed on post failure.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1093">line 1093</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="saveUnavailable"><span class="type-signature">&lt;static> </span>saveUnavailable<span class="signature">(unavailable, successCallback, errorCallback)</span><span class="type-signature"></span></h4>
</dt>
<dd>
<div class="description">
Save unavailable period to database.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>unavailable</code></td>
<td class="type">
<span class="param-type">object</span>
</td>
<td class="description last">Containts the unavailable period data.</td>
</tr>
<tr>
<td class="name"><code>successCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The ajax success callback function.</td>
</tr>
<tr>
<td class="name"><code>errorCallback</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="description last">The ajax failure callback function.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1138">line 1138</a>
</li></ul></dd>
</dl>
</dd>
<dt>
<h4 class="name" id="validateAppointmentForm"><span class="type-signature">&lt;static> </span>validateAppointmentForm<span class="signature">()</span><span class="type-signature"> &rarr; {bool}</span></h4>
</dt>
<dd>
<div class="description">
Validate the manage appointment dialog data. Validation checks need to
run every time the data are going to be saved.
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="backend_calendar.js.html">backend_calendar.js</a>, <a href="backend_calendar.js.html#line1697">line 1697</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Returns the validation result.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">bool</span>
</dd>
</dl>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Index</a></h2><h3>Classes</h3><ul><li><a href="AdminsHelper.html">AdminsHelper</a></li><li><a href="CategoriesHelper.html">CategoriesHelper</a></li><li><a href="CustomersHelper.html">CustomersHelper</a></li><li><a href="ProvidersHelper.html">ProvidersHelper</a></li><li><a href="SecretariesHelper.html">SecretariesHelper</a></li><li><a href="ServicesHelper.html">ServicesHelper</a></li><li><a href="SystemSettings.html">SystemSettings</a></li><li><a href="UserSettings.html">UserSettings</a></li><li><a href="WorkingPlan.html">WorkingPlan</a></li></ul><h3>Namespaces</h3><ul><li><a href="Backend.html">Backend</a></li><li><a href="BackendCalendar.html">BackendCalendar</a></li><li><a href="BackendCustomers.html">BackendCustomers</a></li><li><a href="BackendServices.html">BackendServices</a></li><li><a href="BackendSettings.html">BackendSettings</a></li><li><a href="BackendUsers.html">BackendUsers</a></li><li><a href="FrontendBook.html">FrontendBook</a></li><li><a href="GeneralFunctions.html">GeneralFunctions</a></li></ul><h3>Global</h3><ul><li><a href="global.html#enableCancel">enableCancel</a></li><li><a href="global.html#enableSubmit">enableSubmit</a></li></ul>
</nav>
<br clear="both">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.2.0-dev</a> on Sat Oct 19 2013 11:58:41 GMT+0300 (EEST)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>