diff --git a/README.md b/README.md index 014e03c78..a28d76be5 100644 --- a/README.md +++ b/README.md @@ -141,6 +141,14 @@ respect the alphabet while sorting customer entered content. For that purpose the application config file has `locale_code_for_sorting` entry. By default the value is `en` (English). One can override it with other locales such as `cs`, `fr`, `de` etc. +### Force employees to pick type each time new leave is booked + +Some organizations require employees to explicitly pick the type of leave when booking time off. So employee makes a choice rather than relying on default settings. +That reduce number of "mistaken" leaves, which are cancelled after. + +In order to force employee to explicitly pick the leave type of the booked time off, change `is_force_to_explicitly_select_type_when_requesting_new_leave` +flag to be `true` in the `config/app.json` file. + ## Use Redis as a sessions storage Follow instructions on [this page](docs/SessionStoreInRedis.md). diff --git a/config/app.json b/config/app.json index 106380333..26f10a8d0 100644 --- a/config/app.json +++ b/config/app.json @@ -21,5 +21,6 @@ "crypto_secret" : "!2~`HswpPPLa22+=±§sdq qwe,appp qwwokDF_", "application_domain" : "http://app.timeoff.management", "promotion_website_domain" : "http://timeoff.management", - "locale_code_for_sorting": "en" + "locale_code_for_sorting": "en", + "force_to_explicitly_select_type_when_requesting_new_leave": false } diff --git a/lib/view/helpers.js b/lib/view/helpers.js index 3ee5d8708..5677edec3 100644 --- a/lib/view/helpers.js +++ b/lib/view/helpers.js @@ -152,5 +152,13 @@ module.exports = function(){ return options.inverse(this); }, + is_force_to_explicitly_select_type_when_requesting_new_leave: function (options) { + if (!!config.get('force_to_explicitly_select_type_when_requesting_new_leave')) { + return options.fn(this); + } + + return options.inverse(this); + }, + }; }; diff --git a/views/partials/book_leave_modal.hbs b/views/partials/book_leave_modal.hbs index 389a2d8f3..c36c81d5b 100644 --- a/views/partials/book_leave_modal.hbs +++ b/views/partials/book_leave_modal.hbs @@ -23,6 +23,9 @@