summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaren Stevenson2012-04-19 21:48:06 (GMT)
committer Karen Stevenson2012-04-19 21:48:06 (GMT)
commit9f4ee153a96eeaf149a285412298bc30f0f65be8 (patch)
treea94cb9df857dfce53446d982af3291ba0c863406
parent04218ea286d28997ad4425f0591f40341a5d2283 (diff)
Issue #1537598, Fix misc errors in day display caused when some items were not getting rendered due to a badly placed 'continue' in the loop.
-rw-r--r--CHANGELOG.txt2
-rw-r--r--theme/calendar-day-overlap.tpl.php8
-rw-r--r--theme/theme.inc20
3 files changed, 21 insertions, 9 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index b130620..3254160 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -5,6 +5,8 @@ Calendar Module 7.x
Version 7.x-3.x-dev
===================
+- Issue #1537598, Fix misc errors in day display caused when some items were not getting rendered due to a badly placed 'continue' in the loop.
+
======================
Version 7.x-3.1
======================
diff --git a/theme/calendar-day-overlap.tpl.php b/theme/calendar-day-overlap.tpl.php
index 2350f73..3b3bf4f 100644
--- a/theme/calendar-day-overlap.tpl.php
+++ b/theme/calendar-day-overlap.tpl.php
@@ -111,7 +111,13 @@
<div class="calendar item-wrapper">
<?php endif; ?>
<div class="inner">
- <?php print !empty($hour['values']) && is_array($hour['values']) && array_key_exists($column, $hour['values']) ? implode($hour['values'][$column]) : '&nbsp;'; ?>
+ <?php if (!empty($hour['values']) && is_array($hour['values']) && array_key_exists($column, $hour['values'])): ?>
+ <?php foreach ($hour['values'][$column] as $item): ?>
+ <?php print $item; ?>
+ <?php endforeach; ?>
+ <?php else: ?>
+ <?php print '&nbsp;'; ?>
+ <?php endif; ?>
</div>
</div>
</div>
diff --git a/theme/theme.inc b/theme/theme.inc
index 5d09220..2ccb7e1 100644
--- a/theme/theme.inc
+++ b/theme/theme.inc
@@ -263,22 +263,26 @@ function template_preprocess_calendar_day(&$vars) {
$grouped_items[$start_time]['ampm'] = $heading['ampm'];
foreach ($grouped_items[$start_time]['values'] as $column => &$items) {
foreach ($items as $index => &$item) {
+ $group_time = NULL;
+ $divisor = NULL;
if ($display_overlap) {
- if ($view->date_info->style_groupby_times == 'half'){
+ if ($view->style_options['groupby_times'] == 'half') {
$group_time = 30;
$divisor = 7.5;
}
- else if ($view->date_info->style_groupby_times == 'hour'){
+ elseif ($view->style_options['groupby_times'] == 'hour') {
$group_time = 60;
$divisor = 15;
- } else {
+ }
+ else {
$item->class = '';
- continue;
}
- $start_minute = intval(substr($start_time, 3, 2));
- $offset = round((date_format($item->date_start, 'i') - $start_minute) / $divisor);
- $duration = round(($item->date_end->format('U') - $item->date_start->format('U')) / 60 / $divisor);
- $item->class = 'd_' . $duration . ' o_' . $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
+ if (!empty($group_time) && !empty($divisor)) {
+ $start_minute = intval(substr($start_time, 3, 2));
+ $offset = round((date_format($item->date_start, 'i') - $start_minute) / $divisor);
+ $duration = round(($item->date_end->format('U') - $item->date_start->format('U')) / 60 / $divisor);
+ $item->class = 'd_' . $duration . ' o_' . $offset . ' i_' . $item->indent . ' md_' . min($item->max_depth, 5);
+ }
}
$grouped_items[$start_time]['values'][$column][$index] = theme('calendar_item', array('view' => $view, 'rendered_fields' => $item->rendered_fields, 'item' => $item));
}