ireland_372_2.cif 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. // Note: Ireland does not currently have postal codes but it has been announced
  3. // that they will be implemented - so I left the postal code in the address
  4. // definition.
  5. // http://www.dcmnr.gov.ie/Press+Releases/Dempsey+announces+programme+to+introduce+postcodes+in+Ireland+by+1st+January+2008.htm
  6. //
  7. function ireland_install() {
  8. // Make the entry in the country table.
  9. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  10. db_insert('uc_countries')
  11. ->fields(array(
  12. 'country_id' => 372,
  13. 'country_name' => 'Ireland',
  14. 'country_iso_code_2' => 'IE',
  15. 'country_iso_code_3' => 'IRL',
  16. 'version' => 2,
  17. ))
  18. ->execute();
  19. // Make the entries in the zones table.
  20. $zones = array(
  21. array(372, 'CARLOW', 'Co. Carlow'),
  22. array(372, 'CAVAN', 'Co. Cavan'),
  23. array(372, 'CLARE', 'Co. Clare'),
  24. array(372, 'CORK', 'Co. Cork'),
  25. array(372, 'DONEGAL', 'Co. Donegal'),
  26. array(372, 'DUBLIN', 'Co. Dublin'),
  27. array(372, 'GALWAY', 'Co. Galway'),
  28. array(372, 'KERRY', 'Co. Kerry'),
  29. array(372, 'KILDARE', 'Co. Kildare'),
  30. array(372, 'KILKENNY', 'Co. Kilkenny'),
  31. array(372, 'LAOIS', 'Co. Laois'),
  32. array(372, 'LEITRIM', 'Co. Leitrim'),
  33. array(372, 'LIMERICK', 'Co. Limerick'),
  34. array(372, 'LONGFORD', 'Co. Longford'),
  35. array(372, 'LOUTH', 'Co. Louth'),
  36. array(372, 'MAYO', 'Co. Mayo'),
  37. array(372, 'MEATH', 'Co. Meath'),
  38. array(372, 'MONAGHAN', 'Co. Monaghan'),
  39. array(372, 'OFFALY', 'Co. Offaly'),
  40. array(372, 'ROSCOMMON', 'Co. Roscommon'),
  41. array(372, 'SLIGO', 'Co. Sligo'),
  42. array(372, 'TIPPERARY', 'Co. Tipperary'),
  43. array(372, 'WATERFORD', 'Co. Waterford'),
  44. array(372, 'WESTMEATH', 'Co. Westmeath'),
  45. array(372, 'WEXFORD', 'Co. Wexford'),
  46. array(372, 'WICKLOW', 'Co. Wicklow'),
  47. );
  48. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  49. foreach ($zones as $zone) {
  50. $query->values($zone);
  51. }
  52. $query->execute();
  53. // Set address format
  54. uc_set_address_format(
  55. 372,
  56. "!company\r\n".
  57. "!first_name !last_name\r\n".
  58. "!street1\r\n".
  59. "!street2\r\n".
  60. "!city, !zone_name !postal_code\r\n".
  61. "!country_name_if"
  62. );
  63. }
  64. function ireland_update($version) {
  65. switch ($version) {
  66. case 2:
  67. uc_set_address_format(
  68. 372,
  69. "!company\r\n".
  70. "!first_name !last_name\r\n".
  71. "!street1\r\n".
  72. "!street2\r\n".
  73. "!city, !zone_name !postal_code\r\n".
  74. "!country_name_if"
  75. );
  76. break;
  77. }
  78. }