Adding a global default_calendar_view setting in the agenda. see BT#6695

1.9.x
Julio Montoya 12 years ago
parent 695395f6cc
commit 5c29dd4384
  1. 11
      main/calendar/agenda_js.php
  2. 1
      main/template/default/agenda/month.tpl

@ -38,7 +38,6 @@ if (api_is_platform_admin() && $type == 'admin') {
$type = 'admin'; $type = 'admin';
} }
//if (api_get_course_id() != -1 && $type == 'course') {
if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) { if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) {
$type = 'course'; $type = 'course';
} }
@ -153,6 +152,16 @@ if ($type == 'course' && !empty($group_id)) {
$type_label = get_lang('GroupCalendar'); $type_label = get_lang('GroupCalendar');
} }
$defaultView = api_get_setting('default_calendar_view');
if (empty($defaultView)) {
$defaultView = 'month';
}
/* month, basicWeek,agendaWeek,agendaDay */
$tpl->assign('default_view', $defaultView);
if ($type == 'course' && !empty($session_id)) { if ($type == 'course' && !empty($session_id)) {
$type_event_class = 'session_event'; $type_event_class = 'session_event';
$type_label = get_lang('SessionCalendar'); $type_label = get_lang('SessionCalendar');

@ -103,6 +103,7 @@ $(document).ready(function() {
], ],
{% endif %} {% endif %}
defaultView: '{{ default_view }}',
buttonText: {{ button_text }}, buttonText: {{ button_text }},
monthNames: {{ month_names }}, monthNames: {{ month_names }},
monthNamesShort:{{ month_names_short }}, monthNamesShort:{{ month_names_short }},

Loading…
Cancel
Save