<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class ProfileSecteurs implements ProfileSetting
+class ProfileSectors implements ProfileSetting
{
public function value(ProfilePage &$page, $field, $value, &$success)
{
$success = true;
if (is_null($value)) {
$value = array();
- $res = XDB::iterRow("SELECT m.country, p.pays
+ $res = XDB::iterRow("SELECT m.country, gc.countryFR
FROM profile_mentor_country AS m
- INNER JOIN geoloc_pays AS p ON (m.country = p.a2)
+ INNER JOIN geoloc_countries AS gc ON (m.country = gc.iso_3166_1_a2)
WHERE m.uid = {?}",
S::i('uid'));
while (list($id, $name) = $res->next()) {
{
parent::__construct($wiz);
$this->settings['expertise'] = null;
- $this->settings['secteurs'] = new ProfileSecteurs();
+ $this->settings['sectors'] = new ProfileSectors();
$this->settings['countries'] = new ProfileCountry();
}
public function _prepare(PlPage &$page, $id)
{
- $page->assign('secteurs_sel', XDB::iterator("SELECT id, name AS label
- FROM profile_job_sector_enum"));
+ $page->assign('sectors', XDB::iterator("SELECT id, name
+ FROM profile_job_sector_enum"));
+
+ $page->assign('countryList', XDB::iterator("SELECT iso_3166_1_a2, countryFR
+ FROM geoloc_countries
+ ORDER BY countryFR"));
}
}