I took a different approach than http://drupal.org/node/205651 with this patch. I have included a CSS file to help format it correctly in the form, and I also added an install file to handle the update from one -> two fields. The update works with both single and multi-fields. This patch file applies cleanly against 5.x-2.11

Comments

liveoutloud2day’s picture

StatusFileSize
new8.48 KB

Woops - how about the patch file?

liveoutloud2day’s picture

StatusFileSize
new8.56 KB

Oh - the above patch applies cleanly with any of the patches I submitted, except in combination with this one - http://drupal.org/node/275837 - This version of the patch applies after you have applied the "range" patch.

thierry_gd’s picture

Hi,

I think you forgot in phone.css to define the following elements :
phone-fields-end-wrapper
phone-field-end-wrapper

Freso’s picture

Status: Needs review » Needs work

You'll probably want to add some t() calls.
E.g. $order_options = array('Mobile' => 'Mobile', 'Home' => 'Home', 'Office' => 'Office', 'Apt' => 'Apt', 'Dorm' => 'Dorm', 'Fax' => 'Fax'); should probably be

 $order_options = array(
  'Mobile' => t('Mobile'),
  'Home' => t('Home'),
  'Office' => t('Office'),
  'Apt' => t('Apt'), // Perhaps "Apartment" instead, for the value?
  'Dorm' => t('Dorm'),
  'Fax' => t('Fax'),
); 

Both for better compliace with Drupal's coding standards (the array formatting), but also so that you're able to translate the values of the array keys. You'll probably want to use t() when presenting the value as well.

kruser’s picture

Version: 5.x-2.11 » 6.x-2.8

Is there a patch for D6?

gnindl’s picture

I have done some work here:
http://drupal.org/node/501060

darrellduane’s picture

+1

nedjo’s picture

Marked #205651: Phone Type Selector - Home, Work, Mobile, Fax, Other as a duplicate. It has an alternate patch.