Ignore:
Timestamp:
08/20/07 17:12:03 (17 years ago)
Author:
niltonneto
Message:

* empty log message *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/calendar/inc/class.uicalendar.inc.php

    r42 r57  
    2727 
    2828                var $debug = False; 
    29 //              var $debug = True; 
     29                //var $debug = True; 
    3030 
    3131                var $cat_id; 
     
    6767                        'edit' => True, 
    6868                        'export'        => True, 
     69                        'export_all' => True, 
    6970                        'reinstate_list'        => True, 
    7071                        'reinstate'     => True, 
     
    432433                                $next_month_link = '<a href="'.$this->page('month','&year='.$nextyear.'&month='.$next).'">&gt;&gt;</a>'; 
    433434                                $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>';                              
    435438                        } 
    436439                        else 
     
    10021005                } 
    10031006 
     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 
    10041032                function export($vcal_id=0) 
    10051033                { 
    1006                          
    10071034                        $temp_path = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP; 
    10081035                        srand((double)microtime()*1000000); 
     
    10121039                        $attach_fd = fopen($filename,"w+"); 
    10131040                        $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); 
    10151042                        include_once('class.bocalendar.inc.php'); 
    10161043                        $cal = new bocalendar; 
     
    26522679                        ); 
    26532680                        $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                                         
    26542692                        $p->parse('table_row','blank_row',True); 
    26552693 
Note: See TracChangeset for help on using the changeset viewer.