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

liveoutloud2day - June 27, 2008 - 19:46
Project:Phone (CCK)
Version:6.x-2.8
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Description

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

#1

liveoutloud2day - June 27, 2008 - 19:47

Woops - how about the patch file?

AttachmentSize
phone.type_.diff 8.48 KB

#2

liveoutloud2day - June 27, 2008 - 19:50

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

thierry_gd - July 28, 2008 - 20:47

Hi,

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

#4

Freso - March 11, 2009 - 14:55
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

2440media2 - June 27, 2009 - 03:55
Version:5.x-2.11» 6.x-2.8

Is there a patch for D6?

#6

gnindl - July 1, 2009 - 16:14

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

 
 

Drupal is a registered trademark of Dries Buytaert.