forked from mirrors/easyappointments
Removed unnecessary files
This commit is contained in:
parent
4eec5fbe46
commit
80e77ad8a0
4 changed files with 0 additions and 329 deletions
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" ?><svg height="32px" version="1.1" viewBox="0 0 32 32" width="32px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#157EFB" id="icon-21-eye-hidden"><path d="M8.10869891,20.8913011 C4.61720816,18.8301147 3,16 3,16 C3,16 7,9 16,9 C17.3045107,9 18.5039752,9.14706466 19.6014388,9.39856122 L18.7519017,10.2480983 C17.8971484,10.0900546 16.9800929,10 16,10 C8,10 4.19995117,16 4.19995117,16 C4.19995117,16 5.71472808,18.3917225 8.84492713,20.1550729 L8.10869891,20.8913011 L8.10869891,20.8913011 L8.10869891,20.8913011 Z M12.398561,22.601439 C13.4960246,22.8529356 14.6954892,23.0000001 16,23 C25,22.999999 29,16 29,16 C29,16 27.3827918,13.1698856 23.8913008,11.1086992 L23.1550727,11.8449273 C26.2852719,13.6082776 27.8000488,16 27.8000488,16 C27.8000488,16 24,21.999999 16,22 C15.019907,22.0000001 14.1028515,21.9099455 13.2480981,21.7519019 L12.398561,22.601439 L12.398561,22.601439 L12.398561,22.601439 Z M19.8986531,15.1013469 C19.9649658,15.3902115 20,15.6910144 20,16 C20,18.2091391 18.2091391,20 16,20 C15.6910144,20 15.3902115,19.9649658 15.1013469,19.8986531 L16,19 C16.7677669,19.0000001 17.5355339,18.7071068 18.1213203,18.1213203 C18.7071068,17.5355339 19.0000001,16.7677669 19,16 L19.8986531,15.1013469 L19.8986531,15.1013469 L19.8986531,15.1013469 Z M16.8986531,12.1013469 C16.6097885,12.0350342 16.3089856,12 16,12 C13.7908609,12 12,13.7908609 12,16 C12,16.3089856 12.0350342,16.6097885 12.1013469,16.8986531 L13,16 C12.9999999,15.2322331 13.2928932,14.4644661 13.8786797,13.8786797 C14.4644661,13.2928932 15.2322331,12.9999999 16,13 L16.8986531,12.1013469 L16.8986531,12.1013469 L16.8986531,12.1013469 Z M24,7 L7,24 L8,25 L25,8 L24,7 L24,7 Z" id="eye-hidden"/></g></g></svg>
|
|
Before Width: | Height: | Size: 1.9 KiB |
|
@ -1 +0,0 @@
|
||||||
<?xml version="1.0" ?><svg height="32px" version="1.1" viewBox="0 0 32 32" width="32px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#157EFB" id="icon-22-eye"><path d="M17,9 C8,9 4,16 4,16 C4,16 8,23.000001 17,23 C26,22.999999 30,16 30,16 C30,16 26,9 17,9 L17,9 Z M17,20 C19.2091391,20 21,18.2091391 21,16 C21,13.7908609 19.2091391,12 17,12 C14.7908609,12 13,13.7908609 13,16 C13,18.2091391 14.7908609,20 17,20 L17,20 Z M17,19 C18.6568543,19 20,17.6568543 20,16 C20,14.3431457 18.6568543,13 17,13 C15.3431457,13 14,14.3431457 14,16 C14,17.6568543 15.3431457,19 17,19 L17,19 Z M17,17 C17.5522848,17 18,16.5522848 18,16 C18,15.4477152 17.5522848,15 17,15 C16.4477152,15 16,15.4477152 16,16 C16,16.5522848 16.4477152,17 17,17 L17,17 Z" id="eye"/></g></g></svg>
|
|
Before Width: | Height: | Size: 954 B |
|
@ -1,165 +0,0 @@
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
* Easy!Appointments - Open Source Web Scheduler
|
|
||||||
*
|
|
||||||
* @package EasyAppointments
|
|
||||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
|
||||||
* @copyright Copyright (c) Alex Tselegidis
|
|
||||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
||||||
* @link https://easyappointments.org
|
|
||||||
* @since v1.0.0
|
|
||||||
* ---------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
window.BackendSettingsClientForm = window.BackendSettingsClientForm || {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Backend Settings
|
|
||||||
*
|
|
||||||
* Contains the functionality of the backend settings page. Can either work for system or user settings,
|
|
||||||
* but the actions allowed to the user are restricted to his role (only admin has full privileges).
|
|
||||||
*
|
|
||||||
* @module BackendSettingsClientForm
|
|
||||||
*/
|
|
||||||
(function (exports) {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
// Constants
|
|
||||||
exports.SETTINGS_SYSTEM = 'SETTINGS_SYSTEM';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Tab settings object.
|
|
||||||
*
|
|
||||||
* @type {Object}
|
|
||||||
*/
|
|
||||||
var settings = {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Initialize Page
|
|
||||||
*
|
|
||||||
* @param {bool} defaultEventHandlers Optional (true), determines whether to bind the default event handlers.
|
|
||||||
*/
|
|
||||||
exports.initialize = function (defaultEventHandlers) {
|
|
||||||
defaultEventHandlers = defaultEventHandlers || true;
|
|
||||||
|
|
||||||
// Apply setting values from database.
|
|
||||||
GlobalVariables.settings.system.forEach(function (setting) {
|
|
||||||
$('input[data-field="' + setting.name + '"]').val(setting.value);
|
|
||||||
$('select[data-field="' + setting.name + '"]').val(setting.value);
|
|
||||||
|
|
||||||
if (setting.name === 'customer_notifications') {
|
|
||||||
$('#customer-notifications').prop('checked', Boolean(Number(setting.value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setting.name === 'require_captcha') {
|
|
||||||
$('#require-captcha').prop('checked', Boolean(Number(setting.value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setting.name === 'require_phone_number') {
|
|
||||||
$('#require-phone-number').prop('checked', Boolean(Number(setting.value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setting.name === 'display_any_provider') {
|
|
||||||
$('#display-any-provider').prop('checked', Boolean(Number(setting.value)));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (setting.name === 'display_cookie_notice') {
|
|
||||||
$('#display-cookie-notice').prop('checked', Boolean(Number(setting.value)));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Set default settings helper.
|
|
||||||
settings = new SystemSettingsClientFormHelper();
|
|
||||||
|
|
||||||
if (defaultEventHandlers) {
|
|
||||||
bindEventHandlers();
|
|
||||||
}
|
|
||||||
|
|
||||||
Backend.placeFooterToBottom();
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Bind the backend/settings default event handlers.
|
|
||||||
*
|
|
||||||
* This method depends on the backend/settings html, so do not use this method on a different page.
|
|
||||||
*/
|
|
||||||
function bindEventHandlers() {
|
|
||||||
/**
|
|
||||||
* Event: Save Settings Button "Click"
|
|
||||||
*
|
|
||||||
* Store the setting changes into the database.
|
|
||||||
*/
|
|
||||||
$('.save-settings').on('click', function () {
|
|
||||||
var data = settings.get();
|
|
||||||
settings.save(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Event: Visible/Hidden button "Click"
|
|
||||||
*
|
|
||||||
* Change the state of the Visible/Hidden button
|
|
||||||
*/
|
|
||||||
$('.hide-toggle').on('click', function () {
|
|
||||||
var $target = $(this);
|
|
||||||
|
|
||||||
$target.find('span').each(function (index, span) {
|
|
||||||
var $span = $(span);
|
|
||||||
|
|
||||||
var isHidden = $span.prop('hidden');
|
|
||||||
|
|
||||||
$span.prop('hidden', !isHidden);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set a Visible/Hidden toggle button to a certain state.
|
|
||||||
*
|
|
||||||
* @param {jQuery} $target Target element selector.
|
|
||||||
* @param {Boolean} isVisible a boolean which is true if the button should display 'visible' and false when the button should display 'hidden'
|
|
||||||
*/
|
|
||||||
function setShowToggleValue($target, isVisible) {
|
|
||||||
if (getShowToggleValue($target) !== isVisible) {
|
|
||||||
$target.find('span').each(function (index, span) {
|
|
||||||
var $span = $(span);
|
|
||||||
|
|
||||||
var isHidden = $span.prop('hidden');
|
|
||||||
|
|
||||||
$span.prop('hidden', !isHidden);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the Visible/Hidden toggle button
|
|
||||||
*
|
|
||||||
* @param {jQuery} $target Target element selector.
|
|
||||||
*
|
|
||||||
* @return the state of the button. True for visible, false for hidden.
|
|
||||||
*/
|
|
||||||
function getShowToggleValue($target) {
|
|
||||||
var visiblePartArray = $target.find('.hide-toggle-visible');
|
|
||||||
return !visiblePartArray.prop('hidden');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Event: require phone number switch "Click"
|
|
||||||
*
|
|
||||||
* make sure that our phone number is visible when it is required.
|
|
||||||
*/
|
|
||||||
$('#show-phone-number').on('click', function () {
|
|
||||||
if (!getShowToggleValue($(this))) {
|
|
||||||
//if button is set to hidden
|
|
||||||
$('#require-phone-number').prop('checked', false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Event: require phone number switch "Click"
|
|
||||||
*
|
|
||||||
* make sure that our phone number is visible when it is required.
|
|
||||||
*/
|
|
||||||
$('#require-phone-number').on('click', function () {
|
|
||||||
if ($(this).prop('checked')) {
|
|
||||||
setShowToggleValue($('#show-phone-number'), true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
})(window.BackendSettingsClientForm);
|
|
|
@ -1,162 +0,0 @@
|
||||||
/* ----------------------------------------------------------------------------
|
|
||||||
* Easy!Appointments - Open Source Web Scheduler
|
|
||||||
*
|
|
||||||
* @package EasyAppointments
|
|
||||||
* @author A.Tselegidis <alextselegidis@gmail.com>
|
|
||||||
* @copyright Copyright (c) Alex Tselegidis
|
|
||||||
* @license https://opensource.org/licenses/GPL-3.0 - GPLv3
|
|
||||||
* @link https://easyappointments.org
|
|
||||||
* @since v1.0.0
|
|
||||||
* ---------------------------------------------------------------------------- */
|
|
||||||
|
|
||||||
(function () {
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* "System Settings" Tab Helper Class
|
|
||||||
*
|
|
||||||
* @class SystemSettingsClientFormHelper
|
|
||||||
*/
|
|
||||||
var SystemSettingsClientFormHelper = function () {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save the system settings.
|
|
||||||
*
|
|
||||||
* This method is run after changes are detected on the tab input fields.
|
|
||||||
*
|
|
||||||
* @param {Array} settings Contains the system settings data.
|
|
||||||
*/
|
|
||||||
SystemSettingsClientFormHelper.prototype.save = function (settings) {
|
|
||||||
if (!this.validate()) {
|
|
||||||
return; // Validation failed, do not proceed.
|
|
||||||
}
|
|
||||||
|
|
||||||
var url = GlobalVariables.baseUrl + '/index.php/settings/client_form/save';
|
|
||||||
|
|
||||||
var data = {
|
|
||||||
csrf_token: GlobalVariables.csrfToken,
|
|
||||||
settings: JSON.stringify(settings),
|
|
||||||
type: BackendSettingsClientForm.SETTINGS_SYSTEM
|
|
||||||
};
|
|
||||||
|
|
||||||
$.post(url, data).done(function () {
|
|
||||||
Backend.displayNotification(App.Lang.settings_saved);
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the state of a visible/hidden toggle button
|
|
||||||
*
|
|
||||||
* This method uses the DOM elements of the backend/settings page, so it can't be used in another page.
|
|
||||||
*
|
|
||||||
* @argument the element jquery of a button object that is a visible/hidden toggle.
|
|
||||||
*
|
|
||||||
* @return '0' when the button shows 'invisible' and '1' when the button shows 'visible'. Will always return '0' on an error.
|
|
||||||
*/
|
|
||||||
function getToggleButtonState($element) {
|
|
||||||
var visiblePartArray = $element.find('.hide-toggle-visible');
|
|
||||||
var invisiblePartArray = $element.find('.hide-toggle-hidden');
|
|
||||||
if (!(visiblePartArray.length === 0 || invisiblePartArray.length === 0)) {
|
|
||||||
if (visiblePartArray.prop('hidden')) {
|
|
||||||
//our button is currently invisible
|
|
||||||
return '0'; //invisible
|
|
||||||
} else {
|
|
||||||
//our button is currently visible
|
|
||||||
return '1'; //visible
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return '0'; //invisible
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Prepare the system settings array.
|
|
||||||
*
|
|
||||||
* This method uses the DOM elements of the backend/settings page, so it can't be used in another page.
|
|
||||||
*
|
|
||||||
* @return {Array} Returns the system settings array.
|
|
||||||
*/
|
|
||||||
SystemSettingsClientFormHelper.prototype.get = function () {
|
|
||||||
var settings = [];
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'customer_notifications',
|
|
||||||
value: $('#customer-notifications').prop('checked') ? '1' : '0'
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'require_captcha',
|
|
||||||
value: $('#require-captcha').prop('checked') ? '1' : '0'
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'require_phone_number',
|
|
||||||
value: $('#require-phone-number').prop('checked') ? '1' : '0'
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'display_any_provider',
|
|
||||||
value: $('#display-any-provider').prop('checked') ? '1' : '0'
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'show_phone_number',
|
|
||||||
value: getToggleButtonState($('#show-phone-number'))
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'show_address',
|
|
||||||
value: getToggleButtonState($('#show-address'))
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'show_city',
|
|
||||||
value: getToggleButtonState($('#show-city'))
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'show_zip_code',
|
|
||||||
value: getToggleButtonState($('#show-zip-code'))
|
|
||||||
});
|
|
||||||
|
|
||||||
settings.push({
|
|
||||||
name: 'show_notes',
|
|
||||||
value: getToggleButtonState($('#show-notes'))
|
|
||||||
});
|
|
||||||
|
|
||||||
return settings;
|
|
||||||
};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Validate the settings data.
|
|
||||||
*
|
|
||||||
* If the validation fails then display a message to the user.
|
|
||||||
*
|
|
||||||
* @return {Boolean} Returns the validation result.
|
|
||||||
*/
|
|
||||||
SystemSettingsClientFormHelper.prototype.validate = function () {
|
|
||||||
$('#client-form .is-invalid').removeClass('is-invalid');
|
|
||||||
|
|
||||||
try {
|
|
||||||
// Validate required fields.
|
|
||||||
var missingRequired = false;
|
|
||||||
$('#client-form .required').each(function (index, requiredField) {
|
|
||||||
if (!$(requiredField).val()) {
|
|
||||||
$(requiredField).addClass('is-invalid');
|
|
||||||
missingRequired = true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (missingRequired) {
|
|
||||||
throw new Error(App.Lang.fields_are_required);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
} catch (error) {
|
|
||||||
Backend.displayNotification(error.message);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
window.SystemSettingsClientFormHelper = SystemSettingsClientFormHelper;
|
|
||||||
})();
|
|
Loading…
Reference in a new issue