When you're entering a phone number you write the country code first, so shouldn't the country selector show before the phone number's text field?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DamienMcKenna’s picture

FileSize
2.07 KB

Here's a patch that just swaps the order of the $element['country_codes'] and $element['number'] arrays in cck_phone_phone_number_process(), that's all it took.

DamienMcKenna’s picture

Status: Active » Needs review
roball’s picture

+1

Could you please also provide a patch for the 6.x-1.x branch?

roball’s picture

Status: Needs review » Patch (to be ported)

Anybody else interested in this feature for D6?

DamienMcKenna’s picture

Status: Patch (to be ported) » Needs review
FileSize
2.46 KB

Here's a patch for D6 - untested, but I just changed the order of the fields.

dboulet’s picture

Makes sense to me. Patch in #1 works fine.

ckng’s picture

Status: Needs review » Needs work

Not really, most prefer phone number first before country code selector. However I anticipated this request to come sooner or later. =)

So the best option is to let users decide themselves. This will be ideally implemented in a way user choose the display sequence of the country code
Country Code Display:
- front/before phone number textfield
- rear/after phone number textfield

with rear as default, so not to break existing site

roball’s picture

So anyone willing to create a patch implementing #7?

rooby’s picture

I'll do it in the next day or two if no one else beats me to it.

roball’s picture

Category: bug » feature

Great - I'll test it once it is out.

rooby’s picture

Status: Needs work » Needs review
FileSize
2.5 KB

Sorry, I lost track of this one.

Here is a patch for drupal 7 that adds a new option for country code position.

rooby’s picture

Oops, the previous patch has the extension in the wrong place.
This one addresses that.

On a side note, maybe an option to display the country code at the very end might be useful to someone also?
A little list of the sub elements in a weight draggable table would be pretty cool so people could have whatever order they want, although that would probbaly be overkill when there are only 3 parts.
Anyway, I'm just rambling, this should suit pretty much everyone I would imagine.

nikemen’s picture

Release, please!

rooby’s picture

@nikemen:
Are you saying you have used the patch and it works as expected?

nikemen’s picture

@rooby
Yes, indeed it works like a charm.

roball’s picture

Status: Needs review » Reviewed & tested by the community

Then the status could be changed to RTBTC. Anybody willing to port the patch to D6?

ckng’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch. Committed.

dragable any order & country code at the very end? They can open new issue for that. =)

ckng’s picture

Version: 7.x-1.x-dev » 6.x-1.x-dev
Status: Fixed » Patch (to be ported)

per #16 request, if anyone is up for this feature