From 513b0101ebf636536ca8fe812350bc5ec0f1c2d5 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 29 Mar 2020 19:25:23 +0200 Subject: [PATCH] Added new button for applying the global working plan to all providers (#551). --- application/controllers/Backend_api.php | 34 ++++++++++++++++ .../language/arabic/translations_lang.php | 3 ++ .../language/bulgarian/translations_lang.php | 3 ++ .../language/chinese/translations_lang.php | 3 ++ .../language/czech/translations_lang.php | 3 ++ .../language/danish/translations_lang.php | 3 ++ .../language/dutch/translations_lang.php | 3 ++ .../language/english/translations_lang.php | 3 ++ .../language/finnish/translations_lang.php | 3 ++ .../language/french/translations_lang.php | 3 ++ .../language/german/translations_lang.php | 3 ++ .../language/greek/translations_lang.php | 3 ++ .../language/hindi/translations_lang.php | 3 ++ .../language/hungarian/translations_lang.php | 3 ++ .../language/italian/translations_lang.php | 3 ++ .../language/japanese/translations_lang.php | 3 ++ .../luxembourgish/translations_lang.php | 3 ++ .../language/marathi/translations_lang.php | 3 ++ .../language/polish/translations_lang.php | 3 ++ .../portuguese-br/translations_lang.php | 3 ++ .../language/portuguese/translations_lang.php | 3 ++ .../language/romanian/translations_lang.php | 6 +++ .../language/russian/translations_lang.php | 3 ++ .../language/slovak/translations_lang.php | 3 ++ .../language/spanish/translations_lang.php | 3 ++ .../language/turkish/translations_lang.php | 3 ++ application/views/backend/settings.php | 7 ++++ assets/js/backend_settings.js | 39 +++++++++++++++++++ 28 files changed, 158 insertions(+) diff --git a/application/controllers/Backend_api.php b/application/controllers/Backend_api.php index c755bbed..0e6e631a 100755 --- a/application/controllers/Backend_api.php +++ b/application/controllers/Backend_api.php @@ -1739,4 +1739,38 @@ class Backend_api extends CI_Controller { ->set_output(json_encode(['exceptions' => [exceptionToJavaScript($exc)]])); } } + + /** + * Apply global working plan to all providers. + */ + public function ajax_apply_global_working_plan() + { + try + { + if ($this->privileges[PRIV_SYSTEM_SETTINGS]['edit'] == FALSE) + { + throw new Exception('You do not have the required privileges for this task.'); + } + + $working_plan = $this->input->post('working_plan'); + + $this->load->model('providers_model'); + + $providers = $this->providers_model->get_batch(); + + foreach ($providers as $provider) + { + $this->providers_model->set_setting('working_plan', $working_plan, $provider['id']); + } + + $this->output + ->set_content_type('application/json') + ->set_output(json_encode(AJAX_SUCCESS)); + } catch (Exception $exc) + { + $this->output + ->set_content_type('application/json') + ->set_output(json_encode(['exceptions' => [exceptionToJavaScript($exc)]])); + } + } } diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 6c67d07f..5eaac0ab 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index e3ba869c..1e1298eb 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 0ece57d5..c12cd862 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 40678157..0673c8c1 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index d5887417..b9f07ee9 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index 71288969..87b1d4ba 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index ad616a87..44d76bdf 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index adf8390e..de811ccf 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index 6d7c46e5..cd8b876f 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 55085173..0a96dda0 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index 7ce75874..331b4c64 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index cd5298cc..b8868c05 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index b7100a39..d8c68e68 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index b333f449..be9b22f1 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index fefb7db5..1adb9f99 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 40a1e899..d165ec25 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index 9512d623..b66d1ba2 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index faf5d766..38ea27ce 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 76fe2d03..3a25db50 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index e57023e7..78934cb5 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index e698b527..07659acf 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -310,5 +310,11 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index fe76e77b..4a8b591e 100755 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 747029d3..57347496 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index aa81f12a..c017f095 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 7f66d724..5d7fd16b 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -310,3 +310,6 @@ $lang['require_phone_number_hint'] = 'When enabled, customers and users will nee $lang['check_spam_folder'] = 'Please check your spam folder if the email does not arrive within a few minutes.'; $lang['api_token_hint'] = 'Set a secret token in order to enable the token based authentication of the Easy!Appointments API.'; $lang['timezone'] = 'Timezone'; +$lang['overwrite_existing_working_plans'] = 'This will overwrite the existing provider working plans, are you sure that you want to continue?'; +$lang['working_plans_got_updated'] = 'All the working plans got updated.'; +$lang['apply_to_all_providers'] = 'Apply To All Providers'; diff --git a/application/views/backend/settings.php b/application/views/backend/settings.php index 9a6175ba..b68c47a0 100755 --- a/application/views/backend/settings.php +++ b/application/views/backend/settings.php @@ -244,6 +244,13 @@ +
+ +
+

diff --git a/assets/js/backend_settings.js b/assets/js/backend_settings.js index 2ff1a630..a36baba9 100644 --- a/assets/js/backend_settings.js +++ b/assets/js/backend_settings.js @@ -236,6 +236,45 @@ window.BackendSettings = window.BackendSettings || {}; } }, 'json').fail(GeneralFunctions.ajaxFailureHandler); }); + + /** + * Event: Apply Global Working Plan + */ + $('#apply-global-working-plan').on('click', function() { + var buttons = [ + { + text: 'OK', + click: function() { + var postUrl = GlobalVariables.baseUrl + '/index.php/backend_api/ajax_apply_global_working_plan'; + + var postData = { + csrfToken: GlobalVariables.csrfToken, + working_plan: JSON.stringify(exports.wp.get()), + }; + + $.post(postUrl, postData, function (response) { + if (!GeneralFunctions.handleAjaxExceptions(response)) { + return; + } + + Backend.displayNotification(EALang.working_plans_got_updated); + }, 'json') + .fail(GeneralFunctions.ajaxFailureHandler) + .always(function() { + $('#message_box').dialog('close'); + }); + } + }, + { + text: EALang.cancel, + click: function() { + $('#message_box').dialog('close'); + } + } + ]; + + GeneralFunctions.displayMessageBox(EALang.working_plan, EALang.overwrite_existing_working_plans, buttons); + }); } })(window.BackendSettings);