Task description
Create an abstraction of the existing filters for phone numbers, so that the filter (to be created) works for all country-codes. The new filter should validate the number the user typs in against the rules of ITU, therefor add a default country-code (configuration option), if the user didn't, ignore all brackets, dots, dashes etc. form the user - input, test the length of the phone numbers (digits only) against a configurable length (default 20; ITU recommondation 15 + Country-code)
The new filter can also be used to transmit the phone-numbers to asterisk for initiating a call, so drupal makes a step forward.

Learning opportunity: How are international phone numbers formatet? What country-codes exist? Who defines standards for phone-numbers? How to validate user-input for accuracy and security?

Approach:
Install drupal, cck and phone
create a input-type with a phone nuber, test the limits of the existing phone-module (not all country-codes can be used)
take the php-Editor / IDE of your choice
Learn how the existing filters are build (fr, us, ca, it, ru)
Create the configuration for the filter
Create the generic filter for all phone-numbers
Integrate the configuration, the filter and the existing phone-module

Deliverable(s)
a new filter for phone
a patch of phone.module to integrate the new filter
at least one page of user documentation

Resources
http://ftp.drupal.org/files/projects/drupal-5.6.tar.gz
http://drupal.org/project/cck
IRC: #drupal
The phone modul: http://drupal.org/project/phone
http://en.wikipedia.org/wiki/List_of_country_calling_codes
RegEx - Tester: http://sourceforge.net/projects/kodos/
http://drupal.org/project/asterisk

Primary contact
Thomas_Zahreddin
mailto:ghop@it-arts.org

Comments

aclight’s picture

Status: Active » Needs work

A few quick comments (I'll try to review in more detail later)

1.) Can you give your requirements of the filter in a bullet format. It's a little difficult for me to see where one requirement stops and the next starts right now.

2.) Have you discussed this with the maintainer of the phone module (if you're not that person)? Is the maintainer cool with accepting such a patch and willing to help out if necessary?

3.) You should provide the branch/version of all relevant modules in this task that the student should use, including the branch against which the patch should be rolled.

4.) Get rid of the learning opportunity section, unless you intend for part of the task to be to write up such information. If that's the case, you need that to be included in the deliverables section.

5.) Deliverables section should specify that task is complete when patch is reviewed and marked RTBC or committed to repository.

Thomas_Zahreddin’s picture

1)
Requirements:
+ Create an abstraction of the existing filters for phone numbers, so that the filter (to be created) works for all country-codes.
+ The new filter should validate the number the user typs in against the rules of ITU: valid country code if started with a "+" sign
+ add a configuration option for a default country code,
+ add a default country-code if the user didn't typed it in
+ add a configuration option for the maximum number of digits a phone number (default 20; ITU recommondation 15 + Country-code)
+ test the length of the phone numbers (digits only) against the configured length, while ignoring all brackets, dots, dashes etc. form the user - input,

2) maintainer asked via contact form

3) phone is now only for D5 aviable, so the students have to use D5 with the actual developer release of the phone module

4) the learnings:
(thank you mentioning that point)
these answers have to be found to create the filter
and to maintain the filter the sources of the answers have to be documented with the filter
part of the answers are encoded in rules the number has to match

5) RTBC is the state to approach, the maintainer is asked to help and for reviewing the patch.

aclight’s picture

Component: GHOP Task » Task idea

Can you update this task idea with my comments and your responses to those. That'll make this easier to review. Thanks!

Thomas_Zahreddin’s picture

Task description / Requirements:
Create an abstraction of the existing filters for phone numbers, so that the filter (to be created) works for all country-codes, therefor:
+ add a configuration option for a default country code,
+ The new filter should validate the number from the user-input against the rules of ITU: validate the country code if started with a "+" sign
+ add a default country-code if the user didn't typed it in
+ add a configuration option for the maximum number of digits a phone number is allowed to have (default 20; ITU recommondation 15 + Country-code)
+ test the length of the phone numbers (digits only) against the configured length, while ignoring all brackets, dots, dashes etc. form the user - input,

Learning opportunity: How are international phone numbers formatet? What country-codes exist? Who defines standards for phone-numbers? How to validate user-input for accuracy and security?

Approach:
Install drupal, cck and phone
create a input-type with a phone nuber, test the limits of the existing phone-module (not all country-codes can be used)
take the php-Editor / IDE of your choice
Learn how the existing filters are build (fr, us, ca, it, ru)
Create the configuration for the filter
Create the generic filter for all phone-numbers
Integrate the configuration: the filter and the existing phone-module

Versions:
phone is now only for D5 aviable, so the students have to use D5 with the actual developer release of the phone module

