Add 'agenda_legend' configuration setting see BT#12500

pull/2487/head
jmontoyaa 9 years ago
parent cdaaac65e7
commit 2d580b6a18
  1. 54
      main/calendar/agenda_js.php
  2. 6
      main/install/configuration.dist.php
  3. 17
      main/template/default/agenda/month.tpl

@ -109,29 +109,6 @@ switch ($type) {
break;
}
//Setting translations
/*$day_short = api_get_week_days_short();
$days = api_get_week_days_long();
$months = api_get_months_long();
$months_short = api_get_months_short();*/
//Setting calendar translations
/*$tpl->assign('month_names', json_encode($months));
$tpl->assign('month_names_short', json_encode($months_short));
$tpl->assign('day_names', json_encode($days));
$tpl->assign('day_names_short', json_encode($day_short));
$tpl->assign(
'button_text',
json_encode(array(
'today' => get_lang('Today'),
'month' => get_lang('Month'),
'week' => get_lang('Week'),
'day' => get_lang('Day')
))
);*/
//see http://docs.jquery.com/UI/Datepicker/$.datepicker.formatDate
$tpl->assign('js_format_date', 'll');
$region_value = api_get_language_isocode();
@ -140,9 +117,33 @@ if ($region_value == 'en') {
}
$tpl->assign('region_value', $region_value);
$export_icon = Display::return_icon('export.png', null, null, null, null, true, false);
$export_icon_low = Display::return_icon('export_low_fade.png', null, null, null, null, true, false);
$export_icon_high = Display::return_icon('export_high_fade.png', null, null, null, null, true, false);
$export_icon = Display::return_icon(
'export.png',
null,
null,
null,
null,
true,
false
);
$export_icon_low = Display::return_icon(
'export_low_fade.png',
null,
null,
null,
null,
true,
false
);
$export_icon_high = Display::return_icon(
'export_high_fade.png',
null,
null,
null,
null,
true,
false
);
$tpl->assign(
'export_ical_confidential_icon',
@ -246,6 +247,7 @@ if ($agenda->type === 'course') {
}
$tpl->assign('form_add', $form->returnForm());
$tpl->assign('legend_list', api_get_configuration_value('agenda_legend'));
$templateName = $tpl->get_template('agenda/month.tpl');
$content = $tpl->fetch($templateName);
$tpl->assign('content', $content);

@ -339,3 +339,9 @@ $_configuration['tracking_columns'] = [
*/
// Hide session link of course_block on index/userportal
//$_configuration['remove_session_url']= false ;
// Shows a legend in the agenda tool
/*
$_configuration['agenda_legend'] = [
'red' => 'red caption',
'#f0f' => 'another caption'
];*/

@ -125,9 +125,7 @@ $(document).ready(function() {
for (dayIndex = 0; dayIndex < segsByDay.length; dayIndex++) {
daySegs = segsByDay[dayIndex];
if (daySegs) { // sparse array, so might be undefined
this.sortEventSegs(daySegs);
for (i = 0; i < daySegs.length; i++) {
var event = daySegs[i].event;
if (jQuery.inArray(event.id, eventList) !== -1) {
@ -644,7 +642,6 @@ $(document).ready(function() {
'<div class="form-group"><label class="col-sm-3 control-label">{{ 'Session' | get_lang }}</label>' +
'<div class="col-sm-9">' + calEvent.session_name+"</div></div>"
);
} else {
$("#calendar_session_info").html('');
}
@ -652,7 +649,6 @@ $(document).ready(function() {
$("#simple_title").html(calEvent.title);
$("#simple_content").html(calEvent.description);
$("#simple_comment").html(calEvent.comment);
$("#simple-dialog-form").dialog("open");
$("#simple-dialog-form").dialog({
buttons: {
@ -706,12 +702,6 @@ $(document).ready(function() {
else $('#loading').hide();
}
});
});
</script>
{{ actions_div }}
@ -764,6 +754,13 @@ $(document).ready(function() {
{{ form_add }}
</div>
</div>
{% if legend_list %}
{% for color, text in legend_list %}
<span style="background-color: {{ color }}" class="label label-default">&nbsp;</span> {{ text }} &nbsp;&nbsp;
{% endfor %}
<br /><br />
{% endif %}
<div id="loading" style="margin-left:150px;position:absolute;display:none">
{{ "Loading" | get_lang }}...
</div>

Loading…
Cancel
Save