Browse Source

Add config value "agenda_on_hover_info" see BT#13559

- By default show comment and description when on hover an event in
the calendar (default behaviour in past).
Julio 7 years ago
parent
commit
0f7eda7256

+ 12 - 0
main/calendar/agenda_js.php

@@ -283,6 +283,18 @@ if ($agenda->type === 'course') {
 
 $tpl->assign('form_add', $form->returnForm());
 $tpl->assign('legend_list', api_get_configuration_value('agenda_legend'));
+
+$onHoverInfo = api_get_configuration_value('agenda_on_hover_info');
+if (!empty($onHoverInfo)) {
+    $options = $onHoverInfo['options'];
+} else {
+    $options = [
+        'comment' => true,
+        'description' => true,
+    ];
+}
+$tpl->assign('on_hover_info', $options);
+
 $templateName = $tpl->get_template('agenda/month.tpl');
 $content = $tpl->fetch($templateName);
 $tpl->assign('content', $content);

+ 7 - 0
main/install/configuration.dist.php

@@ -662,3 +662,10 @@ $_configuration['gradebook_badge_sidebar'] = [
 //$_configuration['messages_hide_mail_content'] = false;
 // If you install plugin redirection you need to change to true
 //$_configuration['plugin_redirection_enabled'] = false;
+// Customize on hover agenda view. Show agenda comment and/or description
+/*$_configuration['agenda_on_hover_info'] = [
+    'options' => [
+        'comment' => true,
+        'description' => true,
+    ]
+];*/

+ 17 - 2
main/template/default/agenda/month.tpl

@@ -393,9 +393,24 @@ $(document).ready(function() {
 		        }).removeData('qtip'); // this is an special hack to add multiple qtip in the same target
 		        */
             }
-            if (event.comment) {
+
+            var onHoverInfo = '';
+
+            {% if on_hover_info.description %}
+                if (event.description) {
+                    onHoverInfo = event.description;
+                }
+            {% endif %}
+
+            {% if on_hover_info.comment %}
+                if (event.comment) {
+                    onHoverInfo = onHoverInfo + event.comment;
+                }
+            {% endif %}
+
+            if (onHoverInfo) {
                 element.qtip({
-                    content: event.comment,
+                    content: onHoverInfo,
                     position: {
                         at: 'top center',
                         my: 'bottom center'