diff --git a/src/application/language/english/translations_lang.php b/src/application/language/english/translations_lang.php index 066223ca..b5a54730 100755 --- a/src/application/language/english/translations_lang.php +++ b/src/application/language/english/translations_lang.php @@ -282,3 +282,13 @@ $lang['flexible'] = 'Flexible'; $lang['fixed'] = 'Fixed'; $lang['attendants_number'] = 'Attendants Number'; $lang['reset_working_plan'] = 'Reset the working plan back to the default values.'; +$lang['legal_contents'] = 'Legal Contents'; +$lang['cookie_notice'] = 'Cookie Notice'; +$lang['display_cookie_notice'] = 'Display Cookie Notice'; +$lang['cookie_notice_content'] = 'Cookie Notice Content'; +$lang['terms_and_conditions'] = 'Terms & Conditions'; +$lang['display_terms_and_conditions'] = 'Display Terms & Conditions'; +$lang['terms_and_conditions_content'] = 'Terms & Conditions Content'; +$lang['privacy_policy'] = 'Privacy Policy'; +$lang['display_privacy_policy'] = 'Display Privacy Policy'; +$lang['privacy_policy_content'] = 'Privacy Policy Content'; diff --git a/src/application/views/backend/settings.php b/src/application/views/backend/settings.php index 434458d5..65d9232b 100755 --- a/src/application/views/backend/settings.php +++ b/src/application/views/backend/settings.php @@ -40,6 +40,11 @@ + +
  • + +
  • +
  • @@ -324,6 +329,80 @@ + + + + + diff --git a/src/assets/js/backend_settings.js b/src/assets/js/backend_settings.js index d66b6c10..6d20efe9 100644 --- a/src/assets/js/backend_settings.js +++ b/src/assets/js/backend_settings.js @@ -49,6 +49,8 @@ window.BackendSettings = window.BackendSettings || {}; exports.initialize = function (bindEventHandlers) { bindEventHandlers = bindEventHandlers || true; + $('#cookie-notice-content, #terms-and-conditions-content, #privacy-policy-content').trumbowyg(); + // Apply setting values from database. $.each(GlobalVariables.settings.system, function (index, setting) { $('input[data-field="' + setting.name + '"]').val(setting.value); @@ -57,17 +59,41 @@ window.BackendSettings = window.BackendSettings || {}; var workingPlan = {}; $.each(GlobalVariables.settings.system, function (index, setting) { - if (setting.name == 'company_working_plan') { + if (setting.name === 'company_working_plan') { workingPlan = $.parseJSON(setting.value); } - if (setting.name == 'customer_notifications' && setting.value == '1') { + if (setting.name === 'customer_notifications' && setting.value === '1') { $('#customer-notifications').addClass('active'); } - if (setting.name == 'require_captcha' && setting.value == '1') { + if (setting.name === 'require_captcha' && setting.value === '1') { $('#require-captcha').addClass('active'); } + + if (setting.name === 'display_cookie_notice') { + $('#display-cookie-notice').prop('checked', setting.value === '1'); + } + + if (setting.name === 'cookie_notice_content') { + $('#cookie-notice-content').trumbowyg('html', setting.value); + } + + if (setting.name === 'display_terms_and_conditions') { + $('#display-terms-and-conditions').prop('checked', setting.value === '1'); + } + + if (setting.name === 'terms_and_conditions_content') { + $('#terms-and-conditions-content').trumbowyg('html', setting.value); + } + + if (setting.name === 'display_privacy_policy') { + $('#display-privacy-policy').prop('checked', setting.value === '1'); + } + + if (setting.name === 'privacy_policy_content') { + $('#privacy-policy-content').trumbowyg('html', setting.value); + } }); exports.wp = new WorkingPlan(); @@ -144,6 +170,8 @@ window.BackendSettings = window.BackendSettings || {}; settings = new SystemSettings(); } else if (href === '#business-logic') { settings = new SystemSettings(); + } else if (href === '#legal-contents') { + settings = new SystemSettings(); } else if (href === '#current-user') { settings = new UserSettings(); diff --git a/src/assets/js/backend_settings_system.js b/src/assets/js/backend_settings_system.js index 9337eb39..e2c4fe4b 100644 --- a/src/assets/js/backend_settings_system.js +++ b/src/assets/js/backend_settings_system.js @@ -93,6 +93,37 @@ value: $('#book-advance-timeout').val() }); + // Legal Contents Tab + settings.push({ + name: 'display_cookie_notice', + value: $('#display-cookie-notice').prop('checked') ? '1' : '0' + }); + + settings.push({ + name: 'cookie_notice_content', + value: $('#cookie-notice-content').trumbowyg('html') + }); + + settings.push({ + name: 'display_terms_and_conditions', + value: $('#display-terms-and-conditions').prop('checked') ? '1' : '0' + }); + + settings.push({ + name: 'terms_and_conditions_content', + value: $('#terms-and-conditions-content').trumbowyg('html') + }); + + settings.push({ + name: 'display_privacy_policy', + value: $('#display-privacy-policy').prop('checked') ? '1' : '0' + }); + + settings.push({ + name: 'privacy_policy_content', + value: $('#privacy-policy-content').trumbowyg('html') + }); + return settings; };