diff --git a/application/controllers/Calendar.php b/application/controllers/Calendar.php index 679710cc..df14b57a 100644 --- a/application/controllers/Calendar.php +++ b/application/controllers/Calendar.php @@ -444,6 +444,11 @@ class Calendar extends EA_Controller { $working_plan_exception = request('working_plan_exception'); + if ( ! $working_plan_exception) + { + $working_plan_exception = NULL; + } + $provider_id = request('provider_id'); $this->providers_model->save_working_plan_exception($provider_id, $date, $working_plan_exception); diff --git a/application/language/arabic/translations_lang.php b/application/language/arabic/translations_lang.php index 3de1bda2..6a9876f7 100755 --- a/application/language/arabic/translations_lang.php +++ b/application/language/arabic/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/bulgarian/translations_lang.php b/application/language/bulgarian/translations_lang.php index 44885702..be595db0 100755 --- a/application/language/bulgarian/translations_lang.php +++ b/application/language/bulgarian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/catalan/translations_lang.php b/application/language/catalan/translations_lang.php index 581a5750..fd550aed 100644 --- a/application/language/catalan/translations_lang.php +++ b/application/language/catalan/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/chinese/translations_lang.php b/application/language/chinese/translations_lang.php index 81e70440..1a6e1c5f 100755 --- a/application/language/chinese/translations_lang.php +++ b/application/language/chinese/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/croatian/translations_lang.php b/application/language/croatian/translations_lang.php index 3e6eee26..e0d175c4 100644 --- a/application/language/croatian/translations_lang.php +++ b/application/language/croatian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Kliknite za prebacivanje'; $lang['week_short'] = 'Tjed'; $lang['scroll_to_increment'] = 'Skrolajte za inkrementaciju'; $lang['year'] = 'Godina'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/czech/translations_lang.php b/application/language/czech/translations_lang.php index 71a2c133..61aa6742 100644 --- a/application/language/czech/translations_lang.php +++ b/application/language/czech/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/danish/translations_lang.php b/application/language/danish/translations_lang.php index d08f5a29..692a83cf 100755 --- a/application/language/danish/translations_lang.php +++ b/application/language/danish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/dutch/translations_lang.php b/application/language/dutch/translations_lang.php index 7ba8d54c..7eb90073 100755 --- a/application/language/dutch/translations_lang.php +++ b/application/language/dutch/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/english/translations_lang.php b/application/language/english/translations_lang.php index 19e10272..1b917f9f 100755 --- a/application/language/english/translations_lang.php +++ b/application/language/english/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/estonian/translations_lang.php b/application/language/estonian/translations_lang.php index 9cdde53f..3d78765c 100644 --- a/application/language/estonian/translations_lang.php +++ b/application/language/estonian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/finnish/translations_lang.php b/application/language/finnish/translations_lang.php index 4750b930..4f5cf27b 100755 --- a/application/language/finnish/translations_lang.php +++ b/application/language/finnish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/french/translations_lang.php b/application/language/french/translations_lang.php index c6ec2d60..3d777b61 100755 --- a/application/language/french/translations_lang.php +++ b/application/language/french/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Cliquez pour basculer'; $lang['week_short'] = 'Se'; $lang['scroll_to_increment'] = 'Faire défiler pour incrémenter'; $lang['year'] = 'Année'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/german/translations_lang.php b/application/language/german/translations_lang.php index 08ac4aaa..3516c164 100755 --- a/application/language/german/translations_lang.php +++ b/application/language/german/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Klicken Sie zum Umschalten'; $lang['week_short'] = 'Wo'; $lang['scroll_to_increment'] = 'Scrollen Sie zu Inkrement'; $lang['year'] = 'Jahr'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/greek/translations_lang.php b/application/language/greek/translations_lang.php index ca0a0e6b..feb97f76 100755 --- a/application/language/greek/translations_lang.php +++ b/application/language/greek/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/hebrew/translations_lang.php b/application/language/hebrew/translations_lang.php index cacb3a64..e9e8de49 100644 --- a/application/language/hebrew/translations_lang.php +++ b/application/language/hebrew/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/hindi/translations_lang.php b/application/language/hindi/translations_lang.php index 8a42da73..bda0e399 100755 --- a/application/language/hindi/translations_lang.php +++ b/application/language/hindi/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/hungarian/translations_lang.php b/application/language/hungarian/translations_lang.php index f02f6e0d..f0c3ffa2 100755 --- a/application/language/hungarian/translations_lang.php +++ b/application/language/hungarian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/italian/translations_lang.php b/application/language/italian/translations_lang.php index 68d3475a..7bff146c 100755 --- a/application/language/italian/translations_lang.php +++ b/application/language/italian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/japanese/translations_lang.php b/application/language/japanese/translations_lang.php index cc8f0276..f29e798a 100755 --- a/application/language/japanese/translations_lang.php +++ b/application/language/japanese/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/luxembourgish/translations_lang.php b/application/language/luxembourgish/translations_lang.php index 017ecce8..5974ceac 100755 --- a/application/language/luxembourgish/translations_lang.php +++ b/application/language/luxembourgish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/marathi/translations_lang.php b/application/language/marathi/translations_lang.php index ddea3afe..e3ed1db9 100644 --- a/application/language/marathi/translations_lang.php +++ b/application/language/marathi/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/persian/translations_lang.php b/application/language/persian/translations_lang.php index b3b1df3e..a364c840 100644 --- a/application/language/persian/translations_lang.php +++ b/application/language/persian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/polish/translations_lang.php b/application/language/polish/translations_lang.php index ce370d86..a39c9aa4 100755 --- a/application/language/polish/translations_lang.php +++ b/application/language/polish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/portuguese-br/translations_lang.php b/application/language/portuguese-br/translations_lang.php index 56d36c66..b0abeb59 100755 --- a/application/language/portuguese-br/translations_lang.php +++ b/application/language/portuguese-br/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/portuguese/translations_lang.php b/application/language/portuguese/translations_lang.php index 3920860e..9546437c 100755 --- a/application/language/portuguese/translations_lang.php +++ b/application/language/portuguese/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/romanian/translations_lang.php b/application/language/romanian/translations_lang.php index 7580240b..5578ab76 100755 --- a/application/language/romanian/translations_lang.php +++ b/application/language/romanian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/russian/translations_lang.php b/application/language/russian/translations_lang.php index 7df683a2..c9272d2c 100644 --- a/application/language/russian/translations_lang.php +++ b/application/language/russian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Нажмите для переключения'; $lang['week_short'] = 'Нед'; $lang['scroll_to_increment'] = 'Прокрутка для увеличения'; $lang['year'] = 'Год'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/serbian/translations_lang.php b/application/language/serbian/translations_lang.php index 273a8478..de7136bc 100644 --- a/application/language/serbian/translations_lang.php +++ b/application/language/serbian/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/slovak/translations_lang.php b/application/language/slovak/translations_lang.php index 01aace6a..84b6a538 100755 --- a/application/language/slovak/translations_lang.php +++ b/application/language/slovak/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/spanish/translations_lang.php b/application/language/spanish/translations_lang.php index 80f50be0..dbe17a19 100755 --- a/application/language/spanish/translations_lang.php +++ b/application/language/spanish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/swedish/translations_lang.php b/application/language/swedish/translations_lang.php index c8a9719b..fbc4a74c 100644 --- a/application/language/swedish/translations_lang.php +++ b/application/language/swedish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/language/turkish/translations_lang.php b/application/language/turkish/translations_lang.php index 206ec89a..418f0be6 100755 --- a/application/language/turkish/translations_lang.php +++ b/application/language/turkish/translations_lang.php @@ -434,4 +434,6 @@ $lang['click_to_toggle'] = 'Click To Toggle'; $lang['week_short'] = 'Wk'; $lang['scroll_to_increment'] = 'Scroll To Increment'; $lang['year'] = 'Year'; +$lang['make_non_working_day'] = 'This provider will not be available for work on the selected day.'; +$lang['no_breaks'] = 'No Breaks'; // End diff --git a/application/models/Providers_model.php b/application/models/Providers_model.php index 621fea4c..21c3438b 100755 --- a/application/models/Providers_model.php +++ b/application/models/Providers_model.php @@ -582,7 +582,7 @@ class Providers_model extends EA_Model { * @throws InvalidArgumentException * @throws Exception */ - public function save_working_plan_exception(int $provider_id, string $date, array $working_plan_exception) + public function save_working_plan_exception(int $provider_id, string $date, array $working_plan_exception = NULL) { // Validate the working plan exception data. $start = date('H:i', strtotime($working_plan_exception['start'])); @@ -610,7 +610,7 @@ class Providers_model extends EA_Model { // Store the working plan exception. $working_plan_exceptions = json_decode($provider['settings']['working_plan_exceptions'], TRUE); - if ( ! isset($working_plan_exception['breaks'])) + if ( is_array($working_plan_exception) && ! isset($working_plan_exception['breaks'])) { $working_plan_exception['breaks'] = []; } @@ -643,7 +643,7 @@ class Providers_model extends EA_Model { unset($working_plan_exceptions[$date]); - $provider['settings']['working_plan_exceptions'] = empty($working_plan_exceptions) ? new stdClass() : $working_plan_exceptions; + $provider['settings']['working_plan_exceptions'] = empty($working_plan_exceptions) ? '{}' : $working_plan_exceptions; $this->update($provider); } @@ -1015,10 +1015,10 @@ class Providers_model extends EA_Model { /** * Quickly check if a service is assigned to a provider. - * + * * @param int $provider_id * @param int $service_id - * + * * @return bool */ public function is_service_supported(int $provider_id, int $service_id): bool diff --git a/application/views/components/working_plan_exceptions_modal.php b/application/views/components/working_plan_exceptions_modal.php index 3a3ba72a..1cc85137 100644 --- a/application/views/components/working_plan_exceptions_modal.php +++ b/application/views/components/working_plan_exceptions_modal.php @@ -1,5 +1,5 @@