/**
  * (non-PHPdoc)
  * @see Addressbook_Convert_Contact_VCard_Abstract::_toTine20ModelParseTel()
  */
 protected function _toTine20ModelParseTel(&$data, \Sabre\VObject\Property $property)
 {
     if (!isset($property['TYPE'])) {
         // CardDAVSync sends OTHER just as TEL:12345678 without any TYPE
         $data['tel_other'] = $property->getValue();
     }
     parent::_toTine20ModelParseTel($data, $property);
 }
 /**
  * (non-PHPdoc)
  * @see Addressbook_Convert_Contact_VCard_Abstract::_toTine20ModelParseTel()
  */
 protected function _toTine20ModelParseTel(&$data, \Sabre\VObject\Property $property)
 {
     $telField = null;
     if (isset($property['TYPE'])) {
         // CELL
         if ($property['TYPE']->has('cell') && $property['TYPE']->has('voice') && !$property['TYPE']->has('iphone')) {
             $telField = 'tel_cell';
         } elseif ($property['TYPE']->has('cell') && $property['TYPE']->has('iphone')) {
             $telField = 'tel_cell_private';
         }
     }
     if (!empty($telField)) {
         $data[$telField] = $property->getValue();
     } else {
         parent::_toTine20ModelParseTel($data, $property);
     }
 }
 /**
  * (non-PHPdoc)
  * @see Addressbook_Convert_Contact_VCard_Abstract::_toTine20ModelParseTel()
  */
 protected function _toTine20ModelParseTel(&$data, \Sabre\VObject\Property $property)
 {
     parent::_toTine20ModelParseTel($data, $property);
     $telfield = null;
     if (isset($property['TYPE'])) {
         // CELL
         if ($property['TYPE']->has('cell')) {
             if ($property['TYPE']->has('work')) {
                 $telField = 'tel_cell';
             } else {
                 // this will map TEL;TYPE=CELL;TYPE=PREF: to private mobile; point of discussion whether this is private or work.
                 $telField = 'tel_cell_private';
             }
             // PAGER
         } elseif ($property['TYPE']->has('pager')) {
             $telField = 'tel_pager';
             // FAX
         } elseif ($property['TYPE']->has('fax')) {
             if ($property['TYPE']->has('work')) {
                 $telField = 'tel_fax';
             } elseif ($property['TYPE']->has('home')) {
                 $telField = 'tel_fax_home';
             }
             // HOME
         } elseif ($property['TYPE']->has('home')) {
             $telField = 'tel_home';
             // WORK
         } elseif ($property['TYPE']->has('work')) {
             $telField = 'tel_work';
             // CAR
         } elseif ($property['TYPE']->has('car')) {
             // not yet supported by CalkDAVSynchronizer
             $telField = 'tel_car';
             // ASSISTENT
         } elseif ($property['TYPE']->has('assistant')) {
             // not yet supported by CalDAVSynchronizer
             $telField = 'tel_assistent';
         } else {
             // OTHER
             $telField = 'other';
         }
     }
     if (!empty($telField)) {
         $data[$telField] = $property->getValue();
     }
 }
Exemplo n.º 4
0
 protected function _toTine20ModelParseTel(&$data, $property)
 {
     $telField = null;
     $types = array();
     if (isset($property['TYPE'])) {
         // get all types
         foreach ($property['TYPE'] as $typeProperty) {
             $types[] = strtoupper($typeProperty->value);
         }
         // CELL
         if (in_array('CELL', $types) && in_array('VOICE', $types) && !in_array('IPHONE', $types)) {
             $telField = 'tel_cell';
         } elseif (in_array('CELL', $types) && in_array('IPHONE', $types)) {
             $telField = 'tel_cell_private';
         }
     }
     if (!empty($telField)) {
         $data[$telField] = $property->value;
     } else {
         parent::_toTine20ModelParseTel($data, $property);
     }
 }
 /**
  * parse telephone
  *
  * @param array $data
  * @param \Sabre\VObject\Property $property
  */
 protected function _toTine20ModelParseTel(&$data, \Sabre\VObject\Property $property)
 {
     parent::_toTine20ModelParseTel($data, $property);
     if ($property['TYPE']->has('other')) {
         $data['tel_cell_private'] = $property->getValue();
     }
 }
 /**
  * (non-PHPdoc)
  * @see Addressbook_Convert_Contact_VCard_Abstract::_toTine20ModelParseTel()
  */
 protected function _toTine20ModelParseTel(&$data, \Sabre\VObject\Property $property)
 {
     $telField = null;
     if (isset($property['TYPE'])) {
         // CELL
         if ($property['TYPE']->has('cell')) {
             $telField = 'tel_cell';
         } elseif ($property['TYPE']->has('other')) {
             $telField = 'tel_cell_private';
             // TEL
         } elseif ($property['TYPE']->has('work') && $property['TYPE']->has('voice')) {
             $telField = 'tel_work';
         } elseif ($property['TYPE']->has('home') && $property['TYPE']->has('voice')) {
             $telField = 'tel_home';
             // FAX
         } elseif ($property['TYPE']->has('work') && $property['TYPE']->has('fax')) {
             $telField = 'tel_fax';
         } elseif ($property['TYPE']->has('home') && $property['TYPE']->has('fax')) {
             $telField = 'tel_fax_home';
         }
     }
     if (!empty($telField)) {
         $data[$telField] = $property->getValue();
     } else {
         parent::_toTine20ModelParseTel($data, $property);
     }
 }