Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ajax/getCompanyLocation.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
" <city>" . $locationArray['city'] . "</city>\n" .
" <state>" . $locationArray['state'] . "</state>\n" .
" <zip>" . $locationArray['zip'] . "</zip>\n" .
" <country>" . $locationArray['country'] . "</country>\n" .
"</data>\n"
);

Expand Down
1 change: 1 addition & 0 deletions ajax/getCompanyLocationAndDepartments.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
" <city>" . $locationArray['city'] . "</city>\n" .
" <state>" . $locationArray['state'] . "</state>\n" .
" <zip>" . $locationArray['zip'] . "</zip>\n" .
" <country>" . $locationArray['country'] . "</country>\n" .
" <departments>" . $departmentsString . "</departments>\n" .
"</data>\n"
);
Expand Down
51 changes: 51 additions & 0 deletions constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,57 @@
array(12, 'GMT+13:00 Nuku`alofa')
);

/* Countries */
$countries = array(
'AE' => 'United Arab Emirates',
'AR' => 'Argentina',
'AT' => 'Austria',
'AU' => 'Australia',
'BE' => 'Belgium',
'BG' => 'Bulgaria',
'BR' => 'Brazil',
'CA' => 'Canada',
'CH' => 'Switzerland',
'CL' => 'Chile',
'CN' => 'China',
'CO' => 'Colombia',
'CZ' => 'Czech Republic',
'DE' => 'Germany',
'DK' => 'Denmark',
'EG' => 'Egypt',
'ES' => 'Spain',
'FI' => 'Finland',
'FR' => 'France',
'GB' => 'United Kingdom',
'GR' => 'Greece',
'HK' => 'Hong Kong',
'HU' => 'Hungary',
'IE' => 'Ireland',
'IL' => 'Israel',
'IN' => 'India',
'IT' => 'Italy',
'JP' => 'Japan',
'KR' => 'South Korea',
'MA' => 'Morocco',
'MX' => 'Mexico',
'NL' => 'Netherlands',
'NO' => 'Norway',
'NZ' => 'New Zealand',
'PE' => 'Peru',
'PL' => 'Poland',
'PT' => 'Portugal',
'RO' => 'Romania',
'SA' => 'Saudi Arabia',
'SE' => 'Sweden',
'SG' => 'Singapore',
'SK' => 'Slovakia',
'TN' => 'Tunisia',
'TR' => 'Turkey',
'TW' => 'Taiwan',
'US' => 'United States',
'ZA' => 'South Africa'
);

/* These file extensions will have '.txt' appended to them on upload. */
$badFileExtensions = array(
'shtml',
Expand Down
12 changes: 8 additions & 4 deletions db/cats_schema.sql

Large diffs are not rendered by default.

21 changes: 21 additions & 0 deletions js/company.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ function CompanyLocation_populate(companySelectID, sessionCookie)
{
document.getElementById("city").value = "";
document.getElementById("state").value = "";
if (document.getElementById("country"))
{
document.getElementById("country").value = "";
}
return;
}

Expand Down Expand Up @@ -92,6 +96,10 @@ function CompanyLocation_populate(companySelectID, sessionCookie)

document.getElementById("city").value = "";
document.getElementById("state").value = "";
if (document.getElementById("country"))
{
document.getElementById("country").value = "";
}

if (document.getElementById("zip"))
{
Expand All @@ -105,6 +113,7 @@ function CompanyLocation_populate(companySelectID, sessionCookie)
var cityNode = http.responseXML.getElementsByTagName("city").item(0);
var stateNode = http.responseXML.getElementsByTagName("state").item(0);
var zipNode = http.responseXML.getElementsByTagName("zip").item(0);
var countryNode = http.responseXML.getElementsByTagName("country").item(0);

if (document.getElementById("address"))
{
Expand Down Expand Up @@ -147,6 +156,18 @@ function CompanyLocation_populate(companySelectID, sessionCookie)
document.getElementById("zip").value = "";
}
}

if (document.getElementById("country"))
{
if (countryNode.firstChild)
{
document.getElementById("country").value = countryNode.firstChild.nodeValue;
}
else
{
document.getElementById("country").value = "";
}
}
}

