Index: branches/2.2/calendar/inc/class.uicalendar.inc.php
===================================================================
--- branches/2.2/calendar/inc/class.uicalendar.inc.php	(revision 4700)
+++ branches/2.2/calendar/inc/class.uicalendar.inc.php	(revision 5110)
@@ -1129,4 +1129,7 @@
 		function export_all()
 		{
+			//UserCurrent
+			$exportUserId = $_POST['exportUserId'];
+			
 			$temp_path = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP;
 			srand((double)microtime()*1000000);
@@ -1136,8 +1139,19 @@
 			$attach_fd = fopen($filename,"w+");
 			$event_ids = $this->bo->search_keywords($_POST['keywords']);
+			
 			foreach($event_ids as $key => $id)
 			{
 				$event[$key]=$this->bo->read_entry($id);
 			}
+			
+			if( is_array($event) )
+			{
+				foreach( $event as $key => $ev )
+				{
+					if( $ev['owner'] != $exportUserId )
+						unset( $event[$key] );
+				}
+			}	
+			
 			include_once('class.bocalendar.inc.php');
 			$cal = new bocalendar;
@@ -3127,5 +3141,5 @@
 
 		function footer()
-		{
+		{	
 			$menuaction = $_GET['menuaction'];
 			list(,,$method) = explode('.',$menuaction);
@@ -3141,5 +3155,6 @@
 				Array(
 					'footer'	=> 'footer.tpl',
-					'form_button'	=> 'form_button_script.tpl'
+					'form_button_1'	=> 'form_button_script.tpl',
+					'form_button_2'	=> 'form_button_script_2.tpl'
 				)
 			);
@@ -3339,9 +3354,10 @@
 				'action_extra_field'	=> ''
 			);
-			$this->output_template_array($p,'b_row','form_button',$var);
+			$this->output_template_array($p,'b_row','form_button_1',$var);
 			
 			$var = Array(
 				'submit_button'		=> lang('Submit'),
-				'action_url'	=> $this->page($method,''),
+				'action_url'		=> $this->page($method,''),
+				'onclick_export'	=> "onclick='getUserSelect()';",
 				'action_url_button'	=> $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.export_all'),
 				'action_text_button'	=> lang('Export all'),
@@ -3349,5 +3365,5 @@
 				'action_extra_field'	=> ''
 			);
-			$this->output_template_array($p,'b_row2','form_button',$var);
+			$this->output_template_array($p,'b_row2','form_button_2',$var);
 					
 			$p->parse('table_row','blank_row',True);
Index: branches/2.2/calendar/templates/default/form_button_script_2.tpl
===================================================================
--- branches/2.2/calendar/templates/default/form_button_script_2.tpl	(revision 5110)
+++ branches/2.2/calendar/templates/default/form_button_script_2.tpl	(revision 5110)
@@ -0,0 +1,28 @@
+
+<!-- BEGIN form_button -->
+<nobr>
+<script>
+	function getUserSelect()
+	{
+		var _select = document.getElementById('userExportCalendar');
+		var _input	= document.getElementById('exportUserId');
+		
+		for( var i = 0; i < _select.options.length; i++ )
+		{
+			if( _select.options[i].selected )
+			{
+				_input.value = _select.options[i].value;
+			} 
+		}
+	}
+</script>
+<form action="{action_url_button}" method="post" name="{action_text_button}form">
+<div style="padding-top:15px; padding-right: 2px">
+	{action_extra_field}
+	<input id="exportUserId" type="hidden" name="exportUserId" value="" />
+	<input id="{button_id}" style="font-size:10px" type="submit" value="{action_text_button}" {action_confirm_button} {onclick_export} >
+</div>
+	
+</form>
+</nobr>
+<!-- END form_button -->
Index: branches/2.2/calendar/templates/default/form_button_dropdown.tpl
===================================================================
--- branches/2.2/calendar/templates/default/form_button_dropdown.tpl	(revision 663)
+++ branches/2.2/calendar/templates/default/form_button_dropdown.tpl	(revision 5110)
@@ -2,6 +2,6 @@
 <td width="{form_width}%" align="center" valign="top" style="padding-top:16px">
 	<span style="font-size:10px"><b>{title}:</b>
-    {hidden_vars}    
-    <select name="{form_name}" onchange="document.{form_name}form.submit()">
+    {hidden_vars}
+    <select {id_form_select} name="{form_name}" onchange="document.{form_name}form.submit()">
 		{form_options}
 	</select>
