- 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.
This commit is contained in:
Hans-Jürgen Tappe 2010-03-20 20:06:47 +00:00
parent 90a3a946f6
commit c6886bee7d

View File

@ -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'])
{