AJAX_callCATSFunction(
Expand Down
18 changes: 17 additions & 1 deletion js/contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,18 @@ function ContactDepartments_populate(companyID, sessionCookie)
document.getElementById("city").value = "";
document.getElementById("state").value = "";
document.getElementById("zip").value = "";
if (document.getElementById("country"))
{
document.getElementById("country").value = "";
}
return;
}

var addressNode = http.responseXML.getElementsByTagName("address").item(0);
var cityNode = http.responseXML.getElementsByTagName("city").item(0);
var stateNode = http.responseXML.getElementsByTagName("state").item(0);
var zipNode = http.responseXML.getElementsByTagName("zip").item(0);
var countryNode = http.responseXML.getElementsByTagName("country").item(0);
var departmentsNode = http.responseXML.getElementsByTagName("departments").item(0);

if (document.getElementById("address"))
Expand Down Expand Up @@ -142,6 +147,18 @@ function ContactDepartments_populate(companyID, sessionCookie)
}
}

if (document.getElementById("country"))
{
if (countryNode.firstChild)
{
document.getElementById("country").value = countryNode.firstChild.nodeValue;
}
else
{
document.getElementById("country").value = "";
}
}

if (departmentsNode.firstChild)
{
document.getElementById("departmentsCSV").value = departmentsNode.firstChild.nodeValue;
Expand All @@ -166,4 +183,3 @@ function ContactDepartments_populate(companyID, sessionCookie)
false
);
}

