- while (list($name, $secteur, $ss_secteur, $fonction, $poste,
- $adr1, $adr2, $adr3, $postcode, $city, $cityid,
- $region, $regiontxt, $country, $countrytxt, $display,
- $checked, $tel, $fax, $mobile, $email, $web,
- $pub, $adr_pub, $tel_pub, $email_pub) = $res->next()) {
- $this->values['jobs'][] = array('name' => $name,
- 'secteur' => $secteur,
- 'ss_secteur' => $ss_secteur,
- 'fonction' => $fonction,
- 'poste' => $poste,
- 'adr' => array('adr1' => $adr1,
- 'adr2' => $adr2,
- 'adr3' => $adr3,
- 'postcode' => $postcode,
- 'city' => $city,
- 'cityid' => $cityid,
- 'region' => $region,
- 'regiontxt' => $regiontxt,
- 'country' => $country,
- 'countrytxt' => $countrytxt,
- 'display' => $display,
- 'pub' => $adr_pub,
- 'checked' => $checked),
- 'tel' => $tel,
- 'fax' => $fax,
- 'mobile' => $mobile,
- 'email' => $email,
- 'web' => $web,
- 'pub' => $pub,
- 'adr_pub' => $adr_pub,
- 'tel_pub' => $tel_pub,
- 'email_pub' => $email_pub);
+ while (list($id, $name, $function, $secteur, $ss_secteur, $sss_secteur, $description,
+ $w_adr1, $w_adr2, $w_adr3, $w_postcode, $w_city, $w_cityid,
+ $w_region, $w_regiontxt, $w_country, $w_countrytxt, $w_display,
+ $w_checked, $w_email, $w_web,
+ $pub, $w_adr_pub, $w_email_pub, $w_glat, $w_glng, $sss_secteur_name
+ ) = $res->next()) {
+ $this->values['jobs'][] = array('id' => $id,
+ 'name' => $name,
+ 'fonction' => $function,
+ 'secteur' => $secteur,
+ 'ss_secteur' => $ss_secteur,
+ 'sss_secteur' => $sss_secteur,
+ 'sss_secteur_name' => $sss_secteur_name,
+ 'description' => $description,
+ 'w_adr' => array('adr1' => $w_adr1,
+ 'adr2' => $w_adr2,
+ 'adr3' => $w_adr3,
+ 'postcode' => $w_postcode,
+ 'city' => $w_city,
+ 'cityid' => $w_cityid,
+ 'region' => $w_region,
+ 'regiontxt' => $w_regiontxt,
+ 'country' => $w_country,
+ 'countrytxt' => $w_countrytxt,
+ 'display' => $w_display,
+ 'pub' => $w_adr_pub,
+ 'checked' => $w_checked,
+ 'precise_lat' => $w_glat,
+ 'precise_lon' => $w_glng),
+ 'w_email' => $w_email,
+ 'w_web' => $w_web,
+ 'pub' => $pub,
+ 'w_email_pub' => $w_email_pub);
+ }
+
+ $res = XDB::iterator("SELECT link_id AS jobid, tel_type AS type, pub, display_tel AS tel, comment
+ FROM profile_phones
+ WHERE uid = {?} AND link_type = 'pro'
+ ORDER BY link_id",
+ $this->pid());
+ $i = 0;
+ $jobNb = count($this->values['jobs']);
+ while ($tel = $res->next()) {
+ $jobid = $tel['jobid'];
+ unset($tel['jobid']);
+ while ($i < $jobNb && $this->values['jobs'][$i]['id'] < $jobid) {
+ $i++;
+ }
+ if ($i >= $jobNb) {
+ break;
+ }
+ $job =& $this->values['jobs'][$i];
+ if (!isset($job['w_tel'])) {
+ $job['w_tel'] = array();
+ }
+ if ($job['id'] == $jobid) {
+ $job['w_tel'][] = $tel;
+ }
+ }
+ foreach ($this->values['jobs'] as $id=>&$job) {
+ if (!isset($job['w_tel'])) {
+ $job['w_tel'] = array();
+ }
+ unset($job['id']);