// Geocoding fields.
public $text = '';
public $postalText = '';
+ public $postal_code_fr = null;
public $types = '';
public $formatted_address = '';
public $components = array();
--$count;
}
+ $postal_code = null;
// All the lines must have less than 38 characters but street and
// locality lines whose limit is 32 characters.
foreach ($arrayText as $lineNumber => $line) {
$formattedLine = $this->getStreetNumberFR($line) . ' ';
$limit = 32;
} elseif ($this->isLocalityFR($line)) {
- $formattedLine = $this->getPostalCodeFR($line) . ' ';
+ $postal_code = $this->getPostalCodeFR($line);
+ $formattedLine = $postal_code . ' ';
$limit = 32;
} else {
$formattedLine = '';
$arrayText[$lineNumber] = trim($formattedLine);
}
+ $this->postal_code_fr = $postal_code;
return implode("\n", $arrayText);
}
XDB::execute('INSERT IGNORE INTO profile_addresses (pid, jobid, groupid, type, id, flags, text, postalText, pub, comment,
types, formatted_address, location_type, partial_match, latitude, longitude,
southwest_latitude, southwest_longitude, northeast_latitude, northeast_longitude,
- geocoding_date, geocoding_calls)
+ geocoding_date, geocoding_calls, postal_code_fr)
VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, NOW(), {?})',
+ {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, NOW(), {?}, {?})',
$this->pid, $this->jobid, $this->groupid, $this->type, $this->id, $this->flags, $this->text, $this->postalText, $this->pub, $this->comment,
$this->types, $this->formatted_address, $this->location_type, $this->partial_match, $this->latitude, $this->longitude,
- $this->southwest_latitude, $this->southwest_longitude, $this->northeast_latitude, $this->northeast_longitude, $this->geocoding_calls);
+ $this->southwest_latitude, $this->southwest_longitude, $this->northeast_latitude, $this->northeast_longitude, $this->geocoding_calls, $this->postal_code_fr);
if ($this->componentsIds) {
foreach (explode(',', $this->componentsIds) as $component_id) {
$res = XDB::query("SELECT pd.promo, p.title,
IF (pn.firstname_ordinary = '', UPPER(pn.firstname_main), UPPER(pn.firstname_ordinary)) AS firstname,
IF (pn.lastname_ordinary = '', UPPER(pn.lastname_main), UPPER(pn.lastname_ordinary)) AS lastname,
- UPPER(pje.name), pa.postalText, pa.long_name AS postal_code, p.email_directory
- FROM (SELECT pa.pid, pa.postalText, pa.jobid, pa.groupid, pa.type, pa.id, pace.long_name
- FROM profile_addresses AS pa
- LEFT JOIN profile_addresses_components AS pac ON (pa.pid = pac.pid
- AND pa.jobid = pac.jobid
- AND pa.groupid = pac.groupid
- AND pa.type = pac.type
- AND pa.id = pac.id)
- LEFT JOIN profile_addresses_components_enum AS pace ON (pac.component_id = pace.id
- AND FIND_IN_SET('postal_code', pace.types))
- WHERE pa.pub IN ('public', 'ax') AND FIND_IN_SET('mail', pa.flags) AND pa.pid IN {?}
- ORDER BY pa.pid, NOT FIND_IN_SET('current', pa.flags),
- FIND_IN_SET('secondary', pa.flags), pa.type = 'job',
- pace.long_name IS NULL) AS pa
+ UPPER(pje.name), pa.postalText, pa.postal_code_fr AS postal_code, p.email_directory
+ FROM (SELECT pid, postalText, jobid, groupid, type, id, postal_code_fr
+ FROM profile_addresses
+ WHERE pub IN ('public', 'ax') AND FIND_IN_SET('mail', flags) AND pid IN {?}
+ ORDER BY pid, NOT FIND_IN_SET('current', flags),
+ FIND_IN_SET('secondary', flags), type = 'job') AS pa
INNER JOIN profiles AS p ON (pa.pid = p.pid)
INNER JOIN profile_display AS pd ON (pd.pid = pa.pid)
INNER JOIN profile_public_names AS pn ON (pn.pid = pa.pid)