24 changes: 21 additions & 3 deletions lib/Candidates.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function add($firstName, $middleName, $lastName, $email1, $email2,
$source, $keySkills, $dateAvailable, $currentEmployer, $canRelocate,
$currentPay, $desiredPay, $notes, $webSite, $bestTimeToCall, $enteredBy, $owner,
$gender = '', $race = '', $veteran = '', $disability = '',
$skipHistory = false)
$skipHistory = false, $country = '')
{
$sql = sprintf(
"INSERT INTO candidate (
Expand All @@ -114,6 +114,7 @@ public function add($firstName, $middleName, $lastName, $email1, $email2,
city,
state,
zip,
country,
source,
key_skills,
date_available,
Expand Down Expand Up @@ -160,6 +161,7 @@ public function add($firstName, $middleName, $lastName, $email1, $email2,
%s,
%s,
%s,
%s,
0,
%s,
%s,
Expand All @@ -183,6 +185,7 @@ public function add($firstName, $middleName, $lastName, $email1, $email2,
$this->_db->makeQueryString($city),
$this->_db->makeQueryString($state),
$this->_db->makeQueryString($zip),
$this->_db->makeQueryStringOrNULL($country),
$this->_db->makeQueryString($source),
$this->_db->makeQueryString($keySkills),
$this->_db->makeQueryStringOrNULL($dateAvailable),
Expand Down Expand Up @@ -256,8 +259,20 @@ public function update($candidateID, $isActive, $firstName, $middleName, $lastNa
$city, $state, $zip, $source, $keySkills, $dateAvailable,
$currentEmployer, $canRelocate, $currentPay, $desiredPay,
$notes, $webSite, $bestTimeToCall, $owner, $isHot, $email, $emailAddress,
$gender = '', $race = '', $veteran = '', $disability = '')
$gender = '', $race = '', $veteran = '', $disability = '', $country = false)
{
if ($country === false)
{
$countrySQL = ",\n";
}
else
{
$countrySQL = sprintf(
",\n country = %s,\n",
$this->_db->makeQueryStringOrNULL($country)
);
}

$sql = sprintf(
"UPDATE
candidate
Expand All @@ -275,7 +290,7 @@ public function update($candidateID, $isActive, $firstName, $middleName, $lastNa
address2 = %s,
city = %s,
state = %s,
zip = %s,
zip = %s%s
source = %s,
key_skills = %s,
date_available = %s,
Expand Down Expand Up @@ -311,6 +326,7 @@ public function update($candidateID, $isActive, $firstName, $middleName, $lastNa
$this->_db->makeQueryString($city),
$this->_db->makeQueryString($state),
$this->_db->makeQueryString($zip),
$countrySQL,
$this->_db->makeQueryString($source),
$this->_db->makeQueryString($keySkills),
$this->_db->makeQueryStringOrNULL($dateAvailable),
Expand Down Expand Up @@ -481,6 +497,7 @@ public function get($candidateID)
candidate.city AS city,
candidate.state AS state,
candidate.zip AS zip,
candidate.country AS country,
candidate.source AS source,
candidate.key_skills AS keySkills,
candidate.current_employer AS currentEmployer,
Expand Down Expand Up @@ -618,6 +635,7 @@ public function getForEditing($candidateID)
candidate.city AS city,
candidate.state AS state,
candidate.zip AS zip,
candidate.country AS country,
candidate.source AS source,
candidate.key_skills AS keySkills,
candidate.current_employer AS currentEmployer,
Expand Down
25 changes: 21 additions & 4 deletions lib/Companies.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public function __construct($siteID)
*/
public function add($name, $address, $address2, $city, $state, $zip, $phone1,
$phone2, $faxNumber, $url, $keyTechnologies, $isHot,
$notes, $enteredBy, $owner)
$notes, $enteredBy, $owner, $country = '')
{
$company= Company::create(
$this->_siteID,
Expand All @@ -95,6 +95,7 @@ public function add($name, $address, $address2, $city, $state, $zip, $phone1,
$city,
$state,
$zip,
$country,
$phone1,
$phone2,
$faxNumber,
Expand Down Expand Up @@ -137,8 +138,20 @@ public function add($name, $address, $address2, $city, $state, $zip, $phone1,
public function update($companyID, $name, $address, $address2, $city, $state,
$zip, $phone1, $phone2, $faxNumber, $url,
$keyTechnologies, $isHot, $notes, $owner,
$billingContact, $email, $emailAddress)
$billingContact, $email, $emailAddress, $country = false)
{
if ($country === false)
{
$countrySQL = ",\n";
}
else
{
$countrySQL = sprintf(
",\n country = %s,\n",
$this->_db->makeQueryStringOrNULL($country)
);
}

$sql = sprintf(
"UPDATE
company
Expand All @@ -148,7 +161,7 @@ public function update($companyID, $name, $address, $address2, $city, $state,
address2 = %s,
city = %s,
state = %s,
zip = %s,
zip = %s%s
phone1 = %s,
phone2 = %s,
fax_number = %s,
Expand All @@ -169,6 +182,7 @@ public function update($companyID, $name, $address, $address2, $city, $state,
$this->_db->makeQueryString($city),
$this->_db->makeQueryString($state),
$this->_db->makeQueryString($zip),
$countrySQL,
$this->_db->makeQueryString($phone1),
$this->_db->makeQueryString($phone2),
$this->_db->makeQueryString($faxNumber),
Expand Down Expand Up @@ -329,6 +343,7 @@ public function get($companyID)
company.city AS city,
company.state AS state,
company.zip AS zip,
company.country AS country,
company.phone1 AS phone1,
company.phone2 AS phone2,
company.fax_number AS faxNumber,
Expand Down Expand Up @@ -389,6 +404,7 @@ public function getForEditing($companyID)
company.city AS city,
company.state AS state,
company.zip AS zip,
company.country AS country,
company.phone1 AS phone1,
company.phone2 AS phone2,
company.fax_number AS faxNumber,
Expand Down Expand Up @@ -517,7 +533,8 @@ public function getLocationArray($companyID)
company.address AS address,
company.city AS city,
company.state AS state,
company.zip AS zip
company.zip AS zip,
company.country AS country
FROM
company
WHERE
Expand Down
Loading
Loading