From d5a2b01981c674e9e51ecc15dc52116b96af229f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 27 Apr 2010 14:25:19 +0000 Subject: [PATCH] "optional argument to specify a startdate" --- .../class.module_calendar_planner.inc.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/calendar/sitemgr/class.module_calendar_planner.inc.php b/calendar/sitemgr/class.module_calendar_planner.inc.php index 74b707658e..e16f2d9dbb 100644 --- a/calendar/sitemgr/class.module_calendar_planner.inc.php +++ b/calendar/sitemgr/class.module_calendar_planner.inc.php @@ -58,6 +58,12 @@ class module_calendar_planner extends Module ), 'default' => 'default', ), + 'date' => array( + 'type' => 'textfield', + 'label' => 'Startdate as YYYYmmdd (empty for current date)', + 'default' => '', + 'params' => array('size' => 10), + ), ); $this->title = lang('Calendar - Planner'); $this->description = lang('This module displays a planner calendar.'); @@ -73,7 +79,7 @@ class module_calendar_planner extends Module { $this->arguments['cat_id']['options'][$cat['id']] = str_repeat('  ',$cat['level']).$cat['name']; } - if (count($cat_ids) > 5) + if (count($cat_ids) > 5) { $this->arguments['cat_id']['multiple'] = 5; } @@ -82,15 +88,19 @@ class module_calendar_planner extends Module /** * Get block content - * + * * @param $arguments * @param $properties */ function get_content(&$arguments,$properties) { translation::add_app('calendar'); - + $arguments['view'] = 'planner'; + if (empty($arguments['date'])) + { + $arguments['date'] = date('Ymd'); + } if ($arguments['sortby'] == 'yearly') { $arguments['sortby'] = 'month'; @@ -114,7 +124,7 @@ class module_calendar_planner extends Module $html .= str_replace($GLOBALS['egw_info']['server']['webserver_url'].'/index.php?', $this->link().'&', $uiviews->planner(true)); - + return $html; } }