From 9b52f5fba55e3b2726e3414abac65e42aef6b495 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 9 Feb 2005 23:13:23 +0000 Subject: [PATCH] fixed bug reported from Adriano on the user-list: daily matrix view gives warning if no participants selected. Also fixed not working switch between daily and weekly view. --- calendar/inc/class.uicalendar.inc.php | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 3c07595373..01aa401dd4 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -2311,7 +2311,7 @@ } $var[] = Array( 'field' => lang('Participants'), - 'data' => "\n ".$GLOBALS['phpgw']->uiaccountsel->selection('participants[]','uicalendar_matrix_users',array(),'calendar+',$size,False,'','',$users) + 'data' => "\n ".$GLOBALS['phpgw']->uiaccountsel->selection('participants[]','uicalendar_matrix_users',array($this->bo->owner),'calendar+',$size,False,'','',$users) ); for($i=0;$isession->appsession("participants_matrix", "calendar", implode(";", $participants)); + $GLOBALS['phpgw']->session->appsession("participants_matrix", "calendar", implode(";",(array)$participants)); } $date["year"] = get_var("year", array("GET", "POST")); $date["month"] = get_var("month", array("GET", "POST")); @@ -2393,7 +2393,8 @@ if ($this->always_app_header) $GLOBALS['phpgw_info']['flags']['app_header'] = $GLOBALS['phpgw_info']['apps']['calendar']['title'].' - '.lang('Matrixview'); $GLOBALS['phpgw']->common->phpgw_header(); - switch($_POST['matrixtype']) + $matrixtype = $_POST['oneday'] ? 'free/busy' : ($_POST['sevendays'] ? 'weekly' : $_POST['matrixtype']); + switch($matrixtype) { case 'free/busy': $freetime = $GLOBALS['phpgw']->datetime->gmtdate(mktime(0,0,0,$this->bo->month,$this->bo->day,$this->bo->year)); @@ -2411,7 +2412,7 @@ Array( 'date' => sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day), 'showyear' => true, - 'owners' => $participants + 'owners' => $participants[0] ? $participants : $this->bo->owner, ) ); break; @@ -2421,20 +2422,17 @@ echo ' '.$this->html->input_hidden('year',$this->bo->year); echo ' '.$this->html->input_hidden('month',$this->bo->month); echo ' '.$this->html->input_hidden('day',$this->bo->day); - echo ' '.$this->html->input_hidden('matrixtype',$_POST['matrixtype']); + echo ' '.$this->html->input_hidden('matrixtype',$matrixtype); echo ' '.$this->html->input_hidden('matrix', 1); echo ' '."\n"; echo ' '."\n"; echo ' '."\n"; // Seven days - if( get_var("matrixtype", array("GET", "POST")) == "free/busy" ) - { - if( !get_var("sevendays", array("GET", "POST")) ) - echo ' '."\n"; - else - echo ' '."\n"; - } + if($matrixtype == 'free/busy') + echo ' '."\n"; + else + echo ' '."\n"; echo ' '."\n"; echo ''."\n";