From 5f2a173513d935cbd448a8df3fa980b9cf46abc3 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Wed, 29 Oct 2014 08:35:38 +0000 Subject: [PATCH] * Calendar: Add event description to calendar event body if the event is long enough (3 times bigger than calendar view interval). --- calendar/inc/class.calendar_uiviews.inc.php | 7 +++++++ calendar/templates/default/event_widget.tpl | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_uiviews.inc.php b/calendar/inc/class.calendar_uiviews.inc.php index b9155c5d35..b40e202ec5 100644 --- a/calendar/inc/class.calendar_uiviews.inc.php +++ b/calendar/inc/class.calendar_uiviews.inc.php @@ -1809,6 +1809,13 @@ class calendar_uiviews extends calendar_ui (isset($data['border']) ? '&border='.urlencode($data['border']) : '')); } */ + // Add event description to cal event view body if the event is long enough (ATM 3 times longer than interval) + // to be able to show some lines of description text + if ($event['whole_day'] || ($event['end'] - $event['start']) > ($this->cal_prefs['interval'] * 3 * 60)) + { + $tpl->set_var('bodydescription', !$is_private ? nl2br(html::htmlspecialchars($event['description'])) : ''); + } + $tooltip = $tpl->fp('tooltip','event_tooltip'); $html = $tpl->fp('out',$block); diff --git a/calendar/templates/default/event_widget.tpl b/calendar/templates/default/event_widget.tpl index c2190a7ee2..955ff7a321 100644 --- a/calendar/templates/default/event_widget.tpl +++ b/calendar/templates/default/event_widget.tpl @@ -3,7 +3,12 @@ {indent} {header} {indent}
{icons}
{indent} -{indent}
{title}
+{indent}
+{indent}

+{indent} {title} +{indent}
{bodydescription} +{indent}

+{indent}