poland_616_1.cif 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Implements hook_install() using the name of the country as the base of
  4. * the function name.
  5. */
  6. function poland_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' => 616,
  12. 'country_name' => 'Poland',
  13. 'country_iso_code_2' => 'PL',
  14. 'country_iso_code_3' => 'POL',
  15. 'version' => 1,
  16. ))
  17. ->execute();
  18. // Make the entries in the zones table.
  19. $zones = array(
  20. array(616, 'DO', 'Dolnośląskie'),
  21. array(616, 'KP', 'Kujawsko-Pomorskie'),
  22. array(616, 'LO', 'Łódzkie'),
  23. array(616, 'LL', 'Lubelskie'),
  24. array(616, 'LU', 'Lubuskie'),
  25. array(616, 'ML', 'Małopolskie'),
  26. array(616, 'MZ', 'Mazowieckie'),
  27. array(616, 'OP', 'Opolskie'),
  28. array(616, 'PP', 'Podkarpackie'),
  29. array(616, 'PL', 'Podlaskie'),
  30. array(616, 'PM', 'Pomorskie'),
  31. array(616, 'SL', 'Śląskie'),
  32. array(616, 'SW', 'Świętokrzyskie'),
  33. array(616, 'WM', 'Warmińsko-Mazurskie'),
  34. array(616, 'WP', 'Wielkopolskie'),
  35. array(616, 'ZA', 'Zachodniopomorskie'),
  36. );
  37. $query = db_insert('uc_zones')->fields(array('zone_country_id', 'zone_code', 'zone_name'));
  38. foreach ($zones as $zone) {
  39. $query->values($zone);
  40. }
  41. $query->execute();
  42. // Set address format
  43. uc_set_address_format(
  44. 616,
  45. "!company\r\n" .
  46. "!first_name !last_name\r\n" .
  47. "!street1\r\n" .
  48. "!street2\r\n" .
  49. "!city, !zone_code !postal_code\r\n" .
  50. "!country_name_if"
  51. );
  52. }