Skip to content

feat: add country support#742

Open
anonymoususer72041 wants to merge 6 commits intoopencats:masterfrom
anonymoususer72041:feat/country-support
Open

feat: add country support#742
anonymoususer72041 wants to merge 6 commits intoopencats:masterfrom
anonymoususer72041:feat/country-support

Conversation

@anonymoususer72041
Copy link
Copy Markdown
Contributor

Summary

This PR adds country support to the core address-bearing entities in OpenCATS by introducing a country field for companies, contacts, candidates and job orders across the schema, legacy data layer, UI forms, AJAX location helpers and the newer entity/repository coverage where applicable.

It also adds country selection support to the Career Portal, including the shipped default apply template and candidate profile handling, so candidate address data can be captured and preserved consistently instead of assuming a single-country setup.

In addition, this PR updates Career Portal job location rendering to use a unified <location> placeholder so locations can include country information cleanly. The default Job Details templates are updated accordingly, and a schema migration upgrades stored default templates that still use the legacy <city> / <state> pattern.

Note: Custom Career Portal templates that still reference <city> and/or <state> will no longer render a location and must be updated to use <location>

Motivation

The main goal of this change is to make OpenCATS usable for recruiters and staffing agencies that operate across national borders by introducing an explicit way to distinguish and store country information.

It also serves as groundwork for restoring zip lookup on top of country-aware location data, so future improvements can avoid relying on a fixed country assumption such as the current US-based behavior.

@anonymoususer72041 anonymoususer72041 force-pushed the feat/country-support branch 3 times, most recently from 87e5e60 to 261c9ee Compare April 15, 2026 12:05
@anonymoususer72041
Copy link
Copy Markdown
Contributor Author

Please merge #743 first.

In order to keep the country fixture semantically correct, I changed

(40001, 1, 30001, 20002, 1, 1, 1, '', 'OpenCATS Tester', '', '', 'H', '', '', '', 'Active', 0, 1, 'London', 'United Kingdom', NULL, '2016-08-10 14:48:21', '2016-08-10 15:03:11', 0, 0, 0, 1, NULL);

to

(40001, 1, 30001, 20002, 1, 1, 1, '', 'OpenCATS Tester', '', '', 'H', '', '', '', 'Active', 0, 1, 'London', NULL, 'GB', NULL, '2016-08-10 14:48:21', '2016-08-10 15:03:11', 0, 0, 0, 1, NULL);

Without #743, this branch still needs a workaround in test/data/securityTests.sql because joborder.state is not nullable at the schema level.

@RussH
Copy link
Copy Markdown
Member

RussH commented Apr 24, 2026

My main concern here is that he google geocoding in /lib/ZipLookup.php is not broken. Google lookup currently returns the country long name, while the new country select appears to expect the ISO-style country code. Could you please make sure the zip/geocode lookup is also amended so it maps Google’s country component using short_name rather than long_name, and stores the values like "US" rather than "United States"?

* Remove legacy `<city>` / `<state>` placeholder handling from the public Career Portal template rendering and rely on `<location>` only

* Update the shipped default Job Details template to use `<location>` and add a safe schema migration that upgrades stored default Job Details templates

* Note: Custom Career Portal templates that still reference `<city>` and/or `<state>` will no longer render a location and must be updated to use `<location>`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants