From 864c8b9d62ace1140b4b584fc4dfd0766588d4a9 Mon Sep 17 00:00:00 2001 From: ppound Date: Tue, 24 Aug 2021 13:54:15 -0300 Subject: [PATCH] added a message when a user clicks to far into the future and made some string translatable --- reservation.inc | 4 ++-- src/Controller/CalendarController.php | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/reservation.inc b/reservation.inc index 6287f16..4928f4d 100644 --- a/reservation.inc +++ b/reservation.inc @@ -70,7 +70,7 @@ function reserve_form_reserve_reservation_form_alter(array &$form, FormStateInte '#markup' => '
', ]; return; @@ -85,7 +85,7 @@ function reserve_form_reserve_reservation_form_alter(array &$form, FormStateInte '#markup' => '
', ]; return; diff --git a/src/Controller/CalendarController.php b/src/Controller/CalendarController.php index a2a3c45..c7fb5a0 100644 --- a/src/Controller/CalendarController.php +++ b/src/Controller/CalendarController.php @@ -43,6 +43,7 @@ class CalendarController extends ControllerBase { $config = \Drupal::config('reserve.settings'); // likely no need for this as not used anywhere else; but maybe for external modules global $yyyy_mmdd; + //$entity_type = ebundle_split($ebundle, 'type'); //$bundle = ebundle_split($ebundle, 'bundle'); @@ -75,6 +76,9 @@ class CalendarController extends ControllerBase { if ($yyyy_mmdd == $dates[0]['yyyymmdd']) { $dates[0]['selected'] = TRUE; $dates[0]['today'] = TRUE; + \Drupal::messenger()->addWarning(t('You have chosen a date to far in the ' + . 'future. Please choose a date within 14 days of today. The Calendar' + . ' view below has defaulted to todays date.')); } // a bit hacky; but we need to store what the calendar is using for its date so we can use this in theme functions later