This looks like a solid plugin, but it would be nice to be able to select which phone fields are given as options. For instance, I will never use a fax number or extension anywhere on my site, ever, so I'd like to disable those fields.
Looking into the code, it seems to me like the way to do this would be to split the formatter into separate functions for Phone, Extension, Mobile, and Fax and then separate the formatter function similarly. This would create separate handlers for each field. Optimally it seems like the UI should be as in the following image, but a way to do that isn't readily apparent.
If anyone has feedback on this I'd appreciate it, otherwise I might start mucking around myself.
Comment | File | Size | Author |
---|---|---|---|
#24 | addressfiedl_phone.png | 6.16 KB | andriyun |
#16 | phonefield_selection-1874490-16.patch | 5.36 KB | basvredeling |
#10 | phonefield_selection-1874490-10.patch | 5.21 KB | basvredeling |
#5 | addressfield_phone-phone_options-1874490.patch | 5.13 KB | AaronBauman |
#4 | phone_options-1874490.patch | 8.3 KB | scotthooker |
Comments
Comment #1
donapis CreditAttribution: donapis commentedI'm looking forward for this feature
Comment #2
anni CreditAttribution: anni commentedI´m hoping for a solution too.
Comment #3
scotthooker CreditAttribution: scotthooker commentedSeeing as that comment was made back in December. I'm going to try and patch this now. Bear with me.
Comment #4
scotthooker CreditAttribution: scotthooker commentedPatch attached to give config options of what phone fields you want displayed.
Comments appreciated and I'll make the required amends.
Comment #5
AaronBaumanpatch in #4 works great, thanks Scott.
Since there are only 4 options, I like the proposal in the OP better, however, to use checkboxes instead of a multi-select list.
Also, patch in #4 contains leftover help text from Countries field, and some whitespace changes that are unrelated.
Here's an updated patch with those changes.
Comment #6
MoRphlnE CreditAttribution: MoRphlnE commentedThank you, I'll give it a try.
Comment #7
froboyThanks for the work scott and aaron. I had to apply the patch in #5 manually (it doesn't look like a git-generated patch), but once I did it changed the selectors but didn't seem to have an effect on the field display. That is, I was able to check some fields but all of the phone fields still remained. aaronbauman, could you check your patch out and resubmit?
Comment #8
Zito CreditAttribution: Zito commentedSame issue
Comment #9
jcisio CreditAttribution: jcisio commentedBecause of #7 and #8.
Comment #10
basvredelingTry this patch
Comment #11
scotthooker CreditAttribution: scotthooker commentedSorry only just seen these comments progressing on from my patch in 4.
It was a quick job. Happy to review any patches / make any amends.
Comment #12
nbchip CreditAttribution: nbchip commentedFor already instantiated fields u need one more "if" in phone.inc line 31
Comment #13
ShaneOnABike CreditAttribution: ShaneOnABike commentedI tested this and it works great thanks very much!
Comment #14
jcisio CreditAttribution: jcisio commentedPer #12. For fields instantiated before this patch, all numbers should be displayed.
Comment #15
scotthooker CreditAttribution: scotthooker commented#12 & #14 yep correct fields before this patch, all numbers are displayed.
Comment #16
basvredelingI've created a new patch. Needs to be tested. I've added the remark of #14 jcisio. All numbers also need to be visible for uninstantiated fields. So I put an extra check in each if().
Comment #17
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedFor those interested in a hook_form_alter() approach, this example code can be used to hide the mobile and fax number fields:
The place to put the #access value is buried pretty deep in the form, be sure to use a call to dpm($form) to find the correct location to set #access on the form.
Comment #18
kvoltz CreditAttribution: kvoltz commentedAny chance on this getting rolled into a new commit?
Thanks for the awesome module!
Comment #19
2ndmile CreditAttribution: 2ndmile commented#16 Tested and Working
Comment #20
drclaw CreditAttribution: drclaw commentedAlso Tested and can confirm it works. Marking as RTBC
Comment #21
jcisio CreditAttribution: jcisio commentedCommitted. Thanks all for patch and reviews.
Comment #23
drclaw CreditAttribution: drclaw commentedNice!
Comment #24
andriyun CreditAttribution: andriyun commentedHello guys!
I'm don't see this changes and not undrestend why :(
I'm install dev branch addressfield_phone and dependesies stable branch addressfield.
In field setting form show old checkbox list
Please help! :)
Comment #26
annya CreditAttribution: annya commentedI reopen this issue, cause this feature doesn't implement now, because this commit was reverted here.
@jcisio could you tell what's wrong with this patch? I can remake it if it's necessary.
Comment #28
jcisio CreditAttribution: jcisio commentedI wanted to revert 4ce1f3d and commit again with proper attribution (75c6690 right after that) but it reverted both this commit and 945b358 which came after.
Now I recommitted 945b358 and pushed as 9f57caa. Sorry for the confusion.
Comment #30
kopeboy CreditAttribution: kopeboy commentedWhat about a stable release?