/** * Function to convert a Horde_Icalendar_Vcard object into a Turba * Object Hash with Turba attributes suitable as a parameter for add(). * * @see add() * * @param Horde_Icalendar_Vcard $vcard The Horde_Icalendar_Vcard object * to parse. * * @return array A Turba attribute hash. */ public function toHash(Horde_Icalendar_Vcard $vcard) { $hash = array(); $attr = $vcard->getAllAttributes(); foreach ($attr as $item) { switch ($item['name']) { case 'UID': $hash['__uid'] = $item['value']; break; case 'FN': $hash['name'] = $item['value']; break; case 'N': $name = $item['values']; if (!empty($name[Horde_Icalendar_Vcard::N_FAMILY])) { $hash['lastname'] = $name[Horde_Icalendar_Vcard::N_FAMILY]; } if (!empty($name[Horde_Icalendar_Vcard::N_GIVEN])) { $hash['firstname'] = $name[Horde_Icalendar_Vcard::N_GIVEN]; } if (!empty($name[Horde_Icalendar_Vcard::N_ADDL])) { $hash['middlenames'] = $name[Horde_Icalendar_Vcard::N_ADDL]; } if (!empty($name[Horde_Icalendar_Vcard::N_PREFIX])) { $hash['namePrefix'] = $name[Horde_Icalendar_Vcard::N_PREFIX]; } if (!empty($name[Horde_Icalendar_Vcard::N_SUFFIX])) { $hash['nameSuffix'] = $name[Horde_Icalendar_Vcard::N_SUFFIX]; } break; case 'NICKNAME': case 'X-EPOCSECONDNAME': $hash['nickname'] = $item['value']; $hash['alias'] = $item['value']; break; // We use LABEL but also support ADR. // We use LABEL but also support ADR. case 'LABEL': if (isset($item['params']['HOME']) && !isset($hash['homeAddress'])) { $hash['homeAddress'] = $item['value']; } elseif (isset($item['params']['WORK']) && !isset($hash['workAddress'])) { $hash['workAddress'] = $item['value']; } elseif (!isset($hash['commonAddress'])) { $hash['commonAddress'] = $item['value']; } break; case 'ADR': if (isset($item['params']['TYPE'])) { if (!is_array($item['params']['TYPE'])) { $item['params']['TYPE'] = array($item['params']['TYPE']); } } else { $item['params']['TYPE'] = array(); if (isset($item['params']['WORK'])) { $item['params']['TYPE'][] = 'WORK'; } if (isset($item['params']['HOME'])) { $item['params']['TYPE'][] = 'HOME'; } if (count($item['params']['TYPE']) == 0) { $item['params']['TYPE'][] = 'COMMON'; } } $address = $item['values']; foreach ($item['params']['TYPE'] as $adr) { switch (Horde_String::upper($adr)) { case 'HOME': $prefix = 'home'; break; case 'WORK': $prefix = 'work'; break; default: $prefix = 'common'; } if (isset($hash[$prefix . 'Address'])) { continue; } $hash[$prefix . 'Address'] = ''; if (!empty($address[Horde_Icalendar_Vcard::ADR_STREET])) { $hash[$prefix . 'Street'] = $address[Horde_Icalendar_Vcard::ADR_STREET]; $hash[$prefix . 'Address'] .= $hash[$prefix . 'Street'] . "\n"; } if (!empty($address[Horde_Icalendar_Vcard::ADR_EXTEND])) { $hash[$prefix . 'Extended'] = $address[Horde_Icalendar_Vcard::ADR_EXTEND]; $hash[$prefix . 'Address'] .= $hash[$prefix . 'Extended'] . "\n"; } if (!empty($address[Horde_Icalendar_Vcard::ADR_POB])) { $hash[$prefix . 'POBox'] = $address[Horde_Icalendar_Vcard::ADR_POB]; $hash[$prefix . 'Address'] .= $hash[$prefix . 'POBox'] . "\n"; } if (!empty($address[Horde_Icalendar_Vcard::ADR_LOCALITY])) { $hash[$prefix . 'City'] = $address[Horde_Icalendar_Vcard::ADR_LOCALITY]; $hash[$prefix . 'Address'] .= $hash[$prefix . 'City']; } if (!empty($address[Horde_Icalendar_Vcard::ADR_REGION])) { $hash[$prefix . 'Province'] = $address[Horde_Icalendar_Vcard::ADR_REGION]; $hash[$prefix . 'Address'] .= ', ' . $hash[$prefix . 'Province']; } if (!empty($address[Horde_Icalendar_Vcard::ADR_POSTCODE])) { $hash[$prefix . 'PostalCode'] = $address[Horde_Icalendar_Vcard::ADR_POSTCODE]; $hash[$prefix . 'Address'] .= ' ' . $hash[$prefix . 'PostalCode']; } if (!empty($address[Horde_Icalendar_Vcard::ADR_COUNTRY])) { include 'Horde/Nls/Countries.php'; $country = array_search($address[Horde_Icalendar_Vcard::ADR_COUNTRY], $countries); if ($country === false) { $country = $address[Horde_Icalendar_Vcard::ADR_COUNTRY]; } $hash[$prefix . 'Country'] = $country; $hash[$prefix . 'Address'] .= "\n" . $address[Horde_Icalendar_Vcard::ADR_COUNTRY]; } $hash[$prefix . 'Address'] = trim($hash[$prefix . 'Address']); } break; case 'TZ': // We only support textual timezones. if (!isset($item['params']['VALUE']) || Horde_String::lower($item['params']['VALUE']) != 'text') { break; } $timezones = explode(';', $item['value']); $available_timezones = Horde_Nls::getTimezones(); foreach ($timezones as $timezone) { $timezone = trim($timezone); if (isset($available_timezones[$timezone])) { $hash['timezone'] = $timezone; break 2; } } break; case 'GEO': if (isset($item['params']['HOME'])) { $hash['homeLatitude'] = $item['value']['latitude']; $hash['homeLongitude'] = $item['value']['longitude']; } elseif (isset($item['params']['WORK'])) { $hash['workLatitude'] = $item['value']['latitude']; $hash['workLongitude'] = $item['value']['longitude']; } else { $hash['latitude'] = $item['value']['latitude']; $hash['longitude'] = $item['value']['longitude']; } break; case 'TEL': if (isset($item['params']['FAX'])) { if (isset($item['params']['WORK']) && !isset($hash['workFax'])) { $hash['workFax'] = $item['value']; } elseif (isset($item['params']['HOME']) && !isset($hash['homeFax'])) { $hash['homeFax'] = $item['value']; } elseif (!isset($hash['fax'])) { $hash['fax'] = $item['value']; } } elseif (isset($item['params']['PAGER']) && !isset($hash['pager'])) { $hash['pager'] = $item['value']; } elseif (isset($item['params']['TYPE'])) { if (!is_array($item['params']['TYPE'])) { $item['params']['TYPE'] = array($item['params']['TYPE']); } foreach ($item['params']['TYPE'] as &$type) { $type = Horde_String::upper($type); } // For vCard 3.0. if (in_array('CELL', $item['params']['TYPE'])) { if (in_array('HOME', $item['params']['TYPE']) && !isset($hash['homeCellPhone'])) { $hash['homeCellPhone'] = $item['value']; } elseif (in_array('WORK', $item['params']['TYPE']) && !isset($hash['workCellPhone'])) { $hash['workCellPhone'] = $item['value']; } elseif (!isset($hash['cellPhone'])) { $hash['cellPhone'] = $item['value']; } } elseif (in_array('FAX', $item['params']['TYPE'])) { if (in_array('HOME', $item['params']['TYPE']) && !isset($hash['homeFax'])) { $hash['homeFax'] = $item['value']; } elseif (in_array('WORK', $item['params']['TYPE']) && !isset($hash['workFax'])) { $hash['workFax'] = $item['value']; } elseif (!isset($hash['fax'])) { $hash['fax'] = $item['value']; } } elseif (in_array('VIDEO', $item['params']['TYPE'])) { if (in_array('HOME', $item['params']['TYPE']) && !isset($hash['homeVideoCall'])) { $hash['homeVideoCall'] = $item['value']; } elseif (in_array('WORK', $item['params']['TYPE']) && !isset($hash['workVideoCall'])) { $hash['workVideoCall'] = $item['value']; } elseif (!isset($hash['videoCall'])) { $hash['videoCall'] = $item['value']; } } elseif (in_array('PAGER', $item['params']['TYPE']) && !isset($hash['pager'])) { $hash['pager'] = $item['value']; } elseif (in_array('WORK', $item['params']['TYPE']) && !isset($hash['workPhone'])) { $hash['workPhone'] = $item['value']; } elseif (in_array('HOME', $item['params']['TYPE']) && !isset($hash['homePhone'])) { $hash['homePhone'] = $item['value']; } elseif (!isset($hash['phone'])) { $hash['phone'] = $item['value']; } } elseif (isset($item['params']['CELL'])) { if (isset($item['params']['WORK']) && !isset($hash['workCellPhone'])) { $hash['workCellPhone'] = $item['value']; } elseif (isset($item['params']['HOME']) && !isset($hash['homeCellPhone'])) { $hash['homeCellPhone'] = $item['value']; } elseif (!isset($hash['cellPhone'])) { $hash['cellPhone'] = $item['value']; } } elseif (isset($item['params']['VIDEO'])) { if (isset($item['params']['WORK']) && !isset($hash['workVideoCall'])) { $hash['workVideoCall'] = $item['value']; } elseif (isset($item['params']['HOME']) && !isset($hash['homeVideoCall'])) { $hash['homeVideoCall'] = $item['value']; } elseif (!isset($hash['videoCall'])) { $hash['videoCall'] = $item['value']; } } else { if (isset($item['params']['WORK']) && !isset($hash['workPhone'])) { $hash['workPhone'] = $item['value']; } elseif (isset($item['params']['HOME']) && !isset($hash['homePhone'])) { $hash['homePhone'] = $item['value']; } else { $hash['phone'] = $item['value']; } } break; case 'EMAIL': $email_set = false; if (isset($item['params']['HOME']) && (!isset($hash['homeEmail']) || isset($item['params']['PREF']))) { $e = Horde_Icalendar_Vcard::getBareEmail($item['value']); $hash['homeEmail'] = $e ? $e : ''; $email_set = true; } elseif (isset($item['params']['WORK']) && (!isset($hash['workEmail']) || isset($item['params']['PREF']))) { $e = Horde_Icalendar_Vcard::getBareEmail($item['value']); $hash['workEmail'] = $e ? $e : ''; $email_set = true; } elseif (isset($item['params']['TYPE'])) { if (!is_array($item['params']['TYPE'])) { $item['params']['TYPE'] = array($item['params']['TYPE']); } foreach ($item['params']['TYPE'] as &$type) { $type = Horde_String::upper($type); } if (in_array('HOME', $item['params']['TYPE']) && (!isset($hash['homeEmail']) || in_array('PREF', $item['params']['TYPE']))) { $e = Horde_Icalendar_Vcard::getBareEmail($item['value']); $hash['homeEmail'] = $e ? $e : ''; $email_set = true; } elseif (in_array('WORK', $item['params']['TYPE']) && (!isset($hash['workEmail']) || in_array('PREF', $item['params']['TYPE']))) { $e = Horde_Icalendar_Vcard::getBareEmail($item['value']); $hash['workEmail'] = $e ? $e : ''; $email_set = true; } } if (!$email_set && (!isset($hash['email']) || isset($item['params']['PREF']))) { $e = Horde_Icalendar_Vcard::getBareEmail($item['value']); $hash['email'] = $e ? $e : ''; } if (!isset($hash['emails'])) { $hash['emails'] = ''; } if ($e = Horde_Icalendar_Vcard::getBareEmail($item['value'])) { if (strlen($hash['emails'])) { $hash['emails'] .= ','; } $hash['emails'] .= $e; } break; case 'TITLE': $hash['title'] = $item['value']; break; case 'ROLE': $hash['role'] = $item['value']; break; case 'ORG': // The VCARD 2.1 specification requires the presence of two // SEMI-COLON separated fields: Organizational Name and // Organizational Unit. Additional fields are optional. $hash['company'] = !empty($item['values'][0]) ? $item['values'][0] : ''; $hash['department'] = !empty($item['values'][1]) ? $item['values'][1] : ''; break; case 'NOTE': $hash['notes'] = $item['value']; break; case 'CATEGORIES': $hash['businessCategory'] = $item['value']; $hash['__tags'] = $item['values']; break; case 'URL': if (isset($item['params']['HOME']) && !isset($hash['homeWebsite'])) { $hash['homeWebsite'] = $item['value']; } elseif (isset($item['params']['WORK']) && !isset($hash['workWebsite'])) { $hash['workWebsite'] = $item['value']; } elseif (!isset($hash['website'])) { $hash['website'] = $item['value']; } break; case 'BDAY': if (empty($item['value'])) { $hash['birthday'] = null; } else { $hash['birthday'] = $item['value']['year'] . '-' . $item['value']['month'] . '-' . $item['value']['mday']; } break; case 'PHOTO': case 'LOGO': if (isset($item['params']['VALUE']) && Horde_String::lower($item['params']['VALUE']) == 'uri') { // No support for URIs yet. break; } if (!isset($item['params']['ENCODING']) || Horde_String::lower($item['params']['ENCODING']) != 'b' && Horde_String::upper($item['params']['ENCODING']) != 'BASE64') { // Invalid property. break; } $type = Horde_String::lower($item['name']); $hash[$type] = base64_decode($item['value']); if (isset($item['params']['TYPE'])) { $hash[$type . 'type'] = $item['params']['TYPE']; } break; case 'X-SIP': if (isset($item['params']['POC']) && !isset($hash['ptt'])) { $hash['ptt'] = $item['value']; } elseif (isset($item['params']['VOIP']) && !isset($hash['voip'])) { $hash['voip'] = $item['value']; } elseif (isset($item['params']['SWIS']) && !isset($hash['shareView'])) { $hash['shareView'] = $item['value']; } elseif (!isset($hash['sip'])) { $hash['sip'] = $item['value']; } break; case 'X-WV-ID': $hash['imaddress'] = $item['value']; break; case 'X-ANNIVERSARY': if (empty($item['value'])) { $hash['anniversary'] = null; } else { $hash['anniversary'] = $item['value']['year'] . '-' . $item['value']['month'] . '-' . $item['value']['mday']; } break; case 'X-CHILDREN': $hash['children'] = $item['value']; break; case 'X-SPOUSE': $hash['spouse'] = $item['value']; break; } } /* Ensure we have a valid name field. */ if (empty($hash['name'])) { /* If name is a composite field, it won't be present in the * $this->fields array, so check for that as well. */ if (isset($this->map['name']) && is_array($this->map['name']) && !empty($this->map['name']['attribute'])) { $fieldarray = array(); foreach ($this->map['name']['fields'] as $mapfields) { $fieldarray[] = isset($hash[$mapfields]) ? $hash[$mapfields] : ''; } $hash['name'] = Turba::formatCompositeField($this->map['name']['format'], $fieldarray); } else { $hash['name'] = isset($hash['firstname']) ? $hash['firstname'] : ''; if (!empty($hash['lastname'])) { $hash['name'] .= ' ' . $hash['lastname']; } $hash['name'] = trim($hash['name']); } } // Ensure we have an 'email' field since we don't know for sure what // the source is, therefore we don't know the mappings available. Fixes // importing vCards that have all EMAIL properties with a TYPE // attribute. // See Bug: 12955 if (!isset($hash['email'])) { if (!empty($hash['homeEmail'])) { $hash['email'] = Horde_Icalendar_Vcard::getBareEmail($hash['homeEmail']); } else { if (!empty($hash['workEmail'])) { $hash['email'] = Horde_Icalendar_Vcard::getBareEmail($hash['workEmail']); } } } return $hash; }
$_prefs['language'] = array('value' => '', 'type' => 'enum', 'enum' => array(), 'escaped' => true, 'desc' => _("Select your preferred language:"), 'on_init' => function ($ui) { $enum = $GLOBALS['registry']->nlsconfig->languages; array_unshift($enum, _("Default")); $ui->prefs['language']['enum'] = $enum; }, 'on_change' => function () { global $prefs, $registry; $registry->setLanguageEnvironment($prefs->getValue('language')); foreach ($registry->listApps() as $app) { if ($registry->isAuthenticated(array('app' => $app, 'notransparent' => true))) { $registry->callAppMethod($app, 'changeLanguage'); } } }); $_prefs['sending_charset'] = array('value' => 'UTF-8', 'advanced' => true, 'locked' => true, 'type' => 'enum', 'enum' => array_merge(array('' => _("Default")), $GLOBALS['registry']->nlsconfig->encodings_sort), 'desc' => _("Default charset for sending e-mail messages:")); $_prefs['timezone'] = array('value' => '', 'type' => 'enum', 'enum' => array(), 'desc' => _("Your current time zone:"), 'on_init' => function ($ui) { $enum = Horde_Nls::getTimezones(); array_unshift($enum, _("Default")); $ui->prefs['timezone']['enum'] = $enum; }); $_prefs['twentyFour'] = array('value' => false, 'type' => 'checkbox', 'desc' => _("Display 24-hour times?")); $_prefs['date_format'] = array('value' => '%x', 'type' => 'enum', 'enum' => array('%x' => strftime('%x'), '%Y-%m-%d' => strftime('%Y-%m-%d'), '%d/%m/%Y' => strftime('%d/%m/%Y'), '%A, %B %d, %Y' => strftime('%A, %B %d, %Y'), '%A, %d. %B %Y' => strftime('%A, %d. %B %Y'), '%A, %d %B %Y' => strftime('%A, %d %B %Y'), '%a, %b %e, %Y' => strftime('%a, %b %e, %Y'), '%a, %b %e, %y' => strftime('%a, %b %e, %y'), '%a, %b %e' => strftime('%a, %b %e'), '%a, %e %b %Y' => strftime('%a, %e %b %Y'), '%a, %e %b %y' => strftime('%a, %e %b %y'), '%a %d %b %Y' => strftime('%a %d %b %Y'), '%a %x' => strftime('%a %x'), '%a %Y-%m-%d' => strftime('%a %Y-%m-%d'), '%e %b %Y' => strftime('%e %b %Y'), '%e. %b %Y' => strftime('%e. %b %Y'), '%e. %m %Y' => strftime('%e %m %Y'), '%e. %m.' => strftime('%e. %m.'), '%e. %B' => strftime('%e. %B'), '%e. %B %Y' => strftime('%e. %B %Y'), '%e. %B %y' => strftime('%e. %B %y'), '%B %e, %Y' => strftime('%B %e, %Y')), 'desc' => _("Choose how to display dates (full format):")); $_prefs['date_format_mini'] = array('value' => '%x', 'type' => 'enum', 'enum' => array('%x' => strftime('%x'), '%Y-%m-%d' => strftime('%Y-%m-%d'), '%d/%m/%Y' => strftime('%d/%m/%Y'), '%a, %b %e, %Y' => strftime('%a, %b %e, %Y'), '%a, %b %e, %y' => strftime('%a, %b %e, %y'), '%a, %b %e' => strftime('%a, %b %e'), '%a, %e %b %Y' => strftime('%a, %e %b %Y'), '%a, %e %b %y' => strftime('%a, %e %b %y'), '%a %d %b %Y' => strftime('%a %d %b %Y'), '%a %x' => strftime('%a %x'), '%a %Y-%m-%d' => strftime('%a %Y-%m-%d'), '%e %b %Y' => strftime('%e %b %Y'), '%e. %b %Y' => strftime('%e. %b %Y'), '%e. %m %Y' => strftime('%e %m %Y'), '%e. %m.' => strftime('%e. %m.'), '%b %e, %Y' => strftime('%b %e, %Y')), 'desc' => _("Choose how to display dates (abbreviated format):")); $_prefs['time_format'] = array('value' => '%X', 'type' => 'enum', 'enum' => array('%X' => strftime('%X') . ' (' . _("Default") . ')', '%H:%M:%S' => strftime('%H:%M:%S') . ' (' . _("24-hour format") . ')', '%l:%M:%S %p' => strftime('%l:%M:%S %p')), 'desc' => _("Choose how to display times (full format):")); $_prefs['time_format_mini'] = array('value' => '%X', 'type' => 'enum', 'enum' => array('%X' => strftime('%X') . ' (' . _("Default") . ')', '%H:%M' => strftime('%H:%M') . ' (' . _("24-hour format") . ')', '%l:%M %p' => strftime('%l:%M %p')), 'desc' => _("Choose how to display times (abbreviated format):")); $_prefs['first_week_day'] = array('value' => '0', 'type' => 'enum', 'enum' => array('0' => _("Sunday"), '1' => _("Monday")), 'desc' => _("Which day would you like to be displayed as the first day of the week?")); // *** Categories/Labels Preferences *** $prefGroups['categories'] = array('column' => _("Your Information"), 'label' => _("Categories and Labels"), 'desc' => _("Manage the list of categories you have to label items with, and colors associated with those categories."), 'members' => array('categorymanagement')); // UI for category management. $_prefs['categorymanagement'] = array('type' => 'special', 'handler' => 'Horde_Prefs_Special_Category'); $_prefs['categories'] = array('value' => ''); $_prefs['category_colors'] = array('value' => '');
$attributes['workPOBox'] = array('label' => _("Work Post Office Box"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 10, 'maxlength' => 10)); $attributes['workCity'] = array('label' => _("Work City"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['workProvince'] = array('label' => _("Work State/Province"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['workPostalCode'] = array('label' => _("Work Postal Code"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 10, 'maxlength' => 10)); $attributes['workCountry'] = array('label' => _("Work Country"), 'type' => 'country', 'required' => false, 'params' => array('prompt' => true)); $attributes['workCountryFree'] = array('label' => _("Work Country"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['companyAddress'] = array('label' => _("Company Address"), 'type' => 'address', 'required' => false, 'params' => array('rows' => 3, 'cols' => 40)); $attributes['otherAddress'] = array('label' => _("Other Address"), 'type' => 'address', 'required' => false, 'params' => array('rows' => 3, 'cols' => 40)); $attributes['otherStreet'] = array('label' => _("Other Street Address"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['otherCity'] = array('label' => _("Other City"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['otherProvince'] = array('label' => _("Other State/Province"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['otherPostalCode'] = array('label' => _("Other Postal Code"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 10, 'maxlength' => 10)); $attributes['otherCountry'] = array('label' => _("Other Country"), 'type' => 'country', 'required' => false, 'params' => array('prompt' => true)); $attributes['otherCountryFree'] = array('label' => _("Other Country"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 40, 'maxlength' => 255)); $attributes['otherPOBox'] = array('label' => _("Other Post Office Box"), 'type' => 'text', 'required' => false, 'params' => array('regex' => '', 'size' => 10, 'maxlength' => 10)); $attributes['timezone'] = array('label' => _("Time Zone"), 'type' => 'enum', 'params' => array('values' => Horde_Nls::getTimezones(), 'prompt' => true), 'required' => false); /* Communication. */ $attributes['email'] = array('label' => _("Email"), 'type' => 'email', 'required' => false, 'params' => array('allow_multi' => false, 'strip_domain' => false, 'link_compose' => true, 'link_name' => null, 'delimiters' => ',', 'size' => null)); $attributes['emails'] = array('label' => _("Emails"), 'type' => 'email', 'required' => false, 'params' => array('allow_multi' => true, 'strip_domain' => false, 'link_compose' => true, 'link_name' => null, 'delimiters' => ',', 'size' => null)); $attributes['homePhone'] = array('label' => _("Home Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['homePhone2'] = array('label' => _("Home Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['workPhone'] = array('label' => _("Work Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['workPhone2'] = array('label' => _("Work Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['assistPhone'] = array('label' => _("Assistant Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['companyPhone'] = array('label' => _("Company Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['cellPhone'] = array('label' => _("Mobile Phone"), 'type' => 'cellphone', 'required' => false); $attributes['carPhone'] = array('label' => _("Car Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['radioPhone'] = array('label' => _("Radio Phone"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['fax'] = array('label' => _("Fax"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['homeFax'] = array('label' => _("Home Fax"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15)); $attributes['pager'] = array('label' => _("Pager"), 'type' => 'phone', 'required' => false, 'params' => array('size' => 15));