phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] addressbook/inc class.uivcard.inc.php, 1.5.2.1.2.2, 1


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] addressbook/inc class.uivcard.inc.php, 1.5.2.1.2.2, 1.5.2.1.2.3 class.uiXport.inc.php, 1.6.2.4.2.1, 1.6.2.4.2.2 class.boXport.inc.php, 1.7.4.1, 1.7.4.2
Date: Mon, 03 Nov 2003 20:28:04 +0000

Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv2922/addressbook/inc

Modified Files:
      Tag: Version-0_9_16-branch
        class.uivcard.inc.php class.uiXport.inc.php 
        class.boXport.inc.php 
Log Message:
Bugfix #5150, #5342, this fix export for vcard


Index: class.uivcard.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uivcard.inc.php,v
retrieving revision 1.5.2.1.2.2
retrieving revision 1.5.2.1.2.3
diff -C2 -d -r1.5.2.1.2.2 -r1.5.2.1.2.3
*** class.uivcard.inc.php       8 Oct 2003 08:47:25 -0000       1.5.2.1.2.2
--- class.uivcard.inc.php       3 Nov 2003 20:28:01 -0000       1.5.2.1.2.3
***************
*** 88,106 ****
                        }
  
!                       // First, make sure they have permission to this entry
!                       $check = $this->bo->read_entry(array('id' => $ab_id, 
'fields' => array('owner' => 'owner')));
!                       $perms = 
$this->contacts->check_perms($this->contacts->grants[$check[0]['owner']],PHPGW_ACL_READ);
! 
!                       if ( (!$perms) && ($check[0]['owner'] != 
$GLOBALS['phpgw_info']['user']['account_id']) )
                        {
!                               Header("Location: " . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'));
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
  
-                       $extrafields = array('address2' => 'address2');
-                       $qfields = $this->contacts->stock_contact_fields + 
$extrafields;
- 
-                       $fieldlist = $this->bo->read_entry(array('id' => 
$ab_id, 'fields' => $qfields));
-                       $fields = $fieldlist[0];
  
                        $email        = $fields['email'];
--- 88,149 ----
                        }
  
!                       if(!$this->contacts->check_edit($ab_id))
                        {
!                               Header("Location: " . 
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
                                $GLOBALS['phpgw']->common->phpgw_exit();
                        }
+                       
+                       // First, make sure they have permission to this entry
+                       $fieldlist = 
$this->contacts->person_complete_data($ab_id);
+                       $type_work = 
$this->contacts->search_location_type('work');
+                       $type_home = 
$this->contacts->search_location_type('home');
+                       $fields['full_name']            = 
$fieldlist['full_name'];
+                       $fields['first_name']           = 
$fieldlist['first_name'];
+                       $fields['last_name']            = 
$fieldlist['last_name'];
+                       $fields['middle_name']          = 
$fieldlist['middle_name'];
+                       $fields['prefix']               = $fieldlist['prefix'];
+                       $fields['suffix']               = $fieldlist['suffix'];
+                       $fields['sound']                = $fieldlist['sound'];
+                       $fields['birthday']             = 
$fieldlist['birthday'];
+                       //$fields['note']               = $fieldlist[''];
+                       //$fields['tz']                 = 
$fieldlist['locations'][$type_work][''];
+                       //$fields['geo']                = $fieldlist[''];
+                       $fields['url']                  = $fieldlist['website'];
+                       $fields['pubkey']               = $fieldlist['pubkey'];
+                       $fields['org_name']             = 
$fieldlist['org_name'];
+                       $fields['org_unit']             = 
$fieldlist['department'];
+                       $fields['title']                = $fieldlist['title'];
+                       $fields['adr_one_type']         = 'WORK';
+                       $fields['adr_two_type']         = 'HOME';
+                       //$fields['tel_prefer']         = $fieldlist[''];
+                       $fields['email_type']           = 'INTERNET';
+                       $fields['email_home_type']      = 'INTERNET';
+                       $fields['adr_one_street']       = 
$fieldlist['locations'][$type_work]['add1'];
+                       $fields['adr_one_locality']     = 
$fieldlist['locations'][$type_work]['city'];
+                       $fields['adr_one_region']       = 
$fieldlist['locations'][$type_work]['state'];
+                       $fields['adr_one_postalcode']   = 
$fieldlist['locations'][$type_work]['postal_code'];
+                       $fields['adr_one_countryname']  = 
$fieldlist['locations'][$type_work]['country'];
+                       $fields['address2']             = 
$fieldlist['locations'][$type_work]['add2'];
+                       $fields['label']                = 
$fieldlist['locations'][$type_work]['add1'].' 
'.$fieldlist['locations'][$type_work]['add2'];;
+                       $fields['adr_two_street']       = 
$fieldlist['locations'][$type_home]['add1'];
+                       $fields['adr_two_locality']     = 
$fieldlist['locations'][$type_home]['city'];
+                       $fields['adr_two_region']       = 
$fieldlist['locations'][$type_home]['state'];
+                       $fields['adr_two_postalcode']   = 
$fieldlist['locations'][$type_home]['postal_code'];
+                       $fields['adr_two_countryname']  = 
$fieldlist['locations'][$type_home]['country'];
+                       $fields['tel_work']             = $fieldlist['work 
phone'];
+                       $fields['tel_home']             = $fieldlist['home 
phone'];
+                       $fields['tel_voice']            = $fieldlist['voice 
phone'];
+                       $fields['tel_fax']              = $fieldlist['work 
fax'];
+                       $fields['tel_msg']              = $fieldlist['msg 
phone'];
+                       $fields['tel_cell']             = $fieldlist['mobile 
(cell) phone'];
+                       $fields['tel_pager']            = $fieldlist['pager'];
+                       $fields['tel_bbs']              = $fieldlist['bbs'];
+                       $fields['tel_modem']            = $fieldlist['modem'];
+                       $fields['tel_car']              = $fieldlist['car 
phone'];
+                       $fields['tel_isdn']             = $fieldlist['isdn'];
+                       $fields['tel_video']            = $fieldlist['video'];
+                       $fields['email']                = $fieldlist['work 
email'];
+                       $fields['email_home']           = $fieldlist['home 
email'];
  
  
                        $email        = $fields['email'];
***************
*** 116,121 ****
                                $fields['email_home_type'] = 'INTERNET';
                        }
!                       $firstname    = $fields['n_given'];
!                       $lastname     = $fields['n_family'];
  
                        if(!$nolname && !$nofname)
--- 159,164 ----
                                $fields['email_home_type'] = 'INTERNET';
                        }
!                       $firstname    = $fields['first_name'];
!                       $lastname     = $fields['last_name'];
  
                        if(!$nolname && !$nofname)
***************
*** 162,170 ****
  
                                // create a vcard from this translated array
!                           $entry = $this->vcard->out($buffer);
                                // print it using browser class for headers
                                // filename, mimetype, no length, default 
nocache True
                                
$this->browser->content_header($filename,'text/x-vcard');
                                echo $entry;
                                exit;
                                //$GLOBALS['phpgw']->common->exit;
--- 205,215 ----
  
                                // create a vcard from this translated array
!                               $entry = $this->vcard->out($buffer);
!                               
                                // print it using browser class for headers
                                // filename, mimetype, no length, default 
nocache True
                                
$this->browser->content_header($filename,'text/x-vcard');
                                echo $entry;
+                               sleep(1);
                                exit;
                                //$GLOBALS['phpgw']->common->exit;

Index: class.boXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.boXport.inc.php,v
retrieving revision 1.7.4.1
retrieving revision 1.7.4.2
diff -C2 -d -r1.7.4.1 -r1.7.4.2
*** class.boXport.inc.php       8 Sep 2003 13:26:37 -0000       1.7.4.1
--- class.boXport.inc.php       3 Nov 2003 20:28:02 -0000       1.7.4.2
***************
*** 242,254 ****
                                }
                        }
-                       $extrafields = array(
-                               'ophone'   => 'ophone',
-                               'address2' => 'address2',
-                               'address3' => 'address3'
-                       );
-                       if ($contacts->type != 'vcard')
-                       {
-                               $contacts->qfields = 
$contacts->stock_contact_fields;# + $extrafields;# + $customfields;
-                       }
  
                        if (!empty($cat_id))
--- 242,245 ----

Index: class.uiXport.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiXport.inc.php,v
retrieving revision 1.6.2.4.2.1
retrieving revision 1.6.2.4.2.2
diff -C2 -d -r1.6.2.4.2.1 -r1.6.2.4.2.2
*** class.uiXport.inc.php       8 Sep 2003 13:26:37 -0000       1.6.2.4.2.1
--- class.uiXport.inc.php       3 Nov 2003 20:28:02 -0000       1.6.2.4.2.2
***************
*** 160,165 ****
                function export()
                {
!                       global 
$convert,$tsvfilename,$cat_id,$download,$conv_type;
! 
                        if ($convert)
                        {
--- 160,164 ----
                function export()
                {
!                       global 
$convert,$tsvfilename,$fcat_id,$download,$conv_type;
                        if ($convert)
                        {
***************
*** 176,180 ****
                                }
  
!                               $buffer = $this->bo->export($conv_type,$cat_id);
  
                                if(($download == 'on') || ($conv_type == 
'Palm_PDB') )
--- 175,179 ----
                                }
  
!                               $buffer = 
$this->bo->export($conv_type,$fcat_id);
  
                                if(($download == 'on') || ($conv_type == 
'Palm_PDB') )





reply via email to

[Prev in Thread] Current Thread [Next in Thread]