From 7c884582a24a879d70dc2a587e2894e1742eda3b Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 28 Jan 2018 22:05:09 -0500 Subject: [PATCH 1/4] Working on adding business hours to the calendar --- admin/admin_settings.php | 81 +++++++++++++++++++ install/database-validation.php | 2 + .../AddBusinessHoursTable.php | 16 ++++ 3 files changed, 99 insertions(+) create mode 100644 install/migrations/v330/CalendarImprovements/AddBusinessHoursTable.php diff --git a/admin/admin_settings.php b/admin/admin_settings.php index 8f9a5115..af7c7493 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -2220,6 +2220,87 @@ $modsForHesk_settings = mfh_getSettings(); +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 SundayMondayTuesdayWednesdayThursdayFridaySaturday
+ From + + + + + + + + + + + + + + +
+ To + + + + + + + + + + + + + + +
+
+
+
diff --git a/install/database-validation.php b/install/database-validation.php index 4b2b14ef..cce19ef6 100644 --- a/install/database-validation.php +++ b/install/database-validation.php @@ -206,6 +206,8 @@ hesk_dbConnect(); $all_good &= run_column_check('categories', 'mfh_description'); $all_good &= run_column_check('custom_fields', 'mfh_description'); $all_good &= run_setting_check('migrationNumber'); + output_header_row('3.3.0'); + $all_good &= run_table_check('mfh_calendar_business_hours'); if ($all_good) { echo ""; diff --git a/install/migrations/v330/CalendarImprovements/AddBusinessHoursTable.php b/install/migrations/v330/CalendarImprovements/AddBusinessHoursTable.php new file mode 100644 index 00000000..90f881c5 --- /dev/null +++ b/install/migrations/v330/CalendarImprovements/AddBusinessHoursTable.php @@ -0,0 +1,16 @@ +executeQuery("CREATE TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_calendar_business_hours` + (`day_of_week` INT NOT NULL, `all_day` INT NOT NULL, + `start_time` VARCHAR(5) NOT NULL, `end_time` VARCHAR(5) NOT NULL)"); + } + + function innerDown($hesk_settings) { + $this->executeQuery("DROP TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "mfh_calendar_business_hours`"); + } +} \ No newline at end of file From 09b371036a6ea8a6a7b3ea5e0239698be2461298 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 29 Jan 2018 22:12:00 -0500 Subject: [PATCH 2/4] Business hours can be added to the calendar --- admin/admin_settings.php | 157 +++++++++--------- admin/admin_settings_save.php | 30 ++++ admin/calendar.php | 7 + calendar.php | 9 +- .../mods-for-hesk-calendar-admin-readonly.js | 37 +++++ .../mods-for-hesk-calendar-readonly.js | 37 +++++ js/calendar/mods-for-hesk-calendar.js | 37 +++++ language/en/text.php | 3 + 8 files changed, 239 insertions(+), 78 deletions(-) diff --git a/admin/admin_settings.php b/admin/admin_settings.php index af7c7493..1f055ddc 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -2220,85 +2220,88 @@ $modsForHesk_settings = mfh_getSettings(); -
-