sweden_752_1.cif 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function sweden_install() {
  7. // Make the entry in the country table.
  8. // VALUES = Country ID, Country Name, 2-digit Code, 3-digit Code, File Version
  9. db_insert('uc_countries')
  10. ->fields(array(
  11. 'country_id' => 752,
  12. 'country_name' => 'Sweden',
  13. 'country_iso_code_2' => 'SE',
  14. 'country_iso_code_3' => 'SWE',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(752, 'BL', 'Blekinge'),
  21. array(752, 'DA', 'Dalarna'),
  22. array(752, 'GA', 'Gavleborg'),
  23. array(752, 'GO', 'Gotland'),
  24. array(752, 'HA', 'Halland'),
  25. array(752, 'JA', 'Jamtland'),
  26. array(752, 'JO', 'Jonkoping'),
  27. array(752, 'KA', 'Kalmar'),
  28. array(752, 'KR', 'Kronoberg'),
  29. array(752, 'NO', 'Norrbotten'),
  30. array(752, 'OR', 'Orebro'),
  31. array(752, 'OS', 'Ostergotland'),
  32. array(752, 'SK', 'Skane'),
  33. array(752, 'SO', 'Sodermanland'),
  34. array(752, 'ST', 'Stockholm'),
  35. array(752, 'UP', 'Uppsala'),
  36. array(752, 'VL', 'Varmland'),
  37. array(752, 'VB', 'Vasterbotten'),
  38. array(752, 'VN', 'Vasternorrland'),
  39. array(752, 'VM', 'Vastmanland'),
  40. array(752, 'VG', 'Vastra Gotaland'),
  41. );
  42. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  43. foreach ($zones as $zone) {
  44. $query->values($zone);
  45. }
  46. $query->execute();
  47. // Set address format
  48. uc_set_address_format(
  49. 752,
  50. "!company\r\n".
  51. "!first_name !last_name\r\n".
  52. "!street1\r\n".
  53. "!street2\r\n".
  54. "!postal_code !city\r\n".
  55. "!country_name_if"
  56. );
  57. }