diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php
index baad51ec26..5cf4b6548e 100755
--- a/calendar/inc/class.uicalendar.inc.php
+++ b/calendar/inc/class.uicalendar.inc.php
@@ -1277,6 +1277,7 @@
$can_edit = True;
$participants = (string)(get_var('participants',array('GET'),FALSE));
+ $matrix_mode = (int)(get_var('matrix',array('GET', 'POST'),FALSE));
$starthour = (int)(get_var('hour',array('GET'),$this->bo->prefs['calendar']['workdaystarts']));
$startmin = (int)(get_var('minute',array('GET'),0));
$endmin = $startmin + (int)$this->bo->prefs['calendar']['defaultlength'];
@@ -1297,11 +1298,50 @@
{
$this->bo->set_class(True);
}
+
+ // Construct Participants stack
+ $_stack_participants = $GLOBALS['phpgw']->session->appsession("participants");
+ if($matrix_mode == 1) // You come from matrix, ok
+ $_stack_participants = ";" . $GLOBALS['phpgw']->session->appsession("participants_matrix");
+
+ // Read each participant
+ foreach(explode(";", $_stack_participants) as $part)
+ {
+ // Skip Owner
+ if( !$part OR ($part == $this->bo->owner) )
+ continue;
+
+ // Add into stack
+ $this->bo->add_attribute('participants', 'U',$part);
+ }
+ unset($_stack_participants);
+
+
+ /* --- OLD CODE ---
// Add participants from matrixview
+ if($matrix_mode == 1)
+ {
+ foreach(explode(';', $GLOBALS['phpgw']->session->appsession("participants_matrix")) as $part)
+ {
+ // Skip owner
+ if( !$part OR ( $part == $this->bo->owner) )
+ continue;
+
+ $this->bo->add_attribute('participants', 'U',$part);
+ }
+ }
+ // Add participants from outer space
foreach(explode(';',$GLOBALS['phpgw']->session->appsession("participants")) as $part)
{
- if ($part) $this->bo->add_attribute('participants','U',$part);
+ // Skip owner
+ if( !$part OR ( $part == $this->bo->owner) )
+ continue;
+
+ $this->bo->add_attribute('participants','U',$part);
}
+ // --- END OLD CODE */
+
+
// Add misc
$this->bo->add_attribute('participants','A',$this->bo->owner);
$this->bo->set_recur_none();
@@ -2345,7 +2385,7 @@
$participants = array_keys($parts); // get id's as values and a numeric index
// Defined - into session - who participates
- $GLOBALS['phpgw']->session->appsession("participants", NULL, implode(";", $participants));
+ $GLOBALS['phpgw']->session->appsession("participants_matrix", "calendar", implode(";", $participants));
unset($GLOBALS['phpgw_info']['flags']['noheader']);
unset($GLOBALS['phpgw_info']['flags']['nonavbar']);
@@ -3836,7 +3876,7 @@ return;
$k = ($j == 0 ? sprintf('%02d',$i).'
':'').sprintf('%02d',$j*$increment);
$str .= '