Download & Extend

Allow user to have a phone type (Mobile, Home, Office, etc) associated with a phone number.

Project:Phone
Version:6.x-2.8
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work

Issue Summary

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

#1

Woops - how about the patch file?

AttachmentSize
phone.type_.diff 8.48 KB

#2

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.

AttachmentSize
phone.type_.after_.range_.diff 8.56 KB

#3

Hi,

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

#4

Status:needs review» needs work

You'll probably want to add some t() calls.
E.g.

<?php
$order_options
= array('Mobile' => 'Mobile', 'Home' => 'Home', 'Office' => 'Office', 'Apt' => 'Apt', 'Dorm' => 'Dorm', 'Fax' => 'Fax');
?>
should probably be
<?php
$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.

#5

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

Is there a patch for D6?

#6

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

#7

+1

nobody click here