Deliverable(s)
a new filter for phone (Ready for review)
a patch of phone.module to integrate the new filter (Ready for review)
at least one page of user documentation: Who defines country-codes? Where are they officiealy documented? What is the recommendation for the length of phone numbers? What signs are used to format a phone-number ?

Resources
http://ftp.drupal.org/files/projects/drupal-5.6.tar.gz
http://drupal.org/project/cck
IRC: #drupal
The phone modul: http://drupal.org/project/phone
http://en.wikipedia.org/wiki/List_of_country_calling_codes
RegEx - Tester: http://sourceforge.net/projects/kodos/
http://drupal.org/project/asterisk

Maintainer for phone: Thierry Guégan; drupal.org - userID: thierry_gd

Primary contact
Thomas_Zahreddin
mailto:ghop@it-arts.org

aclight’s picture

at least one page of user documentation: Who defines country-codes? Where are they officiealy documented? What is the recommendation for the length of phone numbers? What signs are used to format a phone-number ?

Where do you want this to go? Is this user facing documentation that's presented to the user somewhere on a configuration page? Is it in a README.txt? Handbook page?

The new filter should validate the number from the user-input against the rules of ITU: validate the country code if started with a "+" sign

Can you provide a link in the references section that points to the standard/rules you want the student to follow? In my experience, it's easy to find the wrong standard in situations like this, and I don't want the student to go down the wrong path.

Otherwise, this looks good.

Thomas_Zahreddin’s picture

aclight,
thank you for your valuble comment and questions:

The used standards should be described in the readme.txt, the apropriate places in the source-code and apropriate links should also placed on the configuration page.

additional ressource for the standards by the ITU:
official list of country codes: http://www.itu.int/publ/T-SP-E.164D-2007/en
Number-format and -length:
http://www.antelope.org.uk/numbering/World_numbering_developments.pdf see section 2.1.1

aclight’s picture

Status: Needs work » Reviewed & tested by the community

Ok, sounds good. Make to incorporate your last comment into the description itself. You can go ahead and create the official task following the instructions at http://groups.drupal.org/node/7360#tasks (start with the 3rd or 4th bullet point).

Thomas_Zahreddin’s picture

Title: International phone numbers for CCK » GHOP #xx: International phone numbers for CCK

Task description / Requirements:
Create an abstraction of the existing filters for phone numbers, so that the filter (to be created) works for all country-codes, therefor:
+ add a configuration option for a default country code,
+ The new filter should validate the number from the user-input against the rules of ITU: validate the country code if started with a "+" sign
+ add a default country-code if the user didn't typed it in, delete therefor a leading 0
+ add a configuration option for the maximum number of digits a phone number is allowed to have (default 20; ITU recommondation 15 + Country-code)
+ test the length of the phone numbers (digits only) against the configured length, while ignoring all brackets, dots, dashes etc. form the user - input,

Learning opportunity: How are international phone numbers formatet? What country-codes exist? Who defines standards for phone-numbers? How to validate user-input for accuracy and security?

Approach:
Install drupal, cck and phone
create a input-type with a phone nuber, test the limits of the existing phone-module (not all country-codes can be used)
take the php-Editor / IDE of your choice
Learn how the existing filters are build (fr, us, ca, it, ru)
Create the configuration for the filter
Create the generic filter for all phone-numbers
Integrate the configuration: the filter and the existing phone-module

Versions:
phone is now only for D5 aviable, so the students will have to use D5 with the actual developer release of the phone module

Deliverable(s)
a new filter for phone (Ready for review)
a patch of phone.module to integrate the new filter (Ready for review)
at least one page of user documentation: Who defines country-codes? Where are they officiealy documented? What is the recommendation for the length of phone numbers? What signs are used to format a phone-number ?
The used standards should be described in the readme.txt, the appropriate places in the source-code and appropriate links should also placed on the configuration page.

Resources
http://ftp.drupal.org/files/projects/drupal-5.6.tar.gz
http://drupal.org/project/cck
IRC: #drupal
The phone modul: http://drupal.org/project/phone
http://en.wikipedia.org/wiki/List_of_country_calling_codes
RegEx - Tester: http://sourceforge.net/projects/kodos/
official list of country codes: http://www.itu.int/publ/T-SP-E.164D-2007/en
Number-format and -length:
http://www.antelope.org.uk/numbering/World_numbering_developments.pdf see section 2.1.1
a link to the general resources: http://code.google.com/p/google-highly-open-participation-drupal/wiki/Fu...

Maintainer for the module phone: Thierry Guégan; http://drupal.org/user/43798
(this task is on the to-do list of the module9)

Primary contact
Thomas_Zahreddin http://drupal.org/user/118299
mailto:ghop@it-arts.org

aclight’s picture

Status: Reviewed & tested by the community » Closed (fixed)