diff --git a/main/calendar/agenda_js.php b/main/calendar/agenda_js.php index 40891eb22f..1fc187bce3 100755 --- a/main/calendar/agenda_js.php +++ b/main/calendar/agenda_js.php @@ -299,6 +299,14 @@ if (!empty($onHoverInfo)) { } $tpl->assign('on_hover_info', $options); +$settings = api_get_configuration_value('fullcalendar_settings'); +$extraSettings = ''; +if (!empty($settings) && isset($settings['settings']) && !empty($settings['settings'])) { + $encoded = json_encode($settings['settings']); + $extraSettings = substr($encoded, 1, -1).','; +} +$tpl->assign('fullcalendar_settings', $extraSettings); + $templateName = $tpl->get_template('agenda/month.tpl'); $content = $tpl->fetch($templateName); $tpl->assign('content', $content); diff --git a/main/install/configuration.dist.php b/main/install/configuration.dist.php index d92c9d62e9..0d7028286b 100755 --- a/main/install/configuration.dist.php +++ b/main/install/configuration.dist.php @@ -1902,6 +1902,19 @@ ALTER TABLE gradebook_comment ADD CONSTRAINT FK_C3B70763AD3ED51C FOREIGN KEY (gr // Enable X-Sendfile headers on forced download files going through document/download.php //$_configuration['enable_x_sendfile_headers'] = false; +// Extra settings for the agenda (FullCalendar) +/*$_configuration['fullcalendar_settings'] = [ + 'settings' => [ + 'businessHours' => [ + // days of week. an array of zero-based day of week integers (0=Sunday) + 'dow' => [0, 1, 2, 3, 4], // Monday - Friday + 'start' => '10:00', + 'end' => '18:00', + ], + 'firstDay' => 0, // 0 = Sunday, 1 = Monday + ] +];*/ + // KEEP THIS AT THE END // -------- Custom DB changes // Add user activation by confirmation email diff --git a/main/template/default/agenda/month.tpl b/main/template/default/agenda/month.tpl index c9bdb26831..d9c0b44edb 100755 --- a/main/template/default/agenda/month.tpl +++ b/main/template/default/agenda/month.tpl @@ -239,7 +239,10 @@ $(function() { defaultDate: defaultStartDate, firstHour: 8, firstDay: 1, - selectable : true, + {% if fullcalendar_settings %} + {{ fullcalendar_settings }} + {% endif %} + selectable : true, selectHelper: true, viewDisplay: function(view) { /* When changing the view update the qtips */