From c6886bee7dcb5f1150467b9d15e279502cf9c778 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hans-J=C3=BCrgen=20Tappe?= Date: Sat, 20 Mar 2010 20:06:47 +0000 Subject: [PATCH] - Fix a problem with the daylight saving: The static increment could not cope and another week (without events) is shown. - Fix the default value to be consistently 2 at both places where specified - Fix problem with calendar events "search()" function: offset needs to be 0. - remove numEntries, which does not make sense for the weekN view (will fill up the weeks only up to the event which is counted to max.) and seems to be a legacy from the list view code. --- .../class.module_calendar_month.inc.php | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/calendar/sitemgr/class.module_calendar_month.inc.php b/calendar/sitemgr/class.module_calendar_month.inc.php index bd3183e2c5..273f558f7f 100644 --- a/calendar/sitemgr/class.module_calendar_month.inc.php +++ b/calendar/sitemgr/class.module_calendar_month.inc.php @@ -74,12 +74,6 @@ class module_calendar_month extends Module 'type' => 'textfield', 'label' => lang('Search string for the events'), ), - 'numEntries' => array( - 'type' => 'textfield', - 'label' => lang('Max. Number of entries to show (leave empty for no restriction)'), - 'default' => '', - 'params' => array('size' => 1), - ), 'users' => array( 'type' => 'select', 'options' => array(), @@ -232,7 +226,7 @@ class module_calendar_month extends Module $this->ui->allowEdit = false; $this->ui->use_time_grid = isset($arguments['grid']) ? $arguments['grid'] : false; - $weeks = $arguments['numWeeks'] ? (int) $arguments['numWeeks'] : 4; + $weeks = $arguments['numWeeks'] ? (int) $arguments['numWeeks'] : 2; if (($arguments['acceptDateParam']) && (get_var('date',array('POST','GET')))) { @@ -248,8 +242,7 @@ class module_calendar_month extends Module adodb_date('Y',$start), adodb_date('m',$start), adodb_date('d',$start)); - $last = (int) ($first + - (60 * 60 * 24 * 7 * $weeks)); + $last = strtotime("+$weeks weeks",$first) - 1; if ($arguments['showTitle']) { @@ -261,7 +254,7 @@ class module_calendar_month extends Module // set the search parameters $search_params = Array ( - 'offset' => 0, // should be false if you want no restrictions on the number of results + 'offset' => false, 'order' => 'cal_start ASC', 'start' => $first, 'end' => $last, @@ -280,14 +273,6 @@ class module_calendar_month extends Module { $search_params['users'] = $arguments['users']; } - if ($arguments['numEntries']) - { - $search_params['num_rows'] = (int) $arguments['numEntries']; - } - else - { - $search_params['offset'] = false; - } $rows = $this->bo->search($search_params); if ($arguments['showWeeks']) {