/* ---------------------------------------------------------------------------- * Easy!Appointments - Open Source Web Scheduler * * @package EasyAppointments * @author A.Tselegidis * @copyright Copyright (c) 2013 - 2020, Alex Tselegidis * @license http://opensource.org/licenses/GPL-3.0 - GPLv3 * @link http://easyappointments.org * @since v1.0.0 * ---------------------------------------------------------------------------- */ window.BackendUsers = window.BackendUsers || {}; /** * Backend Users * * This module handles the js functionality of the users backend page. It uses three other * classes (defined below) in order to handle the admin, provider and secretary record types. * * @module BackendUsers */ (function (exports) { 'use strict'; /** * Minimum Password Length * * @type {Number} */ exports.MIN_PASSWORD_LENGTH = 7; /** * Contains the current tab record methods for the page. * * @type {AdminsHelper|ProvidersHelper|SecretariesHelper} */ var helper = {}; /** * Use this class instance for performing actions on the working plan. * * @type {WorkingPlan} */ exports.wp = {}; /** * Initialize the backend users page. * * @param {Boolean} defaultEventHandlers (OPTIONAL) Whether to bind the default event handlers. */ exports.initialize = function (defaultEventHandlers) { defaultEventHandlers = defaultEventHandlers || true; exports.wp = new WorkingPlan(); exports.wp.bindEventHandlers(); // Instantiate default helper object (admin). helper = new ProvidersHelper(); helper.resetForm(); helper.filter(''); helper.bindEventHandlers(); // Fill the services and providers list boxes. GlobalVariables.services.forEach(function(service) { $('
', { 'class': 'checkbox', 'html': [ $('
', { 'class': 'checkbox form-check', 'html': [ $('', { 'class': 'form-check-input', 'type': 'checkbox', 'data-id': service.id }), $('