CRM-8002 make use of country code

    Details

    • Type: New Feature
    • Status: Done/Fixed
    • Priority: Trivial
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.0.0
    • Fix Version/s: Unscheduled
    • Component/s: Core CiviCRM
    • Labels:
      None

      Description

      civicrm_country contains already country_code to put the phone prefix of the country.

      I'd be great to use it, for instance:

      on blur the phone field and the country is set to UK, verify if the phone starts with 0044 or +44
      if the country is not set and the phone number starts with 0044 or +44, set the country to UK.

      have a bin/updatePhone that does it automatically.

      First step, populating this country_code is done (attached)

        Attachments

          Activity

          [CRM-8002] make use of country code
          xavier dutoit added a comment -

          I'm going to use it in an extension, don't need it in the core.

          The extension will ensure the format of the phone is "correct" (ie. with the country prefix), and probably set the country rather than use the country to set the country prefix.

          We'll see, I'm going to work on the extension early next year, I'll update on the progress

          Sarah Gladstone added a comment -

          There are errors for many Caribbean and Pacific Islands. The corrections needed are:

          update civicrm_country set country_code ='1' where iso_code ='AS';
          update civicrm_country set country_code ='1' where iso_code ='AI';
          update civicrm_country set country_code ='1' where iso_code ='AG';
          update civicrm_country set country_code ='1' where iso_code ='BS';
          update civicrm_country set country_code ='1' where iso_code ='BB';
          update civicrm_country set country_code ='1' where iso_code ='BM';
          update civicrm_country set country_code ='1' where iso_code ='VG';
          update civicrm_country set country_code ='1' where iso_code ='KY';
          update civicrm_country set country_code ='1' where iso_code ='DM';
          update civicrm_country set country_code ='1' where iso_code ='DO';
          update civicrm_country set country_code ='1' where iso_code ='GD';
          update civicrm_country set country_code ='1' where iso_code ='GU';
          update civicrm_country set country_code ='1' where iso_code ='JM';
          update civicrm_country set country_code ='1' where iso_code ='MS';
          update civicrm_country set country_code ='1' where iso_code ='MP';
          update civicrm_country set country_code ='1' where iso_code ='KN';
          update civicrm_country set country_code ='1' where iso_code ='LC';
          update civicrm_country set country_code ='1' where iso_code ='MF';
          update civicrm_country set country_code ='1' where iso_code ='VC';
          update civicrm_country set country_code ='1' where iso_code ='TT';
          update civicrm_country set country_code ='1' where iso_code ='TC';
          update civicrm_country set country_code ='1' where iso_code ='VI';

            People

            • Assignee:
              xavier dutoit
              Reporter:
              xavier dutoit

              Dates

              • Created:
                Updated:
                Resolved: