phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] addressbook/inc/export Multiple_VCard, 1.2, 1.2.6.1


From: Jonathan Rivera <address@hidden>
Subject: [Phpgroupware-cvs] addressbook/inc/export Multiple_VCard, 1.2, 1.2.6.1
Date: Mon, 03 Nov 2003 20:28:03 +0000

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

Modified Files:
      Tag: Version-0_9_16-branch
        Multiple_VCard 
Log Message:
Bugfix #5150, #5342, this fix export for vcard


Index: Multiple_VCard
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/export/Multiple_VCard,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -C2 -d -r1.2 -r1.2.6.1
*** Multiple_VCard      4 Dec 2001 01:26:53 -0000       1.2
--- Multiple_VCard      3 Nov 2003 20:28:01 -0000       1.2.6.1
***************
*** 31,88 ****
                var $export = array();
  
-               /* make sure to order how we ask for these */
-               var $qfields = array(
-                       'fn'                     => 'fn',
-                       'n_given'                => 'n_given',
-                       'n_family'               => 'n_family',
-                       'n_middle'               => 'n_middle',
-                       'n_prefix'               => 'n_prefix',
-                       'n_suffix'               => 'n_suffix',
-                       'sound'                  => 'sound',
-                       'bday'                   => 'bday',
-                       'note'                   => 'note',
-                       'tz'                     => 'tz',
-                       'geo'                    => 'geo',
-                       'url'                    => 'url',
-                       'pubkey'                 => 'pubkey',
-                       'org_name'               => 'org_name',
-                       'org_unit'               => 'org_unit',
-                       'title'                  => 'title',
- 
-                       'adr_one_type'           => 'adr_one_type',
-                       'adr_two_type'           => 'adr_two_type',
-                       'tel_prefer'             => 'tel_prefer',
-                       'email_type'             => 'email_type',
-                       'email_home_type'        => 'email_home_type',
- 
-                       'adr_one_street'         => 'adr_one_street',
-                       'adr_one_locality'       => 'adr_one_locality', 
-                       'adr_one_region'         => 'adr_one_region', 
-                       'adr_one_postalcode'     => 'adr_one_postalcode',
-                       'adr_one_countryname'    => 'adr_one_countryname',
-                       'label'                  => 'label',
- 
-                       'adr_two_street'         => 'adr_two_street',
-                       'adr_two_locality'       => 'adr_two_locality', 
-                       'adr_two_region'         => 'adr_two_region', 
-                       'adr_two_postalcode'     => 'adr_two_postalcode',
-                       'adr_two_countryname'    => 'adr_two_countryname',
- 
-                       'tel_work'               => 'tel_work',
-                       'tel_home'               => 'tel_home',
-                       'tel_voice'              => 'tel_voice',
-                       'tel_fax'                => 'tel_fax', 
-                       'tel_msg'                => 'tel_msg',
-                       'tel_cell'               => 'tel_cell',
-                       'tel_pager'              => 'tel_pager',
-                       'tel_bbs'                => 'tel_bbs',
-                       'tel_modem'              => 'tel_modem',
-                       'tel_car'                => 'tel_car',
-                       'tel_isdn'               => 'tel_isdn',
-                       'tel_video'              => 'tel_video',
-                       'email'                  => 'email',
-                       'email_home'             => 'email_home'
-               );
- 
                /* This will store the contacts and vcard objects */
                var $contacts = '';
--- 31,34 ----
***************
*** 92,114 ****
                function export_start_file($buffer,$ncat_id='')
                {
                        $this->id=-1;
                        if ($ncat_id)
                        {
!                               $filter = 'tid=n,cat_id='.$ncat_id;
                        }
                        else
                        {
!                               $filter = 'tid=n';
                        }
-                       /* Setup the contact and vcard objects, and the export 
fields var */
-                       $this->contacts = CreateObject('phpgwapi.contacts');
-                       $this->vcard = CreateObject('phpgwapi.vcard');
-                       $this->export = $this->vcard->export;
  
!                       $tmp = 
$this->contacts->read('','',array('id'=>'id'),'',$filter);
                        for ($i=0;$i<count($tmp);$i++)
                        {
!                               $this->ids[$i] = $tmp[$i]['id'];
                        }
                        /*
                           $ids is now an array of all id's for this user, e.g. 
$ids[0] = 21, etc...
--- 38,65 ----
                function export_start_file($buffer,$ncat_id='')
                {
+                       /* Setup the contact and vcard objects, and the export 
fields var */
+                       $this->contacts = CreateObject('phpgwapi.contacts');
+                       $this->vcard = CreateObject('phpgwapi.vcard');
+                       $this->export = $this->vcard->export;
+ 
                        $this->id=-1;
+ 
                        if ($ncat_id)
                        {
!                               $tmp = 
$this->contacts->get_persons_by_cat($ncat_id);
!                               //$filter = 'tid=n,cat_id='.$ncat_id;
                        }
                        else
                        {
!                               $tmp = 
$this->contacts->get_persons(array('person_id'));
!                               //$filter = 'tid=n';
                        }
  
!                       //$tmp = 
$this->contacts->read('','',array('id'=>'id'),'',$filter);
                        for ($i=0;$i<count($tmp);$i++)
                        {
!                               $this->ids[$i] = $tmp[$i];
                        }
+                       
                        /*
                           $ids is now an array of all id's for this user, e.g. 
$ids[0] = 21, etc...
***************
*** 122,127 ****
                {
                        $this->id++;
!                       $top = 
$this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
!                       $this->currentrecord = $top[0];
                        return $buffer;
                }
--- 73,128 ----
                {
                        $this->id++;
!                       //$top = 
$this->contacts->read_single_entry($this->ids[$this->id],$this->qfields);
!                       $fieldlist = 
$this->contacts->person_complete_data($this->ids[$this->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'];
!                       $this->currentrecord = $fields;
                        return $buffer;
                }





reply via email to

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