Changeset 57 for trunk/calendar/inc/class.uicalendar.inc.php
- Timestamp:
- 08/20/07 17:12:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/calendar/inc/class.uicalendar.inc.php
r42 r57 27 27 28 28 var $debug = False; 29 //var $debug = True;29 //var $debug = True; 30 30 31 31 var $cat_id; … … 67 67 'edit' => True, 68 68 'export' => True, 69 'export_all' => True, 69 70 'reinstate_list' => True, 70 71 'reinstate' => True, … … 432 433 $next_month_link = '<a href="'.$this->page('month','&year='.$nextyear.'&month='.$next).'">>></a>'; 433 434 $param = '&year='.$this->bo->year.'&month='.$this->bo->month.'&friendly=1'; 434 $print = "<a href='javascript:void(0)' onClick=\"javascript:window.open('".$this->page('month'.$param)."','','width=600,height=600,toolbar=no,scrollbars=yes,resizable=no');\" onMouseOver=\"window.status = '".lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>'; 435 $print = "<a href='javascript:void(0)' onClick=\"javascript:window.open('".$this->page('month'.$param). 436 "','','width=600,height=600,toolbar=no,scrollbars=yes,resizable=no');\" onMouseOver=\"window.status = '". 437 lang('Generate printer-friendly version')."'\">[".lang('Printer Friendly').']</a>'; 435 438 } 436 439 else … … 1002 1005 } 1003 1006 1007 function export_all() 1008 { 1009 $temp_path = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP; 1010 srand((double)microtime()*1000000); 1011 $random_number = rand(100000000,999999999); 1012 $newfilename = md5(time() . getenv("REMOTE_ADDR") . $random_number ); 1013 $filename = $temp_path . $newfilename; 1014 $attach_fd = fopen($filename,"w+"); 1015 $event_ids = $this->bo->search_keywords($_POST['keywords']); 1016 foreach($event_ids as $key => $id) 1017 { 1018 $event[$key]=$this->bo->read_entry($id); 1019 } 1020 include_once('class.bocalendar.inc.php'); 1021 $cal = new bocalendar; 1022 $tmpattach=$cal->create_vcard($event); 1023 fwrite($attach_fd,$tmpattach); 1024 header ("Content-Type: text/plain"); 1025 header ("Cache-Control: must-revalidate, post-check=0, pre-check=0"); 1026 header('Content-Length: ' . filesize($filename)); 1027 header("Content-disposition: attachment; filename="."export.vcard"); 1028 readfile($filename); 1029 fclose($attach_fd); 1030 } 1031 1004 1032 function export($vcal_id=0) 1005 1033 { 1006 1007 1034 $temp_path = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP; 1008 1035 srand((double)microtime()*1000000); … … 1012 1039 $attach_fd = fopen($filename,"w+"); 1013 1040 $cal_id = get_var('cal_id',array('GET','POST'),$vcal_id); 1014 $event = $this->bo->read_entry($cal_id);1041 $event[0] = $this->bo->read_entry($cal_id); 1015 1042 include_once('class.bocalendar.inc.php'); 1016 1043 $cal = new bocalendar; … … 2652 2679 ); 2653 2680 $this->output_template_array($p,'b_row','form_button',$var); 2681 2682 $var = Array( 2683 'submit_button' => lang('Submit'), 2684 'action_url' => $this->page($method,''), 2685 'action_url_button' => $GLOBALS['phpgw']->link('/index.php','menuaction=calendar.uicalendar.export_all'), 2686 'action_text_button' => lang('Export all'), 2687 'action_confirm_button' => '', 2688 'action_extra_field' => '' 2689 ); 2690 $this->output_template_array($p,'b_row2','form_button',$var); 2691 2654 2692 $p->parse('table_row','blank_row',True); 2655 2693
Note: See TracChangeset
for help on using the changeset viewer.