From e757e538198773eaf28defc756af5414bc9d5bfc Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 4 Aug 2009 14:26:11 +0000 Subject: [PATCH] remove listview from calendar_list title, as it offers no additional information. Use get_weekday_start in calendar_list as used in calendar_month; Use numEntries for calendar_month, as passing no number of entries to fetch, will result in applying the default number of entries, or the number of entries to fetch for the anonymous user --- calendar/sitemgr/class.module_calendar_list.inc.php | 11 ++++++++--- calendar/sitemgr/class.module_calendar_month.inc.php | 12 +++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/calendar/sitemgr/class.module_calendar_list.inc.php b/calendar/sitemgr/class.module_calendar_list.inc.php index c864ecb413..d404d7d1e8 100644 --- a/calendar/sitemgr/class.module_calendar_list.inc.php +++ b/calendar/sitemgr/class.module_calendar_list.inc.php @@ -277,20 +277,25 @@ class module_calendar_list extends Module if (($arguments['acceptDateParam']) && (get_var('date',array('POST','GET')))) { - $first = (int) (strtotime(get_var('date',array('POST','GET'))) + + $start = (int) (strtotime(get_var('date',array('POST','GET'))) + (60 * 60 * 24 * 7 * $dateOffset)); } else { - $first = (int) ($this->bo->now_su + + $start = (int) ($this->bo->now_su + (60 * 60 * 24 * 7 * $dateOffset)); } + $first = $this->ui->datetime->get_weekday_start( + adodb_date('Y',$start), + adodb_date('m',$start), + adodb_date('d',$start)); + $last = (int) ($first + (60 * 60 * 24 * 7 * $weeks)); if ($arguments['showTitle']) { - $html .= '
'.$GLOBALS['egw_info']['apps']['calendar']['title'].' - '.lang('Listview').": "; + $html .= '
'.$GLOBALS['egw_info']['apps']['calendar']['title'].' - '; $html .= lang('After %1',$this->bo->long_date($first)); $html .= "
"; } diff --git a/calendar/sitemgr/class.module_calendar_month.inc.php b/calendar/sitemgr/class.module_calendar_month.inc.php index ae978efdbe..3e296a316a 100644 --- a/calendar/sitemgr/class.module_calendar_month.inc.php +++ b/calendar/sitemgr/class.module_calendar_month.inc.php @@ -74,6 +74,12 @@ 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(), @@ -274,6 +280,10 @@ class module_calendar_month extends Module { $search_params['users'] = $arguments['users']; } + if ($arguments['numEntries']) + { + $search_params['num_rows'] = (int) $arguments['numEntries']; + } $rows = $this->bo->search($search_params); if ($arguments['showWeeks']) { @@ -306,7 +316,7 @@ class module_calendar_month extends Module { $GLOBALS['egw']->template = new Template; } - $html .= $this->ui->timeGridWidget($this->ui->tagWholeDayOnTop($week),$weeks == 2 ? 30 : 60,200,'',$title,0,$week_start+WEEK_s >= $this->last); + $html .= $this->ui->timeGridWidget($this->ui->tagWholeDayOnTop($week),$weeks == 2 ? 30 : 60,200,'',$title,0,$week_start+WEEK_s >= $last); } // Initialize Tooltips $html .= ''."\n";