"optional argument to specify a startdate"

This commit is contained in:
Ralf Becker 2010-04-27 14:25:19 +00:00
parent a2e2c5f797
commit d5a2b01981

View File

@ -58,6 +58,12 @@ class module_calendar_planner extends Module
), ),
'default' => 'default', '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->title = lang('Calendar - Planner');
$this->description = lang('This module displays a planner calendar.'); $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']; $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; $this->arguments['cat_id']['multiple'] = 5;
} }
@ -82,15 +88,19 @@ class module_calendar_planner extends Module
/** /**
* Get block content * Get block content
* *
* @param $arguments * @param $arguments
* @param $properties * @param $properties
*/ */
function get_content(&$arguments,$properties) function get_content(&$arguments,$properties)
{ {
translation::add_app('calendar'); translation::add_app('calendar');
$arguments['view'] = 'planner'; $arguments['view'] = 'planner';
if (empty($arguments['date']))
{
$arguments['date'] = date('Ymd');
}
if ($arguments['sortby'] == 'yearly') if ($arguments['sortby'] == 'yearly')
{ {
$arguments['sortby'] = 'month'; $arguments['sortby'] = 'month';
@ -114,7 +124,7 @@ class module_calendar_planner extends Module
$html .= str_replace($GLOBALS['egw_info']['server']['webserver_url'].'/index.php?', $html .= str_replace($GLOBALS['egw_info']['server']['webserver_url'].'/index.php?',
$this->link().'&', $this->link().'&',
$uiviews->planner(true)); $uiviews->planner(true));
return $html; return $html;
} }
} }