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

This commit is contained in:
Klaus Leithoff 2009-08-04 14:26:11 +00:00
parent 5283f3098f
commit e757e53819
2 changed files with 19 additions and 4 deletions

View File

@ -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 .= '<div id="divAppboxHeader">'.$GLOBALS['egw_info']['apps']['calendar']['title'].' - '.lang('Listview').": ";
$html .= '<div id="divAppboxHeader">'.$GLOBALS['egw_info']['apps']['calendar']['title'].' - ';
$html .= lang('After %1',$this->bo->long_date($first));
$html .= "</div>";
}

View File

@ -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 .= '<script language="JavaScript" type="text/javascript" src="'.$GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/js/wz_tooltip/wz_tooltip.js"></script>'."\n";