reunion_638_2.cif 1010 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function reunion_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' => 638,
  12. 'country_name' => 'Réunion',
  13. 'country_iso_code_2' => 'RE',
  14. 'country_iso_code_3' => 'REU',
  15. 'version' => 2,
  16. ))
  17. ->execute();
  18. // No zones
  19. // Set address format
  20. uc_set_address_format(
  21. 638,
  22. "!company\r\n".
  23. "!first_name !last_name\r\n".
  24. "!street1\r\n".
  25. "!street2\r\n".
  26. "!city !zone_code !postal_code\r\n".
  27. "!country_name_if"
  28. );
  29. }
  30. function reunion_update($version) {
  31. switch ($version) {
  32. case 2:
  33. // Correct ISO-3166-1 country name
  34. db_update('uc_countries')
  35. ->fields(array('country_name' => 'Réunion'))
  36. ->condition('country_id', 638)
  37. ->execute();
  38. break;
  39. }
  40. }