================================================================================
+VERSION 0.f.0 XX XX XXXX
+
+New:
+ * Core:
+ - Centralises email management through an email combobox -JAC
+
+Bug/Wish:
+ * Profile:
+ - #16, #528, #917: Changes job interface, updates business sectors -JAC
+ - #188: Adds informations about the Corps d'État -JAC
+ - #209: Thoroughly changes education's implementation -JAC
+ - #373: User now chooses the name we use to talk to him/her -JAC
+ - #386: Adds the possibility to fill in multiple nationalities -JAC
+ - #443: Adds concept of ordinary firstname -JAC
+ - #450: Adds marital name, thus ordinary name can be any name -JAC
+ - #891: Improves education display -JAC
+
+================================================================================
VERSION 0.10.1 XX XX XXXX
From 0.10.0 branch:
* CAT: Florian El Ahdab (LeChat) <florian.el-ahdab@m4x.org>
* FAL: Raphaël Marichez (Falco) <raphael.marichez@m4x.org>
* FRU: Florent Bruneau (Fruneau) <florent.bruneau@m4x.org>
+ * GUI: Guillaume Bandet (GUI) <guillaume.bandet@m4x.org>
* JAC: Stéphane Jacob (jacou) <stephane.jacob@m4x.org>
+ * JM : Jean-Marc Bécu <jean-marc.becu@m4x.org>
* JS : Jean Sébastien Bedo <jean-sebastien.bedo@m4x.org>
* MC : Pierre Habouzit (MadCoder) <pierre.habouzit@m4x.org>
* mYk: Aymeric Augustin (mYk) <aymeric.augustin@m4x.org>
/* Validite des flags de transmission */
check("SELECT u.user_id, nom, prenom, promo,
- profile_mobile_pub, emails_alias_pub, profile_web_pub, profile_freetext_pub, profile_medals_pub
+ emails_alias_pub, profile_freetext_pub, profile_medals_pub
FROM auth_user_md5 AS u
INNER JOIN auth_user_quick AS q USING(user_id)
- WHERE (profile_mobile_pub != 'private' AND profile_mobile_pub != 'ax' AND profile_mobile_pub != 'public')
- OR (emails_alias_pub != 'private' AND emails_alias_pub != 'public')
- OR (profile_web_pub != 'private' AND profile_web_pub != 'public')
+ WHERE (emails_alias_pub != 'private' AND emails_alias_pub != 'public')
OR (profile_freetext_pub != 'private' AND profile_freetext_pub != 'public')
OR (profile_medals_pub != 'private' AND profile_medals_pub != 'public')",
"Utilisateur n'ayant pas de flag de publicite pour leurs donnees de profil");
-check("select uid from adresses where pub != 'private' and pub !='ax' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour une adresse");
-check("select uid from tels where tel_pub != 'private' and tel_pub !='ax' and tel_pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour un numero de telephone");
+check("SELECT pid
+ FROM profile_addresses
+ WHERE pub != 'private' AND pub !='ax' AND pub != 'public'",
+ "Utiliseur n'ayant pas de flag de publicité pour une adresse.");
+check("select uid from profile_phones where pub != 'private' and pub != 'ax' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicite pour un numero de téléphone");
+check("select uid from profile_networking where pub != 'private' and pub != 'public'", "Utiliseur n'ayant pas de flag de publicité pour une adresse de networking");
/* validite des hruid */
check("SELECT user_id, nom, prenom, promo FROM auth_user_md5 WHERE hruid IS NULL OR hruid = ''",
LEFT JOIN auth_user_md5 AS u ON u.user_id=a.id
WHERE (a.type='alias' OR a.type='a_vie') AND u.prenom is null");
-/* validite de applis_ins */
-check("select a.* from applis_ins as a left join auth_user_md5 as u on u.user_id=a.uid where u.prenom is null");
-check("select a.* from applis_ins as a left join applis_def as ad on ad.id=a.aid where ad.text is null");
+/* validite de profile_education */
+check("select a.* from profile_education as a left join auth_user_md5 as u on u.user_id=a.uid where u.prenom is null");
+check("select a.* from profile_education as a left join profile_education_enum as ad on ad.id=a.eduid where ad.name is null");
/* validite de binet_users */
check("select b.* from binets_ins as b left join auth_user_md5 as u on u.user_id=b.user_id where u.prenom is null");
/* validite de photo */
check("select p.* from photo as p left join auth_user_md5 as u on u.user_id=p.uid where u.prenom is null");
-/* validite des champ pays et region */
-check("SELECT a.uid, a.country FROM adresses AS a LEFT JOIN geoloc_pays AS gp ON a.country = gp.a2 WHERE gp.pays IS NULL","donne la liste des pays dans les profils qui n'ont pas d'entree correspondante dans geoloc_pays");
-/* les régions ne sont valides que dans les adresses pros */
-//check("SELECT e.uid, e.country, e.region FROM entreprises AS e LEFT JOIN geoloc_region AS gr ON (e.country = gr.a2 AND e.region = gr.region) WHERE e.region != '' AND gr.name IS NULL","donne la liste des regions dans les profils pros qui n'ont pas d'entree correspondante dans geoloc_region");
+/* validite des formats téléphoniques */
+check("SELECT DISTINCT g.phonePrefix
+ FROM geoloc_countries AS g
+ WHERE EXISTS (SELECT h.phonePrefix
+ FROM geoloc_countries AS h
+ WHERE h.phonePrefix = g.phonePrefix
+ AND h.phoneFormat != (SELECT i.phoneFormat
+ FROM geoloc_countries AS i
+ WHERE i.phonePrefix = g.phonePrefix
+ LIMIT 1))",
+ "Préfixes téléphoniques qui ont des formats de numéros de téléphones différents selon les pays");
+
+/* validite des champ pays */
+check("SELECT a.pid, a.countryId
+ FROM profile_addresses AS a
+ LEFT JOIN geoloc_countries AS gc ON (a.countryId = gc.iso_3166_1_a2)
+ WHERE gc.countryFR IS NULL OR gc.countryFR = ''",
+ "donne la liste des pays dans les profils qui n'ont pas d'entree correspondante dans geoloc_countries");
/* donne la liste des emails douteux que les administrateurs n'ont pas encore traité */
check("SELECT a1.alias, a2.alias, e1.email, e2.flags
GROUP BY matricule_ax
having c > 1", "à chaque personne de l'annuaire de l'AX (identification_ax) doit correspondre AU PLUS UNE personne de notre annuaire (auth_user_md5) -> si ce n'est pas le cas il faut regarder en manuel ce qui ne va pas !");
+/* no alumni is allowed to have empty names */
+check("SELECT s.uid, d.public_name
+ FROM profile_name AS s
+ INNER JOIN profile_display AS d ON (d.pid = s.uid)
+ WHERE name = ''", "liste des personnes qui ont un de leur nom de recherche vide");
+
/* verifie qu'il n'y a pas d'utilisateurs ayant un compte Google Apps désactivé et une redirection encore active vers Google Apps */
check("SELECT a.alias, g.g_status, u.mail_storage
FROM auth_user_md5 AS u
query("DELETE FROM register_pending WHERE hash = 'INSCRIT'");
// quelques tables sont triées pour que la lecture triée soit plus facile
-query("ALTER TABLE applis_def ORDER BY text");
+query("ALTER TABLE profile_education_enum ORDER BY name");
query("ALTER TABLE binets_def ORDER BY text");
query("ALTER TABLE groupesx_def ORDER BY text");
-query("ALTER TABLE secteur ORDER BY text");
+query("ALTER TABLE profile_job_sector_enum ORDER BY name");
+query("ALTER TABLE profile_job_subsector_enum ORDER BY name");
+query("ALTER TABLE profile_job_subsubsector_enum ORDER BY name");
query("ALTER TABLE sections ORDER BY text");
// Prunes older autocomplete queries.
--- /dev/null
+#!/usr/bin/php5
+<?php
+
+require('./connect.db.inc.php');
+require_once('profil.func.inc.php');
+
+$globals->debug = 0; //do not store backtraces
+
+
+function do_update_by_block($values)
+{
+ // Update display_tel by block
+ // Because there is no mysql update syntax for multiple updates in one query
+ // we use a multiple insert syntax which will fail because the key already exist
+ // and then update the display_tel
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id ,tel_type,
+ search_tel, display_tel, pub, comment)
+ VALUES " . $values . "
+ ON DUPLICATE KEY UPDATE display_tel = VALUES(display_tel)");
+}
+
+$res = XDB::query("SELECT DISTINCT phonePrefix
+ FROM geoloc_countries
+ WHERE phonePrefix IS NOT NULL");
+$prefixes = $res->fetchColumn();
+foreach ($prefixes as $i => $prefix) {
+ $res = XDB::query("SELECT phoneFormat
+ FROM geoloc_countries
+ WHERE phonePrefix = {?} AND phoneFormat != '' LIMIT 1",
+ $prefix);
+ if ($res->numRows() > 0) {
+ $format = $res->fetchOneCell();
+ //Build regexp for mysql query
+ $len = strlen($format);
+ $regexp = "^";
+ $nbPar = 0;
+ for ($i = 0; $i < $len; $i++) {
+ $char = $format[$i];
+ switch ($char) {
+ case 'p':
+ $regexp .= $prefix;
+ break;
+ case '#':
+ if ($nbPar == 0) {
+ $regexp .= '(';
+ $nbPar++;
+ }
+ $regexp .= '[0-9](';
+ $nbPar++;
+ break;
+ default:
+ //Appends the char after escaping it if necessary
+ $escape = array('[', ']', '{', '}', '(', ')', '*', '+', '?', '.', '^', '$', '|', '\\');
+ if (in_array($char, $escape)) {
+ $regexp .= '[' . $char . ']';
+ } else {
+ $regexp .= $char;
+ }
+ }
+ }
+ //allows additionnal spaces and numbers
+ $regexp .= '[0-9 ]*';
+ //closes parenthesis
+ for ($i = 0; $i < $nbPar; $i++) {
+ $regexp .= ')?';
+ }
+ $regexp .= '$';
+ $res = XDB::iterator("SELECT uid, link_type, link_id, tel_id, tel_type, search_tel,
+ display_tel, pub, comment
+ FROM profile_phones
+ WHERE search_tel LIKE {?} AND display_tel NOT REGEXP {?}",
+ $prefix . '%', $regexp);
+ if ($res->numRows() > 0)
+ {
+ //To speed up the update of phone numbers, theses updates are grouped by block of 1000
+ $values = '';
+ $i = 0;
+ while ($phone = $res->next()) {
+ $disp = format_display_number($phone['search_tel'], $error, array('format' => $format, 'phoneprf' => $prefix));
+ if ($values != '') {
+ $values .= ",\n";
+ }
+ $values .= "('" . addslashes($phone['uid']) . "', '" . addslashes($phone['link_type'])
+ . "', '" . addslashes($phone['link_id'])
+ . "', '" . addslashes($phone['tel_id']) . "', '" . addslashes($phone['tel_type'])
+ . "', '" . addslashes($phone['search_tel']) . "', '" . addslashes($disp)
+ . "', '" . addslashes($phone['pub']) . "', '" . addslashes($phone['comment']) . "')";
+ $i++;
+ if ($i == 1000) {
+ do_update_by_block($values);
+ $values = '';
+ $i = 0;
+ }
+ }
+ if ($values != '') {
+ do_update_by_block($values);
+ }
+ }
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
ini_set('memory_limit', "16M");
$globals->debug = 0; // Do not store backtraces
-XDB::execute('DELETE FROM search_name');
-$res = XDB::iterRow('SELECT auth_user_md5.user_id, nom, prenom, nom_usage, profile_nick
- FROM auth_user_md5
- LEFT JOIN auth_user_quick USING(user_id)');
+$res = XDB::iterRow("SELECT user_id
+ FROM auth_user_md5");
$i = 0;
-$muls = array(1, 1, 1, 0.2);
-$pub = array(true, true, true, false);
-while ($tmp = $res->next()) {
- $uid = array_shift($tmp);
- _user_reindex($uid, $tmp, $muls, $pub);
- printf("\r%u / %u", ++$i, $res->total());
+$n = $res->total();
+while ($uid = $res->next()->fetchOneCell()) {
+ user_reindex($uid);
+ printf("\r%u / %u", ++$i, $n);
}
print "done\n";
}
global $globals;
- $res = XDB::query("SELECT u.hruid, u.promo,
+ $res = XDB::query("SELECT u.hruid, d.promo,
CONCAT(af.alias, '@{$globals->mail->domain}') AS forlife,
CONCAT(ab.alias, '@{$globals->mail->domain}') AS bestalias,
CONCAT(u.prenom, ' ', IF(u.nom_usage <> '', u.nom_usage, u.nom)) AS full_name,
q.core_mail_fmt AS email_format,
u.perms
FROM auth_user_md5 AS u
+ INNER JOIN profile_display AS d ON (d.pid = u.user_id)
LEFT JOIN auth_user_quick AS q ON (q.user_id = u.user_id)
LEFT JOIN aliases AS af ON (af.id = u.user_id AND af.type = 'a_vie')
LEFT JOIN aliases AS ab ON (ab.id = u.user_id AND FIND_IN_SET('bestalias', ab.flags))
if ($perms->hasFlag('groupannu')) {
$sub['annuaire du groupe'] = "$dim/annuaire";
$sub['trombinoscope'] = "$dim/trombi";
- $sub['planisphère'] = "$dim/geoloc";
}
if ($perms->hasFlag('groupmember')) {
if ($globals->asso('forum')) {
platal.conf
platal.cron
+ax_xorg_rsa.pem
*.pem
0 21 * * 1-6 web cd $WD; ./checkdb.php | mail -e -s "verifications sur la BDD de plat/al @VERSION@" br@staff.m4x.org
0 21 * * 0 web cd $WD; ./checkdb.php -v | mail -e -s "verifications verbose sur la BDD de plat/al @VERSION@" br@staff.m4x.org
0 20 * * * web cd $WD; ./emails.check.php | mail -e -s "qualite de l'annuaire" br@staff.m4x.org
+0 22 * * * web cd $WD; ./phones.check.php > /dev/null
# inscription report
0 6 * * 1 web cd $WD; ./rapports_inscription.php
event_forum = ""
event_reply = ""
-[Geoloc]
-webservice_url = ""
+[Geocoder]
+email = ""
+gmaps_key = ""
+gmaps_url = "http://maps.google.com/maps/geo"
[Lists]
rpchost = "localhost"
background: inherit;
}
+.hinted {
+ border-bottom: 1px dashed black;
+}
+
input.error, textarea.error {
background-color: #faa;
}
}
td.action a { padding: 0px 2px 0px 2px; }
+div.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
+span.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
/*******************************************************************************
4 Tableau de choix de skins
[ Styles pour les tableaux de types de ceux des skins ]
font-style: italic;
}
+div.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
+span.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
/*******************************************************************************
4 Tableau de choix de skins
[ Styles pour les tableaux de types de ceux des skins ]
font-size: 100%;
}
-div.contact div.appli {
+div.contact div.edu {
}
div.contact div.bits {
}
td.action a { padding: 0px 2px; }
+div.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
+span.titre {
+ color: #000000;
+ background: inherit;
+ font-weight: bold;
+}
+
/*******************************************************************************
4 Tableau de choix de skins
[ Styles pour les tableaux de types de ceux des skins ]
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-// Page initialization
+// Page initialization {{{1
function wizPage_onLoad(id)
{
switch (id) {
case 'general':
- fillType(document.forms.prof_annu['appli1[type]'], document.forms.prof_annu['appli1[id]'].selectedIndex-1);
- selectType(document.forms.prof_annu['appli1[type]'], document.forms.prof_annu['appli1_tmp'].value);
- fillType(document.forms.prof_annu['appli2[type]'], document.forms.prof_annu['appli2[id]'].selectedIndex-1);
- selectType(document.forms.prof_annu['appli2[type]'], document.forms.prof_annu['appli2_tmp'].value);
+ var i = 1;
+ while ($('.edu_' + i).length != 0) {
+ prepareType(i - 1);
+ ++i;
+ }
+ break;
+ case 'adresses':
+ checkCurrentAddress();
break;
case 'poly':
- updateGroupSubLink(document.forms.prof_annu.groupesx_sub);
+ updateGroupSubLink();
break;
case 'deco':
for (var i in names) {
- if (typeof names[i] != 'function') {
- if (document.getElementById("medal_" + i) != null) {
- getMedalName(i);
- buildGrade(i, document.forms.prof_annu["medal_" + i + "_grade"].value);
- }
+ if ($('#medal_' + i).length != 0) {
+ getMedalName(i);
+ buildGrade(i, $('#medal_' + i).find('[name*=medal_' + i + '_grade]').val());
}
}
break;
case 'emploi':
- for (var i = 0 ; document.getElementById('job_' + i) != null ; ++i) {
- updateJobSecteur(i, 'job_' + i, 'jobs[' + i + ']',
- document.forms.prof_annu["jobs[" + i + "][ss_secteur]"].value);
+ for (var i = 0 ; $('#job_' + i).length != 0; ++i) {
+ updateJobSector(i, $('#job_' + i).find("[name='jobs[" + i + "][subSector]']").val());
+ updateJobSubSector(i, $('#job_' + i).find("[name='jobs[" + i + "][subSubSector]']").val());
+ updateJobAlternates(i);
}
- setTimeout('registerEnterpriseAutocomplete(-1)', 100);
break;
}
}
-var applisType;
-var applisTypeAll;
-
-// General
-
+var educationDegree;
+var educationDegreeAll;
+var educationDegreeName;
var subgrades;
var names;
-function fillType(selectCtrl, appli, fill)
+
+// Names {{{1
+
+function toggleNamesAdvanced()
{
- var i;
- var i0=0;
+ $('.names_advanced').toggle();
+}
- for (i = selectCtrl.options.length; i >=0; i--) {
- selectCtrl.options[i] = null;
+function addSearchName()
+{
+ var i = 0;
+ while ($('#search_name_' + i).length != 0) {
+ i++;
}
+ Ajax.update_html('search_name_' + i, 'profile/ajax/searchname/' + i, function(data){
+ $('#searchname').before(data);
+ changeNameFlag(i);
+ });
+}
+
+function removeSearchName(i)
+{
+ $('#search_name_' + i).remove();
+ updateNameDisplay();
+}
- if (fill || appli <0) {
- selectCtrl.options[0] = new Option(' ');
- i0=1;
+function changeNameFlag(i)
+{
+ $('#flag_' + i).remove();
+ var typeid = $('#search_name_' + i).find('select').val();
+ var type = $('#search_name_' + i).find('select :selected').text();
+ if ($('[name=sn_type_' + typeid + '_' + i + ']').val() > 0) {
+ $('#flag_cb_' + i).after('<span id="flag_' + i + '"> ' +
+ '<img src="images/icons/flag_green.gif" alt="site public" title="site public" />' +
+ '<input type="hidden" name="search_names[' + i + '][pub]" value="1"/>' +
+ '<input type="hidden" name="search_names[' + i + '][typeid]" value="' + typeid + '"/>' +
+ '<input type="hidden" name="search_names[' + i + '][type]" value="' + type + '"/></span>');
+ } else {
+ $('#flag_cb_' + i).after('<span id="flag_' + i + '"> ' +
+ '<img src="images/icons/flag_red.gif" alt="site privé" title="site privé" />' +
+ '<input type="hidden" name="search_names[' + i + '][typeid]" value="' + typeid + '"/>' +
+ '<input type="hidden" name="search_names[' + i + '][type]" value="' + type + '"/></span>');
}
- if (appli>=0)
- for (i=0; i < applisType[appli].length; i++)
- selectCtrl.options[i0+i] = new Option(applisType[appli][i]);
- else if (fill)
- for (i=0; i < applisTypeAll.length; i++)
- selectCtrl.options[i0+i] = new Option(applisTypeAll[i]);
}
+function updateNameDisplay()
+{
+ var searchnames = '';
+ for (var i = 0; i < 10; i++) {
+ if ($('#search_name_' + i).find(':text').val()) {
+ searchnames += $('#search_name_' + i).find('[name*=typeid]').val() + ';';
+ searchnames += $('#search_name_' + i).find(':text').val() + ';;';
+ }
+ }
+ Ajax.update_html(null, 'profile/ajax/buildnames/' + searchnames, function(data){
+ var name = data.split(';');
+ $('#public_name').html(name[0]);
+ $('#private_name').html(name[0] + name[1]);
+ });
+}
-function selectType(selectCtrl, type)
+function toggleParticle(id)
{
- for (i = 0; i < selectCtrl.options.length; i++) {
- if (selectCtrl.options[i].text == type)
- selectCtrl.selectedIndex=i;
+ if ($('#search_name_' + id).find("[name*='[particle]']").val() == '') {
+ $('#search_name_' + id).find("[name*='[particle]']").val(1);
+ } else {
+ $('#search_name_' + id).find("[name*='[particle]']").val('');
}
}
+// Nationalities {{{1
+function delNationality(i)
+{
+ $('#nationalite' + i).hide().find('select').val('');
+}
-// Addresses
+function addNationality()
+{
+ var i = 0;
+ if ($('#nationalite2').find('select').val() == "") {
+ i = 2;
+ } else if ($('#nationalite3').find('select').val() == "") {
+ i = 3;
+ }
+ if ((i == 2) || (i == 3)) {
+ $('#nationalite' + i).show();
+ }
+}
-function removeObject(id, pref)
+// Education {{{1
+
+function prepareType(id)
{
- document.getElementById(id).style.display = "none";
- document.forms.prof_annu[pref + "[removed]"].value = "1";
+ var edu = $('.edu_' + id).find("[name='edus[" + id + "][eduid]']").val() - 1;
+ var sel = $('.edu_' + id).find('[name=edu_' + id + '_tmp]').val();
+ var html = '';
+ var length = educationDegree[edu].length;
+ for (i = 0; i < length; ++i) {
+ html += '<option value="' + educationDegree[edu][i] + '"';
+ if (sel == educationDegree[edu][i]) {
+ html += ' selected="selected"';
+ }
+ html += '>' + educationDegreeName[educationDegree[edu][i] - 1] + '</option>';
+ }
+ $('.edu_' + id).find("[name='edus[" + id + "][degreeid]']").html(html);
}
-function restoreObject(id, pref)
+function addEdu()
{
- document.getElementById(id).style.display = '';
- document.forms.prof_annu[pref + "[removed]"].value = "0";
+ var i = 0;
+ var j = 0;
+ var prefix = 'edu_';
+ var class_parity;
+
+ while (!$('#edu_add').hasClass(prefix + i)) {
+ if ($('.' + prefix + i).length != 0) {
+ j++;
+ }
+ i++;
+ }
+ if (j % 2) {
+ class_parity = 'pair';
+ } else {
+ class_parity = 'impair';
+ }
+ $('#edu_add').removeClass(prefix + i);
+ i++;
+ $('#edu_add').addClass(prefix + i);
+ i--;
+ $.get(platal_baseurl + 'profile/ajax/edu/' + i + '/' + class_parity,
+ function(data) {
+ $('#edu_add').before(data);
+ prepareType(i);
+ });
}
-function getAddressElement(adrid, adelement)
+function removeEdu(i)
{
- return document.forms.prof_annu["addresses[" + adrid + "][" + adelement + "]"];
+ var prefix = 'edu_';
+ $('.' + prefix + i).remove();
+ while (!$('#edu_add').hasClass(prefix + i)) {
+ $('.' + prefix + i).toggleClass('pair');
+ $('.' + prefix + i).toggleClass('impair');
+ i++;
+ }
}
-function checkCurrentAddress(newCurrent)
+// Networking {{{1
+
+function addNetworking()
{
- var hasCurrent = false;
var i = 0;
- while (getAddressElement(i, 'pub') != null) {
- var radio = getAddressElement(i, 'current');
- var removed = getAddressElement(i, 'removed');
- if (removed.value == "1" && radio.checked) {
- radio.checked = false;
- } else if (radio.checked && radio != newCurrent) {
- radio.checked = false;
- } else if (radio.checked) {
- hasCurrent = true;
- }
+ while ($('#networking_' + i).length != 0) {
i++;
}
- if (!hasCurrent) {
- i = 0;
- while (getAddressElement(i, 'pub') != null) {
- var radio = getAddressElement(i, 'current');
- var removed = getAddressElement(i, 'removed');
- if (removed.value != "1") {
- radio.checked= true;
- return;
- }
- i++;
+ var namefirst = '';
+ var html = '<tr id="networking_' + i + '">'
+ + ' <td colspan="2">'
+ + ' <div style="float: left; width: 200px;">'
+ + ' <span class="flags">'
+ + ' <input type="checkbox" name="networking[' + i + '][pub]"/>'
+ + ' <img src="images/icons/flag_green.gif" alt="site public" title="site public">'
+ + ' </span> '
+ + ' <select name="networking[' + i + '][type]" onchange="javascript:updateNetworking(' + i + ');">';
+ for (nw in nw_list) {
+ if (namefirst == '') {
+ namefirst = nw;
}
+ html += ' <option value="' + nw_list[nw] + '">' + nw + '</option>';
}
+ html += '</select>'
+ + ' <input type="hidden" name="networking[' + i + '][name]" value="' + namefirst + '"/>'
+ + ' </div>'
+ + ' <div style="float: left">'
+ + ' <input type="text" name="networking[' + i + '][address]" value="" size="30"/>'
+ + ' <a href="javascript:removeNetworking(' + i + ')">'
+ + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer cet élément"/>'
+ + ' </a>'
+ + ' </div>'
+ + ' </td>'
+ + '</tr>';
+
+ $('#networking').before(html);
}
-function removeAddress(id, pref)
+function removeNetworking(id)
{
- removeObject(id, pref);
- checkCurrentAddress(null);
- if (document.forms.prof_annu[pref + '[datemaj]'].value != '') {
- document.getElementById(id + '_grayed').style.display = '';
- }
+ $('#networking_' + id).remove();
}
-function restoreAddress(id, pref)
+function updateNetworking(i)
{
- document.getElementById(id + '_grayed').style.display = 'none';
- checkCurrentAddress(null);
- restoreObject(id, pref);
+ $('#networking_' + i).find("[name='networking[" + i + "][name]']").val($('#networking_' + i).find('select option:selected').text());
}
-function addAddress()
+// Addresses {{{1
+
+function toggleAddress(id, val)
{
+ $('#addresses_' + id + '_grayed').toggle();
+ $('#addresses_' + id).toggle();
+ $('#addresses_' + id + '_cont').find('[name*=removed]').val(val);
+ checkCurrentAddress();
+}
+
+function checkCurrentAddress(id)
+{
+ var hasCurrentAddress = id ? true : false;
var i = 0;
- while (getAddressElement(i, 'pub') != null) {
+ while ($('#addresses_' + i + '_cont').length != 0) {
+ if ($('#addresses_' + i + '_cont').find('[name*=removed]').val() == 1) {
+ $('#addresses_' + i + '_cont').find('[name*=current]').attr('checked', false);
+ }
+ if (!hasCurrentAddress && $('#addresses_' + i + '_cont').find('[name*=current]:checked').length != 0) {
+ hasCurrentAddress = true;
+ } else {
+ $('#addresses_' + i + '_cont').find('[name*=current]').attr('checked', false);
+ }
i++;
}
- $("#add_adr").before('<div id="addresses_' + i + '_cont"></div>');
- Ajax.update_html('addresses_' + i + '_cont', 'profile/ajax/address/' + i, checkCurrentAddress);
+ if (!hasCurrentAddress) {
+ i = 0;
+ while ($('#addresses_' + i + '_cont').length != 0) {
+ if ($('#addresses_' + i + '_cont').find('[name*=removed]').val() == 0) {
+ $('#addresses_' + i + '_cont').find('[name*=current]').attr('checked', 'checked');
+ break;
+ }
+ i++;
+ }
+ }
+ if (id) {
+ $('#addresses_' + id + '_cont').find('[name*=current]').attr('checked', 'checked');
+ }
}
-function addTel(id)
+function addAddress()
{
var i = 0;
- var adid = 'addresses_' + id;
- var tel = adid + '_tel_';
- while (document.getElementById(tel + i) != null) {
+ while ($('#addresses_' + i + '_cont').length != 0) {
i++;
}
- $('#' + adid + '_add_tel').before('<div id="' + tel + i + '" style="clear: both"></div>');
- Ajax.update_html(tel + i, 'profile/ajax/tel/' + id + '/' + i);
+ $('#add_address').before('<div id="addresses_' + i + '_cont"></div>');
+ Ajax.update_html('addresses_' + i + '_cont', 'profile/ajax/address/' + i, checkCurrentAddress());
}
-
-// Geoloc
-
-function validGeoloc(id, pref)
+function addressChanged(prefid)
{
- document.getElementById(id + '_geoloc').style.display = 'none';
- document.getElementById(id + '_geoloc_error').style.display = 'none';
- document.getElementById(id + '_geoloc_valid').style.display = 'none';
- document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
- document.forms.prof_annu[pref + "[text]"].value = document.forms.prof_annu[pref + "[geoloc]"].value;
- document.forms.prof_annu[pref + "[cityid]"].value = document.forms.prof_annu[pref + "[geoloc_cityid]"].value;
- $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
- document.forms.prof_annu[pref + "[text]"].className = '';
+ $('#' + prefid + '_cont').find('[name*=changed]').val("1");
}
-function validAddress(id, pref)
+function validGeoloc(prefid, id, geoloc)
{
- document.getElementById(id + '_geoloc').style.display = 'none';
- document.getElementById(id + '_geoloc_error').style.display = 'none';
- document.getElementById(id + '_geoloc_valid').style.display = 'none';
- document.forms.prof_annu[pref + "[parsevalid]"].value = "1";
- $(document.forms.prof_annu[pref + "[text]"]).click(function() { document.forms.prof_annu[pref + "[text]"].blur(); });
- document.forms.prof_annu[pref + "[text]"].className = '';
+ if (geoloc == 1) {
+ $('#' + prefid + '_cont').find('[name*=text]').val($('#' + prefid + '_cont').find('[name*=geoloc]').val());
+ $('#' + prefid + '_cont').find('[name*=postalText]').val($('#' + prefid + '_cont').find('[name*=geocodedPostalText]').val());
+ }
+ if (geoloc > 0) {
+ $('#' + prefid + '_cont').find("[name*='[geoloc]']").remove();
+ }
+ $('#' + prefid + '_cont').find('[name*=text]').removeClass('error');
+ $('#' + prefid + '_cont').find('[name*=geoloc_choice]').val(geoloc);
+ $('.' + prefid + '_geoloc').remove();
}
+// {{{1 Phones
-// Groups
-
-function updateGroup(type)
+function addTel(prefid, prefname)
{
- var val = document.forms.prof_annu[type + '_sel'].value;
- if (val == '0' || document.getElementById(type + '_' + val) != null) {
- document.getElementById(type + '_add').style.display = 'none';
- } else {
- document.getElementById(type + '_add').style.display = '';
+ var i = 0;
+ var prefix = prefid + '_';
+ while ($('#' + prefix + i).length != 0) {
+ i++;
}
+ $('#' + prefix + 'add').before('<div id="' + prefix + i + '" style="clear: both; padding-top: 4px; padding-bottom: 4px"></div>');
+ Ajax.update_html(prefix + i, 'profile/ajax/tel/' + prefid + '/' + prefname + '/' + i);
}
-function removeGroup(cat, id)
+function removeTel(id)
{
- $('#' + cat + '_' + id).remove();
- updateGroup(cat);
+ $('#' + id).remove();
}
-function addGroup(cat)
+function addPhoneComment(id)
{
- var cb = document.forms.prof_annu[cat + '_sel'];
- var id = cb.value;
- var text = cb.options[cb.selectedIndex].text;
- var html = '<tr id="' + cat + '_' + id + '">'
- + ' <td>'
- + ' <input type="hidden" name="' + cat + '[' + id + ']" value="' + text + '" />'
- + ' </td>'
- + ' <td>'
- + ' <div style="float: left; width: 70%">'
- + text
- + ' </div>'
- + ' <a href="javascript:removeGroup(\'' + cat + '\', ' + id + ')">'
- + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
- + ' </a>'
- + ' </td>'
- + '</tr>';
- $('#' + cat).after(html);
- updateGroup(cat);
+ $('#' + id + '_comment').show();
+ $('#' + id + '_addComment').hide();
}
-function updateGroupSubLink(cb)
+function removePhoneComment(id, pref)
{
- var href = cb.value ? cb.value : "http://www.polytechnique.net";
- document.getElementById("groupesx_sub").href = href;
+ $('#' + id + '_comment').hide();
+ $('#' + id + '_comment').find("[name='" + pref + "[comment]']").val('');
+ $('#' + id + '_addComment').show();
}
+// {{{1 Groups
-// Medals
+function addBinet()
+{
+ var id = $('#binets_table').find('[name=binets_sel]').val();
+ var text = $('#binets_table').find('select option:selected').text();
+ var html = '<tr id="binets_' + id + '">'
+ + ' <td>'
+ + ' <input type="hidden" name="binets[' + id + ']" value="' + text + '" />'
+ + ' </td>'
+ + ' <td>'
+ + ' <div style="float: left; width: 70%">'
+ + text
+ + ' </div>'
+ + ' <a href="javascript:removeElement(\'binets\', ' + id + ')">'
+ + ' <img src="images/icons/cross.gif" alt="cross" title="Supprimer ce groupe" />'
+ + ' </a>'
+ + ' </td>'
+ + '</tr>';
+ $('#binets_table').after(html);
+ updateElement('binets');
+}
+
+function updateGroupSubLink()
+{
+ var href = $('[name*=groupesx_sub]').val() ? $('[name*=groupesx_sub]').val() : 'http://www.polytechnique.net';
+ $('#groupesx_sub').attr('href', href);
+}
+
+// {{{1 Medals
function updateMedal()
{
- var val = document.forms.prof_annu['medal_sel'].value;
- if (val == '' || document.getElementById('medal_' + val) != null) {
- document.getElementById('medal_add').style.display = 'none';
+ var val = $('#medals').find('[name*=medal_sel]').val();
+ if (val && ($('#medal_' + val).length == 0)) {
+ $('#medal_add').show();
} else {
- document.getElementById('medal_add').style.display = '';
+ $('#medal_add').hide();
}
}
function getMedalName(id)
{
- document.getElementById('medal_name_' + id).innerHTML = names[id];
+ $('#medal_name_' + id).html(names[id]);
}
function buildGrade(id, current)
function addMedal()
{
- var id = document.forms.prof_annu['medal_sel'].value;
+ var id = $('#medals').find('[name=medal_sel]').val();
$.get(platal_baseurl + 'profile/ajax/medal/' + id, makeAddProcess(id));
}
updateMedal();
}
-
-// Jobs
+// Jobs {{{1
function removeJob(id, pref)
{
- document.getElementById(id + '_cont').style.display = 'none';
- if (document.forms.prof_annu[pref + '[new]'].value == '0') {
- document.getElementById(id + '_grayed').style.display = '';
- document.getElementById(id + '_grayed_name').innerHTML =
- document.forms.prof_annu[pref + "[name]"].value.replace('<', '<');
+ $('#' + id + '_cont').hide();
+ if ($('#' + id).find("[name='" + pref + "[new]']").val() == '0') {
+ $('#' + id + '_grayed').show();
+ $('#' + id + '_grayed_name').html($('#' + id).find("[name='" + pref + "[name]']").val());
}
- document.forms.prof_annu[pref + "[removed]"].value = "1";
+ $('#' + id).find("[name='" + pref + "[removed]']").val('1');
}
function restoreJob(id, pref)
{
- document.getElementById(id + '_cont').style.display = '';
- document.getElementById(id + '_grayed').style.display = 'none';
- document.forms.prof_annu[pref + "[removed]"].value = "0";
+ $('#' + id + '_cont').show();
+ $('#' + id + '_grayed').hide();
+ $('#' + id).find("[name='" + pref + "[removed]']").val('0');
+}
+
+function updateJobSector(id, sel)
+{
+ var sector = $('#job_' + id).find("[name='jobs[" + id + "][sector]']").val();
+ if (sector == '') {
+ sector = '-1';
+ }
+ Ajax.update_html('job_' + id + '_subSector', 'profile/ajax/sector/' + id + '/job_' + id + '/jobs[' + id + ']/' + sector + '/' + sel);
}
-function updateJobSecteur(nb, id, pref, sel)
+function updateJobSubSector(id, sel)
{
- var secteur = document.forms.prof_annu[pref + '[secteur]'].value;
- if (secteur == '') {
- secteur = '-1';
+ var subSector = $('#job_' + id).find("[name='jobs[" + id + "][subSector]']").val();
+ if (subSector == '') {
+ subSector = '-1';
}
- Ajax.update_html(id + '_ss_secteur', 'profile/ajax/secteur/' +nb + '/' + secteur + '/' + sel);
+ Ajax.update_html('job_' + id + '_subSubSector', 'profile/ajax/sub_sector/' + id + '/' + subSector + '/' + sel);
+}
+
+function updateJobAlternates(id)
+{
+ var subSubSector = $('#job_' + id).find("[name='jobs[" + id + "][subSubSector]']").val();
+ if (subSubSector != '') {
+ Ajax.update_html('job_' + id + '_alternates', 'profile/ajax/alternates/' + id + '/' + subSubSector);
+ }
+}
+
+function displayAllSector(id)
+{
+ $('.sector_text_' + id).remove();
+ $('.sector_' + id).show();
}
function makeAddJob(id)
{
$('#add_job').before(data);
registerEnterpriseAutocomplete(id);
- updateSecteur('job_' + id, 'jobs[' + id + ']', '');
};
}
function addJob()
{
var i = 0;
- while (document.getElementById('job_' + i) != null) {
+ while ($('#job_' + i).length != 0) {
++i;
}
$.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i));
}
-
-// Skills
-
-function updateSkill(cat)
+function addEntreprise(id)
{
- var val = document.forms.prof_annu[cat + '_sel'].value;
- var show = true;
- if (val == '') {
- show = false;
- }
- if (document.getElementById(cat + '_' + val) != null) {
- show = false;
- }
- document.getElementById(cat + '_add').style.display = show ? '' : 'none';
+ $('.entreprise_' + id).toggle();
}
+// {{{1 Skills
+
function addSkill(cat)
{
- var sel = document.forms.prof_annu[cat + '_sel'];
- var val = sel.value;
- var text = sel.options[sel.selectedIndex].text;
+ var val = $('#' + cat + '_table').find('[name=' + cat + '_sel]').val();
+ var text = $('#' + cat + '_table').find('[name=' + cat + '_sel] :selected').text();
$.get(platal_baseurl + 'profile/ajax/skill/' + cat + '/' + val,
function(data) {
- $('#' + cat).append(data);
- document.getElementById(cat + '_' + val + '_title').innerHTML = text;
- updateSkill(cat);
+ $('#' + cat).append(data);
+ $('#' + cat + '_' + val + '_title').text(text);
+ updateElement(cat);
});
}
-function removeSkill(cat, id)
-{
- $('#' + cat + '_' + id).remove();
- updateSkill(cat);
-}
-
-
-// Mentor
-
-function updateCountry()
-{
- var val = document.forms.prof_annu.countries_sel.value;
- var show = true;
- if (val == '' || val == '00') {
- show = false;
- }
- if (document.getElementById('countries_' + val) != null) {
- show = false;
- }
- document.getElementById('countries_add').style.display = show ? '' : 'none';
-}
+// {{{1 Mentor
function addCountry()
{
- var cb = document.forms.prof_annu.countries_sel;
- var val = cb.value;
- var text = cb.options[cb.selectedIndex].text;
+ var val = $('#countries_table').find('[name=countries_sel] :selected').val();
+ var text = $('#countries_table').find('[name=countries_sel] :selected').text();
var html = '<div id="countries_' + val + '" style="clear: both; margin-bottom: 0.7em">'
- + ' <a href="javascript:removeCountry(\'' + val + '\')" style="display: block; float:right">'
+ + ' <a href="javascript:removeElement(\'countries\', \'' + val + '\')" style="display: block; float:right">'
+ ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce pays" />'
+ ' </a>'
+ ' <div style="float: left; width: 50%">' + text + '</div>'
+ ' <input type="hidden" name="countries[' + val + ']" value="' + text + '" />'
+ '</div>';
$('#countries').append(html);
- updateCountry();
+ updateElement('countries');
}
-function removeCountry(id)
+function updateSubSector()
{
- $('#countries_' + id).remove();
- updateCountry();
+ var s = $('#sectorSelection').find('[name=sectorSelection]').val();
+ var ss = $('#subSectorSelection').find("[name='jobs[-1][subSector]']").val();
+ if ((s == '' || ss == '') || $('#sectors_' + s + '_' + ss).length != 0) {
+ $('#addSector').hide();
+ } else {
+ $('#addSector').show();
+ }
}
-function updateSSecteur()
+
+function removeSector(s, ss)
{
- var s = document.forms.prof_annu.secteur_sel.value;
- var ss = document.forms.prof_annu['jobs[-1][ss_secteur]'].value;
- var show = true;
- if (s == '' || ss == '') {
- show = false;
- }
- if (document.getElementById('secteurs_' + s + '_' + ss) != null) {
- show = false;
- }
- document.getElementById('secteurs_add').style.display = show ? 'block' : 'none';
+ $('#sectors_' + s + '_' + ss).remove();
+ updateSubSector();
}
-function updateSecteur()
+function updateSector()
{
- var secteur = document.forms.prof_annu.secteur_sel.value;
- if (secteur == '') {
- secteur = '-1';
- document.getElementById('ss_secteur_sel').innerHTML = '';
+ var sector = $('#sectorSelection').find('[name=sectorSelection]').val();
+ if (sector == '') {
+ sector = '-1';
+ $('#subSectorSelection').html('');
return;
}
- $.get(platal_baseurl + 'profile/ajax/secteur/-1/' + secteur,
+ $.get(platal_baseurl + 'profile/ajax/sector/-1/0/0/' + sector,
function(data) {
- data = '<a href="javascript:addSecteur()" style="display: none; float: right" id="secteurs_add">'
- + ' <img src="images/icons/add.gif" alt="" title="Ajouter ce secteur" />'
- + '</a>' + data;
- document.getElementById('ss_secteur_sel').innerHTML = data;
- $(document.forms.prof_annu['jobs[-1][ss_secteur]']).change(updateSSecteur);
+ data = '<a href="javascript:addSector()" style="display: none; float: right" id="addSector">'
+ + ' <img src="images/icons/add.gif" alt="Ajouter ce secteur" title="Ajouter ce secteur" />'
+ + '</a>' + data;
+ $('#subSectorSelection').html(data);
+ $('#subSectorSelection').find("[name='jobs[-1][subSector]']").change(updateSubSector);
});
}
-function addSecteur()
+function addSector()
{
- var scb = document.forms.prof_annu.secteur_sel;
- var s = scb.value;
- var st = scb.options[scb.selectedIndex].text;
-
- var sscb = document.forms.prof_annu['jobs[-1][ss_secteur]'];
- var ss = sscb.value;
- var sst = sscb.options[sscb.selectedIndex].text;
-
- var html = '<div id="secteurs_' + s + '_' + ss + '" style="clear: both; margin-top: 0.5em" class="titre">'
- + ' <a href="javascript:removeSecteur(\'' + s + '\', \'' + ss + '\')" style="display: block; float: right">'
- + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce secteur" />'
- + ' </a>'
- + ' <input type="hidden" name="secteurs[' + s + '][' + ss + ']" value="' + sst + '" />'
- + ' ' + sst
- + '</div>';
- $('#secteurs').append(html);
- updateSSecteur();
-}
+ var s = $('#sectorSelection').find('[name=sectorSelection]').val();
+ var ss = $('#subSectorSelection').find("[name='jobs[-1][subSector]']").val();
+ var sst = $('#subSectorSelection').find("[name='jobs[-1][subSector]'] :selected").text();
-function removeSecteur(s, ss)
-{
- $('#secteurs_' + s + '_' + ss).remove();
- updateSSecteur();
+ var html = '<div id="sectors_' + s + '_' + ss + '" style="clear: both; margin-top: 0.5em" class="titre">'
+ + ' <a href="javascript:removeSector(\'' + s + '\', \'' + ss + '\')" style="display: block; float: right">'
+ + ' <img src="images/icons/cross.gif" alt="" title="Supprimer ce secteur" />'
+ + ' </a>'
+ + ' <input type="hidden" name="sectors[' + s + '][' + ss + ']" value="' + sst + '" />'
+ + ' ' + sst
+ + '</div>';
+ $('#sectors').append(html);
+ updateSubSector();
}
function registerEnterpriseAutocomplete(id)
{
- $(".enterprise_name").each(
+ $(".enterpriseName").each(
function() {
if (id == -1 || this.name == "jobs[" + id + "][name]") {
$(this).autocomplete(platal_baseurl + "search/autocomplete/entreprise",
{
- selectOnly:1,
- field:this.name,
- matchSubset:0,
- width:$(this).width()
+ selectOnly:1,
+ field:this.name,
+ matchSubset:0,
+ width:$(this).width()
});
}
- }
- );
+ });
+
+ $(".sectorName").each(
+ function() {
+ if (id == -1 || this.name == "jobs[" + id + "][subSubSectorName]") {
+ $(this).autocomplete(platal_baseurl + "search/autocomplete/subSubSector",
+ {
+ selectOnly:1,
+ field:this.name,
+ matchSubset:0,
+ width:$(this).width()
+ });
+ }
+ });
+}
+
+// {{{1 Multiusage functions
+
+function updateElement(cat)
+{
+ var val = $('#' + cat + '_table').find('[name=' + cat + '_sel]').val();
+ if (val == '' || $('#' + cat + '_' + val).length != 0) {
+ $('#' + cat + '_add').hide();
+ } else {
+ $('#' + cat + '_add').show();
+ }
+}
+
+function removeElement(cat, id)
+{
+ $('#' + cat + '_' + id).remove();
+ updateElement(cat);
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
require_once dirname(__FILE__).'/../include/xnet.inc.php';
-$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'geoloc', 'payment', 'bandeau');
+$platal = new Xnet('xnet', 'xnetgrp', 'xnetlists', 'xnetevents', 'payment', 'bandeau');
if (!($path = Env::v('n')) || substr($path, 0, 4) != 'Xnet') {
$platal->run();
exit;
require_once dirname(__FILE__).'/../include/xorg.inc.php';
$platal = new Xorg('auth', 'carnet', 'email', 'events', 'forums',
- 'geoloc', 'lists', 'marketing', 'payment', 'platal',
+ 'lists', 'marketing', 'payment', 'platal',
'profile', 'register', 'search', 'stats', 'admin',
'newsletter', 'axletter', 'bandeau', 'survey',
- 'gadgets', 'googleapps', 'poison', 'openid');
+ 'fusionax', 'gadgets', 'googleapps', 'poison', 'openid');
if (!($path = Env::v('n')) || ($path{0} < 'A' || $path{0} > 'Z')) {
$platal->run();
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-function applis_options($current=0) {
- $html = '<option value="-1"></option>';
- $res = XDB::iterator("select * from applis_def order by text");
- while ($arr_appli = $res->next()) {
- $html .= '<option value="'.$arr_appli["id"].'"';
- if ($arr_appli["id"]==$current) $html .= " selected='selected'";
- $html .= '>'.htmlspecialchars($arr_appli["text"])."</option>\n";
- }
- return $html;
-}
-/** pour appeller applis_options depuis smarty
- */
-function _applis_options_smarty($params){
- if(!isset($params['selected']))
- $params['selected'] = 0;
- return applis_options($params['selected']);
-}
-Platal::page()->register_function('applis_options','_applis_options_smarty');
-
-
-/** affiche un Array javascript contenant les types de chaque appli
- */
-function applis_type(){
- $html = "";
- $res=XDB::iterRow("select type from applis_def order by text");
- if (list($appli_type) = $res->next()) {
- $html .= "new Array('".str_replace(",","','",$appli_type)."')";
- }
- while (list($appli_type) = $res->next()) {
- $html .= ",\nnew Array('".str_replace(",","','",$appli_type)."')";
- }
- return $html;
-}
-Platal::page()->register_function('applis_type','applis_type');
-
-/** affiche tous les types possibles d'applis
- */
-function applis_type_all(){
- $res = XDB::query("show columns from applis_def like 'type'");
- $arr_appli = $res->fetchOneAssoc();
- return str_replace(")","",str_replace("set(","",$arr_appli["Type"]));
-}
-Platal::page()->register_function('applis_type_all','applis_type_all');
-
-/** formatte une ecole d'appli pour l'affichage
- */
-function applis_fmt($type, $text, $url) {
- $txt="";
- if (($type != "Ingénieur") && ($type != "Diplôme"))
- $txt .= $type;
- if ($text != "Université") {
- if ($txt) $txt .= ' ';
- if ($url)
- $txt .= "<a href=\"$url\" onclick=\"return popup(this)\">$text</a>";
- else
- $txt .= $text;
- }
- if (!$txt) {
- $txt .= $text;
- }
- return $txt;
-}
-function _applis_fmt($params, &$smarty) {
- extract($params);
- return applis_fmt($type, $text, $url);
-}
-Platal::page()->register_function('applis_fmt','_applis_fmt');
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+function education_options($current = 0)
+{
+ $html = '<option value="-1"></option>';
+ $res = XDB::iterator("SELECT e.id AS id, gc.countryFR AS country,
+ IF(CHAR_LENGTH(e.name) > 76, e.abbreviation, e.name) AS name
+ FROM profile_education_enum AS e
+ LEFT JOIN geoloc_countries AS gc ON (e.country = gc.iso_3166_1_a2)
+ WHERE EXISTS (SELECT *
+ FROM profile_education_degree AS d
+ WHERE e.id = d.eduid)
+ ORDER BY gc.countryFR, e.name");
+ $country = "";
+ while ($arr_edu = $res->next()) {
+ if ($arr_edu["country"] != $country) {
+ $country = $arr_edu["country"];
+ $html .= "<optgroup label=" . $country . ">";
+ }
+ $html .= '<option value="' . $arr_edu["id"] . '"';
+ if ($arr_edu["id"] == $current) {
+ $html .= " selected='selected'";
+ }
+ $html .= '>' . htmlspecialchars($arr_edu["name"]) . "</option>\n";
+ }
+ return $html;
+}
+
+/** pour appeller education_options depuis smarty
+ */
+function _education_options_smarty($params)
+{
+ if(!isset($params['selected'])) {
+ $params['selected'] = 0;
+ }
+ return education_options($params['selected']);
+}
+Platal::page()->register_function('education_options', '_education_options_smarty');
+
+/** affiche un Array javascript contenant les diplômes de chaque formation
+ */
+function education_degree()
+{
+ $html = '';
+ $res = XDB::iterRow("SELECT eduid, degreeid
+ FROM profile_education_degree
+ ORDER BY eduid");
+ $edu_degree = $res->next();
+ for ($eduid = 1; $edu_degree; ++$eduid) {
+ $html .= '[';
+ if ($edu_degree['0'] == $eduid) {
+ $html .= $edu_degree['1'];
+ $edu_degree = $res->next();
+ while ($edu_degree['0'] == $eduid) {
+ $html .= ',' . $edu_degree['1'];
+ $edu_degree = $res->next();
+ }
+ }
+ $html .= ']';
+ if ($edu_degree) {
+ $html .= ",\n";
+ }
+ }
+ return $html;
+}
+Platal::page()->register_function('education_degree', 'education_degree');
+
+/** affiche tous les types possibles de diplômes
+ */
+function education_degree_all()
+{
+ $res = XDB::query("SELECT id
+ FROM profile_education_degree_enum
+ ORDER BY id");
+ return implode(',', $res->fetchColumn());
+}
+Platal::page()->register_function('education_degree_all', 'education_degree_all');
+
+/** affiche les noms de tous les diplômes possibles
+ */
+function education_degree_name()
+{
+ $res = XDB::query("SELECT degree
+ FROM profile_education_degree_enum
+ ORDER BY id");
+ return '"' . implode('","', $res->fetchColumn()) . '"';
+}
+Platal::page()->register_function('education_degree_name', 'education_degree_name');
+
+/** formatte une formation pour l'affichage
+ */
+function education_fmt($name, $url, $degree, $grad_year, $field, $program, $sexe, $long)
+{
+ $field = strtolower($field);
+ $txt = "";
+
+ if ($grad_year || $field || $program) {
+ $txt .= "<span title=\"(";
+ if ($program) {
+ $txt .= $program;
+ if ($grad_year || $field) {
+ $txt .= ", ";
+ }
+ }
+ if ($grad_year) {
+ if ($sexe) {
+ $txt .= "diplômée en $grad_year";
+ } else {
+ $txt .= "diplômé en $grad_year";
+ }
+ if ($field) {
+ $txt .= ", ";
+ }
+ }
+ if ($field) {
+ $txt .= "domaine : $field)\">";
+ }
+ }
+
+ if (($degree != "Lic.") || ($long)) {
+ if (($degree != "Ing.") && ($degree != "Dipl.")) {
+ $txt .= $degree;
+ }
+ if ($name) {
+ $txt .= ' ';
+ }
+ if ($url != ' ') {
+ $txt .= "<a href=\"$url\" onclick=\"return popup(this)\">$name</a>";
+ } else {
+ $txt .= $name;
+ }
+ }
+ $txt .= "</span>";
+
+ return $txt;
+}
+
+function _education_fmt($params, &$smarty)
+{
+ extract($params);
+ return education_fmt($name, $url, $degree, $grad_year, $field, $program, $sexe, $long);
+}
+Platal::page()->register_function('education_fmt', '_education_fmt');
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+function fill_email_combobox(PlPage& $page)
+{
+ global $globals;
+
+ $user = S::user();
+ $email_type = "directory";
+
+ $res = XDB::query(
+ "SELECT email_directory
+ FROM profile_directory
+ WHERE uid = {?}", $user->id());
+ $email_directory = $res->fetchOneCell();
+ if ($email_directory) {
+ $page->assign('email_directory', $email_directory);
+ list($alias, $domain) = explode('@', $email_directory);
+ } else {
+ $page->assign('email_directory', '');
+ $email_type = NULL;
+ $alias = $domain = '';
+ }
+
+ $res = XDB::query(
+ "SELECT alias
+ FROM virtual
+ INNER JOIN virtual_redirect USING(vid)
+ WHERE (redirect = {?} OR redirect = {?})
+ AND alias LIKE '%@{$globals->mail->alias_dom}'",
+ $user->forlifeEmail(),
+ // TODO: remove this über-ugly hack. The issue is that you need
+ // to remove all @m4x.org addresses in virtual_redirect first.
+ $user->login() . '@' . $globals->mail->domain2);
+ $melix = $res->fetchOneCell();
+ if ($melix) {
+ list($melix) = explode('@', $melix);
+ $page->assign('melix', $melix);
+ if (($domain == $globals->mail->alias_dom) || ($domain == $globals->mail->alias_dom2)) {
+ $email_type = "melix";
+ }
+ }
+
+ $res = XDB::query(
+ "SELECT alias
+ FROM aliases
+ WHERE id={?} AND (type='a_vie' OR type='alias')", $user->id());
+ $res = $res->fetchAllAssoc();
+ $page->assign('list_email_X', $res);
+ if (($domain == $globals->mail->domain) || ($domain == $globals->mail->domain2)) {
+ foreach ($res as $res_it) {
+ if ($alias == $res_it['alias']) {
+ $email_type = "X";
+ }
+ }
+ }
+
+ require_once 'emails.inc.php';
+ $redirect = new Redirect($user);
+ $redir = array();
+ foreach ($redirect->emails as $redirect_it) {
+ if ($redirect_it instanceof EmailRedirection) {
+ $redir[] = $redirect_it->email;
+ if ($email_directory == $redirect_it->email) {
+ $email_type = "redir";
+ }
+ }
+ }
+ $page->assign('list_email_redir', $redir);
+
+ $res = XDB::query(
+ "SELECT email
+ FROM profile_job
+ WHERE uid = {?}", $user->id());
+ $res = $res->fetchAllAssoc();
+ $pro = array();
+ foreach ($res as $res_it) {
+ if ($res_it['email'] != '') {
+ $pro[] = $res_it['email'];
+ if ($email_directory == $res_it['email']) {
+ $email_type = "pro";
+ }
+ }
+ }
+ $page->assign('list_email_pro', $pro);
+
+ $page->assign('email_type', $email_type);
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+// Interface for an address geocoder. It provides support for transforming a free
+// form address into a fully structured one.
+// TODO: define and use an Address object instead of a key-value map.
+abstract class Geocoder {
+ // Geocodes @p the address, and returns the corresponding updated address.
+ // Unknown key-value pairs available in the input map are retained as-is.
+ abstract public function getGeocodedAddress(array $address);
+
+ // Cleans the address from its geocoded data
+ abstract public function stripGeocodingFromAddress(array $address);
+
+ // Updates geoloc_administrativeareas, geoloc_subadministrativeareas and
+ // geoloc_localities databases with new geocoded data and returns the
+ // corresponding id.
+ static public function getAreaId(array &$address, $area)
+ {
+ static $databases = array(
+ 'administrativeArea' => 'geoloc_administrativeareas',
+ 'subAdministrativeArea' => 'geoloc_subadministrativeareas',
+ 'locality' => 'geoloc_localities',
+ );
+
+ if (isset($address[$area . 'Name']) && isset($databases[$area])) {
+ $res = XDB::query("SELECT id
+ FROM " . $databases[$area] . "
+ WHERE name = {?}",
+ $address[$area . 'Name']);
+ if ($res->numRows() == 0) {
+ $address[$area . 'Id'] = XDB::execute("INSERT INTO " . $databases[$area] . " (name, country)
+ VALUES ({?}, {?})",
+ $address[$area . 'Name'], $address['countryId']);
+ } else {
+ $address[$area . 'Id'] = $res->fetchOneCell();
+ }
+ }
+ }
+
+ // Returns the part of the text preceeding the line with the postal code
+ // and the city name, within the limit of $limit number of lines.
+ static public function getFirstLines($text, $postalCode, $limit)
+ {
+ $textArray = explode("\n", $text);
+ for ($i = 0; $i < count($textArray); ++$i) {
+ if ($i > $limit || strpos($textLine, $postalCode) !== false) {
+ $limit = $i; break;
+ }
+ }
+ return implode("\n", array_slice($textArray, 0, $limit));
+ }
+
+ // Returns the number of non geocoded addresses for a user.
+ static public function countNonGeocoded($pid)
+ {
+ $res = XDB::query("SELECT COUNT(*)
+ FROM profile_addresses
+ WHERE pid = {?} AND FIND_IN_SET('home', type) AND accuracy = 0",
+ $pid);
+ return $res->fetchOneCell();
+ }
+}
+
+// Implementation of a Geocoder using the Google Maps API. Please refer to
+// the following links for details:
+// http://code.google.com/apis/maps/documentation/services.html#Geocoding
+// http://code.google.com/intl/en/apis/maps/documentation/geocoding/
+// http://code.google.com/apis/maps/documentation/reference.html#GGeoAddressAccuracy
+//
+// It requires the properties gmaps_key and gmaps_url to be defined in section
+// Geocoder in plat/al's configuration (platal.ini & platal.conf).
+class GMapsGeocoder extends Geocoder {
+
+ // Maximum number of Geocoding calls to the Google Maps API.
+ const MAX_GMAPS_RPC_CALLS = 5;
+
+ public function getGeocodedAddress(array $address) {
+ $address = $this->prepareAddress($address);
+ $textAddress = $this->getTextToGeocode($address);
+
+ // Try to geocode the full address.
+ if (($geocodedData = $this->getPlacemarkForAddress($textAddress))) {
+ return $this->getUpdatedAddress($address, $geocodedData, null);
+ }
+
+ // If the full geocoding failed, try to geocode only the final part of the address.
+ // We start by geocoding everything but the first line, and continue until we get
+ // a result. To respect the limit of GMaps calls, we ignore the first few lines
+ // if there are too many address lines.
+ $addressLines = explode("\n", $textAddress);
+ $linesCount = count($addressLines);
+ for ($i = max(1, $linesCount - self::MAX_GMAPS_RPC_CALLS + 1); $i < $linesCount; ++$i) {
+ $extraLines = implode("\n", array_slice($addressLines, 0, $i));
+ $toGeocode = implode("\n", array_slice($addressLines, $i));
+ if (($geocodedData = $this->getPlacemarkForAddress($toGeocode))) {
+ return $this->getUpdatedAddress($address, $geocodedData, $extraLines);
+ }
+ }
+
+ // No geocoding could be done, the initial address is returned as-is.
+ return $address;
+ }
+
+ public function stripGeocodingFromAddress(array $address) {
+ unset($address['geoloc'], $address['geoloc_choice'], $address['geocodedPostalText'],
+ $address['countryId'], $address['country'], $address['administrativeAreaName'],
+ $address['subAdministrativeAreaName'], $address['localityName'],
+ $address['thoroughfareName'], $address['postalCode']);
+ $address['accuracy'] = 0;
+ return $address;
+ }
+
+ // Updates the address with the geocoded information from Google Maps. Also
+ // cleans up the final informations.
+ private function getUpdatedAddress(array $address, array $geocodedData, $extraLines) {
+ $this->fillAddressWithGeocoding(&$address, $geocodedData);
+
+ // If the accuracy is 6, it means only the street has been gecoded
+ // but not the number, thus we need to fix it.
+ if ($address['accuracy'] == 6) {
+ $this->fixStreetNumber($address);
+ }
+
+ // We can now format the address.
+ $this->formatAddress($address, $extraLines);
+
+ return $address;
+ }
+
+ // Retrieves the Placemark object (see #getPlacemarkFromJson()) for the @p
+ // address, by querying the Google Maps API. Returns the array on success,
+ // and null otherwise.
+ private function getPlacemarkForAddress($address) {
+ $url = $this->getGeocodingUrl($address);
+ $geoData = $this->getGeoJsonFromUrl($url);
+
+ return ($geoData ? $this->getPlacemarkFromJson($geoData) : null);
+ }
+
+ // Prepares address to be geocoded
+ private function prepareAddress($address) {
+ $address['text'] = preg_replace('/\s*\n\s*/m', "\n", trim($address['text']));
+ $address['postalText'] = $this->getPostalAddress($address['text']);
+ $address['updateTime'] = time();
+ unset($address['changed']);
+ return $address;
+ }
+
+ // Builds the Google Maps geocoder url to fetch information about @p address.
+ // Returns the built url.
+ private function getGeocodingUrl($address) {
+ global $globals;
+
+ $parameters = array(
+ 'key' => $globals->geocoder->gmaps_key,
+ 'sensor' => 'false', // The queried address wasn't obtained from a GPS sensor.
+ 'hl' => 'fr', // Output langage.
+ 'oe' => 'utf8', // Output encoding.
+ 'output' => 'json', // Output format.
+ 'gl' => 'fr', // Location preferences (addresses are in France by default).
+ 'q' => $address, // The queries address.
+ );
+
+ return $globals->geocoder->gmaps_url . '?' . http_build_query($parameters);
+ }
+
+ // Fetches JSON-encoded data from a Google Maps API url, and decode them.
+ // Returns the json array on success, and null otherwise.
+ private function getGeoJsonFromUrl($url) {
+ global $globals;
+
+ // Prepare a backtrace object to log errors.
+ $bt = null;
+ if ($globals->debug & DEBUG_BT) {
+ if (!isset(PlBacktrace::$bt['Geoloc'])) {
+ new PlBacktrace('Geoloc');
+ }
+ $bt = &PlBacktrace::$bt['Geoloc'];
+ $bt->start($url);
+ }
+
+ // Fetch the geocoding data.
+ $rawData = file_get_contents($url);
+ if (!$rawData) {
+ if ($bt) {
+ $bt->stop(0, "Could not retrieve geocoded address from GoogleMaps.");
+ }
+ return null;
+ }
+
+ // Decode the JSON-encoded data, and check for their validity.
+ $data = json_decode($rawData, true);
+ if ($bt) {
+ $bt->stop(count($data), null, $data);
+ }
+
+ return $data;
+ }
+
+ // Extracts the most appropriate placemark from the JSON data fetched from
+ // Google Maps. Returns a Placemark array on success, and null otherwise. See
+ // http://code.google.com/apis/maps/documentation/services.html#Geocoding_Structured
+ // for details on the Placemark structure.
+ private function getPlacemarkFromJson(array $data) {
+ // Check for geocoding failures.
+ if (!isset($data['Status']['code']) || $data['Status']['code'] != 200) {
+ // TODO: handle non-200 codes in a better way, since the code might
+ // indicate a temporary error on Google's side.
+ return null;
+ }
+
+ // Check that at least one placemark was found.
+ if (count($data['Placemark']) == 0) {
+ return null;
+ }
+
+ // Extract the placemark with the best accuracy. This is not always the
+ // best result (since the same address may yield two different placemarks).
+ $result = $data['Placemark'][0];
+ foreach ($data['Placemark'] as $place) {
+ if ($place['AddressDetails']['Accuracy'] > $result['AddressDetails']['Accuracy']) {
+ $result = $place;
+ }
+ }
+
+ return $result;
+ }
+
+ // Fills the address with the geocoded data
+ private function fillAddressWithGeocoding(&$address, $geocodedData) {
+ // The geocoded address three is
+ // Country -> AdministrativeArea -> SubAdministrativeArea -> Locality -> Thoroughfare
+ // with all the possible shortcuts
+ // The address is formatted as xAL, or eXtensible Address Language, an international
+ // standard for address formatting.
+ // xAL documentation: http://www.oasis-open.org/committees/ciq/ciq.html#6
+ $address['geoloc'] = str_replace(", ", "\n", $geocodedData['address']);
+ if (isset($geocodedData['AddressDetails']['Accuracy'])) {
+ $address['accuracy'] = $geocodedData['AddressDetails']['Accuracy'];
+ }
+
+ $currentPosition = $geocodedData['AddressDetails'];
+ if (isset($currentPosition['Country'])) {
+ $currentPosition = $currentPosition['Country'];
+ $address['countryId'] = $currentPosition['CountryNameCode'];
+ $address['country'] = $currentPosition['CountryName'];
+ }
+ if (isset($currentPosition['AdministrativeArea'])) {
+ $currentPosition = $currentPosition['AdministrativeArea'];
+ $address['administrativeAreaName'] = $currentPosition['AdministrativeAreaName'];
+ }
+ if (isset($currentPosition['SubAdministrativeArea'])) {
+ $currentPosition = $currentPosition['SubAdministrativeArea'];
+ $address['subAdministrativeAreaName'] = $currentPosition['SubAdministrativeAreaName'];
+ }
+ if (isset($currentPosition['Locality'])) {
+ $currentPosition = $currentPosition['Locality'];
+ $address['localityName'] = $currentPosition['LocalityName'];
+ }
+ if (isset($currentPosition['Thoroughfare'])) {
+ $address['thoroughfareName'] = $currentPosition['Thoroughfare']['ThoroughfareName'];
+ }
+ if (isset($currentPosition['PostalCode'])) {
+ $address['postalCode'] = $currentPosition['PostalCode']['PostalCodeNumber'];
+ }
+
+ // Gets coordinates.
+ if (isset($geocodedData['Point']['coordinates'][0])) {
+ $address['latitude'] = $geocodedData['Point']['coordinates'][0];
+ }
+ if (isset($geocodedData['Point']['coordinates'][1])) {
+ $address['longitude'] = $geocodedData['Point']['coordinates'][1];
+ }
+ if (isset($geocodedData['ExtendedData']['LatLonBox']['north'])) {
+ $address['north'] = $geocodedData['ExtendedData']['LatLonBox']['north'];
+ }
+ if (isset($geocodedData['ExtendedData']['LatLonBox']['south'])) {
+ $address['south'] = $geocodedData['ExtendedData']['LatLonBox']['south'];
+ }
+ if (isset($geocodedData['ExtendedData']['LatLonBox']['east'])) {
+ $address['east'] = $geocodedData['ExtendedData']['LatLonBox']['east'];
+ }
+ if (isset($geocodedData['ExtendedData']['LatLonBox']['west'])) {
+ $address['west'] = $geocodedData['ExtendedData']['LatLonBox']['west'];
+ }
+ }
+
+ // Formats the text of the geocoded address using the unused data and
+ // compares it to the given address. If they are too different, the user
+ // will be asked to choose between them.
+ private function formatAddress(&$address, $extraLines) {
+ $same = true;
+ if ($extraLines) {
+ $address['geoloc'] = $extraLines . "\n" . $address['geoloc'];
+ }
+ $address['geocodedPostalText'] = $this->getPostalAddress($address['geoloc']);
+ $geoloc = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"),
+ array("", "\n"), $address['geoloc']));
+ $text = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"),
+ array("", "\n"), $address['text']));
+ $arrayGeoloc = explode("\n", $geoloc);
+ $arrayText = explode("\n", $text);
+ $countGeoloc = count($arrayGeoloc);
+ $countText = count($arrayText);
+
+ if (($countText > $countGeoloc) || ($countText < $countGeoloc - 1)
+ || (($countText == $countGeoloc - 1)
+ && ($arrayText[$countText - 1] == strtoupper($address['country'])))) {
+ $same = false;
+ } else {
+ for ($i = 0; $i < $countGeoloc && $i < $countText; ++$i) {
+ if (levenshtein($arrayText[$i], trim($arrayGeoloc[$i])) > 3) {
+ $same = false;
+ }
+ }
+ }
+ if ($same) {
+ $address['text'] = $address['geoloc'];
+ $address['postalText'] = $address['geocodedPostalText'];
+ unset($address['geoloc'], $address['geocodedPostalText']);
+ } else {
+ $address['geoloc'] = str_replace("\n", "\r\n", $address['geoloc']);
+ $address['geocodedPostalText'] = str_replace("\n", "\r\n", $address['geocodedPostalText']);
+ }
+ $address['text'] = str_replace("\n", "\r\n", $address['text']);
+ $address['postalText'] = str_replace("\n", "\r\n", $address['postalText']);
+ }
+
+ // Returns the address formated for postal use.
+ // The main rules are (cf AFNOR XPZ 10-011):
+ // -everything in upper case;
+ // -if there are more then than 38 characters in a lign, split it;
+ // -if there are more then than 32 characters in the description of the "street", use abbreviations.
+ private function getPostalAddress($text) {
+ static $abbreviations = array(
+ "IMPASSE" => "IMP",
+ "RUE" => "R",
+ "AVENUE" => "AV",
+ "BOULEVARD" => "BVD",
+ "ROUTE" => "R",
+ "STREET" => "ST",
+ "ROAD" => "RD",
+ );
+
+ $text = strtoupper($text);
+ $arrayText = explode("\n", $text);
+ $postalText = "";
+
+ foreach ($arrayText as $i => $lign) {
+ $postalText .= (($i == 0) ? "" : "\n");
+ if (($length = strlen($lign)) > 32) {
+ $words = explode(" ", $lign);
+ $count = 0;
+ foreach ($words as $word) {
+ if (isset($abbreviations[$word])) {
+ $word = $abbreviations[$word];
+ }
+ if ($count + ($wordLength = strlen($word)) <= 38) {
+ $postalText .= (($count == 0) ? "" : " ") . $word;
+ $count += (($count == 0) ? 0 : 1) + $wordLength;
+ } else {
+ $postalText .= "\n" . $word;
+ $count = strlen($word);
+ }
+ }
+ } else {
+ $postalText .= $lign;
+ }
+ }
+ return $postalText;
+ }
+
+ // Trims the name of the real country if it contains an ISO 3166-1 non-country
+ // item. For that purpose, we compare the last but one line of the address with
+ // all non-country items of ISO 3166-1.
+ private function getTextToGeocode($address)
+ {
+ $res = XDB::iterator('SELECT country, countryFR
+ FROM geoloc_countries
+ WHERE belongsTo IS NOT NULL');
+ $countries = array();
+ foreach ($res as $item) {
+ $countries[] = $item[0];
+ $countries[] = $item[1];
+ }
+ $textLines = explode("\n", $address['text']);
+ $countLines = count($textLines);
+ $needle = strtoupper(trim($textLines[$countLines - 2]));
+ $isPseudoCountry = false;
+ foreach ($countries as $country) {
+ if (strtoupper($country) == $needle) {
+ $isPseudoCountry = true;
+ break;
+ }
+ }
+
+ if ($isPseudoCountry) {
+ return $address['text'];
+ }
+ return implode("\n", array_slice($textLines, 0, -1));
+ }
+
+ // Search for the lign from the given address that is the closest to the geocoded thoroughfareName
+ // and replaces the corresponding lign in the geocoded text by it.
+ static protected function fixStreetNumber(&$address)
+ {
+ if (isset($address['thoroughfareName'])) {
+ $thoroughfareName = $address['thoroughfareName'];
+ $thoroughfareToken = strtoupper(trim(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"),
+ array("", "\n"), $thoroughfareName)));
+ $geolocLines = explode("\n", $address['geoloc']);
+ $textLines = explode("\n", $address['text']);
+ $mindist = strlen($thoroughfareToken);
+ $minpos = 0;
+ $pos = 0;
+ foreach ($textLines as $i => $token) {
+ if (($l = levenshtein(strtoupper(trim(preg_replace(array("/[,\"'#~:;_\-]/", "/\r\n/"),
+ array("", "\n"), $token))),
+ $thoroughfareToken)) < $mindist) {
+ $mindist = $l;
+ $minpos = $i;
+ }
+ }
+ foreach ($geolocLines as $i => $line) {
+ if (strtoupper(trim($thoroughfareName)) == strtoupper(trim($line))) {
+ $pos = $i;
+ break;
+ }
+ }
+ $geolocLines[$pos] = $textLines[$minpos];
+ $address['geoloc'] = implode("\n", $geolocLines);
+ }
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-// {{{ liste les pays ou les régions d'un pays
-/** donne la liste déroulante des pays
- * @param $current pays actuellement selectionné
- */
-function geoloc_country($current, $avail_only = false)
-{
- if ($avail_only) {
- $res = XDB::iterRow('SELECT g.a2, g.pays
- FROM geoloc_pays AS g
- INNER JOIN adresses AS a ON(a.country = g.a2)
- GROUP BY g.a2
- ORDER BY g.pays');
- } else {
- $res = XDB::iterRow('SELECT a2,pays FROM geoloc_pays ORDER BY pays');
- }
- $html = "";
- while (list($my_id, $my_pays) = $res->next()) {
- $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
- $my_id, ($current==$my_id?"selected='selected'":""), $my_pays);
- }
- return $html;
-}
-
-/** donne la liste deroulante des regions pour un pays
- * @param $pays le pays dont on veut afficher les regions
- * @param $current la region actuellement selectionnee
- */
-function geoloc_region($country, $current, $avail_only = false)
-{
- if ($avail_only) {
- $res = XDB::iterRow('SELECT r.region, r.name
- FROM geoloc_region AS r
- INNER JOIN adresses AS a ON (a.country = r.a2 AND a.region = r.region)
- WHERE r.a2 = {?}
- GROUP BY r.region
- ORDER BY r.name', $country);
- } else {
- $res = XDB::iterRow('SELECT region,name
- FROM geoloc_region
- WHERE a2 = {?}
- ORDER BY name', $country);
- }
- $html = "<option value=\"\"></option>";
- while (list($regid, $regname) = $res->next()) {
- $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
- $regid, ($current==$regid?"selected='selected'":""), $regname);
- }
- return $html;
-}
-// }}}
-
-// {{{ get_address_infos($txt)
-/** retrieve the infos on a text address
- * store on the fly the info of the city concerned
- * @param $txt the raw text of an address
- */
-function get_address_infos($txt)
-{
- global $globals;
-
- $url = $globals->geoloc->webservice_url."address.php?precise=1&txt=" . urlencode($txt);
- if ($globals->debug & DEBUG_BT) {
- if (!isset(PlBacktrace::$bt['Geoloc'])) {
- new PlBacktrace('Geoloc');
- }
- PlBacktrace::$bt['Geoloc']->start($url);
- }
- $f = @fopen($url, 'r');
- if ($f === false) {
- if ($globals->debug & DEBUG_BT) {
- PlBacktrace::$bt['Geoloc']->stop(0, 'Can\'t fetch result');
- }
- return false;
- }
- $keys = explode('|',fgets($f));
- $vals = explode('|',fgets($f));
- if ($globals->debug & DEBUG_BT) {
- $data = array();
- for ($i = 0 ; $i < count($keys) ; ++$i) {
- $data[] = array($keys[$i], $vals[$i]);
- }
- PlBacktrace::$bt['Geoloc']->stop(count($keys), null, $data);
- }
- $infos = empty_address();
- foreach ($keys as $i=>$key) {
- if($vals[$i]) {
- if ($key == 'sql') {
- $infos[$key] = $vals[$i];
- } else {
- $val = strtr($vals[$i], array(chr(197).chr(147) => "œ"));
- $infos[$key] = $val;
- }
- }
- }
- if (empty($infos['country'])) {
- $infos['country'] = '00';
- }
- if (isset($infos['sql']) && $infos['sql']) {
- $sql = explode(', ', trim($infos['sql'], '()'));
- if (count($sql) == 16) {
- for ($i = 0 ; $i < 16 ; ++$i) {
- $sql[$i] = stripslashes(trim($sql[$i], ' \''));
- }
- XDB::execute("REPLACE INTO geoloc_city
- VALUES ({?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?})",
- $sql[0], $sql[1], $sql[2], $sql[3], $sql[4], $sql[5],
- $sql[6], $sql[7], $sql[8], $sql[9], $sql[10], $sql[11],
- $sql[12], $sql[13], $sql[14], $sql[15]);
- }
- }
- if (isset($infos['display']) && $infos['display'])
- XDB::execute("UPDATE geoloc_pays
- SET display = {?}
- WHERE a2 = {?}", $infos['display'], $infos['country']);
- if (isset($infos['cityid'])) {
- fix_cities_not_on_map(1, $infos['cityid']);
- if (floatval($infos['precise_lat']) && floatval($infos['precise_lon'])) {
- $res = XDB::query("SELECT c.lat / 100000, c.lon / 100000
- FROM geoloc_city AS c
- WHERE c.id = {?}", $infos['cityid']);
- if ($res->numRows()) {
- list($glat, $glng) = $res->fetchOneRow();
- $infos['precise_lat'] = $glat;
- $infos['precise_lon'] = $glng;
- }
- }
- }
- return $infos;
-}
-// }}}
-
-// {{{ get_cities_maps($array)
-/* get all the maps id of the cities contained in an array */
-function get_cities_maps($array)
-{
- global $globals;
- implode("\n",$array);
- $url = $globals->geoloc->webservice_url."findMaps.php?datatext=".urlencode(implode("\n", $array));
- if (!($f = @fopen($url, 'r'))) return false;
- $maps = array();
- while (!feof($f))
- {
- $l = trim(fgets($f));
- $tab = explode(';', $l);
- $i = $tab[0];
- unset($tab[0]);
- $maps[$i] = $tab;
- }
- return $maps;
-}
-// }}}
-
-// {{{ get_new_maps($url)
-/** set new maps from url **/
-function get_new_maps($url)
-{
- if (!($f = @fopen($url, 'r'))) {
- return false;
- }
- XDB::query('TRUNCATE TABLE geoloc_maps');
- $s = '';
- while (!feof($f)) {
- $l = fgetcsv($f, 1024, ';', '"');
- foreach ($l as $i => $val) {
- if ($val != 'NULL') {
- $l[$i] = '\''.addslashes($val).'\'';
- }
- }
- $s .= ',('.implode(',',$l).')';
- }
- XDB::execute('INSERT INTO geoloc_maps VALUES '.substr($s, 1));
- return true;
-}
-// }}}
-
-// {{{ get_address_text($adr)
-/** make the text of an address that can be read by a mailman
- * @param $adr an array with all the usual fields
- */
-function get_address_text($adr)
-{
- $t = "";
- if (isset($adr['adr1']) && $adr['adr1']) $t.= $adr['adr1'];
- if (isset($adr['adr2']) && $adr['adr2']) $t.= "\n".$adr['adr2'];
- if (isset($adr['adr3']) && $adr['adr3']) $t.= "\n".$adr['adr3'];
- $l = "";
- if (isset($adr['display']) && $adr['display']) {
- $keys = explode(' ', $adr['display']);
- foreach ($keys as $key) {
- if (isset($adr[$key])) {
- $l .= " ".$adr[$key];
- } else {
- $l .= " ".$key;
- }
- }
- if ($l) substr($l, 1);
- } elseif ($adr['country'] == 'US' || $adr['country'] == 'CA' || $adr['country'] == 'GB') {
- if ($adr['city']) $l .= $adr['city'].",\n";
- if ($adr['region']) $l .= $adr['region']." ";
- if ($adr['postcode']) $l .= $adr['postcode'];
- } else {
- if (isset($adr['postcode']) && $adr['postcode']) $l .= $adr['postcode']." ";
- if (isset($adr['city']) && $adr['city']) $l .= $adr['city'];
- }
- if ($l) $t .= "\n".trim($l);
- if ($adr['country'] != '00' && (!$adr['countrytxt'] || $adr['countrytxt'] == strtoupper($adr['countrytxt']))) {
- $res = XDB::query("SELECT pays FROM geoloc_pays WHERE a2 = {?}", $adr['country']);
- $adr['countrytxt'] = $res->fetchOneCell();
- }
- if (isset($adr['countrytxt']) && $adr['countrytxt']) {
- $t .= "\n".$adr['countrytxt'];
- }
- return trim($t);
-}
-// }}}
-
-// {{{ compare_addresses_text($a, $b)
-/** compares if two address matches
- * @param $a the raw text of an address
- * @param $b the raw text of a complete valid address
- */
-function compare_addresses_text($a, $b)
-{
- $ta = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $a));
- $tb = strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"), array("", "\n"), $b));
-
- $la = explode("\n", $ta);
- $lb = explode("\n", $tb);
-
- if (count($lb) > count($la) + 1) {
- return false;
- }
- foreach ($la as $i=>$l) {
- if (levenshtein(trim($l), trim($lb[$i])) > 3) {
- return false;
- }
- }
- return true;
-}
-
-// }}}
-
-function empty_address() {
- return Array(
- "adr1" => "",
- "adr2" => "",
- "adr3" => "",
- "cityid" => NULL,
- "city" => "",
- "postcode" => "",
- "region" => "",
- "regiontxt" => "",
- "country" => "00",
- "countrytxt" => "",
- "precise_lat" => "",
- "precise_lon" => "");
-}
-
-// create a simple address from a text without geoloc
-function cut_address($txt)
-{
- $txt = str_replace("\r\n", "\n", $txt);
- ereg("^([^\n]*)(\n([^\n]*)(\n(.*))?)?$", trim($txt), $a);
- return array("adr1" => trim($a[1]), "adr2" => trim($a[3]), "adr3" => trim(str_replace("\n", " ", $a[5])));
-}
-
-// {{{ localize_addresses($uid)
-/* localize all the address of a user and modify the database
- * if the new address match with the old one
- * @param $uid the id of the user
- */
-function localize_addresses($uid)
-{
- $res = XDB::iterator("SELECT *
- FROM adresses
- WHERE uid = {?} and (cityid IS NULL OR cityid = 0)", $uid);
- $erreur = Array();
-
- while ($a = $res->next()) {
- $new = get_address_infos($ta = get_address_text($a));
- if (compare_addresses_text($ta, get_address_text($new))) {
- XDB::execute("UPDATE adresses
- SET adr1 = {?}, adr2 = {?}, adr3 = {?},
- cityid = {?}, city = {?}, postcode = {?},
- region = {?}, regiontxt = {?}, country = {?},
- glat = {?}, glng = {?}
- WHERE uid = {?} AND adrid = {?}",
- $new['adr1'], $new['adr2'], $new['adr3'],
- $new['cityid'], $new['city'], $new['postcode'],
- $new['region'], $new['regiontxt'], $new['country'],
- $new['precise_lat'], $new['precise_lon'],
- $uid, $a['adrid']);
- $new['store'] = true;
- if (!$new['cityid']) {
- $erreur[$a['adrid']] = $new;
- }
- } else {
- $new['store'] = false;
- $erreur[$a['adrid']] = $new;
- }
- }
- return $erreur;
-}
-// }}}
-
-// {{{ synchro_city($id)
-/** synchronise the local geoloc_city base to geoloc.org
- * @param $id the id of the city to synchronize
- */
-function synchro_city($id)
-{
- global $globals;
- $url = $globals->geoloc->webservice_url."cityFinder.php?method=id&id=".$id."&out=sql";
- if (!($f = @fopen($url, 'r'))) {
- return false;
- }
- $s = fgets($f);
- if ($s) {
- return XDB::execute("REPLACE INTO geoloc_city VALUES ".$s) > 0;
- }
-}
- // }}}
-
-// {{{ function fix_cities_not_on_map($limit)
-function fix_cities_not_on_map($limit=false, $cityid=false)
-{
- $missing = XDB::query("SELECT c.id
- FROM geoloc_city AS c
- LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id)
- WHERE m.city_id IS NULL"
- . ($cityid ? " AND c.id = '" . $cityid . "'" : "" )
- . ($limit ? " LIMIT $limit" : "" ));
- $maps = get_cities_maps($missing->fetchColumn());
- if ($maps) {
- $values = "";
- foreach ($maps as $cityid => $maps_c) {
- foreach ($maps_c as $map_id) {
- $values .= ",($cityid, $map_id, '')";
- }
- }
- if (strlen($values) > 1) {
- XDB::execute("REPLACE INTO geoloc_city_in_maps
- VALUES ".substr($values, 1));
- }
- } else {
- return false;
- }
- return true;
-}
-
-function set_smallest_levels()
-{
- $maxlengths = XDB::iterRow("SELECT MAX(LENGTH(gm.path)), gcim.city_id
- FROM geoloc_city_in_maps AS gcim
- INNER JOIN geoloc_maps AS gm USING ( map_id )
- GROUP BY gcim.city_id");
- while (list($length, $id) = $maxlengths->next()) {
- XDB::execute("UPDATE geoloc_city_in_maps AS gcim
- INNER JOIN geoloc_maps AS gm USING(map_id)
- SET gcim.infos = IF(LENGTH(gm.path) = {?}, 'smallest', '')
- WHERE gcim.city_id = {?}", $length, $id);
- }
- return true;
-}
-// }}}
-
-
-function geoloc_to_x($lon, $lat)
-{
- return deg2rad(1) * $lon *100;
-}
-
-function geoloc_to_y($lon, $lat)
-{
- if ($lat < -75) {
- return latToY(-75);
- }
- if ($lat > 75) {
- return latToY(75);
- }
- return -100 * log(tan(pi()/4 + deg2rad(1)/2*$lat));
-}
-
-function size_of_city($nb)
-{
- $s = round(log($nb + 1)*2,2);
- if ($s < 1) {
- return 1;
- }
- return $s;
-}
-
-function size_of_territory($nb)
-{
- return size_of_city($nb);
-}
-
-function geoloc_getData_subcities($mapid, $SFields, &$cities, $direct=true)
-{
- if ($SFields instanceof UserSet) {
- $set = $SFields;
- $SFields = array();
- } else {
- $set = new UserSet();
- }
- for ($i_mapfield=0; $i_mapfield < count($SFields) ; $i_mapfield++) {
- if ($SFields[$i_mapfield]->fieldFormName == 'mapid') {
- break;
- }
- }
- $SFields[$i_mapfield] = new MapSField('mapid',
- array('gcim.map_id'),
- array('adresses','geoloc_city_in_maps'),
- array('am','gcim'),
- array(getadr_join('am'), 'am.cityid = gcim.city_id'),
- $mapid);
- $fields = new SFieldGroup(true, $SFields);
- $where = $fields->get_where_statement();
- $joins = $fields->get_select_statement();
- if ($where) {
- $where .= ' AND ';
- }
- $cityres = $set->get('gc.id,
- gc.lon / 100000 AS x, gc.lat/100000 AS y,
- gc.name,
- COUNT(u.user_id) AS pop,
- SUM(u.promo % 2) AS yellow',
- "$joins
- LEFT JOIN geoloc_city AS gc ON(gcim.city_id = gc.id)",
- $where . ($direct ? "gcim.infos = 'smallest'" : '1'),
- 'gc.id, gc.alias',
- 'pop DESC');
- foreach($cityres as $c) {
- if ($c['pop'] > 0) {
- $city = $c;
- $city['x'] = geoloc_to_x($c['x'], $c['y']);
- $city['y'] = geoloc_to_y($c['x'], $c['y']);
- $city['size'] = size_of_city($c['pop']);
- $cities[$c['id']] = $city;
- }
- }
-}
-
-function geoloc_getData_subcountries($mapid, $sin, $minentities)
-{
- $countries = array();
- $cities = array();
-
- if ($mapid === false) {
- $wheremapid = "WHERE gm.parent IS NULL";
- } else {
- $wheremapid = "WHERE gm.parent = {?}";
- }
- $submapres = XDB::iterator(
- "SELECT gm.map_id AS id, gm.name, gm.x, gm.y, gm.xclip, gm.yclip,
- gm.width, gm.height, gm.scale, 1 AS rat
- FROM geoloc_maps AS gm
- ". $wheremapid, Env::v('mapid',''));
-
- global $globals;
-
- while ($c = $submapres->next()) {
- $country = $c;
- $country['color'] = 0xFFFFFF;
- $country['swf'] = $globals->geoloc->webservice_url."maps/mercator/map_".$c['id'].".swf";
- $countries[$c['id']] = $country;
- }
-
- if ($mapid === false) {
- return array($countries, $cities);
- }
-
- geoloc_getData_subcities(Env::i('mapid'), $sin, $cities);
- $nbcities = count($cities);
- $nocity = $nbcities == 0;
- if ($sin instanceof UserSet) {
- $set = $sin;
- $SFields = array();
- } else {
- $set = new UserSet();
- $SFields = $sin;
- }
-
- for ($i_mapfield=0; $i_mapfield < count($SFields) ; $i_mapfield++) {
- if ($SFields[$i_mapfield]->fieldFormName == 'mapid') {
- break;
- }
- }
- $SFields[$i_mapfield] = new MapSField('mapid',
- array('map.parent'),
- array('adresses','geoloc_city_in_maps','geoloc_maps'),
- array('am','gcim','map'),
- array(getadr_join('am'),
- 'am.cityid = gcim.city_id',
- 'map.map_id = gcim.map_id'));
- $fields = new SFieldGroup(true, $SFields);
- $where = $fields->get_where_statement();
- $joins = $fields->get_select_statement();
- $countryres = $set->get('map.map_id AS id,
- COUNT(u.user_id) AS nbPop,
- SUM(u.promo % 2) AS yellow,
- COUNT(DISTINCT gcim.city_id) AS nbCities,
- SUM(IF(u.user_id IS NULL,0,am.glng)) AS lonPop,
- SUM(IF(u.user_id IS NULL, 0,am.glat)) AS latPop',
- $joins,
- $where,
- 'map.map_id',
- 'NULL');
-
- $maxpop = 0;
- $nbentities = $nbcities + count($countryres);
- foreach ($countryres as $c) {
- $c['latPop'] /= $c['nbPop'];
- $c['lonPop'] /= $c['nbPop'];
- $c['rad'] = size_of_territory($c['nbPop']);
- if ($maxpop < $c['nbPop']) $maxpop = $c['nbPop'];
- $c['xPop'] = geoloc_to_x($c['lonPop'], $c['latPop']);
- $c['yPop'] = geoloc_to_y($c['lonPop'], $c['latPop']);
- @$countries[$c['id']] = array_merge($countries[$c['id']], $c);
-
- $nbcities += $c['nbCities'];
- }
-
- if ($nocity && $nbcities < $minentities){
- foreach($countries as $i => $c) {
- $countries[$i]['nbPop'] = 0;
- if (@$c['nbCities'] > 0) {
- geoloc_getData_subcities($c['id'], $sin, $cities, false);
- }
- }
- }
-
- foreach ($countries as $i => $c) {
- if (@$c['nbPop'] > 0) {
- $lambda = pow($c['nbPop'] / $maxpop,0.3);
- $countries[$i]['color'] = 0x0000FF + round((1-$lambda) * 0xFF)*0x010100;
- }
- }
-
- return array($countries, $cities);
-}
-// }}}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+function build_javascript_names($data)
+{
+ $data_array = explode(';;', $data);
+ $n = count($data_array);
+ $n--;
+ for ($i = 0; $i < $n; $i++) {
+ $searchname = explode(';', $data_array[$i]);
+ if (isset($search_names[$searchname[0]])) {
+ $search_names[$searchname[0]][] = $searchname[1];
+ } else {
+ $search_names[$searchname[0]] = array('fullname' => $searchname[1]);
+ }
+ }
+
+ $sn_types_public = build_types('public');
+ $sn_types_private = build_types('private');
+ $full_name = build_full_name($search_names, $sn_types_public);
+ return build_public_name($search_names, $sn_types_public, $full_name) . ';' .
+ build_private_name($search_names, $sn_types_private);
+}
+
+function build_display_names(&$display_names, $search_names, $private_name_end = null, &$alias = null)
+{
+ $sn_types_public = build_types('public');
+ $full_name = build_full_name($search_names, $sn_types_public);
+ $display_names['public_name'] = build_public_name($search_names, $sn_types_public, $full_name);
+ $display_names['private_name'] = $display_names['public_name'] . $private_name_end;
+ $display_names['directory_name'] = build_directory_name($search_names, $sn_types_public, $full_name);
+ $display_names['short_name'] = build_short_name($search_names, $sn_types_public, $alias);
+ $display_names['sort_name'] = build_sort_name($search_names, $sn_types_public);
+}
+
+function build_types($pub = null)
+{
+ if ($pub == 'public') {
+ $sql_pub = "AND FIND_IN_SET('public', flags)";
+ } elseif ($pub == 'private') {
+ $sql_pub = "AND NOT FIND_IN_SET('public', flags)";
+ } else {
+ $sql_pub = "";
+ }
+ $sql = "SELECT id, type, name
+ FROM profile_name_enum
+ WHERE NOT FIND_IN_SET('not_displayed', flags)" . $sql_pub;
+ $sn_types = XDB::iterator($sql);
+ $types = array();
+ while ($sn_type = $sn_types->next()) {
+ if ($pub) {
+ $types[$sn_type['type']] = $sn_type['id'];
+ } else {
+ $types[$sn_type['id']] = $sn_type['name'];
+ }
+ }
+ return $types;
+}
+
+function build_full_name(&$search_names, &$sn_types)
+{
+ $name = "";
+ if (isset($search_names[$sn_types['lastname_ordinary']])) {
+ $name .= $search_names[$sn_types['lastname_ordinary']]['fullname'] . " ("
+ . $search_names[$sn_types['lastname']]['fullname'] . ")";
+ } else {
+ $name .= $search_names[$sn_types['lastname']]['fullname'];
+ }
+ if (isset($search_names[$sn_types['lastname_marital']])
+ || isset($search_names[$sn_types['pseudonym']])) {
+ $name .= " (";
+ if (isset($search_names[$sn_types['lastname_marital']])) {
+ $user = S::user();
+ if ($user->isFemale()) {
+ $name .= "Mme ";
+ } else {
+ $name .= "M ";
+ }
+ $name .= $search_names[$sn_types['lastname_marital']]['fullname'];
+ if (isset($search_names[$sn_types['pseudonym']])) {
+ $name .= ", ";
+ }
+ }
+ if (isset($search_names[$sn_types['pseudonym']])) {
+ $name .= $search_names[$sn_types['pseudonym']]['fullname'];
+ }
+ $name .= ")";
+ }
+ return $name;
+}
+
+function build_public_name(&$search_names, &$sn_types, $full_name)
+{
+ return $search_names[$sn_types['firstname']]['fullname'] . " " . $full_name;
+}
+
+function build_private_name(&$search_names, &$sn_types)
+{
+ $name = "";
+ if (isset($search_names[$sn_types['nickname']])
+ || (isset($search_names[$sn_types['name_other']])
+ || isset($search_names[$sn_types['name_other']]))) {
+ $name .= " (";
+ if (isset($search_names[$sn_types['nickname']])) {
+ $name .= "alias " . $search_names[$sn_types['nickname']]['fullname'];
+ $i = 0;
+ while (isset($search_names[$sn_types['nickname']][$i])) {
+ $name .= ", " . $search_names[$sn_types['nickname']][$i];
+ $i++;
+ }
+ if (isset($search_names[$sn_types['name_other']])
+ || isset($search_names[$sn_types['name_other']])) {
+ $name .= ", ";
+ }
+ }
+ if (isset($search_names[$sn_types['firstname_other']])) {
+ $name .= "autres prénoms : " . $search_names[$sn_types['firstname_other']]['fullname'];
+ $i = 0;
+ while (isset($search_names[$sn_types['firstname_other']][$i])) {
+ $name .= ", " . $search_names[$sn_types['firstname_other']][$i];
+ $i++;
+ }
+ if (isset($search_names[$sn_types['name_other']])) {
+ $name .= ", ";
+ }
+ }
+ if (isset($search_names[$sn_types['name_other']])) {
+ $name .= "autres noms : " . $search_names[$sn_types['name_other']]['fullname'];
+ $i = 0;
+ while (isset($search_names[$sn_types['name_other']][$i])) {
+ $name .= ", " . $search_names[$sn_types['name_other']][$i];
+ $i++;
+ }
+ }
+ $name .= ")";
+ }
+ return $name;
+}
+
+function build_directory_name(&$search_names, &$sn_types, $full_name)
+{
+ return $full_name . " " . $search_names[$sn_types['firstname']]['fullname'];
+}
+
+function build_short_name(&$search_names, &$sn_types, &$alias = null)
+{
+ if (isset($search_names[$sn_types['lastname_ordinary']])) {
+ $lastname = $search_names[$sn_types['lastname_ordinary']]['fullname'];
+ } else {
+ $lastname = $search_names[$sn_types['lastname']]['fullname'];
+ }
+ if (isset($search_names[$sn_types['firstname_ordinary']])) {
+ $firstname = $search_names[$sn_types['firstname_ordinary']]['fullname'];
+ } else {
+ $firstname = $search_names[$sn_types['firstname']]['fullname'];
+ }
+ if ($alias) {
+ $alias = make_username($firstname, $lastname);
+ }
+ return $firstname . " " . $lastname;
+}
+
+function build_sort_name(&$search_names, &$sn_types)
+{
+ $name = "";
+ if (isset($search_names[$sn_types['lastname_ordinary']])) {
+ $name .= $search_names[$sn_types['lastname_ordinary']]['name'];
+ } else {
+ $name .= $search_names[$sn_types['lastname']]['name'];
+ }
+ $name .= " " . $search_names[$sn_types['firstname']]['fullname'];
+ return $name;
+}
+
+function set_profile_display(&$display_names)
+{
+ XDB::execute("UPDATE profile_display
+ SET public_name = {?}, private_name = {?},
+ directory_name = {?}, short_name = {?}, sort_name = {?}
+ WHERE pid = {?}",
+ $display_names['public_name'], $display_names['private_name'],
+ $display_names['directory_name'], $display_names['short_name'],
+ $display_names['sort_name'], S::v('uid'));
+}
+
+function build_sn_pub()
+{
+ $res = XDB::iterator("SELECT CONCAT(sn.particle, sn.name) AS fullname, sn.typeid,
+ sn.particle, sn.name, sn.id
+ FROM profile_name AS sn
+ INNER JOIN profile_name_enum AS e ON (e.id = sn.typeid)
+ WHERE sn.pid = {?} AND NOT FIND_IN_SET('not_displayed', e.flags)
+ AND FIND_IN_SET('public', e.flags)
+ ORDER BY NOT FIND_IN_SET('always_displayed', e.flags), e.id, sn.name",
+ S::i('uid'));
+ $sn_old = array();
+ while ($old = $res->next()) {
+ $sn_old[$old['typeid']] = array('fullname' => $old['fullname'],
+ 'name' => $old['name'],
+ 'particle' => $old['particle'],
+ 'id' => $old['id']);
+ }
+ return $sn_old;
+}
+
+function set_alias_names(&$sn_new, $sn_old, $update_new = false, $new_alias = null)
+{
+ $has_new = false;
+ foreach ($sn_new as $typeid => $sn) {
+ if (isset($sn['pub'])) {
+ if (isset($sn_old[$typeid]) && ($sn_old[$typeid]['fullname'] == $sn['fullname'] && $update_new)) {
+ XDB::execute("UPDATE profile_name
+ SET particle = {?}, name = {?}, typeid = {?}
+ WHERE id = {?} AND pid = {?}",
+ $sn['particle'], $sn['name'], $typeid, $sn_old[$typeid]['id'], S::i('uid'));
+ unset($sn_old[$typeid]);
+ } elseif ($update_new
+ || (isset($sn_old[$typeid]) && $sn_old[$typeid]['fullname'] == $sn['fullname'])) {
+ XDB::execute("INSERT INTO profile_name (particle, name, typeid, pid)
+ VALUES ({?}, {?}, {?}, {?})",
+ $sn['particle'], $sn['name'], $typeid, S::i('uid'));
+ unset($sn_old[$typeid]);
+ } else {
+ $has_new = true;
+ }
+ } else {
+ if ($sn['fullname'] != '') {
+ XDB::execute("INSERT INTO profile_name (particle, name, typeid, pid)
+ VALUES ('', {?}, {?}, {?})",
+ $sn['fullname'], $typeid, S::i('uid'));
+ }
+ $i = 0;
+ while (isset($sn[$i])) {
+ XDB::execute("INSERT INTO profile_name (particle, name, typeid, pid)
+ VALUES ('', {?}, {?}, {?})",
+ $sn[$i], $typeid, S::i('uid'));
+ $i++;
+ }
+ }
+ }
+ if (count($sn_old) > 0) {
+ if (!$update_new) {
+ $has_new = true;
+ foreach ($sn_old as $typeid => $sn) {
+ XDB::execute("INSERT INTO profile_name (particle, name, typeid, pid)
+ VALUES ({?}, {?}, {?}, {?})",
+ $sn['particle'], $sn['name'], $typeid, S::i('uid'));
+ }
+ } else {
+ foreach ($sn_old as $typeid => $sn) {
+ XDB::execute("DELETE FROM profile_name
+ WHERE pid = {?} AND id = {?}",
+ S::i('uid'), $sn['id']);
+ }
+ }
+ }
+ if ($update_new) {
+ XDB::execute("DELETE FROM aliases
+ WHERE FIND_IN_SET('usage', flags) AND id = {?}",
+ S::i('uid'));
+ }
+ if ($new_alias) {
+ XDB::execute("INSERT INTO aliases (alias, type, flags, id)
+ VALUES ({?}, 'alias', 'usage', {?})",
+ $new_alias, S::i('uid'));
+ }
+ require_once('user.func.inc.php');
+ user_reindex(S::i('uid'));
+ return $has_new;
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
// {{{
global $prf_desc;
-$prf_desc = array('nom' => 'Son patronyme',
+$prf_desc = array('search_names' => 'L\'un de ses noms',
'freetext' => 'Le texte libre',
'mobile' => 'Son numéro de téléphone portable',
'nationalite' => 'Sa nationalité',
+ 'nationalite2' => 'Sa seconde nationalité',
+ 'nationalite3' => 'Sa troisième nationalité',
'nick' => 'Son surnom',
- 'web' => 'L\'adresse de son site web',
- 'appli1' => 'Son école d\'application',
- 'appli2' => 'Son école de post-application',
+ 'networking' => 'La liste de ses adresses de networking',
+ 'edus' => 'Ses formations',
'addresses' => 'Ses adresses',
'section' => 'Sa section sportive',
'binets' => 'La liste de ses binets',
'medals' => 'Ses décorations',
'cv' => 'Son Curriculum Vitae',
+ 'corps' => 'Son Corps d\'État',
'jobs' => 'Ses informations professionnelles',
'photo' => 'Sa photographie');
***************************************************************************/
-require_once('applis.func.inc.php');
function replace_ifset(&$var,$req) {
if (Env::has($req)){
switch ($val) {
case 'adr' : if (!($c['adr'] = diff_user_addresses($a[$val], $bvar, $view))) unset($c['adr']); break;
case 'adr_pro' : if (!($c['adr_pro'] = diff_user_pros($a[$val], $bvar, $view))) unset($c['adr_pro']); break;
- case 'mobile' : if (same_tel($a[$val], $bvar)) unset($c['mobile']); break;
+ case 'tels' : if (!($c['tels'] = diff_user_tels($a[$val], $bvar, $view))) unset($c['tels']); break;
}
}
}
}
- // don't modify mobile if you don't have the right
- if (isset($b['mobile_pub']) && !has_user_right($b['mobile_pub'], $view) && isset($c['mobile']))
- unset($c['mobile']);
- if (isset($b['web_pub']) && !has_user_right($b['web_pub'], $view) && isset($c['web']))
- unset($c['web']);
+ // don't modify freetext if you don't have the right
if (isset($b['freetext_pub']) && !has_user_right($b['freetext_pub'], $view) && isset($c['freetext']))
unset($c['freetext']);
if (!count($c))
}
function same_tel(&$a, &$b) {
- $numbera = preg_replace('/[^0-9]/', '', (string) $a);
- $numberb = preg_replace('/[^0-9]/', '', (string) $b);
+ $numbera = format_phone_number((string) $a);
+ $numberb = format_phone_number((string) $b);
return $numbera === $numberb;
}
function same_address(&$a, &$b) {
return
(same_field($a['adr1'],$b['adr1'])) &&
- (same_field($a['adr1'],$b['adr1'])) &&
- (same_field($a['adr1'],$b['adr1'])) &&
+ (same_field($a['adr2'],$b['adr2'])) &&
+ (same_field($a['adr3'],$b['adr3'])) &&
(same_field($a['postcode'],$b['postcode'])) &&
(same_field($a['city'],$b['city'])) &&
(same_field($a['countrytxt'],$b['countrytxt'])) &&
return $c;
}
-function diff_user_address($a, $b) {
- if (isset($b['pub']) && isset($a['pub']) && has_user_right($b['pub'], $a['pub']))
- $a['pub'] = $b['pub'];
- if (isset($b['tels'])) {
- $bvar = $b['tels'];
-
- $telids_b = array();
- foreach ($bvar as $i => $telb) $telids_b[$telb['telid']] = $i;
+function diff_user_tels(&$a, &$b)
+{
+ $c = $a;
+ $telids_b = array();
+ foreach ($b as $i => $telb) $telids_b[$telb['telid']] = $i;
- if (isset($a['tels']))
- $avar = $a['tels'];
- else
- $avar = array();
- $ctels = $avar;
- foreach ($avar as $j => $tela) {
- if (isset($tela['telid'])) {
- // if b has a tel with the same telid, compute diff
- if (isset($telids_b[$tela['telid']])) {
- if (!($ctels[$j] = diff_user_tel($tela, $varb[$telids_b[$tela['adrid']]])))
- unset($ctels[$j]);
- unset($telids_b[$tela['telid']]);
+ foreach ($a as $j => $tela) {
+ if (isset($tela['telid'])) {
+ // if b has a tel with the same telid, compute diff
+ if (isset($telids_b[$tela['telid']])) {
+ if (!($c[$j] = diff_user_tel($tela, $b[$telids_b[$tela['adrid']]]))) {
+ unset($c[$j]);
}
- } else {
- // try to find a match in b
- foreach ($bvar as $i => $telb) {
- if (same_tel($tela['tel'], $telb['tel'])) {
- $tela['telid'] = $telb['telid'];
- if (!($ctels[$j] = diff_user_tel($tela, $telb)))
- unset($ctels[$j]);
- unset($telids_b[$tela['telid']]);
- break;
+ unset($telids_b[$tela['telid']]);
+ }
+ } else {
+ // try to find a match in b
+ foreach ($b as $i => $telb) {
+ if (same_tel($tela['tel'], $telb['tel'])) {
+ $tela['telid'] = $telb['telid'];
+ if (!($c[$j] = diff_user_tel($tela, $telb))) {
+ unset($c[$j]);
}
+ unset($telids_b[$tela['telid']]);
+ break;
}
}
}
+ }
- foreach ($telids_b as $telidb => $i)
- $ctels[] = array('telid' => $telidb, 'remove' => 1);
+ foreach ($telids_b as $telidb => $i)
+ $c[] = array('telid' => $telidb, 'remove' => 1);
+ return $c;
+}
+
+function diff_user_address($a, $b) {
+ if (isset($b['pub']) && isset($a['pub']) && has_user_right($b['pub'], $a['pub']))
+ $a['pub'] = $b['pub'];
+ if (isset($b['tels'])) {
+ if (isset($a['tels'])) {
+ $avar = $a['tels'];
+ } else {
+ $avar = array();
+ }
+ $ctels = diff_user_tels($avar, $b['tels']);
if (!count($ctels)) {
$b['tels'] = $avar;
- } else
+ } else {
$a['tels'] = $ctels;
+ }
}
foreach ($a as $val => $avar) {
}
if (isset($b['adr_pub']) && isset($a['adr_pub']) && has_user_right($b['adr_pub'], $a['adr_pub']))
$a['adr_pub'] = $b['adr_pub'];
- if (isset($b['tel_pub']) && !has_user_right($b['tel_pub'], $view)) {
- unset($a['tel']);
- unset($a['fax']);
- unset($a['mobile']);
+ if (isset($b['tels'])) {
+ if (isset($a['tels']))
+ $avar = $a['tels'];
+ else
+ $avar = array();
+ $ctels = diff_user_tels($avar, $b['tels']);
+
+ if (!count($ctels)) {
+ $b['tels'] = $avar;
+ } else
+ $a['tels'] = $ctels;
}
- if (isset($b['tel_pub']) && isset($a['tel_pub']) && has_user_right($b['tel_pub'], $a['tel_pub']))
- $a['tel_pub'] = $b['tel_pub'];
if (isset($b['email_pub']) && !has_user_right($b['email_pub'], $view))
unset($a['email']);
if (isset($b['email_pub']) && isset($a['email_pub']) && has_user_right($b['email_pub'], $a['email_pub']))
return $c;
}
+function format_phone_number($tel)
+{
+ $tel = trim($tel);
+ if (substr($tel, 0, 3) === '(0)') {
+ $tel = '33' . $tel;
+ }
+ $tel = preg_replace('/\(0\)/', '', $tel);
+ $tel = preg_replace('/[^0-9]/', '', $tel);
+ if (substr($tel, 0, 2) === '00') {
+ $tel = substr($tel, 2);
+ } else if(substr($tel, 0, 1) === '0') {
+ $tel = '33' . substr($tel, 1);
+ }
+ return $tel;
+}
+
+function format_display_number($tel, &$error, $format = array('format'=>'','phoneprf'=>''))
+{
+ $error = false;
+ $ret = '';
+ $tel_length = strlen($tel);
+ if((!isset($format['phoneprf'])) || ($format['phoneprf'] == '')) {
+ $res = XDB::query("SELECT phonePrefix AS phoneprf, phoneFormat AS format
+ FROM geoloc_countries
+ WHERE phonePrefix = {?} OR phonePrefix = {?} OR phonePrefix = {?}
+ LIMIT 1",
+ substr($tel, 0, 1), substr($tel, 0, 2), substr($tel, 0, 3));
+ if ($res->numRows() == 0) {
+ $error = true;
+ return '+' . $tel;
+ }
+ $format = $res->fetchOneAssoc();
+ }
+ if ($format['format'] == '') {
+ $format['format'] = '+p';
+ }
+ $j = 0;
+ $i = strlen($format['phoneprf']);
+ $length_format = strlen($format['format']);
+ while (($i < $tel_length) && ($j < $length_format)){
+ if ($format['format'][$j] == '#'){
+ $ret .= $tel[$i];
+ $i++;
+ } else if ($format['format'][$j] == 'p') {
+ $ret .= $format['phoneprf'];
+ } else {
+ $ret .= $format['format'][$j];
+ }
+ $j++;
+ }
+ for (; $i < $tel_length - 1; $i += 2) {
+ $ret .= ' ' . substr($tel, $i, 2);
+ }
+ //appends last alone number to the last block
+ if ($i < $tel_length) {
+ $ret .= substr($tel, $i);
+ }
+ return $ret;
+}
+
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
?>
*/
function user_clear_all_subs($user_id, $really_del=true)
{
- // keep datas in : aliases, adresses, tels, applis_ins, binets_ins, contacts, groupesx_ins, homonymes, identification_ax, photo
+ // keep datas in : aliases, adresses, tels, profile_education, binets_ins, contacts, groupesx_ins, homonymes, identification_ax, photo
// delete in : auth_user_md5, auth_user_quick, competences_ins, emails, entreprises, langues_ins, mentor,
// mentor_pays, mentor_secteurs, newsletter_ins, perte_pass, requests, user_changes, virtual_redirect, watch_sub
// + delete maillists
$user = User::getSilent($uid);
list($alias) = explode('@', $user->forlifeEmail());
- $tables_to_clear = array('uid' => array('competences_ins', 'entreprises', 'langues_ins', 'mentor_pays',
- 'mentor_secteurs', 'mentor', 'perte_pass', 'watch_sub'),
+ $tables_to_clear = array('uid' => array('competences_ins', 'profile_job', 'langues_ins', 'profile_mentor_country',
+ 'profile_mentor_sector', 'profile_mentor', 'perte_pass', 'watch_sub'),
'user_id' => array('requests', 'user_changes'));
if ($really_del) {
- array_push($tables_to_clear['uid'], 'emails', 'groupex.membres', 'contacts', 'adresses', 'tels',
+ array_push($tables_to_clear['uid'], 'emails', 'groupex.membres', 'contacts', 'adresses', 'profile_phones',
'photo', 'perte_pass', 'langues_ins', 'forums.abos', 'forums.profils');
array_push($tables_to_clear['user_id'], 'newsletter_ins', 'auth_user_quick', 'binets_ins');
$tables_to_clear['id'] = array('aliases');
$tables_to_clear['contact'] = array('contacts');
XDB::execute("UPDATE auth_user_md5
SET date_ins = 0, promo_sortie = 0, nom_usage = '', password = '', perms = 'pending',
- nationalite = '', cv = '', section = 0, date = 0, smtppass = '', mail_storage = ''
+ nationalite = '', nationalite2 = '', nationalite3 = '', cv = '', section = 0,
+ date = 0, smtppass = '', mail_storage = ''
WHERE user_id = {?}", $uid);
XDB::execute("DELETE virtual.* FROM virtual INNER JOIN virtual_redirect AS r USING(vid) WHERE redirect = {?}",
$alias.'@'.$globals->mail->domain);
function get_user_details_pro($uid, $view = 'private')
{
- $sql = "SELECT e.entreprise, s.label as secteur , ss.label as sous_secteur , f.fonction_fr as fonction,
- e.poste, e.adr1, e.adr2, e.adr3, e.postcode, e.city, e.entrid,
- gp.pays AS countrytxt, gr.name AS region, e.tel, e.fax, e.mobile, e.entrid,
- e.pub, e.adr_pub, e.tel_pub, e.email, e.email_pub, e.web
- FROM entreprises AS e
- LEFT JOIN emploi_secteur AS s ON(e.secteur = s.id)
- LEFT JOIN emploi_ss_secteur AS ss ON(e.ss_secteur = ss.id AND e.secteur = ss.secteur)
- LEFT JOIN fonctions_def AS f ON(e.fonction = f.id)
- LEFT JOIN geoloc_pays AS gp ON (gp.a2 = e.country)
- LEFT JOIN geoloc_region AS gr ON (gr.a2 = e.country and gr.region = e.region)
- WHERE e.uid = {?}
- ORDER BY e.entrid";
+ $sql = "SELECT en.name AS entreprise, s.name as secteur, f.fonction_fr as fonction,
+ j.description AS poste, gp.pays AS countrytxt, gr.name AS region,
+ j.id AS entrid, j.pub, j.email, j.email_pub, j.url AS w_web, en.url AS web,
+ e.adr1, e.adr2, e.adr3, e.postcode, e.city, e.adr_pub
+ FROM profile_job AS j
+ LEFT JOIN entreprises AS e ON (e.entrid = j.id AND e.uid = j.uid)
+ LEFT JOIN profile_job_enum AS en ON (j.jobid = en.id)
+ LEFT JOIN profile_job_subsubsector_enum AS s ON (j.subsubsectorid = s.id)
+ LEFT JOIN fonctions_def AS f ON (j.functionid = f.id)
+ LEFT JOIN geoloc_pays AS gp ON (gp.a2 = e.country)
+ LEFT JOIN geoloc_region AS gr ON (gr.a2 = e.country AND gr.region = e.region)
+ WHERE j.uid = {?}
+ ORDER BY j.id";
$res = XDB::query($sql, $uid);
$all_pro = $res->fetchAllAssoc();
foreach ($all_pro as $i => $pro) {
$all_pro[$i]['region'] = '';
}
}
- if (!has_user_right($pro['tel_pub'], $view)) {
- // if no tel was defined, then the viewer will be able to write it
- if ($pro['tel'] == '' &&
- $pro['fax'] == '' &&
- $pro['mobile'] == '') {
- $all_pro[$i]['tel_pub'] = $view;
- } else {
- $all_pro[$i]['tel'] = '';
- $all_pro[$i]['fax'] = '';
- $all_pro[$i]['mobile'] = '';
+ $sql = "SELECT pub AS tel_pub, tel_type, display_tel AS tel, comment
+ FROM profile_phones AS t
+ WHERE uid = {?} AND link_type = 'pro' AND link_id = {?}
+ ORDER BY link_id, tel_type DESC, tel_id";
+ $restel = XDB::iterator($sql, $uid, $pro['entrid']);
+ while ($nexttel = $restel->next()) {
+ if (has_user_right($nexttel['tel_pub'], $view)) {
+ if (!isset($all_pro[$i]['tels'])) {
+ $all_pro[$i]['tels'] = array($nexttel);
+ } else {
+ $all_pro[$i]['tels'][] = $nexttel;
+ }
}
}
if (!has_user_right($pro['email_pub'], $view)) {
$all_pro[$i]['fonction'] == '' &&
$all_pro[$i]['secteur'] == '' &&
$all_pro[$i]['poste'] == '' &&
- $all_pro[$i]['tel'] == '' &&
- $all_pro[$i]['fax'] == '' &&
- $all_pro[$i]['mobile'] == '' &&
+ (!isset($all_pro[$i]['tels'])) &&
$all_pro[$i]['email'] == '')
unset($all_pro[$i]);
}
FIND_IN_SET('active', a.statut) AS active, a.adrid,
FIND_IN_SET('res-secondaire', a.statut) AS secondaire,
FIND_IN_SET('courrier', a.statut) AS courier,
- a.pub, gp.display
+ a.pub, gp.display, a.comment
FROM adresses AS a
LEFT JOIN geoloc_pays AS gp ON (gp.a2=a.country)
WHERE uid= {?} AND NOT FIND_IN_SET('pro',a.statut)
$adrid_index[$adr['adrid']] = $i;
}
- $sql = "SELECT t.adrid, t.tel_pub, t.tel_type, t.tel, t.telid
- FROM tels AS t
- INNER JOIN adresses AS a ON (a.uid = t.uid) AND (a.adrid = t.adrid)
- WHERE t.uid = {?} AND NOT FIND_IN_SET('pro',a.statut)
- ORDER BY t.adrid, t.tel_type DESC, t.telid";
+ $sql = "SELECT link_id AS adrid, pub AS tel_pub, tel_type, display_tel AS tel, tel_id AS telid, comment
+ FROM profile_phones AS t
+ WHERE uid = {?} AND link_type = 'address'
+ ORDER BY link_id, tel_type DESC, tel_id";
$restel = XDB::iterator($sql, $uid);
while ($nexttel = $restel->next()) {
if (has_user_right($nexttel['tel_pub'], $view)) {
function &get_user_details($login, $from_uid = '', $view = 'private')
{
- $reqsql = "SELECT u.user_id, u.promo, u.promo_sortie, u.prenom, u.nom, u.nom_usage, u.date, u.cv,
+ $reqsql = "SELECT u.user_id, d.promo, u.prenom, u.nom, u.nom_usage, u.date, u.cv,
u.perms IN ('admin','user','disabled') AS inscrit, FIND_IN_SET('femme', u.flags) AS sexe, u.deces != 0 AS dcd, u.deces,
- q.profile_nick AS nickname, q.profile_from_ax, q.profile_mobile AS mobile, q.profile_web AS web, q.profile_freetext AS freetext,
- q.profile_mobile_pub AS mobile_pub, q.profile_web_pub AS web_pub, q.profile_freetext_pub AS freetext_pub,
- q.profile_medals_pub AS medals_pub,
- IF(gp.nat='',gp.pays,gp.nat) AS nationalite, gp.a2 AS iso3166,
+ q.profile_nick AS nickname, q.profile_from_ax, q.profile_freetext AS freetext,
+ q.profile_freetext_pub AS freetext_pub,
+ q.profile_medals_pub AS medals_pub, co.corps_pub AS corps_pub,
+ IF(gp1.nat='',gp1.pays,gp1.nat) AS nationalite, gp1.a2 AS iso3166_1,
+ IF(gp2.nat='',gp2.pays,gp2.nat) AS nationalite2, gp2.a2 AS iso3166_2,
+ IF(gp3.nat='',gp3.pays,gp3.nat) AS nationalite3, gp3.a2 AS iso3166_3,
a.alias AS forlife, a2.alias AS bestalias,
c.uid IS NOT NULL AS is_contact,
s.text AS section, p.x, p.y, p.pub AS photo_pub,
u.matricule_ax,
m.expertise != '' AS is_referent,
- (COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif
- FROM auth_user_md5 AS u
- INNER JOIN auth_user_quick AS q USING(user_id)
- INNER JOIN aliases AS a ON (u.user_id=a.id AND a.type='a_vie')
- INNER JOIN aliases AS a2 ON (u.user_id=a2.id AND FIND_IN_SET('bestalias',a2.flags))
- LEFT JOIN contacts AS c ON (c.uid = {?} and c.contact = u.user_id)
- LEFT JOIN geoloc_pays AS gp ON (gp.a2 = u.nationalite)
- INNER JOIN sections AS s ON (s.id = u.section)
- LEFT JOIN photo AS p ON (p.uid = u.user_id)
- LEFT JOIN mentor AS m ON (m.uid = u.user_id)
- LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active')
+ (COUNT(e.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif,
+ d.public_name, d.private_name
+ FROM auth_user_md5 AS u
+ INNER JOIN auth_user_quick AS q USING(user_id)
+ INNER JOIN aliases AS a ON (u.user_id = a.id AND a.type = 'a_vie')
+ INNER JOIN aliases AS a2 ON (u.user_id = a2.id AND FIND_IN_SET('bestalias', a2.flags))
+ LEFT JOIN contacts AS c ON (c.uid = {?} and c.contact = u.user_id)
+ LEFT JOIN profile_corps AS co ON (co.uid = u.user_id)
+ LEFT JOIN geoloc_pays AS gp1 ON (gp1.a2 = u.nationalite)
+ LEFT JOIN geoloc_pays AS gp2 ON (gp2.a2 = u.nationalite2)
+ LEFT JOIN geoloc_pays AS gp3 ON (gp3.a2 = u.nationalite3)
+ INNER JOIN sections AS s ON (s.id = u.section)
+ LEFT JOIN photo AS p ON (p.uid = u.user_id)
+ LEFT JOIN profile_mentor AS m ON (m.uid = u.user_id)
+ LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags='active')
+ INNER JOIN profile_display AS d ON (d.pid = u.user_id)
WHERE a.alias = {?}
GROUP BY u.user_id";
$res = XDB::query($reqsql, $from_uid, $login);
$uid = $user['user_id'];
// hide orange status, cv, nickname, section
if (!has_user_right('private', $view)) {
- $user['promo_sortie'] = $user['promo'] + 3;
$user['cv'] = '';
$user['nickname'] = '';
$user['section'] = '';
}
- // hide mobile
- if (!has_user_right($user['mobile_pub'], $view)) {
- if ($user['mobile'] == '')
- $user['mobile_pub'] = $view;
- else
- $user['mobile'] = '';
- }
- // hide web
- if (!has_user_right($user['web_pub'], $view)) {
- if ($user['web'] == '')
- $user['web_pub'] = $view;
- else
- $user['web'] = '';
- }
+
// hide freetext
if (!has_user_right($user['freetext_pub'], $view)) {
if ($user['freetext'] == '')
$user['freetext'] = '';
}
+ $sql = "SELECT pub AS tel_pub, tel_type, display_tel AS tel, comment
+ FROM profile_phones AS t
+ WHERE uid = {?} AND link_type = 'user'
+ ORDER BY tel_type DESC, tel_id";
+ $restel = XDB::iterator($sql, $uid);
+ while ($nexttel = $restel->next()) {
+ if (has_user_right($nexttel['tel_pub'], $view)) {
+ if (!isset($user['tels'])) {
+ $user['tels'] = array($nexttel);
+ } else {
+ $user['tels'][] = $nexttel;
+ }
+ }
+ }
+
$user['adr_pro'] = get_user_details_pro($uid, $view);
$user['adr'] = get_user_details_adr($uid, $view);
$user['gpxs_join'] = join(', ', $user['gpxs']);
}
- $res = XDB::iterRow("SELECT applis_def.text, applis_def.url, applis_ins.type
- FROM applis_ins
- INNER JOIN applis_def ON applis_def.id = applis_ins.aid
- WHERE uid={?}
- ORDER BY ordre", $uid);
-
- $user['applis_fmt'] = Array();
- $user['formation'] = Array();
- while (list($txt, $url, $type) = $res->next()) {
- $user['formation'][] = $txt." ".$type;
- require_once('applis.func.inc.php');
- $user['applis_fmt'][] = applis_fmt($type, $txt, $url);
+ $res = XDB::iterRow("SELECT en.name AS name, en.url AS url, d.degree AS degree,
+ ed.grad_year AS grad_year, f.field AS field, ed.program AS program
+ FROM profile_education AS ed
+ LEFT JOIN profile_education_enum AS en ON (en.id = ed.eduid)
+ LEFT JOIN profile_education_degree_enum AS d ON (d.id = ed.degreeid)
+ LEFT JOIN profile_education_field_enum AS f ON (f.id = ed.fieldid)
+ WHERE uid = {?} AND NOT FIND_IN_SET('primary', flags)
+ ORDER BY ed.grad_year", $uid);
+
+ if (list($name, $url, $degree, $grad_year, $field, $program) = $res->next()) {
+ require_once('education.func.inc.php');
+ $user['education'][] = education_fmt($name, $url, $degree, $grad_year, $field, $program, $user['sexe'], true);
+ }
+ while (list($name, $url, $degree, $grad_year, $field, $program) = $res->next()) {
+ $user['education'][] = education_fmt($name, $url, $degree, $grad_year, $field, $program, $user['sexe'], true);
+ }
+
+ if (has_user_right($user['corps_pub'], $view)) {
+ $res = XDB::query("SELECT e1.name AS original, e2.name AS current, r.name AS rank
+ FROM profile_corps AS c
+ LEFT JOIN profile_corps_enum AS e1 ON (c.original_corpsid = e1.id)
+ LEFT JOIN profile_corps_enum AS e2 ON (c.current_corpsid = e2.id)
+ LEFT JOIN profile_corps_rank_enum AS r ON (c.rankid = r.id)
+ WHERE c.uid = {?} AND c.original_corpsid != 1", $uid);
+ if ($res = $res->fetchOneRow()) {
+ list($original, $current, $rank) = $res;
+ $user['corps'] = "Corps d'origine : " . $original . ", corps actuel : " . $current . ", grade : " . $rank;
+ }
}
- $user['applis_join'] = join(', ', $user['applis_fmt']);
if (has_user_right($user['medals_pub'], $view)) {
$res = XDB::iterator("SELECT m.id, m.text AS medal, m.type, s.gid, g.text AS grade
}
}
+ $user['networking'] = Array();
+ $res = XDB::iterator("SELECT n.address, n.pub, m.network_type AS type, m.name, m.filter, m.link
+ FROM profile_networking AS n
+ INNER JOIN profile_networking_enum AS m ON (n.network_type = m.network_type)
+ WHERE n.uid = {?}", $uid);
+ while($network = $res->next())
+ {
+ if (has_user_right($network['pub'], $view)) {
+ $network['link'] = str_replace('%s', $network['address'], $network['link']);
+ $user['networking'][] = $network;
+ }
+ }
+
return $user;
}
// }}}
if (isset($adr['tels']) && is_array($adr['tels'])) {
$telid = 0;
foreach ($adr['tels'] as $tel) if ($tel['tel']) {
- add_user_tel($uid, $adrid, $telid, $tel);
+ add_user_tel($uid, 'address', $adrid, $telid, $tel);
$telid ++;
}
}
$adr['adr1'], $adr['adr2'], $adr['adr3'],
$adr['postcode'], $adr['city'], $adr['pub'], $adrid, $uid);
if (isset($adr['tels']) && is_array($adr['tels'])) {
- $res = XDB::query("SELECT telid FROM tels WHERE uid = {?} AND adrid = {?} ORDER BY telid", $uid, $adrid);
+ $res = XDB::query("SELECT tel_id FROM profile_phones WHERE uid = {?} AND link_type = 'address' AND link_id = {?} ORDER BY tel_id", $uid, $adrid);
$telids = $res->fetchColumn();
foreach ($adr['tels'] as $tel) {
if (isset($tel['telid']) && isset($tel['remove']) && $tel['remove']) {
- remove_user_tel($uid, $adrid, $tel['telid']);
+ remove_user_tel($uid, 'address', $adrid, $tel['telid']);
if (isset($telids[$tel['telid']])) unset($telids[$tel['telid']]);
} else if (isset($tel['telid'])) {
- update_user_tel($uid, $adrid, $tel['telid'], $tel);
+ update_user_tel($uid, 'address', $adrid, $tel['telid'], $tel);
} else {
for ($telid = 0; isset($telids[$telid]) && ($telids[$telid] == $telid); $telid++);
- add_user_tel($uid, $adrid, $telid, $tel);
+ add_user_tel($uid, 'address', $adrid, $telid, $tel);
}
}
}
// {{{ function remove_user_address()
function remove_user_address($uid, $adrid) {
XDB::execute("DELETE FROM adresses WHERE adrid = {?} AND uid = {?}", $adrid, $uid);
- XDB::execute("DELETE FROM tels WHERE adrid = {?} AND uid = {?}", $adrid, $uid);
+ XDB::execute("DELETE FROM profile_phones WHERE link_id = {?} AND uid = {?} AND link_type = 'address'", $adrid, $uid);
}
// }}}
// {{{ function add_user_tel()
-function add_user_tel($uid, $adrid, $telid, $tel) {
- XDB::execute(
- "INSERT INTO tels SET uid = {?}, adrid = {?}, telid = {?}, tel = {?}, tel_type = {?}, tel_pub = {?}",
- $uid, $adrid, $telid, $tel['tel'], $tel['tel_type'], $tel['tel_pub']);
+function add_user_tel($uid, $link_type, $link_id, $telid, $tel) {
+ require('profil.func.inc.php');
+ $fmt_phone = format_phone_number($tel['tel']);
+ $disp_phone = format_display_number($fmt_phone, $error);
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type, search_tel, display_tel, pub)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
+ $uid, $link_type, $link_id, $telid, $tel['tel_type'], $fmt_phone, $disp_phone, $tel['tel_pub']);
}
// }}}
// {{{ function update_user_tel()
-function update_user_tel($uid, $adrid, $telid, $tel) {
- XDB::execute(
- "UPDATE tels SET tel = {?}, tel_type = {?}, tel_pub = {?}
- WHERE telid = {?} AND adrid = {?} AND uid = {?}",
- $tel['tel'], $tel['tel_type'], $tel['tel_pub'],
- $telid, $adrid, $uid);
+function update_user_tel($uid, $link_type, $link_id, $telid, $tel) {
+ require('profil.func.inc.php');
+ $fmt_phone = format_phone_number($tel['tel']);
+ $disp_phone = format_display_number($fmt_phone, $error);
+ XDB::execute("UPDATE profile_phones SET search_tel = {?}, display_tel = {?}, tel_type = {?}, pub = {?}
+ WHERE link_type = {?} AND tel_id = {?} AND link_id = {?} AND uid = {?}",
+ $fmt_phone, $disp_phone, $tel['tel_type'], $tel['tel_pub'],
+ $link_type, $telid, $link_id, $uid);
}
// }}}
// {{{ function remove_user_tel()
-function remove_user_tel($uid, $adrid, $telid) {
- XDB::execute("DELETE FROM tels WHERE telid = {?} AND adrid = {?} AND uid = {?}",
- $telid, $adrid, $uid);
+function remove_user_tel($uid, $link_type, $link_id, $telid) {
+ XDB::execute("DELETE FROM profile_phones WHERE tel_id = {?} AND link_id = {?} AND uid = {?} AND link_type = {?}",
+ $telid, $link_id, $uid, $link_type);
}
// }}}
// {{{ function add_user_pro()
function add_user_pro($uid, $entrid, $pro) {
XDB::execute(
"INSERT INTO entreprises (`uid`, `entrid`, `entreprise`, `poste`, `secteur`, `ss_secteur`, `fonction`,
- `adr1`, `adr2`, `adr3`, `postcode`, `city`, `country`, `region`, `tel`, `fax`, `mobile`, `email`, `web`, `pub`, `adr_pub`, `tel_pub`, `email_pub`)
+ `adr1`, `adr2`, `adr3`, `postcode`, `city`, `country`, `region`, `email`, `web`, `pub`, `adr_pub`, `email_pub`)
SELECT u.user_id, {?}, {?}, {?}, s.id, ss.id, f.id,
{?}, {?}, {?}, {?}, {?}, gp.a2, gr.region, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}
FROM auth_user_md5 AS u
WHERE u.user_id = {?}
LIMIT 1",
$entrid, $pro['entreprise'], $pro['poste'],
- $pro['adr1'], $pro['adr2'], $pro['adr3'], $pro['postcode'], $pro['city'], $pro['tel'], $pro['fax'], $pro['mobile'], $pro['email'], $pro['web'], $pro['pub'], $pro['adr_pub'], $pro['tel_pub'], $pro['email_pub'],
+ $pro['adr1'], $pro['adr2'], $pro['adr3'], $pro['postcode'], $pro['city'], $pro['email'], $pro['web'], $pro['pub'], $pro['adr_pub'], $pro['email_pub'],
$pro['secteur'], $pro['sous_secteur'], $pro['fonction'], $pro['fonction'],
$pro['countrytxt'], $pro['countrytxt'], $pro['region'],
$uid);
+ if (isset($pro['tels']) && is_array($pro['tels'])) {
+ $telid = 0;
+ foreach ($pro['tels'] as $tel) {
+ if ($pro['tel']) {
+ add_user_tel($uid, 'pro', $entrid, $telid, $tel);
+ $telid ++;
+ }
+ }
+ }
}
// }}}
// {{{ function update_user_pro()
$args_set[] = $pro['adr_pub'];
}
- if (isset($pro['tel'])) {
- $set .= ", e.`tel` = {?}, e.`fax` = {?}, e.`mobile` = {?}, e.tel_pub = {?}";
- $args_set[] = $pro['tel'];
- $args_set[] = $pro['fax'];
- $args_set[] = $pro['mobile'];
- $args_set[] = $pro['tel_pub'];
- }
if (isset($pro['email'])) {
$set .= ", e.`email` = {?}, e.`email_pub` = {?}";
$args_set[] = $pro['email'];
$args_where = array($uid, $entrid);
$args = array_merge(array($query), $args_join, $args_set, $args_where);
call_user_func_array(array('XDB', 'execute'), $args);
+
+
+ if (isset($pro['tels']) && is_array($pro['tels'])) {
+ $res = XDB::query("SELECT tel_id FROM profile_phones WHERE uid = {?} AND link_type = 'pro' AND link_id = {?} ORDER BY tel_id", $uid, $entrid);
+ $telids = $res->fetchColumn();
+ foreach ($pro['tels'] as $tel) {
+ if (isset($tel['telid']) && isset($tel['remove']) && $tel['remove']) {
+ remove_user_tel($uid, 'pro', $entrid, $tel['telid']);
+ if (isset($telids[$tel['telid']])) unset($telids[$tel['telid']]);
+ } else if (isset($tel['telid'])) {
+ update_user_tel($uid, 'pro', $entrid, $tel['telid'], $tel);
+ } else {
+ for ($telid = 0; isset($telids[$telid]) && ($telids[$telid] == $telid); $telid++);
+ add_user_tel($uid, 'pro', $entrid, $telid, $tel);
+ }
+ }
+ }
}
// }}}
// {{{ function remove_user_pro()
function remove_user_pro($uid, $entrid) {
XDB::execute("DELETE FROM entreprises WHERE entrid = {?} AND uid = {?}", $entrid, $uid);
+ XDB::execute("DELETE FROM profile_phones WHERE link_id = {?} AND uid = {?} AND link_type = 'pro'", $entrid, $uid);
}
// }}}
-// {{{ function set_user_details()
+// {{{ function set_user_details_addresses()
function set_user_details_addresses($uid, $adrs) {
$req = XDB::query('SELECT MAX(adrid) + 1
FROM adresses
if (isset($details['nom_usage'])) {
XDB::execute("UPDATE auth_user_md5 SET nom_usage = {?} WHERE user_id = {?}", strtoupper($details['nom_usage']), $uid);
}
- if (isset($details['mobile'])) {
- XDB::execute("UPDATE auth_user_quick SET profile_mobile = {?} WHERE user_id = {?}", $details['mobile'], $uid);
- }
if (isset($details['nationalite'])) {
XDB::execute(
"UPDATE auth_user_md5 AS u
$uid, $groupex);
}
}
- // applis
+ if (isset($details['tels']) && is_array($details['tels'])) {
+ $res = XDB::query("SELECT tel_id FROM profile_phones WHERE uid = {?} AND link_type = 'user' ORDER BY tel_id", $uid);
+ $telids = $res->fetchColumn();
+ foreach ($details['tels'] as $tel) {
+ if (isset($tel['telid']) && isset($tel['remove']) && $tel['remove']) {
+ remove_user_tel($uid, 'user', 0, $tel['telid']);
+ if (isset($telids[$tel['telid']])) unset($telids[$tel['telid']]);
+ } else if (isset($tel['telid'])) {
+ update_user_tel($uid, 'user', 0, $tel['telid'], $tel);
+ } else {
+ for ($telid = 0; isset($telids[$telid]) && ($telids[$telid] == $telid); $telid++);
+ add_user_tel($uid, 'user', 0, $telid, $tel);
+ }
+ }
+ }
+
+ // education
// medals
}
// }}}
// {{{ function _user_reindex
-function _user_reindex($uid, $keys, $muls, $pubs)
+function _user_reindex($uid, $keys)
{
foreach ($keys as $i => $key) {
- if ($key == '') {
+ if ($key['name'] == '') {
continue;
}
- $toks = preg_split('/[ \'\-]+/', $key);
+ $toks = preg_split('/[ \'\-]+/', $key['name']);
$token = "";
$first = 5;
while ($toks) {
$token = strtolower(replace_accent(array_pop($toks) . $token));
- $score = ($toks ? 0 : 10 + $first) * $muls[$i];
+ $score = ($toks ? 0 : 10 + $first) * ($key['score'] / 10);
XDB::execute("REPLACE INTO search_name (token, uid, soundex, score, flags)
VALUES ({?}, {?}, {?}, {?}, {?})",
- $token, $uid, soundex_fr($token), $score, $pubs[$i] ? 'public' : '');
+ $token, $uid, soundex_fr($token), $score, $key['public']);
$first = 0;
}
}
- $res = XDB::query("SELECT nom_ini, nom, nom_usage, prenom_ini, prenom, promo, matricule
- FROM auth_user_md5
- WHERE user_id = {?}", $uid);
- if (!$res->numRows()) {
- unset($res);
- return;
- }
- $array = $res->fetchOneRow();
- $promo = intval(array_pop($array));
- $mat = array_shift($array);
- array_walk($array, 'soundex_fr');
- XDB::execute("REPLACE INTO recherche_soundex
- SET matricule = {?}, nom1_soundex = {?}, nom2_soundex= {?}, nom3_soundex = {?},
- prenom1_soundex = {?}, prenom2_soundex= {?}, promo = {?}",
- $mat, $array[0], $array[1], $array[2], $array[3], $array[4], $promo);
- unset($res);
- unset($array);
}
// }}}
// {{{ function user_reindex
function user_reindex($uid) {
- XDB::execute("DELETE FROM search_name WHERE uid={?}", $uid);
- $res = XDB::query("SELECT prenom, nom, nom_usage, profile_nick FROM auth_user_md5 INNER JOIN auth_user_quick USING(user_id) WHERE auth_user_md5.user_id = {?}", $uid);
- if ($res->numRows()) {
- _user_reindex($uid, $res->fetchOneRow(), array(1,1,1,0.2), array(true, true, true, false));
- } else { // not in auth_user_quick => still "pending"
- $res = XDB::query("SELECT prenom, nom, nom_usage FROM auth_user_md5 WHERE auth_user_md5.user_id = {?}", $uid);
- if ($res->numRows()) {
- _user_reindex($uid, $res->fetchOneRow(), array(1,1,1), array(true, true, true));
- }
- }
+ XDB::execute("DELETE FROM search_name
+ WHERE uid = {?}",
+ $uid);
+ $res = XDB::iterator("SELECT CONCAT(n.particle, n.name) AS name, e.score,
+ FIND_IN_SET('public', e.flags) AS public
+ FROM profile_name AS n
+ INNER JOIN profile_name_enum AS e ON (n.typeid = e.id)
+ WHERE n.pid = {?}",
+ $uid);
+ _user_reindex($uid, $res);
}
// }}}
global $globals;
-@$globals->search->result_where_statement = '
- LEFT JOIN applis_ins AS ai0 ON (u.user_id = ai0.uid AND ai0.ordre = 0)
- LEFT JOIN applis_def AS ad0 ON (ad0.id = ai0.aid)
- LEFT JOIN applis_ins AS ai1 ON (u.user_id = ai1.uid AND ai1.ordre = 1)
- LEFT JOIN applis_def AS ad1 ON (ad1.id = ai1.aid)
- LEFT JOIN entreprises AS e ON (e.entrid = 0 AND e.uid = u.user_id)
- LEFT JOIN emploi_secteur AS es ON (e.secteur = es.id)
- LEFT JOIN fonctions_def AS ef ON (e.fonction = ef.id)
- LEFT JOIN geoloc_pays AS n ON (u.nationalite = n.a2)
- LEFT JOIN adresses AS adr ON (u.user_id = adr.uid AND FIND_IN_SET(\'active\',adr.statut))
- LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
- LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
- LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = \'active\')';
+@$globals->search->result_where_statement = "
+ LEFT JOIN profile_education AS edu ON (u.user_id = edu.uid)
+ LEFT JOIN profile_education_enum AS ede ON (ede.id = edu.eduid)
+ LEFT JOIN profile_job AS j ON (j.id = 0 AND j.uid = u.user_id)
+ LEFT JOIN profile_job_enum AS je ON (je.id = j.jobid)
+ LEFT JOIN profile_job_sector_enum AS es ON (j.sectorid = es.id)
+ LEFT JOIN fonctions_def AS ef ON (j.functionid = ef.id)
+ LEFT JOIN geoloc_countries AS n1 ON (u.nationalite = n1.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n2 ON (u.nationalite2 = n2.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n3 ON (u.nationalite2 = n3.iso_3166_1_a2)
+ LEFT JOIN profile_addresses AS adr ON (u.user_id = adr.pid
+ AND FIND_IN_SET('current', adr.flags))
+ LEFT JOIN geoloc_countries AS gc ON (adr.countryId = gc.iso_3166_1_a2)
+ LEFT JOIN geoloc_administrativeareas AS gr ON (adr.countryId = gr.country
+ AND adr.administrativeAreaId = gr.id)
+ LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')";
class UserSet extends PlSet
{
{
public function __construct(PlSet &$set, $data, array $params)
{
- require_once 'applis.func.inc.php';
+ require_once 'education.func.inc.php';
global $globals;
$this->entriesPerPage = $globals->search->per_page;
if (@$params['with_score']) {
- $this->addSortKey('score', array('-score', '-date', '-promo', 'nom', 'prenom'), 'pertinence');
+ $this->addSortKey('score', array('-score', '-date', '-d.promo', 'sort_name'), 'pertinence');
}
- $this->addSortKey('name', array('nom', 'prenom'), 'nom');
- $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
- $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
+ $this->addSortKey('name', array('sort_name'), 'nom');
+ $this->addSortKey('promo', array('-d.promo', 'sort_name'), 'promotion');
+ $this->addSortKey('date_mod', array('-date', '-d.promo', 'sort_name'), 'dernière modification');
parent::__construct($set, $data, $params);
}
public function fields()
{
global $globals;
- return "u.user_id AS id, u.*,
+ return "u.user_id AS id, u.*, d.promo,
CONCAT(a.alias, '@{$globals->mail->domain}') AS bestemail,
u.perms != 'pending' AS inscrit,
u.perms != 'pending' AS wasinscrit,
u.deces != 0 AS dcd, u.deces, u.matricule_ax,
FIND_IN_SET('femme', u.flags) AS sexe,
- e.entreprise, e.web AS job_web, es.label AS secteur, ef.fonction_fr AS fonction,
- IF(n.nat='',n.pays,n.nat) AS nat, n.a2 AS iso3166,
- ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
- ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
- adr.city, gp.a2, gp.pays AS countrytxt, gr.name AS region,
- IF(u.nom_usage<>'',u.nom_usage,u.nom) AS sortkey,
- (COUNT(em.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif" .
+ je.name AS entreprise, je.url AS job_web, es.name AS sector, ef.fonction_fr AS fonction,
+ IF(n1.nat = '', n1.countryFR, n1.nat) AS nat1, n1.iso_3166_1_a2 AS iso3166_1,
+ IF(n2.nat = '', n2.countryFR, n2.nat) AS nat2, n2.iso_3166_1_a2 AS iso3166_2,
+ IF(n3.nat = '', n3.countryFR, n3.nat) AS nat3, n3.iso_3166_1_a2 AS iso3166_3,
+ IF(ede0.abbreviation = '', ede0.name, ede0.abbreviation) AS eduname0, ede0.url AS eduurl0,
+ IF(edd0.abbreviation = '', edd0.degree, edd0.abbreviation) AS edudegree0,
+ edu0.grad_year AS edugrad_year0, f0.field AS edufield0, edu0.program AS eduprogram0,
+ IF(ede1.abbreviation = '', ede1.name, ede1.abbreviation) AS eduname1, ede1.url AS eduurl1,
+ IF(edd1.abbreviation = '', edd1.degree, edd1.abbreviation) AS edudegree1,
+ edu1.grad_year AS edugrad_year1, f1.field AS edufield1, edu1.program AS eduprogram1,
+ IF(ede2.abbreviation = '', ede2.name, ede2.abbreviation) AS eduname2, ede2.url AS eduurl2,
+ IF(edd2.abbreviation = '', edd2.degree, edd2.abbreviation) AS edudegree2,
+ edu2.grad_year AS edugrad_year2, f2.field AS edufield2, edu2.program AS eduprogram2,
+ IF(ede3.abbreviation = '', ede3.name, ede3.abbreviation) AS eduname3, ede3.url AS eduurl3,
+ IF(edd3.abbreviation = '', edd3.degree, edd3.abbreviation) AS edudegree3,
+ edu3.grad_year AS edugrad_year3, f3.field AS edufield3, edu3.program AS eduprogram3,
+ "// adr.localityId, gr.name AS region
+ . "gc.iso_3166_1_a2, gc.countryFR AS countrytxt
+ (COUNT(em.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif,
+ d.directory_name, d.sort_name" .
(S::logged() ? ", c.contact AS contact" : '');
}
public function joins()
{
- return "LEFT JOIN entreprises AS e ON (e.entrid = 0 AND e.uid = u.user_id".(S::logged() ? "" : " AND e.pub = 'public'").")
- LEFT JOIN emploi_secteur AS es ON (e.secteur = es.id)
- LEFT JOIN fonctions_def AS ef ON (e.fonction = ef.id)
- LEFT JOIN geoloc_pays AS n ON (u.nationalite = n.a2)
- LEFT JOIN applis_ins AS ai0 ON (u.user_id = ai0.uid AND ai0.ordre = 0)
- LEFT JOIN applis_def AS ad0 ON (ad0.id = ai0.aid)
- LEFT JOIN applis_ins AS ai1 ON (u.user_id = ai1.uid AND ai1.ordre = 1)
- LEFT JOIN applis_def AS ad1 ON (ad1.id = ai1.aid)
- LEFT JOIN adresses AS adr ON (u.user_id = adr.uid
- AND FIND_IN_SET('active', adr.statut)".(S::logged() ? "" : " AND adr.pub = 'public'").")
- LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
- LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
- LEFT JOIN aliases AS a ON (a.id = u.user_id AND FIND_IN_SET('bestalias', a.flags))
- LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')" .
- (S::logged() ?
- "LEFT JOIN contacts AS c On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
+ return "LEFT JOIN aliases AS a ON (u.user_id = a.id AND FIND_IN_SET('bestalias', a.flags))
+ LEFT JOIN search_name AS n ON (u.user_id = n.uid)
+ LEFT JOIN profile_job AS j ON (j.uid = u.user_id".(S::logged() ? "" : " AND j.pub = 'public'").")
+ LEFT JOIN profile_job_enum AS je ON (je.id = j.jobid)
+ LEFT JOIN profile_job_sector_enum AS es ON (j.sectorid = es.id)
+ LEFT JOIN fonctions_def AS ef ON (j.functionid = ef.id)
+ LEFT JOIN geoloc_countries AS n1 ON (u.nationalite = n1.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n2 ON (u.nationalite2 = n2.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n3 ON (u.nationalite3 = n3.iso_3166_1_a2)
+ LEFT JOIN profile_education AS edu0 ON (u.user_id = edu0.uid AND edu0.id = 0)
+ LEFT JOIN profile_education_enum AS ede0 ON (ede0.id = edu0.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd0 ON (edd0.id = edu0.degreeid)
+ LEFT JOIN profile_education_field_enum AS f0 ON (f0.id = edu0.fieldid)
+ LEFT JOIN profile_education AS edu1 ON (u.user_id = edu1.uid AND edu1.id = 1)
+ LEFT JOIN profile_education_enum AS ede1 ON (ede1.id = edu1.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd1 ON (edd1.id = edu1.degreeid)
+ LEFT JOIN profile_education_field_enum AS f1 ON (f1.id = edu1.fieldid)
+ LEFT JOIN profile_education AS edu2 ON (u.user_id = edu2.uid AND edu2.id = 2)
+ LEFT JOIN profile_education_enum AS ede2 ON (ede2.id = edu2.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd2 ON (edd2.id = edu2.degreeid)
+ LEFT JOIN profile_education_field_enum AS f2 ON (f2.id = edu2.fieldid)
+ LEFT JOIN profile_education AS edu3 ON (u.user_id = edu3.uid AND edu3.id = 3)
+ LEFT JOIN profile_education_enum AS ede3 ON (ede3.id = edu3.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd3 ON (edd3.id = edu3.degreeid)
+ LEFT JOIN profile_education_field_enum AS f3 ON (f3.id = edu3.fieldid)
+ LEFT JOIN profile_addresses AS adr ON (u.user_id = adr.pid
+ AND FIND_IN_SET('current', adr.flags)"
+ . (S::logged() ? "" :
+ "AND adr.pub = 'public'") . ")
+ LEFT JOIN geoloc_countries AS gc ON (adr.countryId = gc.iso_3166_a2)
+ LEFT JOIN geoloc_administrativeareas AS gr ON (adr.countryId = gr.country
+ AND adr.administrativeAreaId = gr.id)
+ LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')
+ INNER JOIN profile_display AS d ON (d.pid = u.user_id)" . (S::logged() ?
+ "LEFT JOIN contacts AS c ON (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
: "");
}
{
$this->entriesPerPage = 10;
$this->addSortKey('rand', array('RAND(' . S::i('uid') . ')'), 'aléatoirement');
- $this->addSortKey('name', array('nom', 'prenom'), 'nom');
- $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
- $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
+ $this->addSortKey('name', array('sort_name'), 'nom');
+ $this->addSortKey('promo', array('-d.promo', 'sort_name'), 'promotion');
+ $this->addSortKey('date_mod', array('-date', '-d.promo', 'sort_name'), 'dernière modification');
parent::__construct($set, $data, $params);
}
public function fields()
{
- return "m.uid, u.prenom, u.nom, u.promo, u.hruid,
- m.expertise, mp.pid, ms.secteur, ms.ss_secteur";
+ return "m.uid, d.promo, u.hruid,
+ m.expertise, mp.country, ms.sectorid, ms.subsectorid,
+ d.directory_name, d.sort_name";
+ }
+
+ public function joins()
+ {
+ return "INNER JOIN profile_display AS d ON (d.pid = u.user_id)";
}
public function bounds()
public function __construct(PlSet &$set, $data, array $params)
{
$this->entriesPerPage = 24;
- $this->order = explode(',', Env::v('order', 'nom,prenom,promo'));
+ $this->order = explode(',', Env::v('order', 'sort_name'));
if (@$params['with_score']) {
- $this->addSortKey('score', array('-score', '-watch_last', '-promo', 'nom', 'prenom'), 'pertinence');
+ $this->addSortKey('score', array('-score', '-watch_last', '-d.promo', 'sort_name'), 'pertinence');
}
- $this->addSortKey('name', array('nom', 'prenom'), 'nom');
- $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
+ $this->addSortKey('name', array('sort_name'), 'nom');
+ $this->addSortKey('promo', array('-d.promo', 'sort_name'), 'promotion');
parent::__construct($set, $data, $params);
}
public function fields()
{
- return "u.user_id, IF(u.nom_usage != '', u.nom_usage, u.nom) AS nom, u.prenom, u.promo, u.hruid ";
+ return "u.user_id, d.directory_name, d.sort_name, u.promo, d.promo, u.hruid ";
}
public function joins()
{
- return "INNER JOIN photo AS p ON (p.uid = u.user_id) ";
+ return "INNER JOIN photo AS p ON (p.uid = u.user_id)
+ INNER JOIN profile_display AS d ON (d.pid = u.user_id)";
}
public function bounds()
}
}
-class GeolocView implements PlView
-{
- private $set;
- private $type;
- private $params;
-
- public function __construct(PlSet &$set, $data, array $params)
- {
- $this->params = $params;
- $this->set =& $set;
- $this->type = $data;
- }
-
- private function use_map()
- {
- return is_file(dirname(__FILE__) . '/../modules/geoloc/dynamap.swf') &&
- is_file(dirname(__FILE__) . '/../modules/geoloc/icon.swf');
- }
-
- public function args()
- {
- $args = $this->set->args();
- unset($args['initfile']);
- unset($args['mapid']);
- return $args;
- }
-
- public function apply(PlPage &$page)
- {
- require_once 'geoloc.inc.php';
- require_once '../modules/search/search.inc.php';
-
- switch ($this->type) {
- case 'icon.swf':
- header("Content-type: application/x-shockwave-flash");
- header("Pragma:");
- readfile(dirname(__FILE__).'/../modules/geoloc/icon.swf');
- exit;
-
- case 'dynamap.swf':
- header("Content-type: application/x-shockwave-flash");
- header("Pragma:");
- readfile(dirname(__FILE__).'/../modules/geoloc/dynamap.swf');
- exit;
-
- case 'init':
- $page->changeTpl('geoloc/init.tpl', NO_SKIN);
- header('Content-Type: text/xml');
- header('Pragma:');
- if (!empty($GLOBALS['IS_XNET_SITE'])) {
- $page->assign('background', 0xF2E9D0);
- }
- break;
-
- case 'city':
- $page->changeTpl('geoloc/city.tpl', NO_SKIN);
- header('Content-Type: text/xml');
- header('Pragma:');
- $only_current = Env::v('only_current', false)? ' AND FIND_IN_SET(\'active\', adrf.statut)' : '';
- $it =& $this->set->get('u.user_id AS id, u.prenom, u.nom, u.promo, al.alias',
- "INNER JOIN adresses AS adrf ON (adrf.uid = u.user_id $only_current)
- LEFT JOIN aliases AS al ON (u.user_id = al.id
- AND FIND_IN_SET('bestalias', al.flags))
- INNER JOIN adresses AS avg ON (" . getadr_join('avg') . ")",
- 'adrf.cityid = ' . Env::i('cityid'), null, null, 11);
- $page->assign('users', $it);
- break;
-
- case 'country':
- if (Env::has('debug')) {
- $page->changeTpl('geoloc/country.tpl', SIMPLE);
- } else {
- $page->changeTpl('geoloc/country.tpl', NO_SKIN);
- header('Content-Type: text/xml');
- header('Pragma:');
- }
- $mapid = Env::has('mapid') ? Env::i('mapid', -2) : false;
- list($countries, $cities) = geoloc_getData_subcountries($mapid, $this->set, 10);
- $page->assign('countries', $countries);
- $page->assign('cities', $cities);
- break;
-
- default:
- global $globals;
- if (!$this->use_map()) {
- $page->assign('request_geodesix', true);
- }
- $page->assign('annu', @$this->params['with_annu']);
- $page->assign('protocole', @$_SERVER['HTTPS'] ? 'https' : 'http');
- $this->set->get('u.user_id', null, "u.perms != 'pending' AND u.deces = 0", "u.user_id", null);
- return 'include/plview.geoloc.tpl';
- }
- }
-}
-
class GadgetView implements PlView
{
public function __construct(PlSet &$set, $data, array $params)
public function fields()
{
return "u.user_id AS id, u.*," .
- (S::logged() ? "q.profile_mobile AS mobile, " : "IF(q.profile_mobile_pub = 'public', q.profile_mobile, NULL) as mobile, ") .
"u.perms != 'pending' AS inscrit,
u.perms != 'pending' AS wasinscrit,
u.deces != 0 AS dcd, u.deces,
FIND_IN_SET('femme', u.flags) AS sexe,
- adr.city, gp.a2, gp.pays AS countrytxt, gr.name AS region" .
+ " // adr.city, gr.name AS region
+ . "gc.iso_3166_1_a2, gc.countryFR AS countrytxt" .
(S::logged() ? ", c.contact AS contact" : '');
}
public function joins()
{
- return "LEFT JOIN adresses AS adr ON (u.user_id = adr.uid AND FIND_IN_SET('active', adr.statut)".(S::logged() ? "" : " AND adr.pub = 'public'").")
- LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
- LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)" .
- (S::logged() ?
- "LEFT JOIN contacts AS c On (c.contact = u.user_id AND c.uid = " . S::v('uid') . ")"
- : "");
+ return "LEFT JOIN profile_addresses AS adr ON (u.user_id = adr.pid AND
+ FIND_IN_SET('current', adr.flags)"
+ . (S::logged() ? "" : "AND adr.pub = 'public'") . ")
+ LEFT JOIN geoloc_countries AS gc ON (adr.countryId = gc.iso_3166_1_a2)
+ LEFT JOIN geoloc_administrativeareas AS gr ON (adr.countryId = gr.country
+ AND adr.administrativeAreaId = gr.id)
+ " . (S::logged() ?
+ "LEFT JOIN contacts AS c ON (c.contact = u.user_id
+ AND c.uid = " . S::v('uid') . ")" : "");
}
public function apply(PlPage &$page)
$this->stamp = date('YmdHis');
$this->unique = $_unique;
$this->type = $_type;
+ $res = XDB::query("SELECT promo
+ FROM profile_display
+ WHERE pid={?}", $this->user->id());
+ $this->promo = $res->fetchOneCell();
}
// }}}
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+// {{{ class EntrReq
+
+class EntrReq extends Validate
+{
+ // {{{ properties
+
+ public $id;
+ public $name;
+ public $acronym;
+ public $url;
+ public $email;
+ public $holdingid;
+ public $NAF_code;
+ public $AX_code;
+
+ public $tel;
+ public $fax;
+ public $address;
+
+ public $suggestions;
+
+ // }}}
+ // {{{ constructor
+
+ public function __construct(User &$_user, $_id, $_name, $_acronym, $_url, $_email, $_tel, $_fax, $_address, $_stamp = 0)
+ {
+ parent::__construct($_user, false, 'entreprise', $_stamp);
+ $this->id = $_id;
+ $this->name = $_name;
+ $this->acronym = $_acronym;
+ $this->url = $_url;
+ $this->email = $_email;
+ $this->tel = $_tel;
+ $this->fax = $_fax;
+ $this->address = $_address;
+
+ $_name = preg_replace('/[^0-9a-z]/i', ' ', strtolower(replace_accent($_name)));
+ $name = explode(" ", $_name);
+ $name_array = array_map("trim", $name);
+ $length = count($name_array);
+ $where = "";
+ for ($i = 0; $i < $length; $i++) {
+ if (strlen($name_array[$i]) > 2) {
+ if ($where !== "") {
+ $where .= " OR ";
+ }
+ $where .= "name LIKE '%" . $name_array[$i] . "%'";
+ }
+ }
+ $res = XDB::iterator('SELECT name
+ FROM profile_job_enum
+ WHERE ' . $where);
+ $this->suggestions = "| ";
+ while ($sug = $res->next()) {
+ $this->suggestions .= $sug['name'] . " | ";
+ }
+ }
+
+ // }}}
+ // {{{ function formu()
+
+ public function formu()
+ {
+ return 'include/form.valid.entreprises.tpl';
+ }
+
+ // }}}
+ // {{{ function editor()
+
+ public function editor()
+ {
+ return 'include/form.valid.edit-entreprises.tpl';
+ }
+
+ // }}}
+ // {{{ function handle_editor()
+
+ protected function handle_editor()
+ {
+ if (Env::has('holdingid')) {
+ $this->holdingid = trim(Env::v('holdingid'));
+ }
+ if (Env::has('name')) {
+ $this->name = trim(Env::v('name'));
+ if (Env::has('acronym')) {
+ $this->acronym = trim(Env::v('acronym'));
+ if (Env::has('url')) {
+ $this->url = trim(Env::v('url'));
+ if (Env::has('NAF_code')) {
+ $this->NAF_code = trim(Env::v('NAF_code'));
+ if (Env::has('AX_code')) {
+ $this->AX_code = trim(Env::v('AX_code'));
+ return true;
+ }
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+ // }}}
+ // {{{ function _mail_subj
+
+ protected function _mail_subj()
+ {
+ return "[Polytechnique.org/Entreprises] Demande d'ajout d'une entreprise : " . $this->name;
+ }
+
+ // }}}
+ // {{{ function _mail_body
+
+ protected function _mail_body($isok)
+ {
+ if ($isok) {
+ return " L'entreprise " . $this->name . " vient d'être ajoutée à ta fiche.";
+ } else {
+ return " La demande que tu avais faite pour l'entreprise " . $this->name .
+ " a été refusée, car elle figure déjà dans notre base.";
+ }
+ }
+
+ // }}}
+ // {{{ function commit()
+
+ public function commit()
+ {
+ // TODO: use address and phone classes to update profile_job_enum and profile_phones once they are done.
+
+ $res = XDB::query('SELECT id
+ FROM profile_job_enum
+ WHERE name = {?}',
+ $this->name);
+ if ($res->numRows() != 1) {
+ require_once 'profil.func.inc.php';
+ require_once 'geocoding.inc.php';
+
+ XDB::execute('INSERT INTO profile_job_enum (name, acronym, url, email, holdingid, NAF_code, AX_code)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?})',
+ $this->name, $this->acronym, $this->url, $this->email,
+ $this->holdingid, $this->NAF_code, $this->AX_code);
+
+ $jobid = XDB::insertId();
+ $display_tel = format_display_number($this->tel, $error_tel);
+ $display_fax = format_display_number($this->fax, $error_fax);
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type,
+ search_tel, display_tel, pub)
+ VALUES ({?}, 'hq', 0, 0, 'fixed', {?}, {?}, 'public'),
+ ({?}, 'hq', 0, 1, 'fax', {?}, {?}, 'public')",
+ $jobid, format_phone_number($this->tel), $display_tel,
+ $jobid, format_phone_number($this->fax), $display_fax);
+
+ $gmapsGeocoder = new GMapsGeocoder();
+ $address = $gmapsGeocoder->getGeocodedAddress($this->address);
+ Geocoder::getAreaId($address, 'administrativeArea');
+ Geocoder::getAreaId($address, 'subAdministrativeArea');
+ Geocoder::getAreaId($address, 'locality');
+ XDB::execute("INSERT INTO profile_addresses (jobid, type, id, accuracy,
+ text, postalText, postalCode, localityId,
+ subAdministrativeAreaId, administrativeAreaId,
+ countryId, latitude, longitude, updateTime,
+ north, south, east, west)
+ VALUES ({?}, 'hq', 0, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
+ {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?})",
+ $jobid, $this->address['accuracy'], $this->address['text'], $this->address['postalText'],
+ $this->address['postalCode'], $this->address['localityId'],
+ $this->address['subAdministrativeAreaId'], $this->address['administrativeAreaId'],
+ $this->address['countryId'], $this->address['latitude'], $this->address['longitude'],
+ $this->address['updateTime'], $this->address['north'], $this->address['south'],
+ $this->address['east'], $this->address['west']);
+ } else {
+ $jobid = $res->fetchOneCell();
+ $success = true;
+ }
+ return XDB::execute('UPDATE profile_job
+ SET jobid = {?}
+ WHERE uid = {?} AND id = {?}',
+ $jobid, $this->user->id(), $this->id);
+ }
+
+ // }}}
+}
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+?>
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-// {{{ class UsageReq
+// {{{ class NamesReq4
-class UsageReq extends Validate
+class NamesReq extends Validate
{
// {{{ properties
public $unique = true;
- public $nom_usage;
- public $alias = '';
+ public $sn_old;
+ public $sn_new;
+ public $display_names;
+ public $old_alias;
+ public $new_alias;
+ public $sn_types;
- public $oldusage;
- public $oldalias;
-
- public $homonyme;
- public $reason;
-
- public $rules = "Refuser
- tout ce qui n'est visiblement pas un nom de famille (ce qui est
- extremement rare car à peu près n'importe quoi peut être un nom de
- famille...)";
+ public $rules = "Refuser tout ce qui n'est visiblement pas un nom de famille (ce qui est extremement rare car à peu près n'importe quoi peut être un nom de famille).";
// }}}
// {{{ constructor
- public function __construct(User &$_user, $_usage, $_reason)
+ public function __construct(User &$_user, $_search_names, $_private_name_end)
{
parent::__construct($_user, true, 'usage');
- $this->nom_usage = $_usage;
- $this->reason = $_reason;
-
- $res = XDB::query("SELECT prenom FROM auth_user_md5 WHERE user_id = {?}", $this->user->id());
- $this->alias = make_username($res->fetchOneCell(), $this->nom_usage);
- if (!$this->nom_usage) {
- $this->alias = "";
+ require_once 'name.func.inc.php';
+
+ $this->sn_types = build_types();
+ $this->sn_old = build_sn_pub();
+ $this->sn_new = $_search_names;
+ $this->new_alias = true;
+ $this->display_names = array();
+
+ build_display_names($this->display_names, $_search_names, $_private_name_end, $this->new_alias);
+ foreach ($this->sn_new AS $key => &$sn) {
+ if (!isset($sn['pub'])) {
+ unset($this->sn_new[$key]);
+ }
+ }
+ $res = XDB::query("SELECT alias
+ FROM aliases
+ WHERE id = {?} AND type = 'alias' AND FIND_IN_SET('usage', flags)",
+ $this->user->id());
+ $this->old_alias = $res->fetchOneCell();
+ if ($this->old_alias != $this->new_alias) {
+ $res = XDB::query("SELECT id
+ FROM aliases
+ WHERE alias = {?}",
+ $this->new_alias);
+ if ($res->fetchOneCell()) {
+ $this->new_alias = null;
+ }
}
-
- $res = XDB::query("
- SELECT e.alias, u.nom_usage, a.id
- FROM auth_user_md5 as u
- LEFT JOIN aliases as e ON(e.type='alias' AND FIND_IN_SET('usage',e.flags) AND e.id = u.user_id)
- LEFT JOIN aliases as a ON(a.alias = {?} AND a.id != u.user_id)
- WHERE u.user_id = {?}", $this->alias, $this->user->id());
- list($this->oldalias, $this->oldusage, $this->homonyme) = $res->fetchOneRow();
}
// }}}
public function formu()
{
- return 'include/form.valid.nomusage.tpl';
+ return 'include/form.valid.names.tpl';
}
// }}}
protected function _mail_subj()
{
- return "[Polytechnique.org/USAGE] Changement de nom d'usage";
+ return "[Polytechnique.org/NOMS] Changement de noms";
}
// }}}
{
global $globals;
if ($isok) {
- $res = " Le changement de nom d'usage que tu as demandé vient d'être effectué.";
- if ($this->oldalias) {
- $res .= "\n\n Les alias {$this->oldalias}@{$globals->mail->domain} et @{$globals->mail->domain2} ont été supprimés.";
- }
- if ($this->nom_usage) {
- $res .= "\n\n Les alias {$this->alias}@{$globals->mail->domain} et @{$globals->mail->domain2} sont maintenant à ta disposition !";
+ $res = " Le changement de nom que tu as demandé vient d'être effectué.";
+ if ($this->old_alias != $this->new_alias) {
+ if ($this->old_alias) {
+ $res .= "\n\n Les alias {$this->old_alias}@{$globals->mail->domain} et @{$globals->mail->domain2} ont été supprimés.";
+ }
+ if ($this->new_alias) {
+ $res .= "\n\n Les alias {$this->new_alias}@{$globals->mail->domain} et @{$globals->mail->domain2} sont maintenant à ta disposition !";
+ }
}
if ($globals->mailstorage->googleapps_domain) {
require_once 'googleapps.inc.php';
$account = new GoogleAppsAccount($this->user);
if ($account->active()) {
- $res .= "\n\n Si tu utilises Google Apps, tu peux changer ton nom d'usage sur https://mail.google.com/a/polytechnique.org/#settings/accounts";
+ $res .= "\n\n Si tu utilises Google Apps, tu peux changer ton nom d'usage sur https://mail.google.com/a/polytechnique.org/#settings/accounts.";
}
}
return $res;
} else {
- return " La demande de changement de nom d'usage que tu avais faite a été refusée.";
+ return " La demande de changement de nom que tu avais faite a été refusée.";
}
}
public function commit()
{
require_once 'notifs.inc.php';
- register_watch_op($this->user->id(), WATCH_FICHE, '', 'nom');
- require_once('user.func.inc.php');
- set_new_usage($this->user->id(), $this->nom_usage, $this->alias);
+ require_once 'name.func.inc.php';
+
+ register_watch_op($this->user->id(), WATCH_FICHE, '', 'search_names');
+ set_profile_display($this->display_names);
+ set_alias_names($this->sn_new, $this->sn_old, true, $this->new_alias);
// Update the local User object, to pick up the new bestalias.
$this->user = User::getSilent($this->user->id());
public $unique = true;
- public $promo_sortie;
+ public $oldGradYear;
+ public $newGradYear;
+ public $entryYear;
- public $rules = "A priori accepter (la validation sert à repousser les
- petits malins). Refuse si tu connais la personne et que tu es sure
+ public $rules = "À priori accepter (la validation sert à repousser les
+ petits malins). Refuse si tu connais la personne et que tu es sûr
qu'elle n'est pas orange.";
// }}}
// {{{ constructor
- public function __construct(User &$_user, $_sortie)
+ public function __construct(User &$_user, $_newGradYear)
{
parent::__construct($_user, true, 'orange');
- $this->promo_sortie = $_sortie;
- $res = XDB::query("SELECT promo FROM auth_user_md5 WHERE user_id = {?}", $_user->id());
+ $this->newGradYear = $_newGradYear;
+ $res = XDB::query("SELECT entry_year
+ FROM profile_education
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->user->id());
+ $this->entryYear = $res->fetchOneCell();
+ $this->oldGradYear = $this->entryYear + 3;
}
// }}}
protected function _mail_body($isok)
{
if ($isok) {
- $res = " La demande de changement de promo de sortie que tu as demandée vient d'être effectuée.";
- return $res;
+ return " La demande de changement de promotion de sortie que tu as demandée vient d'être effectuée. "
+ . "Si tu le souhaites, tu peux maintenant modifier l'affichage de ta promotion sur le site sur la page suivante : "
+ . "https://www.polytechnique.org/profile/edit";
} else {
- return " La demande de changement de promo de sortie tu avais faite a été refusée.";
+ return " La demande de changement de promotion de sortie tu avais faite a été refusée.";
}
}
public function commit()
{
- XDB::execute("UPDATE auth_user_md5 set promo_sortie = {?} WHERE user_id = {?}",$this->promo_sortie, $this->user->id());
+ XDB::execute("UPDATE profile_education
+ SET grad_year = {?}
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $this->newGradYear, $this->user->id());
return true;
}
$error_mat = "You didn't provide me with a valid matricule number...";
$error_key = "You didn't provide me with a valid cipher key...";
-/**
- le premier parametre doit etre le matricule
- le second parametre facultatif doit etre le numero de l'adresse voulue :
- -1 => on ne veut pas d'adresse
- 0 => on veut toutes les adresses
- n => on veut l'adresse numero n
-
- IL NE FAUT PAS CHANGER LES NOMS DES CHAMPS DE ADRESSES
- S'IL Y A DES MODIFS A FAIRE VOIR AVEC MANAGEURS admin@manageurs.com
-*/
+
+// The first parameter has to be the identification number (matricule).
+// The second parameter facultative has to be the number of the desired address:
+// -1 => we do not want any address;
+// 0 => we want all the addresses;
+// n => we want the address number n.
+//
+// DO NOT CHANGE THE NAMES OF THE ADDRESSES' FIELDS.
+// IF YOU HAVE TO MAKE SOME MODIFICATION, FIRST CONTACT:
+// admin@manageurs.com
function get_annuaire_infos($method, $params) {
+ require "geocoding.inc.php";
global $error_mat, $error_key, $globals;
- //verif du mdp
- if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)){return false;}
- //si on a adresse == -1 => on ne recupère aucune adresse
- if(isset($params[2]) && ($params[2] == -1)) unset($params[2]);
-
- if( !empty($params[1]) ){ // on verifie qu'on a bien un matricule
+ // Password verification.
+ if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)) {
+ return false;
+ }
+ // If address == -1, we do not retrieve any address.
+ if(isset($params[2]) && ($params[2] == -1)) {
+ unset($params[2]);
+ }
- //on ne recupere pas les adresses inutilement
- if(!isset($params[2])){
+ // We check we actually have an identification number.
+ if(!empty($params[1])) {
+ // We only retrieve addresses when required.
+ if(!isset($params[2])) {
$res = XDB::iterRow(
- "SELECT q.profile_mobile AS cell, a.naissance AS age
- FROM auth_user_md5 AS a
- INNER JOIN auth_user_quick AS q USING (user_id)
- WHERE a.matricule = {?}", $params[1]);
+ "SELECT ph.display_tel AS cell, a.naissance AS age
+ FROM auth_user_md5 AS a
+ INNER JOIN auth_user_quick AS q USING (user_id)
+ LEFT JOIN profile_phones AS ph ON (ph.uid = a.user_id AND link_type='user' AND tel_type = 'mobile')
+ WHERE a.matricule = {?} LIMIT 1", $params[1]);
$array = $res->next();
- }
- else{
+ } else {
$res = XDB::iterRow(
- "SELECT q.profile_mobile AS cell, a.naissance AS age,
- adr.adr1, adr.adr2, adr.adr3,
- adr.postcode, adr.city, adr.country,
- adr.uid, adr.adrid
- FROM auth_user_md5 AS a
- INNER JOIN auth_user_quick AS q USING (user_id)
- LEFT JOIN adresses AS adr ON(adr.uid = a.user_id)
+ "SELECT a.naissance, addr.text, addr.postalCode,
+ l.name, addr.countryId, addr.pid, addr.id
+ FROM auth_user_md5 AS a
+ INNER JOIN auth_user_quick AS q USING (user_id)
+ LEFT JOIN profile_addresses AS addr ON(adr.pid = a.user_id)
+ LEFT JOIN geoloc_localities AS l ON (l.id = addr.localityId)
WHERE a.matricule = {?} AND
NOT FIND_IN_SET('pro', adr.statut)
ORDER BY NOT FIND_IN_SET('active', adr.statut),
FIND_IN_SET('res-secondaire', adr.statut),
NOT FIND_IN_SET('courrier', adr.statut)", $params[1]);
- //traitement des adresses si necessaire
- if(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['cp'], $adr['ville'],
- $adr['pays'], $uid, $adr['adrid']) = $res->next())
- {
- $array['cell'] = $cell;
+ // Process the addresses we got.
+ if(list($age, $text, $adr['cp'], $adr['ville'],
+ $adr['pays'], $uid, $adr['adrid']) = $res->next()) {
+ list($adr['adr1'], $adr['adr2'], $adr['adr3']) =
+ explode("\n", Geocoder::getFirstLines($text, $adr['cp'], 3));
+ $sql = XDB::query("SELECT display_tel
+ FROM profile_phones
+ WHERE uid = {?} AND link_type = 'user' AND tel_type = 'mobile'
+ LIMIT 1", $uid);
+ if ($sql->numRows() > 0) {
+ $array['cell'] = $sql->fetchOneCell();
+ } else {
+ $array['cell'] ='';
+ }
$array['age'] = $age;
$array['adresse'][] = $adr;
- //on clamp le numero au nombre d'adresses dispo
+ // We limit the address number by the number of available addresses.
$adresse = min((int) $params[2], $res->total());
- if ($adresse != 1) { //on ne veut pas la premiere adresse
+ if ($adresse != 1) { // We don't want the first address.
$i = 2;
- while(list($cell, $age, $adr['adr1'], $adr['adr2'], $adr['adr3'], $adr['cp'], $adr['ville'],
- $adr['pays'], , $adr['adrid']) = $res->next())
- {
- if($adresse == $i){//si on veut cette adresse en particulier
+ while(list($age, $text, $adr['cp'], $adr['ville'],
+ $adr['pays'], , $adr['adrid']) = $res->next()) {
+ list($adr['adr1'], $adr['adr2'], $adr['adr3']) =
+ explode("\n", Geocoder::getFirstLines($text, $adr['cp'], 3));
+ if ($adresse == $i) {
+ // If we want this particular address.
$array['adresse'][0] = $adr;
//$res->free();
break;
- }
- elseif($adresse == 0){//si on veut toutes les adresses
+ } elseif ($adresse == 0) {
+ // If we want every address.
$array['adresse'][] = $adr;
}
$i++;
}
}
- // on rajoute les numéros de tél
+ // We add the phone numbers.
$adrid_index = array();
- foreach ($array['adresse'] as $i => $a) $adrid_index[$a['adrid']] = $i;
- // on rajoute les numéros de tels
+ foreach ($array['adresse'] as $i => $a) {
+ $adrid_index[$a['adrid']] = $i;
+ }
$restel = XDB::iterator(
- "SELECT t.tel, t.tel_type, t.adrid
- FROM tels AS t
- INNER JOIN adresses AS a ON (t.adrid = a.adrid AND t.uid = a.uid)
- WHERE t.uid = {?} AND NOT FIND_IN_SET('pro', a.statut)", $uid);
- while ($tel = $restel->next()) $array['adresse'][$adrid_index[$tel['adrid']]]['tels'][] = $tel;
+ "SELECT t.display_tel AS tel, t.tel_type, t.link_id as adrid
+ FROM profile_phones AS t
+ INNER JOIN profile_addresses AS a ON (t.link_id = a.id AND t.uid = a.pid)
+ WHERE t.uid = {?} AND t.link_type = 'address'
+ AND NOT FIND_IN_SET('pro', a.statut)", $uid);
+ while ($tel = $restel->next()) {
+ $array['adresse'][$adrid_index[$tel['adrid']]]['tels'][] = $tel;
+ }
foreach ($array['adresse'] as $i => $adr) {
unset($lasttel);
- foreach($adr['tels'] as $j => $t){
- if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) $array['adresse'][$i]['tel'] = $t['tel'];
- elseif (!isset($array['adresse'][$i]['fax']) && (strpos($t['tel_type'], 'Fax') === 0)) $array['adresse'][$i]['fax'] = $t['tel'];
- else $lasttel = $t['tel'];
- if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) break;
+ foreach ($adr['tels'] as $j => $t) {
+ if (!isset($array['adresse'][$i]['tel']) && (strpos($t['tel_type'], 'Tél') === 0)) {
+ $array['adresse'][$i]['tel'] = $t['tel'];
+ } elseif (!isset($array['adresse'][$i]['fax'])
+ && (strpos($t['tel_type'], 'Fax') === 0)) {
+ $array['adresse'][$i]['fax'] = $t['tel'];
+ } else {
+ $lasttel = $t['tel'];
+ }
+ if (isset($array['adresse'][$i]['tel']) && isset($array['adresse'][$i]['fax'])) {
+ break;
+ }
}
- if (!isset($array['adresse'][$i]['tel']) && isset($lasttel))
+ if (!isset($array['adresse'][$i]['tel']) && isset($lasttel)) {
$array['adresse'][$i]['tel'] = $lasttel;
- elseif (!isset($array['adresse'][$i]['fax']) && isset($lasttel))
+ } elseif (!isset($array['adresse'][$i]['fax']) && isset($lasttel)) {
$array['adresse'][$i]['fax'] = $lasttel;
+ }
unset($array['adresse'][$i]['adrid']);
unset($array['adresse'][$i]['tels']);
}
- }
- else{
+ } else {
$array = false;
}
}
- if ($array) { // on a bien eu un résultat : le matricule etait bon
+ if ($array) { // We did get a result: the identification number was rigth.
- //on n'envoit que l'age à manageurs le format est YYYY-MM-DD 0123-56-89
- $year = (int) substr($array['age'],0,4);
- $month = (int) substr($array['age'],5,2);
- $day = (int) substr($array['age'],8,2);
+ // We only send the age to manageurs.com; the format is YYYY-MM-DD 0123-56-89.
+ $year = (int) substr($array['age'], 0, 4);
+ $month = (int) substr($array['age'], 5, 2);
+ $day = (int) substr($array['age'], 8, 2);
$age = (int) date('Y') - $year - 1;
if(( $month < (int)date('m')) ||
- (($month == (int)date('m')) && ($day >= (int)date('d'))))
- {
+ (($month == (int)date('m')) && ($day >= (int)date('d')))) {
$age += 1;
}
$array['age'] = $age;
- //on commence le cryptage des donnees
- if (manageurs_encrypt_init($params[1]) == 1) {//on a pas trouve la cle pour crypter
+ // We start the encryption of the data.
+ if (manageurs_encrypt_init($params[1]) == 1) {
+ // We did not find the key to encryptthe data.
$args = array("erreur" => 3, "erreurstring" => $error_key);
$reply = xmlrpc_encode_request(NULL,$args);
} else {
$reply = manageurs_encrypt_array($array);
manageurs_encrypt_close();
}
- } else {//le matricule n'etait pas valide
+ } else {
+ // The identification number was not valid.
$args = array("erreur" => 2, "erreurstring" => $erreur_mat);
$reply = xmlrpc_encode_request(NULL,$args);
}
- } else {//le matricule n'etait pas en argument
+ } else {
+ // The identification number was not in argument.
$args = array("erreur" => 1, "erreurstring" => $error_mat);
- $reply = xmlrpc_encode_request(NULL,$args);
+ $reply = xmlrpc_encode_request(NULL, $args);
}
return $reply;
function get_nouveau_infos($method, $params) {
global $error_mat, $error_key, $globals;
- //verif du mdp
- if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)){return false;}
- if( !empty($params[1]) ){ // on verifie qu'on a bien un matricule
-
+ // Password verification.
+ if(!isset($params[0]) || ($params[0] != $globals->manageurs->manageurs_pass)) {
+ return false;
+ }
+ // We check we actually have an identification number.
+ if(!empty($params[1])) {
$res = XDB::query(
- "SELECT a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme ,a.deces!= 0 as decede ,
- a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
- FROM auth_user_md5 AS a
- INNER JOIN aliases as al ON a.user_id=al.id
- WHERE al.flags='bestalias' and a.matricule = {?}",$params[1]);
+ "SELECT a.nom, a.nom_usage,a.prenom, FIND_IN_SET('femme', a.flags) as femme,
+ a.deces!= 0 as decede, a.naissance, a.promo, concat(al.alias, '@m4x.org') as mail
+ FROM auth_user_md5 AS a
+ INNER JOIN aliases AS al ON (a.user_id = al.id)
+ WHERE al.flags = 'bestalias' AND a.matricule = {?}",$params[1]);
$data=$res->fetchOneAssoc();
//$data['mail'].='@polytechnique.org';
- //on commence le cryptage des donnees
- if (manageurs_encrypt_init($params[1]) == 1) {//on a pas trouve la cle pour crypter
+ // We start the encryption of the data.
+ if (manageurs_encrypt_init($params[1]) == 1) {
+ // We did not find the key to encryptthe data.
$args = array("erreur" => 3, "erreurstring" => $error_key);
- $reply = xmlrpc_encode_request(NULL,$args);
+ $reply = xmlrpc_encode_request(NULL, $args);
} else {
$reply = manageurs_encrypt_array($data);
manageurs_encrypt_close();
}
+ } else {
+ $reply = false;
}
- else{
- $reply=false;
- }
- return $reply;
-
+ return $reply;
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
'admin/ipwatch' => $this->make_hook('ipwatch', AUTH_MDP, 'admin'),
'admin/icons' => $this->make_hook('icons', AUTH_MDP, 'admin'),
'admin/accounts' => $this->make_hook('accounts', AUTH_MDP, 'admin'),
+ 'admin/jobs' => $this->make_hook('jobs', AUTH_MDP, 'admin'),
);
}
$action = Env::v('valid_promo') == 'Ajouter des membres' ? 'add' : 'ax';
pl_redirect('admin/promo/' . $action . '/' . Env::i('promo'));
} else {
- $page->trigError('Promo non valide');
+ $page->trigError('Promotion non valide.');
}
}
WHERE perms = \'admin\'
ORDER BY nom, prenom'));
}
+
+ function handler_jobs(&$page, $id = -1)
+ {
+ $page->changeTpl('admin/jobs.tpl');
+
+ if (Env::has('search')) {
+ $res = XDB::query("SELECT e.id, e.name, e.acronym
+ FROM profile_job_enum AS e
+ WHERE e.name LIKE CONCAT('% ', {?}, '%') OR e.acronym LIKE CONCAT('% ', {?}, '%')",
+ Env::t('job'), Env::t('job'));
+
+ if ($res->numRows() <= 20) {
+ $page->assign('jobs', $res->fetchAllAssoc());
+ } else {
+ $page->trigError("Il y a trop d'entreprises correspondant à ton choix. Affine-le !");
+ }
+
+ $page->assign('askedJob', Env::v('job'));
+ return;
+ }
+
+ if (Env::has('edit')) {
+ // TODO: use address and phone classes to update profile_job_enum and profile_phones once they are done.
+
+ S::assert_xsrf_token();
+ $selectedJob = Env::has('selectedJob');
+
+ XDB::execute("DELETE FROM profile_phones
+ WHERE uid = {?} AND link_type = 'hq'",
+ $id);
+ XDB::execute("DELETE FROM profile_addresses
+ WHERE jobid = {?} AND type = 'hq'",
+ $id);
+ XDB::execute('DELETE FROM profile_job_enum
+ WHERE id = {?}',
+ $id);
+
+ if (Env::has('change')) {
+ XDB::execute('UPDATE profile_job
+ SET jobid = {?}
+ WHERE jobid = {?}',
+ Env::i('newJobId'), $id);
+
+ $page->trigSuccess("L'entreprise a bien été remplacée.");
+ } else {
+ require_once 'profil.func.inc.php';
+ require_once 'geocoding.inc.php';
+
+ $display_tel = format_display_number(Env::v('tel'), $error_tel);
+ $display_fax = format_display_number(Env::v('fax'), $error_fax);
+ $gmapsGeocoder = new GMapsGeocoder();
+ $address = array('text' => Env::t('address'));
+ $address = $gmapsGeocoder->getGeocodedAddress($address);
+ Geocoder::getAreaId($address, 'administrativeArea');
+ Geocoder::getAreaId($address, 'subAdministrativeArea');
+ Geocoder::getAreaId($address, 'locality');
+
+ XDB::execute('UPDATE profile_job_enum
+ SET name = {?}, acronym = {?}, url = {?}, email = {?},
+ NAF_code = {?}, AX_code = {?}, holdingid = {?}
+ WHERE id = {?}',
+ Env::t('name'), Env::t('acronym'), Env::t('url'), Env::t('email'),
+ Env::t('NAF_code'), Env::i('AX_code'), Env::i('holdingId'), $id);
+
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type,
+ search_tel, display_tel, pub)
+ VALUES ({?}, 'hq', 0, 0, 'fixed', {?}, {?}, 'public'),
+ ({?}, 'hq', 0, 1, 'fax', {?}, {?}, 'public')",
+ $id, format_phone_number(Env::v('tel')), $display_tel,
+ $id, format_phone_number(Env::v('fax')), $display_fax);
+
+ XDB::execute("INSERT INTO profile_addresses (jobid, type, id, accuracy,
+ text, postalText, postalCode, localityId,
+ subAdministrativeAreaId, administrativeAreaId,
+ countryId, latitude, longitude, updateTime,
+ north, south, east, west)
+ VALUES ({?}, 'hq', 0, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
+ {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?})",
+ $id, $address['accuracy'], $address['text'], $address['postalText'],
+ $address['postalCode'], $address['localityId'],
+ $address['subAdministrativeAreaId'], $address['administrativeAreaId'],
+ $address['countryId'], $address['latitude'], $address['longitude'],
+ $address['updateTime'], $address['north'], $address['south'],
+ $address['east'], $address['west']);
+
+ $page->trigSuccess("L'entreprise a bien été mise à jour.");
+ }
+ }
+
+ if (!Env::has('change') && $id != -1) {
+ $res = XDB::query("SELECT e.id, e.name, e.acronym, e.url, e.email, e.NAF_code, e.AX_code,
+ h.id AS holdingId, h.name AS holdingName, h.acronym AS holdingAcronym,
+ t.display_tel AS tel, f.display_tel AS fax, a.text AS address
+ FROM profile_job_enum AS e
+ LEFT JOIN profile_job_enum AS h ON (e.holdingid = h.id)
+ LEFT JOIN profile_phones AS t ON (t.uid = e.id AND link_type = 'hq' AND tel_id = 0)
+ LEFT JOIN profile_phones AS f ON (f.uid = e.id AND link_type = 'hq' AND tel_id = 1)
+ LEFT JOIN profile_addresses AS a ON (a.jobid = e.id AND a.type = 'hq')
+ WHERE e.id = {?}",
+ $id);
+
+ if ($res->numRows() == 0) {
+ $page->trigError('Auncune entreprise ne correspond à cet identifiant.');
+ } else {
+ $page->assign('selectedJob', $res->fetchOneAssoc());
+ }
+ }
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
$actifs = Env::v('emails_actifs', Array());
print_r(Env::v('emails_rewrite'));
if (Env::v('emailop') == "ajouter" && Env::has('email')) {
- $result = $redirect->add_email(Env::v('email'));
+ $new_email = Env::v('email');
+ if ($new_email == "new@example.org") {
+ $new_email = Env::v('email_new');
+ }
+ $result = $redirect->add_email($new_email);
+ if ($result == ERROR_INVALID_EMAIL) {
+ $page->assign('email', $new_email);
+ }
+ $page->assign('retour', $result);
} elseif (empty($actifs)) {
$result = ERROR_INACTIVE_REDIRECTION;
} elseif (is_array($actifs)) {
// Display GoogleApps acount information.
require_once 'googleapps.inc.php';
$page->assign('googleapps', GoogleAppsAccount::account_status($user->id()));
+
+ require_once 'emails.combobox.inc.php';
+ fill_email_combobox($page);
}
function handler_antispam(&$page, $statut_filtre = null)
$page->assign('photo_incitation', $res->fetchOneCell() == 0);
// Geo-location onebox.
- require_once 'geoloc.inc.php';
- $res = localize_addresses(S::user()->id());
- $page->assign('geoloc_incitation', count($res));
+ require_once "geocoding.inc.php";
+ $page->assign('geoloc_incitation', Geocoder::countNonGeocoded(S::user()->id()));
// Direct link to the RSS feed, when available.
if (S::rssActivated()) {
// Fetch the events to display, along with their metadata.
$array = array();
- $it = XDB::iterator("SELECT e.id,e.titre,e.texte,e.post_id,a.user_id,a.nom,a.prenom,a.promo,a.hruid,
+ $it = XDB::iterator("SELECT e.id, e.titre, e.texte, e.post_id, a.user_id, a.nom, a.prenom, d.promo AS promo_display ,a.hruid,
p.x, p.y, p.attach IS NOT NULL AS img, FIND_IN_SET('wiki', e.flags) AS wiki,
FIND_IN_SET('important', e.flags) AS important,
e.creation_date > DATE_SUB(CURDATE(), INTERVAL 2 DAY) AS news,
e.peremption < DATE_ADD(CURDATE(), INTERVAL 2 DAY) AS end,
ev.user_id IS NULL AS nonlu
FROM evenements AS e
- LEFT JOIN evenements_photo AS p ON (e.id = p.eid)
- INNER JOIN auth_user_md5 AS a ON e.user_id=a.user_id
- LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
+ LEFT JOIN evenements_photo AS p ON (e.id = p.eid)
+ INNER JOIN auth_user_md5 AS a ON (e.user_id = a.user_id)
+ INNER JOIN profile_display AS d ON (d.pid = a.user_id)
+ LEFT JOIN evenements_vus AS ev ON (e.id = ev.evt_id AND ev.user_id = {?})
WHERE FIND_IN_SET('valide', e.flags) AND peremption >= NOW()
AND (e.promo_min = 0 || e.promo_min <= {?})
AND (e.promo_max = 0 || e.promo_max >= {?})
--- /dev/null
+<?php
+/***************************************************************************
+ * Copyright (C) 2003-2009 Polytechnique.org *
+ * http://opensource.polytechnique.org/ *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., *
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
+ ***************************************************************************/
+
+/**
+ * @brief Module to merge data from AX database
+ *
+ * Module to import data from another database of alumni that had
+ * different schemas. The organization that used this db is called AX
+ * hence the name of this module.
+ *
+ * Datas are stored in an external server and you need a private key
+ * to connect to their server.
+ */
+class FusionAxModule extends PLModule
+{
+ function __construct()
+ {
+ }
+
+ function handlers()
+ {
+ return array(
+ 'fusionax' => $this->make_hook('index', AUTH_MDP, 'admin'),
+ 'fusionax/import' => $this->make_hook('import', AUTH_MDP, 'admin'),
+ 'fusionax/view' => $this->make_hook('view', AUTH_MDP, 'admin'),
+ 'fusionax/ids' => $this->make_hook('ids', AUTH_MDP, 'admin'),
+ 'fusionax/deceased' => $this->make_hook('deceased', AUTH_MDP, 'admin'),
+ 'fusionax/promo' => $this->make_hook('promo', AUTH_MDP, 'admin'),
+ );
+ }
+
+
+ function handler_index(&$page)
+ {
+ $globals = Platal::globals();
+
+ $page->changeTpl('fusionax/index.tpl');
+ $page->assign('xorg_title', 'Polytechnique.org - Fusion des annuaires');
+ if (isset($globals->fusionax) && isset($globals->fusionax->LastUpdate)) {
+ $page->assign('lastimport', date("d-m-Y", $globals->fusionax->LastUpdate));
+ }
+ }
+
+ /** Import de l'annuaire de l'AX depuis l'export situé dans le home de jacou */
+ function handler_import(&$page, $action = 'index', $fileSQL = '')
+ {
+ $globals = Platal::globals();
+
+ if ($action == 'index') {
+ $page->changeTpl('fusionax/import.tpl');
+ $page->addJsLink('jquery.js');
+ if (isset($globals->fusionax) && isset($globals->fusionax->LastUpdate)) {
+ $page->assign(
+ 'lastimport',
+ "le " . date("d/m/Y à H:i", $globals->fusionax->LastUpdate));
+ }
+ return;
+ }
+
+ // toutes les actions sont faites en ajax en utilisant jquery
+ header("Content-type: text/javascript; charset=utf-8");
+
+ // log des actions
+ $report = array();
+
+ // création d'un fichier temporaire si nécessaire
+ if (Env::has('tmpdir')) {
+ $tmpdir = Env::v('tmpdir');
+ } else {
+ $tmpdir = tempnam('/tmp', 'fusionax');
+ unlink($tmpdir);
+ mkdir($tmpdir);
+ chmod($tmpdir, 0700);
+ }
+
+ $modulepath = realpath(dirname(__FILE__) . '/fusionax/') . '/';
+ $olddir = getcwd();
+ chdir($tmpdir);
+
+ if ($action == 'launch') {
+ // séparation de l'archive en fichiers par tables
+ exec($modulepath . 'import-ax.sh', $report);
+ $report[] = 'Fichier parsé.';
+ $report[] = 'Import dans la base en cours...';
+ $next = 'integrateSQL';
+ } elseif ($action == 'integrateSQL') {
+ // intégration des données dans la base MySQL
+ // liste des fichiers sql à exécuter
+ $filesSQL = array(
+ 'Activites.sql',
+ 'Adresses.sql',
+ 'Anciens.sql',
+ 'Formations.sql',
+ 'Entreprises.sql');
+ if ($fileSQL != '') {
+ // récupère le contenu du fichier sql
+ $queries = explode(';', file_get_contents($modulepath . $fileSQL));
+ foreach ($queries as $q) {
+ if (trim($q)) {
+ // coupe le fichier en requêtes individuelles
+ if (substr($q, 0, 2) == '--') {
+ // affiche les commentaires dans le report
+ $lines = explode("\n", $q);
+ $l = $lines[0];
+ $report[] = addslashes($l);
+ }
+ // exécute la requête
+ XDB::execute($q);
+ }
+ }
+ // trouve le prochain fichier à exécuter
+ $trans = array_flip($filesSQL);
+ $nextfile = $trans[$fileSQL] + 1;
+ } else {
+ $nextfile = 0;
+ }
+ if (!isset($filesSQL[$nextfile])) {
+ // tous les fichiers ont été exécutés, on passe à l'étape
+ // suivante
+ $next = 'clean';
+ } else {
+ // on passe au fichier suivant
+ $next = 'integrateSQL/' . $filesSQL[$nextfile];
+ }
+ } elseif ($action == 'clean') {
+ // nettoyage du fichier temporaire
+ chdir($olddir);
+ exec("rm -Rf $tmpdir", $report);
+ $report[] = "Fin de l\'import";
+ // met à jour la date de dernier import
+ //$globals->change_dynamic_config(array('LastUpdate' => time()), 'FusionAx');
+ }
+ foreach($report as $t) {
+ // affiche les lignes de report
+ echo "$('#fusionax_import').append('" . $t . "<br/>');\n";
+ }
+ if (isset($next)) {
+ $tmpdir = getcwd();
+ chdir($olddir);
+ // lance le prochain script s'il y en a un
+ echo "$.getScript('fusionax/import/" . $next . "?tmpdir=" . urlencode($tmpdir) . "');";
+ }
+ // exit pour ne pas afficher la page template par défaut
+ exit;
+ }
+
+ /** Import de l'annuaire de l'AX depuis l'export situé dans le home de jacou */
+ function handler_view(&$page, $action = '')
+ {
+ $globals = Platal::globals();
+
+ $page->changeTpl('fusionax/view.tpl');
+ if ($action == 'create') {
+ XDB::execute('DROP VIEW IF EXISTS fusionax_deceased');
+ XDB::execute('CREATE VIEW fusionax_deceased AS
+ SELECT u.user_id, a.id_ancien, u.nom, u.prenom, u.promo, u.deces AS deces_xorg, a.Date_deces AS deces_ax
+ FROM auth_user_md5 AS u
+ INNER JOIN fusionax_anciens AS a ON (a.id_ancien = u.matricule_ax)
+ WHERE u.deces != a.Date_deces');
+ XDB::execute('DROP VIEW IF EXISTS fusionax_promo');
+ XDB::execute('CREATE VIEW fusionax_promo AS
+ SELECT u.user_id, u.matricule_ax, CONCAT(u.nom, " ", u.prenom) AS display_name, u.promo AS promo_etude_xorg,
+ f.promotion_etude AS promo_etude_ax, u.promo_sortie AS promo_sortie_xorg
+ FROM auth_user_md5 AS u
+ INNER JOIN fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+ WHERE u.promo != f.promotion_etude AND !(f.promotion_etude = u.promo + 1 AND u.promo_sortie = u.promo + 4)');
+ }
+ }
+
+ /* Mets à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX */
+ private static function clear_wrong_in_xorg($user_id)
+ {
+ $res = XDB::execute("UPDATE fusionax_xorg_anciens
+ SET matricule_ax = NULL
+ WHERE user_id = {?}", $user_id);
+ if (!$res) {
+ return 0;
+ }
+ return XDB::affectedRows() / 2;
+ }
+
+ /* Cherche les les anciens présents dans Xorg avec un matricule_ax ne correspondant à rien dans la base de l'AX
+ * (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)*/
+ private static function find_wrong_in_xorg($limit = 10)
+ {
+ return XDB::iterator("SELECT u.promo, u.user_id, u.display_name
+ FROM fusionax_xorg_anciens AS u
+ WHERE NOT EXISTS (SELECT *
+ FROM fusionax_anciens AS f
+ WHERE f.id_ancien = u.matricule_ax)
+ AND u.matricule_ax IS NOT NULL AND promo != 1921 AND promo != 1923");
+ }
+
+ /** Lier les identifiants d'un ancien dans les deux annuaires
+ * @param user_id identifiant dans l'annuaire X.org
+ * @param matricule_ax identifiant dans l'annuaire de l'AX
+ * @return 0 si la liaison a échoué, 1 sinon
+ */
+ private static function link_by_ids($user_id, $matricule_ax)
+ {
+ $res = XDB::execute("UPDATE fusionax_import AS i
+ INNER JOIN fusionax_xorg_anciens AS u
+ SET u.matricule_ax = i.id_ancien,
+ i.user_id = u.user_id,
+ i.date_match_id = NOW()
+ WHERE i.id_ancien = {?} AND u.user_id = {?}
+ AND (u.matricule_ax != {?} OR u.matricule_ax IS NULL
+ OR i.user_id != {?} OR i.user_id IS NULL)",
+ $matricule_ax, $user_id, $matricule_ax, $user_id);
+ if (!$res) {
+ return 0;
+ }
+ return XDB::affectedRows() / 2;
+ }
+
+ /** Recherche automatique d'anciens à lier entre les deux annuaires
+ * @param limit nombre d'anciens à trouver au max
+ * @param sure si true, ne trouve que des anciens qui sont quasi sûrs
+ * @return un XOrgDBIterator sur les entrées avec display_name, promo,
+ * user_id, id_ancien et display_name_ax
+ */
+ private static function find_easy_to_link($limit = 10, $sure = false)
+ {
+ $easy_to_link = XDB::iterator("
+ SELECT u.display_name, u.promo, u.user_id, ax.id_ancien,
+ CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
+ COUNT(*) AS nbMatches
+ FROM fusionax_anciens AS ax
+ INNER JOIN fusionax_import AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
+ LEFT JOIN fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
+ AND ax.Nom_patronymique = u.nom
+ AND ax.prenom = u.prenom
+ AND u.promo = ax.promotion_etude)
+ GROUP BY u.user_id
+ HAVING u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
+ if ($easy_to_link->total() > 0 || $sure) {
+ return $easy_to_link;
+ }
+ return XDB::iterator("
+ SELECT u.display_name, u.promo, u.user_id, ax.id_ancien,
+ CONCAT(ax.prenom, ' ', ax.nom_complet, ' (X ', ax.promotion_etude, ')') AS display_name_ax,
+ COUNT(*) AS nbMatches
+ FROM fusionax_anciens AS ax
+ INNER JOIN fusionax_import AS i ON (i.id_ancien = ax.id_ancien AND i.user_id IS NULL)
+ LEFT JOIN fusionax_xorg_anciens AS u ON (u.matricule_ax IS NULL
+ AND (ax.Nom_patronymique = u.nom
+ OR ax.Nom_patronymique LIKE CONCAT(u.nom, ' %')
+ OR ax.Nom_patronymique LIKE CONCAT(u.nom, '-%')
+ OR ax.Nom_usuel = u.nom
+ OR u.nom LIKE CONCAT('% ', ax.Nom_patronymique))
+ AND u.promo < ax.promotion_etude + 2
+ AND u.promo > ax.promotion_etude - 2)
+ GROUP BY u.user_id
+ HAVING u.user_id IS NOT NULL AND nbMatches = 1 " . ($limit ? ('LIMIT ' . $limit) : ''));
+ }
+
+ /** Module de mise en correspondance les ids */
+ function handler_ids(&$page, $part = 'main', $user_id = null, $matricule_ax = null)
+ {
+ $globals = Platal::globals();
+ $nbToLink = 100;
+
+ $page->addJsLink('jquery.js');
+ $page->assign('xorg_title', 'Polytechnique.org - Fusion - Mise en correspondance simple');
+ if ($part == 'missingInAX') {
+ // locate all persons from this database that are not in AX's
+ $page->changeTpl('fusionax/idsMissingInAx.tpl');
+ $missingInAX = XDB::iterator("SELECT promo, user_id, display_name
+ FROM fusionax_xorg_anciens
+ WHERE matricule_ax IS NULL");
+ $page->assign('missingInAX', $missingInAX);
+ return;
+ }
+ if ($part == 'missingInXorg') {
+ // locate all persons from AX's database that are not here
+ $page->changeTpl('fusionax/idsMissingInXorg.tpl');
+ $missingInXorg = XDB::iterator("SELECT a.promotion_etude AS promo,
+ CONCAT(a.prenom, ' ', a.Nom_usuel) AS display_name,
+ a.id_ancien
+ FROM fusionax_import
+ INNER JOIN fusionax_anciens AS a USING (id_ancien)
+ WHERE fusionax_import.user_id IS NULL");
+ $page->assign('missingInXorg', $missingInXorg);
+ return;
+ }
+ if ($part == 'wrongInXorg') {
+ // locate all persons from Xorg database that have a bad AX id
+ $page->changeTpl('fusionax/idswrongInXorg.tpl');
+ $wrongInXorg = FusionAxModule::find_wrong_in_xorg($nbToLink);
+ $page->assign('wrongInXorg', $wrongInXorg);
+ return;
+ }
+ if ($part == 'cleanwronginxorg') {
+ $linksToDo = FusionAxModule::find_wrong_in_xorg($nbToLink);
+ while ($l = $linksToDo->next()) {
+ FusionAxModule::clear_wrong_in_xorg($l['user_id']);
+ }
+ pl_redirect('fusionax/ids/wrongInXorg');
+ }
+ if ($part == 'lier') {
+ if (Post::has('user_id') && Post::has('matricule_ax')) {
+ FusionAxModule::link_by_ids(Post::i('user_id'), Post::v('matricule_ax'));
+ }
+ }
+ if ($part == 'link') {
+ FusionAxModule::link_by_ids($user_id, $matricule_ax);
+ exit;
+ }
+ if ($part == 'linknext') {
+ $linksToDo = FusionAxModule::find_easy_to_link($nbToLink);
+ while ($l = $linksToDo->next()) {
+ FusionAxModule::link_by_ids($l['user_id'], $l['id_ancien']);
+ }
+ pl_redirect('fusionax/ids#autolink');
+ }
+ if ($part == 'linkall') {
+ $linksToDo = FusionAxModule::find_easy_to_link(0);
+ while ($l = $linksToDo->next()) {
+ FusionAxModule::link_by_ids($l['user_id'], $l['id_ancien']);
+ }
+ }
+ {
+ $page->changeTpl('fusionax/ids.tpl');
+ $missingInAX = XDB::query('SELECT COUNT(*)
+ FROM fusionax_xorg_anciens AS u
+ WHERE u.matricule_ax IS NULL');
+ if ($missingInAX) {
+ $page->assign('nbMissingInAX', $missingInAX->fetchOneCell());
+ }
+ $missingInXorg = XDB::query('SELECT COUNT(*)
+ FROM fusionax_import AS i
+ WHERE i.user_id IS NULL');
+ if ($missingInXorg) {
+ $page->assign('nbMissingInXorg', $missingInXorg->fetchOneCell());
+ }
+ $wrongInXorg = FusionAxModule::find_wrong_in_xorg($nbToLink);
+ if ($wrongInXorg->total() > 0) {
+ $page->assign('wrongInXorg', $wrongInXorg->total());
+ }
+ $easyToLink = FusionAxModule::find_easy_to_link($nbToLink);
+ if ($easyToLink->total() > 0) {
+ $page->assign('nbMatch', $easyToLink->total());
+ $page->assign('easyToLink', $easyToLink);
+ }
+ }
+ }
+
+ function handler_deceased(&$page, $action = '')
+ {
+ if ($action == 'updateXorg') {
+ XDB::execute('UPDATE fusionax_deceased
+ SET deces_xorg = deces_ax
+ WHERE deces_xorg = "0000-00-00"');
+ }
+ if ($action == 'updateAX') {
+ XDB::execute('UPDATE fusionax_deceased
+ SET deces_ax = deces_xorg
+ WHERE deces_ax = "0000-00-00"');
+ }
+ if ($action == 'update') {
+ if (Post::has('user_id') && Post::has('date')) {
+ XDB::execute('UPDATE fusionax_deceased
+ SET deces_ax = {?}, deces_xorg = {?}
+ WHERE user_id = {?}',
+ Post::v('date'), Post::v('date'), Post::i('user_id'));
+ }
+ }
+ $page->changeTpl('fusionax/deceased.tpl');
+ // deceased
+ $deceasedErrorsSql = XDB::query('SELECT COUNT(*) FROM fusionax_deceased');
+ $page->assign('deceasedErrors', $deceasedErrorsSql->fetchOneCell());
+ $res = XDB::iterator('SELECT d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_ax,
+ CONCAT(d.prenom, " ", d.nom) AS display_name
+ FROM fusionax_deceased AS d
+ WHERE d.deces_xorg = "0000-00-00"
+ LIMIT 10');
+ $page->assign('nbDeceasedMissingInXorg', $res->total());
+ $page->assign('deceasedMissingInXorg', $res);
+ $res = XDB::iterator('SELECT d.user_id, d.id_ancien, d.nom, d.prenom, d.promo, d.deces_xorg,
+ CONCAT(d.prenom, " ", d.nom) AS display_name
+ FROM fusionax_deceased AS d
+ WHERE d.deces_ax = "0000-00-00"
+ LIMIT 10');
+ $page->assign('nbDeceasedMissingInAX', $res->total());
+ $page->assign('deceasedMissingInAX', $res);
+ $res = XDB::iterator('SELECT d.user_id, d.id_ancien, d.nom, d.prenom, d.promo,
+ d.deces_ax, d.deces_xorg,
+ CONCAT(d.prenom, " ", d.nom, " ", d.user_id) AS display_name
+ FROM fusionax_deceased AS d
+ WHERE d.deces_xorg != "0000-00-00" AND d.deces_ax != "0000-00-00"');
+ $page->assign('nbDeceasedDifferent', $res->total());
+ $page->assign('deceasedDifferent', $res);
+ }
+
+ function handler_promo(&$page, $action = '')
+ {
+ $page->changeTpl('fusionax/promo.tpl');
+ $res = XDB::iterator('SELECT user_id, display_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax
+ FROM fusionax_promo
+ WHERE !(promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg)');
+ $nbMissmatchingPromos = $res->total();
+ $page->assign('nbMissmatchingPromos1', $res->total());
+ $page->assign('missmatchingPromos1', $res);
+ $res = XDB::iterator('SELECT user_id, display_name, promo_etude_xorg, promo_sortie_xorg, promo_etude_ax
+ FROM fusionax_promo
+ WHERE promo_etude_ax + 1 = promo_etude_xorg AND promo_etude_xorg + 3 = promo_sortie_xorg');
+ $nbMissmatchingPromos += $res->total();
+ $page->assign('nbMissmatchingPromos2', $res->total());
+ $page->assign('missmatchingPromos2', $res);
+ $page->assign('nbMissmatchingPromos', $nbMissmatchingPromos);
+ }
+}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:?>
--- /dev/null
+-- Import complet des activités professionnelles
+
+DROP TABLE IF EXISTS `fusionax_activites`;
+
+CREATE TABLE IF NOT EXISTS `fusionax_activites` (
+ `AC` CHAR(2) NOT NULL COMMENT 'Vaut toujours AC pour cette table',
+ `id_ancien` VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
+ `hash_activite` BINARY(5) NOT NULL COMMENT 'Hash de cette ligne pour la lier à l''adresse',
+ `Code_etab` BIGINT(10) NOT NULL COMMENT 'Code de l''établissement',
+ `Raison_sociale` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Raison sociale de l''établissement',
+ `Libelle_fonctio` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Libéllé de la fonction',
+ `Annuaire` BOOLEAN NOT NULL COMMENT 'publiable dans l''annuaire papier',
+ `Date_maj` DATE NOT NULL COMMENT 'Date de mise à jour de ces informations',
+ PRIMARY KEY( `id_ancien` , `hash_activite` )
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+LOAD DATA LOCAL INFILE 'Activites.txt' INTO TABLE `fusionax_activites` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(AC, id_ancien, Code_etab, Raison_sociale, Libelle_fonctio, Annuaire,
+@Ligne1, @Ligne2, @Ligne3, @code_postal, @ville, @zip_cedex, @etat_distr, @pays, @tel, @fax, @StringDate_maj)
+SET
+`hash_activite` = SUBSTRING( MD5( CONCAT(Code_etab, Libelle_fonctio) ), 1, 5),
+`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
--- /dev/null
+-- Import complet des adresses
+
+DROP TABLE IF EXISTS fusionax_adresses;
+
+CREATE TABLE IF NOT EXISTS fusionax_adresses (
+ provenance CHAR(2) NOT NULL COMMENT 'Vaut AC, AD ou AN selon la provenance de l''info',
+ id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
+ Type_adr ENUM('E', 'P') character set binary NOT NULL DEFAULT 'P' COMMENT 'Type d''adresse : E pour Entreprise, P pour Personnelle',
+ hash_adresse BINARY(5) NOT NULL COMMENT 'Hash pour différencier les diverses adresses',
+ Ligne1 VARCHAR(90) character set utf8 NOT NULL,
+ Ligne2 VARCHAR(90) character set utf8 NOT NULL,
+ Ligne3 VARCHAR(90) character set utf8 NOT NULL,
+ code_postal VARCHAR(20) character set utf8 NOT NULL,
+ ville VARCHAR(80) character set utf8 NOT NULL,
+ zip_cedex VARCHAR(20) character set utf8 NOT NULL,
+ etat_distr VARCHAR(20) character set utf8 NOT NULL,
+ pays VARCHAR(50) character set utf8 NOT NULL,
+ tel VARCHAR(30) NOT NULL,
+ fax VARCHAR(30) NOT NULL,
+ Date_maj DATE NOT NULL,
+ PRIMARY KEY (id_ancien, hash_adresse)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+LOAD DATA LOCAL INFILE 'Adresses.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(provenance, id_ancien, @Type_adr, Ligne1, Ligne2, Ligne3, code_postal, ville, zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
+SET
+`Type_adr` = IF(@Type_adr = 'E', 'E', IF(@Type_adr = '', '', 'P')),
+`hash_adresse` = SUBSTRING( MD5( @Type_adr ), 1, 5),
+`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
+
+LOAD DATA LOCAL INFILE 'Anciens.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(provenance, id_ancien, @Login, @Password, @promotion_etude, @Groupe_promo, @Nom_patronymique, @partic_patro, @prenom, @Nom_usuel, @partic_nom,
+ @Nom_complet, @Civilite, @Code_nationalite, @Type_membre, @corps_sortie, @StringDate_deces, @grade, @Mel_usage, @Mel_publiable,
+ @tel_mobile, @annee_dernCot, @Representant, @Type_adr, Ligne1, Ligne2, Ligne3, code_postal, ville,
+ zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
+SET
+`Type_adr` = IF(@Type_adr = 'E', 'E', IF(@Type_adr = '', '', 'P')),
+`hash_adresse` = SUBSTRING( MD5( @Type_adr ), 1, 5),
+`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
+
+LOAD DATA LOCAL INFILE 'Activites.txt' INTO TABLE `fusionax_adresses` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(provenance, id_ancien, @Code_etab, @Raison_sociale, @Libelle_fonctio, @Annuaire,
+Ligne1, Ligne2, Ligne3, code_postal, ville, zip_cedex, etat_distr, pays, tel, fax, @StringDate_maj)
+SET
+`Type_adr` = 'E',
+`hash_adresse` = SUBSTRING( MD5( CONCAT(@Code_etab, @Libelle_fonctio) ), 1, 5),
+`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
--- /dev/null
+-- Import complet des anciens
+
+DROP TABLE IF EXISTS fusionax_anciens;
+
+CREATE TABLE IF NOT EXISTS fusionax_anciens (
+ AN CHAR(2) NOT NULL COMMENT 'Vaut toujours AN pour cette table',
+ id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
+ Login VARCHAR(15) NOT NULL COMMENT 'Login sur le site de l''AX',
+ Password INT(11) NOT NULL COMMENT 'Mot de passe sur le site AX',
+ promotion_etude SMALLINT(4) NOT NULL COMMENT 'Promotion avec laquelle il/elle a fait ses études',
+ Groupe_promo ENUM('', 'A', 'B', 'C', 'N', 'S') character set binary NOT NULL COMMENT 'Groupe de promotion (code compris seulement par AX)',
+ Nom_patronymique VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom patronymique (nom de jeune fille) sans la particule',
+ partic_patro VARCHAR(5) character set utf8 NOT NULL COMMENT 'Particule du nom patronymique',
+ prenom VARCHAR(30) character set utf8 NOT NULL COMMENT 'Prénom',
+ Nom_usuel VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom usuel (nom marital par exemple) sans la particule',
+ partic_nom VARCHAR(5) character set utf8 NOT NULL COMMENT 'Particule du nom usuel',
+ Nom_complet VARCHAR(255) character set utf8 NOT NULL COMMENT 'Nom patronymique complet (avec la particule)',
+ Civilite ENUM('', '.', 'M', 'MME', 'MLLE') character set utf8 NOT NULL COMMENT 'Civilité',
+ Code_nationalite CHAR(4) NOT NULL COMMENT 'Nationalité (code)',
+ Type_membre ENUM('', '*', 'F', 'FB', 'P', 'PB', 'T', 'TB', 'TA') character set binary NOT NULL COMMENT 'Type de membre (code compris seulement par AX)',
+ corps_sortie VARCHAR(50) character set utf8 NOT NULL COMMENT 'Corps de sortie (ou D si aucun)',
+ Date_deces DATE COMMENT 'Date de décès',
+ grade VARCHAR(50) NOT NULL COMMENT 'Grade actuel dans son corps',
+ Mel_usage VARCHAR(255) NOT NULL COMMENT 'Adresse e-mail d''usage',
+ Mel_publiable TINYINT(4) NOT NULL COMMENT 'Autorisation d''utiliser le mail',
+ tel_mobile VARCHAR(30) NOT NULL COMMENT 'Numéro de téléphone mobile',
+ annee_dernCot INT(11) NOT NULL COMMENT 'Année de dernière cotisation AX',
+ Representant ENUM('', 'K', 'DE') character set binary NOT NULL COMMENT 'Représentant de promotion',
+ hash_adr_defaut BINARY(5) NOT NULL COMMENT 'Hash de l''adresse par défaut',
+ Date_maj DATE NOT NULL,
+ PRIMARY KEY (id_ancien)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+LOAD DATA LOCAL INFILE 'Anciens.txt' INTO TABLE `fusionax_anciens` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(`AN`, `id_ancien`, `Login`, `Password`, `promotion_etude`, `Groupe_promo`, `Nom_patronymique`, `partic_patro`, `prenom`, Nom_usuel, partic_nom,
+ Nom_complet, Civilite, Code_nationalite, Type_membre, corps_sortie, @StringDate_deces, grade, Mel_usage, Mel_publiable,
+ tel_mobile, annee_dernCot, Representant, @Type_adr_defaut, @AdrC_Ligne1, @AdrC_Ligne2, @AdrC_Ligne3, @AdrC_code_postal, @AdrC_ville,
+ @AdrC_zip_cedex, @AdrC_etat_distr, @AdrC_pays, @tel, @fax, @StringDate_maj)
+SET
+ `hash_adr_defaut` = SUBSTRING( MD5( @Type_adr_defaut ), 1, 5),
+ `Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2)),
+ `Date_deces` = CONCAT(SUBSTRING(@StringDate_deces,7),'-',SUBSTRING(@StringDate_deces,4,2),'-',SUBSTRING(@StringDate_deces,1,2));
+
+ALTER TABLE fusionax_anciens ADD INDEX (id_ancien);
+
+-- Correspondances entre fiches X.org et fiches AX
+DROP TABLE IF EXISTS `fusionax_import`;
+
+CREATE TABLE IF NOT EXISTS `fusionax_import` (
+ `id_ancien` VARCHAR(8) NOT NULL COMMENT 'identifiant AX de l''ancien',
+ `user_id` INT(11) DEFAULT NULL COMMENT 'identifiant x.org de l''ancien si on l''a trouvé',
+ `date_match_id` TIMESTAMP NULL DEFAULT NULL COMMENT 'date de mise en correspondance des identifiants',
+ PRIMARY KEY (`id_ancien`),
+ KEY `user_id` (`user_id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+INSERT INTO `fusionax_import` ( SELECT `id_ancien`, NULL, NULL FROM `fusionax_anciens` );
+REPLACE INTO `fusionax_import` ( SELECT `matricule_ax`, `user_id`, NOW() FROM `auth_user_md5` );
--- /dev/null
+-- Import complet des entreprises
+
+DROP TABLE IF EXISTS `fusionax_entreprises`;
+
+CREATE TABLE IF NOT EXISTS `fusionax_entreprises` (
+ `EN` CHAR(2) NOT NULL COMMENT 'Vaut toujours EN pour cette table',
+ `Code_etab` BIGINT(10) NOT NULL COMMENT 'Code de l''établissement',
+ `Raison_sociale` VARCHAR(255) collate utf8_general_ci NOT NULL COMMENT 'Raison sociale de l''établissement',
+ `Sigle` VARCHAR(50) collate utf8_general_ci NOT NULL COMMENT 'Sigle de l''établissement',
+ `Date_maj` DATE NOT NULL COMMENT 'Date de mise à jour de ces informations',
+ PRIMARY KEY(`Code_etab`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+LOAD DATA LOCAL INFILE 'Entreprises.txt' INTO TABLE `fusionax_entreprises` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n'
+(EN, Code_etab, Raison_sociale, Sigle, @Inconnu, @StringDate_maj)
+SET
+`Date_maj` = CONCAT(SUBSTRING(@StringDate_maj,7),'-',SUBSTRING(@StringDate_maj,4,2),'-',SUBSTRING(@StringDate_maj,1,2));
--- /dev/null
+-- Import complet des formations
+
+DROP TABLE IF EXISTS `fusionax_formations`;
+
+CREATE TABLE IF NOT EXISTS `fusionax_formations` (
+ FO CHAR(2) NOT NULL COMMENT 'Vaut toujours FO pour cette table',
+ id_ancien VARCHAR(8) NOT NULL COMMENT 'Id unique de l''ancien',
+ Intitule_diplome VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Intitulé du diplôme',
+ Intitule_formation VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Intitulé de la formation',
+ Descr_formation VARCHAR(60) collate utf8_general_ci NOT NULL COMMENT 'Description de la formation',
+ tmp_1 VARCHAR(60) collate utf8_general_ci NOT NULL,
+ tmp_2 VARCHAR(60) collate utf8_general_ci NOT NULL,
+ tmp_3 VARCHAR(60) collate utf8_general_ci NOT NULL,
+ tmp_4 VARCHAR(60) collate utf8_general_ci NOT NULL,
+ PRIMARY KEY (id_ancien, Intitule_diplome, Intitule_formation)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+ LOAD DATA LOCAL INFILE 'Formations.txt'
+ INTO TABLE fusionax_formations
+FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\r\n' (FO, id_ancien, Intitule_diplome, Intitule_formation, Descr_formation, tmp_1, tmp_2, tmp_3, tmp_4);
--- /dev/null
+#!/usr/bin/perl
+use utf8;
+open(FILE, "<:encoding(UTF-8)", "Formations.txt") || die ("Erreur d'ouverture");
+open(OUT, ">:encoding(UTF-8)", "Formations_out.txt") || die ("Erreur d'ouverture");
+
+while (<FILE>)
+{
+ # On enlève les dates de mises à jour
+ s/..\/..\/..../\t/;
+ s/..\/..\/../\t/;
+
+ s/\(//;
+ s/\)//;
+ s/3È Cycle//g;
+ s/3e cycle//g;
+ s/3e Cycle//g;
+ s/3È Cycle//g;
+ s/3ÈCycle//g;
+ s/3ÈCycle//g;
+ s/3ème cycle//g;
+ s/Master Chem\.Eng\.//g;
+ s/civ\.//g;
+ s/Civ\.//g;
+ s/ en / /g;
+ s/ ès / /g;
+ s/d'Etat//g;
+ s/ d'/ /g;
+ s/ de l'/ /g;
+ s/ de / /g;
+ s/Univ //g;
+ s/Univ\.//g;
+
+ # On enlève les fiches tordues de l'AX qui sont plus complètes chez nous et on modifie les lignes chiantes
+ s/FO\t19850253\tDEA Sciences et Techniques Environnement Créteil//;
+ s/FO\t19770064\tBiologie Moléculaire//;
+ s/FO\t19520093\tBT//;
+ s/FO\t19960133\tEngineering Management Certificate//;
+ s/FO\t19560013\tIng I\.E\.G\.//;
+ s/FO\t19780033\tMécanique des Transfert//;
+ s/FO\t19920017\tDEA\+ Thèse Doctorat Pharmacochimie moléculaire//;
+ s/FO\t20010319\tM\.Sc\.in applied Mathematics//;
+ s/FO\t19660131\tMS Schenectady NY/FO\t19660131\tMSc\tNYU/;
+ s/FO\t19870204\tENS/FO\t19870204\tDEA\tENS Ulm/;
+ s/FO\t19910162\tDESS CAAE IAE/FO\t19910162\tDESS\tIAE de Paris/;
+ s/FO\t19950283\tDESS CAAE MBA/FO\t19950283\tMBA\tIAE de Paris/;
+ s/FO\t20020411\tME : Madrid/FO\t20020411\tME\tUPM/;
+ s/FO\t19910255\tDoct Physique Solide Paris XI/FO\t19910255\tPhD\tParis-Sud\tPhysique des solides/;
+ s/FO\t19890053\tDoct. de Physique Univ.Paris XI/FO\t19890053\tPhD\tParis-Sud\tPhysique/;
+ s/FO\t19890248\tPh.D Physique Paris XI/FO\t19890248\tPhD\tParis-Sud\tPhysique/;
+ s/FO\t19580112\tDESGE Lyon III/FO\t19580112\tDipl.\tUniversité Jean-Moulin/;
+
+ # Modifications sur une ligne complète
+ s/IHEDN-CHEAR\t/IHEDN/;
+ s/CHEBAP/Ing.\tCHEC\tCHEBAP (Centre des Hautes Etudes du Béton Armé et Précontraint)/;
+ s/Escuela Sup\. Ing\. Caminos Canales y Puertos/Dipl.\tUPM/;
+ s/MS "Technology & Policy" MIT/MSc\tMIT/;
+ s/MS&E Stanford/MSc\tStanford/;
+ s/Engineering Management Cert.\t//;
+ s/Etudes sup\. Comptables & Financières\t//;
+
+ # On enlève les professions
+ s/Adm\. HC\t//;
+ s/Prof\. ENSMP\t//;
+ s/Prés\.hon.Colonie Fr\.du Caire\t//;
+ s/Anc\. Avocat au Bareau Toulon\t//;
+ s/Insp\.gén\.hon\.CEA\t//;
+ s/Insp\.Gén\.CRdes Aff\.d'O\.M\.\t//;
+ s/Prof Emérite Gén\. Méca\.\t//;
+ s/Prof\.Hon\.Sup\.Aéro\t//;
+ s/Anc\.DG Dassault Aviation\t//;
+ s/Prof\.des Universités\t//;
+ s/Direct\.Hon.BNP\t//;
+ s/Prof\. hon\. Bordeaux I\t//;
+ s/Architecte DPLG\t//;
+ s/Conseiller Commercial hors classe\t//;
+ s/Professeur des Universités\t//;
+ s/Gestalt praticien\t//;
+ s/Adm\.\t//;
+ s/Psychologue Clinicien\t//;
+ s/Inspecteur des Finances\t//;
+ s/Don religion\t//;
+ s/Prof\. ENSMP\t//;
+ s/Pilote militaire Hélicoptère\t//;
+ s/Ing\. Navigant Essais Hélicoptère\t//;
+ s/Analyste SFAF\t//;
+ s/European Patent Attorney\t//;
+ s/Pilotage militaire\t//;
+ s/Mandataire agrée OEB\t//;
+ s/Chartered Financial Analyst\t//;
+ s/Pilote chasse\t//;
+ s/Avocat au Barreau Paris\t//;
+ s/Prof\.\t//;
+ s/EURATOM\t//;
+
+ # On enlève les sigles inconnus
+ s/Baccalauréat canonique\t//;
+ s/BEL\t//;
+ s/BEMS\t//;
+ s/BESG\t//;
+ s/Brth\t//;
+ s/BT\t//;
+ s/CES Informatique\t//;
+ s/CESDR\t//;
+ s/CFAF\t//;
+ s/CHEA\t//;
+ s/CHEAR\t//;
+ s/CHEE&DD Session 9\t//;
+ s/CESB\t//;
+ s/CESSID\t//;
+ s/CNAM\t//;
+ s/Collège des Sciences Soc\. et Eco\.\t//;
+ s/CRC\t//;
+ s/CSCP\t//;
+ s/CSME Session 29\t//;
+ s/D\.E\.M\.\t//;
+ s/DECF\t//;
+ s/DECS\t//;
+ s/DESA//;
+ s/DIUUP\t//;
+ s/DRES Sciences\t//;
+ s/DSN\t//;
+ s/DT\t//;
+ s/EATG\t//;
+ s/EERN//;
+ s/Ecole Chasse\t//;
+ s/ENS Armement\t//;
+ s/ENSGM\t//;
+ s/ENSME\t//;
+ s/ESMIM Nancy\t//;
+ s/ESO\t//;
+ s/ETS II\t//;
+ s/Fla USA\t//;
+ s/IAC\t//;
+ s/IAF\t//;
+ s/ICAF Washington\t//;
+ s/ICG\t//;
+ s/IESTO\t//;
+ s/IGP Bordeaux\t//;
+ s/Inst\. Auguste Comte\t//;
+ s/Institut Auguste Comte\t//;
+ s/Institut Auguste Comte IAC\t//;
+ s/Institut Contrôle Gestion//;
+ s/ISNSE Argunne National Laboratory USA\t//;
+ s/FRM\t//;
+ s/MITI Japon\t//;
+ s/MRM\t//;
+ s/Pasadena//;
+ s/React\. School Harwell\t//;
+ s/SFAF\t//;
+ s/SFAF CIIA\t//;
+ s/SM Management\t//;
+ s/Univer\. Ecolo\. Tropic\.//;
+
+ # On adapte les diplômes bien placés
+ s/Ing\./Ing.\t/;
+ s/Licenci./Lic.\t/;
+ s/Licence/Lic.\t/;
+ s/Lic\./Lic.\t/;
+ s/Deug/DEUG\t/;
+ s/DEUG/DEUG\t/;
+ s/Dipl.me/Dipl.\t/;
+ s/Dipl\./Dipl.\t/;
+ s/Anc\.El\./Dipl.\t/;
+ s/DU/Dipl.\t/;
+ s/Agr\./Agr.\t/;
+ s/Agr.g. d.Univers\./Agr.\t/;
+ s/Agrégée/Agr.\t/;
+ s/Agr.g./Agr.\t/;
+ s/Certifi./CAPES\t/;
+ s/Cert\./CAPES\t/;
+ s/CAPES/CAPES\t/;
+ s/DESCF/DESCF\t/;
+ s/DES\./DESS\t/;
+ s/DES\t/DESS\t/;
+ s/DES /DESS\t/;
+ s/DESS/DESS\t/;
+ s/DEA/DEA\t/;
+ s/Doctorat/PhD\t/;
+ s/Docteur/PhD\t/;
+ s/Doct\./PhD\t/;
+ s/Doct/PhD\t/;
+ s/Ph\.D/PhD\t/;
+ s/PhD/PhD\t/;
+ s/Ph D/PhD\t/;
+ s/Dr\./PhD\t/;
+ s/Doc\./PhD\t/;
+ s/Th.se/PhD\t/;
+ s/doctorat oncogénèse/PhD\t/;
+ s/HDR/HDR\t/;
+ s/HdR/HDR\t/;
+ s/Habil\. Dir\.Recherche/HDR\t/;
+ s/Habilitation à diriger les recherches/HDR\t/;
+ s/Habilitation à Diriger des Recherche/HDR\t/;
+ s/Habilitation à diriger des Recherches/HDR\t/;
+ s/Habilitation à diriger des Rech\./HDR\t/;
+ s/Habilitation à diriger des recherches/HDR\t/;
+ s/Habilitation U\./HDR\t/;
+ s/Habilitation/HDR\t/;
+ s/Habil\./HDR\t/;
+ s/Habilité à la dir\. rech\./HDR\t/;
+ s/MSUCLA/MSc\tUCLA/;
+ s/MSc /MSc\t/;
+ s/MS /MSc\t/;
+ s/MS\t/MSc\t/;
+ s/MS\./MSc\t/;
+ s/M\.Sc\./MSc\t/;
+ s/M\.Sc/MSc\t/;
+ s/M\. Sc\./MSc\t/;
+ s/Master of Sciences/MSc\t/;
+ s/Master of Science/MSc\t/;
+ s/Masters of Sciences/MSc\t/;
+ s/Master Urbanisme/MUP\t/;
+ s/MCityPlann/MUP\t/;
+ s/MCP/MUP\t/;
+ s/MUP/MUP\t/;
+ s/Executive MBA/MBA/;
+ s/EMBA/MBA/;
+ s/MBA/MBA\t/;
+ s/BTS/BTS\t/;
+ s/M\. A\./MA\t/;
+ s/M\.A\./MA\t/;
+ s/\tMA/\tMA\t/;
+ s/Executive MA/MA\t/;
+ s/ME/ME\t/;
+ s/M\.Eco\.Agric\./MEE\t/;
+ s/M\.Eco\./ME\t/;
+ s/M\. Eng\./MEng\t/;
+ s/Master Ing\./MEng\t/;
+ s/Masters of Electrical Engineering/MEE\t/;
+ s/MEE/MEE\t/;
+ s/MSEE/MEE\t/;
+ s/Ma.trise/Maîtr.\t/;
+ s/Ma.tre/Maîtr.\t/;
+ s/Mphil/MPhil\t/;
+ s/M\.Phil\./MPhil\t/;
+ s/MPhil/MPhil\t/;
+ s/MPA/MPA\t/;
+ s/MCP/MCP\t/;
+ s/Master Electronique/MEl\t/;
+ s/MEl/MEl\t/;
+ s/Master Management par les comp.tences et organisations/MM\t/;
+ s/Master of Management/MM\t/;
+ s/Management Paris/\tManagement/;
+ s/DDI/Dipl.\t/;
+ s/3.me Cycle Fac\./Dipl.\t/;
+ s/MIB/MIB\t/;
+ s/Master of Eng in Manufacturing/MEM\t/;
+ s/Master Engin.Science/MEng\t/;
+ s/BA /BA\t/;
+ s/Post Doc//;
+ s/Post PhD//;
+ s/Auditeur/Dipl.\t/;
+ s/Dr Phys\.chim\.biotransformation/PhD\t\tPhysique, chimie, biotransformation/;
+
+ # On nettoye les tab en trop et les ponctutions inutiles
+ s/\t\t\t/\t/g;
+ s/\t\t/\t/g;
+ s/\t,/\t/g;
+ s/\t-/\t/g;
+ s/\t:/\t/g;
+ s/\t\./\t/g;
+ s/(\t)( )+/\t/g;
+ s/\ten /\t/g;
+ s/\tin /\t/g;
+ s/\tès /\t/g;
+ s/\tof /\t/g;
+ s/( )+(\t)/\t/g;
+
+
+ # On remet dans l'ordre lorsque le diplôme se situe après l'université
+ s/Manag\.Vanderblit/Vanderbilt University\tManagement/;
+ s/AMHERST MA/MA\tAmherst College/;
+ s/Executive Education, Harvard \tBusiness School/MBA\tHarvard/;
+ s/Harvard MPA/MPA\tHarvard/;
+ s/Harvard MA/MA\tHarvard/;
+ s/Advanced Manag\. Program Harvard/Harvard/;
+ s/DEA : ENS/DEA\tENS Ulm/;
+ s/ENS Ulm DEA/DEA\tENS Ulm/;
+ s/ENS Ulm :DEA/DEA\tENS Ulm/;
+ s/ENS Ulm : DEA/DEA\tENS Ulm/;
+ s/ENS Ulm : PhD/PhD\tENS Ulm/;
+ s/ENS Ulm/MSc\tENS Ulm/;
+ s/Ecole Normale Sup.Ulm/MSc\tENS Ulm/;
+ s/\tENS\t/\tENS Ulm/;
+ s/Moscow : ME/ME\tBauman MSTU/;
+ s/Supoptique : Ing\./Ing.\tSupOptique/;
+ s/EP Montr.al Ing\./Ing.\tEPM/;
+ s/EP Montr.al Ing/Ing.\tEPM/;
+ s/EP Montr.al MSc/MSc\tEPM/;
+ s/EP Montr.al MS/MSc\tEPM/;
+ s/MsChicago/MSc\tUniversity of Chicago/;
+ s/Sciences Po/Sciences Po\t/;
+ s/IEP DEA/DEA\tSciences Po/;
+ s/Master AMUR/MUP\tPonts\tMastère AMUR/;
+ s/Master CAR/MSc\tTélécom\tMastère CAR/;
+ s/Mastère SSIR ENST/MSc\tTélécom\tMastère SSIR/;
+ s/KTH Stockholm Master Mech. Eng./MME\tKTH/;
+ s/ESCP-EAP Executive MSc/MSc\tESCP-EAP/;
+ s/Biologie Paris VI/Paris VI\tBiologie/;
+ s/HEC : MS/MSc\tHEC/;
+ s/HEC : MA/MA\tHEC/;
+ s/HEC : MBA/MBA\tHEC/;
+ s/Master HEC Entrepreneurs/ME\tHEC\tHEC-Entrepreneurs /;
+ s/HEC-Entrepreneurs/ME\tHEC\tHEC-Entrepreneurs /;
+ s/Master HEC Finance/ME\tHEC/;
+ s/Strategic Management HEC/HEC\tStrategic Management/;
+ s/Marketing HEC/HEC\tMarketing/;
+ s/Economie EHESS-ENSAE/EHESS\tÉconomie/;
+ s/EHESS : PhD/PhD\tEHESS/;
+ s/EHESS DEA/DEA\tEHESS/;
+ s/EHESS Phd/PhD\tEHESS/;
+ s/ESSEC Mast.re Tehniques Financi.res/ME\tESSEC\tMastère Techniques Financières/;
+ s/ESSEC : MA/MA\tESSEC/;
+ s/ESSEC-MANNHEIM/ESSEC/;
+ s/ESSEC : MBA/MBA\tESSEC/;
+ s/M.decine : Dipl\./Dipl.\tMédecine/;
+ s/Sup.A.ro\. : PhD/PhD\tSUPAERO/;
+ s/INSEAD : MA/MA\tINSEAD/;
+ s/INSEAD : MBA/MBA\tINSEAD/;
+ s/TU Berlin :ME/ME\tTU Berlin/;
+ s/Mast.re Am.nagement et Ma.tr./MUP\t\tMastère Aménagement et Maîtr./;
+ s/Master Droit des affaires Int. & Eur./MIB\t\tMaster Droit des affaires Int. & Eur./;
+ s/Finance LSE/LSE\tFinance/;
+ s/Finance London Business School/London Business School\tFinance/;
+ s/Chimie Organique ENSTA/ENSTA\tChimie organique/;
+ s/Informatique Stanford/Stanford\tInformatique/;
+
+ # On normalise les universités
+ s/Dipl ISUP\t/Dipl.\tUMPC\t/;
+ s/ISUP\t/Dipl.\tUMPC\t/;
+ s/DESIA\t/Dipl.\tSUPAERO\t/;
+ s/IHESI\t/Dipl.\tINHES\t/;
+ s/Ctre Form\.Journaliste\t/Dipl.\tCFJ\t/;
+ s/Collège InterArmées Défense\t/Dipl.\tCollège Interarmées de Défense\t/;
+ s/AFITEP\t/Dipl.\tAFITEP\t/;
+ s/CEDEP cycle 43\t/CEDEP\t/;
+ s/CEDEP\t/Dipl.\tCEDEP\t/;
+ s/Bocconi University Milan/Dipl.\tUniversità Bocconi/;
+ s/Columbia\t/Columbia University\t/;
+ s/EMP Columbia Bus\.School\./Dipl.\tColumbia University/;
+ s/Columbia & sciences Po/Columbia University/;
+ s/Columbia \+ LBS/Columbia University/;
+ s/Columbia University & sciences Po/Columbia University/;
+ s/Columbia University + LBS/Columbia University/;
+ s/CESS ENSAÉ/Dipl.\tENSAE/;
+ s/EAPB Ecole Architecture Paris Belleville/Dipl.\tENSAPB/;
+ s/EDP\/INSEAD/Dipl.\tINSEAD/;
+ s/PSD INSEAD/Dipl.\tINSEAD/;
+ s/INSEAD/Dipl.\tINSEAD/;
+ s/EDP\/INSEAD/Dipl.\tINSEAD/;
+ s/INSEAD/Dipl.\tINSEAD/;
+ s/PSD INSEAD/Dipl.\tINSEAD\tProgramme Supérieur pour Dirigeants/;
+ s/INSEAD - AMP/Dipl.\tINSEAD/;
+ s/INSEAD Executive Program/Dipl.\tINSEAD/;
+ s/IMI Harvard/Dipl.\tHarvard/;
+ s/Advanced Manag\. Program Harvard/MBA\tHarvard/;
+ s/Harvard Business Sch\. Alumnus/Dipl.\tHarvard/;
+ s/Executive Education, Harvard Business School/Dipl.\tHarvard/;
+ s/Harvard/Dipl.\tHarvard/;
+ s/Havard/Harvard/;
+ s/M\. Eng Cornell University/MEng\tCornell/;
+ s/Cornell Ithaca/Cornell/;
+ s/Cornell NY/Cornell/;
+ s/NY\t/NYU\t/;
+ s/New-York/NYU/;
+ s/New York University/NYU/;
+ s/New York/NYU/;
+ s/MS Politecnico di Milano/MSc\tPolitecnico di Milano/;
+ s/\tMilano/\tPolitecnico di Milano/;
+ s/Computer Sc\.MIT/MIT\tComputer science/;
+ s/Techno\.Policy MIT/MIT\tTechno. Policy/;
+ s/NA MIT/MA\tMIT/;
+ s/MIT/Dipl.\tMIT\t/;
+ s/MIT Chemical Engineering/MCE\tMIT/;
+ s/Massuchusetts Institute of Technology/MIT/;
+ s/Massachusetts Institute of Technologie/MIT/;
+ s/Massachusetts Institute of Techn\./MIT/;
+ s/Massachusetts Inst\. of Technology/MIT/;
+ s/Massachusetts Inst of Tech/MIT/;
+ s/Massachusetts/MIT/;
+ s/Msc\.Massachus\./MIT/;
+ s/Sup.A.ro./Ing.\tSUPAERO/;
+ s/Sup.A.ro.\/KTH/Ing.\tSUPAERO/;
+ s/Aéro\./SUPAERO/;
+ s/SUPAEROAstro &EECS/SUPAERO/;
+ s/SUPAERO\/KTH/SUPAERO/;
+ s/Syracuse USA/Dipl.\tSU/;
+ s/EHESS/Dipl.\tEHESS/;
+ s/IHEDN/Dipl.\tIHEDN/;
+ s/IHEDN 26° session/Dipl.\tIHEDN/;
+ s/Business School Dartmouth/Dipl.\tDartmouth College /;
+ s/ENSAE/Dipl.\tENSAE/;
+ s/ENSAE Statisticien économiste/Dipl.\tENSAE/;
+ s/ENSAE Malakoff/Dipl.\tENSAE/;
+ s/\tIllinois\t/\tUniversity of Illinois\t/;
+ s/University of Illinois/Dipl.\tUniversity of Illinois/;
+ s/CEPE/Dipl.\tCEPE/;
+ s/CEPE Ecole Pratique des Hautes Etudes/Dipl.\tCEPE/;
+ s/ECE/Ing.\tECE/;
+ s/Ecole Centrale d’Electronique ECE/Ing.\tECE/;
+ s/Science Stanford/Stanford\tSience/;
+ s/Econom\.Stanford/Stanford\tÉconomie/;
+ s/Electrical Eng Stanford/Stanford\tElectrical engineering/;
+ s/Management a Stanford/Stanford\tManagement/;
+ s/SEP Stanford/Dipl.\Stanford/;
+ s/Stanford SEP/Dipl.\tStanford/;
+ s/Stanford/Dipl.\tStanford/;
+ s/Stanford Executive Program/Dipl.\tStanford/;
+ s/Stanford University/Dipl.\tStanford/;
+ s/Stanford /Stanford\t/;
+ s/Sc\.Po\. Paris/Dipl.\tSciences Po\t/;
+ s/Sc\.Po\. Economie/Dipl.\tSciences Po\t/;
+ s/Sc\.Po\. Gestion et Strat.gie des Entreprises/Dipl.\tSciences Po\tGestion et Stratégie des Entreprises/;
+ s/Sc\.Po\./Dipl.\tSciences Po/;
+ s/Lauréat IEP/Dipl.\tSciences Po/;
+ s/IEP Paris Lic\./Dipl.\tSciences Po/;
+ s/IEP Paris/Dipl.\tSciences Po/;
+ s/IEP/Dipl.\tSciences Po/;
+ s/Auditeur Sc\.Politique/Dipl.\tSciences Po\t/;
+ s/Sciences politiques/Sciences Po/;
+ s/Sc\.Politique/Sciences Po/;
+ s/IAE Paris/MBA\tIAE de Paris/;
+ s/\tIAE\t/\tMBA\tIAE de Paris\t/;
+ s/EPNER/Dipl.\tEPNER/;
+ s/ENSAR/Ing.\tENSAR/;
+ s/Uc.Berkeley/Berkeley/;
+ s/UC Berkeley/Dipl.\tBerkeley/;
+ s/CEIPI/Dipl.\tCEIPI/;
+ s/Institute for Management Development/IMD/;
+ s/\tLausanne/\tUNIL/;
+ s/IMD Lausanne/Dipl.\tUNIL/;
+ s/EP F.d.ration Lausanne/Dipl.\tEPFL/;
+ s/EP F.d.rale Lausanne/Dipl.\tEPFL/;
+ s/cycle postgrade EPFL option Finance/Dipl.\tEPFL\toption Finance/;
+ s/Ecol\. Poly\. F.d.rale Lausanne/Dipl.\tEPFL/;
+ s/EP F.d.rale Lausanne/Dipl.\tEPFL/;
+ s/EPFL G.nie Mécanique/Dipl.\tEPFL\tGénie Mécanique/;
+ s/EP F.d.rale Lausane/Dipl.\tEPFL/;
+ s/Ecole Polytechnique Lausanne/EPFL/;
+ s/ISMCM Saint-Ouen/Dipl.\tISMCM Saint-Ouen/;
+ s/ISCM/ISMCM Saint-Ouen/;
+ s/ENAC/Dipl.\tENAC/;
+ s/HEC\/Ucla/HEC/;
+ s/Mast.re Gestion Financi.re HEC/ME\tHEC\tMastère Gestion Financière/;
+ s/\tHEC/\tDipl.\tHEC/;
+ s/CPA-HEC/HEC/;
+ s/HEC Master Gestion du Changement/ME\tHEC\tMaster Gestion du Changement/;
+ s/HEC Execut\. Management \/ CPA/Dipl.\tHEC/;
+ s/HEC Majeure Finance/Dipl.\tHEC\tMajeure Finance/;
+ s/CESA Achats HEC Management/Dipl.\tHEC/;
+ s/HEC Entrepreneurs/Dipl.\tHEC/;
+ s/HECc/HEC/;
+ s/HEC\/CPA/HEC/;
+ s/HEC Start\. Management/HEC\tStart. Management/;
+ s/HEC Finance/HEC\tFinance/;
+ s/Centre des Hautes Etudes la Construction/Ing.\tCHEC/;
+ s/CHEC/Ing.\tCHEC/;
+ s/Ecole Air/Dipl.\tÉcole de l\'Air/;
+ s/EAVT/Dipl.\tEAVT/;
+ s/EAVT Ecole architecture Marne La Vall.e/Dipl.\tEAVT/;
+ s/Master ENPC Action publique/M\tPonts\tMaster Action publique/;
+ s/ENPC/Ing.\tPonts/;
+ s/Master P\.C\./MSc\tPonts/;
+ s/P\.C\./Ponts\t/;
+ s/EAPLV Ecole Architecture Paris La Villette/Dipl.\tENSAPLV/;
+ s/EAPLV/Dipl.\tENSAPLV/;
+ s/Cambridge Profic\./Dipl.\tCambridge/;
+ s/London Business School/Dipl.\tLondon Business School/;
+ s/ENSIC/Dipl.\tENSIC/;
+ s/ENSIC Nancy/Ing.\tENSIC/;
+ s/Internat\. Teachers Progr./Dipl.\tITP/;
+ s/Institut Sup.rieur des Affaires/Dipl.\tISA/;
+ s/ISA/Dipl.\tISA/;
+ s/ISAA/Dipl.\tISAA/;
+ s/ENSCP/Ing.\tChimie Paris/;
+ s/Engineer Kentucky/Ing.\tUK/;
+ s/EP Gda.sk Pologne/Dipl.\tUniwersytet Gdański/;
+ s/ESPCI/Ing.\tESPCI/;
+ s/ESPCI Ecole Sup\. Phys\. et Chimie Industrielles/Ing.\tESPCI/;
+ s/ESG/Dipl.\tESG Paris/;
+ s/ESSEC Management g.n.ral/Dipl.\tESSEC/;
+ s/ESSEC/Dipl.\tESSEC/;
+ s/Ecole Nat. Eaux et For.t Nancy/Ing.\tENGREF/;
+ s/Sc\. environnement ENGREF/ENGREF\tSciences environnementales/;
+ s/\tGREF/\tENGREF/;
+ s/du Québec à Montréal/UQÀM/;
+ s/EP Montréal/Dipl.\tEPM/;
+ s/Mast\.Biotechnology Montréal/MB\tEPM/;
+ s/Montréal/EPM/;
+ s/Québec/UQÀM/;
+ s/Ec\.Polyt\.Montreal/EPM/;
+ s/Actuaire/Dipl.\tInstitut des Actuaires/;
+ s/Actuaire IAF-CEA/Dipl.\tInstitut des Actuaires/;
+ s/Actuaire IAF/Dipl.\tInstitut des Actuaires/;
+ s/Actuaire CEA/Dipl.\tInstitut des Actuaires/;
+ s/Actuariat-Iaf/Dipl.\tInstitut des Actuaires/;
+ s/Actuaire qualifi./Dipl.\tInstitut des Actuaires/;
+ s/Institut des Actuaires qualifié/Institut des Actuaires/;
+ s/Institut des Actuaires IAF-/Institut des Actuaires/;
+ s/STEGE MGT GENERAL ESCP-EAP/Dipl.\tESCP-EAP/;
+ s/ESCP-EAP/Dipl.\tESCP-EAP/;
+ s/\tESCP\t/\tESCP-EAP\t/;
+ s/IHEE/Dipl.\tIHEE/;
+ s/ENS G.ographiques/Corps\tGéographes/;
+ s/Ecole Nat. des Sc. G.ographiques/Corps\tGéographes/;
+ s/ENST Bretagne/Ing.\tTélécom Bretagne/;
+ s/Collède des Ing\./CDI/;
+ s/Collège des Ing\./CDI/;
+ s/Collège Ing\./CDI/;
+ s/Collèges des Ing\./CDI/;
+ s/Collège des Ingénieurs/CDI/;
+ s/CDI/Dipl.\tCDI/;
+ s/Ecole Nationale la Magistrature/Dipl.\tENM/;
+ s/ENSTA/Ing.\tENSTA/;
+ s/\tGM\t/\tENSTA\t/;
+ s/ENSP Versailles/Dipl.\tENSP/;
+ s/ENSP/Dipl.\tENSP/;
+ s/Investment Banking Program-Kellog School of Management/Dipl.\tKellogg/;
+ s/IFSBM/Dipl.\tIFSBM/;
+ s/Inst\.Form\. Sup\.Biom.dicale/Dipl.\tIFSBM/;
+ s/EMA/Ing.\tEMA/;
+ s/Ecole Supérieure Electricité/Ing.\tSupélec/;
+ s/ESE/Ing.\tSupélec/;
+ s/Supelec 86 - MBA/Supélec/;
+ s/UCSD/Dipl.\tUCSD\t/;
+ s/UC San Diego/UCSD/;
+ s/San Diego/UCSD/;
+ s/California UCSD/UCSD/;
+ s/ENSAM/Ing.\tENSAM/;
+ s/Arts et Métiers/ENSAM/;
+ s/IFFI/ENSAM\tIFFI/;
+ s/USMC Command & Staff College/MSc\tMCU/;
+ s/University Coll.Londres/Dipl.\tUCL/;
+ s/TU Munich/TU München/;
+ s/TU M.nchen/Dipl.\tTU München/;
+ s/\tMünchen/\tTU München/;
+ s/\tM\.\t/\tMines\t/;
+ s/Mines Paris/Mines/;
+ s/ENSMP/Ing.\tMines/;
+ s/ISIGE/Mines\tISIGE/;
+ s/LSE/Dipl.\tLSE/;
+ s/London School Econ\.& Polit\. Sc\./LSE/;
+ s/London School Economics/LSE/;
+ s/London School of Eco\./LSE/;
+ s/London School of Econ\./LSE/;
+ s/London School of Economics/LSE/;
+ s/Lonson School of Economics/LSE/;
+ s/Chartered Institute of Management Accountant/M\tCIMA/;
+ s/CFA/Dipl.\tCFA Institute/;
+ s/INAPG/Ing.\tINAPG/;
+ s/Agronome/Ing.\tINAPG/;
+ s/Agro/Ing.\tINAPG/;
+ s/INA PG/INAPG/;
+ s/Naval Postgraduate School/Dipl.\tNPS/;
+ s/ENSSEIHT Informatique/Ing.\tENSEEIHT/;
+ s/ENSEEIHT/Ing.\tENSEEIHT/;
+ s/ENSEEIHT Toulouse/ENSEEIHT/;
+ s/ENA/Dipl.\tENA/;
+ s/Colorado\t/Colorado School of Mines/;
+ s/Colorado Scholl of MInes/Dipl.\tColorado School of Mines/;
+ s/Colorado school of Mines/Dipl.\tColorado School of Mines/;
+ s/Ing RWTH-Aachen/Ing.\tRWTH/;
+ s/Ing RWTH-Aachen/Ing.\tRWTH/;
+ s/RWTH Aachen/Dipl.\tRWTH/;
+ s/TH Aachen/RWTH/;
+ s/RWTH-Aachen/RWTH/;
+ s/Th Aachen/RWTH/;
+ s/UCLA\t/Dipl.\tUCLA\t/;
+ s/Computer Sc\.Ucla/UCLA/;
+ s/UCLA Anderson/UCLA/;
+ s/Los Angeles/UCLA/;
+ s/Royal College of Art Londres/Dipl.\tRCA/;
+ s/Royal College of Art Londres /Dipl.\tRCA/;
+ s/de Caminos Madrid/UPM/;
+ s/Ingeniero Industrial UPM Madrid/Ing.\tUPM/;
+ s/ETSII Madrid/Dipl.\tUPM/;
+ s/Madrid/Dipl.\tUPM/;
+ s/ENS Cachan/Dipl.\tENS Cachan/;
+ s/\tCachan/\tENS Cachan/;
+ s/ENS CACHAN/ENS Cachan/;
+ s/ENS Cachan Math Appliquée/ENS Cachan\tMathématiques appliquées/;
+ s/Collège Europe Natolin Varsovie/Dipl.\tCollege of Europe/;
+ s/Collège Europ\.Bruges/\tCollege of Europe/;
+ s/New South Wales Sydney Australia/UNSW/;
+ s/New South Wales Sydney Austr\./UNSW/;
+ s/New South Wales/UNSW/;
+ s/Master of Env. Engin. Science UNSW Sydney/MEE\tUNSW/;
+ s/S Sydney/UNSW/;
+ s/Design UNSW/UNSW\tDesign/;
+ s/Interne Chirurgie/Dipl.\tMédecine/;
+ s/X-HEC/X\t/;
+ s/X Chimie Orga/X\tChimie organique/;
+ s/X Physique/Physique/;
+ s/X Math app\./Mathématiques appliquées/;
+ s/Chimie Ec\. Polyt\./X\tChimie/;
+ s/Master X Projet-Innovation-Conception/MSc\tX\tMaster X Projet-Innovation-Conception/;
+ s/Master PIC/M\tX\tMaster PIC/;
+ s/Ec\. Polyt\./X\t/;
+ s/Supoptique/Ing.\tSupOptique/;
+ s/Universiteit/Universiteit Leiden/;
+ s/\tLeiden/\tDipl.\tUniversiteit Leiden/;
+ s/Phys.Théor. ENS Lyon/ENS Lyon\tPhysique théorique/;
+ s/ENS Lyon/Dipl.\tENS Lyon/;
+ s/- U of Michigan/Michigan/;
+ s/Eng Birmingham/University of Birmingham/;
+ s/Imperial Collège/Imperial College/;
+ s/Advanced Mechanical Engin\. , Imperial College Londres/Imperial College\tAdvanced mechanical engineering/;
+ s/Imperial College GB/Imperial College/;
+ s/Boulder/CU/;
+ s/Californie Institute of Technology/CalTech/;
+ s/CIT/CalTech/;
+ s/Carnegie Mellon/CMU/;
+ s/Comput\.Carnégie Mellon Univ/CMU/;
+ s/Caroline du Nord Chapel Hill/Carolina/;
+ s/Ctre Perf\. aux Affaires/CPA de Paris/;
+ s/Centre Perfect\. aux Affaires/CPA de Paris/;
+ s/Centre Perfection\. aux Affaires/CPA de Paris/;
+ s/CPA\t/MBA\tCPA de Paris/;
+ s/CPA 73\/2\t/MBA\tCPA de Paris/;
+ s/CPA Lyon\t/MBA\tCPA de Lyon/;
+ s/CPA Nord\t/MBA\tCPA du Nord/;
+ s/\tChicago/\tUniversity of Chicago/;
+ s/Econom\.Chicago/University of Chicago\tÉconomie/;
+ s/Cleveland/CSU/;
+ s/Architect\.Univers\.Rome/University of Rome\tArchitecture/;
+ s/d'University of Rome/University of Rome/;
+ s/\tUC Davis/\tUC Davis/;
+ s/\tDavis/\tUC Davis/;
+ s/University of California/UCSB/;
+ s/Université Tokyo/Todai/;
+ s/Tokyo/Todai/;
+ s/Université Stuttgart/Universität Stuttgart/;
+ s/\tStuttgart\t/\tUniversität Stuttgart\t/;
+ s/diplomé Fac\. Aéronautique Stuttgart/Universität Stuttgart\tAéronautique/;
+ s/Zürich/Universität Zürich/;
+ s/Zurich/Universität Zürich/;
+ s/Ec\.Polyt\.Universität Zürich/ETH Zürich/;
+ s/Yale/Yale\t/;
+ s/Wisconsin-Madison/UW-Madison/;
+ s/Wisconsin USA/UW-Madison/;
+ s/Wisconsin/UW-Madison/;
+ s/Wharton/The Wharton School/;
+ s/Pennsylvania The Wharton School/The Wharton School/;
+ s/Pennsylvania\t/University of Pennsylvania\t/;
+ s/Washington/University of Washington/;
+ s/Urbana/Urbana University/;
+ s/Stat\.Texas A&M/TAMU/;
+ s/Texas A&M/TAMU/;
+ s/TAMU University/TAMU/;
+ s/Austin/UT Austin/;
+ s/Texas/UT Austin/;
+ s/UBC Canada/UBC/;
+ s/Torino/UNITO/;
+ s/Téléc\./Télécom/;
+ s/ENST\t/Télécom\t/;
+ s/ENST licencié sciences économiques/Télécom\tLicenci sciences économiques/;
+ s/Southampton/University of Southampton/;
+ s/Nat\. of Singapore/NUS/;
+ s/Singapour/NUS/;
+ s/Kyoto/Kyoto University/;
+ s/Karlsruhe/Universität Karlsruhe/;
+ s/Johns Hopkins/JHU/;
+ s/Sheffield/University of Sheffield/;
+ s/Santa Barbara/UCSB/;
+ s/Salt Lake City/University of Utah/;
+ s/Rotterdam School of Management/RSM/;
+ s/Queen's Canada/Queen's/;
+ s/Purdue/Purdue University/;
+ s/Pompeu Fabra/UPF/;
+ s/Polytech\. Bucarest/Universitatea Politehnica din Bucureşti/;
+ s/Petroleum Engineering - TU Delft/TU Delft\tPetroleum engineering/;
+ s/Paris Paris-Diderot/Paris-Diderot/;
+ s/Watson School of Biological/WSBS/;
+ s/Ottawa/OU/;
+ s/Northwestern University/NU/;
+ s/Northwestern/NU/;
+ s/N\.Dame Indiana/Notre Dame/;
+ s/Moscow/MGU/;
+ s/Mc Gill University/McGill/;
+ s/Maryland/UMCP/;
+ s/Iowa/University of Iowa /;
+ s/Institut Polytechnique Grenoble/Grenoble INP/;
+ s/INPG/Grenoble INP/;
+ s/INPL Institut National Polytechnique Lorraine/INPL/;
+ s/INP Toulouse/INP Toulouse\t/;
+ s/IHM INPT/INP Toulouse\tIHM/;
+ s/ENSPM/ENSPM\t/;
+ s/IFP/ENSPM/;
+ s/Houston/UH/;
+ s/Georgia\t/UGA\t/;
+ s/Finance Princeton/Princeton\tFinance/;
+ s/Elect\.Engineer\.Princeton/Princeton\tElectrical engineering/;
+ s/ENSHG/ENSHMG/;
+ s/Dallas/University of Dallas/;
+ s/British Columbia University/UBC/;
+
+ s/\tSorbonne\t/\tPanthéon-Sorbonne\t/;
+ s/\t1\t/\tPanthéon-Sorbonne\t/;
+ s/Finance Paris I/Panthéon-Sorbonne\tFinance/;
+ s/Sc.Eco. Paris 1/Panthéon-Sorbonne\tSciences économiques/;
+ s/CAAE \. Paris I/Panthéon-Sorbonne/;
+ s/Paris 1er/Panthéon-Sorbonne/;
+ s/Paris 1 Modélisation Econ\.& Fin\./Panthéon-Sorbonne\tModélisation économie et finance/;
+ s/Paris 1\t/Panthéon-Sorbonne\t/;
+ s/Philo\.Paris I/Panthéon-Sorbonne\tPhilosophie/;
+ s/Paris I\t/Panthéon-Sorbonne\t/;
+ s/Droit Paris 2/Assas\tDroit/;
+ s/Paris 2/Assas/;
+ s/Paris II Panthéon - Assas/Assas/;
+ s/Paris II Panthéon/Assas/;
+ s/Paris-Sorbonne/Paris-Sorbonne\t/;
+ s/Philosophie Paris IV Sorbonne/Paris-Sorbonne\tPhilosophie/;
+ s/Paris 4/Paris-Sorbonne/;
+ s/Paris IV/Paris-Sorbonne\t/;
+ s/Paris 5/Paris-Descartes/;
+ s/Paris V\t/Paris-Descartes\t/;
+ s/Université Paris V/Paris-Descartes/;
+ s/UMPC/UMPC\t/;
+ s/et Habil\. à diriger les Rech\. Paris 6/UMPC/;
+ s/Stat. Paris 6/UMPC\tStatistiques/;
+ s/Sc\.des Matériaux Paris VI/UMPC\tScience des matériaux/;
+ s/Probabilités Paris VI/UMPC\tProbabilités/;
+ s/Probabilités et Finanace Paris VI/UMPC\tProbabilités et finance/;
+ s/Probab\. & Applications Paris 6/UMPC\tProbabilités et applications/;
+ s/Paris 6 Jussieu/UMPC/;
+ s/Paris 6/UMPC\t/;
+ s/Paris VI Pierre & Marie Curie/UMPC/;
+ s/paris VI\t/UMPC\t/;
+ s/Paris VI\t/UMPC\t/;
+ s/Paris VI Ecologie/UMPC\tÉcologie/;
+ s/ParisVI Proba\. & Finance/UMPC\tProbabilité et finance/;
+ s/Paris VI Finance/UMPC\tFinance/;
+ s/Paris VI Physique quantique/UMPC\tPhysique quantique/;
+ s/Paris VI Spéc\.Physique des Solides/UMPC\tPhysique des Solides/;
+ s/2 Proba\. & Finance Paris VI/UMPC\tProbabilité et finance/;
+ s/Biologie Paris VI/UMPC\tBiologie/;
+ s/CPM/UMPC/;
+ s/IARFAG Paris VI/UMPC\tInformatique/;
+ s/IARFAG/UMPC\tInformatique/;
+ s/Informatique - Paris 6/UMPC\tInformatique/;
+ s/Analyse numérique Paris VI/UMPC\tAnalyse numérique/;
+ s/\tParis\t/\tUMPC\t/;
+ s/TACS Dipl\./UMPC\tMaster Techniques Avancées en Calcul des Structures/;
+ s/Informatique - UMPC/UMPC\tInformatique/;
+ s/Analyse numérique UMPC/UMPC\tAnalyse numérique/;
+ s/à diriger les Rech\. UMPC/UMPC/;
+ s/2 Proba\. & Finance UMPC/UMPC\tProbabilité et finance/;
+ s/Japonais Paris VII/Paris-Diderot\tJaponais/;
+ s/Jussieu Paris 7/Paris-Diderot/;
+ s/Jussieu/Paris-Diderot/;
+ s/Math\. Appliquées Paris VII/Paris-Diderot\tMathématiques appliquées/;
+ s/Télédétection Paris VII/Paris-Diderot\tTélédétection/;
+ s/Physique des Solides Paris VII/Paris-Diderot\tPhysique des solides/;
+ s/Paris 7/Paris-Diderot/;
+ s/Paris VII\t/Paris-Diderot\t/;
+ s/Univers\.Paris VII Math\./Paris-Diderot\tMathématiques/;
+ s/Télécom Paris-Diderot/Paris-Diderot/;
+ s/Paris Paris-Diderot/Paris-Diderot/;
+ s/Paris 8/Vincennes-Saint-Denis/;
+ s/ANLA Paris IX/Dauphine/;
+ s/Economie Paris Dauphine/Dauphine\tÉconomie/;
+ s/Economie Ind. Paris IX/Dauphine\tÉconomie/;
+ s/Economie Ind. Paris Dauphine/Dauphine\tÉconomie/;
+ s/Paris 9/Dauphine/;
+ s/Paris Dauphine/Dauphine/;
+ s/Paris IX/Dauphine/;
+ s/Sc\.Econ\. Dauphine/Dauphine\tÉconomie/;
+ s/Gestion Publique Dauphine/Dauphine\tGestion publique/;
+ s/Economie ind\. Dauphine/Dauphine\tÉconomie/;
+ s/Paris X Philo. Esthétique/Nanterre\tPhilosophie/;
+ s/Paris X\t/Nanterre/;
+ s/Paris 10/Nanterre/;
+ s/Physique Paris XI/Paris-Sud\tPhysique/;
+ s/écologie Paris XI/Paris-Sud\tÉcologie/;
+ s/Univers\. Paris Sud/Paris-Sud/;
+ s/Paris XI\t/M\tParis-Sud\t/;
+ s/Paris XI Electronique/Paris-Sud\tÉlectronique/;
+ s/Master Paris 11/M\tParis-Sud/;
+ s/Master Paris 11/M\tParis-Sud/;
+ s/écologie Paris XI/Paris-Sud\tÉcologie/;
+ s/ATS Orsay/Paris-Sud/;
+ s/Paris 11 Orsay/Paris-Sud/;
+ s/Paris 11/Paris-Sud/;
+ s/paris 11/Paris-Sud/;
+ s/Orsay/Paris-Sud/;
+ s/Santé Publique Paris Sud/Paris-Sud\tSanté publique/;
+ s/Physique XI/Paris-Sud\tPhysique/;
+ s/Paris Paris-Sud/Paris-Sud/;
+ s/Droit des Affaires Paris 12/Paris-Val de Marne\tDroit des affaires/;
+ s/Paris 12/Paris-Val de Marne/;
+ s/Paris XII\t/Paris-Val de Marne\t/;
+ s/IUP Paris-Val de Marne/Paris-Val de Marne/;
+ s/Paris 13/Paris-Nord/;
+ s/Paris XIII/Paris-Nord/;
+ s/Aix Marseille II/Université de Provence/;
+ s/Université Lyon I/Université Claude Bernard/;
+ s/Lyon I/Université Claude Bernard/;
+ s/Paul-Sabatier/Université Paul-Sabatier/;
+ s/P\.Sabatier/Université Paul-Sabatier/;
+ s/ECP/Centrale Paris/;
+ s/Ecole Centrale/Centrale Paris/;
+ s/Catolica Chile/PUC/;
+ s/Catalunya/UOC/;
+ s/Californie Irvine/UCI/;
+ s/Californie/UCSD/;
+
+ s/Master Adm. des Entreprises/MBA\t\tMaster Administration des Entreprises/;
+ s/Master P.trole Engineering/MSc\t\tMaster en Pétrole/;
+ s/Master of Space System Engineering/MSc\t\tMaster of Space System Engineering/;
+ s/Master d\'Histoire/M\t\tMastère d\'Histoire/;
+ s/Master Hydraulique/M\t\tMastère Hydraulique/;
+ s/Master Aérospace/M\t\tMastère Aérospace/;
+ s/\tUrbanisme\t/\t\tUrbanisme\t/;
+ s/3e c\.Urbanisme/\tUrbanisme/;
+ s/Acoustique musicale/\tAcoustique musicale/;
+ s/Acoustique\t/\tAcoustique/;
+ s/Aéro\.Astro &EECS/\tAéronautique et Astronomie/;
+ s/Algorithmique/\tAlgorithmique/;
+ s/Anal\. Modél\.Syst\. Biologi\./\tAnalyse et modélisation sytématique en biologie/;
+ s/Anal\.& Polit\.Economique/\tAnalyse et politique économique/;
+ s/Analyse & Modélisation/\tAnalyse et modélisation/;
+ s/Analyse & Polit\. Econom\./\tAnalyse et politique économique/;
+ s/Analyse & Polit\.Eco\./\tAnalyse et politique économique/;
+ s/Analyse & Politique Eco\./\tAnalyse et politique économique/;
+ s/Analyse & Politique Econ\./\tAnalyse et politique économique/;
+ s/Analyse & Politique Economiques/\tAnalyse et politique économique/;
+ s/Analyse donnée/\tAnalyse de données/;
+ s/Analyse Economique/\tAnalyse économique/;
+ s/Analyse et Politique Economiques/\tAnalyse et politique économique/;
+ s/Analyse Industr\./\tAnalyse industrielle/;
+ s/Analyse Numérique/\tAnalyse numérique/;
+ s/Arabe Littéral/\tArabe littéral/;
+ s/Astrophys\./\tAstrophysique/;
+ s/Base Fond\. Oncogenèse/\tBase fondamentale de l'oncogenèse/;
+ s/Bases fondamentales Oncogénèse/\tBase fondamentale de l'oncogenèse/;
+ s/Biologie marine/\tBiologie marine/;
+ s/Biologie moléculaire et céllulaire végétale/\tBiologie moléculaire et céllulaire végétale/;
+ s/Bio. Moléculaire/\tBiologie moléculaire/;
+ s/biologie moléculaire/\tBiologie moléculaire/;
+ s/Biochimie/\tBiochimie/;
+ s/Biochimic/\tBiochimie/;
+ s/Microbiologie/\tMicrobiologie/;
+ s/Biologie/\tBiologie/;
+ s/biologie/\tBiologie/;
+ s/biomécanique/\tBiomécanique/;
+ s/Biophysique/\tBiophysique/;
+ s/Business/\tBusiness/;
+ s/Cancérologie/\tCancérologie/;
+ s/CEA/\tCEA/;
+ s/Champs Particules Matières/\tChamps particules matières/;
+ s/Champs Particules Matière/\tChamps particules matières/;
+ s/Chemical Engineering/\tChemical engineering/;
+ s/Chem.Eng./\tChemical engineering/;
+ s/\tChimie\t/\t\tChimie\t/;
+ s/Chimie appliquée/\tChimie appliquée/;
+ s/Chimie moléculaire/\tChimie moléculaire/;
+ s/\tChimie Moléculaire/\t\tChimie moléculaire/;
+ s/Multinational Chimie Moléculaire/\tChimie moléculaire/;
+ s/Chimie Organique/\t\tChimie organique/;
+ s/Chimie Organique Ing./\tChimie organique/;
+ s/Computer Sc\.Dipl\./\tComputer science/;
+ s/Computer Sciences/\tComputer science/;
+ s/Cryptographe\/Algorighmie/\tCryptographe et algorithmique/;
+ s/algorithmique/\tAlgorithmique/;
+ s/Astro\., Géophysique & Techn\. Spatiales/\tAstronomie, géophysique et technologies spatiales/;
+ s/Astrophysique/\tAstrophysique/;
+ s/Automatique/\tAutomatique/;
+ s/Ecologie/\tÉcologie/;
+ s/Master Histoire/M\t\tHistoire/;
+ s/Affaires Internationales/\tAffaires internationales/;
+ s/Aménagement & Urbanisme/\tAménagement et urbanisme/;
+ s/Chinois/\tChinois/;
+ s/cryptographie/\tCryptographie/;
+ s/d'Histoire/\tHistoire/;
+ s/Dépollution des Sols/\tDépollution des sols/;
+ s/dével. culturel et dir. projet/\tDéveloppement culturel et direction de projets/;
+ s/DIC/\tDIC/;
+ s/Virologie/\tVirologie/;
+ s/Virologie Moléculaire/\tVirologie moléculaire/;
+ s/Transportation/\tTransportation/;
+ s/Transports/\tTransports/;
+ s/Transport\t/\tTransport/;
+ s/Trait. Signal/\tTrait\. Signal/;
+ s/Toxicologie/\tToxicologie/;
+ s/Théorie Information/\tThéorie Information/;
+ s/Théologie Catholique/\tThéologie Catholique/;
+ s/Théologie cath./\tThéologie cath\./;
+ s/Théologie\t/\tThéologie\t/;
+ s/Théolog\./\tThéolog\./;
+ s/Télécom\. Numériques/\tTélécom\. Numériques/;
+ s/Technologie Management/\tTechnologie Management/;
+ s/Techno\.Policy Dipl\./\tTechno\.Policy Dipl\./;
+ s/Technique agricole/\tTechnique agricole/;
+ s/Syst\. énergétiques/\tSyst\. énergétiques/;
+ s/Strat\. des Org\./\tStrat\. des Org\./;
+ s/Strat\. & Marketing/\tStrat\. & Marketing/;
+ s/Statistiques/\tStatistiques/;
+ s/Statistique et modèles aléatoires écon\. et finance/\tStatistique et modèles aléatoires écon\. et finance/;
+ s/Statist\./\tStatist\./;
+ s/Stat\.& Santé/\tStat\.& Santé/;
+ s/\tSt\.//;
+ s/spécialisé sécurité des syst\. inform\./\tspécialisé sécurité des syst\. inform\./;
+ s/Solides Structures & Syst\. Mécaniques/\tSolides Structures & Syst\. Mécaniques/;
+ s/Sociologie/\tSociologie/;
+ s/Signal et Communications Londres/\tSignal et Communications Londres/;
+ s/Sciences théoriques/\tSciences théoriques/;
+ s/Sciences Physiques/\tSciences Physiques/;
+ s/Sciences des Sols/\tSciences des Sols/;
+ s/Sciences Cognitives/\tSciences Cognitives/;
+ s/Sciences & Techniques environnement/\tSciences & Techniques environnement/;
+ s/Science Dipl\./\tScience/;
+ s/Science\t/\tSciences/;
+ s/Sciences\t/\tSciences/;
+ s/Sc\.Phys\. Théorique/\tPhysique théorique/;
+ s/Sc\.Phys\.\t/\tPhysique/;
+ s/Sc\.Natur\./\tSciences naturelles/;
+ s/Sc\.Microbio\./\tMicrobiologie/;
+ s/Sc\.Math\. Appliquées/\tMathématiques appliquées/;
+ s/Sc\.Math\.\t/\tMathématiques\t/;
+ s/Sc\.Info\.Géographique/\tInformatique géographique/;
+ s/Sc\.Hum\./\tScience humaine/;
+ s/Sc\.Gestion/\tGestion/;
+ s/Macroéconomie/\tMacroéconomie/;
+ s/Math\. Appliquées aux Sc\. Eco\./\tÉconomie/;
+ s/Sc.Econom./\tÉconomie/;
+ s/Sc\.Econ\. Finance/\tÉconomie et finance/;
+ s/Sc\.Econ\.\t/\tÉconomie\t/;
+ s/Sc\.Eco\.Internat\./\tÉconomie/;
+ s/Sc\.Eco\./\tÉconomie/;
+ s/Sc\.Eco\t/\tÉconomie\t/;
+ s/Sc\.du Bois/\tScience du bois/;
+ s/Sc\.des Matériaux/\tSciences des matériaux/;
+ s/Sc\.de la Vie/\tSciences de la vie/;
+ s/Sc\.de l'Organisation/\tScience de l'organisation/;
+ s/Sc\.de l'Eau 1994/\tScience de l'eau/;
+ s/Sc\.de l'Eau\t/\tScience de l'eau\t/;
+ s/Sc.Cognitives/\tSciences cognitives/;
+ s/Sc\.Chim\./\tChimie/;
+ s/Sc\.Appl\./\tScience appliquées/;
+ s/Sc\. Physiques Option Chimie/\tPhysique, chimie/;
+ s/Sc\. Phy\./\tPhysique/;
+ s/Sc\. Micro/\t/;
+ s/Sc\. matériaux/\tSciences des matériaux/;
+ s/Sc\. la Vie/\tSciences de la vie/;
+ s/Sc\. Informatique\/Micro-électronique/\tInformatique, micro-électronique/;
+ s/Sc\. Immunologie/\tImmunologie/;
+ s/Sc\. Histor\. et Philolog\./\tHistoire et philologie/;
+ s/Sc\. forestières/\tSciences forestières/;
+ s/Sc\. et Tech\. Environ\./\tTechnique environnementale/;
+ s/Sc\. Eco/\tÉconomie/;
+ s/Sc\. Cognitives/\tSciences cognitives/;
+ s/Sc\. biomédicales/\tSciences biomédicales/;
+ s/Sc\. Bactériologie/\tBactériologie/;
+ s/Sc\. & Génie Matériaux/\tGénie des matériaux/;
+ s/Sc\. & Génie des Matériaux/\tGénie des matériaux/;
+ s/Management Sc\./\tManagement des sciences/;
+ s/Sc\.\t/\tSciences\t/;
+ s/Sc Géodésie/\tGéodésie/;
+ s/Robotique/\tRobotique/;
+ s/retr\.Aérospatiale/\tAérospatiale/;
+ s/Réseaux/\tRéseaux/;
+ s/Rech\.Opérationnelle/\tRecherche opérationnelle/;
+ s/Rech\.Opér\./\tRecherche opérationnelle/;
+ s/Public Policy/\tPublic Policy/;
+ s/Psychopathologie/\tPsychopathologie/;
+ s/psychologie/\tPsychologie/;
+ s/Programmation/\tProgrammation/;
+ s/Processus stochastiques/\tProcessus stochastiques/;
+ s/Processus Stochastiques/\tProcessus stochastiques/;
+ s/Génie Procédés/\tGénie des procédés/;
+ s/Génie des Procédés/\tGénie des procédés/;
+ s/\tProcédés/\t\tProcédés/;
+ s/Probalilité & Finance/\tProbalilité & Finance/;
+ s/Probabilités Finance/\tProbabilités Finance/;
+ s/Probabilités et Applications/\tProbabilités et Applications/;
+ s/Probabilités\t/\tProbabilités\t/;
+ s/Physique, chimie, biotransformation/\tPhysique, chimie, biotransformation/;
+ s/Physique Théorique/\tPhysique théorique/;
+ s/Physique Solides/\tPhysique des solides/;
+ s/Physique Quantique/\tPhysique quantique/;
+ s/Physique nucléaire/\tPhysique nucléaire/;
+ s/Physique Nucléaire/\tPhysique nucléaire/;
+ s/Phys\.Nucléaire/\tPhysique nucléaire/;
+ s/Physique expérimentale/\tPhysique expérimentale/;
+ s/Physique du solide/\tPhysique des solides/;
+ s/Physique des Solides/\tPhysique des solides/;
+ s/Physique des Lasers/\tPhysique des lasers/;
+ s/Physique Chimie des matériaux/\tPhysique et chimie des matériaux/;
+ s/Physique\t/\tPhysique\t/;
+ s/Phys\.Théor\. Dipl\./\tPhysique théorique/;
+ s/Phys\.Théor\./\tPhysique théorique/;
+ s/Phys\.Réact\./\tPhysique des réacteurs/;
+ s/Phys\.Quantique/\tPhysique quantique/;
+ s/Phys\.Plasmas Spatiaux/\tPhysique des plasmas spatiaux/;
+ s/Phys\.Mathématiques/\tPhysiques mathématiques/;
+ s/Phys\.des Solides/\tPhysique des solides/;
+ s/Phys\. Théor\./\tPhysique théorique/;
+ s/Phys\. Réacteurs/\tPhysique des réacteurs/;
+ s/Phys\. Quantique/\tPhysique quantique/;
+ s/Géodynamique & Phys\./\tGéodynamique & physique/;
+ s/Phys\.Solid/\t\tPhysique des solides/;
+ s/Phys\./\tPhysique/;
+ s/Phys des Solides/\tPhysique des solides/;
+ s/philosophie et théologie/\tPhilosophie et théologie/;
+ s/Philosophie/\tPhilosophie/;
+ s/Philo\.et Eco\. Londres/\tPhilosophie et économie/;
+ s/Pharmacochimie Mol\.expérim\.et Métabolisme/\tPharmacochimie moléculaire expérimentales et métabolisme/;
+ s/Pharmaco\.& Biol\.Cellulaire/\tPharmacologie et biologie cellulaire/;
+ s/Pharmacolog\./\tPharmacologie/;
+ s/Particules & Matière/\tParticules et matières/;
+ s/Organisation et Pilotage Syst\. Product\. Indust\./\tOrganisation et pilotage syst. Product. Indust./;
+ s/Organisation & Syst\.Prod\./\tOrganisation et système de production/;
+ s/Russe/\tRusse/;
+ s/Polit\.Eco\.& Soc\./\tPolitique économique et sociale/;
+ s/Physique des Particules CNRS-CERN/\tPhysique des Particules CNRS-CERN/;
+ s/Physique M/\tPhysique moléculaire/;
+ s/Org\. Production et Entreprise/\tOrganisation production et entreprise/;
+ s/Org\. et Pilotage des Syst\. product\./\tOrganisation et pilotage des systèmes production/;
+ s/\tOptique/\t\tOptique/;
+ s/Océanographie/\tOcéanographie/;
+ s/océanologie/\tOcéanographie/;
+ s/Océano\./\tOcéanographie/;
+ s/Nucl\. Eng/\tNuclear engineering/;
+ s/Neurosciences/\tNeurosciences/;
+ s/Neuro/\tNeurosciences/;
+ s/Multinational Chimie molécullaire/\tChimie molécullaire/;
+ s/Multinational\t//;
+ s/Morphol\.Math\./\tMorphologie mathématiques/;
+ s/Modélisation Stochastique et Statistique/\tModélisation stochastique et statistique/;
+ s/Modèl\.Stochastiq\./\tModélisation stochastique/;
+ s/Milieux Coralliens/\tMilieux coralliens/;
+ s/Microélect\./\tMicroélectronique/;
+ s/Microéconomie/\tMicroéconomie/;
+ s/méthodes physiques télédétection/\tMéthodes physiques télédétection/;
+ s/Météorologie/\tMétéorologie/;
+ s/Médiateur Judiciaire et conventionnelle/\tMédiateur judiciaire et conventionnelle/;
+ s/Mechanical Engineering/\tMechanical Engineering/;
+ s/Mécanique\/Sc\. Matériaux/\tMécanique science des matériaux/;
+ s/Mécanique Théorique/\tMécanique théorique/;
+ s/Mécanique Fluides/\tMécanique fluides/;
+ s/Mécanique\t/\tMécanique\t/;
+ s/Méca Fluid\.Théor\./\tMécanique des fluides théoriques/;
+ s/Méc\.des Fluides/\tMécanique des fluides/;
+ s/Maths Financières/\tMathématiques financières/;
+ s/Maths Appl\.à l'Economie/\tMathématiques appliquées à l'économie/;
+ s/Mathématiques/\tMathématiques/;
+ s/Mathématique/\tMathématiques/;
+ s/Mathematics/\tMathématiques/;
+ s/Maths\t/\tMathématiques\t/;
+ s/Math\.Appliquées/\tMathématiques appliquées/;
+ s/Math\.Appliq\./\tMathématiques appliquées/;
+ s/Math\.Appl\./\tMathématiques appliquées/;
+ s/Math\. Stat\./\tMathématiques statistiques/;
+ s/Math\. Pures/\tMathématiques pures/;
+ s/Math\. Appliqués/\tMathématiques appliquées/;
+ s/Math\. Appliquées et Calcul Scient\./\tMathématiques appliquées et calcul scientifique/;
+ s/Math\. Appliquées/\tMathématiques appliquées/;
+ s/Math\. appli\. Sci\. homme/\tMathématiques appliquées aux sciences humaines/;
+ s/Informatique Math\.& Appl\./\tInformatique et mathématiques appliquées/;
+ s/\tinformatique\t/\t\tInformatique\t/;
+ s/Informatique Math\. et Appli\./\tInformatique et mathématiques appliquées/;
+ s/Math\./\tMathématiques/;
+ s/Nepali-Tibétain/\tNepali-Tibétain/;
+ s/MVA/\tMathématiques vision apprentissage/;
+ s/MMME//;
+ s/OJME//;
+ s/\tMicro\t/\t\tMicro\t/;
+ s/Médec\.AIHP/\Médecine/;
+ s/\tMarketing\t/\t\tMarketing\t/;
+ s/Lt\. Et\. Sup\. Banq\./\tLt. Et. Sup. Banq./;
+ s/Management Aéroportuaire/\tManagement Aéroportuaire/;
+ s/Logistique/\tLogistique/;
+ s/Lettres modernes/\tLettres modernes/;
+ s/Lettres Hist\. Art/\tLettres histoire de l'art/;
+ s/lettres classiques/\tLettres classiques/;
+ s/Lettres Anglais/\tLettres Anglais/;
+ s/Lettres\t/\tLettres\t/;
+ s/LCO//;
+ s/Laser & Matière/\tLaser & Matière/;
+ s/Langues Orientales/\tLangues orientales/;
+ s/Langues Orient\./\tLangues orientales/;
+ s/Intelligence Artificielle/\tIntelligence artificielle/;
+ s/Ingenierie & Gestion/\tIngenierie & gestion/;
+ s/Informatique Fondamentale/\tInformatique fondamentale/;
+ s/Informatique Dipl\./\tInformatique/;
+ s/Informatique Grenoble/\tInformatique/;
+ s/\tInformatique\t/\t\tInformatique\t/;
+ s/Information theory/\tInformation theory/;
+ s/Industrial Design Eng\./\tIndustrial Design Engineering/;
+ s/Immunologie/\tImmunologie/;
+ s/Immunology/\tImmunologie/;
+ s/Images Synthèse/\tImages synthèse/;
+ s/hydrologie-hydrogéologie/\thydrologie-hydrogéologie/;
+ s/Hydrologie/\tHydrologie/;
+ s/Hydrogéologie/\tHydrogéologie/;
+ s/Hydrodynamique/\tHydrodynamique/;
+ s/Histoire, Anglais, Lettres classiques & modernes/\tHistoire, Anglais, Lettres classiques & modernes/;
+ s/Histoire Droit/\tHistoire Droit/;
+ s/\tHistoire\t/\t\tHistoire\t/;
+ s/Hist\.de l'Art/\tHistoire l'art/;
+ s/HIST PHILOSOPHIE/\tHistoire et philosophie/;
+ s/HH GG/\tHistoire et géographie/;
+ s/Gestion scientifique/\tGestion scientifique/;
+ s/Gestion des Ress\. Naturelles Renouvelables/\tGestion des ressources naturelles renouvelables/;
+ s/\tGestion\t/\t\tGestion\t/;
+ s/Géophys\./\tGéophysique/;
+ s/Géographie/\tGéographie/;
+ s/Génie Electrique/\tGénie électrique/;
+ s/Génie Chimique/\tGénie chimique/;
+ s/Génie Atomique/\tGénie atomique/;
+ s/\tGénie\t/\t\tGénie\t/;
+ s/Génie civil/\tGénie civil/;
+ s/Génétique/\tGénétique/;
+ s/Finance Monnaie/\tFinance Monnaie/;
+ s/Finance Marché/\tFinance Marché/;
+ s/Finance et probabilité/\tFinance et probabilité/;
+ s/Finance et Monnaie/\tFinance et Monnaie/;
+ s/Finance Dipl\./\tFinance/;
+ s/Finance and Economics Londres/\tFinance and Economics/;
+ s/\tFinance\t/\t\tFinance\t/;
+ s/Expert Compt\./\tExpertise comptable/;
+ s/Etudes Latines/\tEtudes latines/;
+ s/études extrême orientales/\tÉtudes extrême orientales/;
+ s/et PhD\t//;
+ s/et HDR\t//;
+ s/Epidémiologie/\tÉpidémiologie/;
+ s/Environnement Marin/\tEnvironnement marin/;
+ s/\tEnvironnement\t/\t\tEnvironnement\t/;
+ s/Energétique/\tÉnergétique/;
+ s/Electronique/\tÉlectronique/;
+ s/Electron\./\tÉlectronique/;
+ s/Electrical Engineering/\tElectrical Engineering/;
+ s/Electrical Engin\. & Computer/\tElectrical engineering & Computer science/;
+ s/Electrical Eng Dipl\./\tElectrical engineering/;
+ s/Educateur spécialisé/\tÉducateur spécialisé/;
+ s/Économiee\t/\tÉconomie\t/;
+ s/Economie Monétaire & Bancaire/\tÉconomie monétaire & bancaire/;
+ s/Economie Internationale/\tÉconomie internationale/;
+ s/Economie innovation/\tÉconomie innovation/;
+ s/Economie Industrielle/\tÉconomie industrielle/;
+ s/Economie Ind\./\tÉconomie industrielle/;
+ s/Economie et Finance/\tÉconomie et fnance/;
+ s/Economie Environnement/\tÉconomie environnementale/;
+ s/Economie Envir\. et Ress\. Nat\./\tÉconomie environnementale et ressources naturelles/;
+ s/Economie du Dévelop\./\tÉconomie du développement/;
+ s/Economie Dipl\./\tÉconomie/;
+ s/Economie Développement/\tÉconomie développement/;
+ s/Economie des Institutions/\tÉconomie des institutions/;
+ s/Economie & Finance Internat./\tÉconomie & finance internationale/;
+ s/Economie\t/\tÉconomie\t/;
+ s/Econométrie/\tÉconométrie/;
+ s/Econom\.Dipl\./\tÉconométrie/;
+ s/Econ\.Po\./\tÉconomie politique/;
+ s/Econ\.Industrielle/\tÉconomie industrielle/;
+ s/Econ\.Appliquée/\tÉconomie appliquée/;
+ s/Econ\.& Finance Internat\./\tÉconomie & finance internationale/;
+ s/Econ\. & Finance/\tÉconomie & finance/;
+ s/Econ\.\t/\tÉconomie\t/;
+ s/écologie M/\tÉcologie/;
+ s/Eco\.Rech\.Dévelop\./\tÉconomie recherche et développement/;
+ s/Eco\.Appliquée/\tÉconomie appliquée/;
+ s/Eco\. Enviro\. & Ress\. Humaines/\tÉconomie environnementale & ressource humaines/;
+ s/Eco Finance Internationale/\tÉconomie finance internationale/;
+ s/Droit Public/\tDroit Public/;
+ s/Droit des affaires/\tDroit des affaires/;
+ s/Droit\t/\tDroit\t/;
+ s/INRIA/\tINRIA/;
+ s/\tInformatique\t/\t\tInformatique\t/;
+ s/Ecotoxicologie/\tEcotoxicologie/;
+ s/Droit public/\tDroit public/;
+ s/Droit des Affaires/\tDroit des Affaires/;
+ s/Anal\.Numér\./\tAnalyse numérique/;
+ s/& Gestion Energie/\tGestion de l'énergie/;
+ s/droit/\tdroit/;
+
+ # On nettoye à la fin
+ s/\tSE\t/\t/;
+ s/rer\.Nat\.//;
+ s/Un\. Dipl\.\t//;
+ s/Dipl\. Dipl\./Dipl./;
+ s/Dipl\.Dipl\./Dipl./;
+ s/Ing Dipl\./Ing./;
+ s/Ing Ing\./Ing./;
+ s/Sc\.Dipl\.//;
+ s/\t2005\t//;
+ s/(Dipl\.)(\tDipl\.)+/Dipl./;
+ s/(Ing\.)(\tDipl\.)+/Ing./;
+ s/(Corps)(\tDipl\.)+/Corps/;
+ s/(MSc)(\tDipl\.)+/MSc/;
+ s/(PhD)(\tDipl\.)+/PhD/;
+ s/(DEA)(\tDipl\.)+/DEA/;
+ s/(ME)(\tDipl\.)+/ME/;
+ s/(MBA)(\tDipl\.)+/MBA/;
+ s/(MPA)(\tDipl\.)+/MPA/;
+ s/(Lic\.)(\tDipl\.)+/Lic./;
+ s/(MIA)(\tDipl\.)+/MIA/;
+ s/(Agr\.)(\tDipl\.)+/Agr./;
+ s/(CAPES)(\tDipl\.)+/CAPES/;
+ s/(DESS)(\tDipl\.)+/DESS/;
+ s/(BTS)(\tDipl\.)+/BTS/;
+ s/(MA)(\tDipl\.)+/MA/;
+ s/(Maîtr\.)(\tDipl\.)+/Maîtr./;
+ s/(HDR)(\tDipl\.)+/HDR/;
+ s/(DEUG)(\tDipl\.)+/DEUG/;
+ s/(MEE)(\tDipl\.)+/MEE/;
+ s/(MPhil)(\tDipl\.)+/MPhil/;
+ s/(MUP)(\tDipl\.)+/MUP/;
+ s/(MME)(\tDipl\.)+/MME/;
+ s/(MCP)(\tDipl\.)+/MCP/;
+ s/(BA)(\tDipl\.)+/BA/;
+ s/(MEl)(\tDipl\.)+/MEl/;
+ s/(MM)(\tDipl\.)+/MM/;
+ s/(MIB)(\tDipl\.)+/MIB/;
+ s/(MC)(\tDipl\.)+/MC/;
+ s/(MEM)(\tDipl\.)+/MEM/;
+ s/(MEng)(\tDipl\.)+/MEng/;
+ s/(MCE)(\tDipl\.)+/MCE/;
+ s/(M)(\tDipl\.)+/M/;
+ s/(MMS)(\tDipl\.)+/MMS/;
+ s/(MB)(\tDipl\.)+/MB/;
+ s/(MiF)(\tDipl\.)+/MiF/;
+ s/Ing\.\tPhD/Ing.\t\t/;
+ s/PhD\tPhD/PhD\t\t/;
+ s/MSc\tMSc/MSc/;
+ s/DEA\tMSc/DEA/;
+ s/DEA\tMSc/DEA/;
+ s/DEA\tMSc/DEA/;
+ s/PhD\tMSc/PhD/;
+ s/Dipl\.\tME/ME/;
+ s/MBA\tMBA/MBA/;
+ s/DEA\tM\t/DEA\t/;
+ s/PhD\tM\t/PhD\t/;
+ s/MSc\tMBA/MBA/;
+ s/PhD\tHDR/PhD/;
+ s/(Ing\.\t)+(Ing\.)/Ing./;
+ s/PhD\tIng/PhD/;
+ s/PhD\tIng\./PhD/;
+ s/MBA\tIng\./MBA/;
+ s/MBA\tMA/MBA/;
+ s/PhD\./PhD/;
+ s/Dipl\.\tIng\./Ing./;
+ s/MSc\tIng\./MSc/;
+ s/MIB\tIng\./MIB/;
+
+ s/Université//g;
+ s/université//g;
+ s/Univers\.//g;
+ s/Sc\.\t//g;
+ s/Sc\. \t//g;
+ s/Paul-Sabatier/Université Paul-Sabatier/;
+ s/de Provence/Université de Provence/;
+ s/Jean-Moulin/Université Jean-Moulin/;
+ s/Claude Bernard/Université Claude Bernard/;
+ s/de Rennes/Université de Rennes 1/;
+ s/MIT Institute of Technology/MIT/;
+ s/London Royaume uni//;
+ s/\tLondon\t//;
+ s/\tGrenoble\t//;
+ s/ENS UlmAE/ENSAE/;
+
+ s/\t /\t/g;
+ s/\t /\t/g;
+ s/\t,/\t/g;
+ s/\t-/\t/g;
+ s/\t:/\t/g;
+ s/\t\./\t/g;
+ s/\t /\t/g;
+ s/\t /\t/g;
+ s/ \t/\t/g;
+ s/ \t/\t/g;
+ s/London\tBusiness School/London Business School/;
+ s/DEA\tMSc/DEA/;
+ s/ME\tDipl\./ME/;
+ s/\tENS\t/\tENS Ulm/;
+ s/Économiee environ\. et ressources naturelles UCL Londres/UCL\tÉconomie environnementale et ressources naturelles/;
+ s/Dipl\.\tHEC 04//;
+ s/Neurosciencessciences/Neurosciences/;
+ s/HEC\tHEC-Entrepreneurs//;
+ s/Master Techniques Avancées en Calcul des Structures\tENS Cachan/Master Techniques Avancées en Calcul des Structures/;
+ s/DEA\t\tPanthéon-Sorbonne/DEA\tPanthéon-Sorbonne/;
+ s/MBA\t\tCollege of Europe/MBA\tCollege of Europe/;
+ s/DEA\t\tUMPC/DEA\tUMPC/;
+ s/Informatique UMPC/Informatique/;
+
+ print OUT $_;
+}
+
+close(FILE);
+close(OUT);
--- /dev/null
+#! /bin/bash
+
+# import des données
+#scp -i ax_xorg_rsa xorg@polytechniciens.com:/home/axasso/ax-import/export_4D.txt.rar .
+#unrar e -inul export_4D.txt.rar
+cp /home/x2004jacob/export*utf8.TXT .
+
+# séparation en fichiers de tables
+cat export_total* | grep ^AD > Adresses.txt
+cat export_total* | grep ^AN > Anciens.txt
+cat export_total* | grep ^FO > Formations.txt
+cat export_total* | grep ^AC > Activites.txt
+cat export_total* | grep ^EN > Entreprises.txt
+
+exit 1
+
+# intégration dans notre bdd
+echo intégration dans notre bdd
+$MYSQL x4dat < Activites.sql
+$MYSQL x4dat < Adresses.sql
+$MYSQL x4dat < Anciens.sql
+$MYSQL x4dat < Entreprises.sql
+./formation.pl
+cat Formations_out.txt > Formations.txt
+rm -f Formations_out.txt
+$MYSQL x4dat < Formations.sql
+
+
+# nettoyage
+echo nettoyage
+#rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export_4D.txt.rar export-total*
+rm Adresses.txt Anciens.txt Formations.txt Activites.txt Entreprises.txt export-total*
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-class GeolocModule extends PLModule
-{
- function handlers()
- {
- return array(
- 'geoloc' => $this->make_hook('default', AUTH_COOKIE),
- 'admin/geoloc' => $this->make_hook('admin', AUTH_MDP, 'admin'),
- 'admin/geoloc/dynamap' => $this->make_hook('admin_dynamap', AUTH_MDP, 'admin'),
- );
- }
-
- function handler_default(&$page, $action = null, $subaction = null)
- {
- global $globals;
-
- $set = new UserSet();
- $set->addMod('geoloc', 'Geolocalisation', true);
- $set->apply('geoloc', $page, $action, $subaction);
- }
-
- function handler_admin(&$page, $action = false) {
- $page->changeTpl('geoloc/admin.tpl');
- require_once("geoloc.inc.php");
- $page->setTitle('Administration - Geolocalisation');
-
- $nb_synchro = 0;
-
- if (Env::has('id') && is_numeric(Env::v('id'))) {
- if (synchro_city(Env::v('id'))) $nb_synchro ++;
- }
-
- if ($action == 'missinglat') {
- $res = XDB::iterRow("SELECT id FROM geoloc_city WHERE lat = 0 AND lon = 0");
- while ($a = $res->next()) if (synchro_city($a[0])) $nb_synchro++;
- }
-
- if ($nb_synchro)
- $page->trigSuccess(($nb_synchro > 1)?($nb_synchro." villes ont été synchronisées"):"Une ville a été synchronisée");
-
- $res = XDB::query("SELECT COUNT(*) FROM geoloc_city WHERE lat = 0 AND lon = 0");
- $page->assign("nb_missinglat", $res->fetchOneCell());
- }
-
- function handler_admin_dynamap(&$page, $action = false) {
- $page->changeTpl('geoloc/admin_dynamap.tpl');
-
- if ($action == 'cities_not_on_map') {
- require_once('geoloc.inc.php');
- if (!fix_cities_not_on_map(20))
- $page->trigError("Impossible d'accéder au webservice");
- else
- $refresh = true;
- }
-
- if ($action == 'smallest_maps') {
- require_once('geoloc.inc.php');
- set_smallest_levels();
- }
-
- if ($action == 'precise_coordinates') {
- XDB::execute("UPDATE adresses AS a
- INNER JOIN geoloc_city AS c ON(a.cityid = c.id)
- SET a.glat = c.lat / 100000, a.glng = c.lon / 100000");
- }
-
- if ($action == 'newmaps') {
- require_once('geoloc.inc.php');
- if (!get_new_maps(Env::v('url')))
- $page->trigError("Impossible d'accéder aux nouvelles cartes");
- }
-
- $countMissing = XDB::query("SELECT COUNT(*) FROM geoloc_city AS c LEFT JOIN geoloc_city_in_maps AS m ON(c.id = m.city_id) WHERE m.city_id IS NULL");
- $missing = $countMissing->fetchOneCell();
-
- $countNoSmallest = XDB::query("SELECT SUM(IF(infos = 'smallest',1,0)) AS n FROM geoloc_city_in_maps GROUP BY city_id ORDER BY n");
- $noSmallest = $countNoSmallest->fetchOneCell() == 0;
-
- $countNoCoordinates = XDB::query("SELECT COUNT(*) FROM adresses WHERE cityid IS NOT NULL AND glat = 0 AND glng = 0");
- $noCoordinates = $countNoCoordinates->fetchOneCell();
-
- if (isset($refresh) && $missing) {
- $page->assign("pl_extra_header", "<meta http-equiv='Refresh' content='3'/>");
- }
- $page->assign("nb_cities_not_on_map", $missing);
- $page->assign("no_smallest", $noSmallest);
- $page->assign("no_coordinates", $noCoordinates);
- }
-
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
function handler_admin_nl_edit(&$page, $nid = 'last', $aid = null, $action = 'edit') {
$page->changeTpl('newsletter/edit.tpl');
$page->addCssLink('nl.css');
- $page->setTitle('Administration - Newsletter : Edition');
- require_once("newsletter.inc.php");
+ $page->setTitle('Administration - Newsletter : Édition');
+ require_once 'newsletter.inc.php';
$nl = new NewsLetter($nid);
if($action == 'edit' && $aid != 'update') {
$eaid = $aid;
- if(Post::has('title')) {
+ if (Post::has('title')) {
$art = new NLArticle(Post::v('title'), Post::v('body'), Post::v('append'),
- $eaid, Post::v('cid'), Post::v('pos'));
+ $eaid, Post::v('cid'), Post::v('pos'));
} else {
- $art = ($eaid == 'new') ? new NLArticle() : $nl->getArt($eaid);
+ $art = ($eaid == 'new') ? new NLArticle() : $nl->getArt($eaid);
+ }
+ if ($art && !$art->check()) {
+ $page->trigError("Cet article est trop long.");
}
$page->assign('art', $art);
}
class PayPal
{
- // {{{ properties
-
var $val_number;
var $urlform;
var $nomsite = "PayPal";
var $infos;
- // }}}
- // {{{ constructor
-
function PayPal($val)
{
$this->val_number = $val;
}
- // }}}
- // {{{ function form()
-
function prepareform(&$pay)
{
- // toute la doc sur :
- // https://www.paypal.com/fr_FR/pdf/integration_guide.pdf
- // attention : le renvoi automatique ne fonctionne que si
- // on oblige les gens à créer un compte paypal
- // nous ne l'utilisons pas ; il faut donc que l'utilisateur
- // revienne sur le site
+ // Documentation:
+ // https://www.paypal.com/developer
+ // Warning: the automatic return only works if we force the
+ // users to create a paypal account. We do not use it; thus
+ // the user must come back on the site.
global $globals, $platal;
- $this->urlform = 'https://'.$globals->money->paypal_site.'/cgi-bin/webscr';
+ $this->urlform = 'https://' . $globals->money->paypal_site . '/cgi-bin/webscr';
$req = XDB::query("SELECT IF(nom_usage!='', nom_usage, nom) AS nom
FROM auth_user_md5
- WHERE user_id = {?}",S::v('uid'));
+ WHERE user_id = {?}", S::v('uid'));
$name = $req->fetchOneCell();
$roboturl = str_replace("https://","http://",$globals->baseurl)
- . '/' . $platal->ns . "payment/paypal_return/".S::v('uid')."?comment=".urlencode(Env::v('comment'));
+ . '/' . $platal->ns . "payment/paypal_return/" . S::v('uid')
+ . "?comment=" . urlencode(Env::v('comment'));
- $this->infos = Array();
+ $this->infos = array();
- $this->infos['commercant'] = Array(
+ $this->infos['commercant'] = array(
'business' => $globals->money->paypal_compte,
- 'rm' => 2,
+ 'rm' => 2,
'return' => $roboturl,
- 'cn' => 'Commentaires',
+ 'cn' => 'Commentaires',
'no_shipping' => 1,
'cbt' => empty($GLOBALS['IS_XNET_SITE']) ?
- 'Revenir sur polytechnique.org' :
- 'Revenir sur polytechnique.net');
+ 'Revenir sur polytechnique.org.' :
+ 'Revenir sur polytechnique.net.'
+ );
- $info_client = Array(
+ $info_client = array(
'first_name' => S::v('prenom'),
'last_name' => $name,
- 'email' => S::user()->bestEmail());
+ 'email' => S::user()->bestEmail()
+ );
$res = XDB::query(
- "SELECT a.adr1 AS address1, a.adr2 AS address2,
- a.city, a.postcode AS zip, a.country,
- IF(t.tel, t.tel, q.profile_mobile) AS night_phone_b
- FROM auth_user_quick AS q
- LEFT JOIN adresses AS a ON (q.user_id = a.uid AND FIND_IN_SET('active', a.statut))
- LEFT JOIN tels AS t ON (t.uid = a.uid AND t.adrid = a.adrid)
- WHERE q.user_id = {?}
- LIMIT 1", S::v('uid'));
+ "SELECT a.text, l.name AS city, a.postalCode AS zip, a.countryiId AS country,
+ IF(t1.display_tel != '', t1.display_tel, t2.display_tel) AS night_phone_b
+ FROM auth_user_quick AS q
+ LEFT JOIN profile_addresses AS a ON (q.user_id = a.pid AND FIND_IN_SET('current', a.flags))
+ LEFT JOIN profile_phones AS t1 ON (t1.uid = a.uid AND t1.link_type = 'address'
+ AND t1.link_id = a.adrid)
+ LEFT JOIN profile_phones AS t2 ON (t2.uid = a.uid AND t2.link_type = 'user'
+ AND t2.link_id = 0)
+ LEFT JOIN geoloc_localities AS l ON (l.id = a.localityId)
+ WHERE q.user_id = {?}
+ LIMIT 1",
+ S::v('uid'));
$this->infos['client'] = array_map('replace_accent', array_merge($info_client, $res->fetchOneAssoc()));
-
- // on constuit la reference de la transaction
- $prefix = ($pay->flags->hasflag('unique')) ? str_pad("",15,"0") : rand_url_id();
- $fullref = substr("$prefix-xorg-{$pay->id}",-15);
-
- $this->infos['commande'] = Array(
- 'item_name' => replace_accent($pay->text),
- 'amount' => $this->val_number,
+ list($this->infos['client']['address1'], $this->infos['client']['address2']) =
+ explode("\n", Geocoder::getFirstLines($this->infos['client']['text'],
+ $this->infos['client']['zip'], 2));
+ unset($this->infos['client']['text']);
+
+ // We build the transaction's reference
+ $prefix = ($pay->flags->hasflag('unique')) ? str_pad("", 15, "0") : rand_url_id();
+ $fullref = substr("$prefix-xorg-{$pay->id}", -15);
+
+ $this->infos['commande'] = array(
+ 'item_name' => replace_accent($pay->text),
+ 'amount' => $this->val_number,
'currency_code' => 'EUR',
- 'custom' => $fullref);
+ 'custom' => $fullref
+ );
- $this->infos['divers'] = Array('cmd' => '_xclick');
+ $this->infos['divers'] = array('cmd' => '_xclick');
}
-
- // }}}
}
$api = 'PayPal';
function handlers()
{
return array(
- 'photo' => $this->make_hook('photo', AUTH_PUBLIC),
- 'photo/change' => $this->make_hook('photo_change', AUTH_MDP),
-
- 'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC),
- 'profile' => $this->make_hook('profile', AUTH_PUBLIC),
- 'profile/private' => $this->make_hook('profile', AUTH_COOKIE),
- 'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin'),
- 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP),
- 'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/job' => $this->make_hook('ajax_job', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/secteur' => $this->make_hook('ajax_secteur', AUTH_COOKIE, 'user', NO_AUTH),
- 'profile/ajax/skill' => $this->make_hook('ajax_skill', AUTH_COOKIE, 'user', NO_AUTH),
- 'javascript/applis.js' => $this->make_hook('applis_js', AUTH_COOKIE),
- 'javascript/grades.js' => $this->make_hook('grades_js', AUTH_COOKIE),
- 'profile/medal' => $this->make_hook('medal', AUTH_PUBLIC),
- 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP),
- 'profile/usage' => $this->make_hook('p_usage', AUTH_MDP),
-
- 'referent' => $this->make_hook('referent', AUTH_COOKIE),
- 'emploi' => $this->make_hook('ref_search', AUTH_COOKIE),
- 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE),
- 'referent/ssect' => $this->make_hook('ref_sect', AUTH_COOKIE, 'user', NO_AUTH),
- 'referent/country' => $this->make_hook('ref_country', AUTH_COOKIE, 'user', NO_AUTH),
-
- 'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE),
-
- 'vcard' => $this->make_hook('vcard', AUTH_COOKIE, 'user', NO_HTTPS),
- 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'),
- 'admin/medals' => $this->make_hook('admin_medals', AUTH_MDP, 'admin'),
- 'admin/formations' => $this->make_hook('admin_formations', AUTH_MDP, 'admin'),
- 'admin/sections' => $this->make_hook('admin_sections', AUTH_MDP, 'admin'),
- 'admin/secteurs' => $this->make_hook('admin_secteurs', AUTH_MDP, 'admin'),
- 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'),
- 'admin/ss_secteurs' => $this->make_hook('admin_ss_secteurs', AUTH_MDP, 'admin'),
- 'admin/fonctions' => $this->make_hook('admin_fonctions', AUTH_MDP, 'admin'),
+ 'photo' => $this->make_hook('photo', AUTH_PUBLIC),
+ 'photo/change' => $this->make_hook('photo_change', AUTH_MDP),
+
+ 'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC),
+ 'profile' => $this->make_hook('profile', AUTH_PUBLIC),
+ 'profile/private' => $this->make_hook('profile', AUTH_COOKIE),
+ 'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin'),
+ 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP),
+ 'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/edu' => $this->make_hook('ajax_edu', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/networking' => $this->make_hook('networking', AUTH_PUBLIC),
+ 'profile/ajax/job' => $this->make_hook('ajax_job', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/sector' => $this->make_hook('ajax_sector', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/sub_sector' => $this->make_hook('ajax_sub_sector', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/alternates' => $this->make_hook('ajax_alternates', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/skill' => $this->make_hook('ajax_skill', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/searchname' => $this->make_hook('ajax_searchname', AUTH_COOKIE, 'user', NO_AUTH),
+ 'profile/ajax/buildnames' => $this->make_hook('ajax_buildnames', AUTH_COOKIE, 'user', NO_AUTH),
+ 'javascript/education.js' => $this->make_hook('education_js', AUTH_COOKIE),
+ 'javascript/grades.js' => $this->make_hook('grades_js', AUTH_COOKIE),
+ 'profile/medal' => $this->make_hook('medal', AUTH_PUBLIC),
+ 'profile/name_info' => $this->make_hook('name_info', AUTH_PUBLIC),
+ 'profile/orange' => $this->make_hook('p_orange', AUTH_MDP),
+
+ 'referent' => $this->make_hook('referent', AUTH_COOKIE),
+ 'emploi' => $this->make_hook('ref_search', AUTH_COOKIE),
+ 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE),
+ 'referent/ssect' => $this->make_hook('ref_sect', AUTH_COOKIE, 'user', NO_AUTH),
+ 'referent/country' => $this->make_hook('ref_country', AUTH_COOKIE, 'user', NO_AUTH),
+
+ 'groupes-x' => $this->make_hook('xnet', AUTH_COOKIE),
+
+ 'vcard' => $this->make_hook('vcard', AUTH_COOKIE, 'user', NO_HTTPS),
+ 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'),
+ 'admin/medals' => $this->make_hook('admin_medals', AUTH_MDP, 'admin'),
+ 'admin/education' => $this->make_hook('admin_education', AUTH_MDP, 'admin'),
+ 'admin/education_field' => $this->make_hook('admin_education_field', AUTH_MDP, 'admin'),
+ 'admin/education_degree' => $this->make_hook('admin_education_degree', AUTH_MDP, 'admin'),
+ 'admin/education_degree_set' => $this->make_hook('admin_education_degree_set', AUTH_MDP, 'admin'),
+ 'admin/sections' => $this->make_hook('admin_sections', AUTH_MDP, 'admin'),
+ 'admin/networking' => $this->make_hook('admin_networking', AUTH_MDP, 'admin'),
+ 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'),
+ 'admin/sectors' => $this->make_hook('admin_sectors', AUTH_MDP, 'admin'),
+ 'admin/corps_enum' => $this->make_hook('admin_corps_enum', AUTH_MDP, 'admin'),
+ 'admin/corps_rank' => $this->make_hook('admin_corps_rank', AUTH_MDP, 'admin'),
+ 'admin/names' => $this->make_hook('admin_names', AUTH_MDP, 'admin'),
);
}
exit;
}
+ function handler_name_info(&$page)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $page->changeTpl('profile/name_info.tpl', SIMPLE);
+ $res = XDB::iterator("SELECT name, explanations,
+ FIND_IN_SET('public', flags) AS public,
+ FIND_IN_SET('has_particle', flags) AS has_particle
+ FROM profile_name_enum
+ WHERE NOT FIND_IN_SET('not_displayed', flags)
+ ORDER BY NOT FIND_IN_SET('public', flags)");
+ $page->assign('types', $res);
+ }
+
+ function handler_networking(&$page, $mid)
+ {
+ $res = XDB::query("SELECT icon
+ FROM profile_networking_enum
+ WHERE network_type = {?}",
+ $mid);
+ $img = dirname(__FILE__) . '/../htdocs/images/networking/' . $res->fetchOneCell();
+ $type = mime_content_type($img);
+ header("Content-Type: $type");
+ echo file_get_contents($img);
+ exit;
+ }
+
function handler_photo_change(&$page)
{
global $globals;
// Build the page
$page->addJsLink('ajax.js');
- $page->addJsLink('applis.js');
+ $page->addJsLink('education.js');
$page->addJsLink('grades.js');
$page->addJsLink('profile.js');
$page->addJsLink('jquery.autocomplete.js');
WHERE user_id = {?} AND naissance = '0000-00-00'", S::i('uid'));
if ($res->numRows()) {
$page->trigWarning("Ta date de naissance n'est pas renseignée, ce qui t'empêcheras de réaliser"
- . " la procédure de récupération de mot de passe si un jour tu le perdais");
+ . " la procédure de récupération de mot de passe si un jour tu le perdais.");
}
$page->setTitle('Mon Profil');
}
- function handler_applis_js(&$page)
+ function handler_education_js(&$page)
{
header('Content-Type: text/javascript; charset=utf-8');
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified:' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
- $page->changeTpl('profile/applis.js.tpl', NO_SKIN);
- require_once "applis.func.inc.php";
+ $page->changeTpl('profile/education.js.tpl', NO_SKIN);
+ require_once "education.func.inc.php";
}
function handler_grades_js(&$page)
$page->assign('medal_list', $mlist);
}
- function handler_ajax_address(&$page, $adid)
+ function handler_ajax_address(&$page, $id)
{
header('Content-Type: text/html; charset=utf-8');
$page->changeTpl('profile/adresses.address.tpl', NO_SKIN);
- $page->assign('i', $adid);
- $page->assign('adr', array());
+ $page->assign('i', $id);
+ $page->assign('address', array());
}
- function handler_ajax_tel(&$page, $adid, $telid)
+ function handler_ajax_tel(&$page, $prefid, $prefname, $telid)
{
header('Content-Type: text/html; charset=utf-8');
- $page->changeTpl('profile/adresses.tel.tpl', NO_SKIN);
- $page->assign('i', $adid);
- $page->assign('adid', "addresses_$adid");
- $page->assign('adpref', "addresses[$adid]");
- $page->assign('t', $telid);
+ $page->changeTpl('profile/phone.tpl', NO_SKIN);
+ $page->assign('prefid', $prefid);
+ $page->assign('prefname', $prefname);
+ $page->assign('telid', $telid);
$page->assign('tel', array());
}
+ function handler_ajax_edu(&$page, $eduid, $class)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $page->changeTpl('profile/general.edu.tpl', NO_SKIN);
+ $res = XDB::iterator("SELECT id, field
+ FROM profile_education_field_enum
+ ORDER BY field");
+ $page->assign('edu_fields', $res->fetchAllAssoc());
+ $page->assign('eduid', $eduid);
+ $page->assign('class', $class);
+ require_once "education.func.inc.php";
+ }
+
function handler_ajax_medal(&$page, $id)
{
header('Content-Type: text/html; charset=utf-8');
$page->assign('i', $id);
$page->assign('job', array());
$page->assign('new', true);
- $res = XDB::query("SELECT id, label
- FROM emploi_secteur");
- $page->assign('secteurs', $res->fetchAllAssoc());
- $res = XDB::query("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title
- FROM fonctions_def
- ORDER BY id");
- $page->assign('fonctions', $res->fetchAllAssoc());
+ $res = XDB::query("SELECT id, name AS label
+ FROM profile_job_sector_enum");
+ $page->assign('sectors', $res->fetchAllAssoc());
+ require_once "emails.combobox.inc.php";
+ fill_email_combobox($page);
}
- function handler_ajax_secteur(&$page, $id, $sect, $ssect = -1)
+ function handler_ajax_sector(&$page, $id, $jobid, $jobpref, $sect, $ssect = -1)
{
header('Content-Type: text/html; charset=utf-8');
- $res = XDB::iterator("SELECT id, label
- FROM emploi_ss_secteur
- WHERE secteur = {?}", $sect);
- $page->changeTpl('profile/jobs.secteur.tpl', NO_SKIN);
+ $res = XDB::iterator("SELECT id, name, FIND_IN_SET('optgroup', flags) AS optgroup
+ FROM profile_job_subsector_enum
+ WHERE sectorid = {?}", $sect);
+ $page->changeTpl('profile/jobs.sector.tpl', NO_SKIN);
$page->assign('id', $id);
- $page->assign('ssecteurs', $res);
+ $page->assign('subSectors', $res);
$page->assign('sel', $ssect);
+ if ($id != -1) {
+ $page->assign('change', 1);
+ $page->assign('jobid', $jobid);
+ $page->assign('jobpref', $jobpref);
+ }
+ }
+
+ function handler_ajax_sub_sector(&$page, $id, $ssect, $sssect = -1)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $res = XDB::iterator("SELECT id, name
+ FROM profile_job_subsubsector_enum
+ WHERE subsectorid = {?}", $ssect);
+ $page->changeTpl('profile/jobs.sub_sector.tpl', NO_SKIN);
+ $page->assign('id', $id);
+ $page->assign('subSubSectors', $res);
+ $page->assign('sel', $sssect);
+ }
+
+ function handler_ajax_alternates(&$page, $id, $sssect)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $res = XDB::iterator('SELECT name
+ FROM profile_job_alternates
+ WHERE subsubsectorid = {?}
+ ORDER BY id',
+ $sssect);
+ $page->changeTpl('profile/jobs.alternates.tpl', NO_SKIN);
+ $alternate = $res->next();
+ $alternates = $alternate['name'];
+ while ($alternate = $res->next()) {
+ $alternates .= ', ' . $alternate['name'];
+ }
+ $page->assign('alternates', $alternates);
}
function handler_ajax_skill(&$page, $cat, $id)
}
}
+ function handler_ajax_searchname(&$page, $id)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $page->changeTpl('profile/general.searchname.tpl', NO_SKIN);
+ $res = XDB::query("SELECT id, name, FIND_IN_SET('public', flags) AS pub
+ FROM profile_name_enum
+ WHERE NOT FIND_IN_SET('not_displayed', flags)
+ AND NOT FIND_IN_SET('always_displayed', flags)");
+ $page->assign('sn_type_list', $res->fetchAllAssoc());
+ $page->assign('i', $id);
+ }
+
+ function handler_ajax_buildnames(&$page, $data)
+ {
+ header('Content-Type: text/html; charset=utf-8');
+ $page->changeTpl('profile/general.buildnames.tpl', NO_SKIN);
+ require_once 'name.func.inc.php';
+ $page->assign('names', build_javascript_names($data));
+ }
+
function handler_p_orange(&$page)
{
$page->changeTpl('profile/orange.tpl');
require_once 'validations.inc.php';
- $res = XDB::query(
- "SELECT u.promo, u.promo_sortie
- FROM auth_user_md5 AS u
- WHERE user_id={?}", S::v('uid'));
+ $res = XDB::query("SELECT e.entry_year, e.grad_year, d.promo, FIND_IN_SET('femme', u.flags) AS sexe
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_display AS d ON (d.pid = u.user_id)
+ INNER JOIN profile_education AS e ON (e.uid = u.user_id AND FIND_IN_SET('primary', e.flags))
+ WHERE u.user_id = {?}", S::v('uid'));
- list($promo, $promo_sortie_old) = $res->fetchOneRow();
+ list($promo, $promo_sortie_old, $promo_display, $sexe) = $res->fetchOneRow();
$page->assign('promo_sortie_old', $promo_sortie_old);
- $page->assign('promo', $promo);
+ $page->assign('promo', $promo);
+ $page->assign('promo_display', $promo_display);
+ $page->assign('sexe', $sexe);
if (!Env::has('promo_sortie')) {
return;
$promo_sortie = Env::i('promo_sortie');
if ($promo_sortie < 1000 || $promo_sortie > 9999) {
- $page->trigError('L\'année de sortie doit être un nombre de quatre chiffres');
+ $page->trigError('L\'année de sortie doit être un nombre de quatre chiffres.');
}
elseif ($promo_sortie < $promo + 3) {
- $page->trigError('Trop tôt');
+ $page->trigError('Trop tôt !');
}
elseif ($promo_sortie == $promo_sortie_old) {
$page->trigWarning('Tu appartiens déjà à la promotion correspondante à cette année de sortie.');
}
elseif ($promo_sortie == $promo + 3) {
- XDB::execute(
- "UPDATE auth_user_md5 set promo_sortie={?}
- WHERE user_id={?}", $promo_sortie, S::v('uid'));
+ XDB::execute("UPDATE profile_education
+ SET grad_year = {?}
+ WHERE uid = {?} AND FIND_IN_SET('primary', flags)", $promo_sortie, S::v('uid'));
$page->trigSuccess('Ton statut "orange" a été supprimé.');
$page->assign('promo_sortie_old', $promo_sortie);
}
///// recuperations infos referent
//expertise
- $res = XDB::query("SELECT expertise FROM mentor WHERE uid = {?}", $user->id());
+ $res = XDB::query("SELECT expertise FROM profile_mentor WHERE uid = {?}", $user->id());
$page->assign('expertise', $res->fetchOneCell());
- //secteurs
- $secteurs = $ss_secteurs = Array();
+ // Sectors
+ $sectors = $subSectors = Array();
$res = XDB::iterRow(
- "SELECT s.label, ss.label
- FROM mentor_secteurs AS m
- LEFT JOIN emploi_secteur AS s ON(m.secteur = s.id)
- LEFT JOIN emploi_ss_secteur AS ss ON(m.secteur = ss.secteur AND m.ss_secteur = ss.id)
+ "SELECT s.name AS label, ss.name AS label
+ FROM profile_mentor_sector AS m
+ LEFT JOIN profile_job_sector_enum AS s ON(m.sectorid = s.id)
+ LEFT JOIN profile_job_subsector_enum AS ss ON(m.sectorid = ss.sectorid AND m.subsectorid = ss.id)
WHERE uid = {?}", $user->id());
- while (list($sec, $ssec) = $res->next()) {
- $secteurs[] = $sec;
- $ss_secteurs[] = $ssec;
+ while (list($sector, $subSector) = $res->next()) {
+ $sectors[] = $sector;
+ $subSectors[] = $subSector;
}
- $page->assign_by_ref('secteurs', $secteurs);
- $page->assign_by_ref('ss_secteurs', $ss_secteurs);
+ $page->assign_by_ref('sectors', $sectors);
+ $page->assign_by_ref('subSectors', $subSectors);
- //pays
+ // Countries.
$res = XDB::query(
- "SELECT gp.pays
- FROM mentor_pays AS m
- LEFT JOIN geoloc_pays AS gp ON(m.pid = gp.a2)
+ "SELECT gc.countryFR
+ FROM profile_mentor_country AS m
+ LEFT JOIN geoloc_countries AS gc ON (m.country = gc.iso_3166_1_a2)
WHERE uid = {?}", $user->id());
$page->assign('pays', $res->fetchColumn());
$page->setTitle('Conseil Pro');
- //recuperation des noms de secteurs
- $res = XDB::iterRow("SELECT id, label FROM emploi_secteur");
- $secteurs[''] = '';
+ // Retrieval of sector names
+ $res = XDB::iterRow("SELECT id, name AS label
+ FROM profile_job_sector_enum");
+ $sectors[''] = '';
while (list($tmp_id, $tmp_label) = $res->next()) {
- $secteurs[$tmp_id] = $tmp_label;
+ $sectors[$tmp_id] = $tmp_label;
}
- $page->assign_by_ref('secteurs', $secteurs);
+ $page->assign_by_ref('sectors', $sectors);
// nb de mentors
- $res = XDB::query("SELECT count(*) FROM mentor");
+ $res = XDB::query("SELECT count(*) FROM profile_mentor");
$page->assign('mentors_number', $res->fetchOneCell());
// On vient d'un formulaire
- $where = array();
- $pays_sel = XDB::escape(Env::v('pays_sel'));
- $secteur_sel = XDB::escape(Env::v('secteur'));
- $ss_secteur_sel = XDB::escape(Env::v('ss_secteur'));
- $expertise_champ = XDB::escape(Env::v('expertise'));
+ $where = array();
+ $pays_sel = XDB::escape(Env::v('pays_sel'));
+ $sectorSelection = XDB::escape(Env::v('sector'));
+ $subSectorSelection = XDB::escape(Env::v('subSector'));
+ $expertise_champ = XDB::escape(Env::v('expertise'));
if ($pays_sel != "''") {
- $where[] = "mp.pid = $pays_sel";
+ $where[] = "mp.country = $pays_sel";
}
- if ($secteur_sel != "''") {
- $where[] = "ms.secteur = $secteur_sel";
- if ($ss_secteur_sel != "''") {
- $where[] = "ms.ss_secteur = $ss_secteur_sel";
+ if ($sectorSelection != "''") {
+ $where[] = "ms.sectorid = " . $sectorSelection;
+ if ($selectedSubSector != "''") {
+ $where[] = "ms.subsectorid = " . $subSectorSelection;
}
}
if ($expertise_champ != "''") {
if ($where) {
$where = join(' AND ', $where);
- $set = new UserSet("INNER JOIN mentor AS m ON (m.uid = u.user_id)
- LEFT JOIN mentor_pays AS mp ON (mp.uid = m.uid)
- LEFT JOIN mentor_secteurs AS ms ON (ms.uid = m.uid)",
+ $set = new UserSet("INNER JOIN profile_mentor AS m ON (m.uid = u.user_id)
+ LEFT JOIN profile_mentor_country AS mp ON (mp.uid = m.uid)
+ LEFT JOIN profile_mentor_sector AS ms ON (ms.uid = m.uid)",
$where);
$set->addMod('mentor', 'Référents');
$set->apply('referent/search', $page, $action, $subaction);
{
header('Content-Type: text/html; charset=utf-8');
$page->changeTpl('include/field.select.tpl', NO_SKIN);
- $page->assign('onchange', 'setSSecteurs()');
+ $page->assign('onchange', 'setSSectors()');
$page->assign('id', 'ssect_field');
- $page->assign('name', 'ss_secteur');
- $it = XDB::iterator("SELECT id,label AS field
- FROM emploi_ss_secteur
- WHERE secteur = {?}", $sect);
+ $page->assign('name', 'subSector');
+ $it = XDB::iterator("SELECT id, name AS field
+ FROM profile_job_subsector_enum
+ WHERE sectorid = {?}", $sect);
$page->assign('list', $it);
}
header('Content-Type: text/html; charset=utf-8');
$page->changeTpl('include/field.select.tpl', NO_SKIN);
$page->assign('name', 'pays_sel');
- $where = ($ssect ? ' AND ms.ss_secteur = {?}' : '');
- $it = XDB::iterator("SELECT a2 AS id, pays AS field
- FROM geoloc_pays AS g
- INNER JOIN mentor_pays AS mp ON (mp.pid = g.a2)
- INNER JOIN mentor_secteurs AS ms ON (ms.uid = mp.uid)
- WHERE ms.secteur = {?} $where
- GROUP BY a2
- ORDER BY pays", $sect, $ssect);
+ $where = ($ssect ? ' AND ms.subsectorid = {?}' : '');
+ $it = XDB::iterator("SELECT gc.iso_3166_1_a2 AS id, gc.countryFR AS field
+ FROM geoloc_countries AS gc
+ INNER JOIN profile_mentor_country AS mp ON (mp.country = gc.iso_3166_1_a2)
+ INNER JOIN profile_mentor_sector AS ms ON (ms.uid = mp.uid)
+ WHERE ms.sectorid = {?} " . $where . "
+ GROUP BY iso_3166_1_a2
+ ORDER BY countryFR", $sect, $ssect);
$page->assign('list', $it);
}
- function handler_p_usage(&$page)
- {
- $page->changeTpl('profile/nomusage.tpl');
-
- require_once 'validations.inc.php';
-
- $res = XDB::query(
- "SELECT u.nom, u.nom_usage, u.flags, e.alias
- FROM auth_user_md5 AS u
- LEFT JOIN aliases AS e ON(u.user_id = e.id
- AND FIND_IN_SET('usage', e.flags))
- WHERE user_id={?}", S::v('uid'));
-
- list($nom, $usage_old, $flags, $alias_old) = $res->fetchOneRow();
- $flags = new PlFlagSet($flags);
- $page->assign('usage_old', $usage_old);
- $page->assign('alias_old', $alias_old);
-
- $nom_usage = replace_accent(trim(Env::v('nom_usage')));
- $nom_usage = strtoupper($nom_usage);
- $page->assign('usage_req', $nom_usage);
-
- if (Env::has('submit') && ($nom_usage != $usage_old)) {
- S::assert_xsrf_token();
-
- // on vient de recevoir une requete, differente de l'ancien nom d'usage
- if ($nom_usage == $nom) {
- $page->trigWarning('Le nom d\'usage que tu demandes est identique à ton nom à l\'X, '
- . 'aucune modification n\'a donc été effectuée.');
- $page->assign('same', true);
- } else { // le nom de mariage est distinct du nom à l'X
- // on calcule l'alias pour l'afficher
- $reason = Env::v('reason');
- if ($reason == 'other') {
- $reason = Env::v('other_reason');
- }
- $myusage = new UsageReq(S::user(), $nom_usage, $reason);
- $myusage->submit();
- $page->assign('myusage', $myusage);
- }
- }
- }
-
function handler_xnet(&$page)
{
$page->changeTpl('profile/groupesx.tpl');
break;
}
}
+ function handler_admin_names(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Types de noms');
+ $page->assign('title', 'Gestion des types de noms');
+ $table_editor = new PLTableEditor('admin/names', 'profile_name_enum', 'id', true);
+ $table_editor->describe('name', 'Nom', true);
+ $table_editor->describe('explanations', 'Explications', true);
+ $table_editor->describe('type', 'Type', true);
+ $table_editor->describe('flags', 'Flags', true);
+ $table_editor->describe('score', 'Score', true);
+ $table_editor->apply($page, $action, $id);
+ }
function handler_admin_binets(&$page, $action = 'list', $id = null) {
$page->setTitle('Administration - Binets');
$page->assign('title', 'Gestion des binets');
$table_editor->describe('text','intitulé',true);
$table_editor->apply($page, $action, $id);
}
- function handler_admin_formations(&$page, $action = 'list', $id = null) {
+ function handler_admin_education(&$page, $action = 'list', $id = null) {
$page->setTitle('Administration - Formations');
$page->assign('title', 'Gestion des formations');
- $table_editor = new PLTableEditor('admin/formations','applis_def','id');
- $table_editor->add_join_table('applis_ins','aid',true);
- $table_editor->describe('text','intitulé',true);
- $table_editor->describe('url','site web',false);
+ $table_editor = new PLTableEditor('admin/education', 'profile_education_enum', 'id');
+ $table_editor->add_join_table('profile_education', 'eduid', true);
+ $table_editor->add_join_table('profile_education_degree', 'eduid', true);
+ $table_editor->describe('name', 'intitulé', true);
+ $table_editor->describe('url', 'site web', false);
+ $table_editor->apply($page, $action, $id);
+ }
+ function handler_admin_education_field(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Domaines de formation');
+ $page->assign('title', 'Gestion des domaines de formation');
+ $table_editor = new PLTableEditor('admin/education_field', 'profile_education_field_enum', 'id', true);
+ $table_editor->add_join_table('profile_education', 'fieldid', true);
+ $table_editor->describe('field', 'domaine', true);
+ $table_editor->apply($page, $action, $id);
+ }
+ function handler_admin_education_degree(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Niveau de formation');
+ $page->assign('title', 'Gestion des niveau de formation');
+ $table_editor = new PLTableEditor('admin/education_degree', 'profile_education_degree_enum', 'id', true);
+ $table_editor->add_join_table('profile_education_degree', 'degreeid', true);
+ $table_editor->add_join_table('profile_education', 'degreeid', true);
+ $table_editor->describe('degree', 'niveau', true);
+ $table_editor->apply($page, $action, $id);
+ }
+ function handler_admin_education_degree_set(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Correspondances formations - niveau de formation');
+ $page->assign('title', 'Gestion des correspondances formations - niveau de formation');
+ $table_editor = new PLTableEditor('admin/education_degree_set', 'profile_education_degree', 'eduid', true);
+ $table_editor->describe('eduid', 'formation', true);
+ $table_editor->describe('degreeid', 'niveau', true);
$table_editor->apply($page, $action, $id);
}
function handler_admin_sections(&$page, $action = 'list', $id = null) {
$table_editor->describe('text','intitulé',true);
$table_editor->apply($page, $action, $id);
}
- function handler_admin_ss_secteurs(&$page, $action = 'list', $id = null) {
- $page->setTitle('Administration - Sous-secteurs');
- $page->assign('title', 'Gestion des sous-secteurs');
- $table_editor = new PLTableEditor('admin/ss_secteurs', 'emploi_ss_secteur', 'id', true);
- $table_editor->describe('label', 'intitulé', true);
+ function handler_admin_sectors(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Secteurs');
+ $page->assign('title', 'Gestion des secteurs');
+ $table_editor = new PLTableEditor('admin/sectors', 'profile_job_subsubsector_enum', 'id', true);
+ $table_editor->describe('sectorid', 'id du secteur', false);
+ $table_editor->describe('subsectorid', 'id du sous-secteur', false);
+ $table_editor->describe('name', 'nom', true);
+ $table_editor->describe('flags', 'affichage', true);
+ $table_editor->apply($page, $action, $id);
+ }
+ function handler_admin_networking(&$page, $action = 'list', $id = null) {
+ $page->assign('xorg_title', 'Polytechnique.org - Administration - Networking');
+ $page->assign('title', 'Gestion des types de networking');
+ $table_editor = new PLTableEditor('admin/networking', 'profile_networking_enum', 'network_type');
+ $table_editor->describe('name', 'intitulé', true);
+ $table_editor->describe('icon', 'nom de l\'icône', false);
+ $table_editor->describe('filter', 'filtre', true);
+ $table_editor->describe('link', 'lien web', true);
$table_editor->apply($page, $action, $id);
}
- function handler_admin_fonctions(&$page, $action = 'list', $id = null) {
- $page->setTitle('Administration - Fonctions');
- $page->assign('title', 'Gestion des fonctions');
- $table_editor = new PLTableEditor('admin/fonctions', 'fonctions_def', 'id', true);
- $table_editor->describe('fonction_fr', 'intitulé', true);
- $table_editor->describe('fonction_en', 'intitulé (ang)', true);
- $table_editor->describe('flags', 'titre', true);
+ function handler_admin_corps_enum(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Corps');
+ $page->assign('title', 'Gestion des Corps');
+ $table_editor = new PLTableEditor('admin/corps_enum', 'profile_corps_enum', 'id');
+ $table_editor->describe('name', 'intitulé', true);
+ $table_editor->describe('abbreviation', 'abbréviation', true);
+ $table_editor->describe('still_exists', 'existe encore ?', true);
$table_editor->apply($page, $action, $id);
}
- function handler_admin_secteurs(&$page, $action = 'list', $id = null) {
- $page->setTitle('Administration - Secteurs');
- $page->assign('title', 'Gestion des secteurs');
- $table_editor = new PLTableEditor('admin/secteurs', 'emploi_secteur', 'id', true);
- $table_editor->describe('label', 'intitulé', true);
+ function handler_admin_corps_rank(&$page, $action = 'list', $id = null) {
+ $page->setTitle('Administration - Grade dans les Corps');
+ $page->assign('title', 'Gestion des grade dans les Corps');
+ $table_editor = new PLTableEditor('admin/corps_rank', 'profile_corps_rank_enum', 'id');
+ $table_editor->describe('name', 'intitulé', true);
+ $table_editor->describe('abbreviation', 'abbréviation', true);
$table_editor->apply($page, $action, $id);
}
function handler_admin_medals(&$page, $action = 'list', $id = null) {
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class ProfileAddress extends ProfileGeoloc
+class ProfileAddress extends ProfileGeocoding
{
private $bool;
private $pub;
- private $tel;
public function __construct()
{
$this->bool = new ProfileBool();
$this->pub = new ProfilePub();
- $this->tel = new ProfileTel();
}
- private function cleanAddress(ProfilePage &$page, array &$address, &$success)
+ private function cleanAddress(ProfilePage &$page, $addrid, array &$address)
{
- if (@$address['changed']) {
- $address['datemaj'] = time();
+ if (!isset($address['tel'])) {
+ $address['tel'] = array();
}
- $success = true;
- foreach ($address['tel'] as $t=>&$tel) {
- if (@$tel['removed'] || !trim($tel['tel'])) {
- unset($address['tel'][$t]);
- } else {
- $tel['pub'] = $this->pub->value($page, 'pub', $tel['pub'], $s);
- $tel['tel'] = $this->tel->value($page, 'tel', $tel['tel'], $s);
- if (!$s) {
- $tel['error'] = true;
- $success = false;
- }
- }
- unset($tel['removed']);
- }
- $address['checked'] = $this->bool->value($page, 'checked', $address['checked'], $s);
- $address['secondaire'] = $this->bool->value($page, 'secondaire', $address['secondaire'], $s);
- $address['mail'] = $this->bool->value($page, 'mail', $address['mail'], $s);
+ $profiletel = new ProfilePhones('address', $addrid);
+ $address['tel'] = $profiletel->value($page, 'tel', $address['tel'], $s);
+ $address['current'] = $this->bool->value($page, 'current', $address['current'], $s);
$address['temporary'] = $this->bool->value($page, 'temporary', $address['temporary'], $s);
- $address['current'] = $this->bool->value($page, 'current', @$address['current'], $s);
- $address['pub'] = $this->pub->value($page, 'pub', $address['pub'], $s);
- unset($address['parsevalid']);
- unset($address['changed']);
- unset($address['removed']);
- unset($address['display']);
+ $address['secondary'] = $this->bool->value($page, 'secondary', $address['secondary'], $s);
+ $address['mail'] = $this->bool->value($page, 'mail', $address['mail'], $s);
+ $address['pub'] = $this->pub->value($page, 'pub', $address['pub'], $s);
}
public function value(ProfilePage &$page, $field, $value, &$success)
$init = false;
if (is_null($value)) {
$value = $page->values['addresses'];
- $init = true;
+ $init = true;
}
- foreach ($value as $key=>&$adr) {
- if (@$adr['removed']) {
+ foreach ($value as $key => &$address) {
+ if (isset($address['removed']) && $address['removed']) {
unset($value[$key]);
}
}
$current = 0;
$success = true;
- foreach ($value as $key=>&$adr) {
- if (@$adr['current']) {
+ foreach ($value as $key => &$address) {
+ if (isset($address['current']) && $address['current']) {
$current++;
}
}
if ($current == 0 && count($value) > 0) {
- foreach ($value as $key=>&$adr) {
- $adr['current'] = true;
+ foreach ($value as $address) {
+ $address['current'] = true;
break;
}
- } else if ($current > 1) {
+ } elseif ($current > 1) {
$success = false;
}
- foreach ($value as $key=>&$adr) {
- $ls = true;
- $this->geolocAddress($adr, $s);
- $ls = ($ls && $s);
- $this->cleanAddress($page, $adr, $s);
- $ls = ($ls && $s);
- if (!trim($adr['text'])) {
+ foreach ($value as $key => &$address) {
+ if (!trim($address['text'])) {
unset($value[$key]);
- } else if (!$init) {
- $success = ($success && $ls);
+ } elseif (!$init) {
+ $this->geocodeAddress($address, $s);
+ $success = $success && $s;
}
+ $this->cleanAddress($page, $key, $address);
}
return $value;
}
- private function saveTel($adrid, $telid, array &$tel)
+ private function saveTel($addrid, $telid, array &$tel)
{
- XDB::execute("INSERT INTO tels (uid, adrid, telid,
- tel_type, tel_pub, tel)
- VALUES ({?}, {?}, {?},
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type,
+ search_tel, display_tel, pub)
+ VALUES ({?}, 'address', {?}, {?}, {?},
{?}, {?}, {?})",
- S::i('uid'), $adrid, $telid,
- $tel['type'], $tel['pub'], $tel['tel']);
+ S::i('uid'), $addrid, $telid, $tel['type'],
+ format_phone_number($tel['tel']), $tel['tel'], $tel['pub']);
}
- private function saveAddress($adrid, array &$address)
+ public function saveAddress($addrid, array &$address, $type)
{
+ require_once "geocoding.inc.php";
+
$flags = new PlFlagSet();
- if ($address['secondaire']) {
- $flags->addFlag('res-secondaire');
- }
- if ($address['mail']) {
- $flags->addFlag('courrier');
- }
- if ($address['temporary']) {
- $flags->addFlag('temporaire');
- }
if ($address['current']) {
- $flags->addFlag('active');
+ $flags->addFlag('current');
}
- if ($address['checked']) {
- $flags->addFlag('coord-checked');
+ if ($address['temporary']) {
+ $flags->addFlag('temporary');
}
- XDB::execute("INSERT INTO adresses (adr1, adr2, adr3,
- postcode, city, cityid,
- country, region, regiontxt,
- pub, datemaj, statut,
- uid, adrid, glat, glng)
- VALUES ({?}, {?}, {?},
- {?}, {?}, {?},
- {?}, {?}, {?},
- {?}, FROM_UNIXTIME({?}), {?},
- {?}, {?}, {?}, {?})",
- $address['adr1'], $address['adr2'], $address['adr3'],
- $address['postcode'], $address['city'], $address['cityid'],
- $address['country'], $address['region'], $address['regiontxt'],
- $address['pub'], $address['datemaj'], $flags,
- S::i('uid'), $adrid, $address['precise_lat'], $address['precise_lon']);
- foreach ($address['tel'] as $telid=>&$tel) {
- $this->saveTel($adrid, $telid, $tel);
+ if ($address['secondary']) {
+ $flags->addFlag('secondary');
}
+ if ($address['mail']) {
+ $flags->addFlag('mail');
+ }
+ if ($address['cedex'] =
+ (strpos(strtoupper(preg_replace(array("/[0-9,\"'#~:;_\- ]/", "/\r\n/"),
+ array("", "\n"), $address['text'])), 'CEDEX')) !== false) {
+ $flags->addFlag('cedex');
+ }
+ Geocoder::getAreaId($address, "administrativeArea");
+ Geocoder::getAreaId($address, "subAdministrativeArea");
+ Geocoder::getAreaId($address, "locality");
+ XDB::execute("INSERT INTO profile_addresses (pid, type, id, flags, accuracy,
+ text, postalText, postalCode, localityId,
+ subAdministrativeAreaId, administrativeAreaId,
+ countryId, latitude, longitude, updateTime, pub, comment,
+ north, south, east, west)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
+ {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?}, {?}, {?})",
+ S::i('uid'), $type, $addrid, $flags, $address['accuracy'],
+ $address['text'], $address['postalText'], $address['postalCode'], $address['localityId'],
+ $address['subAdministrativeAreaId'], $address['administrativeAreaId'],
+ $address['countryId'], $address['latitude'], $address['longitude'],
+ $address['updateTime'], $address['pub'], $address['comment'],
+ $address['north'], $address['south'], $address['east'], $address['west']);
}
public function save(ProfilePage &$page, $field, $value)
{
- XDB::execute("DELETE FROM adresses
- WHERE uid = {?}",
+ XDB::execute("DELETE FROM profile_addresses
+ WHERE pid = {?} AND type = 'home'",
S::i('uid'));
- XDB::execute("DELETE FROM tels
- WHERE uid = {?}",
+ XDB::execute("DELETE FROM profile_phones
+ WHERE uid = {?} AND link_type = 'address'",
S::i('uid'));
- foreach ($value as $adrid=>&$address) {
- $this->saveAddress($adrid, $address);
+ foreach ($value as $addrid => &$address) {
+ $this->saveAddress($addrid, $address, 'home');
+ $profiletel = new ProfilePhones('address', $addrid);
+ $profiletel->saveTels('tel', $address['tel']);
}
}
}
{
parent::__construct($wiz);
$this->settings['addresses'] = new ProfileAddress();
- $this->watched['addresses'] = true;
+ $this->watched['addresses'] = true;
}
protected function _fetchData()
{
- // Build the addresses tree
- $res = XDB::query("SELECT a.adrid AS id, a.adr1, a.adr2, a.adr3,
- UNIX_TIMESTAMP(a.datemaj) AS datemaj,
- a.postcode, a.city, a.cityid, a.region, a.regiontxt,
- a.pub, a.country, gp.pays AS countrytxt, gp.display,
- FIND_IN_SET('coord-checked', a.statut) AS checked,
- FIND_IN_SET('res-secondaire', a.statut) AS secondaire,
- FIND_IN_SET('courrier', a.statut) AS mail,
- FIND_IN_SET('temporaire', a.statut) AS temporary,
- FIND_IN_SET('active', a.statut) AS current,
- a.glat AS precise_lat, a.glng AS precise_lon
- FROM adresses AS a
- INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country)
- WHERE uid = {?} AND NOT FIND_IN_SET('pro', statut)
- ORDER BY adrid",
+ $res = XDB::query("SELECT id, accuracy, text, postalText,
+ postalCode, localityId, subAdministrativeAreaId, administrativeAreaId,
+ countryId, latitude, longitude, pub, comment, UNIX_TIMESTAMP(updateTime) AS updateTime,
+ north, south, east, west,
+ FIND_IN_SET('current', flags) AS current,
+ FIND_IN_SET('temporary', flags) AS temporary,
+ FIND_IN_SET('secondary', flags) AS secondary,
+ FIND_IN_SET('mail', flags) AS mail,
+ FIND_IN_SET('cedex', flags) AS cedex
+ FROM profile_addresses
+ WHERE pid = {?} AND type = 'home'
+ ORDER BY id",
S::i('uid'));
if ($res->numRows() == 0) {
$this->values['addresses'] = array();
$this->values['addresses'] = $res->fetchAllAssoc();
}
- $res = XDB::iterator("SELECT adrid, tel_type AS type, tel_pub AS pub, tel
- FROM tels
- WHERE uid = {?}
- ORDER BY adrid",
+ $res = XDB::iterator("SELECT link_id AS addrid, tel_type AS type, pub, display_tel AS tel, comment
+ FROM profile_phones
+ WHERE uid = {?} AND link_type = 'address'
+ ORDER BY link_id",
S::i('uid'));
$i = 0;
$adrNb = count($this->values['addresses']);
while ($tel = $res->next()) {
- $adrid = $tel['adrid'];
- unset($tel['adrid']);
+ $adrid = $tel['addrid'];
+ unset($tel['addrid']);
while ($i < $adrNb && $this->values['addresses'][$i]['id'] < $adrid) {
$i++;
}
$address['tel'][] = $tel;
}
}
- foreach ($this->values['addresses'] as $id=>&$address) {
+ foreach ($this->values['addresses'] as $id => &$address) {
if (!isset($address['tel'])) {
- $address['tel'] = array();
+ $address['tel'] = array(
+ 0 => array(
+ 'type' => 'fixed',
+ 'tel' => '',
+ 'pub' => 'private',
+ 'comment' => '',
+ )
+ );
}
unset($address['id']);
+ $address['changed'] = 0;
+ $address['removed'] = 0;
}
}
}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class ProfileNom implements ProfileSetting
+class ProfileSearchNames implements ProfileSetting
{
+ private $private_name_end;
+ private $search_names;
+
private function matchWord($old, $new, $newLen) {
return ($i = strpos($old, $new)) !== false
&& ($i == 0 || $old{$i-1} == ' ')
return preg_replace('/[^A-Z]/', ' ', $value);
}
- public function value(ProfilePage &$page, $field, $value, &$success)
+ private function prepare(ProfilePage &$page, $field, $value, $init, &$success)
{
$success = true;
- $current = S::v($field);
- $init = S::v($field . '_ini');
- if (is_null($value)) {
- return $current;
- }
- if ($value == $current || $value == $init) {
- return $value;
- }
- $ini = $this->prepareField($init);
- $old = $this->prepareField($current);
- $new = $this->prepareField($value);
- $newLen = strlen($new);
- $success = $this->matchWord($old, $new, $newLen)
- || $this->matchWord($ini, $new, $newLen)
- || ($field == 'nom' && $new == 'DE ' . $old);
+ $ini = $this->prepareField($init);
+ $new = $this->prepareField($value);
+ $newLen = strlen($new);
+ $success = $this->matchWord($ini, $new, $newLen)
+ || ($field == 'lastname' && $new == 'DE ' . $ini);
if (!$success) {
- Platal::page()->trigError("Le $field que tu as choisi ($value) est trop loin de ton $field initial ($init)"
- . (($init == $current)? "" : " et de ton prénom précédent ($current)"));
+ $field = strtolower($field);
+ Platal::page()->trigError("Le " . $field . " que tu as choisi (" . $value .
+ ") est trop loin de ton " . $field . " initial (" . $init . ").");
+ }
+ return $success ? $value : $init;
+ }
+
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ $success = true;
+ $success_tmp = true;
+
+ if (is_null($value)) {
+ $sn_all = XDB::iterator("SELECT CONCAT(sn.particle, sn.name) AS name,
+ sn.particle, sn.typeid, e.type, e.name AS type_name,
+ FIND_IN_SET('has_particle', e.flags) AS has_particle,
+ FIND_IN_SET('always_displayed', e.flags) AS always_displayed,
+ FIND_IN_SET('public', e.flags) AS pub
+ FROM profile_name AS sn
+ INNER JOIN profile_name_enum AS e ON (e.id = sn.typeid)
+ WHERE sn.pid = {?} AND NOT FIND_IN_SET('not_displayed', e.flags)
+ ORDER BY NOT FIND_IN_SET('always_displayed', e.flags), e.id, sn.name",
+ S::v('uid'));
+
+ $sn_types = XDB::iterator("SELECT id, type, name,
+ FIND_IN_SET('has_particle', flags) AS has_particle
+ FROM profile_name_enum
+ WHERE NOT FIND_IN_SET('not_displayed', flags)
+ AND FIND_IN_SET('always_displayed', flags)
+ ORDER BY id");
+
+ $value = array();
+ $sn = $sn_all->next();
+ while ($sn_type = $sn_types->next()) {
+ if ($sn_type['id'] == $sn['typeid']) {
+ $value[] = $sn;
+ $sn = $sn_all->next();
+ } else {
+ $value[] = array('name' => '',
+ 'particle' => '',
+ 'typeid' => $sn_type['id'],
+ 'type' => $sn_type['type'],
+ 'type_name' => $sn_type['name'],
+ 'has_particle' => $sn_type['has_particle'],
+ 'always_displayed' => 1,
+ 'pub' => 1);
+ }
+ }
+ if ($sn) {
+ do {
+ $value[] = $sn;
+ } while ($sn = $sn_all->next());
+ }
+ } else {
+ require_once 'name.func.inc.php';
+
+ $res = XDB::query("SELECT s.particle, s.name
+ FROM profile_name AS s
+ INNER JOIN profile_name_enum AS e ON (e.id = s.typeid)
+ WHERE s.pid = {?} AND e.type LIKE '%ini'
+ ORDER BY e.type = 'firstname_ini'",
+ S::i('uid'));
+ $res = $res->fetchAllAssoc();
+ $initial = array();
+ $initial['lastname'] = $res[0]['particle'] . $res[0]['name'];
+ $initial['firstname'] = $res[1]['name'];
+ $sn_types = build_types();
+ $this->search_names = array();
+ foreach ($value as &$sn) {
+ $sn['name'] = trim($sn['name']);
+ if ($sn['type'] == 'firstname' || $sn['type'] == 'lastname') {
+ $sn['name'] = $this->prepare($page, $sn['type'], $sn['name'],
+ $initial[$sn['type']], $success_tmp);
+ $success = $success && $success_tmp;
+ }
+ if ($sn['pub']) {
+ if (isset($sn['particle']) && ($sn['particle'] != '')) {
+ list($particle, $name) = explode(' ', $sn['name'], 2);
+ $particle = trim($particle) . ' ';
+ if (!$name) {
+ list($particle, $name) = explode('\'', $sn['name'], 2);
+ $particle = trim($particle);
+ }
+ } else {
+ $particle = '';
+ $name = $sn['name'];
+ }
+ }
+ if ($sn['name'] != '') {
+ if ($sn['pub']) {
+ $this->search_names[$sn['typeid']] = array('fullname' => $sn['name'],
+ 'name' => $name,
+ 'particle' => $particle,
+ 'pub' => $sn['pub']);
+ } else {
+ if (isset($this->search_names[$sn['typeid']])) {
+ $this->search_names[$sn['typeid']][] = $sn['name'];
+ } else {
+ $this->search_names[$sn['typeid']] = array('fullname' => $sn['name']);
+ }
+ $sn['type_name'] = $sn_types[$sn['typeid']];
+ }
+ }
+ }
+ $res = XDB::query("SELECT public_name, private_name
+ FROM profile_display
+ WHERE pid = {?}",
+ S::v('uid'));
+ list($public_name, $private_name) = $res->fetchOneRow();
+ if ($success) {
+ $sn_types_private = build_types('private');
+ $this->private_name_end = build_private_name($this->search_names, $sn_types_private);
+ $private_name = $public_name . $this->private_name_end;
+ }
+ Platal::page()->assign('public_name', $public_name);
+ Platal::page()->assign('private_name', $private_name);
+ }
+
+ return $value;
+ }
+
+ public function save(ProfilePage &$page, $field, $value)
+ {
+ require_once 'name.func.inc.php';
+ $sn_old = build_sn_pub();
+ XDB::execute("DELETE FROM s
+ USING profile_name AS s
+ INNER JOIN profile_name_enum AS e ON (s.typeid = e.id)
+ WHERE s.pid = {?} AND NOT FIND_IN_SET('not_displayed', e.flags)",
+ S::i('uid'));
+ $has_new = set_alias_names($this->search_names, $sn_old);
+
+ // Only requires validation if modification in public names
+ if ($has_new) {
+ $new_names = new NamesReq(S::user(), $this->search_names, $this->private_name_end);
+ $new_names->submit();
+ Platal::page()->trigWarning("La demande de modification de tes noms a bien été prise en compte." .
+ " Tu recevras un email dès que ces changements auront été effectués.");
+ } else {
+ $display_names = array();
+ build_display_names($display_names, $this->search_names, $this->private_name_end);
+ set_profile_display($display_names);
+ }
+ }
+}
+
+class ProfileEdu implements ProfileSetting
+{
+ public function __construct(){}
+
+ static function sortByGradYear($line1, $line2) {
+ $a = (int) $line1['grad_year'];
+ $b = (int) $line2['grad_year'];
+ if ($a == $b) {
+ return 0;
+ }
+ return ($a < $b) ? -1 : 1;
+ }
+
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ $success = true;
+ if (is_null($value) || !is_array($value)) {
+ $value = array();
+ $res = XDB::iterator("SELECT eduid, degreeid, fieldid, grad_year, program
+ FROM profile_education
+ WHERE uid = {?} AND !FIND_IN_SET('primary', flags)
+ ORDER BY id",
+ S::v('uid'));
+ while($edu = $res->next()) {
+ $value[] = $edu;
+ }
+ } else {
+ $i = 0;
+ foreach ($value as $key=>&$edu) {
+ if (($edu['grad_year'] < 1921) || ($edu['grad_year'] > (date('Y') + 4))) {
+ Platal::page()->trigError('L\'année d\'obtention du diplôme est mal renseignée, elle doit être du type : 2004.');
+ $edu['error'] = true;
+ $success = false;
+ }
+ if ($key != $i) {
+ $value[$i] = $edu;
+ unset($value[$key]);
+ }
+ $i++;
+ }
+ usort($value, array("ProfileEdu", "sortByGradYear"));
}
- return $success ? $value : $current;
+ return $value;
}
- public function save(ProfilePage &$page, $field, $new_value)
+ public function save(ProfilePage &$page, $field, $value)
{
- $_SESSION[$field] = $new_value;
+ XDB::execute("DELETE FROM profile_education
+ WHERE uid = {?} AND !FIND_IN_SET('primary', flags)",
+ S::i('uid'));
+ foreach ($value as $eduid=>&$edu) {
+ if ($edu['eduid'] != '') {
+ XDB::execute("INSERT INTO profile_education
+ SET id = {?}, uid = {?}, eduid = {?}, degreeid = {?},
+ fieldid = {?}, grad_year = {?}, program = {?}",
+ $eduid, S::i('uid'), $edu['eduid'], $edu['degreeid'],
+ $edu['fieldid'], $edu['grad_year'], $edu['program']);
+ }
+ }
}
}
-class ProfileAppli implements ProfileSetting
+class ProfileEmailDirectory implements ProfileSetting
{
+ public function __construct(){}
+ public function save(ProfilePage &$page, $field, $value){}
+
public function value(ProfilePage &$page, $field, $value, &$success)
{
+ $p = Platal::page();
+
$success = true;
+ if (!is_null($value)) {
+ $email_stripped = strtolower(trim($value));
+ if ((!isvalid_email($email_stripped)) && ($email_stripped) && ($page->values['email_directory'] == "new@example.org")) {
+ $p->assign('email_error', '1');
+ $p->assign('email_directory_error', $email_stripped);
+ $p->trigError('Adresse Email invalide');
+ $success = false;
+ } else {
+ $p->assign('email_error', '0');
+ }
+ }
+ return $value;
+ }
+}
+
+class ProfileNetworking implements ProfileSetting
+{
+ private $email;
+ private $pub;
+ private $web;
+ private $number;
+
+ public function __construct()
+ {
+ $this->email = new ProfileEmail();
+ $this->pub = new ProfilePub();
+ $this->web = new ProfileWeb();
+ $this->number = new ProfileNumber();
+ }
+
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
if (is_null($value)) {
- return $page->values[$field];
+ $value = array();
+ $res = XDB::iterator("SELECT n.address, n.network_type AS type, n.pub, m.name
+ FROM profile_networking AS n
+ INNER JOIN profile_networking_enum AS m ON (n.network_type = m.network_type)
+ WHERE n.uid = {?}",
+ S::i('uid'));
+ while($network = $res->next()) {
+ $value[] = $network;
+ }
+ }
+ if (!is_array($value)) {
+ $value = array();
+ }
+ $res = XDB::iterator("SELECT filter, network_type AS type
+ FROM profile_networking_enum;");
+ $filters = array();
+ while($filter = $res->next()) {
+ $filters[$filter['type']] = $filter['filter'];
+ }
+ $success = true;
+ foreach($value as $i=>&$network) {
+ if (!trim($network['address'])) {
+ unset($value[$i]);
+ } else {
+ if (!isset($network['pub'])) {
+ $network['pub'] = 'private';
+ }
+ $network['error'] = false;
+ $network['pub'] = $this->pub->value($page, 'pub', $network['pub'], $s);
+ $s = true;
+ if ($filters[$network['type']] == 'web') {
+ $network['address'] = $this->web->value($page, 'address', $network['address'], $s);
+ } elseif ($filters[$network['type']] == 'email') {
+ $network['address'] = $this->email->value($page, 'address', $network['address'], $s);
+ } elseif ($filters[$network['type']] == 'number') {
+ $network['address'] = $this->number->value($page, 'address', $network['address'], $s);
+ }
+ if (!$s) {
+ $success = false;
+ $network['error'] = true;
+ }
+ }
}
return $value;
}
- public function save(ProfilePage &$page, $field, $new_value)
+ public function save(ProfilePage &$page, $field, $value)
{
- $index = ($field == 'appli1' ? 0 : 1);
- if ($new_value['id'] > 0) {
- XDB::execute("REPLACE INTO applis_ins
- SET uid = {?}, aid = {?}, type = {?}, ordre = {?}",
- S::i('uid'), $new_value['id'], $new_value['type'], $index);
- } else {
- XDB::execute("DELETE FROM applis_ins
- WHERE uid = {?} AND ordre = {?}",
- S::i('uid'), $index);
+ XDB::execute("DELETE FROM profile_networking
+ WHERE uid = {?}",
+ S::i('uid'));
+ if (!count($value)) {
+ return;
+ }
+ $insert = array();
+ foreach ($value as $id=>$network) {
+ XDB::execute("INSERT INTO profile_networking (uid, nwid, network_type, address, pub)
+ VALUES ({?}, {?}, {?}, {?}, {?})",
+ S::i('uid'), $id, $network['type'], $network['address'], $network['pub']);
}
}
}
public function __construct(PlWizard &$wiz)
{
parent::__construct($wiz);
- $this->settings['nom'] = $this->settings['prenom']
- = new ProfileNom();
- $this->settings['naissance'] = new ProfileDate();
- $this->settings['mobile_pub']
- = $this->settings['web_pub']
- = $this->settings['freetext_pub']
+ $this->settings['search_names']
+ = new ProfileSearchNames();
+ $this->settings['naissance']
+ = new ProfileDate();
+ $this->settings['freetext_pub']
= $this->settings['photo_pub']
= new ProfilePub();
$this->settings['freetext']
= $this->settings['nationalite']
- = $this->settings['nick']
+ = $this->settings['nationalite2']
+ = $this->settings['nationalite3']
+ = $this->settings['yourself']
+ = $this->settings['promo']
= null;
- $this->settings['synchro_ax']
- = new ProfileBool();
- $this->settings['mobile'] = new ProfileTel();
- $this->settings['web'] = new ProfileWeb();
- $this->settings['appli1']
- = $this->settings['appli2']
- = new ProfileAppli();
- $this->watched= array('nom' => true, 'freetext' => true, 'mobile' => true, 'web' => true,
- 'appli1' => true, 'appli2' => true, 'nationalite' => true, 'nick' => true);
+ $this->settings['email_directory']
+ = new ProfileEmail();
+ $this->settings['email_directory_new']
+ = new ProfileEmailDirectory();
+ $this->settings['networking'] = new ProfileNetworking();
+ $this->settings['tels'] = new ProfilePhones('user', 0);
+ $this->settings['edus'] = new ProfileEdu();
+ $this->watched= array('freetext' => true, 'tels' => true,
+ 'networking' => true, 'edus' => true,
+ 'nationalite' => true, 'nationalite2' => true,
+ 'nationalite3' => true, 'search_names' => true);
}
protected function _fetchData()
{
// Checkout all data...
- $res = XDB::query("SELECT u.promo, u.promo_sortie, u.nom_usage, u.nationalite, u.naissance,
- q.profile_mobile as mobile, q.profile_mobile_pub as mobile_pub,
- q.profile_web as web, q.profile_web_pub as web_pub,
+ $res = XDB::query("SELECT p.promo, e.entry_year AS entry_year, e.grad_year AS grad_year,
+ u.nationalite, u.nationalite2, u.nationalite3, u.naissance,
+ t.display_tel as mobile, t.pub as mobile_pub,
+ d.email_directory as email_directory,
q.profile_freetext as freetext, q.profile_freetext_pub as freetext_pub,
- q.profile_nick as nick, q.profile_from_ax as synchro_ax, u.matricule_ax,
- IF(a1.aid IS NULL, -1, a1.aid) as appli_id1, a1.type as appli_type1,
- IF(a2.aid IS NULL, -1, a2.aid) as appli_id2, a2.type as appli_type2
- FROM auth_user_md5 AS u
- INNER JOIN auth_user_quick AS q USING(user_id)
- LEFT JOIN applis_ins AS a1 ON(a1.uid = u.user_id and a1.ordre = 0)
- LEFT JOIN applis_ins AS a2 ON(a2.uid = u.user_id and a2.ordre = 1)
+ u.matricule_ax, p.yourself
+ FROM auth_user_md5 AS u
+ INNER JOIN auth_user_quick AS q ON (u.user_id = q.user_id)
+ INNER JOIN profile_display AS p ON (p.pid = u.user_id)
+ INNER JOIN profile_education AS e ON (e.uid = u.user_id AND FIND_IN_SET('primary', e.flags))
+ LEFT JOIN profile_phones AS t ON (u.user_id = t.uid AND link_type = 'user')
+ LEFT JOIN profile_directory AS d ON (d.uid = u.user_id)
WHERE u.user_id = {?}", S::v('uid', -1));
$this->values = $res->fetchOneAssoc();
- // Reformat formation data
- $this->values['appli1'] = array('id' => $this->values['appli_id1'],
- 'type' => $this->values['appli_type1']);
- unset($this->values['appli_id1']);
- unset($this->values['appli_type1']);
- $this->values['appli2'] = array('id' => $this->values['appli_id2'],
- 'type' => $this->values['appli_type2']);
- unset($this->values['appli_id2']);
- unset($this->values['appli_type2']);
-
// Retreive photo informations
$res = XDB::query("SELECT pub
FROM photo
WHERE type='photo' AND user_id = {?}",
S::v('uid'));
$this->values['nouvellephoto'] = $res->fetchOneCell();
+
+ // Proposes choice for promotion
+ if ($this->values['entry_year'] != $this->values['grad_year'] - 3) {
+ for ($i = $this->values['entry_year']; $i < $this->values['grad_year'] - 2; $i++) {
+ $this->values['promo_choice'][] = "X" . $i;
+ }
+ }
}
protected function _saveData()
{
- if ($this->changed['nationalite'] || $this->changed['nom'] || $this->changed['prenom']
+ if ($this->changed['nationalite'] || $this->changed['nationalite2'] || $this->changed['nationalite3']
|| $this->changed['naissance']) {
- XDB::execute("UPDATE auth_user_md5
- SET nationalite = {?}, nom={?}, prenom={?}, naissance={?}
- WHERE user_id = {?}",
- $this->values['nationalite'], $this->values['nom'], $this->values['prenom'],
+ if ($this->values['nationalite3'] == "") {
+ $this->values['nationalite3'] = NULL;
+ }
+ if ($this->values['nationalite2'] == "") {
+ $this->values['nationalite2'] = $this->values['nationalite3'];
+ $this->values['nationalite3'] = NULL;
+ }
+ if ($this->values['nationalite'] == "") {
+ $this->values['nationalite'] = $this->values['nationalite2'];
+ $this->values['nationalite2'] = $this->values['nationalite3'];
+ $this->values['nationalite3'] = NULL;
+ }
+
+ XDB::execute("UPDATE auth_user_md5
+ SET nationalite = {?}, nationalite2 = {?}, nationalite3 = {?}, naissance={?}
+ WHERE user_id = {?}",
+ $this->values['nationalite'], $this->values['nationalite2'], $this->values['nationalite3'],
preg_replace('@(\d{2})/(\d{2})/(\d{4})@', '\3-\2-\1', $this->values['naissance']),
S::v('uid'));
}
- if ($this->changed['nick'] || $this->changed['mobile'] || $this->changed['mobile_pub']
- || $this->changed['web'] || $this->changed['web_pub'] || $this->changed['freetext']
- || $this->changed['freetext_pub'] || $this->changed['synchro_ax']) {
+ if ($this->changed['freetext'] || $this->changed['freetext_pub']) {
XDB::execute("UPDATE auth_user_quick
- SET profile_nick= {?}, profile_mobile={?}, profile_mobile_pub={?},
- profile_web={?}, profile_web_pub={?}, profile_freetext={?},
- profile_freetext_pub={?}, profile_from_ax = {?}
- WHERE user_id = {?}",
- $this->values['nick'], $this->values['mobile'], $this->values['mobile_pub'],
- $this->values['web'], $this->values['web_pub'],
- $this->values['freetext'], $this->values['freetext_pub'],
- $this->values['synchro_ax'], S::v('uid'));
- }
- if ($this->changed['nick']) {
- require_once('user.func.inc.php');
- user_reindex(S::v('uid'));
+ SET profile_freetext={?}, profile_freetext_pub={?}
+ WHERE user_id = {?}",
+ $this->values['freetext'], $this->values['freetext_pub'], S::v('uid'));
+ }
+ if ($this->changed['email_directory']) {
+ $new_email = ($this->values['email_directory'] == "new@example.org") ?
+ $this->values['email_directory_new'] : $this->values['email_directory'];
+ if ($new_email == "") {
+ $new_email = NULL;
+ }
+ XDB::execute("REPLACE INTO profile_directory (uid, email_directory)
+ VALUES ({?}, {?})",
+ S::v('uid'), $new_email);
}
if ($this->changed['photo_pub']) {
XDB::execute("UPDATE photo
WHERE uid = {?}",
$this->values['photo_pub'], S::v('uid'));
}
+ if ($this->changed['yourself']) {
+ XDB::execute("UPDATE profile_display
+ SET yourself = {?}
+ WHERE pid = {?}",
+ $this->values['yourself'], S::v('uid'));
+ }
+ if ($this->changed['promo']) {
+ XDB::execute("UPDATE profile_display
+ SET promo = {?}
+ WHERE pid = {?}",
+ $this->values['promo'], S::v('uid'));
+ }
}
public function _prepare(PlPage &$page, $id)
{
- require_once "applis.func.inc.php";
+ require_once "education.func.inc.php";
+
+ $res = XDB::iterator("SELECT id, field
+ FROM profile_education_field_enum
+ ORDER BY field");
+ $page->assign('edu_fields', $res->fetchAllAssoc());
+
+ require_once "emails.combobox.inc.php";
+ fill_email_combobox($page);
+
+ $res = XDB::iterator("SELECT nw.network_type AS type, nw.name
+ FROM profile_networking_enum AS nw
+ ORDER BY name");
+ $page->assign('network_list', $res->fetchAllAssoc());
+
+ $res = XDB::query("SELECT public_name, private_name
+ FROM profile_display
+ WHERE pid = {?}",
+ S::v('uid'));
+ $res = $res->fetchOneRow();
+ $page->assign('public_name', $res[0]);
+ $page->assign('private_name', $res[1]);
}
}
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-class ProfileJob extends ProfileGeoloc
+class ProfileJob extends ProfileGeocoding
{
private $pub;
- private $mail;
- private $web;
- private $tel;
+ private $email_new;
+ private $email;
+ private $url;
private $bool;
private $checks;
public function __construct()
{
- $this->pub = new ProfilePub();
- $this->mail = new ProfileEmail();
- $this->web = new ProfileWeb();
- $this->tel = new ProfileTel();
- $this->bool = new ProfileBool();
- $this->checks = array('web' => array('web'),
- 'mail' => array('email'),
- 'tel' => array('tel', 'fax', 'mobile'),
- 'pub' => array('pub', 'tel_pub', 'email_pub'));
+ $this->pub = new ProfilePub();
+ $this->email
+ = $this->email_new
+ = new ProfileEmail();
+ $this->url = new ProfileWeb();
+ $this->bool = new ProfileBool();
+ $this->checks = array('url' => array('w_url'),
+ 'email' => array('w_email'),
+ 'pub' => array('pub', 'w_email_pub'),
+ );
}
- private function cleanJob(ProfilePage &$page, array &$job, &$success)
+ public function emptyJob()
+ {
+ return array(
+ 'id' => '0',
+ 'jobid' => '',
+ 'pub' => 'private',
+ 'name' => '',
+ 'hq_acronym' => '',
+ 'hq_url' => '',
+ 'hq_email' => '',
+ 'hq_address' => array(
+ 'text' => '',
+ 'accuracy' => '',
+ 'postalText' => '',
+ 'postalCode' => '',
+ 'administrativeAreaId' => '',
+ 'subAdministrativeAreaId' => '',
+ 'localityId' => '',
+ 'countryId' => '',
+ 'latitude' => '',
+ 'longitude' => '',
+ 'north' => '',
+ 'south' => '',
+ 'east' => '',
+ 'west' => '',
+ 'cedex' => '',
+ 'updateTime' => '',
+ 'changed' => '0',
+ 'removed' => '0',
+ ),
+ 'hq_phone' => '',
+ 'hq_fax' => '',
+ 'subSubSectorName' => null,
+ 'sector' => '0',
+ 'subSector' => '0',
+ 'subSubSector' => '0',
+ 'description' => '',
+ 'w_url' => '',
+ 'w_address' => array(
+ 'pub' => 'private',
+ 'text' => '',
+ 'accuracy' => '',
+ 'postalText' => '',
+ 'postalCode' => '',
+ 'administrativeAreaId' => '',
+ 'subAdministrativeAreaId' => '',
+ 'localityId' => '',
+ 'countryId' => '',
+ 'latitude' => '',
+ 'longitude' => '',
+ 'north' => '',
+ 'south' => '',
+ 'east' => '',
+ 'west' => '',
+ 'cedex' => '',
+ 'updateTime' => '',
+ 'changed' => '0',
+ 'removed' => '0',
+ ),
+ 'w_email' => '',
+ 'w_email_pub' => 'private',
+ 'w_email_new' => '',
+ 'w_phone' => array(0 => array(
+ 'type' => 'fixed',
+ 'tel' => '',
+ 'pub' => 'private',
+ 'comment' => '',
+ )),
+ );
+ }
+
+ private function cleanJob(ProfilePage &$page, $jobid, array &$job, &$success)
{
$success = true;
+ if ($job['w_email'] == "new@example.org") {
+ $job['w_email'] = $job['w_email_new'];
+ }
foreach ($this->checks as $obj=>&$fields) {
$chk =& $this->$obj;
foreach ($fields as $field) {
}
}
}
- $job['adr']['pub'] = $this->pub->value($page, 'adr_pub', @$job['adr']['pub'], $s);
- $job['adr']['checked'] = $this->bool->value($page, 'adr_checked', @$job['adr']['checked'], $s);
+ if (!$job['subSubSectorName']) {
+ $res = XDB::query("SELECT name
+ FROM profile_job_subsubsector_enum
+ WHERE id = {?}",
+ $job['subSubSector']);
+ $job['subSubSectorName'] = $res->fetchOneCell();
+ } else {
+ $res = XDB::query("SELECT sectorid, subsectorid, id
+ FROM profile_job_subsubsector_enum
+ WHERE name = {?}",
+ $job['subSubSectorName']);
+ if ($res->numRows() != 1) {
+ $success = false;
+ $job['sector_error'] = true;
+ } else {
+ list($job['sector'], $job['subSector'], $job['subSubSector']) = $res->fetchOneRow();
+ }
+ }
+ if ($job['name']) {
+ $res = XDB::query("SELECT id
+ FROM profile_job_enum
+ WHERE name = {?}",
+ $job['name']);
+ if ($res->numRows() != 1) {
+ $user = S::user();
+ $this->geocodeAddress($job['hq_address'], $s);
+ if (!$s) {
+ $gmapsGeocoder = new GMapsGeocoder();
+ $job['hq_address'] = $gmapsGeocoder->stripGeocodingFromAddress($job['hq_address']);
+ }
+ $req = new EntrReq($user, $jobid, $job['name'], $job['hq_acronym'], $job['hq_url'],
+ $job['hq_email'], $job['hq_fixed'], $job['hq_fax'], $job['hq_address']);
+ $req->submit();
+ $job['jobid'] = null;
+ } else {
+ $job['jobid'] = $res->fetchOneCell();
+ }
+ }
+ $job['w_address']['pub'] = $this->pub->value($page, 'address_pub', $job['w_address']['pub'], $s);
+ if (!isset($job['w_phone'])) {
+ $job['w_phone'] = array();
+ }
+ $profiletel = new ProfilePhones('pro', $jobid);
+ $job['w_phone'] = $profiletel->value($page, 'tel', $job['w_phone'], $s);
+
unset($job['removed']);
unset($job['new']);
- unset($job['adr']['changed']);
- unset($job['adr']['parsevalid']);
- unset($job['adr']['display']);
}
public function value(ProfilePage &$page, $field, $value, &$success)
{
+ require_once('validations.inc.php');
+ $entreprise = Validate::get_typed_requests(S::i('uid'), 'entreprise');
+ $entr_val = 0;
+
$init = false;
if (is_null($value)) {
$value = $page->values['jobs'];
}
$success = true;
foreach ($value as $key=>&$job) {
- if (@$job['removed'] || !trim($job['name'])) {
+ $job['name'] = trim($job['name']);
+ if (!$job['name'] && $entreprise) {
+ $job['tmp_name'] = $entreprise[$entr_val]->name;
+ $entr_val ++;
+ }
+ if (isset($job['removed']) && $job['removed']) {
unset($value[$key]);
}
}
foreach ($value as $key=>&$job) {
$ls = true;
- $this->geolocAddress($job['adr'], $s);
+ $this->geocodeAddress($job['w_address'], $s);
$ls = ($ls && $s);
- $this->cleanJob($page, $job, $s);
+ $this->cleanJob($page, $key, $job, $s);
$ls = ($ls && $s);
if (!$init) {
$success = ($success && $ls);
public function save(ProfilePage &$page, $field, $value)
{
- XDB::execute("DELETE FROM entreprises
+ // TODO: use address and phone classes to update profile_job_enum and profile_phones once they are done.
+
+ require_once('profil.func.inc.php');
+ require_once('validations.inc.php');
+
+ XDB::execute("DELETE FROM profile_job
WHERE uid = {?}",
S::i('uid'));
- $i = 0;
- foreach ($value as &$job) {
- XDB::execute("INSERT INTO entreprises (uid, entrid, entreprise, secteur, ss_secteur,
- fonction, poste, adr1, adr2, adr3, postcode,
- city, cityid, country, region, regiontxt,
- tel, fax, mobile, email, web,
- pub, adr_pub, tel_pub, email_pub, flags,
- glat, glng)
- VALUES ({?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?},
- {?}, {?}, {?}, {?}, {?},
- {?}, {?})",
- S::i('uid'), $i++, $job['name'], $job['secteur'], $job['ss_secteur'],
- $job['fonction'], $job['poste'], $job['adr']['adr1'], $job['adr']['adr2'], $job['adr']['adr3'],
- $job['adr']['postcode'],
- $job['adr']['city'], $job['adr']['cityid'], $job['adr']['country'], $job['adr']['region'],
- $job['adr']['regiontxt'],
- $job['tel'], $job['fax'], $job['mobile'], $job['email'], $job['web'],
- $job['pub'], $job['adr']['pub'], $job['tel_pub'], $job['email_pub'],
- $job['adr']['checked'] ? 'geoloc' : '', $job['adr']['precise_lat'],
- $job['adr']['precise_lon']);
+ XDB::execute("DELETE FROM profile_addresses
+ WHERE pid = {?} AND type = 'job'",
+ S::i('uid'));
+ XDB::execute("DELETE FROM profile_phones
+ WHERE uid = {?} AND link_type = 'pro'",
+ S::i('uid'));
+ foreach ($value as $id=>&$job) {
+ if (isset($job['name']) && $job['name']) {
+ if (isset($job['jobid']) && $job['jobid']) {
+ XDB::execute("INSERT INTO profile_job (uid, id, description, sectorid, subsectorid,
+ subsubsectorid, email, url, pub, email_pub, jobid)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
+ S::i('uid'), $id, $job['description'], $job['sector'], $job['subSector'],
+ $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub'], $job['jobid']);
+ } else {
+ XDB::execute("INSERT INTO profile_job (uid, id, description, sectorid, subsectorid,
+ subsubsectorid, email, url, pub, email_pub)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?})",
+ S::i('uid'), $id, $job['description'], $job['sector'], $job['subSector'],
+ $job['subSubSector'], $job['w_email'], $job['w_url'], $job['pub'], $job['w_email_pub']);
+ }
+ $address = new ProfileAddress();
+ $address->saveAddress($id, $job['w_address'], 'job');
+ $profiletel = new ProfilePhones('pro', $id);
+ $profiletel->saveTels('tel', $job['w_phone']);
+ }
}
}
}
{
parent::__construct($wiz);
$this->settings['cv'] = null;
+ $this->settings['corps'] = null;
$this->settings['jobs'] = new ProfileJob();
- $this->watched['cv'] = $this->watched['jobs'] = true;
+ $this->watched = array('cv' => true, 'jobs' => true, 'corps' => true);
}
protected function _fetchData()
S::i('uid'));
$this->values['cv'] = $res->fetchOneCell();
+ // Checkout the corps
+ $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
+ rankid AS rank, corps_pub AS pub
+ FROM profile_corps
+ WHERE uid = {?}",
+ S::i('uid'));
+ $this->values['corps'] = $res->fetchOneAssoc();
+
// Build the jobs tree
- $res = XDB::iterRow("SELECT e.entreprise, e.secteur, e.ss_secteur,
- e.fonction, e.poste, e.adr1, e.adr2, e.adr3,
- e.postcode, e.city, e.cityid, e.region, e.regiontxt,
- e.country, gp.pays, gp.display,
- FIND_IN_SET('geoloc', flags),
- e.tel, e.fax, e.mobile, e.email, e.web, e.pub,
- e.adr_pub, e.tel_pub, e.email_pub,
- e.glat AS precise_lat, e.glng AS precise_lon
- FROM entreprises AS e
- LEFT JOIN geoloc_pays AS gp ON(gp.a2 = e.country)
- WHERE uid = {?} AND entreprise != ''
- ORDER BY entrid", S::i('uid'));
+ $res = XDB::iterRow("SELECT j.id, j.jobid, je.name, j.sectorid, j.subsectorid, j.subsubsectorid,
+ s.name, j.description, j.email, j.email_pub, j.url, j.pub,
+ je.acronym, je.url, je.email,
+ aw.accuracy, aw.text, aw.postalText, aw.postalCode, aw.localityId,
+ aw.subAdministrativeAreaId, aw.administrativeAreaId, aw.countryId,
+ aw.latitude, aw.longitude, aw.pub, aw.updateTime,
+ aw.north, aw.south, aw.east, aw.west,
+ ah.accuracy, ah.text, ah.postalText, ah.postalCode, ah.localityId,
+ ah.subAdministrativeAreaId, ah.administrativeAreaId, ah.countryId,
+ ah.latitude, ah.longitude, ah.pub, ah.updateTime,
+ ah.north, ah.south, ah.east, ah.west
+ FROM profile_job AS j
+ LEFT JOIN profile_job_enum AS je ON (j.jobid = je.id)
+ LEFT JOIN profile_job_subsubsector_enum AS s ON (s.id = j.subsubsectorid)
+ LEFT JOIN profile_addresses AS aw ON (aw.pid = j.uid AND aw.type = 'job'
+ AND aw.id = j.id)
+ LEFT JOIN profile_addresses AS ah ON (ah.jobid = j.jobid AND ah.type = 'hq')
+ WHERE j.uid = {?}
+ ORDER BY j.id",
+ S::i('uid'));
$this->values['jobs'] = array();
- 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, $glat, $glng) = $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,
- 'precise_lat'=> $glat,
- 'precise_lon'=> $glng),
- 'tel' => $tel,
- 'fax' => $fax,
- 'mobile' => $mobile,
- 'email' => $email,
- 'web' => $web,
- 'pub' => $pub,
- 'tel_pub' => $tel_pub,
- 'email_pub' => $email_pub);
+
+ if ($res->numRows() > 0) {
+ while (list($id, $jobid, $name, $sector, $subSector, $subSubSector,
+ $subSubSectorName, $description, $w_email, $w_emailPub, $w_url, $pub,
+ $hq_acronym, $hq_url, $hq_email,
+ $w_accuracy, $w_text, $w_postalText, $w_postalCode, $w_localityId,
+ $w_subAdministrativeAreaId, $w_administrativeAreaId, $w_countryId,
+ $w_latitude, $w_longitude, $w_pub, $w_updateTime,
+ $w_north, $w_south, $w_east, $w_west,
+ $hq_accuracy, $hq_text, $hq_postalText, $hq_postalCode, $hq_localityId,
+ $hq_subAdministrativeAreaId, $hq_administrativeAreaId, $hq_countryId,
+ $hq_latitude, $hq_longitude, $hq_pub, $hq_updateTime,
+ $hq_north, $hq_south, $hq_east, $hq_west,
+ ) = $res->next()) {
+ $this->values['jobs'][] = array(
+ 'id' => $id,
+ 'jobid' => $jobid,
+ 'name' => $name,
+ 'sector' => $sector,
+ 'subSector' => $subSector,
+ 'subSubSector' => $subSubSector,
+ 'subSubSectorName' => $subSubSectorName,
+ 'description' => $description,
+ 'pub' => $pub,
+ 'w_email' => $w_email,
+ 'w_email_pub' => $w_emailPub,
+ 'w_url' => $w_url,
+ 'hq_acronym' => $hq_acronym,
+ 'hq_url' => $hq_url,
+ 'hq_email' => $hq_email,
+ 'w_address' => array(
+ 'accuracy' => $w_accuracy,
+ 'text' => $w_text,
+ 'postalText' => $w_postalText,
+ 'postalCode' => $w_postalCode,
+ 'localityId' => $w_localityId,
+ 'subAdministrativeAreaId' => $w_subAdministrativeAreaId,
+ 'administrativeAreaId' => $w_administrativeAreaId,
+ 'countryId' => $w_countryId,
+ 'latitude' => $w_latitude,
+ 'longitude' => $w_longitude,
+ 'pub' => $w_pub,
+ 'updateTime' => $w_updateTime,
+ 'north' => $w_north,
+ 'south' => $w_south,
+ 'east' => $w_east,
+ 'west' => $w_west,
+ ),
+ 'hq_address' => array(
+ 'accuracy' => $hq_accuracy,
+ 'text' => $hq_text,
+ 'postalText' => $hq_postalText,
+ 'postalCode' => $hq_postalCode,
+ 'localityId' => $hq_localityId,
+ 'subAdministrativeAreaId' => $hq_subAdministrativeAreaId,
+ 'administrativeAreaId' => $hq_administrativeAreaId,
+ 'countryId' => $hq_countryId,
+ 'latitude' => $hq_latitude,
+ 'longitude' => $hq_longitude,
+ 'pub' => $hq_pub,
+ 'updateTime' => $hq_updateTime,
+ 'north' => $hq_north,
+ 'south' => $hq_south,
+ 'east' => $hq_east,
+ 'west' => $hq_west,
+ ),
+ );
+ }
+
+ $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",
+ S::i('uid'));
+ $i = 0;
+ $jobNb = count($this->values['jobs']);
+ while ($phone = $res->next()) {
+ $jobid = $phone['jobid'];
+ while ($i < $jobNb && $this->values['jobs'][$i]['id'] < $jobid) {
+ $i++;
+ }
+ if ($i >= $jobNb) {
+ break;
+ }
+ $job =& $this->values['jobs'][$i];
+ if (!isset($job['w_phone'])) {
+ $job['w_phone'] = array();
+ }
+ if ($job['id'] == $jobid) {
+ $job['w_phone'][] = $phone;
+ }
+ }
+ foreach ($this->values['jobs'] as $id => &$job) {
+ if (!isset($job['w_phone'])) {
+ $job['w_phone'] = array(
+ 0 => array(
+ 'type' => 'fixed',
+ 'tel' => '',
+ 'pub' => 'private',
+ 'comment' => '',
+ )
+ );
+ }
+ }
+
+ $job['w_email_new'] = '';
+ if (!isset($job['hq_phone'])) {
+ $job['hq_phone'] = '';
+ }
+ if (!isset($job['hq_fax'])) {
+ $job['hq_fax'] = '';
+ }
+ if (!isset($job['w_email_pub'])) {
+ $job['w_email_pub'] = 'private';
+ }
+ if (!$job['hq_address']['text']) {
+ $job['hq_address'] = array(
+ 'text' => '',
+ 'accuracy' => '',
+ 'postalText' => '',
+ 'postalCode' => '',
+ 'administrativeAreaId' => '',
+ 'subAdministrativeAreaId' => '',
+ 'localityId' => '',
+ 'countryId' => '',
+ 'latitude' => '',
+ 'longitude' => '',
+ 'north' => '',
+ 'south' => '',
+ 'east' => '',
+ 'west' => '',
+ 'cedex' => '',
+ 'updateTime' => '',
+ 'changed' => '0',
+ 'removed' => '0',
+ );
+ }
+ $job['w_address']['cedex'] = '';
+ $job['w_address']['changed'] = '0';
+ $job['w_address']['removed'] = '0';
+ } else {
+ $this->values['jobs'][] = $this->settings['jobs']->emptyJob();
}
}
WHERE user_id = {?}",
$this->values['cv'], S::i('uid'));
}
+
+ if ($this->changed['corps']) {
+ XDB::execute("UPDATE profile_corps
+ SET original_corpsid = {?}, current_corpsid = {?},
+ rankid = {?}, corps_pub = {?}
+ WHERE uid = {?}",
+ $this->values['corps']['original'], $this->values['corps']['current'],
+ $this->values['corps']['rank'], $this->values['corps']['pub'], S::i('uid'));
+ }
}
public function _prepare(PlPage &$page, $id)
{
- $res = XDB::query("SELECT id, label
- FROM emploi_secteur");
- $page->assign('secteurs', $res->fetchAllAssoc());
- $res = XDB::query("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title
- FROM fonctions_def
- ORDER BY id");
- $page->assign('fonctions', $res->fetchAllAssoc());
+ require_once "emails.combobox.inc.php";
+ fill_email_combobox($page);
+
+ $res = XDB::query("SELECT id, name AS label
+ FROM profile_job_sector_enum");
+ $page->assign('sectors', $res->fetchAllAssoc());
+
+ $res = XDB::iterator("SELECT id, name
+ FROM profile_corps_enum
+ ORDER BY id = 1 DESC, name");
+ $page->assign('original_corps', $res->fetchAllAssoc());
+
+ $res = XDB::iterator("SELECT id, name
+ FROM profile_corps_enum
+ WHERE still_exists = 1
+ ORDER BY id = 1 DESC, name");
+ $page->assign('current_corps', $res->fetchAllAssoc());
+
+ $res = XDB::iterator("SELECT id, name
+ FROM profile_corps_rank_enum");
+ $page->assign('corps_rank', $res->fetchAllAssoc());
}
}
* 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.secteur, m.ss_secteur, ss.label
- FROM mentor_secteurs AS m
- INNER JOIN emploi_secteur AS s ON(m.secteur = s.id)
- INNER JOIN emploi_ss_secteur AS ss ON(s.id = ss.secteur AND m.ss_secteur = ss.id)
+ $res = XDB::iterRow("SELECT m.sectorid, m.subsectorid, ss.name
+ FROM profile_mentor_sector AS m
+ INNER JOIN profile_job_sector_enum AS s ON (m.sectorid = s.id)
+ INNER JOIN profile_job_subsector_enum AS ss ON (s.id = ss.sectorid AND m.subsectorid = ss.id)
WHERE m.uid = {?}",
S::i('uid'));
while (list($s, $ss, $ssname) = $res->next()) {
$value[$s][$ss] = $ssname;
}
}
- } else if (!is_array($value)) {
+ } elseif (!is_array($value)) {
$value = array();
- } else if (count($value) > 10) {
- Platal::page()->trigError("Le nombre de secteurs d'expertise est limité à 10");
+ } elseif (count($value) > 10) {
+ Platal::page()->trigError("Le nombre de secteurs d'expertise est limité à 10.");
$success = false;
}
ksort($value);
public function save(ProfilePage &$page, $field, $value)
{
- XDB::execute("DELETE FROM mentor_secteurs
+ XDB::execute("DELETE FROM profile_mentor_sector
WHERE uid = {?}",
S::i('uid'));
if (!count($value)) {
return;
}
- foreach ($value as $id=>&$sect) {
- foreach ($sect as $sid=>&$name) {
- XDB::execute("INSERT INTO mentor_secteurs (uid, secteur, ss_secteur)
+ foreach ($value as $id => $sect) {
+ foreach ($sect as $sid => $name) {
+ XDB::execute("INSERT INTO profile_mentor_sector (uid, sectorid, subsectorid)
VALUES ({?}, {?}, {?})",
S::i('uid'), $id, $sid);
}
$success = true;
if (is_null($value)) {
$value = array();
- $res = XDB::iterRow("SELECT m.pid, p.pays
- FROM mentor_pays AS m
- INNER JOIN geoloc_pays AS p ON(m.pid = p.a2)
+ $res = XDB::iterRow("SELECT m.country, gc.countryFR
+ FROM profile_mentor_country AS m
+ 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()) {
public function save(ProfilePage &$page, $field, $value)
{
- XDB::execute("DELETE FROM mentor_pays
+ XDB::execute("DELETE FROM profile_mentor_country
WHERE uid = {?}",
S::i('uid'));
foreach ($value as $id=>&$name) {
- XDB::execute("INSERT INTO mentor_pays (uid, pid)
+ XDB::execute("INSERT INTO profile_mentor_country (uid, country)
VALUES ({?}, {?})",
S::i('uid'), $id);
}
{
parent::__construct($wiz);
$this->settings['expertise'] = null;
- $this->settings['secteurs'] = new ProfileSecteurs();
+ $this->settings['sectors'] = new ProfileSectors();
$this->settings['countries'] = new ProfileCountry();
}
protected function _fetchData()
{
$res = XDB::query("SELECT expertise
- FROM mentor
+ FROM profile_mentor
WHERE uid = {?}",
S::i('uid'));
$this->values['expertise'] = $res->fetchOneCell();
if ($this->changed['expertise']) {
$expertise = trim($this->values['expertise']);
if (empty($expertise)) {
- XDB::execute("DELETE FROM mentor
+ XDB::execute("DELETE FROM profile_mentor
WHERE uid = {?}",
S::i('uid'));
$this->values['expertise'] = null;
} else {
- XDB::execute("REPLACE INTO mentor (uid, expertise)
+ XDB::execute("REPLACE INTO profile_mentor (uid, expertise)
VALUES ({?}, {?})",
S::i('uid'), $expertise);
$this->values['expertise'] = $expertise;
public function _prepare(PlPage &$page, $id)
{
- $page->assign('secteurs_sel', XDB::iterator("SELECT id, label
- FROM emploi_secteur"));
+ $page->assign('sectorList', 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"));
}
}
}
}
+class ProfileNumber extends ProfileNoSave
+{
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ if (is_null($value)) {
+ return isset($page->values[$field]) ? $page->values[$field] : S::v($field);
+ }
+ $value = trim($value);
+ $success = empty($value) || is_numeric($value);
+ if (!$success) {
+ Platal::page()->trigError('Numéro invalide');
+ }
+ return $value;
+ }
+}
+
class ProfileTel extends ProfileNoSave
{
if (is_null($value)) {
return isset($page->values[$field]) ? $page->values[$field] : S::v($field);
}
- $success = !preg_match('/[<>{}@&#~\/:;?,!§*_`\[\]|%$^=]/', $value, $matches);
+ require_once('profil.func.inc.php');
+ $value = format_phone_number($value);
+ if($value == '') {
+ $success = true;
+ return $value;
+ }
+ $value = format_display_number($value,$error);
+ $success = !$error;
if (!$success) {
- Platal::page()->trigError('Le numéro de téléphone contient un caractère interdit : ' . pl_entities($matches[0][0]));
+ Platal::page()->trigError('Le préfixe international du numéro de téléphone est inconnu. ');
}
return $value;
}
}
+class ProfilePhones implements ProfileSetting
+{
+ private $tel;
+ private $pub;
+ protected $id;
+ protected $link_type;
+ protected $link_id;
+
+ public function __construct($type, $link_id, $id = 0)
+ {
+ if ($id != 0) {
+ $this->id = $id;
+ } else {
+ $this->id = S::i('uid');
+ }
+ $this->tel = new ProfileTel();
+ $this->pub = new ProfilePub();
+ $this->link_type = $type;
+ $this->link_id = $link_id;
+ }
+
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ $success = true;
+ if (is_null($value)) {
+ $value = array();
+ $res = XDB::iterator("SELECT t.display_tel AS tel, t.tel_type AS type, t.pub, t.comment
+ FROM profile_phones AS t
+ WHERE t.uid = {?} AND t.link_type = {?}
+ ORDER BY t.tel_id",
+ $this->id, $this->link_type);
+ if ($res->numRows() > 0) {
+ $value = $res->fetchAllAssoc();
+ } else {
+ $value = array(
+ 0 => array(
+ 'type' => 'fixed',
+ 'tel' => '',
+ 'pub' => 'private',
+ 'comment' => '',
+ )
+ );
+ }
+ }
+ foreach ($value as $key=>&$phone) {
+ if (isset($phone['removed']) && $phone['removed']) {
+ unset($value[$key]);
+ } else {
+ unset($phone['removed']);
+ $phone['pub'] = $this->pub->value($page, 'pub', $phone['pub'], $s);
+ $phone['tel'] = $this->tel->value($page, 'tel', $phone['tel'], $s);
+ if(!isset($phone['type']) || ($phone['type'] != 'fixed' && $phone['type'] != 'mobile' && $phone['type'] != 'fax')) {
+ $phone['type'] = 'fixed';
+ $s = false;
+ }
+ if (!$s) {
+ $phone['error'] = true;
+ $success = false;
+ }
+ if (!isset($phone['comment'])) {
+ $phone['comment'] = '';
+ }
+ }
+ }
+ return $value;
+ }
+
+ private function saveTel($telid, array &$phone)
+ {
+ if ($phone['tel'] != '') {
+ XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type,
+ search_tel, display_tel, pub, comment)
+ VALUES ({?}, {?}, {?}, {?}, {?},
+ {?}, {?}, {?}, {?})",
+ $this->id, $this->link_type, $this->link_id, $telid, $phone['type'],
+ format_phone_number($phone['tel']), $phone['tel'], $phone['pub'], $phone['comment']);
+ }
+ }
+
+ public function save(ProfilePage &$page, $field, $value)
+ {
+ XDB::execute("DELETE FROM profile_phones
+ WHERE uid = {?} AND link_type = {?} AND link_id = {?}",
+ $this->id, $this->link_type, $this->link_id);
+ $this->saveTels($field, $value);
+ }
+
+ //Only saves phones without a delete operation
+ public function saveTels($field, $value)
+ {
+ foreach ($value as $telid=>&$phone) {
+ $this->saveTel($telid, $phone);
+ }
+ }
+}
+
class ProfilePub extends ProfileNoSave
{
public function value(ProfilePage &$page, $field, $value, &$success)
if (is_null($value)) {
return isset($page->values[$field]) ? $page->values[$field] : S::v($field);
}
- if (is_null($value) || !$value) {
+ if (!$value) {
$value = 'private';
- } else if ($value == 'on') { // Checkbox
+ } elseif ($value == 'on') { // Checkbox
$value = 'public';
}
return $value;
{
$success = true;
if (is_null($value)) {
- $value = @$page->values[$field];
+ $value = isset($page->values[$field]) ? $page->values[$field] : null;
}
return $value ? "1" : "";
}
}
}
-abstract class ProfileGeoloc implements ProfileSetting
+abstract class ProfileGeocoding implements ProfileSetting
{
- protected function geolocAddress(array &$address, &$success)
+ protected function geocodeAddress(array &$address, &$success)
{
- require_once 'geoloc.inc.php';
+ require_once 'geocoding.inc.php';
$success = true;
- unset($address['geoloc']);
- unset($address['geoloc_cityid']);
- if (@$address['parsevalid']
- || (@$address['text'] && @$address['changed'])
- || (@$address['text'] && !@$address['cityid'])) {
- $address = array_merge($address, empty_address());
- $new = get_address_infos(@$address['text']);
- if (compare_addresses_text(@$address['text'], $geotxt = get_address_text($new))
- || (@$address['parsevalid'] && @$address['cityid'])) {
- $address = array_merge($address, $new);
- $address['checked'] = true;
- } else if (@$address['parsevalid']) {
- $address = array_merge($address, cut_address(@$address['text']));
- $address['checked'] = true;
- $mailer = new PlMailer('geoloc/geoloc.mail.tpl');
- $mailer->assign('text', get_address_text($address));
- $mailer->assign('geoloc', $geotxt);
- $mailer->send();
- } else if (@$address['changed'] || !@$address['checked']) {
+ if (isset($address['changed']) && $address['changed'] == 1) {
+ $gmapsGeocoder = new GMapsGeocoder();
+ $address = $gmapsGeocoder->getGeocodedAddress($address);
+ if (isset($address['geoloc'])) {
$success = false;
- $address = array_merge($address, cut_address(@$address['text']));
- $address['checked'] = false;
- $address['geoloc'] = $geotxt;
- $address['geoloc_cityid'] = $new['cityid'];
- } else {
- $address = array_merge($address, cut_address(@$address['text']));
- $address['checked'] = true;
}
}
- $address['precise_lat'] = rtrim($address['precise_lat'], '.0');
- $address['precise_lon'] = rtrim($address['precise_lon'], '.0');
- $address['text'] = get_address_text($address);
+ if (isset($address['geoloc_choice']) && ($address['geoloc_choice'] == 0)) {
+ $mailer = new PlMailer('geoloc/geoloc.mail.tpl');
+ $mailer->assign('text', $address['text']);
+ $mailer->assign('geoloc', $address['geoloc']);
+ $mailer->send();
+ $gmapsGeocoder = new GMapsGeocoder();
+ $address = $gmapsGeocoder->stripGeocodingFromAddress($address);
+ }
}
}
$res = XDB::iterRow(
"SELECT sa.alias, IF(s.nom_usage,s.nom_usage,s.nom) AS nom,
s.prenom, FIND_IN_SET('femme', s.flags) AS femme,
- GROUP_CONCAT(m.email) AS mails, MAX(m.last) AS dateDernier
+ GROUP_CONCAT(m.email SEPARATOR ', ') AS mails, MAX(m.last) AS dateDernier
FROM register_marketing AS m
INNER JOIN auth_user_md5 AS s ON ( m.sender = s.user_id )
INNER JOIN aliases AS sa ON ( sa.id = m.sender
function handlers()
{
return array(
- 'search' => $this->make_hook('quick', AUTH_PUBLIC),
- 'search/adv' => $this->make_hook('advanced', AUTH_COOKIE),
+ 'search' => $this->make_hook('quick', AUTH_PUBLIC),
+ 'search/adv' => $this->make_hook('advanced', AUTH_COOKIE),
'advanced_search.php' => $this->make_hook('redir_advanced', AUTH_PUBLIC),
- 'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'user', NO_AUTH),
- 'search/list' => $this->make_hook('list', AUTH_COOKIE, 'user', NO_AUTH),
+ 'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'user', NO_AUTH),
+ 'search/list' => $this->make_hook('list', AUTH_COOKIE, 'user', NO_AUTH),
);
}
$school = Env::i('school');
}
- if (!is_null($school)) {
- $sql = 'SELECT type FROM applis_def WHERE id=' . $school;
+ if ((!is_null($school)) && ($school != '')) {
+ $sql = 'SELECT degreeid
+ FROM profile_education_degree
+ WHERE eduid=' . $school;
} else {
- $sql = 'DESCRIBE applis_def type';
+ $sql = 'SELECT id
+ FROM profile_education_degree_enum
+ ORDER BY id';
}
$res = XDB::query($sql);
- $row = $res->fetchOneRow();
- if (!is_null($school)) {
- $types = $row[0];
- } else {
- $types = explode('(',$row[1]);
- $types = str_replace("'","",substr($types[1],0,-1));
- }
- Platal::page()->assign('choix_diplomas', explode(',',$types));
+ Platal::page()->assign('choix_diplomas', $res->fetchColumn());
+
+ $sql = 'SELECT degree
+ FROM profile_education_degree_enum
+ ORDER BY id';
+ $res = XDB::query($sql);
+ Platal::page()->assign('name_diplomas', $res->fetchColumn());
}
function handler_quick(&$page, $action = null, $subaction = null)
$this->form_prepare();
} else {
$textFields = array(
- 'country' => array('field' => 'a2', 'table' => 'geoloc_pays', 'text' => 'pays', 'exact' => false),
- 'fonction' => array('field' => 'id', 'table' => 'fonctions_def', 'text' => 'fonction_fr', 'exact' => true),
- 'secteur' => array('field' => 'id', 'table' => 'emploi_secteur', 'text' => 'label', 'exact' => false),
- 'nationalite' => array('field' => 'a2', 'table' => 'geoloc_pays', 'text' => 'nat', 'exact' => 'false'),
- 'binet' => array('field' => 'id', 'table' => 'binets_def', 'text' => 'text', 'exact' => false),
- 'groupex' => array('field' => 'id', 'table' => 'groupex.asso',
- 'text' => "(cat = 'GroupesX' OR cat = 'Institutions') AND pub = 'public' AND nom",
- 'exact' => false),
- 'section' => array('field' => 'id', 'table' => 'sections', 'text' => 'text', 'exact' => false),
- 'school' => array('field' => 'id', 'table' => 'applis_def', 'text' => 'text', 'exact' => false),
- 'city' => array('table' => 'geoloc_city', 'text' => 'name', 'exact' => false)
+ 'country' => array('field' => 'iso_3166_1_a2', 'table' => 'geoloc_countries', 'text' => 'countryFR',
+ 'exact' => false),
+ 'fonction' => array('field' => 'id', 'table' => 'fonctions_def', 'text' => 'fonction_fr', 'exact' => true),
+ 'secteur' => array('field' => 'id', 'table' => 'profile_job_sector_enum', 'text' => 'name', 'exact' => false),
+ 'nationalite' => array('field' => 'iso_3166_1_a2', 'table' => 'geoloc_countries',
+ 'text' => 'nationalityFR', 'exact' => 'false'),
+ 'binet' => array('field' => 'id', 'table' => 'binets_def', 'text' => 'text', 'exact' => false),
+ 'networking_type' => array('field' => 'network_type', 'table' => 'profile_networking_enum',
+ 'text' => 'name', 'exact' => false),
+ 'groupex' => array('field' => 'id', 'table' => 'groupex.asso',
+ 'text' => "(cat = 'GroupesX' OR cat = 'Institutions') AND pub = 'public' AND nom",
+ 'exact' => false),
+ 'section' => array('field' => 'id', 'table' => 'sections', 'text' => 'text', 'exact' => false),
+ 'school' => array('field' => 'id', 'table' => 'profile_education_enum', 'text' => 'name', 'exact' => false),
+ 'city' => array('table' => 'geoloc_localities', 'text' => 'name', 'exact' => false)
);
if (!Env::has('page')) {
S::logger()->log('search', 'adv=' . var_export($_GET, true));
$beginwith = true;
$field2 = false;
$qsearch = str_replace(array('%', '_'), '', $q);
+ $distinct = true;
switch ($type) {
case 'binetTxt':
$db = '`binets_def` INNER JOIN
`binets_ins` ON(`binets_def`.`id` = `binets_ins`.`binet_id`)';
- $field='`binets_def`.`text`';
+ $field = '`binets_def`.`text`';
if (strlen($q) > 2)
$beginwith = false;
$realid = '`binets_def`.`id`';
break;
+ case 'networking_typeTxt':
+ $db = '`profile_networking_enum` INNER JOIN
+ `profile_networking` ON(`profile_networking`.`network_type` = `profile_networking_enum`.`network_type`)';
+ $field = '`profile_networking_enum`.`name`';
+ $unique = 'uid';
+ $realid = '`profile_networking_enum`.`network_type`';
+ break;
case 'city':
- $db = '`geoloc_city` INNER JOIN
- `adresses` ON(`geoloc_city`.`id` = `adresses`.`cityid`)';
- $unique='`uid`';
- $field='`geoloc_city`.`name`';
+ $db = 'geoloc_localities INNER JOIN
+ profile_addresses ON (geoloc_localities.id = profile_addresses.localityId)';
+ $unique = 'uid';
+ $field ='geoloc_localities.name';
break;
case 'countryTxt':
- $db = '`geoloc_pays` INNER JOIN
- `adresses` ON(`geoloc_pays`.`a2` = `adresses`.`country`)';
- $unique='`uid`';
- $field = '`geoloc_pays`.`pays`';
- $field2 = '`geoloc_pays`.`country`';
- $realid='`geoloc_pays`.`a2`';
+ $db = 'geoloc_countries INNER JOIN
+ profile_addresses ON (geoloc_countries.iso_3166_1_a2 = profile_addresses.countryId)';
+ $unique = 'pid';
+ $field = 'geoloc_countries.countryFR';
+ $realid = 'geoloc_countries.iso_3166_1_a2';
break;
case 'entreprise':
- $db = '`entreprises`';
- $field = '`entreprise`';
- $unique='`uid`';
- break;
- case 'firstname':
- $field = '`prenom`';
- $beginwith = false;
+ $db = 'profile_job_enum INNER JOIN
+ profile_job ON (profile_job.jobid = profile_job_enum.id)';
+ $field = 'profile_job_enum.name';
+ $unique = 'profile_job.uid';
break;
case 'fonctionTxt':
- $db = '`fonctions_def` INNER JOIN
- `entreprises` ON(`entreprises`.`fonction` = `fonctions_def`.`id`)';
- $field = '`fonction_fr`';
- $unique = '`uid`';
- $realid = '`fonctions_def`.`id`';
+ $db = 'fonctions_def INNER JOIN
+ profile_job ON (profile_job.fonctionid = fonctions_def.id)';
+ $field = 'fonction_fr';
+ $unique = 'uid';
+ $realid = 'fonctions_def.id';
$beginwith = false;
break;
case 'groupexTxt':
$realid = 'a.id';
$unique = 'm.uid';
break;
- case 'name':
- $field = '`nom`';
- $field2 = '`nom_usage`';
- $beginwith = false;
- break;
case 'nationaliteTxt':
- $db = '`geoloc_pays` INNER JOIN
- `auth_user_md5` ON(`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
- $field = 'IF(`geoloc_pays`.`nat`=\'\',
- `geoloc_pays`.`pays`,
- `geoloc_pays`.`nat`)';
- $realid = '`geoloc_pays`.`a2`';
+ $db = 'geoloc_countries INNER JOIN
+ auth_user_md5 ON (geoloc_countries.a2 = auth_user_md5.nationalite
+ OR geoloc_countries.a2 = auth_user_md5.nationalite2
+ OR geoloc_countries.a2 = auth_user_md5.nationalite3)';
+ $field = 'geoloc_countries.nationalityFR';
+ $realid = 'geoloc_countries.iso_3166_1_a2';
break;
- case 'nickname':
- $field = '`profile_nick`';
- $db = '`auth_user_quick`';
- $beginwith = false;
- break;
- case 'poste':
- $db = '`entreprises`';
- $field = '`poste`';
- $unique='`uid`';
+ case 'description':
+ $db = 'profile_job';
+ $field = 'description';
+ $unique = 'uid';
break;
case 'schoolTxt':
- $db = '`applis_def` INNER JOIN
- `applis_ins` ON(`applis_def`.`id` = `applis_ins`.`aid`)';
- $field='`applis_def`.`text`';
- $unique = '`uid`';
- $realid = '`applis_def`.`id`';
+ $db = 'profile_education_enum INNER JOIN
+ profile_education ON (profile_education_enum.id = profile_education.eduid)';
+ $field = 'profile_education_enum.name';
+ $unique = 'uid';
+ $realid = 'profile_education_enum.id';
if (strlen($q) > 2)
$beginwith = false;
break;
case 'secteurTxt':
- $db = '`emploi_secteur` INNER JOIN
- `entreprises` ON(`entreprises`.`secteur` = `emploi_secteur`.`id`)';
- $field = '`emploi_secteur`.`label`';
- $realid = '`emploi_secteur`.`id`';
- $unique = '`uid`';
+ $db = 'profile_job_sector_enum INNER JOIN
+ profile_job ON (profile_job.sectorid = profile_job_sector_enum.id)';
+ $field = 'profile_job_sector_enum.name';
+ $realid = 'profile_job_sector_enum.id';
+ $unique = 'uid';
$beginwith = false;
break;
+ case 'subSubSector':
+ $db = 'profile_job_subsubsector_enum';
+ $field = 'name';
+ $beginwith = false;
+ $unique = 'name';
+ $distinct = false;
+ break;
case 'sectionTxt':
$db = '`sections` INNER JOIN
`auth_user_md5` ON(`auth_user_md5`.`section` = `sections`.`id`)';
$field2_t = make_field_test($field2, $beginwith);
$field_select = 'IF(' . $field_t . ', ' . $field . ', ' . $field2. ')';
}
- $list = XDB::iterator('SELECT ' . $field_select . ' AS field,
- COUNT(DISTINCT ' . $unique . ') AS nb
- ' . ($realid ? (', ' . $realid . ' AS id') : '') . '
+ $list = XDB::iterator('SELECT ' . $field_select . ' AS field'
+ . ($distinct ? (', COUNT(DISTINCT ' . $unique . ') AS nb') : '')
+ . ($realid ? (', ' . $realid . ' AS id') : '') . '
FROM ' . $db . '
WHERE ' . $field_t .
($field2 ? (' OR ' . $field2_t) : '') . '
GROUP BY ' . $field_select . '
- ORDER BY nb DESC
+ ORDER BY ' . ($distinct ? 'nb DESC' : $field_select) . '
LIMIT 11',
$qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch,
$qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch, $qsearch);
+
$nbResults = 0;
$res = "";
while ($result = $list->next()) {
$res .= $q."|-1\n";
} else {
$res .= $result['field'].'|';
- $res .= $result['nb'];
+ if (isset($result['nb'])) {
+ $res .= $result['nb'];
+ }
if (isset($result['id'])) {
$res .= '|'.$result['id'];
}
case 'binet':
$db = '`binets_def`';
break;
+ case 'networking_type':
+ $db = '`profile_networking_enum`';
+ $field = '`name`';
+ $id = '`network_type`';
+ break;
case 'country':
- $db = '`geoloc_pays`';
- $field = '`pays`';
- $id = '`a2`';
+ $db = 'geoloc_countries';
+ $field = 'countryFR';
+ $id = 'iso_3166_1_a2';
$page->assign('onchange', 'changeCountry(this.value)');
break;
case 'fonction':
$field = 'nom';
break;
case 'nationalite':
- $db = '`geoloc_pays` INNER JOIN
- `auth_user_md5` ON (`geoloc_pays`.`a2` = `auth_user_md5`.`nationalite`)';
- $field = 'IF(`nat`=\'\', `pays`, `nat`)';
- $id = '`a2`';
+ $db = 'geoloc_countries INNER JOIN
+ auth_user_md5 ON (geoloc_countries.iso_3166_1_a2 = auth_user_md5.nationalite
+ OR geoloc_countries.iso_3166_1_a2 = auth_user_md5.nationalite2
+ OR geoloc_countries.iso_3166_1_a2 = auth_user_md5.nationalite3)';
+ $field = 'nationalityFR';
+ $id = 'iso_3166_1_a2';
break;
case 'region':
- $db = '`geoloc_region`';
- $field = '`name`';
- $id = '`region`';
+ $db = 'geoloc_administrativeareas';
+ $field = 'name';
+ $id = 'id';
if (isset($_REQUEST['country'])) {
- $where .= ' WHERE `a2` = "'.$_REQUEST['country'].'"';
+ $where .= ' WHERE country = "' . $_REQUEST['country'] . '"';
}
break;
case 'school':
- $db = '`applis_def`';
+ $db = 'profile_education_enum';
+ $field = 'name';
+ $id = 'id';
$page->assign('onchange', 'changeSchool(this.value)');
break;
case 'section':
$db = '`sections`';
break;
case 'secteur':
- $db = '`emploi_secteur`';
- $field = '`label`';
+ $db = 'profile_job_sector_enum INNER JOIN
+ profile_job ON (profile_job.sectorid = profile_job_sector_enum.id)';
+ $field = 'profile_job_sector_enum.name';
+ $id = 'profile_job_sector_enum.id';
break;
default: exit();
}
u.perms IN (\'admin\',\'user\', \'disabled\') AS inscrit,
u.perms != \'pending\' AS wasinscrit,
FIND_IN_SET(\'femme\', u.flags) AS sexe,
- a.alias AS forlife,
- ad0.text AS app0text, ad0.url AS app0url, ai0.type AS app0type,
- ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type,
- es.label AS secteur, ef.fonction_fr AS fonction,
- IF(n.nat=\'\',n.pays,n.nat) AS nat, n.a2 AS iso3166,
+ ede0.name AS eduname0, ede0.url AS eduurl0, edd0.degree AS edudegree0,
+ edu0.grad_year AS edugrad_year0, f0.field AS edufield0, edu0.program AS eduprogram0,
+ ede1.name AS eduname1, ede1.url AS eduurl1, edd1.degree AS edudegree1,
+ edu1.grad_year AS edugrad_year1, f1.field AS edufield1, edu1.program AS eduprogram1,
+ ede2.name AS eduname2, ede2.url AS eduurl2, edd2.degree AS edudegree2,
+ edu2.grad_year AS edugrad_year2, f2.field AS edufield2, edu2.program AS eduprogram2,
+ ede3.name AS eduname3, ede3.url AS eduurl3, edd3.degree AS edudegree3,
+ edu3.grad_year AS edugrad_year3, f3.field AS edufield3, edu3.program AS eduprogram3,
+ es.name AS secteur, ef.fonction_fr AS fonction,
+ IF(n1.nat=\'\',n1.pays,n1.nat) AS nat1, n1.a2 AS iso3166_1,
+ IF(n2.nat=\'\',n2.pays,n2.nat) AS nat2, n2.a2 AS iso3166_2,
+ IF(n3.nat=\'\',n3.pays,n3.nat) AS nat3, n3.a2 AS iso3166_3,
(COUNT(em.email) > 0 OR FIND_IN_SET("googleapps", u.mail_storage) > 0) AS actif,';
// hide private information if not logged
if (S::logged())
$globals->search->result_fields .='
- q.profile_web AS web,
- q.profile_mobile AS mobile,
q.profile_freetext AS freetext,
adr.city, gp.pays AS countrytxt, gr.name AS region,
- e.entreprise,';
+ ee.name,
+ nw.address AS networking_address,
+ nwe.name AS networking_name,';
else
$globals->search->result_fields .="
- IF(q.profile_web_pub='public', q.profile_web, '') AS web,
- IF(q.profile_mobile_pub='public', q.profile_mobile, '') AS mobile,
IF(q.profile_freetext_pub='public', q.profile_freetext, '') AS freetext,
- IF(adr.pub='public', adr.city, '') AS city,
- IF(adr.pub='public', gp.pays, '') AS countrytxt,
- IF(adr.pub='public', gr.name, '') AS region,
- IF(e.pub='public', e.entreprise, '') AS entreprise,";
-@$globals->search->result_where_statement = '
- LEFT JOIN applis_ins AS ai0 ON (u.user_id = ai0.uid AND ai0.ordre = 0)
- LEFT JOIN applis_def AS ad0 ON (ad0.id = ai0.aid)
- LEFT JOIN applis_ins AS ai1 ON (u.user_id = ai1.uid AND ai1.ordre = 1)
- LEFT JOIN applis_def AS ad1 ON (ad1.id = ai1.aid)
- LEFT JOIN entreprises AS e ON (e.entrid = 0 AND e.uid = u.user_id)
- LEFT JOIN emploi_secteur AS es ON (e.secteur = es.id)
- LEFT JOIN fonctions_def AS ef ON (e.fonction = ef.id)
- LEFT JOIN geoloc_pays AS n ON (u.nationalite = n.a2)
- LEFT JOIN adresses AS adr ON (u.user_id = adr.uid AND FIND_IN_SET(\'active\',adr.statut))
- LEFT JOIN geoloc_pays AS gp ON (adr.country = gp.a2)
- LEFT JOIN geoloc_region AS gr ON (adr.country = gr.a2 AND adr.region = gr.region)
- LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = \'active\')';
+ IF(adr.pub='public', adr.city, '') AS city,
+ IF(adr.pub='public', gp.pays, '') AS countrytxt,
+ IF(adr.pub='public', gr.name, '') AS region,
+ IF(e.pub='public', je.name, '') AS entreprise,
+ IF(nw.pub='public', nw.address, '') AS networking_address,
+ IF(nw.pub='public', nwe.name, '') AS networking_name,";
+@$globals->search->result_where_statement = "
+ LEFT JOIN profile_education AS edu0 ON (u.user_id = edu0.uid AND edu0.id = 0)
+ LEFT JOIN profile_education_enum AS ede0 ON (ede0.id = edu0.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd0 ON (edd0.id = edu0.degreeid)
+ LEFT JOIN profile_education_field_enum AS f0 ON (f0.id = edu0.fieldid)
+ LEFT JOIN profile_education AS edu1 ON (u.user_id = edu1.uid AND edu1.id = 1)
+ LEFT JOIN profile_education_enum AS ede1 ON (ede1.id = edu1.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd1 ON (edd1.id = edu1.degreeid)
+ LEFT JOIN profile_education_field_enum AS f1 ON (f1.id = edu1.fieldid)
+ LEFT JOIN profile_education AS edu2 ON (u.user_id = edu2.uid AND edu2.id = 2)
+ LEFT JOIN profile_education_enum AS ede2 ON (ede2.id = edu2.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd2 ON (edd2.id = edu2.degreeid)
+ LEFT JOIN profile_education_field_enum AS f2 ON (f2.id = edu2.fieldid)
+ LEFT JOIN profile_education AS edu3 ON (u.user_id = edu3.uid AND edu3.id = 3)
+ LEFT JOIN profile_education_enum AS ede3 ON (ede3.id = edu3.eduid)
+ LEFT JOIN profile_education_degree_enum AS edd3 ON (edd3.id = edu3.degreeid)
+ LEFT JOIN profile_education_field_enum AS f3 ON (f3.id = edu3.fieldid)
+ LEFT JOIN profile_job AS e ON (e.uid = u.user_id)
+ LEFT JOIN profile_job_enum AS ee ON (e.jobid = ee.id)
+ LEFT JOIN profile_job_sector_enum AS es ON (es.id = e.sectorid)
+ LEFT JOIN fonctions_def AS ef ON (e.fonction = ef.id)
+ LEFT JOIN geoloc_countries AS n1 ON (u.nationalite = n1.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n2 ON (u.nationalite2 = n2.iso_3166_1_a2)
+ LEFT JOIN geoloc_countries AS n3 ON (u.nationalite3 = n3.iso_3166_1_a2)
+ LEFT JOIN profile_addresses AS adr ON (u.user_id = adr.pid
+ AND FIND_IN_SET('current', adr.flags))
+ LEFT JOIN geoloc_countries AS gp ON (adr.countryId = gp.iso_3166_1_a2)
+ LEFT JOIN geoloc_administrativeareas AS gr ON (adr.countryId = gr.country
+ AND adr.administrativeAreaId = gr.id)
+ LEFT JOIN emails AS em ON (em.uid = u.user_id AND em.flags = 'active')
+ LEFT JOIN profile_networking AS nw ON (nw.uid = u.user_id)
+ LEFT JOIN profile_networking_enum AS nwe ON (nwe.network_type = nw.network_type)";
// }}}
// {{{ class ThrowError
/** stores admin searches */
var $email;
var $ip;
+ /** stores phone number */
+ var $phone;
// }}}
// {{{ constructor
function isempty()
{
- return empty($this->strings) && empty($this->ranges) && empty($this->email) && empty($this->ip);
+ return empty($this->strings) && empty($this->ranges) && empty($this->email) && empty($this->ip) && empty($this->phone);
}
// }}}
foreach ($ranges as $r) {
if (preg_match('!^([<>]\d{4}|\d{4}(-\d{4})?)$!', $r)) $this->ranges[] = $r;
}
+
+ $t = preg_replace('!(\d{4}-\d{4}|>\d{4}|<\d{4})!', '', $s);
+ $t = preg_replace('![<>\- ]!', '', $t);
+ if (strlen($t) > 4) {
+ $this->phone = $t;
+ }
}
// }}}
$where[] = "false";
}
}
+ if (!empty($this->phone)){
+ require_once("profil.func.inc.php");
+ $phone = format_phone_number($this->phone) . "%";
+ $where[] = 't.search_tel LIKE ' . XDB::escape($phone);
+ }
return join(" AND ", $where);
}
if (!empty($this->ip)) {
$join .= "INNER JOIN logger.sessions AS ls ON (ls.uid = u.user_id)\n";
}
+ if (!empty($this->phone)) {
+ if (!S::logged()) {
+ $join .= "INNER JOIN profile_phones AS t ON (t.uid = u.user_id AND t.pub = 'public')";
+ } else {
+ $join .= "INNER JOIN profile_phones AS t ON (t.uid = u.user_id)";
+ }
+ }
return $join;
}
// }}}
// }}}
// {{{ class RefSFieldMultipleTable
+class PhoneSField extends RefSField
+{
+ function PhoneSField($_fieldFormName, $_fieldDbName='', $_refTable, $_refAlias, $_refCondition)
+ {
+ $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true);
+ }
+
+ function get_request()
+ {
+ require_once("profil.func.inc.php");
+ $this->value = trim(Env::v($this->fieldFormName));
+ $this->value = format_phone_number($this->value);
+ }
+
+ function compare()
+ {
+ return " LIKE '" . addslashes($this->value) . "%'";
+ }
+}
+
+class IndexSField extends RefSField
+{
+ function IndexSField($_fieldFormName, $_fieldDbName='', $_refTable, $_refAlias, $_refCondition)
+ {
+ $this->RefSField($_fieldFormName, $_fieldDbName, $_refTable, $_refAlias, $_refCondition, true);
+ }
+
+ function get_request()
+ {
+ $this->value = trim(Env::v($this->fieldFormName));
+ }
+}
+
class MapSField extends RefSField
{
var $mapId;
require_once dirname(__FILE__).'/classes.inc.php';
// {{{ function advancedSearchFromInput
-function getadr_join($table) {
- return 'u.user_id='.$table.'.uid'.(Env::v('only_current',false)?' AND FIND_IN_SET(\'active\','.$table.'.statut)':'');
+function getAddressJoin($table) {
+ return 'u.user_id = ' . $table . '.pid' . (Env::v('only_current', false) ? ' AND FIND_IN_SET(\'current\', ' . $table . '.flags)' : '');
}
function advancedSearchFromInput()
{
if ($with_soundex = Env::has('with_soundex')) {
- $nameField = new RefWithSoundexSField('name',array('rn.nom1_soundex','rn.nom2_soundex','rn.nom3_soundex'),'recherche_soundex','rn','u.matricule = rn.matricule');
- $firstnameField = new RefWithSoundexSField('firstname',array('rp.prenom1_soundex','rp.prenom2_soundex'),'recherche_soundex','rp','u.matricule = rp.matricule');
+ $nameField = new RefWithSoundexSField('name', array('n.soundex'), 'search_name',
+ 'n', 'u.user_id = n.uid');
} else {
- $nameField = new NameSField('name',array('u.nom','u.nom_usage'),'');
- $firstnameField = new StringSField('firstname',array('u.prenom'),'');
+ $nameField = new NameSField('name', array('n.token'), 'search_name', 'n', 'u.user_id = n.uid');
}
- $nicknameField = new StringSField('nickname',array('q.profile_nick'),'');
- $promo1Field = new PromoSField('promo1','egal1',array('u.promo'),'');
- $promo2Field = new PromoSField('promo2','egal2',array('u.promo'),'');
- $womanField = new RefSField('woman',array('FIND_IN_SET(\'femme\',u.flags)+1'),'','','');
- $subscriberField = new RefSField('subscriber',array('!(u.perms IN (\'admin\',\'user\'))+1'),'','','');
- $aliveField = new RefSField('alive',array('(u.deces!=0)+1'),'','','');
+ $promo1Field = new PromoSField('promo1', 'egal1', array('u.promo'), '');
+ $promo2Field = new PromoSField('promo2', 'egal2', array('u.promo'), '');
+ $womanField = new RefSField('woman', array('FIND_IN_SET(\'femme\', u.flags) + 1'), '', '', '');
+ $subscriberField = new RefSField('subscriber', array('!(u.perms IN (\'admin\', \'user\')) + 1'), '', '', '');
+ $aliveField = new RefSField('alive', array('(u.deces != 0) + 1'), '', '', '');
if (Env::v('only_referent') == 'on') {
- $referentField = new RefSField('only_referent', array('"on"'), 'mentor', 'mt', 'mt.expertise != "" AND mt.uid=u.user_id');
+ $referentField = new RefSField('only_referent', array('"on"'), 'mentor', 'mt', 'mt.expertise != "" AND mt.uid = u.user_id');
} else {
- $referentField = null;
+ $referentField = null;
}
- if (!Env::i('cityid')) {
- $townField = new RefSField('city',array('ac.city', 'ac.postcode'),'adresses','ac',getadr_join('ac'),false);
- } else {
- $townField = new RefSField('cityid',array('av.cityid', 'av.postcode'),'adresses','av',getadr_join('av'));
- }
- $countryField = new RefSField('country',array('ap.country'),'adresses','ap',getadr_join('ap'));
- $regionField = new RefSField('region',array('ar.region'),'adresses','ar',getadr_join('ar'));
- $mapField = new MapSField('mapid', array('sgcim.map_id'), array('adresses','geoloc_city_in_maps'), array('amp','sgcim'), array(getadr_join('amp'), 'amp.cityid = sgcim.city_id'));
+ $townField = new RefSField('city', array('av.localityId', 'av.postalCode'), 'profile_addresses',
+ 'av', getAddressJoin('av'));
+ $countryField = new RefSField('country', array('ap.countryId'), 'profile_addresses', 'ap', getAddressJoin('ap'));
+ $regionField = new RefSField('region',array('ar.administrativeAreaId'), 'profile_addresses', 'ar', getAddressJoin('ar'));
- $entrepriseField = new RefSField('entreprise',array('ee.entreprise'),'entreprises','ee','u.user_id=ee.uid',false);
- $posteField = new RefSField('poste',array('ep.poste'),'entreprises','ep','u.user_id=ep.uid', false);
- $fonctionField = new RefSField('fonction',array('en.fonction'),'entreprises','en','u.user_id=en.uid');
- $secteurField = new RefSField('secteur',array('fm.secteur'),'entreprises','fm','u.user_id=fm.uid');
- $cvField = new RefSField('cv',array('u.cv'),'','','',false);
+ $entrepriseField = new RefSField('entreprise', array('je.name'), '', '','');
+ $posteField = new RefSField('poste', array('ep.description'), 'profile_job', 'ep', 'u.user_id = ep.uid', false);
+ $fonctionField = new RefSField('fonction', array('en.fonction_fr'), 'fonctions_def', 'en',
+ 'u.user_id = profile_job.uid AND fonctions_def.id = profile_job.functionid');
+ $secteurField = new RefSField('secteur', array('fm.sectorid'), 'profile_job', 'fm', 'u.user_id = fm.uid');
+ $cvField = new RefSField('cv', array('u.cv'), '', '', '', false);
- $natField = new RefSField('nationalite',array('u.nationalite'),'','','');
- $binetField = new RefSField('binet',array('b.binet_id'),'binets_ins','b','u.user_id=b.user_id');
- $groupexField = new RefSField('groupex',array('g.id'),array('groupex.asso', 'groupex.membres'),array('g', 'gm'),
- array("(g.cat = 'GroupesX' OR g.cat = 'Institutions') AND g.pub = 'public'",
- 'gm.asso_id = g.id AND u.user_id=gm.uid'));
- $sectionField = new RefSField('section',array('u.section'),'','','');
- $schoolField = new RefSField('school',array('as.aid'),'applis_ins','`as`','u.user_id=as.uid');
- $diplomaField = new RefSField('diploma',array('ad.type'),'applis_ins','ad','u.user_id=ad.uid');
+ $natField = new RefSField('nationalite', array('u.nationalite', 'u.nationalite2', 'u.nationalite3'), '', '', '');
+ $binetField = new RefSField('binet', array('b.binet_id'), 'binets_ins', 'b', 'u.user_id=b.user_id');
+ $groupexField = new RefSField('groupex', array('g.id'), array('groupex.asso', 'groupex.membres'), array('g', 'gm'),
+ array("(g.cat = 'GroupesX' OR g.cat = 'Institutions') AND g.pub = 'public'",
+ 'gm.asso_id = g.id AND u.user_id = gm.uid'));
+ $sectionField = new RefSField('section', array('u.section'), '', '', '');
+ $schoolField = new RefSField('school', array('edu.eduid'), 'profile_education', 'edu', 'u.user_id = edu.uid');
+ $diplomaField = new RefSField('diploma', array('edd.degreeid'), 'profile_education', 'edd', 'u.user_id = edd.uid');
- $freeField = new RefSField('free',array('q.profile_freetext'),'','','',false);
+ $freeField = new RefSField('free', array('q.profile_freetext'), '', '', '', false);
+ $nwAddressField = new RefSField('networking_address', array('nw.address'), 'profile_networking', 'nw', 'nw.uid=u.user_id', false);
+ if (Env::v('networking_address') == '') {
+ $nwTypeField = new IndexSField('networking_type', array('nwe.network_type'), array('profile_networking', 'profile_networking_enum'),
+ array('nw', 'nwe'), array('nw.uid = u.user_id', 'nwe.network_type = nw.network_type'));
+ } else {
+ $nwTypeField = new IndexSField('networking_type',
+ array('nwe.network_type'), 'profile_networking_enum', 'nwe', 'nwe.network_type = nw.network_type');
+ }
+ $nwPhoneField = new PhoneSField('phone_number', array('t.search_tel'), 'profile_phones', 't', 't.uid = u.user_id');
return array(
- $nameField, $firstnameField, $nicknameField, $promo1Field,
- $promo2Field, $womanField, $subscriberField, $aliveField, $referentField,
- $townField, $countryField, $regionField, $mapField, $entrepriseField,
+ $nameField, $promo1Field,
+ $promo2Field, $womanField, $subscriberField, $aliveField,
+ $townField, $countryField, $regionField, $entrepriseField,
$posteField, $secteurField, $cvField, $natField, $binetField,
$groupexField, $sectionField, $schoolField, $diplomaField,
- $freeField, $fonctionField);
+ $freeField, $fonctionField, $nwAddressField, $nwTypeField,
+ $nwPhoneField, $referentField);
}
// }}}
function smarty_function_display_address($param, &$smarty)
{
require_once('geoloc.inc.php');
- $txtad = get_address_text($param['adr']);
- if (!$txtad &&
- !$param['adr']['tels'] && !count($param['adr']['tels']) &&
- !$param['adr']['tel'] &&
- !$param['adr']['fax'] &&
- !$param['adr']['mobile']) return "";
-
+ $txtad = $param['adr']['text'];
+ if (!$txtad && !$param['adr']['tels'] && !count($param['adr']['tels'])) {
+ return "";
+ }
$lines = explode("\n", $txtad);
$idt = array_shift($lines);
$map = "<a href=\"http://maps.google.fr/?q="
. urlencode(implode(", ", $lines) . " ($idt)")
. "\"><img src=\"images/icons/map.gif\" alt=\"Google Maps\" title=\"Carte\"/></a>";
+ $comment = "";
+ if ($param['adr']['comment'] != "")
+ {
+ $commentHtml = str_replace(array('&', '"'), array('&', '"'), $param['adr']['comment']);
+ $commentJs = str_replace(array('\\', '\''), array('\\\\', '\\\''), $commentHtml);
+ $comment = "<img style=\"margin-left: 5px;\" src=\"images/icons/comments.gif\""
+ . " onmouseover=\"return overlib('"
+ . $commentJs
+ . "',WIDTH,250);\""
+ . " onmouseout=\"nd();\""
+ . " alt=\"Commentaire\" title=\""
+ . $commentHtml
+ . "\"/>";
+ }
if ($restore) {
array_unshift($lines, $idt);
}
if ($param['titre'])
{
if ($param['titre_div'])
- $txthtml .= "<div class='titre'>".pl_entity_decode($param['titre'])." ".$map."</div>\n";
+ $txthtml .= "<div class='titre'>".pl_entity_decode($param['titre'])." ".$map.$comment."</div>\n";
else
- $txthtml .= "<em>".pl_entity_decode($param['titre'])." </em>".$map."<br />\n";
+ $txthtml .= "<em>".pl_entity_decode($param['titre'])." </em>".$map.$comment."<br />\n";
}
foreach ($lines as $line)
{
$txthtml .= "<strong>".$line."</strong><br/>\n";
}
- if ($param['adr']['tel'])
- $txthtml .= "<div>\n<em>Tél : </em>\n<strong>".$param['adr']['tel']."</strong>\n</div>\n";
- if ($param['adr']['fax'])
- $txthtml .= "<div>\n<em>Fax : </em>\n<strong>".$param['adr']['fax']."</strong>\n</div>\n";
- if ($param['adr']['mobile'])
- $txthtml .= "<div>\n<em>Tél : </em>\n<strong>".$param['adr']['mobile']."</strong>\n</div>\n";
- if ($param['adr']['tels'] && count($param['adr']['tels'])) {
- foreach ($param['adr']['tels'] as $tel)
- $txthtml .= "<div>\n<em>".$tel['tel_type']." : </em>\n<strong>".$tel['tel']."</strong>\n</div>\n";
+ if(isset($param['adr']['tels'])) {
+ require_once('function.display_phones.php');
+ $txthtml .= smarty_function_display_phones($param['adr'],$smarty);
}
if (!$param['nodiv']) {
$pos = $param['pos'] ? " style='float: " . $param['pos'] . "'" : '';
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-function smarty_function_geoloc_region($params, &$smarty) {
- require_once 'geoloc.inc.php';
- if(!isset($params['country']) || !isset($params['region'])) {
- return;
+function smarty_function_display_phones($param, &$smarty)
+{
+ $txthtml = "";
+ if (count($param['tels'])) {
+ foreach ($param['tels'] as $tel) {
+ switch ($tel['tel_type']) {
+ case 'fixed':
+ $tel_type = 'Tél';
+ break;
+ case 'fax':
+ $tel_type = 'Fax';
+ break;
+ case 'mobile':
+ $tel_type = 'Mob';
+ break;
+ default:
+ $tel_type = $tel['tel_type'];
+ }
+ $txthtml .= "<div>\n<em>" . $tel_type . " : </em>\n<strong>" . $tel['tel'] . "</strong>\n";
+ $comment = "";
+ if ($tel['comment'] != "") {
+ $commentHtml = str_replace(array('&', '"'), array('&', '"'), $tel['comment']);
+ $commentJs = str_replace(array('\\', '\''), array('\\\\', '\\\''), $commentHtml);
+ $txthtml .= "<img style=\"margin-left: 5px;\" src=\"images/icons/comments.gif\""
+ . " onmouseover=\"return overlib('"
+ . $commentJs
+ . "',WIDTH,250);\""
+ . " onmouseout=\"nd();\""
+ . " alt=\"Commentaire\" title=\""
+ . $commentHtml
+ . "\"/>\n";
+ }
+ $txthtml .= "</div>\n";
+ }
}
- return geoloc_region($params['country'], $params['region'], @$params['available']);
+ return $txthtml;
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+++ /dev/null
-<?php
-/***************************************************************************
- * Copyright (C) 2003-2009 Polytechnique.org *
- * http://opensource.polytechnique.org/ *
- * *
- * This program is free software; you can redistribute it and/or modify *
- * it under the terms of the GNU General Public License as published by *
- * the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the Free Software *
- * Foundation, Inc., *
- * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
- ***************************************************************************/
-
-function smarty_function_geoloc_country($params, &$smarty) {
- require_once 'geoloc.inc.php';
- if(!isset($params['country'])) {
- return;
- }
- return geoloc_country($params['country'], @$params['available']);
-}
-
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
-?>
***************************************************************************/
-function select_nat($valeur,$pad=false) {
- $sql = "SELECT a2 AS id,IF(nat='',pays,nat) AS text FROM geoloc_pays WHERE nat IS NOT NULL ORDER BY text";
- $res = XDB::iterRow($sql);
+function select_nat($valeur, $pad=false) {
+ $res = XDB::iterRow("SELECT iso_3166_1_a2 AS id, nationalityFR AS text
+ FROM geoloc_countries
+ WHERE nationalityFR IS NOT NULL
+ ORDER BY nationalityFR");
$sel = ' selected="selected"';
// on ajoute une entree vide si $pad est vrai
$html = "";
if ($pad) {
- $html.= '<option value="0"'.($valeur==0?$sel:"")."></option>\n";
+ $html .= sprintf("<option value=\"\"%s></option>\n", ($valeur ? $sel : ""));
}
- while (list($my_id,$my_text) = $res->next()) {
- $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",$my_id,($valeur==$my_id?$sel:""),$my_text);
+ while (list($my_id, $my_text) = $res->next()) {
+ $html .= sprintf("<option value=\"%s\"%s>%s</option>\n", $my_id, ($valeur==$my_id ? $sel : ""), $my_text);
}
+
return $html;
}
function smarty_function_select_nat($params, &$smarty) {
- if(empty($params['pad']) || !($params['pad']))
- $pad = false;
- else
- $pad = true;
+ if (empty($params['pad']) || !($params['pad'])) {
+ $pad = false;
+ } else {
+ $pad = true;
+ }
+
return select_nat($params['valeur'], $pad);
}
<td>
<a href="admin/promo">Ajout promotion</a>
|
- <a href="admin/user">Edition</a>
+ <a href="admin/user">Édition</a>
|
<a href="admin/homonyms">Homonymes</a>
|
<tr><th colspan="2">{icon name=user_gray} Champs</th></tr>
<tr class="impair">
+ <td class="titre">Formation</td>
+ <td>
+ <a href="admin/education">Formations</a>
+ |
+ <a href="admin/education_field">Domaines de formation</a>
+ |
+ <a href="admin/education_degree">Niveau de formation</a>
+ |
+ <a href="admin/education_degree_set">Niveau par formation</a>
+ </td>
+ </tr>
+ <tr class="impair">
<td class="titre">Emploi</td>
<td>
- <a href="admin/formations">Formations</a>
+ <a href="admin/sectors">Secteurs</a>
|
- <a href="admin/secteurs">Secteurs</a>
+ <a href="admin/jobs">Entreprises</a>
|
- <a href="admin/ss_secteurs">Sous-secteurs</a>
+ <a href="admin/corps_enum">Corps</a>
|
- <a href="admin/fonctions">Fonctions</a>
+ <a href="admin/corps_rank">Grade</a>
</td>
</tr>
<tr class="pair">
<a href="admin/medals">Décorations</a>
|
<a href="admin/sections">Sections</a>
- </td>
- </tr>
- <tr class="impair">
- <td class="titre">Géoloc</td>
- <td>
- <a href="admin/geoloc">Synchro</a>
|
- <a href="admin/geoloc/dynamap">Dynamap</a>
+ <a href="admin/names">Noms</a>
+ |
+ <a href="admin/networking">Networking</a>
</td>
</tr>
- <tr class="pair">
+ <tr class="impair">
<td class="titre">Compte</td>
<td>
<a href="admin/skins">Skins</a>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h1>Entreprises</h1>
+
+{if $jobs}
+<p>
+ Liste des entreprises correspondant à ta recherche :
+ <ul>
+ {foreach from=$jobs item=job}
+ <li>{$job.name}{if $job.acronym} ({$job.acronym}){/if}
+ <a href="admin/jobs/{$job.id}">{icon name="page_edit" title="Éditer"}</a></li>
+ {/foreach}
+ </ul>
+{/if}
+
+{if $selectedJob}
+<form action="admin/jobs/{$selectedJob.id}" method="post">
+{xsrf_token_field}
+ <table class="bicol">
+ <tr>
+ <th colspan="2">Entreprise n° {$selectedJob.id}</th>
+ </tr>
+ <tr>
+ <td>Nom</td>
+ <td><input type="text" name="name" value="{$selectedJob.name}" /></td>
+ </tr>
+ <td>Acronyme</td>
+ <td><input type="text" name="acronym" value="{$selectedJob.acronym}" /></td>
+ </tr>
+ </tr>
+ <td>Page web</td>
+ <td><input type="text" name="url" value="{$selectedJob.url}" /></td>
+ </tr>
+ </tr>
+ <td>Adresse email</td>
+ <td><input type="text" name="email" value="{$selectedJob.email}" /></td>
+ </tr>
+ </tr>
+ <td>Code NAF</td>
+ <td><input type="text" name="NAF_code" value="{$selectedJob.NAF_code}" /></td>
+ </tr>
+ </tr>
+ <td>Code AX</td>
+ <td><input type="text" name="AX_code" value="{$selectedJob.AX_code}" /></td>
+ </tr>
+ </tr>
+ <td>Identifiant de la holding</td>
+ <td><input type="text" name="holdingId" value="{$selectedJob.holdingId}" /></td>
+ </tr>
+ </tr>
+ <td>Nom de la holding</td>
+ <td>{$selectedJob.holdingName}</td>
+ </tr>
+ </tr>
+ <td>Acronyme de la holding</td>
+ <td>{$selectedJob.holdingAcronym}</td>
+ </tr>
+ <tr>
+ <td>Adresse</td>
+ <td<textarea cols="30" rows="4" name="address">{$selectedJob.address}</textarea></td>
+ </tr>
+ <tr>
+ <td>Téléphone</td>
+ <td><input type="text" name="tel" value="{$selectedJob.tel}" /></td>
+ </tr>
+ <tr>
+ <td>Fax</td>
+ <td><input type="text" name="fax" value="{$selectedJob.fax}" /></td>
+ </tr>
+ <tr>
+ <td>Remplacer par l'entreprise n°</td>
+ <td><input type="text" name="newJobId" /></td>
+ </tr>
+ </table>
+ <p>
+ Confirmation du remplacement de cette entreprise :
+ <input type="checkbox" name="change" /><br />
+ <input type="submit" name="edit" value="Éditer" />
+ </p>
+</form>
+{/if}
+
+<form action="" method="get">
+ <p>
+ Nom ou acronyme de l'entreprise :
+ <input type="text" name="job" value="{$askedJob}" /><br />
+ <input type="submit" name="search" value="Rechercher" />
+ </p>
+</form>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* *}
{**************************************************************************}
-<h1>Edition de message</h1>
+<h1>Édition de message</h1>
<form action="{$platal->pl_self()}" method="post">
{xsrf_token_field}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+{iterate from=$users item=vcard}
+BEGIN:VCARD
+VERSION:3.0
+{if $vcard.nom_usage}
+FN:{$vcard.prenom|vcard_enc} {$vcard.nom_usage|vcard_enc} ({$vcard.nom|vcard_enc})
+{else}
+FN:{$vcard.prenom|vcard_enc} {$vcard.nom|vcard_enc}
+{/if}
+N:{$vcard.nom|vcard_enc};{$vcard.prenom|vcard_enc};{$vcard.nom_usage|vcard_enc};;
+{if $vcard.nickname}
+NICKNAME:{$vcard.nickname|vcard_enc}
+{/if}
+EMAIL;TYPE=internet,pref:{$vcard.bestalias}@{#globals.mail.domain#}
+EMAIL;TYPE=internet:{$vcard.bestalias}@{#globals.mail.domain2#}
+{if $vcard.bestalias neq $vcard.forlife}
+EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain#}
+EMAIL;TYPE=internet:{$vcard.forlife}@{#globals.mail.domain2#}
+{/if}
+{if $vcard.virtualalias}
+EMAIL;TYPE=internet:{$vcard.virtualalias}
+{/if}
+{if $vcard.tels}
+{foreach item=tel from=$vcard.tels}
+{if $tel.tel_type eq 'mobile'}TEL;TYPE=cell{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=home{/if}:{$tel.tel|vcard_enc}
+{/foreach}
+{/if}
+{if $vcard.adr_pro}
+{if $vcard.adr_pro[0].entreprise}
+ORG:{$vcard.adr_pro[0].entreprise|vcard_enc}
+{/if}
+{if $vcard.adr_pro[0].poste}
+TITLE:{$vcard.adr_pro[0].poste|vcard_enc}
+{/if}
+{if $vcard.adr_pro[0].fonction}
+ROLE:{$vcard.adr_pro[0].fonction|vcard_enc}
+{/if}
+{if $vcard.adr_pro[0].tels}
+{foreach item=tel from=$vcard.adr_pro[0].tels}
+{if $tel.tel_type eq 'mobile'}TEL;TYPE=cell,work{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=work{/if}:{$tel.tel|vcard_enc}
+{/foreach}
+{/if}
+ADR;TYPE=work:{format_adr adr=$vcard.adr_pro[0]}
+{/if}
+{foreach item=adr from=$vcard.adr}
+ADR;TYPE=home{if $adr.courier},postal{/if}:{format_adr adr=$adr}
+{if $adr.tels}
+{foreach item=tel from=$adr.tels}
+{if $tel.tel_type eq 'mobile'}TEL;TYPE=cell,home{else}{if $tel.tel_type eq 'fax'}FAX{else}TEL{/if};TYPE=home{/if}:{$tel.tel|vcard_enc}
+{/foreach}
+{/if}
+{/foreach}
+{foreach from=$vcard.networking item=nw}
+{if $nw.filter eq 'web'}
+URL:{$nw.address}
+{/if}
+{/foreach}
+{if strlen(trim($vcard.freetext)) == 0}
+NOTE:(X{$vcard.promo})
+{else}
+NOTE:(X{$vcard.promo})\n{$vcard.freetext|miniwiki:'no_title':'text'|vcard_enc}
+{/if}
+{if $vcard.section}
+X-SECTION:{$vcard.section}
+{/if}
+{if $vcard.binets_vcardjoin}
+X-BINETS:{$vcard.binets_vcardjoin}
+{/if}
+{if $vcard.gpxs_vcardjoin}
+X-GROUPS:{$vcard.gpxs_vcardjoin}
+{/if}
+{if $vcard.photo}
+PHOTO;ENCODING=b;TYPE={$vcard.photo.attachmime}:{$vcard.photo.attach|base64_encode|vcard_enc}
+{/if}
+SORT-STRING:{$vcard.nom|vcard_enc}
+REV:{$vcard.date|date_format:"%Y%m%dT000000Z"}
+END:VCARD{"\n"}
+{/iterate}
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
</td>
</tr>
{/foreach}
- <tr class="{cycle values="pair,impair"}"><td colspan="4">
- <form action="emails/redirect" method="post">
- <div>
- <br />
- Ajouter une adresse email :
- <input type="text" size="35" maxlength="60" name="email" value="" />
- <input type="submit" value="ajouter" name="emailop" />
+ <form action="emails/redirect" method="post">
+ {cycle values="pair,impair" assign=class_combobox}
+ {include file="include/emails.combobox.tpl" name="email" val=$email class=$class_combobox error=$error_email i="0"}
+ <tr class=$class_combobox><td colspan="4"><div>
+ <input type="submit" value="ajouter" name="emailop" />
{xsrf_token_field}
- </div>
- </form>
- </td></tr>
+ </div></td></tr>
+ </form>
</table>
<script type="text/javascript">showRemove(); activeEnable();</script>
</div>
{else}
<h1 id='pagetop'>
-Bienvenue {$smarty.session.prenom}{if $birthday}
+Bienvenue {$smarty.session.yourself_name}{if $birthday}
et joyeux anniversaire de la part de toute l'équipe !
{else},
{/if}
</div>
Annonce proposée par
<a href="profile/{$ev.hruid}" class="popup2">
- {$ev.prenom} {$ev.nom} X{$ev.promo}
+ {$ev.prenom} {$ev.nom} {$ev.promo_display}
</a>
</td>
</tr>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Décès</h2>
+
+{if $deceasedErrors}
+<p>Voici les {$deceasedErrors} différences entre les deux annuaires pour les renseignements de
+décès.</p>
+
+{if $nbDeceasedMissingInXorg > 0}
+<p>Anciens déclarés décédés dans l'annuaire AX mais pas sur Xorg</p>
+{include file='fusionax/listFusion.tpl' fusionList=$deceasedMissingInXorg field1='deces_ax' namefield1='Décès AX'}
+
+<a href="fusionax/deceased/updateXorg">Inclure toutes les dates de décès connues par l'AX sur Xorg.</a>
+{/if}
+
+{if $nbDeceasedMissingInAX > 0}
+<p>Anciens déclarés décédés dans l'annuaire Xorg mais pas chez l'AX</p>
+{include file='fusionax/listFusion.tpl' fusionList=$deceasedMissingInAX field1='deces_xorg' namefield1='Décès X.org'}
+
+<a href="fusionax/deceased/updateAX">Considérer ces cas comme traités (il n'y a rien à importer).</a>
+{/if}
+
+{if $nbDeceasedDifferent > 0}
+<p>Anciens déclarés décédés dans les deux annuaires mais pas avec la même date</p>
+{include file='fusionax/listFusion.tpl' fusionList=$deceasedDifferent field1='deces_xorg' field2='deces_ax' namefield1='Décès X.org' namefield2='Décès AX'}
+
+<h3>Mettre en correspondance</h3>
+<form action="fusionax/deceased/update" method="post">
+ User ID X.org : <input type="text" name="user_id" value=""/><br/>
+ Date de décès : <input type="text" name="date" value""/><br/>
+ <input type="submit" value="Mettre à jour"/>
+</form>
+{/if}
+
+{else}
+<p>Aucune différence pour les renseignements de décès entre les deux annuaires.</p>
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Identifiants</h2>
+
+<p>Le préalable à toute fusion de renseignements pour une personne entre ce
+que contient la base AX et ce que contient ce site est bien évidemment de
+trouver une correspondance entre les personnes renseignés dans ces annuaires.</p>
+
+{if $nbMissingInAX}
+<h3>Anciens manquants à l'AX</h3>
+
+<p><a href="fusionax/ids/missingInAX">{$nbMissingInAX} ancien{if $nbMissingInAX > 1}s{/if}</a>.</p>
+{/if}
+
+{if $nbMissingInXorg > 0}
+<h3>Anciens manquants à x.org</h3>
+
+<p><a href="fusionax/ids/missingInXorg">{$nbMissingInXorg} ancien{if $nbMissingInXorg > 1}s{/if}</a>.</p>
+{/if}
+
+{if $wrongInXorg > 0}
+<h3>Anciens ayant un matricule_ax sur Xorg ne correspondant à rien dans la base de l'AX</h3>
+
+<p><a href="fusionax/ids/wrongInXorg">{$wrongInXorg} ancien{if $wrongInXorg > 1}s{/if}</a>.</p>
+{/if}
+
+<h3>Mettre en correspondance</h3>
+<form action="fusionax/ids/lier" method="post">
+ Matricule AX : <input type="text" name="matricule_ax" value""/><br/>
+ User ID X.org : <input type="text" name="user_id" value=""/><br/>
+ <input type="submit" value="Lier"/>
+</form>
+
+<p></p>
+<div id="autolink" name="autolink">
+<h3>Mise en correspondance automatique</h3>
+{if $easyToLink}
+<p>
+ Ces anciens sont probablement les mêmes (à peu près mêmes nom, prénom, promo)<br />
+ {$nbMatch} correspondances trouvées.
+</p>
+
+{include file="fusionax/listFusion.tpl" fusionList=$easyToLink fusionAction="fusionax/ids/link" name="lier" field1="display_name_ax" namefield1="Ancien AX"}
+<p><a href="fusionax/ids/linknext">Lier toutes les fiches affichées</a> <span id="fusion-reload" style="display:none"> - <a href="fusionax/ids#autolink">Trouver d'autres correspondances</a></span></p>
+<script type="text/javascript">
+{literal}
+//<!--
+$(document).ready(function() {
+ $('#autolink a.fusion-action').click(function(a){
+ $.get(a.currentTarget.href,{},function(){
+ $(a.currentTarget).hide();
+ $('#fusion-reload').show();
+ $('#fusion-reload a').click(function(a) {
+ document.location = a.currentTarget.href;
+ document.location.reload();
+ });
+ });
+ return false;
+ });
+});
+//-->
+{/literal}
+</script>
+{else}
+<p>Aucune correspondance automatique n'a été trouvée (mêmes nom, prénom, promo d'étude).</p>
+{/if}
+</div>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> / Manquants dans l'annuaire de l'AX</h2>
+
+<p></p>
+
+{if $missingInAX}
+{include file='fusionax/listFusion.tpl' fusionList=$missingInAX field1='user_id' namefield1='ID X.org'}
+{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> / Manquants dans l'annuaire d'X.org</h2>
+
+<p></p>
+
+{if $missingInXorg}
+{include file='fusionax/listFusion.tpl' fusionList=$missingInXorg field1='id_ancien' namefield1='matricule AX'}
+{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / <a href="fusionax/ids">Identifiants<a> / Présents dans Xorg avec un matricule_ax ne correspondant à rien
+dans la base de l'AX (mises à part les promo 1921 et 1923 qui ne figurent pas dans les données de l'AX)</h2>
+
+<p></p>
+
+{if $wrongInXorg}
+{include file='fusionax/listFusion.tpl' fusionList=$wrongInXorg field1='user_id' namefield1='ID X.org'}
+
+<p><a href="fusionax/ids/cleanwronginxorg">Mettre à NULL le matricule_ax de ces camarades pour marquer le fait qu'ils ne figurent pas dans l'annuaire de l'AX</a></p>
+{/if}
{* *}
{**************************************************************************}
-{assign var=telpref value="`$adpref`[tel][`$t`]"}
-{assign var=telid value="`$adid`_tel_`$t`"}
-<div style="float: right" class="flags">
- {include file="include/flags.radio.tpl" name="`$telpref`[pub]" val=$tel.pub}
+<script type="text/javascript">
+{literal}
+//<!--
+ $(document).ready(function() {
+ $('#fusionax_import input').click(function() {
+ $('#fusionax_import input').hide();
+ $('#fusionax_import').append('Lancement de l\'import.<br/>');
+ $.getScript('fusionax/import/launch');
+ });
+ });
+//-->
+{/literal}
+</script>
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a></h2>
+
+<h2>Import de l'annuaire AX</h2>
+{if $lastimport}
+<p>Dernier import {$lastimport}</p>
+{/if}
+
+{if $keymissing}
+<p>Impossible de faire l'import, il manque la clef d'authentification :</p>
+<pre>{$keymissing}</pre>
+{else}
+<div id="fusionax_import">
+<input type="button" value="Lancer l'import"/>
</div>
-<span class="titre">N°{$t+1}</span>
-<input type="hidden" name="{$telpref}[removed]" value="0" />
-<input type="text" size="10" maxlength="30" name="{$telpref}[type]" value="{$tel.type|default:"Tél."}" />
-<input type="text" size="19" maxlength="28" name="{$telpref}[tel]" {if $tel.error}class="error"{/if} value="{$tel.tel}" />
-<a href="javascript:removeObject('{$telid}', '{$telpref}')">
- {icon name=cross title="Supprimer ce numéro de téléphone"}
-</a>
+{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2>Fusion des annuaires X.org - AX</h2>
+<ul>
+<li>Voir la <a href="Fusion">documentation</a></li>
+<li><a href="fusionax/import">Import de la base AX</a> {if $lastimport} - (dernier import le {$lastimport}){/if}</li>
+<li>Mise en <a href="fusionax/ids">correspondance simple</a></li>
+<li>Création des <a href="fusionax/view">VIEW annexes nécessaires aux corrélations</a></li>
+<li>Corrélation des <a href="fusionax/deceased">dates de décès</a></li>
+<li>Corrélation des <a href="fusionax/promo">promotions</a></li>
+<li>Corrélation des <a href="fusionax/names">données d'identification</a></li>
+<li>Corrélation des <a href="fusionax/coords">coordonnées</a></li>
+<li>Corrélation des <a href="fusionax/pros">informations professionnelles</a></li>
+<li>Corrélation des <a href="fusionax/studies">informations de formations</a></li>
+</ul>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<table class="bicol">
+ <tr>
+ <th>Ancien</th>
+ <th>Fiches</th>
+ {if $field1}
+ <th>{$namefield1}</th>
+ {/if}
+ {if $field2}
+ <th>{$namefield2}</th>
+ {/if}
+ {if $field3}
+ <th>{$namefield3}</th>
+ {/if}
+ {if $field4}
+ <th>{$namefield4}</th>
+ {/if}
+ {if $fusionAction}
+ <th>Action</th>
+ {/if}
+ </tr>
+{if $fusionList}
+{iterate from=$fusionList item=c}
+ <tr class="{cycle values="pair,impair"}">
+ <td>{$c.display_name} (X {$c.promo})</td>
+ <td style="text-align:center">
+ {if $c.user_id}<a href="admin/user/{$c.user_id}" class="popup2">{icon name="user_suit" title="Administrer utilisateur"}</a>{/if}
+ {if $c.id_ancien}<a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&anc_id={$c.id_ancien}" class="popup2">{icon name="user_gray" title="fiche AX"}</a>{/if}
+ </td>
+ {if $field1}
+ <td>{$c.$field1}</td>
+ {/if}
+ {if $field2}
+ <td>{$c.$field2}</td>
+ {/if}
+ {if $field3}
+ <td>{$c.$field3}</td>
+ {/if}
+ {if $field4}
+ <td>{$c.$field4}</td>
+ {/if}
+ {if $fusionAction}
+ <td><a class="fusion-action" href="{$fusionAction}/{$c.user_id}/{$c.id_ancien}">{$name}</a></td>
+ {/if}
+ </tr>
+{/iterate}
+{/if}
+</table>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX</a> / Promotions</h2>
+
+<p></p>
+
+{if $nbMissmatchingPromos > 0}
+<p>Il y a {$nbMissmatchingPromos} différences entre les deux bases dans pour les promotions.</p>
+<p>Grosses différences (oranjisation ?) :</p>
+{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos1 field1='user_id' namefield1='ID X.org' field3='promo_etude_xorg'
+namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'}
+
+<p>Petites différences : promo_etude_xorg == promo_etude_ax + 1 et promo_etude_xorg + 3 == promo_sortie_xorg, a priori ce sont les étrangers que nous avons mal
+inclus</p>
+{include file='fusionax/listFusion.tpl' fusionList=$missmatchingPromos2 field1='user_id' namefield1='ID X.org' field3='promo_etude_xorg'
+namefield3='etude_xorg' field4='promo_sortie_xorg' namefield4='sortie_xorg' field2='promo_etude_ax' namefield2='etude_ax'}
+{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<h2><a href="fusionax">Fusion des annuaires X.org - AX<a> / Création des VIEW annexes nécessaires aux corrélations </h2>
+
+<p><a href="fusionax/view/create">Création des VIEW annexes nécessaires aux corrélations</a></p>
{if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}</a>{/if}
</div>
<div class="autre">
- {if $c.iso3166}
- <img src='images/flags/{$c.iso3166}.gif' alt='{$c.nat}' height='11' title='{$c.nat}' />
+ {if $c.iso3166_1}
+ <img src='images/flags/{$c.iso3166_1}.gif' alt='{$c.nat1}' height='11' title='{$c.nat1}' />
+ {/if}
+ {if $c.iso3166_2}
+ <img src='images/flags/{$c.iso3166_2}.gif' alt='{$c.nat2}' height='11' title='{$c.nat2}' />
+ {/if}
+ {if $c.iso3166_3}
+ <img src='images/flags/{$c.iso3166_3}.gif' alt='{$c.nat3}' height='11' title='{$c.nat3}' />
{/if}
(X {$c.promo})
{if $c.dcd}décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
+++ /dev/null
-{**************************************************************************}\r
-{* *}\r
-{* Copyright (C) 2003-2009 Polytechnique.org *}\r
-{* http://opensource.polytechnique.org/ *}\r
-{* *}\r
-{* This program is free software; you can redistribute it and/or modify *}\r
-{* it under the terms of the GNU General Public License as published by *}\r
-{* the Free Software Foundation; either version 2 of the License, or *}\r
-{* (at your option) any later version. *}\r
-{* *}\r
-{* This program is distributed in the hope that it will be useful, *}\r
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}\r
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}\r
-{* GNU General Public License for more details. *}\r
-{* *}\r
-{* You should have received a copy of the GNU General Public License *}\r
-{* along with this program; if not, write to the Free Software *}\r
-{* Foundation, Inc., *}\r
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}\r
-{* *}\r
-{**************************************************************************}\r
-<?xml version="1.0" encoding="utf-8"?>\r
-<country id="{$smarty.request.mapid}">\r
- <countries>\r
- {foreach from=$countries item="country"}\r
- <country id="{$country.id}" name="{$country.name}">\r
- <file swf="{$country.swf}" scale="{$country.scale}" xclip="{$country.xclip}" yclip="{$country.yclip}">\r
- <color value="{$country.color}"/>\r
- </file>\r
- {if $country.nbPop > 0 or $country.id eq 0}\r
- <map x="{$country.x}" y="{$country.y}" height="{$country.height}" width="{$country.width}" ratio="{$country.rat}"/>\r
- <icon x="{$country.xPop}" y="{$country.yPop}" nb="{$country.nbPop}" size="{$country.rad}" name="{$country.name}" green="{if $country.nbPop}{$country.yellow/$country.nbPop}{else}0{/if}" blue="0" alpha="0.7"/>\r
- <moreinfos url="country{$plset_search|escape_html}mapid={$country.id}"/>\r
- {/if}\r
- </country>\r
- {/foreach}\r
- </countries>\r
- <cities>\r
- {foreach from=$cities item="city"}\r
- <city id="{$city.id}" name="{$city.name}">\r
- <icon x="{$city.x}" y="{$city.y}" nb="{$city.pop}" size="{$city.size}" name="{$city.name}" green="{if $city.pop}{$city.yellow/$city.pop}{else}0{/if}" blue="0"/>\r
- <moreinfos url="city{$plset_search|escape_html}cityid={$city.id}"/>\r
- </city>\r
- {/foreach}\r
- </cities>\r
-</country>\r
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}\r
{* *}
{**************************************************************************}
-<input type="hidden" name="{$name}[changed]" value="0"/>
-{if $adr.geoloc}
-<div class="erreur" id="{$id}_geoloc_error">
- La geolocalisation n'a pas donné un résultat certain, valide la nouvelle adresse
- ou modifie l'ancienne pour que ton adresse puisse être prise en compte.
+{if $address.geoloc}
+<div class="erreur center {$prefid}_geoloc">
+ Le géocodage n'a pas donné un résultat certain ! Tu as le choix entre :
+</div>
+<div class="{$prefid}_geoloc">
+ <ul>
+ <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 0)" style="color: red">ton adresse (à gauche)</a> ;</li>
+ <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 1)" style="color: green">notre suggestion (à droite)</a> ;</li>
+ <li><a href="javascript:validGeoloc('{$prefid}', '{$id}', 2)"
+ title="Garder le texte de l'adresse que tu as renseignée tout en utilisant les informations trouvées par le géocodage pour te localiser sur le planisphère et dans lors d'une recherche dans l'annuaire.">
+ le texte de ton adresse localisé à l'endroit que nous te suggérons</a>.</li>
+ </ul>
</div>
-<script type="text/javascript">setTimeout("document.location += '#{$adid}'", 10);</script>
{/if}
+
<div>
-<textarea name="{$name}[text]" cols="30" rows="4"
- onchange="form['{$name}[changed]'].value=1"
- {if !$adr.cityid && $adr.datemaj}class="error"{/if}
- >{$adr.text}</textarea>
-{if $adr.geoloc}
-<span id="{$id}_geoloc">
-<textarea cols="30" rows="4"
- class="valid"
- name="{$name}[geoloc]"
- onclick="blur()"
- >{$adr.geoloc}</textarea>
-<input type="hidden" name="{$name}[geoloc_cityid]" value="{$adr.geoloc_cityid}" />
-<input type="hidden" name="{$name}[parsevalid]" value="0" />
-</span>
-</div>
-<div class="center" id="{$id}_geoloc_valid">
- <a href="javascript:validAddress('{$id}', '{$name}')">Valider ta version</a>
- •
- <a href="javascript:validGeoloc('{$id}', '{$name}')">Valider la version géolocalisée</a>
+ <textarea name="{$prefname}[text]" cols="30" rows="4" onkeyup="addressChanged('{$prefid}')"
+ {if $address.geoloc}class="error"{/if}>{$address.text}</textarea>
+{if $address.geoloc}
+ <textarea cols="30" rows="4" class="valid {$prefid}_geoloc"
+ name="{$prefname}[geoloc]">{$address.geoloc}</textarea>
{/if}
</div>
-<input type="hidden" name="{$name}[cityid]" value="{$adr.cityid}" />
-<input type="hidden" name="{$name}[adr1]" value="{$adr.adr1}" />
-<input type="hidden" name="{$name}[adr2]" value="{$adr.adr2}" />
-<input type="hidden" name="{$name}[adr3]" value="{$adr.adr3}" />
-<input type="hidden" name="{$name}[postcode]" value="{$adr.postcode}"/>
-<input type="hidden" name="{$name}[city]" value="{$adr.city}" />
-<input type="hidden" name="{$name}[country]" value="{$adr.country|default:'00'}" />
-<input type="hidden" name="{$name}[countrytxt]" value="{$adr.countrytxt}" />
-<input type="hidden" name="{$name}[region]" value="{$adr.region}" />
-<input type="hidden" name="{$name}[regiontxt]" value="{$adr.regiontxt}" />
-<input type="hidden" name="{$name}[checked]" value="{$adr.checked}" />
-<input type="hidden" name="{$name}[precise_lat]" value="{$adr.precise_lat}" />
-<input type="hidden" name="{$name}[precise_lon]" value="{$adr.precise_lon}" />
+{if $address.geoloc}
+<input type="hidden" name="{$prefname}[geoloc_choice]" value="1" />
+<input type="hidden" name="{$prefname}[geoloc]" value="{$address.geoloc}" />
+<input type="hidden" name="{$prefname}[geocodedPostalText]" value="{$address.geocodedPostalText}" />
+<input type="hidden" name="{$prefname}[updateTime]" value="{$address.updateTime}" />
+{/if}
+<input type="hidden" name="{$prefname}[accuracy]" value="{$address.accuracy}" />
+<input type="hidden" name="{$prefname}[postalText]" value="{$address.postalText}" />
+<input type="hidden" name="{$prefname}[postalCode]" value="{$address.postalCode}" />
+<input type="hidden" name="{$prefname}[administrativeAreaId]" value="{$address.administrativeAreaId}" />
+<input type="hidden" name="{$prefname}[subAdministrativeAreaId]" value="{$address.subAdministrativeAreaId}" />
+<input type="hidden" name="{$prefname}[localityId]" value="{$address.localityId}" />
+<input type="hidden" name="{$prefname}[countryId]" value="{$address.countryId}" />
+<input type="hidden" name="{$prefname}[latitude]" value="{$address.latitude}" />
+<input type="hidden" name="{$prefname}[longitude]" value="{$address.longitude}" />
+<input type="hidden" name="{$prefname}[north]" value="{$address.north}" />
+<input type="hidden" name="{$prefname}[south]" value="{$address.south}" />
+<input type="hidden" name="{$prefname}[east]" value="{$address.east}" />
+<input type="hidden" name="{$prefname}[west]" value="{$address.west}" />
+<input type="hidden" name="{$prefname}[cedex]" value="{$address.cedex}" />
+<input type="hidden" name="{$prefname}[updateTime]" value="{$address.updateTime}" />
+<input type="hidden" name="{$prefname}[changed]" value="0" />
+<input type="hidden" name="{$prefname}[removed]" value="0" />
+
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+{assign var=new value="new"|cat:$i}
+{assign var=combobox value="combobox"|cat:$i}
+<tr {if $class}class="{$class}"{/if}>
+ <td class="titre">
+ {if $name eq "email_directory"}
+ Email annuaire AX
+ {elseif $name eq "email"}
+ Ajouter une adresse email
+ {else}
+ Email professionnel
+ {/if}
+ </td>
+ {if $name eq "email"}<td></td>{/if}
+ <td>
+ {if $name neq "email"}<div style="float: left">{/if}
+ <select name="{$name}" id="{$combobox}">
+ {if $email_type eq "directory"}
+ <optgroup label="Email annuaire AX">
+ <option value="{$email_directory}" {if
+ $val eq $email_directory}selected="selected"{/if}>{$email_directory}</option>
+ </optgroup>
+ {/if}
+ {if $name eq "email_directory"}
+ <optgroup label="Emails polytechniciens">
+ {if $melix}
+ <option value="{$melix}@{#globals.mail.alias_dom#}" {if
+ $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom#}selected="selected"{/if}>
+ {$melix}@{#globals.mail.alias_dom#}</option>
+ <option value="{$melix}@{#globals.mail.alias_dom2#}" {if
+ $val eq $melix|cat:'@'|cat:#globals.mail.alias_dom2#}selected="selected"{/if}>
+ {$melix}@{#globals.mail.alias_dom2#}</option>
+ {/if}
+ {foreach from=$list_email_X item=email}
+ <option value="{$email.alias}@{#globals.mail.domain#}" {if
+ $val eq $email.alias|cat:'@'|cat:#globals.mail.domain#}selected="selected"{/if}>
+ {$email.alias}@{#globals.mail.domain#}</option>
+ <option value="{$email.alias}@{#globals.mail.domain2#}" {if
+ $val eq $email.alias|cat:'@'|cat:#globals.mail.domain2#}selected="selected"{/if}>
+ {$email.alias}@{#globals.mail.domain2#}</option>
+ {/foreach}
+ </optgroup>
+ {/if}
+ {if (($name neq "email") && ($list_email_redir|@count neq 0))}
+ <optgroup label="Redirections">
+ {foreach from=$list_email_redir item=email}
+ <option value="{$email}" {if $val eq $email}selected="selected"{/if}>{$email}</option>
+ {/foreach}
+ </optgroup>
+ {/if}
+ {if $list_email_pro|@count neq 0}
+ <optgroup label="Emails professionels">
+ {foreach from=$list_email_pro item=email}
+ <option value="{$email}" {if
+ $val eq $email}selected="selected"{/if}>{$email}</option>
+ {/foreach}
+ </optgroup>
+ {/if}
+ <optgroup label="Autres choix">
+ <option value="new@example.org" {if $error}selected="selected"{/if}>Utiliser une autre adresse email</option>
+ <option value="" {if (($val eq '') && (!$error))}selected="selected"{/if}>{if
+ $name neq "email"}Ne pas mettre d'adresse email{else} {/if}</option>
+ </optgroup>
+ </select>
+ {if $name neq "email"}
+ </div>
+ <div style="float: right" class="flags">
+ {if $name eq "email_directory"}
+ <input type="checkbox" disabled="disabled" checked="checked"/>
+ {icon name="flag_orange" title="Visible sur l'annuaire"}
+ {elseif $name neq "email"}
+ {include file="include/flags.radio.tpl" name="`$jobpref`[`$prefix`email_pub]" val=$pub}
+ {/if}
+ </div>
+ {/if}
+ </td>
+ {if $name eq "email"}<td></td>{/if}
+</tr>
+<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
+ <td></td>
+ {if $name eq "email"}<td></td>{/if}
+ <td>
+ <span class="{$new}" style="display: none">
+ <input type="text" maxlength="60" {if $error}class="error" value="{$val}"{/if} name="{if (($name neq "email_directory")
+ && ($name neq "email"))}jobs[{$i}][{$prefix}email_new]{else}{$name}_new{/if}"/>
+ </span>
+ <script type="text/javascript">//<![CDATA[
+ {literal}
+ $(function() {
+ var i = {/literal}{$i}{literal};
+ $('select#combobox' + i).change(function() {
+ $('.new' + i).hide();
+ if ($('select#combobox' + i).val() == "new@example.org") {
+ $('.new' + i).show();
+ }
+ }).change();
+ });
+ {/literal}
+ // ]]></script>
+ </td>
+ {if $name eq "email"}<td></td>{/if}
+</tr>
+{if $name neq "email"}
+<tr {if $class}class="{$class} {$new}"{else}class="{$new}"{/if} style="display: none">
+ <td colspan="2">
+ <small><strong><em>Attention :</em></strong> cette adresse email figurera dans
+ {if $name eq "email_directory"}l'annuaire papier{else}tes informations professionnelles
+ {/if} mais n'est pas ajoutée à la liste de tes redirections. Nous te conseillons fortement de
+ <strong><a href="emails/redirect">l'ajouter là</a></strong>, surtout
+ si tu n'en as plus de valide.</small>
+ </td>
+</tr>
+{/if}
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
{* *}
{**************************************************************************}
-{if $address.entreprise || $address.secteur || $address.fonction ||
+{if $address.entreprise || $address.sector || $address.fonction ||
$address.poste || $address.fonction || $address.email || $address.web}
<div class="adresse" style="float: left">
<table>
{if $address.entreprise || $address.web}
<tr>
<td><em>Ent/Org : </em></td>
- <td><strong>{$address.entreprise}{if $address.web} [<a href='{$address.web}'>site</a>]{/if}</strong></td>
+ <td><strong>{if $address.web}<a href='{$address.web}'>{$address.entreprise}</a>{$address.entreprise}{else}{$address.entreprise}{/if}
+ {if $address.w_web} [<a href='{$address.w_web}'>Page perso</a>]{/if}</strong></td>
</tr>
{/if}
- {if $address.secteur}
+ {if $address.sector}
<tr>
<td><em>Secteur : </em></td>
- <td><strong>{$address.secteur}{if $address.ss_secteur} ({$address.ss_secteur}){/if}</strong></td>
+ <td><strong>{$address.sector}{if $address.subSector} ({$address.subSector}){/if}</strong></td>
</tr>
{/if}
{* *}
{**************************************************************************}
-<script type="text/javascript">//<![CDATA[
+<script type="text/javascript">//<![CDATA[
var prefix = "{$prefix}";
- {literal}
- function updateRange()
- {
- var range = document.getElementById(prefix + 'promo_range');
- min = document.getElementById(prefix + 'promo_min').value;
- max = document.getElementById(prefix + 'promo_max').value;
- if (isNaN(min) || (min != 0 && (min < 1900 || min > 2020))) {
+ {literal}
+ function updateRange()
+ {
+ var range = document.getElementById(prefix + 'promo_range');
+ min = document.getElementById(prefix + 'promo_min').value;
+ max = document.getElementById(prefix + 'promo_max').value;
+ if (isNaN(min) || (min != 0 && (min < 1900 || min > 2020))) {
range.innerHTML = '<span class="erreur">La promotion minimum n\'est pas valide.</span>';
- return false;
- } else if (isNaN(max) || (max != 0 && (max < 1900 || max > 2020))) {
+ return false;
+ } else if (isNaN(max) || (max != 0 && (max < 1900 || max > 2020))) {
range.innerHTML = '<span class="erreur">La promotion maximum n\'est pas valide.</span>';
- return false;
- } else if (max != 0 && min != 0 && max < min) {
+ return false;
+ } else if (max != 0 && min != 0 && max < min) {
range.innerHTML = '<span class="erreur">L\'intervalle de promotion est inversé.</span>';
- return false;
- } else if (max == 0 && min == 0) {
+ return false;
+ } else if (max == 0 && min == 0) {
range.innerHTML = 'L\'annonce est destinée à toutes les promotions.';
- } else if (max == 0) {
+ } else if (max == 0) {
range.innerHTML = 'L\'annonce est destinée aux promotions plus jeunes que ' + min + ' (incluse).';
- } else if (min == 0) {
+ } else if (min == 0) {
range.innerHTML = "L\'annonce est destinée aux promotions plus anciennes que " + max + ' (incluse).';
} else if (min == max - 1) {
range.innerHTML = "L\'annonce est destinée aux promotions " + min + " et " + max + ".";
} else if (min == max) {
range.innerHTML = "L\'annonce est destinée à la promotion " + min + ".";
- } else {
+ } else {
range.innerHTML = "L\'annonce est destinée aux promotions de " + min + " à " + max + ' (incluses).';
}
- return true;
+ return true;
}
- {/literal}
-//]]></script>
+ {/literal}
+//]]></script>
{if $full}
<table class="bicol">
{/if}
- <tr id="{$prefix}promo_min_tr" class="impair">
- <td class="titre">Promotion la plus ancienne</td>
- <td>
+ <tr id="{$prefix}promo_min_tr" class="impair">
+ <td class="titre">Promotion la plus ancienne</td>
+ <td>
<input type="text" name="{$min_field_name|default:"promo_min"}" id="{$prefix}promo_min"
- size="4" maxlength="4" value="{$promo_min|default:0}"
- onkeyup="return updateRange();" onchange="return updateRange();" /> incluse
- <span class="smaller">(ex : 1980)</span>
- </td>
- </tr>
- <tr id="{$prefix}promo_max_tr" class="impair">
- <td class="titre">Promotion la plus jeune</td>
- <td>
+ size="4" maxlength="4" value="{$promo_min|default:0}"
+ onkeyup="return updateRange();" onchange="return updateRange();" /> incluse
+ <span class="smaller">(ex : 1980)</span>
+ </td>
+ </tr>
+ <tr id="{$prefix}promo_max_tr" class="impair">
+ <td class="titre">Promotion la plus jeune</td>
+ <td>
<input type="text" name="{$max_field_name|default:"promo_max"}" id="{$prefix}promo_max"
- size="4" maxlength="4" value="{$promo_max|default:0}"
- onkeyup="return updateRange();" onchange="return updateRange();" /> incluse
- <span class="smaller">(ex : 2000)</span>
- </td>
- </tr>
- <tr id="{$prefix}promo_range_tr" class="impair">
- <td colspan="2" id="promo_range" class="smaller">
- <script type="text/javascript">updateRange();</script>
- </td>
- </tr>
+ size="4" maxlength="4" value="{$promo_max|default:0}"
+ onkeyup="return updateRange();" onchange="return updateRange();" /> incluse
+ <span class="smaller">(ex : 2000)</span>
+ </td>
+ </tr>
+ <tr id="{$prefix}promo_range_tr" class="impair">
+ <td colspan="2" id="promo_range" class="smaller">
+ <script type="text/javascript">updateRange();</script>
+ </td>
+ </tr>
{if $full}
</table>
{/if}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<strong>Nom :</strong>
+<input type="text" name="name" size="25" maxlength="200" value="{$valid->name}" /><br />
+<strong>Acronyme :</strong>
+<input type="text" name="acronym" size="25" maxlength="200" value="{$valid->acronym}" /><br />
+<strong>Site web :</strong>
+<input type="text" name="url" size="25" maxlength="200" value="{$valid->url}" /><br />
+<strong>Email :</strong>
+<input type="text" name="url" size="25" maxlength="200" value="{$valid->email}" /><br />
+<strong>Holding :</strong>
+<input type="text" name="holdingid" size="25" maxlength="200" value="{$valid->holdingid}" /><br />
+<strong>Code NAF :</strong>
+<input type="text" name="NAF_code" size="25" maxlength="200" value="{$valid->NAF_code}" /><br />
+<strong>Code AX :</strong>
+<input type="text" name="AX_code" size="25" maxlength="200" value="{$valid->AX_code}" /><br />
+<strong>Adresse :</strong>
+<textarea cols="30" rows="4" name="address">{$valid->address}</textarea><br />
+<strong>Téléphone :</strong>
+<input type="text" name="tel" size="25" maxlength="200" value="{$valid->tel}" /><br />
+<strong>Fax :</strong>
+<input type="text" name="fax" size="25" maxlength="200" value="{$valid->fax}" /><br />
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+
+<tr class="pair">
+ <td class="titre">Nom :</td>
+ <td>{$valid->name}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Noms similaires existants :</td>
+ <td>{$valid->suggestions}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Acronyme :</td>
+ <td>{$valid->acronym}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Site web :</td>
+ <td>{$valid->url}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Email :</td>
+ <td>{$valid->email}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Holding :</td>
+ <td>{$valid->holdingid}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Code NAF :</td>
+ <td>{$valid->NAF_code}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Code AX :</td>
+ <td>{$valid->AX_code}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Adresse :</td>
+ <td>{$valid->address}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Téléphone :</td>
+ <td>{$valid->tel}</td>
+</tr>
+<tr class="pair">
+ <td class="titre">Fax :</td>
+ <td>{$valid->fax}</td>
+</tr>
+<tr class="pair">
+ <td colspan="2" class="center">
+ <small>Bien remplir tous les champs, en particulier les <a href="http://societe.com/">codes NAF</a> et AX !</small>
+ </td>
+</tr>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<tr class="impair">
- <td class="titre">Nom d'usage :</td>
- <td>{$valid->nom_usage}</td>
+ <td class="titre">Ancien alias :</td>
+ <td>{$valid->old_alias}</td>
</tr>
<tr class="impair">
- <td class="titre">Nouvel alias :</td>
- <td>{$valid->alias|default:"<span class='erreur'>suppression</span>"}</td>
+ <td class="titre">Nouvel alias :</td>
+ <td>{$valid->new_alias}</td>
</tr>
+{foreach from=$valid->sn_new item=sn key=typeid}
<tr class="impair">
- <td class="titre">Raison :</td>
- <td>{$valid->reason}</td>
+ <td class="titre">*{$valid->sn_types.$typeid} :</td>
+ <td>{$sn.name}</td>
</tr>
-{if $valid->homonyme}
+{/foreach}
+{foreach from=$valid->sn_old item=sn key=typeid}
<tr class="impair">
- <td colspan="2">
- <span class="erreur">Probleme d'homonymie !
- <a href="profile/{$valid->homonyme}" class="popup2">{$valid->homonyme}</a>
- </span>
+ <td class="titre">†{$valid->sn_types.$typeid} :</td>
+ <td>{$sn.name}</td>
+</tr>
+{/foreach}
+<tr class="impair">
+ <td class="center" colspan="2">
+ <span class="smaller">* nouveau nom ; † ancien nom</span>
</td>
</tr>
-{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<tr class="impair">
<td class="titre">Promotion :</td>
- <td>{$valid->user->promo()}</td>
+ <td>{$valid->entryYear}</td>
</tr>
<tr class="impair">
<td class="titre">Année de sortie :</td>
- <td>{$valid->promo_sortie} au lieu de {math equation="a + b" a=$valid->user->promo() b=3}</td>
+ <td>{$valid->newGradYear} au lieu de {$valid->oldGradYear}</td>
</tr>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{if $smarty.session.auth ge AUTH_COOKIE}
<div class="photo">
<img src="photo/{$c.hruid}"
- alt="{$c.prenom} {$c.nom}" />
+ alt="{$c.name_display}" />
</div>
{/if}
<div class="nom">
{if $c.sexe}•{/if}
{if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}<a href="profile/{$c.hruid}" class="popup2">{/if}
- {if $c.nom_usage}{$c.nom_usage} {$c.prenom}<br />({$c.nom}){else}{$c.nom} {$c.prenom}{/if}
+ <span {if $c.name_tooltip}class="hinted" title="{$c.name_tooltip}"{/if}>{$c.name_display}</span>
{if !$c.dcd && ($c.inscrit || $smarty.session.auth eq AUTH_PUBLIC)}</a>{/if}
</div>
- <div class="appli">
- {if $c.iso3166}
- <img src='images/flags/{$c.iso3166}.gif' alt='{$c.nat}' height='11' title='{$c.nat}' />
+ <div class="edu">
+ {if $c.iso3166_1}
+ <img src='images/flags/{$c.iso3166_1}.gif' alt='{$c.nat1}' height='11' title='{$c.nat1}' />
{/if}
- X {$c.promo}{if $c.app0text}, {applis_fmt type=$c.app0type text=$c.app0text url=$c.app0url}{*
- *}{/if}{if $c.app1text}, {applis_fmt type=$c.app1type text=$c.app1text url=$c.app1url}{/if}{*
- *}{if $c.dcd}, décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
+ {if $c.iso3166_2}
+ <img src='images/flags/{$c.iso3166_2}.gif' alt='{$c.nat2}' height='11' title='{$c.nat2}' />
+ {/if}
+ {if $c.iso3166_3}
+ <img src='images/flags/{$c.iso3166_3}.gif' alt='{$c.nat3}' height='11' title='{$c.nat3}' />
+ {/if}
+ {$c.promo_display}{if $c.eduname0}, {education_fmt name=$c.eduname0 url=$c.eduurl0 degree=$c.edudegree0
+ grad_year=$c.edugrad_year0 field=$c.edufield0 program=$c.eduprogram0 sexe=$c.sexe}{*
+ *}{/if}{if $c.eduname1}, {education_fmt name=$c.eduname1 url=$c.eduurl1 degree=$c.edudegree1
+ grad_year=$c.edugrad_year1 field=$c.edufield1 program=$c.eduprogram1 sexe=$c.sexe}{*
+ *}{/if}{if $c.eduname2}, {education_fmt name=$c.eduname2 url=$c.eduurl2 degree=$c.edudegree2
+ grad_year=$c.edugrad_year2 field=$c.edufield2 program=$c.eduprogram2 sexe=$c.sexe}{*
+ *}{/if}{if $c.eduname3}, {education_fmt name=$c.eduname3 url=$c.eduurl3 degree=$c.edudegree3
+ grad_year=$c.edugrad_year3 field=$c.edufield3 program=$c.eduprogram3 sexe=$c.sexe}{*
+ *}{/if}{if $c.dcd}, décédé{if $c.sexe}e{/if} le {$c.deces|date_format}{/if}
</div>
</div>
<td class="lt">Profession :</td>
<td class="rt">
{if $c.job_web}<a href="{$c.job_web}">{$c.entreprise}</a>{else}{$c.entreprise}{/if}
- {if $c.secteur} ({$c.secteur}){/if}{if $c.fonction}<br />{$c.fonction}{/if}
+ {if $c.sector} ({$c.sector}){/if}{if $c.fonction}<br />{$c.fonction}{/if}
</td>
</tr>
{/if}
+++ /dev/null
-{**************************************************************************}
-{* *}
-{* Copyright (C) 2003-2009 Polytechnique.org *}
-{* http://opensource.polytechnique.org/ *}
-{* *}
-{* This program is free software; you can redistribute it and/or modify *}
-{* it under the terms of the GNU General Public License as published by *}
-{* the Free Software Foundation; either version 2 of the License, or *}
-{* (at your option) any later version. *}
-{* *}
-{* This program is distributed in the hope that it will be useful, *}
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
-{* GNU General Public License for more details. *}
-{* *}
-{* You should have received a copy of the GNU General Public License *}
-{* along with this program; if not, write to the Free Software *}
-{* Foundation, Inc., *}
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
-{* *}
-{**************************************************************************}
-
-<script type="text/javascript">//<![CDATA[
-{literal}
-function ficheXorg(id)
-{
- window.open('{/literal}{if !$annu}https://{#globals.core.secure_domain#}/{/if}{literal}profile/'+id,'_blank','toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=840,height=600');
-}
-{/literal}
-{if $annu}
-var search_url = platal_baseurl + "{$platal->ns}{$annu}{$plset_search|smarty:nodefaults}";
-{literal}
-function clickOnCity(id)
-{
- window.open(search_url + unescape('%26')+'cityid=' + id, '_blank', '');
-}
-var mapid = 0;
-function goToCountry(id)
-{
- mapid = id;
-}
-function searchMapId()
-{
- window.open(search_url + unescape('%26')+'mapid=' + mapid, '_blank', '');
-}
-{/literal}
-{/if}
-
-//]]></script>
-
-{if !$request_geodesix}
-
- <p class="center">
- {if $smarty.request.only_current neq 'on'}
- [<a href="{$platal->ns}{$plset_base}/geoloc{$plset_search}only_current=on">Ne voir que les adresses principales</a>]
- {else}
- [<a href="{$platal->ns}{$plset_base}/geoloc{$plset_search|replace:'only_current=on':''}">Voir toutes les adresses</a>]
- {/if}
- </p>
-
- <p class="center">
- <object
- type="application/x-shockwave-flash"
- data="{$platal->ns}{$plset_base}/geoloc/dynamap.swf"
- width="600"
- height="450">
- <param name="movie" value="{$platal->ns}{$plset_base}/geoloc/dynamap.swf"/>
- <param name="wmode" value="transparent"/>
- <param name="flashvars" value="initfile=init{$plset_search_enc}"/>
- </object>
- </p>
- {if $annu}
- <p class="center">
- <a href="javascript:searchMapId()">Lister les X présents sur cette carte</a>
- </p>
- {/if}
- <p class="smaller">Carte fournie gracieusement par <a href="http://www.geodesix.com/">Geodesix</a>.</p>
-{else}
- <p>Le moteur de carte n'a pas été installé sur cette version de plat/al. Veuillez contacter <a href="http://www.geodesix.com/">Geodesix</a>.</p>
-{/if}
-<p class="descr">Pour toute question, problème ou suggestion tu peux envoyer un email à
-<a href="mailto:{#globals.geoloc.email#}">{#globals.geoloc.email#}</a>.</p>
-
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{**************************************************************************}
<div class="contact-list" style="clear: both">
-{foreach from=$set item=p}
- <div class="contact">
- <div class="nom">
- {$p.nom} {$p.prenom}
- </div>
- <div class="appli">
- X{$p.promo}
- </div>
- <div class="bits" style="width: 40%;">
- <span class='smaller'>
+{foreach from=$set item=p}
+ <div class="contact">
+ <div class="nom">
+ <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>
+ </div>
+ <div class="edu">
+ {$p.promo_display}
+ </div>
+ <div class="bits" style="width: 40%;">
+ <span class='smaller'>
<a href="profile/{$p.hruid}" class="popup2">
- {icon name=user_suit title="Voir sa fiche"}</a> -
+ {icon name=user_suit title="Voir sa fiche"}</a> -
<a href="referent/{$p.hruid}" class="popup2">Voir sa fiche référent</a>
- </span>
- </div>
- <div class="long">
- <table cellspacing="0" cellpadding="0">
- <tr>
- <td class="lt">Expertise :</td>
- <td class="rt" colspan="2">{$p.expertise|nl2br}</td>
- </tr>
- </table>
- </div>
- </div>
+ </span>
+ </div>
+ <div class="long">
+ <table cellspacing="0" cellpadding="0">
+ <tr>
+ <td class="lt">Expertise :</td>
+ <td class="rt" colspan="2">{$p.expertise|nl2br}</td>
+ </tr>
+ </table>
+ </div>
+ </div>
{/foreach}
</div>
<tr>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
<a href="{$mainsiteurl}profile/{$set[trombi.index_prev].hruid}" class="popup2">
- {$set[trombi.index_prev].prenom} {$set[trombi.index_prev].nom}{if $trombi_with_promo} ({$set[trombi.index_prev].promo}){/if}
+ <span {if $set[trombi.index_prev].name_tooltip}class="hinted"
+ title="{$set[trombi.index_prev].name_tooltip}"{/if}>{$set[trombi.index_prev].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_prev].promo_display}){/if}
</a>
</td>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
<a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
- {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+ <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
</a>
</td>
<td class="center" style="vertical-align: bottom; padding-bottom: 15px">
{if $set[trombi.index_next]}
<a href="{$mainsiteurl}profile/{$set[trombi.index_next].hruid}" class="popup2">
- {$set[trombi.index_next].prenom} {$set[trombi.index_next].nom}{if $trombi_with_promo} ({$set[trombi.index_next].promo}){/if}
+ <span {if $set[trombi.index_next].name_tooltip}class="hinted" title="{$set[trombi.index_next].name_tooltip}"{/if}>{$set[trombi.index_next].name_display}</span>{if $trombi_with_promo} ({$set[trombi.index_next].promo_display}){/if}
</a>
{/if}
</td>
<tr style="margin-top: 0; padding-top: 0">
<td class="center" style="vertical-align: bottom">
<a href="{$mainsiteurl}profile/{$set[trombi].hruid}" class="popup2">
- {$set[trombi].prenom} {$set[trombi].nom}{if $trombi_with_promo} ({$set[trombi].promo}){/if}
+ <a href="{$mainsiteurl}profile/{$set[trombi].forlife}" class="popup2">
+ <span {if $set[trombi].name_tooltip}class="hinted" title="{$set[trombi].name_tooltip}"{/if}>{$set[trombi].name_display}</span>{if $trombi_with_promo} ({$set[trombi].promo_display}){/if}
</a>
</td>
<td></td><td></td>
{/if}
<br />
<a href="{if $urlmainsite}{$urlmainsite}{/if}profile/{$p.forlife}" class="popup2">
- {$p.prenom} {$p.nom}{if $trombi_show_promo} ({$p.promo}){/if}
+ <span {if $p.name_tooltip}class="hinted" title="{$p.name_tooltip}"{/if}>{$p.name_display}</span>{if $trombi_show_promo} ({$p.promo_display}){/if}
</a>
</td>
{if $loop eq "3"}
{iterate from=$addr item=a}
<tr class="{cycle values='impair,pair'}">
<td>{$a.email}</td>
- <td>{if $a.alias}<a href="profile/{$a.alias}" class="popup2">{$a.alias}</a> {if $a.type eq user}(*){/if}{/if}</td>
+ <td>
+ {if $a.alias neq ''}<a href="profile/{$a.alias}" class="popup2">{$a.alias}</a>
+ {if $a.type eq user}(*){/if}{else}Email connu de l'AX{/if}
+ </td>
<td>{$a.date|date_format|default:'-'}</td>
<td>{$a.last|date_format|default:'-'}</td>
<td class='center'>{$a.nb|default:"-"}</td>
{xsrf_token_field}
<table class="bicol">
<tr class="pair">
- <th colspan="2">Edition de l'email de relance</th>
+ <th colspan="2">Édition de l'email de relance</th>
</tr>
<tr class="pair">
<td align="right"><strong>From :</strong></td>
<table class="bicol" cellpadding="3" cellspacing="0">
<tr>
<td>
- Créer un nouvel article ...
+ Créer un nouvel article...
</td>
<td style='vertical-align:middle; border-left: 1px gray solid' class="center">
<a href="admin/newsletter/edit/{$nl->_id}/new#edit">{icon name=add title="créer"}</a>
[<a href="admin/newsletter/edit/{$nl->_id}">retour</a>]
</p>
-{if !$art->check()}<p class='erreur'>article trop long !</p>{/if}
<table class='bicol'>
<tr><th>Version texte</th></tr>
<tr id='text'>
<strong>Mot de passe enregistré le {$smarty.now|date_format}</strong>
</p>
<p>
- <strong>Attention!</strong> Il est crypté irréversiblement,
+ <strong>Attention !</strong> Il est crypté irréversiblement,
donc <strong>non récupérable</strong>. Pour retrouver un accès au site
consécutivement à une perte de mot de passe, la procédure
est longue et laborieuse...
{* *}
{**************************************************************************}
-{assign var=adpref value="addresses[$i]"}
-{assign var=adid value="addresses_$i"}
-<input type="hidden" name="{$adpref}[removed]" value="0"/>
-<input type="hidden" name="{$adpref}[datemaj]" value="{$adr.datemaj}"/>
-<table class="bicol" style="display: none; margin-bottom: 1em" id="{$adid}_grayed">
+{assign var=prefname value="addresses[$i]"}
+{assign var=prefid value="addresses_$i"}
+<table class="bicol" style="display: none; margin-bottom: 1em" id="{$prefid}_grayed">
<tr>
<th class="grayed">
<div style="float: right">
- <a href="javascript:restoreAddress('{$adid}', '{$adpref}')">{icon name=arrow_refresh title="Restaurer l'adresse"}</a>
+ <a href="javascript:toggleAddress('{$i}', 0)">{icon name=arrow_refresh title="Restaurer l'adresse"}</a>
</div>
Restaurer l'adresse n°{$i+1}
</th>
</tr>
</table>
-<table class="bicol" style="margin-bottom: 1em" id="{$adid}">
+<table class="bicol" style="margin-bottom: 1em" id="{$prefid}">
<tr>
<th>
<div style="float: left">
- <input name="{$adpref}[current]" type="radio" value="1" {if $adr.current}checked="checked"{/if}
- id="{$adid}_current" onchange="checkCurrentAddress(this); return true" />
- <label for="{$adid}_current" class="smaller" style="font-weight: normal">actuelle</label>
+ <label>
+ <input name="{$prefname}[current]" type="radio" {if $address.current}checked="checked"{/if}
+ onchange="checkCurrentAddress({$i})" />
+ <span class="smaller" style="font-weight: normal">actuelle</span>
+ </label>
</div>
<div style="float: right">
- <a href="javascript:removeAddress('{$adid}', '{$adpref}')">{icon name=cross title="Supprimer l'adresse"}</a>
+ <a href="javascript:toggleAddress('{$i}', 1)">
+ {icon name=cross title="Supprimer l'adresse"}
+ </a>
</div>
Adresse n°{$i+1}
</th>
<tr>
<td>
<div style="margin-bottom: 0.2em" class="flags">
- {include file="include/flags.radio.tpl" name="`$adpref`[pub]" val=$adr.pub}
+ {include file="include/flags.radio.tpl" name="`$prefname`[pub]" val=$address.pub}
</div>
<div style="clear: both"></div>
- <div style="float: left">{include file="geoloc/form.address.tpl" name=$adpref id=$adid adr=$adr}</div>
<div style="float: left">
+ {include file="geoloc/form.address.tpl" prefname=$prefname prefid=$prefid address=$address id=$i}
+ </div>
+ <div style="float: left">
+ <div>
+ <label>
+ <input type="radio" name="{$prefname}[temporary]" value="0"
+ {if !$address.temporary}checked="checked"{/if} />
+ permanente
+ </label>
+ <label>
+ <input type="radio" name="{$prefname}[temporary]" value="1"
+ {if $address.temporary}checked="checked"{/if} />
+ temporaire
+ </label>
+ </div>
<div>
- <input type="radio" name="{$adpref}[temporary]" id="{$adid}_temp_0" value="0"
- {if !$adr.temporary}checked="checked"{/if} /><label for="{$adid}_temp_0">permanente</label>
- <input type="radio" name="{$adpref}[temporary]" id="{$adid}_temp_1" value="1"
- {if $adr.temporary}checked="checked"{/if} /><label for="{$adid}_temp_1">temporaire</label>
+ <label>
+ <input type="radio" name="{$prefname}[secondary]" value="0"
+ {if !$address.secondary}checked="checked"{/if} />
+ ma résidence principale
+ </label>
+ <label>
+ <input type="radio" name="{$prefname}[secondary]" value="1"
+ {if $address.secondary}checked="checked"{/if} />
+ une résidence secondaire
+ </label>
</div>
<div>
- <input type="radio" name="{$adpref}[secondaire]" id="{$adid}_sec_0" value="0"
- {if !$adr.secondaire}checked="checked"{/if} /><label for="{$adid}_sec_0">ma résidence principale</label>
- <input type="radio" name="{$adpref}[secondaire]" id="{$adid}_sec_1" value="1"
- {if $adr.secondaire}checked="checked"{/if} /><label for="{$adid}_sec_1">une résidence secondaire</label>
+ <label>
+ <input type="checkbox" name="{$prefname}[mail]" {if $address.mail}checked="checked"{/if} />
+ on peut m'y envoyer du courrier par la poste
+ </label>
</div>
<div>
- <input type="checkbox" name="{$adpref}[mail]" id="{$adid}_mail"
- {if $adr.mail}checked="checked"{/if} />
- <label for="{$adid}_mail">on peut m'y envoyer du courrier par la poste</label>
+ <label>
+ Commentaire :
+ <input type="text" size="35" maxlength="100"
+ name="{$prefname}[comment]" value="{$address.comment}" />
+ </label>
</div>
</div>
</td>
</tr>
<tr class="pair">
<td>
- {foreach from=$adr.tel key=t item=tel}
- <div id="{"`$adid`_tel_`$t`"}" style="clear: both">
- {include file="profile/adresses.tel.tpl" t=$t tel=$tel}
- </div>
+ {foreach from=$address.tel key=t item=tel}
+ <div id="{"`$prefid`_tel_`$t`"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$prefname`[tel]"
+ prefid="`$prefid`_tel" telid=$t tel=$tel}
+ </div>
{/foreach}
- {if $adr.tel|@count eq 0}
- <div id="{"`$adid`_tel_0"}" style="clear: both">
- {include file="profile/adresses.tel.tpl" t=0 tel=0}
- </div>
+ {if $address.tel|@count eq 0}
+ <div id="{"`$prefid`_tel_0"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$prefname`[tel]" prefid="`$prefid`_tel" telid=0 tel=0}
+ </div>
{/if}
- <div id="{$adid}_add_tel" class="center" style="clear: both">
- <a href="javascript:addTel({$i})">
+ <div id="{$prefid}_tel_add" class="center" style="clear: both; padding-top: 4px">
+ <a href="javascript:addTel('{$prefid}_tel', '{$prefname}[tel]')">
{icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
</a>
</div>
{* *}
{**************************************************************************}
-{foreach key=i item=adr from=$addresses}
+{foreach key=i item=address from=$addresses}
<div id="{"addresses_`$i`_cont"}">
-{include file="profile/adresses.address.tpl" i=$i adr=$adr}
+{include file="profile/adresses.address.tpl" i=$i address=$address}
</div>
{/foreach}
{if $addresses|@count eq 0}
<div id="addresses_0_cont">
-{include file="profile/adresses.address.tpl" i=0 adr=0}
+{include file="profile/adresses.address.tpl" i=0 address=0}
</div>
{/if}
-<div id="add_adr" class="center">
+<div id="add_address" class="center">
<a href="javascript:addAddress()">
{icon name=add title="Ajouter une adresse"} Ajouter une adresse
</a>
{* *}
{**************************************************************************}
-<h1>Geoloc</h1>
-
-<h2>Synchroniser des villes avec geoloc.org</h2>
+educationDegree = new Array({education_degree});
+educationDegreeAll = new Array({education_degree_all});
+educationDegreeName = new Array({education_degree_name});
-{if $nb_missinglat}
-<p>[<a href='admin/geoloc/missinglat'>toutes les villes sans coordonnées ({$nb_missinglat})</a>]</p>
-{/if}
-
-<form action='admin/geoloc' method='post'>
-<p>
-La ville dont l'id est : <input size="6" name="id" />
-</p>
-</form>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<div id="fiche_identite">
<div class="civilite">
<strong>{$user->fullName()}</strong><br />
- <span>X{$user->promo()} - </span> <a href="mailto:{$user->bestEmail()}">{$user->bestEmail()}</a>
+ <span>{$user->promo()} - </span> <a href="mailto:{$user->bestEmail()}">{$user->bestEmail()}</a>
</div>
</div>
<div class="spacer"></div>
- {if $expertise != '' || $secteurs|count || $pays|count }
+ {if $expertise != '' || $sectors|count || $pays|count }
<div id="part">
<h2>Informations de référent :</h2>
{if $expertise}
<span>{$expertise|nl2br}</span>
</div>
{/if}
- {if $secteurs|count}
+ {if $sectors|count}
<div class="rubrique_referent">
<em>Secteurs :</em><br />
<ul>
- {foreach from=$secteurs item="secteur" key="i"}
- <li>{$secteur}{if $ss_secteurs.$i != ''} ({$ss_secteurs.$i}){/if}</li>
+ {foreach from=$sectors item="sector" key="i"}
+ <li>{$sector}{if $subSector.$i != ''} ({$subSector.$i}){/if}</li>
{/foreach}
</ul>
</div>
{* *}
{**************************************************************************}
-applisType = new Array({applis_type});
-applisTypeAll = new Array({applis_type_all});
+{$names}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+{assign var=eduname value="edus[`$eduid`]"}
+<tr class="edu_{$eduid} {$class}">
+ <td colspan="2">
+ <a href="javascript:removeEdu('{$eduid}')">
+ {icon name=cross title="Supprimer cette formation"}
+ </a>
+ <select name="{$eduname}[eduid]" onchange="prepareType('{$eduid}')">
+ {education_options selected=$edu.eduid}
+ </select>
+ </td>
+</tr>
+<tr class="edu_{$eduid} {$class}">
+ <td>
+ <span class="titre">Diplôme :</span>
+ </td>
+ <td>
+ <input type="hidden" name="edu_{$eduid}_tmp" value="{$edu.degreeid}" />
+ <select name="{$eduname}[degreeid]">
+ <option value=""></option>
+ </select>
+ </td>
+</tr>
+<tr class="edu_{$eduid} {$class}">
+ <td>
+ <span class="titre">Domaine de formation :</span>
+ </td>
+ <td>
+ <select name="{$eduname}[fieldid]">
+ {foreach from=$edu_fields item=field}
+ <option value="{$field.id}" {if $field.id eq $edu.fieldid}selected="selected"{/if}>{$field.field}</option>
+ {/foreach}
+ </select>
+ </td>
+</tr>
+<tr class="edu_{$eduid} {$class}">
+ <td>
+ <span class="titre">Année d'obtention du diplôme :</span>
+ </td>
+ <td>
+ <input type="text" {if $edu.error}class="error"{/if} name="{$eduname}[grad_year]"
+ value="{$edu.grad_year}" size="4" maxlength="4" />
+ <small>(par exemple : 2008)</small>
+ </td>
+</tr>
+<tr class="edu_{$eduid} {$class}">
+ <td>
+ <span class="titre">Intitulé de la formation :</span>
+ </td>
+ <td>
+ <input type="text" name="{$eduname}[program]" value="{$edu.program}" size="30" maxlength="255" />
+ </td>
+</tr>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<tr id="networking_{$i}">
+ <td colspan="2">
+ <div style="float: left; width: 200px;">
+ <span class="flags">
+ <label><input type="checkbox"
+ {if $nw.pub neq 'private'} checked="checked"{/if}
+ name="networking[{$i}][pub]"/>
+ {icon name="flag_green" title="site public"}</label>
+ </span>
+ <input type="hidden" name="networking[{$i}][type]" value="{$nw.type}"/>
+ <input type="hidden" name="networking[{$i}][name]" value="{$nw.name}"/>
+ <img src="profile/networking/{$nw.type}" alt="{$nw.name}" title="{$nw.name}" />
+ <span style="">{$nw.name}</span>
+ </div>
+ <div style="float: left">
+ <input type="text" name="networking[{$i}][address]" value="{$nw.address}"
+ {if $nw.error} class="error" {/if}
+ size="30"/>
+ <a href="javascript:removeNetworking({$i})">
+ {icon name=cross title="Supprimer cet élément"}
+ </a>
+ </div>
+ </td>
+</tr>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<tr id="search_name_{$i}"{if $class} class="{$class}" {if !$error_name}style="{$style}"{/if}{/if}>
+ <td>
+ <input type="hidden" name="search_names[{$i}][always_displayed]" value="{$sn.always_displayed}"/>
+ <input type="hidden" name="search_names[{$i}][has_particle]" value="{$sn.has_particle}"/>
+ <span class="flags">
+ <input id="flag_cb_{$i}" type="checkbox" checked="checked" disabled="disabled"/>
+ <span id="flag_{$i}">{if $sn.pub}{icon name="flag_green" title="site public"}
+ {else}{icon name="flag_red" title="site privé"}{/if}</span>
+ </span>
+ {if $sn_type_list}
+ <select id="search_name_select_{$i}" name="search_names[{$i}][typeid]" onchange="changeNameFlag({$i});updateNameDisplay();">
+ {foreach from=$sn_type_list item=sn_type}
+ <option value="{$sn_type.id}">{$sn_type.name}</option>
+ {/foreach}
+ </select>
+ {foreach from=$sn_type_list item=sn_type}
+ <input type="hidden" name="sn_type_{$sn_type.id}_{$i}" value="{$sn_type.pub}"/>
+ {/foreach}
+ {else}
+ {$sn.type_name}
+ <input type="hidden" name="search_names[{$i}][pub]" value="{$sn.pub}"/>
+ <input type="hidden" name="search_names[{$i}][type]" value="{$sn.type}"/>
+ <input type="hidden" name="search_names[{$i}][type_name]" value="{$sn.type_name}"/>
+ <input type="hidden" name="search_names[{$i}][typeid]" value="{$sn.typeid}"/>
+ {/if}
+ </td>
+ <td>
+ <input type="text" name="search_names[{$i}][name]" value="{$sn.name}"
+ {if $sn.has_particle}title="Coche la case en bout de ligne si ton nom commence par une particle."{/if}
+ {if $sn.error} class="error"{/if} size="25" onkeyup="updateNameDisplay();"/>
+ </td>
+ <td>
+ {if $sn.has_particle}<input type="checkbox"{if $sn.particle neq ''} checked="checked"{/if}
+ title="Coche cette case si ton nom commence par une particle." onchange="toggleParticle({$i});"/>
+ {/if}
+ <input type="hidden" name="search_names[{$i}][particle]" value="{$sn.particle}"/>
+ {if !$sn.always_displayed}<a href="javascript:removeSearchName({$i})">
+ {icon name=cross title="Supprimer ce nom"}
+ </a>{/if}
+ </td>
+</tr>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* *}
{**************************************************************************}
-<table class="bicol" style="margin-bottom: 1em"
- summary="Profil : Informations générales">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil : Noms">
<tr>
- <th colspan="2">
- <div class="flags" style="float: left">
- <input type="checkbox" disabled="disabled" checked="checked" />
- {icon name="flag_green" title="site public"}
- </div>
- Informations générales
- </th>
+ <th colspan="3">Noms</th>
</tr>
<tr>
- <td>
- <span class="titre">Nom</span>
- <span class="comm"></span>
+ <td class="titre">
+ {icon name="flag_green" title="site public"} Affichage public
</td>
- <td>
- <input type='text' name='nom' {if $errors.nom}class="error"{/if} value="{$nom}" />
+ <td id="public_name">
+ {$public_name}
+ </td>
+ <td rowspan="2">
+ <a href="javascript:toggleNamesAdvanced();">
+ {icon name="page_edit" title="Plus de détail"}
+ </a>
</td>
</tr>
<tr>
- <td>
- <span class="titre">Prénom</span>
- <span class="comm"></span>
+ <td class="titre">
+ {icon name="flag_red" title="site privé"} Affichage privé
</td>
- <td>
- <input type='text' name='prenom' {if $errors.prenom}class="error"{/if} value="{$prenom}" />
+ <td id="private_name">
+ {$private_name}
</td>
</tr>
<tr>
<td>
- <span class="titre">Promotion</span>
+ <span class="titre">Comment t'appeller</span><br />
+ <span class="smaller">sur le site, dans la lettre mensuelle...</span>
</td>
<td>
- <span class="nom">X{$promo}{if ($promo != $promo_sortie - 3)} - X{math equation="a - b" a=$promo_sortie b=3}{/if}</span>
- <span class="lien"><a href="profile/orange">modifier</a>{if ($promo_sortie -3 == $promo)} pour les oranges{/if}</span>
+ <input type="text" name="yourself" value="{$yourself}" size="25"/>
+ </td>
+ <td></td>
+ </tr>
+ <tr class="names_advanced" {if !$errors.search_names}style="display: none"{/if}>
+ <td colspan="3">
+ <span class="titre">Gestion de tes noms, prénoms, surnoms...</span>
+ <span class="smaller">Ils déterminent la façon dont ton nom apparaît sur les annuaires
+ en ligne et papier et ta fiche apparaitra quand on cherche un de ces noms. Pour plus
+ d'explications sur l'icône suivante
+ <a href="profile/name_info" class="popup3">{icon name="information" title="Plus d'infos"}</a>.</span><br/>
+ <div class="small center">Si un de tes noms commence par une particule,
+ coche la case en bout de ligne.</div>
+ </td>
+ </tr>
+ {foreach from=$search_names item=sn key=id}
+ {include file="profile/general.searchname.tpl" i=$id sn=$sn
+ class="names_advanced" style="display: none" error_name=$errors.search_names}
+ {/foreach}
+ <tr class="names_advanced" id="searchname" {if !$errors.search_names}style="display: none"{/if}>
+ <td colspan="2">
+ <div id="sn_add" class="center">
+ <a href="javascript:addSearchName();">
+ {icon name=add title="Ajouter un nom"} Ajouter un nom
+ </a>
+ </div>
</td>
</tr>
+</table>
+
+<table class="bicol" style="margin-bottom: 1em"
+ summary="Profil : Informations générales">
+ <tr>
+ <th colspan="2">
+ <div class="flags" style="float: left">
+ <input type="checkbox" disabled="disabled" checked="checked" />
+ {icon name="flag_green" title="site public"}
+ </div>
+ Informations générales
+ </th>
+ </tr>
<tr>
<td>
- <span class="titre">Nom d'usage</span><br />
- {if $smarty.session.sexe}
- <span class="comm">(Notamment nom d'épouse)</span>
- {else}
- <span class="comm">(si différent de {$nom} seulement)</span>
- {/if}
+ <span class="titre">Promotion</span>
</td>
<td>
- <span class="nom">{$nom_usage|default:"Aucun"}</span>
- <span class="lien"><a href="profile/usage">{if $nom_usage}modifier{else}Faire une demande{/if}</a></span>
+ {if !$promo_choice}
+ <span class="nom">{$promo}</span>
+ <input type="hidden" name="promo" value="{$promo}"/>
+ {else}
+ <select name="promo">
+ {foreach from=$promo_choice item="promo_to_display"}
+ <option value="{$promo_to_display}" {if $promo_to_display eq $promo}selected="selected"{/if}>{$promo_to_display}</option>
+ {/foreach}
+ </select>
+ {/if}
+ <span class="lien"><a href="profile/orange" {if ($grad_year -3 == $entry_year)} {popup text="pour les oranges"}{/if}>{icon name="page_edit" title="modifier"}</a></span>
</td>
</tr>
<tr>
- <td class="titre">Date de naissance</td>
+ <td>
+ <span class="titre">Date de naissance</span>
+ </td>
<td><input type="text" {if $errors.naissance}class="error"{/if} name="naissance" value="{$naissance}" /></td>
</tr>
<tr>
</td>
<td>
<select name="nationalite">
- {select_nat valeur=$nationalite}
+ {select_nat valeur=$nationalite pad=1}
</select>
+ <a href="javascript:addNationality();">{icon name=add title="Ajouter une nationalité"}</a>
</td>
</tr>
- <tr class="pair">
+ <tr id="nationalite2" {if !$nationalite2}style="display: none"{/if}>
+ <td></td>
<td>
- <span class="titre">Application</span><br />
- <span class="comm">(4e année de l'X)</span>
- </td>
- <td>
- <select name="appli1[id]" onchange="fillType(this.form['appli1[type]'], this.selectedIndex-1);">
- {applis_options selected=$appli1.id}
- </select>
- <br />
- <input type="hidden" name="appli1_tmp" value="{$appli1.type}" />
- <select name="appli1[type]">
- <option value=""></option>
+ <select name="nationalite2">
+ {select_nat valeur=$nationalite2 pad=1}
</select>
+ <a href="javascript:delNationality('2');">{icon name=cross title="Supprimer cette nationalité"}</a>
</td>
</tr>
- <tr class="pair">
- <td>
- <span class="titre">Post-application</span>
- </td>
+ <tr id="nationalite3" {if !$nationalite3}style="display: none"{/if}>
+ <td></td>
<td>
- <select name="appli2[id]" onchange="fillType(this.form['appli2[type]'], this.selectedIndex-1);">
- {applis_options selected=$appli2.id}
+ <select name="nationalite3">
+ {select_nat valeur=$nationalite3 pad=1}
</select>
- <br />
- <input type="hidden" name="appli2_tmp" value="{$appli2.type}" />
- <select name="appli2[type]">
- <option value=""></option>
- </select>
- </td>
- </tr>
- <tr class="pair">
- <td class="center" colspan="2">
- <small>Si ta formation ne figure pas dans la liste,
- <a href="mailto:support@{#globals.mail.domain#}">contacte-nous</a>.</small>
+ <a href="javascript:delNationality('3');">{icon name=cross title="Supprimer cette nationalité"}</a>
</td>
</tr>
- </table>
+</table>
-{if !$no_private_key}
-<table class="bicol" style="margin-bottom: 1em"
- summary="Profil : Informations générales">
+<table class="bicol" style="margin-bottom: 1em" summary="Profil : Formations">
<tr>
- <th>
- Synchronisation avec l'AX
+ <th colspan="2">
+ <div class="flags" style="float: left">
+ <input type="checkbox" disabled="disabled" checked="checked" />
+ {icon name="flag_green" title="site public"}
+ </div>
+ Formations
</th>
</tr>
- <tr>
- <td class="flags">
- <input type="checkbox" name="synchro_ax" {if $synchro_ax}checked="checked" {/if}/>
- {icon name="flag_orange" title="transmis à l'AX"}
- <span class="texte">
- Autoriser la synchronisation vers l'AX par des administrateurs ou des scripts automatiques.
- </span>
+ {foreach from=$edus key=eduid item=edu}
+ {cycle values="impair, pair" assign=class}
+ {include file="profile/general.edu.tpl" eduid=$eduid edu=$edu edu_fields=$edu_fields class=$class}
+ {/foreach}
+ {if $edus|@count eq 0}
+ {cycle values="impair, pair" assign=class}
+ {include file="profile/general.edu.tpl" eduid=0 edu=0 class=$class}
+ {/if}
+ {cycle values="impair, pair" assign=class}
+ {assign var=eduaddid value=$edus|@count}
+ <tr id="edu_add" class="edu_{$eduaddid} {$class}">
+ <td colspan="2">
+ <div class="center" style="clear: both; padding-top: 4px;">
+ <a href="javascript:addEdu();">
+ {icon name=add title="Ajouter une formation"} Ajouter une formation
+ </a>
+ </div>
</td>
</tr>
- <tr>
- <td>
- <p>
- Le service annuaire de l'<a href='http://www.polytechniciens.com'>AX</a> met à jour l'annuaire papier à partir des informations que tu lui fournis. Tu peux choisir ici d'envoyer directement les données de ta fiche Polytechnique.org vers ta <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&anc_id={$matricule_ax}">fiche AX</a>.
- </p>
- <p>
- L'opération de synchronisation prend en compte toutes les informations que tu as marquées comme transmises à l'AX (en orange ou en vert). Elle peut alors effacer, modifier ou rajouter des informations sur ta <a href="http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&anc_id={$matricule_ax}">fiche AX</a> selon ce qui s'y trouve déjà.
- </p>
- <p class="center">
- <a href="profile/edit/general?synchro_ax=confirm" onclick="return confirm('Es-tu sûr de vouloir lancer la synchronisation ?')"><input type="button" value="Synchroniser"/></a>
- </p>
+ <tr class="{$class}">
+ <td class="center" colspan="2">
+ <small>Si ta formation ne figure pas dans la liste,
+ <a href="mailto:support@{#globals.mail.domain#}">contacte-nous</a>.</small>
</td>
</tr>
-</table>
-{/if}
+ </table>
<table class="bicol" style="margin-bottom: 1em"
summary="Profil : Trombinoscope">
</th>
</tr>
<tr>
- <td>
- <span class="flags">
- <input type="checkbox" checked="checked" disabled="disabled" />
- {icon name="flag_red" title="privé"}
- </span>
- <span class="titre">Surnom</span>
- </td>
- <td>
- <input type="text" size="35" maxlength="64"
- {if $errors.nick}class="error"{/if} name="nick" value="{$nick}" />
+ <td colspan="2">
+ <span class="titre">Téléphones personnels</span>
</td>
</tr>
<tr>
- <td>
- <span class="titre">Téléphone mobile</span>
- </td>
- <td>
- <input type="text" size="18" maxlength="18" name="mobile"
- {if $errors.mobile}class="error"{/if} value="{$mobile}" />
- <span class="flags">
- {include file="include/flags.radio.tpl" name="mobile_pub" val=$mobile_pub}
- </span>
+ <td colspan="2">
+ {foreach from=$tels key=telid item=tel}
+ <div id="tels_{$telid}" style="clear: both; padding-top: 4px; padding-bottom: 4px">
+ {include file="profile/phone.tpl" prefname='tels' prefid='tels' telid=$telid tel=$tel}
+ </div>
+ {/foreach}
+ {if $tels|@count eq 0}
+ <div id="tels_0" style="clear: both; padding-top: 4px; padding-bottom: 4px">
+ {include file="profile/phone.tpl" prefname='tels' preid='tels' telid=0 tel=0}
+ </div>
+ {/if}
+ <div id="tels_add" class="center" style="clear: both; padding-top: 4px;">
+ <a href="javascript:addTel('tels', 'tels');">
+ {icon name=add title="Ajouter un téléphone"} Ajouter un téléphone
+ </a>
+ </div>
</td>
</tr>
+ {if $email_error}
+ {include file="include/emails.combobox.tpl" name="email_directory" val=$email_directory_error error=$email_error i="0"}
+ {else}{include file="include/emails.combobox.tpl" name="email_directory" val=$email_directory error=$email_error i="0"}{/if}
<tr>
- <td>
- <span class="flags">
- <label><input type="checkbox" name="web_pub" {if $web_pub eq 'public'}checked="checked"{/if} />
- {icon name="flag_green" title="site public"}</label>
- </span>
- <span class="titre">Page web Perso</span>
+ <td colspan="2">
+ <span class="titre">Messageries, networking et sites web</span>
</td>
- <td>
- <input type="text" size="35" maxlength="95" name="web"
- {if $errors.web}class="error"{/if} value="{$web}" />
+ </tr>
+ {foreach from=$networking item=network key=id}
+ {include file="profile/general.networking.tpl" nw=$network i=$id}
+ {/foreach}
+ <tr id="networking">
+ <script type="text/javascript">//<![CDATA[
+ var nw_list = new Array();
+ {foreach from=$network_list item=network}
+ nw_list['{$network.name}'] = {$network.type};
+ {/foreach}
+ //]]></script>
+ <td colspan="2">
+ <div id="nw_add" class="center">
+ <a href="javascript:addNetworking();">
+ {icon name=add title="Ajouter une adresse"} Ajouter une adresse
+ </a>
+ </div>
</td>
</tr>
<tr class="pair">
<label><input type="checkbox" name="freetext_pub" {if $freetext_pub eq 'public'}checked="checked"{/if} />
{icon name="flag_green" title="site public"}</label>
</span>
- <span class="titre">Complément libre</span><br />
- <span class="comm">Commentaire ? ICQ ? etc...</span>
+ <span class="titre">Commentaire</span>
</div>
<div class="smaller" style="margin-top: 30px">
<a href="wiki_help/notitle" class="popup3">
subgrades = new Array();
names = new Array();
{foreach from=$medal_list key=type item=list}
-{foreach from=$list item=m}
-names[{$m.id}] = "{$m.text}";
-{if $grades[$m.id]|@count}
-names[{$m.id}] = "{$m.text}";
-subgrades[{$m.id}] = new Array({$grades[$m.id]|@count});
-{foreach from=$grades[$m.id] item=g}
-subgrades[{$m.id}][{$g.gid-1}] = [{$g.gid},"{$g.text}"];
-{/foreach}
-{/if}{/foreach}
+ {foreach from=$list item=m}
+ names[{$m.id}] = "{$m.text}";
+ {if $grades[$m.id]|@count}
+ subgrades[{$m.id}] = new Array({$grades[$m.id]|@count});
+ {foreach from=$grades[$m.id] item=g}
+ subgrades[{$m.id}][{$g.gid-1}] = [{$g.gid},"{$g.text}"];
+ {/foreach}
+ {/if}
+ {/foreach}
{/foreach}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<ul style="padding-top:0px;padding-bottom:0px">
<li><a href="http://www.polytechnique.net/{$asso.diminutif}/annuaire">annuaire</a></li>
<li><a href="http://www.polytechnique.net/{$asso.diminutif}/trombi">trombino</a></li>
- <li><a href="http://www.polytechnique.net/{$asso.diminutif}/geoloc">carte</a></li>
{if $asso.lists}
<li><a href="http://www.polytechnique.net/{$asso.diminutif}/lists">listes de diffusion</a></li>
{/if}
</td>
</tr>
<!-- Binets -->
- <tr id="binets">
+ <tr id="binets_table">
<td class="titre">{if $old}ex-{/if}Binet(s)</td>
<td>
- <select name="binets_sel" onchange="updateGroup('binets')">
+ <select name="binets_sel" onchange="updateElement('binets')">
{select_db_table table="binets_def" valeur=0 champ="text" pad='1'}
</select>
<a id="binets_add" style="display: none"
- href="javascript:addGroup('binets')">{icon name="add" title="Ajouter ce binet"}</a>
+ href="javascript:addBinet()">{icon name="add" title="Ajouter ce binet"}</a>
</td>
</tr>
{foreach item=text key=bid from=$binets}
<div style="float: left; width: 70%">
{$text}
</div>
- <a href="javascript:removeGroup('binets', {$bid})">{icon name="cross" title="Supprimer ce binet"}</a>
+ <a href="javascript:removeElement('binets', {$bid})">{icon name="cross" title="Supprimer ce binet"}</a>
</td>
</tr>
{/foreach}
<td>
{assign var=groupcat value=""}
{assign var=ingroup value=false}
- <select name="groupesx_sub" onchange="updateGroupSubLink(this)">
+ <select name="groupesx_sub" onchange="updateGroupSubLink()">
{iterate from=$listgroups item=group}
{if $group.dom neq $groupcat}
{if $ingroup}
<td colspan="2" class="smaller">
<div class="titre">Signification des symboles :</div>
{if $grp_public}{icon name=error} L'annuaire du groupe est à visibilité restreinte et ce groupe n'apparaîtra pas sur ta
- fiche{/if}
+ fiche.{/if}
{if $grp_public && $grp_admin}<br />{/if}
- {if $grp_admin}{icon name=wrench} Tu es administrateur du groupe{/if}
+ {if $grp_admin}{icon name=wrench} Tu es administrateur du groupe.{/if}
</td>
</tr>
{/if}
{**************************************************************************}
<?xml version="1.0" encoding="utf-8"?>
-<select name="jobs[{$id}][ss_secteur]">
- <option value=""></option>
- {iterate from=$ssecteurs item=ssecteur}
- <option value="{$ssecteur.id}" {if $ssecteur.id eq $sel}selected="selected"{/if}>{$ssecteur.label}</option>
- {/iterate}
-</select>
+<small>({$alternates})</small>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* *}
{**************************************************************************}
-{assign var=jobid value="job_`$i`"}
+{assign var=jobid value="job_"|cat:$i}
{assign var=jobpref value="jobs[`$i`]"}
+{assign var=sector_text value="sector_text_"|cat:$i}
+{assign var=sector value="sector_"|cat:$i}
+{assign var=entreprise value="entreprise_"|cat:$i}
<div id="{$jobid}">
<input type="hidden" name="{$jobpref}[removed]" value="0" />
<input type="hidden" name="{$jobpref}[new]" value="{if $new}1{else}0{/if}" />
+ <input type="hidden" name="{$jobpref}[id]" value="{$i}" />
+ <input type="hidden" name="{$jobpref}[jobid]" value="{$job.jobid}" />
<table id="{$jobid}_grayed" class="bicol" style="display: none; margin-bottom: 1em">
<tr>
<th class="grayed">
</th>
</tr>
</table>
+
<table id="{$jobid}_cont" class="bicol" summary="Entreprise n°{$i+1}" style="margin-bottom: 1em">
<tr>
<th colspan="2" style="text-align: right">
{include file="include/flags.radio.tpl" name="`$jobpref`[pub]" val=$job.pub}
</div>
Entreprise n°{$i+1} :
- <input type="text" class="enterprise_name {if $job.name_error}error{/if}" size="35" maxlength="100"
+ {if $job.tmp_name}{$job.tmp_name} <small>(en cours de validation)</small>{else}
+ <input type="text" class="enterpriseName {if $job.name_error}error{/if}" size="35" maxlength="100"
name="{$jobpref}[name]" value="{$job.name}" />
+ {/if}
<a href="javascript:removeJob('{$jobid}', '{$jobpref}')">
{icon name=cross title="Supprimer cet emploi"}
</a>
</th>
</tr>
- <tr>
- <td class="titre">Page Web</td>
+ {if !$job.tmp_name && !$job.name}
+ <tr class="{$entreprise}">
+ <td class="center" colspan="2">
+ <small>Si ton entreprise ne figure pas dans la liste,
+ <a href="javascript:addEntreprise({$i})">clique ici</a> et complète les informations la concernant.</small>
+ </td>
+ </tr>
+ {/if}
+ <tr class="{$entreprise}" style="display: none">
+ <td class="titre">Acronyme</td>
<td>
- <input type="text" size="35" maxlength="255" {if $job.web_error}class="error"{/if}
- name="{$jobpref}[web]" value="{$job.web}" />
+ <input type="text" size="35" maxlength="255" {if $job.acronym_error}class="error"{/if}
+ name="{$jobpref}[hq_acronym]" value="{$job.hq_acronym}" />
</td>
</tr>
- <tr>
- <td class="titre">Secteur d'activité</td>
+ <tr class="{$entreprise}" style="display: none">
+ <td class="titre">Page web</td>
<td>
- <select name="{$jobpref}[secteur]" onchange="updateJobSecteur({$i}, '{$jobid}', '{$jobpref}', ''); return true;">
- <option value=""> </option>
- {foreach from=$secteurs item=secteur}
- <option value="{$secteur.id}" {if $secteur.id eq $job.secteur}selected="selected"{/if}>
- {$secteur.label}
- </option>
- {/foreach}
- </select>
+ <input type="text" size="35" maxlength="255" {if $job.hq_url}class="error"{/if}
+ name="{$jobpref}[hq_url]" value="{$job.hq_url}" />
</td>
</tr>
- <tr>
- <td class="titre">Sous-secteur d'activité</td>
- <td id="{$jobid}_ss_secteur">
- <input type="hidden" name="{$jobpref}[ss_secteur]" value="{$job.ss_secteur|default:'-1'}" />
- </td>
+ <tr class="{$entreprise}" style="display: none">
+ <td class="titre">Email de contact</td>
+ <td>
+ <input type="text" maxlength="60" {if $job.hq_email_error}class="error"{/if}
+ name="{$jobpref}[hq_email]" value="{$job.hq_email}" />
+ </td>
</tr>
- <tr>
- <td class="titre">Poste occupé</td>
+ <tr class="{$entreprise}" style="display: none">
+ <td colspan="2">
+ <div style="float: left">
+ <div class="titre">Adresse du siège</div>
+ <div style="margin-top: 20px; clear: both">
+ {include file="geoloc/form.address.tpl" prefname="`$jobpref`[hq_address]"
+ prefid="`$jobid`_address" address=$job.hq_address}
+ </div>
+ </div>
+ </td>
+ </tr>
+ <tr class="{$entreprise}" style="display: none">
+ <td class="titre">Téléphone</td>
<td>
- <input type="text" size="35" maxlength="120" {if $job.poste_error}class="error"{/if}
- name="{$jobpref}[poste]" value="{$job.poste}" />
+ <input type="text" maxlength="28" {if $job.hq_tel_error}class="error"{/if}
+ name="{$jobpref}[hq_phone]" value="{$job.hq_phone}" />
</td>
</tr>
- <tr>
- <td class="titre">Fonction occupée</td>
+ <tr class="{$entreprise}" style="display: none">
+ <td class="titre">Fax</td>
<td>
- <select name="{$jobpref}[fonction]">
- <option value=""> </option>
- {assign var=ingroup value=false}
- {foreach from=$fonctions item=fonct}
- {if $fonct.title}
- {if $ingroup}</optgroup>{/if}
- <optgroup label="{$fonct.fonction_fr}">
- {assign var=ingroup value=true}
- {/if}
- <option value="{$fonct.id}" {if $fonct.id eq $job.fonction}selected="selected"{/if}>
- {$fonct.fonction_fr}
+ <input type="text" maxlength="28" {if $job.hq_fax_error}class="error"{/if}
+ name="{$jobpref}[hq_fax]" value="{$job.hq_fax}" />
+ </td>
+ </tr>
+
+ <tr class="pair">
+ <td colspan="2" class="center" style="font-style: italic">Ta place dans l'entreprise</td>
+ </tr>
+ <tr class="pair {$sector_text}">
+ <td class="titre">Secteur d'activité</td>
+ <td>
+ <input type="text" class="sectorName {if $job.sector_error}error{/if}" size="35" maxlength="100"
+ name="{$jobpref}[subSubSectorName]" value="{$job.subSubSectorName}" />
+ <a href="javascript:displayAllSector({$i})">{icon name="table" title="Tous les secteurs"}</a>
+ </td>
+ </tr>
+ <tr class="pair {$sector}" style="display: none">
+ <td class="titre" rowspan="4">Secteur d'activité</td>
+ <td>
+ <select name="{$jobpref}[sector]" onchange="updateJobSector({$i}, '')">
+ <option value="0"> </option>
+ {foreach from=$sectors item=item}
+ <option value="{$item.id}" {if $item.id eq $job.sector}selected="selected"{/if}>
+ {$item.label}
</option>
{/foreach}
- {if $ingroup}</optgroup>{/if}
</select>
</td>
</tr>
- <tr class="titre">
- <td class="center" colspan="2">
- <small>Si des informations font défaut dans les listes ci-dessus,
- <a href="mailto:support@{#globals.mail.domain#}">contacte-nous</a>.</small>
+ <tr class="pair {$sector}" style="display: none">
+ <td id="{$jobid}_subSector">
+ <input type="hidden" name="{$jobpref}[subSector]" value="{$job.subSector|default:0}" />
+ </td>
+ </tr>
+ <tr class="pair {$sector}" style="display: none">
+ <td id="{$jobid}_subSubSector">
+ <input type="hidden" name="{$jobpref}[subSubSector]" value="{$job.subSubSector|default:0}" />
+ </td>
+ </tr>
+ <tr class="pair {$sector}" style="display: none">
+ <td id="{$jobid}_alternates">
</td>
</tr>
<tr class="pair">
- <td colspan="2">
- <span class="titre">Email professionnel :</span>
- <input type="text" size="30" maxlength="60" {if $job.email_error}class="error"{/if}
- name="{$jobpref}[email]" value="{$job.email}" />
- <span class="flags">
- {include file="include/flags.radio.tpl" name="`$jobpref`[email_pub]" val=$job.mail_pub}
- </span>
+ <td class="titre">Description</td>
+ <td>
+ <input type="text" size="35" maxlength="120" {if $job.description_error}class="error"{/if}
+ name="{$jobpref}[description]" value="{$job.description}" />
+ </td>
+ </tr>
+ <tr class="pair">
+ <td class="titre">Page perso</td>
+ <td>
+ <input type="text" size="35" maxlength="255" {if $job.w_rul}class="error"{/if}
+ name="{$jobpref}[w_url]" value="{$job.w_url}" />
</td>
</tr>
<tr class="pair">
<div style="float: left">
<div class="titre">Adresse</div>
<div class="flags">
- {include file="include/flags.radio.tpl" name="`$jobpref`[adr][pub]" val=$job.adr.pub}
+ {include file="include/flags.radio.tpl" name="`$jobpref`[w_address][pub]" val=$job.w_address.pub}
</div>
<div style="margin-top: 20px; clear: both">
- {include file="geoloc/form.address.tpl" name="`$jobpref`[adr]" id="`$jobid`_adr" adr=$job.adr}
+ {include file="geoloc/form.address.tpl" prefname="`$jobpref`[w_address]"
+ prefid=$jobid address=$job.w_address}
</div>
</div>
- <div style="float: right; width: 50%">
- <div class="titre">Téléphone</div>
- <div class="flags">
- {include file="include/flags.radio.tpl" name="`$jobpref`[tel_pub]" val=$job.tel_pub}
+ </td>
+ </tr>
+ {include file="include/emails.combobox.tpl" name=$jobpref|cat:'[w_email]' val=$job.w_email
+ class="pair" i=$i error=$job.w_email_error prefix="w_" pub=$job.w_email_pub id=$i}
+ <tr class="pair">
+ <td colspan="2">
+ {foreach from=$job.w_phone key=t item=phone}
+ <div id="{"`$jobid`_w_phone_`$t`"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=$t tel=$phone}
+ </div>
+ {/foreach}
+ {if $job.w_phone|@count eq 0}
+ <div id="{"`$jobid`_w_phone_0"}" style="clear: both">
+ {include file="profile/phone.tpl" prefname="`$jobpref`[w_phone]" prefid="`$jobid`_w_phone" telid=0 tel=0}
</div>
- <table style="clear: both">
- <tr>
- <td>Bureau :</td>
- <td>
- <input type="text" size="18" maxlength="18" {if $job.tel_error}class="error"{/if}
- name="{$jobpref}[tel]" value="{$job.tel}" />
- </td>
- </tr>
- <tr>
- <td>Fax :</td>
- <td>
- <input type="text" size="18" maxlength="18" {if $job.fax_error}class="error"{/if}
- name="{$jobpref}[fax]" value="{$job.fax}" /></td>
- </tr>
- <tr>
- <td>Mobile :</td>
- <td>
- <input type="text" size="18" maxlength="18" {if $job.mobile_error}class="error"{/if}
- name="{$jobpref}[mobile]" value="{$job.mobile}" />
- </td>
- </tr>
- </table>
+ {/if}
+ <div id="{$jobid}_w_phone_add" class="center" style="clear: both; padding-top: 4px;">
+ <a href="javascript:addTel('{$jobid}_w_phone', '{$jobpref}[w_phone]')">
+ {icon name=add title="Ajouter un numéro de téléphone"} Ajouter un numéro de téléphone
+ </a>
</div>
</td>
</tr>
--- /dev/null
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<?xml version="1.0" encoding="utf-8"?>
+<select name="jobs[{$id}][subSector]" {if ($change)}onchange="updateJobSubSector({$id}, '')"{/if}>
+ <option value="0"></option>
+ {iterate from=$subSectors item=subSector}
+ {if $subSector.optgroup}
+ {if $gp}
+ </optgroup>
+ {/if}
+ <optgroup label="{$subSector.name}">
+ {assign var=1 name=gp}
+ {else}
+ <option value="{$subSector.id}" {if $subSector.id eq $sel}selected="selected"{/if}>{$subSector.name}</option>
+ {/if}
+ {if $gp}
+ </optgroup>
+ {/if}
+ {/iterate}
+</select>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
-{**************************************************************************}\r
-{* *}\r
-{* Copyright (C) 2003-2009 Polytechnique.org *}\r
-{* http://opensource.polytechnique.org/ *}\r
-{* *}\r
-{* This program is free software; you can redistribute it and/or modify *}\r
-{* it under the terms of the GNU General Public License as published by *}\r
-{* the Free Software Foundation; either version 2 of the License, or *}\r
-{* (at your option) any later version. *}\r
-{* *}\r
-{* This program is distributed in the hope that it will be useful, *}\r
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}\r
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}\r
-{* GNU General Public License for more details. *}\r
-{* *}\r
-{* You should have received a copy of the GNU General Public License *}\r
-{* along with this program; if not, write to the Free Software *}\r
-{* Foundation, Inc., *}\r
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}\r
-{* *}\r
-<?xml version="1.0" encoding="utf-8"?>\r
-<city id="{$smarty.request.cityid}">\r
- {assign var="beginning" value=true}\r
- {assign var="nb_displayed" value=0}\r
- {foreach from=$users item="user"}{if !$beginning}<br/>{/if}{if $nb_displayed < 10}<a href="javascript:ficheXorg('{$user.alias}');">{$user.prenom} {$user.nom|strtolower|ucwords} - {$user.promo}</a>{else}<a href="javascript:clickOnCity({$smarty.request.cityid})">...</a>{/if}{assign var="nb_displayed" value=$nb_displayed+1}{assign var="beginning" value=false}{/foreach}\r
-</city>\r
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}\r
+{**************************************************************************}
+{* *}
+{* Copyright (C) 2003-2009 Polytechnique.org *}
+{* http://opensource.polytechnique.org/ *}
+{* *}
+{* This program is free software; you can redistribute it and/or modify *}
+{* it under the terms of the GNU General Public License as published by *}
+{* the Free Software Foundation; either version 2 of the License, or *}
+{* (at your option) any later version. *}
+{* *}
+{* This program is distributed in the hope that it will be useful, *}
+{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
+{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
+{* GNU General Public License for more details. *}
+{* *}
+{* You should have received a copy of the GNU General Public License *}
+{* along with this program; if not, write to the Free Software *}
+{* Foundation, Inc., *}
+{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
+{* *}
+{**************************************************************************}
+
+<?xml version="1.0" encoding="utf-8"?>
+<select name="jobs[{$id}][subSubSector]" onchange="updateJobAlternates({$id})">
+ <option value="0"></option>
+ {iterate from=$subSubSectors item=subSubSector}
+ <option value="{$subSubSector.id}" {if $subSubSector.id eq $sel}selected="selected"{/if}>{$subSubSector.name}</option>
+ {/iterate}
+</select>
+
+{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
<a href="javascript:addJob()">
{icon name=add title="Ajouter un emploi"} Ajouter un emploi
</a>
+ <br/><br/>
</div>
+<table class="bicol" style="margin-bottom: 1em" summary="Corps">
+ <tr>
+ <th colspan="2">
+ <div class="flags" style="float: left; text-align: left">
+ {include file="include/flags.radio.tpl" name="corps[pub]" val=$corps.pub}
+ </div>
+ Corps
+ </th>
+ </tr>
+ <tr>
+ <td class="titre">Corps d'origine</td>
+ <td>
+ <select name="corps[original]">
+ {foreach from=$original_corps item=o_corps}
+ <option value="{$o_corps.id}" {if $o_corps.id eq $corps.original}selected="selected"{/if}>{$o_corps.name}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="titre">Corps actuel</td>
+ <td>
+ <select name="corps[current]">
+ {foreach from=$current_corps item=c_corps}
+ <option value="{$c_corps.id}" {if $c_corps.id eq $corps.current}selected="selected"{/if}>{$c_corps.name}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <td class="titre">Grade</td>
+ <td>
+ <select name="corps[rank]">
+ {foreach from=$corps_rank item=rank}
+ <option value="{$rank.id}" {if $rank.id eq $corps.rank}selected="selected"{/if}>{$rank.name}</option>
+ {/foreach}
+ </select>
+ </td>
+ </tr>
+</table>
+
<table class="bicol" summary="CV" style="margin-top: 1.5em">
<tr>
<th>
<p>{icon name=information title="Afficher ma fiche référent"}Tu peux consulter ta <a class="popup2" href="referent/{$smarty.session.hruid}">fiche référent</a> qui n'est accessible que par les X.
</p>
-{if (!$expertise)||(!($secteurs|@count))}
+{if (!$expertise)||(!($sectors|@count))}
<p>
<strong>Attention : pour figurer dans la base de données des mentors, il faut remplir la
dernière case en bas de cette page et avoir au moins un secteur d'activité de prédilection.</strong><br />
<li>ou bien, plus âgés, qui souhaitent réorienter leur carrière.</li>
</ul>
-<table class="bicol" style="margin-bottom: 1em" summary="Profil : Mentoring">
+<table class="bicol" id="countries_table" style="margin-bottom: 1em" summary="Profil : Mentoring">
<tr>
<th>
<div class="flags" style="float: left">
<div id="countries_add" style="display: none; float: right">
<a href="javascript:addCountry()">{icon name=add title="Ajouter ce pays"}</a>
</div>
- <select name="countries_sel" onchange="updateCountry()">
- {geoloc_country country='00'}
+ <select name="countries_sel" onchange="updateElement('countries')">
+ <option value=""></option>
+ {iterate from=$countryList item=country}
+ <option value="{$country.iso_3166_1_a2}">{$country.countryFR}</option>
+ {/iterate}
</select>
</td>
</tr>
{foreach from=$countries item=country key=i}
<div id="countries_{$i}" style="clear: both; margin-bottom: 0.7em">
<a style="display: block; float: right"
- href="javascript:removeCountry('{$i}')">{icon name=cross title="Supprimer ce pays"}</a>
+ href="javascript:removeElement('countries', '{$i}')">{icon name=cross title="Supprimer ce pays"}</a>
<div class="titre">{$country}</div>
<input type="hidden" name="countries[{$i}]" value="{$country}" />
</div>
</th>
</tr>
<tr>
- <td id="secteur_sel">
+ <td id="sectorSelection">
<div style="float: left; width: 30%" class="titre">Secteur</div>
- <select name="secteur_sel" onchange="updateSecteur()">
+ <select name="sectorSelection" onchange="updateSector()">
<option value=""> </option>
- {iterate from=$secteurs_sel item=secteur}
- <option value="{$secteur.id}">{$secteur.label}</option>
+ {iterate from=$sectorList item=sector}
+ <option value="{$sector.id}">{$sector.name}</option>
{/iterate}
</select>
</td>
<tr>
<td>
<div style="float: left; width: 30%" class="titre">Sous-secteur</div>
- <span id="ss_secteur_sel"></span>
+ <span id="subSectorSelection"></span>
</td>
</tr>
<tr class="pair">
- <td id="secteurs">
- {if $secteurs|@count}
- {foreach from=$secteurs item=secteur key=s}
- {foreach from=$secteur item=ss_sect key=ss}
- <div id="secteurs_{$s}_{$ss}" style="clear: both; margin-top: 0.5em" class="titre">
- <a href="javascript:removeSecteur('{$s}', '{$ss}')" style="display: block; float: right">
+ <td id="sectors">
+ {if $sectors|@count}
+ {foreach from=$sectors item=sector key=s}
+ {foreach from=$sector item=subSector key=ss}
+ <div id="sectors_{$s}_{$ss}" style="clear: both; margin-top: 0.5em" class="titre">
+ <a href="javascript:removeSector('{$s}', '{$ss}')" style="display: block; float: right">
{icon name=cross title="Supprimer ce secteur"}
</a>
- <input type="hidden" name="secteurs[{$s}][{$ss}]" value="{$ss_sect}" />
- {$ss_sect}
+ <input type="hidden" name="sectors[{$s}][{$ss}]" value="{$subSector}" />
+ {$subSector}
</div>
{/foreach}
{/foreach}
{* *}
{**************************************************************************}
-<h1>
- Administration de la dynamap
-</h1>
+<h1>Les différents types de noms</h1>
+<table class="bicol" style="margin-bottom: 1em" summary="Explications sur les différents types de noms">
+ <tr>
+ <th>Type</th>
+ <th>Description</th>
+ <th>Confidentialité ¹</th>
+ <th>Prise en compte de la particule ²</th>
+ <tr>
+ </tr>
+ {iterate from=$types item=type}
+ <tr>
+ <td>{$type.name}</td>
+ <td>{$type.explanations}</td>
+ <td class="center">
+ {if $type.public}
+ {icon name="flag_green" title="site public"}
+ {else}
+ {icon name="flag_red" title="site privé"}
+ {/if}
+ </td>
+ <td class="center">{if $type.has_particle}Oui{else}Non{/if}</td>
+ </tr>
+ {/iterate}
+</table>
+
+<h2>Légende :</h2>
+<ul>
+<li>¹ {icon name="flag_green" title="site public"} signifie que les données sont visibles
+ sur la partie publique du site alors que {icon name="flag_red" title="site privé"} indique
+ qu'elles sont cantonnées au site privé.</li>
+<li>² Pour les types concernés, il faut cocher la case en bout de ligne si le nom débute
+ par une particule, comme cela tu seras correctement classé dans l'ordre alphabétique.</li>
+</ul>
-<h2>
- Utiliser de nouvelles cartes
-</h2>
- <form action='admin/geoloc/dynamaps/newmaps' method='post'>
- <p>
- <input type='text' name='url' value='{$smarty.request.url|default:"url des données des cartes"}' onfocus='select()' size='40'/>
- <br/>
- <input type='submit'/>
- </p>
- </form>
-
-<h2>
- Placement des villes sur les cartes
-</h2>
-{if $nb_cities_not_on_map}
- <p>
- Il y a {$nb_cities_not_on_map} villes qui ne sont pas placées dans les cartes.
- [<a href='admin/geoloc/dynamap/cities_not_on_map'>Réparer</a>]
- </p>
-{else}
- <p> Toutes les villes de la base sont placées dans des cartes. </p>
-{/if}
-{if $no_smallest}
- <p>
- Il faut <a href='admin/geoloc/dynamap/smallest_maps'>définir la plus petite carte</a>
- pour chaque ville (à ne faire qu'une fois quand on a placé toutes les villes).
- </p>
-{/if}
-{if $no_coordinates}
-<h2>
- Placement précis des adresses
-</h2>
-<p>
- {$no_coordinates} adresses n'ont pas été bien reconnues précisément.
- [<a href='admin/geoloc/dynamap/precise_coordinates'>Mettre les coordonnées du centre de la ville</a>]
-</p>
-{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
+++ /dev/null
-{**************************************************************************}
-{* *}
-{* Copyright (C) 2003-2009 Polytechnique.org *}
-{* http://opensource.polytechnique.org/ *}
-{* *}
-{* This program is free software; you can redistribute it and/or modify *}
-{* it under the terms of the GNU General Public License as published by *}
-{* the Free Software Foundation; either version 2 of the License, or *}
-{* (at your option) any later version. *}
-{* *}
-{* This program is distributed in the hope that it will be useful, *}
-{* but WITHOUT ANY WARRANTY; without even the implied warranty of *}
-{* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *}
-{* GNU General Public License for more details. *}
-{* *}
-{* You should have received a copy of the GNU General Public License *}
-{* along with this program; if not, write to the Free Software *}
-{* Foundation, Inc., *}
-{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
-{* *}
-{**************************************************************************}
-
-<h1>Nom d'usage</h1>
-
-{if $same}
- <p>
- Tu peux soit <a href='profile/usage'>refaire une demande de nom d'usage</a>, soit <a href='profile/edit'>retourner à l'édition de ton profil</a>.
- </p>
-{else}
- {if $myusage}
- {if $usage_old}
- <p>
- Ta demande de suppression de ton nom d'usage ainsi que de tes
- alias {$alias_old}@{#globals.mail.domain#} et
- {$alias_old}@{#globals.mail.domain2#} a bien été enregistrée.
- </p>
- {/if}
-
- {if $myusage->alias}
- <p>
- Ta demande d'ajout de ton nom d'usage a bien été enregistrée. Sa
- validation engendrera la création des alias
- <strong>{$myusage->alias}@{#globals.mail.domain#}</strong> et
- <strong>{$myusage->alias}@{#globals.mail.domain2#}</strong>.
- </p>
- {/if}
-
- <p>
- Tu recevras un email dès que les changements demandés auront été effectués.
- Encore merci de nous faire confiance pour tes emails !
- </p>
-
- {else}
-
-<p>
-Le nom d'usage est un patronyme qui doit être <strong>reconnu par la
- loi</strong> (nom du conjoint, d'un de ses parents, ou bien plus
-exceptionnellement sur changement de l'état civil, ...).
-</p>
-
-<p>
-Les surnoms sont <strong>systématiquement refusés</strong>. Pour
-utiliser une adresse personnalisée, il faut se tourner vers
-<a href="emails/alias">l'alias @{#globals.mail.alias_dom#}</a>.
-</p>
-
- <p>
- Afin d'être joignable à la fois sous ton nom à l'X et sous ton nom d'usage, tu peux
- saisir ici ce dernier. Il apparaîtra alors dans l'annuaire et tu disposeras
- des adresses correspondantes @{#globals.mail.domain#} et @{#globals.mail.domain2#}, en plus de
- celles que tu possèdes déjà.
- </p>
-
- <br />
-
-{literal}
- <form action="profile/usage" method="post" onsubmit="
- for (var i=this.reason.length-1; i>=0; i--) {
- if (this.reason[i].checked &&
- (this.reason[i].value != 'other' || this.other_reason.value != '')) {
- return true;
- }
- }
- alert('Tu dois préciser une raison motivant ta demande.');
- return false;
-">
-{/literal}
- {xsrf_token_field}
- <table class="bicol" cellpadding="4" summary="Nom d'usage">
- <tr>
- <th>Nom d'usage</th>
- </tr>
- <tr>
- <td class="center">
- <input type="text" name="nom_usage" id="nom_usage" value="{$usage_old}" />
- <script type="text/javascript">
- document.getElementById("nom_usage").focus();
- </script>
- </td>
- </tr>
- <tr>
- <th>Raison du changement de nom</th>
- </tr>
- <tr>
- <td class="rt">
- <input type="radio" name="reason" value="époux/se" id="reason_ep" onclick="this.form.other_reason.value=''" /><label for="reason_ep">Nom d'épouse / d'époux</label><br />
- {if $usage_old}
- <input type="radio" name="reason" value="divorce" id="reason_div" onclick="this.form.other_reason.value=''" /><label for="reason_div">Divorce</label><br />
- {/if}
- <input type="radio" name="reason" value="raccourci" id="reason_rac" onclick="this.form.other_reason.value=''" /><label for="reason_rac">Nom d'état civil simplifié, le nom officiel étant trop long</label><br />
- <input type="radio" name="reason" value="other" id="reason_oth" /><label for="reason_oth">Autre :</label><br />
- <input type="text" name="other_reason" onfocus="document.getElementById('reason_oth').checked='checked'" size="60" />
- </td>
- </tr>
- <tr>
- <td class="center">
- {if !$usage_old}
- <input type="submit" name="submit" value="Faire la demande" />
- {else}
- <input type="submit" name="submit" value="Modifier" />
- <input type="submit" name="submit" value="Supprimer" onClick="this.form.nom_usage.value=''" />
- {/if}
- </td>
- </tr>
- </table>
- </form>
- {/if}
-{/if}
-
-
-{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{else}
<p>
- Afin de pouvoir être considéré(e) à la fois dans ta promotion d'origine et ta
+ Afin de pouvoir être considéré{if $sexe}e{/if} à la fois dans ta promotion d'origine et ta
ou tes promotions d'adoption tu peux entrer ici ton année de sortie de l'école.
Plus précisément, il s'agit de l'année d'entrée en quatrième année ou année d'application.
- Pour tes cocons d'origine (X{$promo}) il s'agit de l'année {math equation="a + b" a=$promo b=3}.
+ Pour tes cocons d'origine ({$promo}) il s'agit de l'année {math equation="a + b" a=$promo b=3}.
</p>
<br />
{* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *}
{* *}
{**************************************************************************}
-<config
-grandOncleVisibility="-1"
-tooltipSize="0"
-tooltipDX="0"
-tooltipDY="20"
-panelSize="28"
-citySize="6"
-radius100="1.6"
-radius0="3"
-select="aim"
-aimTween="5"
-transition="2"
-textLookInCity="Rechercher les x dans cette ville"
-textZoomIn="Zoom"
-textGoTo="Va à "
-textZoomBackTo="Revient à "
-textLoading="Chargement"
-textYouAreIn="Tu es dans "
-textSeeMapOfCity="Voir la carte de "
-textYouHaveSelected="Tu as sélectionné "
-{if $background}
-background="{$background}"
-zoomBarBackgroundColor="{$background}"
-{/if}
-textCopyright="Les règles de l'annuaire s'appliquent aussi à cette application"
-autofolder="true"
-iconSwf="icon.swf"
-scriptInfosArea="country{$plset_search|escape_html}">
-<translation>
- <text name="Hide/Show labels" value="Montrer/Cacher les étiquettes"/>
- <text name="- You are in " value="Vous êtes dans "/>
- <text name="Loading first part of XML data" value="Chargement des données"/>
- <text name="Loading own map" value="Chargement de la carte principale"/>
- <text name="Loading XML data" value="Chargement des données"/>
- <text name="Loading maps of sub-countries" value="Chargement des cartes"/>
-</translation>
-</config>
+
+{assign var=telpref value="`$prefname`[`$telid`]"}
+{assign var=id value="`$prefid`_`$telid`"}
+<div class="titre" style="float: left; width: 2.5em">N°{$telid+1}</div>
+<div style="float: left;">
+ <select name="{$telpref}[type]">
+ <option value="fixed"{if $tel.type eq 'fixed'} selected="selected"{/if}>Fixe</option>
+ <option value="mobile"{if $tel.type eq 'mobile'} selected="selected"{/if}>Mobile</option>
+ <option value="fax"{if $tel.type eq 'fax'} selected="selected"{/if}>Fax</option>
+ </select>
+ <input type="hidden" name="{$telpref}[removed]" value="0"/>
+ <input type="text" size="19" maxlength="28" name="{$telpref}[tel]" {if $tel.error}class="error"{/if} value="{$tel.tel}" />
+ <a href="javascript:removeTel('{$id}')">
+ {icon name=cross title="Supprimer ce numéro de téléphone"}
+ </a>
+ <a id="{$id}_addComment" href="javascript:addPhoneComment('{$id}')" {if $tel.comment neq ''}style="display:none" {/if}>
+ {icon name=comments title="Ajouter un commentaire"}
+ </a>
+</div>
+<div style="float: right" class="flags">
+ {include file="include/flags.radio.tpl" name="`$telpref`[pub]" val=$tel.pub}
+</div>
+<div id="{$id}_comment" style="clear: both;{if $tel.comment eq ''} display:none{/if}">
+ Commentaire :
+ <input type="text" size="45" maxlength="80" name="{$telpref}[comment]" {if $tel.error}class="error"{/if} value="{$tel.comment}"/>
+ <a href="javascript:removePhoneComment('{$id}', '{$telpref}')">
+ {icon name=cross title="Supprimer le commentaire"}
+ </a>
+</div>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{if $x.gpxs_join}<div><em class="intitule">Groupe{if count($x.gpxs) > 1}s{/if} et institution{if count($x.gpxs) > 1}s{/if} X : </em>
<span><br/>{$x.gpxs_join|smarty:nodefaults}</span></div>{/if}
{/if}
+ {if $x.networking}
+ <h2>Sur le web...</h2>
+ {foreach from=$x.networking item=network}
+ <img style="width: auto; padding: 0" src="profile/networking/{$network.type}" alt="{$network.name}" title="{$network.name}"/>
+ {if $network.filter == 'web'}
+ <a href="{$network.address}">{$network.address}</a>
+ {elseif $network.link != ''}
+ <a href="{$network.link}">{$network.address}</a>
+ {else}
+ {$network.address}
+ {/if}
+ <br/>
+ {/foreach}
+ {/if}
{if $x.freetext}
<h2>Commentaires :</h2>
<span>{$x.freetext|miniwiki|smarty:nodefaults}</span>
<div id="fiche_identite" class="part">
<div class="civilite">
{if $user->isFemale()}•{/if}
- {$user->fullName()}{if $x.nom_usage neq ""} ({$x.nom}){/if}
+ <span {if $x.name_tooltip neq ""}class="hinted" title="{$x.name_tooltip}"{/if}>{$x.name_display}</span>
{if $logged}
{if $x.nickname} (alias {$x.nickname}){/if}
{/if}
- {if $x.web} <a href="{$x.web}">{icon name="world_go" title="Site Web"}</a>{/if}
{if $logged}
{if !$x.dcd}<a href="vcard/{$user->login()}.vcf">{*
*}{icon name=vcard title="Afficher la carte de visite"}</a>{/if}
le {$x.date|date_format}
</div>
{/if}
- {if $logged || $x.mobile}
+ {if $logged || $x.tels}
<div class="contact">
{if $logged}
<div class='email'>
{/if}
</div>
{/if}
- {if $x.mobile}
- <div class="mob">
- <em class="intitule">Mobile : </em>{$x.mobile}
- </div>
+ {if $x.tels}
+ {display_phones tels=$x.tels}
{/if}
<div class='spacer'></div>
</div>
{/if}
<div class='formation'>
- {if $x.iso3166}
- <img src='images/flags/{$x.iso3166}.gif' alt='{$x.nationalite}' height='11' title='{$x.nationalite}' />
+ {if $x.iso3166_1}
+ <img src='images/flags/{$x.iso3166_1}.gif' alt='{$x.nationalite}' height='11' title='{$x.nationalite}' />
{/if}
- X {$user->promo()}
- {if $x.promo_sortie && ($x.promo_sortie-3 > $x.promo)}
- - X {math equation="a-b" a=$x.promo_sortie b=3}
+ {if $x.iso3166_2}
+ <img src='images/flags/{$x.iso3166_2}.gif' alt='{$x.nationalite2}' height='11' title='{$x.nationalite2}' />
{/if}
- {if $x.applis_join}
- - Formation : {$x.applis_join|smarty:nodefaults}
+ {if $x.iso3166_3}
+ <img src='images/flags/{$x.iso3166_3}.gif' alt='{$x.nationalite3}' height='11' title='{$x.nationalite3}' />
{/if}
+ {$user->promo()}
{if $logged && $x.is_referent}
- [<a href="referent/{$user->login()}" class='popup2'>Ma fiche référent</a>]
+ [<a href="referent/{$x.forlife}" class='popup2'>Ma fiche référent</a>]
+ {/if}
+ {if $x.education}
+ - Formation :
+ <ul>
+ {foreach from=$x.education item="edu"}
+ <li>{$edu|smarty:nodefaults}</li>
+ {/foreach}
+ </ul>
+ {/if}
+ {if $x.corps}
+ {$x.corps|smarty:nodefaults}
{/if}
</div>
</div>
{literal}
var Ajax2 = new AjaxEngine();
-function setSecteur(secteur)
+function setSector(sector)
{
- if (secteur == '') {
+ if (sector == '') {
document.getElementById('scat').style.display = 'none';
document.getElementById('country').style.display = 'none';
document.getElementById('keywords').style.display = 'none';
} else {
- Ajax.update_html('ssect_chg', baseurl + 'ssect/' + secteur);
- Ajax2.update_html('country_chg', baseurl + 'country/' + secteur);
+ Ajax.update_html('ssect_chg', baseurl + 'ssect/' + sector);
+ Ajax2.update_html('country_chg', baseurl + 'country/' + sector);
document.getElementById('scat').style.display = '';
document.getElementById('country').style.display = '';
document.getElementById('keywords').style.display = '';
}
}
-function setSSecteurs()
+function setSubSectors()
{
var sect = document.getElementById('sect_field').value;
var ssect = document.getElementById('ssect_field').value;
Secteur de compétence <br /> du référent
</td>
<td>
- <select name="secteur" id="sect_field" onchange="setSecteur(this.value)">
- {html_options options=$secteurs selected=$secteur_sel}
+ <select name="sector" id="sect_field" onchange="setSector(this.value)">
+ {html_options options=$sectors selected=$sectorSelection}
</select>
</td>
</tr>
<div id="{$cat}_{$id}" style="clear: both; margin-top: 0.5em">
<div style="float: left; width: 50%" class="titre" id="{$cat}_{$id}_title">
{$skill.text}
- <input type="hidden" name="{"`$cat`[`$id`][text]"}" value="{$skill.text}" />
</div>
+ <input type="hidden" name="{"`$cat`[`$id`][text]"}" value="{$skill.text}" />
<select name="{"`$cat`[`$id`][level]"}">
{foreach from=$levels item=level key=lid}
<option value="{$lid}" {if $skill.level eq $lid}selected="selected"{/if}>{$level}</option>
{/foreach}
</select>
- <a href="javascript:removeSkill('{$cat}', '{$id}')">{icon name=cross title="Supprimer"}</a>
+ <a href="javascript:removeElement('{$cat}', '{$id}')">{icon name=cross title="Supprimer"}</a>
</div>
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}
{* *}
{**************************************************************************}
-<table class="bicol" style="margin-bottom: 1em">
+<table class="bicol" id="competences_table" style="margin-bottom: 1em">
<tr>
<th>
<div class="flags" style="float: left">
<tr>
<td>
<span class="titre">Domaine :</span>
- <select name="competences_sel" onchange="updateSkill('competences')">
+ <select name="competences_sel" onchange="updateElement('competences')">
<option value=""></option>
{assign var=ingroup value=false}
{iterate from=$comp_list item=comp}
</tr>
</table>
-<table class="bicol">
+<table class="bicol" id="langues_table">
<tr>
<th>
<div class="flags" style="float: left">
<tr>
<td>
<span class="titre">Domaine :</span>
- <select name="langues_sel" onchange="updateSkill('langues')">
+ <select name="langues_sel" onchange="updateElement('langues')">
<option value=""></option>
{iterate from=$lang_list item=lang}
<option value="{$lang.id}">{$lang.langue_fr}</option>
if (schoolId) {
$(".autocomplete[@name='schoolTxt']").addClass('hidden_valid');
-
- $("[@name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
- if ($("select[@name='diploma']").children("option").size() > 1) {
- $("select[@name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
- } else {
- $("select[@name='diploma']").attr('value', '');
- }
- });
} else {
$(".autocomplete[@name='schoolTxt']").removeClass('hidden_valid');
-
- $("select[@name='diploma']").attr('value', '');
}
+
+ $("[@name='diploma']").parent().load(baseurl + 'list/diploma/', { school:schoolId }, function() {
+ $("select[@name='diploma']").attr('value', '{/literal}{$smarty.request.diploma}{literal}');
+ });
}
// when choosing autocomplete from list, must validate
</th>
</tr>
<tr>
- <td>Nom</td>
+ <td>Nom, prénom, surnom...</td>
<td>
<input type="hidden" name="rechercher" value="Chercher"/>
<input type="submit" style="display:none"/>
- <input type="text" class="autocomplete" name="name" size="32" value="{$smarty.request.name}" />
- </td>
- </tr>
- <tr>
- <td>Prénom</td>
- <td>
- <input class="autocomplete" type="text" name="firstname" size="32" value="{$smarty.request.firstname}" />
- </td>
- </tr>
- <tr>
- <td>Surnom</td>
- <td>
- <input class="autocomplete" type="text" name="nickname" size="32" value="{$smarty.request.nickname}" />
+ <input type="text" name="name" size="32" value="{$smarty.request.name}" />
</td>
</tr>
<tr>
</td>
</tr>
<tr>
- <td>Poste</td>
- <td><input type="text" class="autocomplete" name="poste" size="32" value="{$smarty.request.poste}" /></td>
+ <td>Description</td>
+ <td><input type="text" class="autocomplete" name="description" size="32" value="{$smarty.request.description}" /></td>
</tr>
<tr>
<td>Secteur</td>
<td>Commentaire contient</td>
<td><input type="text" name="free" size="32" value="{$smarty.request.free}" /></td>
</tr>
+ <tr>
+ <td>Numéro de téléphone</td>
+ <td><input type="text" name="phone_number" size="32" value="{$smarty.request.phone_number}"/></td>
+ </tr>
+ <tr>
+ <td style="vertical-align: middle">
+ <span>Networking et sites webs</span>
+ </td>
+ <td>
+ <table>
+ <tr>
+ <td style="padding-left: 0px;">
+ <input type="text" name="networking_address" size="32" value="{$smarty.request.networking_address}" />
+ </td>
+ <td>
+ <input type="text" name="networking_typeTxt" class="autocomplete" size="10" value="{$smarty.request.networking_typeTxt}" />
+ <input name="networking_type" class="autocompleteTarget" type="hidden" value="{$smarty.request.networking_type}"/>
+ <a href="networking_type" class="autocompleteToSelect">{icon name="table" title="Tous les types d'adresse"}</a>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
{if $smarty.session.auth ge AUTH_COOKIE}
<tr>
<td colspan="2">
<select name="diploma">
<option value=""> - </option>
{section name=diploma loop=$choix_diplomas}
-<option value="{$choix_diplomas[diploma]}">
- {$choix_diplomas[diploma]}
+{assign var=i value=$choix_diplomas[diploma]}
+{assign var=id value=$i-1}
+<option value="{$i}">
+ {$name_diplomas[$id]}
</option>
{/section}
</select>
<div class="menu_title">Communauté X</div>
<div class="menu_item"><a href="search">Annuaire</a></div>
-<div class="menu_item"><a href="geoloc">Planisphère</a></div>
<div class="menu_item"><a href="emploi">Emploi & Carrières</a></div>
<div class="menu_item"><a href="groupes-x">Mes groupes X</a></div>
<div class="menu_item"><a href="survey">Sondages</a></div>
{assign var="has_cs" value="true"}
{/if}
{/iterate}
- <tr class="impair">
+ <tr class="impair">
<td class="half">
{if !$has_cs}Aucun sondage en cours{/if}
{if $smarty.session.auth}<a style="display: block; float: right;" href="survey/edit/new">{icon name=page_edit} Proposer un sondage</a>{/if}
- </td>
- </tr>
+ </td>
+ </tr>
</table>
<br />
<td class="titre">Type de sondage :</td>
<td>{$survey_modes[$survey.mode]}</td>
</tr>
- {if $survey.mode != Survey::MODE_ALL}
+ {if $survey.mode != Survey::MODE_ALL}
<tr>
- <td class="titre">Promotions :</td>
+ <td class="titre">Promotions :</td>
<td>
- {if $survey.promos eq "#"}
- erreur
- {elseif $survey.promos eq ""}
- aucune restriction
- {else}
- {$survey.promos}
+ {if $survey.promos eq "#"}
+ erreur
+ {elseif $survey.promos eq ""}
+ aucune restriction
+ {else}
+ {$survey.promos}
{/if}
</td>
</tr>
<p class="center">
{if $survey_editmode}
<a href='survey/edit/valid'>
- {icon name=tick}
+ {icon name=tick}
{if $survey_updatemode}Enregistrer les modifications{else}Proposer ce sondage{/if}
</a> |
<a href='survey/edit/cancel'>
</td>
{if $is_admin}
<td class="center">
- <a href="{$platal->ns}member/{if $m.x}{$m.email}{else}{$m.uid}{/if}">{icon name=user_edit title="Edition du profil"}</a>
+ <a href="{$platal->ns}member/{if $m.x}{$m.email}{else}{$m.uid}{/if}">{icon name=user_edit title="Édition du profil"}</a>
<a href="{$platal->ns}member/del/{if $m.x}{$m.email}{else}{$m.uid}{/if}">{icon name=delete title="Supprimer de l'annuaire"}</a>
</td>
{/if}
<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
--- /dev/null
+set @n = 19200001;
+
+INSERT INTO auth_user_md5 (matricule, matricule_ax, promo, promo_sortie, nom_ini, prenom_ini, perms, nom, prenom)
+ SELECT @n := @n + 1, id_ancien, promotion_etude, promotion_etude + 3, CONCAT(partic_patro, Nom_patronymique), prenom,
+ 'pending', CONCAT(partic_patro, Nom_patronymique), prenom
+ FROM fusionax_anciens
+ WHERE promotion_etude = 1920;
+
+-- vim:set syntax=mysql:
--- /dev/null
+CREATE OR REPLACE ALGORITHM=MERGE VIEW fusionax_xorg_anciens AS
+ SELECT u.user_id, u.matricule_ax, u.promo,
+ n.display AS display_name, n.sort AS sort_name,
+ u.nom, u.prenom
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_names_display AS n ON (n.user_id = u.user_id);
+
+-- vim:set syntax=mysql:
--- /dev/null
+INSERT INTO profile_directory (uid, email_directory)
+ SELECT user_id, Mel_usage
+ FROM fusionax_anciens AS ax
+ INNER JOIN auth_user_md5 AS u ON (ax.id_ancien = u.matricule_ax)
+ WHERE Mel_publiable != '0' AND Mel_usage != '';
+
+INSERT IGNORE INTO register_marketing (uid, email, type)
+ SELECT user_id, Mel_usage, 'ax'
+ FROM fusionax_anciens AS ax
+ INNER JOIN auth_user_md5 AS u ON (ax.id_ancien = u.matricule_ax)
+ LEFT JOIN emails AS e ON (e.uid = u.user_id AND e.flags = 'active')
+ WHERE Mel_usage != '' AND
+ Mel_usage NOT LIKE '%@polytechnique.edu' AND
+ Mel_usage NOT LIKE '%@polytechnique.org' AND
+ Mel_usage NOT LIKE '%@m4x.org' AND
+ Mel_usage NOT LIKE '%@melix.%' AND
+ e.email IS NULL;
+
+-- vim:set syntax=mysql:
--- /dev/null
+CREATE TABLE IF NOT EXISTS alumni_data (
+ uid INT(11) NOT NULL,
+ matricule_ax CHAR(8) UNSIGNED NOT NULL,
+ login_ax VARCHAR(15) NOT NULL,
+ passwd_ax INT(11) UNSIGNED DEFAULT NULL,
+ promo_type ENUM('', 'A', 'B', 'C', 'N', 'S') NOT NULL,
+ membership_type ENUM('', '*', 'F', 'FB', 'P', 'PB', 'T', 'TB', 'TA') NOT NULL,
+ salutation ENUM('', '.', 'M', 'MME', 'MLLE') NOT NULL,
+ last_dues_paid_year INT(4) UNSIGNED NOT NULL,
+ represents ENUM('', 'K', 'DE') NOT NULL,
+ checked TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
+ PRIMARY KEY (uid)
+) CHARSET=utf8;
+
+
+INSERT INTO alumni_data (uid, matricule_ax, login_ax, passwd_ax, promo_type, membership_type,
+ salutation, last_dues_paid_year, represents, checked)
+ SELECT u.user_id, u.matricule_ax, f.Login, f.Password, f.Groupe_promo,
+ f.Type_membre, f.Civilite, f.annee_dernCot, f.Representant, 0
+ FROM fusionax_anciens AS f
+ INNER JOIN auth_user_md5 AS u ON (f.id_ancien = u.matricule_ax);
+
+-- vim:set syntax=mysql:
--- /dev/null
+INSERT IGNORE INTO profile_corps_rank_enum (abbreviation, name)
+ VALUES (" ", "Aucun"),
+ ("A", "Amiral"),
+ ("A2", "Amiral 2e Son"),
+ ("ADC", "Adm.Civil"),
+ ("ADC2", "Adm.Civil retr."),
+ ("ADC3", "Adm.Civil cg."),
+ ("ADC4", "Adm.Civil dém."),
+ ("ADC5", "Adm.Civil dét."),
+ ("ADC6", "Adm.Civil dis."),
+ ("ADC7", "Adm.Civil (H.C)"),
+ ("ADC8", "Adm.Civil h.cl."),
+ ("ADHC", "Adm. h.cl.INSEE"),
+ ("ADHC2", "Adm.h.cl.INSEE retr."),
+ ("ADHC3", "Adm.h.cl.INSEE cg."),
+ ("ADHC4", "Adm.h.cl.INSEE dém."),
+ ("ADHC5", "Adm.h.cl.INSEE dét."),
+ ("ADHC6", "Adm.h.cl.INSEE dis."),
+ ("ADHC7", "Adm.h.cl.INSEE (H.C.)"),
+ ("ADIN", "Adm.INSEE"),
+ ("ADIN2", "Adm.INSEE retr."),
+ ("ADIN3", "Adm.INSEE cg"),
+ ("ADIN4", "Adm.INSEE dém."),
+ ("ADIN5", "Adm.INSEE dét."),
+ ("ADIN6", "Adm.INSEE dis."),
+ ("ADIN7", "Adm.INSEE (H.C.)"),
+ ("CA", "Contre-Amiral"),
+ ("CA2", "Contre-Amiral 2e Son"),
+ ("CAA", "Contrôleur des Armées"),
+ ("CB", "Chef de bataillon"),
+ ("CB2", "Chef de bataillon retr."),
+ ("CB8", "Chef de bataillon rés."),
+ ("CBH", "Chef de bataillon"),
+ ("CC", "Capitaine de Corvette"),
+ ("CC2", "Capitaine de Corvette retr."),
+ ("CC8", "Capitaine de Corvette rés."),
+ ("CCA", "Commiss. Contr. Ass."),
+ ("CCA2", "Commiss. Contr. Ass. retr."),
+ ("CCA3", "Commiss. Contr. Ass. cg."),
+ ("CCA4", "Commiss. Contr. Ass. dém."),
+ ("CCA5", "Commiss. Contr. Ass. dét."),
+ ("CCA6", "Commiss. Contr. Ass. dis."),
+ ("CCA7", "Commiss. Contr. Ass. (HC)"),
+ ("CCCA", "Commiss. Contr. Ch. Ass."),
+ ("CCCA2", "Commiss. Contr. Ch. Ass. retr."),
+ ("CCCA3", "Commiss. Contr. Ch. Ass. cg."),
+ ("CCCA4", "Commiss. Contr. Ch. Ass. dém."),
+ ("CCCA5", "Commiss. Contr. Ch. Ass. dét."),
+ ("CCCA6", "Commiss. Contr. Ch. Ass. dis."),
+ ("CCCA7", "Commiss. Contr. Ch. Ass. (HC)"),
+ ("CCGA", "Commiss. Contr. Gén. Ass."),
+ ("CCGA2", "Commiss. Contr. Gén. Ass.retr."),
+ ("CCGA3", "Commiss. Contr. Gén. Ass. cg."),
+ ("CCGA4", "Commiss. Contr. Gén. Ass. dém."),
+ ("CCGA5", "Commiss. Contr. Gén. Ass. dét."),
+ ("CCGA6", "Commiss. Contr. Gén. Ass. dis."),
+ ("CCGA7", "Commiss. Contr. Gén. Ass. (HC)"),
+ ("CCH", "Capitaine de Corvette hon."),
+ ("Cdt", "Commandant"),
+ ("Cdt2", "Commandant retr."),
+ ("Cdt5", "Commandant dém."),
+ ("Cdt8", "Commandant de rés."),
+ ("CE", "Chef d'Escadron"),
+ ("CE2", "Chef d'Escadron retr."),
+ ("CE3", "Chef d'Escadrons"),
+ ("CE4", "Chef d'Escadrons"),
+ ("CE5", "Chef d'Escadrons de rés."),
+ ("CF", "Capitaine de Frégate"),
+ ("CF2", "Capitaine de Frégate"),
+ ("CF9", "Capitaine de Frégate (CR)"),
+ ("CFC1", "Ing.ch.SNCF"),
+ ("CFC11", "Ing.ch.h.cl.SNCF"),
+ ("CFC2", "Ing.ch.retr.SNCF"),
+ ("CFC3", "Ing.ch.hon.SNCF"),
+ ("CFC31", "Ing.ch.h.cl.SNCF"),
+ ("CFC4", "Ing.ch.H.C.hon.SNCF"),
+ ("CFC5", "Ing.ch.h.cl.hon.SNCF"),
+ ("CFC6", "Ing.ch.h.cl.retr.SNCF"),
+ ("CFD1", "Direct.Gén.SNCF"),
+ ("CFD2", "Direct.Gén.hon.SNCF"),
+ ("CFD3", "Direct.SNCF"),
+ ("CFD4", "Direct.hon.SNCF"),
+ ("CFD5", "Direct.retr.SNCF"),
+ ("CFD6", "DGA hon.SNCF"),
+ ("CFG1", "Ing.gén.SNCF"),
+ ("CFG2", "Ing.gén.retr.SNCF"),
+ ("CFG3", "Ing.gén.hon.SNCF"),
+ ("CFH", "Capitaine de Frégate hon."),
+ ("CFP1", "Ing.pp.SNCF"),
+ ("CFP2", "Ing.pp.retr.SNCF"),
+ ("CFP3", "Ing.pp.hon.SNCF"),
+ ("CFP4", "Ing.pp.H.C.hon.SNCF"),
+ ("CFP5", "Ing.pp.h.cl.hon.SNCF"),
+ ("CFP6", "Ing.pp.h.cl.SNCF"),
+ ("CGA", "Contrôleur Général des Armées"),
+ ("CGA2", "Contrôl.Gén.des Armées 2e Son"),
+ ("Cne", "Capitaine"),
+ ("Cne2", "Capitaine retr."),
+ ("Cne5", "Capitaine dém."),
+ ("Cne6", "Capitaine dis."),
+ ("Cne8", "Capitaine de rés."),
+ ("Col", "Colonel"),
+ ("Col2", "Colonel retr."),
+ ("Col3", "Colonel Brth retr."),
+ ("Col4", "Colonel (Air) retr."),
+ ("Col5", "Colonel hon.(Air)"),
+ ("Colh", "Colonel hon."),
+ ("COM1C", "Commiss.1e cl.Marine"),
+ ("COM2", "Commiss.Marine retr."),
+ ("COM2C", "Commiss.2e cl.Marine"),
+ ("COM4", "Commiss.Marine dém."),
+ ("COM8", "Commiss.Marine rés."),
+ ("COMC", "Commiss.ch.Marine"),
+ ("COMC1", "Commiss.ch.1e cl.Marine"),
+ ("COMC2", "Commiss.ch.Marine retr."),
+ ("COMC8", "Commiss.ch.Marine rés."),
+ ("COMD", "Commiss.Cdt"),
+ ("COMG", "Comm.Gén.Mar.2e Son"),
+ ("COMG1", "Comm.Gén.1e cl.Mar.2e Son"),
+ ("COMG2", "Comm.Gén.2e cl.Mar.2e Son"),
+ ("COMGP", "Commiss.gén.aux prix hon."),
+ ("COMP", "Commiss.pp.Marine"),
+ ("COMP2", "Commiss.pp Marine retr."),
+ ("COMP8", "Commiss.pp.Marine rés."),
+ ("CONE", "Contrôl.Gén Eco.et Financ."),
+ ("CONE2", "Contrôl.Gén Eco.et Financ.ret"),
+ ("CONE3", "Contrôl.Gén Eco.et Financ.cg."),
+ ("CONE4", "Contrôl.Gén Eco.et Financ.dém."),
+ ("CONE5", "Contrôl.Gén Eco.et Financ.dét."),
+ ("CONE6", "Contrôl.Gén Eco.et Financ. dis"),
+ ("CONE7", "Contrôl.Gén Eco.et Financ.H.C."),
+ ("CONEH", "Contrôl.Gén Eco.et Financ.hon."),
+ ("CV", "Capitaine de Vaisseau"),
+ ("CV2", "Capitaine de Vaisseau retr."),
+ ("CV9", "Capitaine de Vaisseau (CR)"),
+ ("CVH", "Capitaine de Vaisseau hon."),
+ ("DRT", "Direct.rég.Téléc."),
+ ("DRT2", "Direct.rég.Téléc. retr."),
+ ("DRT3", "Direct.rég.Téléc. cg."),
+ ("DRT4", "Direct.rég.Téléc. dém."),
+ ("DRT5", "Direct.rég.Téléc. dét."),
+ ("DRT6", "Direct.rég.Téléc. dis."),
+ ("DRT7", "Direct.rég.Téléc. (H.C.)"),
+ ("DRT8", "Direct.rég.Téléc. hon."),
+ ("EF2", "Ing.EDF retr."),
+ ("EF3", "Ing.EDF cg."),
+ ("EF4", "Ing.EDF dém."),
+ ("EF5", "Ing.EDF dét."),
+ ("EF6", "Ing.EDF dis."),
+ ("EFC2", "Ing.ch.EDF retr."),
+ ("EFC3", "Ing.ch.EDF cg."),
+ ("EFC4", "Ing.ch.EDF dém."),
+ ("EFC5", "Ing.ch.EDF dét."),
+ ("EFC6", "Ing.ch.EDF dis."),
+ ("EFC7", "Ing.ch.EDF (HC)"),
+ ("EFCO1", "Contrôl.gén.hon.EDF"),
+ ("EFD", "Direct. EDF"),
+ ("EFD2", "Direct.hon.EDF"),
+ ("EFDG", "Direct.Gén. EDF"),
+ ("EFDG2", "Direct.Gén.hon.EDF"),
+ ("EFG2", "Ing.gén.EDF retr."),
+ ("EFGH", "Insp.gén.hon.EDF"),
+ ("EFP2", "Ing.pp.EDF retr."),
+ ("EFP3", "Ing.pp.EDF cg."),
+ ("EFP4", "Ing.pp.EDF dém."),
+ ("EFP5", "Ing.pp.EDF dét."),
+ ("EFP6", "Ing.pp.EDF dis."),
+ ("EFP7", "Ing.pp.EDF (HC)"),
+ ("EFS", "Insp.gén.EDF"),
+ ("EFS2", "Insp.gén.EDF retr."),
+ ("EFS3", "Insp.gén.hon. EDF"),
+ ("ESC", "Ing.ch.des Essences"),
+ ("ESC10", "Ing.ch. 1e cl.des Essence CR"),
+ ("ESC2", "Ing.ch.des Essences retr."),
+ ("ESC3", "Ing.ch.des Essences cg."),
+ ("ESC4", "Ing.ch.des Essences dém."),
+ ("ESC5", "Ing.ch.des Essences dét."),
+ ("ESC6", "Ing.ch.des Essences dis."),
+ ("ESC7", "Ing.ch.des Essences (H.C.)"),
+ ("ESC9", "Ing.ch.des Essences CR"),
+ ("ESG", "Ing.gén.des Essences"),
+ ("ESG2", "Ing.gén.des Essences retr."),
+ ("ESG3", "Ing.gén.des Essences cg."),
+ ("ESG4", "Ing.gén.des Essences dém."),
+ ("ESG5", "Ing.gén.des Essences dét."),
+ ("ESG6", "Ing.gén.des Essences dis."),
+ ("ESG7", "Ing.gén.des Essences (H.C.)"),
+ ("ESI", "Ing.des Essences"),
+ ("ESI2", "Ing.des Eseences retr."),
+ ("ESI3", "Ing.des Essences cg."),
+ ("ESI4", "Ing.des Essences dém."),
+ ("ESI5", "Ing.des Essences dét."),
+ ("ESI6", "Ing.des Essences dis."),
+ ("ESI7", "Ing.des Essences (H.C.)"),
+ ("EV", "Enseigne de Vaisseau"),
+ ("GA", "Général d'Armée"),
+ ("GA2", "Général d'Armée 2e Son"),
+ ("GAE", "Général d'Armée Aér."),
+ ("GAE2", "Général d'Armée Aér.2e Son"),
+ ("GB", "Général de Brigade"),
+ ("GB2", "Général de Brigade 2e Son"),
+ ("GBAE", "Général de Brigade Aér."),
+ ("GBAE2", "Général de Brig.Aér.2e Son"),
+ ("GCA", "Général de C.A."),
+ ("GCA2", "Général de C.A. 2e Son"),
+ ("GCAE", "Général de C.A.Aér."),
+ ("GCAE2", "Général de C.A.Aér. 2e Son"),
+ ("GD", "Général de Division"),
+ ("GD2", "Général de Division 2e Son"),
+ ("GDAE", "Général de Division Aér."),
+ ("GDAE2", "Général de Div.Aér. 2e Son"),
+ ("GDFC2", "Contrôleur gén.GDF retr."),
+ ("GDFD3", "Direct.hon.GDF"),
+ ("GDFI", "Insp.gén.hon.GDF"),
+ ("GM2", "Ing. Arm. (GM) retr."),
+ ("GM3", "Ing. Arm. (GM) cg."),
+ ("GM4", "Ing. Arm. (GM) dém."),
+ ("GM7", "Ing. Arm. (GM) H.C"),
+ ("GM8", "Ing. Arm. (GM) rés."),
+ ("GM9", "Ing. Arm. (GM) CR"),
+ ("GMC", "Ing.ch.Arm.(GM)"),
+ ("GMC1", "Ing.ch.Arm (GM)"),
+ ("GMC2", "Ing.ch.Arm.(GM) retr."),
+ ("GMC3", "Ing.ch.Arm.(GM) cg."),
+ ("GMC4", "Ing.ch.Arm.(GM) dém."),
+ ("GMC7", "Ing.ch.Arm.(GM) H.C"),
+ ("GMC8", "Ing.ch.Arm.(GM) rés."),
+ ("GMC9", "Ing.ch.Arm.(GM) CR"),
+ ("GMG", "Ing.Gén.Arm.(GM)"),
+ ("GMG02", "Ing.Gén.Arm.(GM) 2e Son"),
+ ("GMG1", "Ing.Gén.1e cl.Arm.(GM) 2e Son"),
+ ("GMG11", "Ing.Gén.1e cl.Arm.(GM)"),
+ ("GMG2", "Ing.Gén.2e cl.Arm.(GM) 2e Son"),
+ ("GMG22", "Ing.Gén.2e cl.Arm.(GM)"),
+ ("GMP", "Ing.pp.Arm.(GM)"),
+ ("GMP2", "Ing.pp.Arm.(GM) retr."),
+ ("GMP3", "Ing.pp.Arm.(GM) cg."),
+ ("GMP4", "Ing.pp.Arm.(GM) dém."),
+ ("GMP7", "Ing.pp.Arm.(GM) H.C"),
+ ("GMP8", "Ing.pp.Arm.(GM) rés."),
+ ("GMP9", "Ing.pp.Arm.(GM) CR"),
+ ("GMT12", "Ing.Gén.1e cl. Mat. 2e Son"),
+ ("GMT2", "Ing.Gén.du Mat. 2e Son"),
+ ("GMT22", "Ing.Gén.2e cl. Mat. 2e Son"),
+ ("HG02", "Ing.Gén.Arm.(H) 2e Son"),
+ ("IA", "Ing.Arm."),
+ ("IA2", "Ing.Arm. retr."),
+ ("IA3", "Ing.Arm. cg."),
+ ("IA4", "Ing.Arm. dém."),
+ ("IA5", "Ing.Arm. dét."),
+ ("IA6", "Ing.Arm. dis."),
+ ("IA7", "Ing.Arm. (H.C.)"),
+ ("IA8", "Ing.Arm. rés."),
+ ("IA9", "Ing.Arm. (CR)"),
+ ("IAC8", "Ing.ch.Arm. rés."),
+ ("IAv", "Ing.Av.C."),
+ ("IAv2", "Ing.Av.C. retr."),
+ ("IAV3", "Ing.Av.C. cg."),
+ ("IAv4", "Ing.Av.C. dém."),
+ ("IAv5", "Ing.Av.C. dét."),
+ ("IAv6", "Ing.Av.C. dis."),
+ ("IAv7", "Ing.Av.C. (H.C.)"),
+ ("ICA", "Ing.ch.Arm."),
+ ("ICA2", "Ing.ch.Arm.retr."),
+ ("ICA3", "Ing.ch.Arm. cg."),
+ ("ICA4", "Ing.ch.Arm. dém."),
+ ("ICA5", "Ing.ch.Arm. dét."),
+ ("ICA6", "Ing.ch.Arm. dis"),
+ ("ICA7", "Ing.ch.Arm. (H.C.)"),
+ ("ICA8", "Ing.ch.Arm.rés."),
+ ("ICA9", "Ing.ch.Arm. (CR)"),
+ ("ICAv", "Ing.ch.Av.C."),
+ ("ICAv2", "Ing.ch.Av.C. retr."),
+ ("ICAv3", "Ing.ch.Av.C. cg."),
+ ("ICAv4", "Ing.ch.Av.C. dém."),
+ ("ICAv5", "Ing.ch.Av.C. dét."),
+ ("ICAv6", "Ing.ch.Av.C. dis."),
+ ("ICAv7", "Ing.ch.Av.C. (H.C.)"),
+ ("ICG", "Ing.ch.GREF"),
+ ("ICG2", "Ing.ch.GREF retr."),
+ ("ICG3", "Ing.ch.GREF cg."),
+ ("ICG4", "Ing.ch.GREF dém."),
+ ("ICG5", "Ing.ch.GREF dét."),
+ ("ICG6", "Ing.ch.GREF dis."),
+ ("ICG7", "Ing.ch.GREF (H.C.)"),
+ ("ICGO", "Ing.ch.Géog."),
+ ("ICGO2", "Ing.ch.Géog. retr."),
+ ("ICGO3", "Ing.ch.Géog. cg"),
+ ("ICGO4", "Ing.ch.Géog. dém."),
+ ("ICGO5", "Ing.ch.Géog. dét."),
+ ("ICGO6", "Ing.ch.Géog. dis."),
+ ("ICGO7", "Ing.ch.Géog. (H.C.)"),
+ ("ICIM", "Ing.ch.I.M."),
+ ("ICIM2", "Ing.ch.I.M. retr."),
+ ("ICIM3", "Ing.ch.I.M. cg."),
+ ("ICIM4", "Ing.ch.I.M. dém."),
+ ("ICIM5", "Ing.ch.I.M. dét."),
+ ("ICIM6", "Ing.ch.I.M. dis."),
+ ("ICIM7", "Ing.ch.I.M. (H.C.)"),
+ ("ICM", "Ing.ch.Mines"),
+ ("ICM2", "Ing.ch.Mines retr."),
+ ("ICM3", "Ing.ch.Mines cg."),
+ ("ICM4", "Ing.ch.Mines dém."),
+ ("ICM5", "Ing.ch.Mines dét."),
+ ("ICM6", "Ing.ch.Mines dis."),
+ ("ICM7", "Ing.ch.Mines (H.C.)"),
+ ("ICME", "Ing.ch.M.E."),
+ ("ICME2", "Ing.ch.M.E. retr."),
+ ("ICME3", "Ing.ch.M.E. cg."),
+ ("ICME4", "Ing.ch.M.E. dém."),
+ ("ICME5", "Ing.ch.M.E. dét."),
+ ("ICME6", "Ing.ch.M.E. dis."),
+ ("ICME7", "Ing.ch.M.E (H.C.)"),
+ ("ICMO", "Ing.ch.Météo."),
+ ("ICMO2", "Ing.ch.Météo.retr."),
+ ("ICMO3", "Ing.ch.Météo.cg"),
+ ("ICMO4", "Ing.ch.Météo.dém."),
+ ("ICMO5", "Ing.ch.Météo.dét."),
+ ("ICMO6", "Ing.ch.Météo.dis"),
+ ("ICMO7", "Ing.ch.Météo. (H.C.)"),
+ ("ICMT2", "Ing.ch.Mat. retr."),
+ ("ICMT3", "Ing.ch.1e cl. Mat hon."),
+ ("ICMT4", "Ing.ch.2e cl. Mat. hon."),
+ ("ICPC", "Ing.ch.P.C."),
+ ("ICPC2", "Ing.ch.P.C. retr."),
+ ("ICPC3", "Ing.ch.P.C. cg."),
+ ("ICPC4", "Ing.ch.P.C. dém."),
+ ("ICPC5", "Ing.ch.P.C. dét."),
+ ("ICPC6", "Ing.ch.P.C. dis."),
+ ("ICPC7", "Ing.ch.P.C. (H.C.)"),
+ ("ICT", "Ing.ch.Téléc."),
+ ("ICT2", "Ing.ch.Téléc. retr."),
+ ("ICT3", "Ing.ch.Téléc. cg."),
+ ("ICT4", "Ing.ch.Téléc. dém."),
+ ("ICT5", "Ing.ch.Téléc. dét."),
+ ("ICT6", "Ing.ch.Téléc. dis."),
+ ("ICT7", "Ing.ch.Téléc. (H.C.)"),
+ ("ICTH", "Ing.ch.Téléc. hon."),
+ ("IFi", "Insp.des Finances"),
+ ("IFi2", "Insp.des Finances retr."),
+ ("IFi3", "Insp.des Finances cg."),
+ ("IFi4", "Insp.des Finances dém."),
+ ("IFi5", "Insp.des Finances dét."),
+ ("IFi6", "Insp.des Finances dis."),
+ ("IFi7", "Insp.des Finances (H.C.)"),
+ ("IG", "Ing.GREF"),
+ ("IG11", "Ing.Gén.1e cl.Arm."),
+ ("IG12", "Ing.Gén.1e cl.Arm. 2e Son"),
+ ("IG13", "Ing.Gén.1e cl.Arm. cg."),
+ ("IG15", "Ing.Gén.1e cl.Arm. dét."),
+ ("IG16", "Ing.Gén.1e cl.Arm. dis."),
+ ("IG17", "Ing.Gén.1e cl.Arm. (H.C.)"),
+ ("IG19", "Ing.Gén.1e cl.Arm. (CR)"),
+ ("IG2", "Ing.GREF retr."),
+ ("IG21", "Ing.Gén.2e cl.Arm."),
+ ("IG22", "Ing.Gén.2e cl.Arm. 2e Son"),
+ ("IG23", "Ing.Gén.2e cl.Arm. cg."),
+ ("IG25", "Ing.Gén.2e cl.Arm. dét."),
+ ("IG26", "Ing.Gén.2e cl.Arm. dis."),
+ ("IG27", "Ing.Gén.2e cl.Arm. (H.C.)"),
+ ("IG29", "Ing.Gén.2e cl.Arm. (CR)"),
+ ("IG3", "Ing.GREF cg."),
+ ("IG4", "Ing.GREF dém."),
+ ("IG5", "Ing.GREF dét."),
+ ("IG6", "Ing.GREF dis."),
+ ("IG7", "Ing.GREF (H.C.)"),
+ ("IGA", "Ing.gén.Arm."),
+ ("IGA2", "Ing.gén.Arm. 2e Son"),
+ ("IGA3", "Ing.gén.Arm. cg."),
+ ("IGA5", "Ing.gén.Arm. dét."),
+ ("IGA6", "Ing.gén.Arm. dis."),
+ ("IGA7", "Ing.gén.Arm. (H.C.)"),
+ ("IGA8", "Ing.gén.Arm.(C.R.)"),
+ ("IGAv", "Ing.gén.Av.C."),
+ ("IGAv2", "Ing.gén.Av.C. retr."),
+ ("IGAv3", "Ing.gén.Av.C. cg."),
+ ("IGAv4", "Ing.gén.Av.C. dém."),
+ ("IGAv5", "Ing.gén.Av.C. dét."),
+ ("IGAv6", "Ing.gén.Av.C. dis"),
+ ("IGAv7", "Ing.gén.Av.C. (H.C.)"),
+ ("IGE", "Ing.gén.de cl.except.Arm."),
+ ("IGE2", "Ing.gén.de cl.except.Arm.2eSon"),
+ ("IGFi", "Insp.gén.des Finances"),
+ ("IGFi2", "Insp.gén.des Finances retr."),
+ ("IGFi3", "Insp.gén.des Finances cg."),
+ ("IGFi4", "Insp.gén.des Finances dém."),
+ ("IGFi5", "Insp.gén.des Finances dét."),
+ ("IGFi6", "Insp.gén.des Finances dis."),
+ ("IGFi7", "Insp.gén.des Finances (H.C.)"),
+ ("IGG", "Ing.gén.GREF"),
+ ("IGG2", "Ing.gén.GREF retr."),
+ ("IGG3", "Ing.gén.GREF cg."),
+ ("IGG4", "Ing.gén.GREF dém."),
+ ("IGG5", "Ing.gén.GREF dét."),
+ ("IGG6", "Ing.gén.GREF dis."),
+ ("IGG7", "Ing.gén.GREF (H.C.)"),
+ ("IGGO", "Ing.gén.Géog."),
+ ("IGGO2", "Ing.gén.Géog. retr."),
+ ("IGGO3", "Ing.gén.Géog. cg."),
+ ("IGGO4", "Ing.gén.Géog. dém."),
+ ("IGGO5", "Ing.gén.Géog. dét."),
+ ("IGGO6", "Ing.gén.Géog. dis."),
+ ("IGGO7", "Ing.gén.Géog. (H.C.)"),
+ ("IGH", "Ing.gén.hors cl. Arm."),
+ ("IGH2", "Ing.gén.hors cl.Arm.2e Son"),
+ ("IGIM", "Ing.gén.I.M."),
+ ("IGIM2", "Ing.gén.I.M. retr."),
+ ("IGIN", "Insp.gén.INSEE"),
+ ("IGIN2", "Insp.gén.INSEE retr."),
+ ("IGIN3", "Insp.gén.INSEE cg."),
+ ("IGIN4", "Insp.gén.INSEE dém."),
+ ("IGIN5", "Insp.gén.INSEE dét."),
+ ("IGIN6", "Insp.gén.INSEE dis."),
+ ("IGIN7", "Insp.gén.INSEE (H.C.)"),
+ ("IGIN8", "Insp.gén.INSEE hon."),
+ ("IGM", "Ing.gén.Mines"),
+ ("IGM2", "Ing.gén.Mines retr."),
+ ("IGM3", "Ing.gén.Mines cg."),
+ ("IGM4", "Ing.gén.Mines dém."),
+ ("IGM5", "Ing.gén.Mines dét."),
+ ("IGM6", "Ing.gén.Mines dis."),
+ ("IGM7", "Ing.gén.Mines (H.C.)"),
+ ("IGME", "Insp.gén.M.E."),
+ ("IGME2", "Insp.gén.M.E. retr."),
+ ("IGME3", "Insp.gén.M.E. cg"),
+ ("IGME4", "Insp.gén.M.E. dém."),
+ ("IGME5", "Insp.gén.M.E. dét."),
+ ("IGME6", "Insp.gén.M.E. dis."),
+ ("IGME7", "Insp.gén.M.E.(H.C)."),
+ ("IGMO", "Ing.gén.Météo."),
+ ("IGMO2", "Ing.gén.Météo. retr."),
+ ("IGMO3", "Ing.gén.Météo. cg."),
+ ("IGMO4", "Ing.gén.Météo. dém."),
+ ("IGMO5", "Ing.gén.Météo. dét."),
+ ("IGMO6", "Ing.gén.Météo. dis."),
+ ("IGMO7", "Ing.gén.Météo. (H.C.)"),
+ ("IGO", "Ing.Géog."),
+ ("IGO2", "Ing.Géog. retr."),
+ ("IGO3", "Ing.Géog. cg."),
+ ("IGO4", "Ing.Géog. dém."),
+ ("IGO5", "Ing.Géog. dét."),
+ ("IGO6", "Ing.Géog. dis."),
+ ("IGO7", "Ing.Géog. (H.C.)"),
+ ("IGPC", "Ing.gén.P.C."),
+ ("IGPC2", "Ing.gén.P.C. hon."),
+ ("IGPC3", "Ing.gén.P.C. cg."),
+ ("IGPC4", "Ing.gén.P.C. dém."),
+ ("IGPC5", "Ing.gén.P.C. dét."),
+ ("IGPC6", "Ing.gén.P.C. dis."),
+ ("IGPC7", "Ing.gén.P.C. (H.C.)"),
+ ("IGT", "Ing.gén.Téléc."),
+ ("IGT12", "Ing.gén.1e cl.Téléc. retr."),
+ ("IGT2", "Ing.gén.Téléc. retr."),
+ ("IGT22", "Ing.gén.2e cl.Téléc. retr."),
+ ("IGT3", "Ing.gén.Téléc. cg."),
+ ("IGT4", "Ing.gén.Téléc. dém."),
+ ("IGT5", "Ing.gén.Téléc. dét."),
+ ("IGT6", "Ing.gén.Téléc. dis."),
+ ("IGT7", "Ing.gén.Téléc.(H.C.)"),
+ ("IGTH", "Ing.gén.Téléc. hon."),
+ ("IIM", "Ing.I.M."),
+ ("IIM2", "Ing.I.M. retr."),
+ ("IIM3", "Ing.I.M. cg."),
+ ("IIM4", "Ing.I.M. dém."),
+ ("IIM5", "Ing.I.M. dét."),
+ ("IIM6", "Ing.I.M. dis."),
+ ("IIM7", "Ing.I.M. (H.C.)"),
+ ("IM", "Ing.Mines"),
+ ("IM2", "Ing.Mines retr."),
+ ("IM3", "Ing.Mines cg."),
+ ("IM4", "Ing.Mines dém."),
+ ("IM5", "Ing.Mines dét."),
+ ("IM6", "Ing.Mines dis."),
+ ("IM7", "Ing.Mines (H.C.)"),
+ ("IME", "Ing.M.E."),
+ ("IME2", "Ing.M.E. retr."),
+ ("IME3", "Ing.M.E. cg."),
+ ("IME4", "Ing.M.E. dém."),
+ ("IME5", "Ing.M.E. dét."),
+ ("IME6", "Ing.M.E. dis."),
+ ("IME7", "Ing.M.E (H.C.)"),
+ ("IMO", "Ing.Météo."),
+ ("IMO2", "Ing.Météo. retr."),
+ ("IMO3", "Ing.Météo. cg."),
+ ("IMO4", "Ing.Météo.dém."),
+ ("IMO5", "Ing.Météo. dét."),
+ ("IMO6", "Ing.Météo. dis."),
+ ("IMO7", "Ing.Météo. (H.C.)"),
+ ("ININ", "Insp.INSEE"),
+ ("ININ2", "Insp.INSEE retr."),
+ ("ININ3", "Insp.INSEE cg."),
+ ("ININ4", "Insp.INSEE dém."),
+ ("ININ5", "Insp.INSEE dét."),
+ ("ININ6", "Insp.INSEE dis."),
+ ("ININ7", "Insp.INSEE (H.C.)"),
+ ("INT12", "Intent.Milit.1e cl. retr."),
+ ("INT22", "Intent.Milit.2e cl. retr."),
+ ("INTG", "Intent.Gén.2e Son"),
+ ("INTG1", "Intent.Gén.1ere cl.2e Son"),
+ ("INTG2", "Intent.Gén.2e cl.2e Son"),
+ ("IPA", "Ing.pp.Arm."),
+ ("IPA2", "Ing.pp.Arm.retr."),
+ ("IPA3", "Ing.pp.Arm. cg."),
+ ("IPA4", "Ing.pp.Arm. dém."),
+ ("IPA5", "Ing.pp.Arm. dét."),
+ ("IPA6", "Ing.pp.Arm. dis."),
+ ("IPA7", "Ing.pp.Arm. (H.C.)"),
+ ("IPA8", "Ing.pp.Arm. rés."),
+ ("IPA9", "Ing.pp.Arm. (CR)"),
+ ("IPC", "Ing.P.C."),
+ ("IPC2", "Ing.P.C. retr."),
+ ("IPC3", "Ing.P.C. cg."),
+ ("IPC4", "Ing.P.C. dém."),
+ ("IPC5", "Ing.P.C. dét."),
+ ("IPC6", "Ing.P.C. dis."),
+ ("IPC7", "Ing.P.C. (H.C.)"),
+ ("IPG", "Ing.pp.GREF"),
+ ("IPG2", "Ing.pp.GREF retr."),
+ ("IPG3", "Ing.pp.GREF cg."),
+ ("IPG4", "Ing.pp.GREF dém."),
+ ("IPG5", "Ing.pp.GREF dét."),
+ ("IPG6", "Ing.pp.GREF dis."),
+ ("IPG7", "Ing.pp.GREF (H.C.)"),
+ ("ISG2", "Insp.pp.des E.et F.OM.retr."),
+ ("IT", "Ing.Téléc."),
+ ("IT2", "Ing.Téléc. retr."),
+ ("IT3", "Ing.Téléc. cg."),
+ ("IT4", "Ing.Téléc. dém."),
+ ("IT5", "Ing.Téléc. dét."),
+ ("IT6", "Ing.Téléc. dis."),
+ ("IT7", "Ing.Téléc. (H.C.)"),
+ ("L.Co", "Lieut.-Colonel"),
+ ("L.Co2", "Lieut.-Colonel retr."),
+ ("L.Co5", "Lieut.-Colonel dém."),
+ ("L.Co8", "Lieut.-Colonel rés."),
+ ("L.Coh", "Lieut.-Colonel hon."),
+ ("Lt", "Lieutenant"),
+ ("Lt6", "Lieutenant dis."),
+ ("Lt8", "Lieutenant rés."),
+ ("LV", "Lieutenant de Vaisseau"),
+ ("NAéG2", "Ing.gén.N.Aé.retr"),
+ ("VA", "Vice-Amiral"),
+ ("VA2", "Vice-Amiral 2e Son"),
+ ("VAE", "Vice-Amiral d'Escadre"),
+ ("VAE2", "Vice-Amiral d'Escadre 2e Son");
+
+INSERT IGNORE INTO profile_corps_enum (abbreviation, name, still_exists)
+ VALUES ("D", "Aucun (anc. démissionnaire)", 1),
+ ("Ad.C", "Adm. des Colonies", 0),
+ ("Agr.C", "Agriculture aux Colonies", 0),
+ ("Z", "Ancien élève étranger", 0),
+ ("Aé", "Arm.Aéronautique", 0),
+ ("ABC", "Arme blindée", 0),
+ ("Arm", "Ingénieurs de l'Armement", 1),
+ ("A", "Artillerie", 0),
+ ("AC", "Artillerie coloniale", 0),
+ ("AM", "Artillerie de Marine", 0),
+ ("AN", "Artillerie Navale", 0),
+ ("Av.C", "Aviation Civile", 0),
+ ("B", "Bourse d'études", 0),
+ ("Cav", "Cavalerie", 0),
+ ("Cha", "Chars de Combat", 0),
+ ("C.A", "Commissaire de l'Air", 0),
+ ("C.M", "Commissariat de la Marine", 0),
+ ("C.Ap", "Contrôle des Assurances", 1),
+ ("EF.Ma", "E.& F. du Maroc", 0),
+ ("E.F", "Eaux et Forêts", 0),
+ ("EFC", "Eaux et Forêts des Colonies", 0),
+ ("EFOM", "Eaux et Forêts Outre-Mer", 0),
+ ("ENA", "Ecole Nation.d'Administration", 0),
+ ("-", "Elève à l'Ecole", 0),
+ ("W", "Elève catégorie particulière", 0),
+ ("w", "Elève étranger naturalisé", 0),
+ (" ", "Elève non sorti de l'école", 0),
+ ("FA", "Fabrication d'Armement", 0),
+ ("Gend", "Gendarmerie", 0),
+ ("G", "Génie", 0),
+ ("GM", "Génie Maritime", 0),
+ ("GR", "Génie Rural", 0),
+ ("GREF", "Génie Rural Eaux et Forêts", 1),
+ ("IG", "Géographe", 0),
+ ("Géo.C", "Géologie des Colonies", 0),
+ ("H", "Hydrographes", 0),
+ ("I", "Infanterie", 0),
+ ("I.C", "Infanterie Coloniale", 0),
+ ("I.Ma", "Infanterie de Marine", 0),
+ ("St", "Institut nat.de la statistique", 0),
+ ("IM", "Instruments de mesure", 0),
+ ("ME", "Manufactures Etat Tabacs", 0),
+ ("Mat", "Matériel Armée de Terre", 0),
+ ("Mét", "Météorologie nationale", 0),
+ ("M", "Mines", 1),
+ ("MC", "Mines coloniales", 0),
+ ("MOM", "Mines Outre-Mer", 0),
+ ("N.Aé", "Navigation Aérienne", 0),
+ ("Air", "Offic.de l'Air", 0),
+ ("ORTF", "Office Radio-Télévision franç.", 0),
+ ("BaAir", "Officier des Bases de l'Air", 0),
+ ("Mar", "Officiers de marine", 0),
+ ("OMAir", "Officiers mécaniciens Air", 0),
+ ("PC", "Ponts et Chaussées", 1),
+ ("PCC", "Ponts et Chaussées Colonies", 0),
+ ("PCOM", "Ponts et Chaussées Outre-Mer", 0),
+ ("PTC", "Postes et Télécom.Colonies", 0),
+ ("PTOM", "Postes et Télécom.Outre-Mer", 0),
+ ("P", "Poudres", 0),
+ ("Rad", "Radiodiffusion française", 0),
+ ("Rech", "Recherche", 0),
+ ("R", "Réformé en fin d'études", 0),
+ ("Bât.", "Service des Bâtiments", 0),
+ ("C.F", "SNCF", 0),
+ ("Sp", "Sports", 0),
+ ("Téléc", "Télécommunications", 1),
+ ("Té.A", "Télécommunications d'Armement", 0),
+ ("Tr", "Train", 0),
+ ("Tra", "Transmissions", 0),
+ ("Tra.C", "Transmissions Coloniales", 0),
+ ("TPC", "Travaux publics des Colonies", 0),
+ ("TP Ic", "Travaux publics en Indochine", 0),
+ ("TPOM", "Travaux publics Outre-Mer", 0),
+ ("TdM", "Troupes de Marine", 0),
+ ("INSEE", "Administrateurs de l'INSEE", 1),
+ ("Off", "Officiers des Armées", 1);
+
+INSERT IGNORE INTO profile_corps (uid, original_corpsid, current_corpsid, rankid, corps_pub)
+ SELECT u.user_id, c.id, c.id, r.id, 'ax'
+ FROM auth_user_md5 AS u
+ INNER JOIN fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+ INNER JOIN profile_corps_enum AS c ON (f.corps_sortie = c.abbreviation)
+ INNER JOIN profile_corps_rank_enum AS r ON (f.grade = r.abbreviation);
+
+ALTER TABLE watch_profile MODIFY field ENUM('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',
+ 'nationalite3', 'nick', 'web', 'networking', 'edus', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo', 'corps');
+
+-- vim:set syntax=mysql:
--- /dev/null
+CREATE TEMPORARY TABLE IF NOT EXISTS tmp_update_fusionax_anciens (
+ good CHAR(4) DEFAULT NULL,
+ bad CHAR(4) DEFAULT NULL,
+ PRIMARY KEY(bad),
+ UNIQUE KEY(good)
+) CHARSET=utf8;
+
+INSERT IGNORE INTO tmp_update_fusionax_anciens (bad, good)
+ VALUES ('TC', 'CAM'),
+ ('SH', 'CN'),
+ ('R', 'RO'),
+ ('TW', 'RC'),
+ ('TG', 'RT'),
+ ('U', 'ROU'),
+ ('KP', 'ROK'),
+ ('CRO', 'HR'),
+ ('UKR', 'UA'),
+ ('AM', 'ARM'),
+ ('CS', 'CZ'),
+ ('SU', 'RUS'),
+ ('LET', 'LV'),
+ ('MDA', 'MD');
+
+ UPDATE fusionax_anciens AS f
+INNER JOIN tmp_update_fusionax_anciens AS t ON (f.Code_nationalite = t.bad)
+ SET f.Code_nationalite = t.good;
+
+-- vim:set syntax=mysql:
--- /dev/null
+-- Query to check if all the nationalities are now rocognized
+-- If the result of this query is not empty, 04_nationalities.sql nedds to be updated
+SELECT DISTINCT Code_nationalite
+ FROM fusionax_anciens AS f
+ WHERE NOT EXISTS (SELECT *
+ FROM geoloc_pays AS g
+ WHERE g.license_plate = f.Code_nationalite);
+
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE geoloc_pays ADD INDEX (license_plate);
+
+ UPDATE auth_user_md5 AS u
+LEFT JOIN fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+LEFT JOIN geoloc_pays AS g ON (g.license_plate = f.Code_nationalite)
+ SET u.nationalite = g.a2
+ WHERE u.nationalite IS NULL;
+
+ UPDATE auth_user_md5 AS u
+LEFT JOIN fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+LEFT JOIN geoloc_pays AS g ON (g.license_plate = f.Code_nationalite)
+ SET u.nationalite2 = g.a2
+ WHERE u.nationalite != g.a2 AND u.nationalite2 IS NULL;
+
+ UPDATE auth_user_md5 AS u
+LEFT JOIN fusionax_anciens AS f ON (u.matricule_ax = f.id_ancien)
+LEFT JOIN geoloc_pays AS g ON (g.license_plate = f.Code_nationalite)
+ SET u.nationalite3 = g.a2
+ WHERE u.nationalite != g.a2 AND u.nationalite2 != g.a2 AND u.nationalite3 IS NULL;
+
+ALTER TABLE geoloc_pays DROP INDEX (license_plate);
+
+-- vim:set syntax=mysql:
--- /dev/null
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+
+$globals->debug = 0; //do not store backtraces
+
+// get degree list
+$res = XDB::iterator("SELECT id, abbreviation AS name
+ FROM profile_education_degree_enum
+ ORDER BY id");
+foreach ($res as $item) {
+ $degree_list[$item[1]] = $item[0];
+}
+
+// get degree's level list
+$res = XDB::iterator("SELECT id, level AS name
+ FROM profile_education_degree_enum
+ ORDER BY id");
+foreach ($res as $item) {
+ $level_list [$item[1]] = $item[0];
+}
+
+// get university list
+$res = XDB::iterator("SELECT id, IF(abbreviation = '', name, abbreviation) AS name
+ FROM profile_education_enum
+ ORDER BY id");
+foreach ($res as $item) {
+ $university_list [$item[1]] = $item[0];
+}
+
+// get field list
+$res = XDB::iterator("SELECT id, field AS name
+ FROM profile_education_field_enum
+ ORDER BY id");
+foreach ($res as $item) {
+ $field_list [$item[1]] = $item[0];
+}
+
+// get Xorg education data
+$res = XDB::query("SELECT p.uid, d.abbreviation AS degree, IF(e.abbreviation = '', e.name, e.abbreviation) AS university, p.program, p.id AS no
+ FROM profile_education AS p
+ INNER JOIN profile_education_enum AS e ON (p.eduid = e.id)
+ INNER JOIN profile_education_degree_enum AS d ON (p.degreeid = d.id)
+ WHERE p.id != 100
+ ORDER BY p.uid");
+$xorg_edu = $res->fetchAllAssoc();
+
+// get AX education data
+$res = XDB::iterator("SELECT u.user_id AS uid, f.Intitule_diplome AS degree, f.Intitule_formation AS university,
+ CONCAT(Descr_formation, ' ', tmp_1, ' ', tmp_2, ' ', tmp_3, ' ', tmp_4) AS program
+ FROM fusionax_formations AS f
+ INNER JOIN fusionax_xorg_anciens AS u ON (f.id_ancien = u.matricule_ax)
+ ORDER BY u.user_id");
+$ax_edu = $res->fetchAllAssoc();
+
+// merge education data
+$nb_merge_succes = 0;
+$nb_total = 0;
+$xorg = next($xorg_edu);
+while ($ax = next($ax_edu)) {
+ array_walk($ax, 'trim');
+ if (($ax['degree'] == '') && ($ax['university'] = '')) {
+ continue;
+ }
+ while ($xorg['uid'] && ($xorg['uid'] < $ax['uid'])) {
+ $xorg = next($xorg_edu);
+ }
+
+ $no = 0;
+ if($xorg['uid'] == $ax['uid']) {
+ $uid = $xorg['uid'];
+ $i = 0;
+
+ while (($xorg['uid'] == $uid) && (!merge($ax, $xorg))) {
+ $xorg = next($xorg_edu);
+ $i++;
+ $no++;
+ }
+ while ($xorg['uid'] == $uid) {
+ $xorg = next($xorg_edu);
+ $no++;
+ }
+
+ if ($i > 0) {
+ $i = $no;
+ } else {
+ $i = $no - 1;
+ }
+ while ($i != 0) {
+ $xorg = prev($xorg_edu);
+ $i--;
+ }
+ if ($ax['no']) {
+ $no = $ax['no'];
+ $nb_merge_succes++;
+ }
+ }
+ adapt_ax($ax);
+ XDB::execute("REPLACE INTO profile_education (uid, degreeid, eduid, program, fieldid, id)
+ VALUES {?}, {?}, {?}, {?}, {?}, {?}",
+ $ax['uid'], $ax['degree'], $ax['university'], $ax['program'], $ax['field'], $no);
+ $nb_total++;
+ if (($nb_total % 1000) == 0) {
+ echo ".";
+ }
+}
+
+echo "\n";
+echo "$nb_merge_succes educations were succesfully merged among $nb_total entries.\n";
+
+// auxilliary functions
+
+// replaces AX data by corresponding id in Xorg database
+function adapt_ax(&$ax)
+{
+ if ($field_list[$ax['program']]) {
+ $ax['field'] = $field_list[$ax['program']];
+ $ax['program'] = null;
+ }
+ $ax['degree'] = $degree_list[$ax['degree']];
+ $ax['university'] = $university_list[$ax['university']];
+}
+
+// tries to merge two educations into ax and returns 1 in case of merge
+function merge(&$ax, $xorg)
+{
+ if ($ax['degree'] == '') {
+ if ($ax['university'] != $xorg['university']) {
+ return 0;
+ }
+ $ax['degree'] = $xorg['degree'];
+ $ax['university'] = $xorg['university'];
+ } else {
+ if ($ax['university'] == '') {
+ if (($level_list[$ax['degree']] == $level_list[$xorg['degree']]) || ($xorg['degree'] == "Dipl.") || ($ax['degree'] == "Dipl.")) {
+ if ($xorg['degree'] != "Dipl.") {
+ $ax['degree'] = $xorg['degree'];
+ }
+ $ax['university'] = $xorg['university'];
+ } else {
+ return 0;
+ }
+ } else {
+ if (($ax['university'] == $xorg['university']) &&
+ (($level_list[$ax['degree']] == $level_list[$xorg['degree']]) || ($xorg['degree'] == "Dipl.") || ($ax['degree'] == "Dipl."))) {
+ if ($xorg['degree'] != "Dipl.") {
+ $ax['degree'] = $xorg['degree'];
+ }
+ } else {
+ return 0;
+ }
+ }
+ }
+ if ($xorg['program']) {
+ $ax['field'] = $field_list[$ax['program']];
+ $ax['program'] = $xorg['program'];
+ }
+ $ax['no'] = $xorg['no'];
+ return 1;
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>
--- /dev/null
+../../bin/connect.db.inc.php
\ No newline at end of file
--- /dev/null
+DROP TABLE IF EXISTS profile_display;
+
+CREATE TABLE profile_display (
+ pid INT(11) NOT NULL DEFAULT 0,
+ yourself VARCHAR(255) NOT NULL,
+ public_name VARCHAR(255) NOT NULL,
+ private_name VARCHAR(255) NOT NULL,
+ directory_name VARCHAR(255) NOT NULL,
+ short_name VARCHAR(255) NOT NULL,
+ sort_name VARCHAR(255) NOT NULL,
+ promo VARCHAR(255) DEFAULT '' NOT NULL,
+ PRIMARY KEY(pid)
+) CHARSET=utf8;
+
+INSERT INTO profile_display (pid, yourself, public_name, private_name, directory_name, short_name, sort_name)
+ SELECT u.user_id, u.prenom,
+ CONCAT(u.prenom, ' ', IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom)),
+ CONCAT(u.prenom, ' ', IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom),
+ IF(q.profile_nick != '', CONCAT(' (alias ', q.profile_nick, ')'), '')),
+ CONCAT(IF(u.nom_usage != '', CONCAT(u.nom_usage, ' (', u.nom, ')') , u.nom), ' ', u.prenom),
+ CONCAT(u.prenom, ' ', IF(u.nom_usage != '', u.nom_usage, u.nom)),
+ CONCAT(IF(u.nom_usage != '', u.nom_usage, u.nom), ' ', u.prenom)
+ FROM auth_user_md5 AS u
+ LEFT JOIN auth_user_quick AS q ON (u.user_id = q.user_id);
+
+
+DROP TABLE IF EXISTS profile_name_enum;
+
+CREATE TABLE IF NOT EXISTS profile_name_enum (
+ id TINYINT(2) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ explanations VARCHAR(255) NOT NULL,
+ type VARCHAR(255) NOT NULL,
+ flags SET('has_particle', 'not_displayed', 'always_displayed', 'public') NOT NULL,
+ score TINYINT(2) UNSIGNED NOT NULL DEFAULT 10,
+ PRIMARY KEY (id),
+ UNIQUE (name)
+) CHARSET=utf8;
+
+INSERT INTO profile_name_enum (name, flags, explanations, type, score)
+ VALUES ('Nom patronymique', 'has_particle,always_displayed,public',
+ 'Le nom de famille avec lequel tu es né', 'lastname', 10),
+ ('Nom marital', 'has_particle,always_displayed,public',
+ 'Ton nom d\'épouse ou d\'époux', 'lastname_marital', 10),
+ ('Nom usuel', 'has_particle,always_displayed,public',
+ 'Le nom de famille que tu utilises usuellement s\'il est différent du nom patronymique, ce peut-être une version racourcie de celui-ci, ton nom marital, une combinaison de ces deux noms...',
+ 'lastname_ordinary', 10),
+ ('Prénom', 'always_displayed,public', 'Ton prénom', 'firstname', 10),
+ ('Pseudonyme (nom de plume)', 'always_displayed,public',
+ 'Pseudonyme pour les artistes, gens de lettres', 'pseudonym', 10),
+ ('Surnom', '', 'Surnom à l\'École ou ailleurs', 'nickname', 2),
+ ('Prénom usuel', 'public', 'Si tu utilises une version raccourcie, francisée... de ton prénom',
+ 'firstname_ordinary', 10),
+ ('Autre prénom', '', 'Si tu as d\'autres prénoms et que tu souhaites les faire apparaître',
+ 'firstname_other', 1),
+ ('Autre nom', '', 'Si tu as d\'autres noms et que tu souhaites les faire apparaître',
+ 'name_other', 1),
+ ('Nom initial', 'has_particle,not_displayed,public', '', 'name_ini', 10),
+ ('Prénom initial', 'has_particle,not_displayed,public', '', 'firstname_ini', 10);
+
+
+DROP TABLE IF EXISTS profile_name;
+
+CREATE TABLE IF NOT EXISTS profile_name (
+ id TINYINT(2) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'id of this name for this user',
+ pid INT(11) NOT NULL COMMENT 'id of alumni',
+ name VARCHAR(255) NOT NULL COMMENT 'name to search for',
+ particle VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'particle of the name to search for',
+ typeid TINYINT(2) UNSIGNED NOT NULL COMMENT 'type of name',
+ PRIMARY KEY (pid, id),
+ INDEX pid (pid)
+) CHARSET=utf8 COMMENT = 'Names of alumni (search table)';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT u.user_id, u.nom, e.id
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Nom patronymique')
+ WHERE nom != '';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT u.user_id, u.nom_ini, e.id
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Nom initial')
+ WHERE nom_ini != '';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT u.user_id, u.prenom, e.id
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Prénom')
+ WHERE prenom != '';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT u.user_id, u.prenom_ini, e.id
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Prénom initial')
+ WHERE prenom_ini != '';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT u.user_id, u.nom_usage, e.id
+ FROM auth_user_md5 AS u
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Nom usuel')
+ WHERE nom_usage != '';
+
+INSERT INTO profile_name (pid, name, typeid)
+ SELECT q.user_id, q.profile_nick, e.id
+ FROM auth_user_quick AS q
+ INNER JOIN profile_name_enum AS e ON (e.name = 'Surnom')
+ WHERE profile_nick != '';
+
+DROP TABLE IF EXISTS recherche_soundex;
+
+DELETE FROM search_autocomplete
+ WHERE name = 'name' OR name = 'firstname' OR name = 'nickname';
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE `adresses` ADD `comment` varchar(100) NOT NULL;
+
--- /dev/null
+CREATE TABLE IF NOT EXISTS `profile_networking_enum` (
+ `network_type` tinyint unsigned NOT NULL,
+ `name` varchar(30) NOT NULL,
+ `icon` varchar(50) NOT NULL COMMENT 'icon filename',
+ `filter` enum('email','web','number','none') NOT NULL DEFAULT 'none' COMMENT 'filter type for addresses',
+ `link` varchar(255) NOT NULL COMMENT 'string used to forge an URL linking to the the profile page',
+ PRIMARY KEY (`network_type`)
+) CHARSET=utf8 COMMENT='types of networking addresses';
+
+CREATE TABLE IF NOT EXISTS `profile_networking` (
+ `uid` int NOT NULL COMMENT 'user id',
+ `nwid` tinyint unsigned NOT NULL COMMENT 'number of the address for the user',
+ `network_type` tinyint unsigned NOT NULL,
+ `address` varchar(255) NOT NULL,
+ `pub` enum('private','public') NOT NULL DEFAULT 'private',
+ PRIMARY KEY (`uid`, `nwid`),
+ INDEX uid (uid)
+) CHARSET=utf8 COMMENT='networking addresses';
+
+-- Insert a first address type for old URLs
+INSERT INTO `profile_networking_enum` (`network_type`, `name`, `icon`, `filter`)
+ VALUES (0, 'Page web', 'web.gif', 'web');
+
+INSERT INTO `profile_networking` (`uid`, `nwid`, `network_type`, `address`, `pub`)
+ SELECT `user_id`, 0, 0, `profile_web`, `profile_web_pub`
+ FROM `auth_user_quick`
+ WHERE `profile_web` <> "";
+
+-- Modify watch_profile to update 'field' from web to networking
+ALTER TABLE `watch_profile`
+ MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick',
+ 'web', 'networking', 'appli1', 'appli2', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo');
+
+UPDATE `watch_profile` SET `field` = 'networking' WHERE `field` = 'web';
+
+ALTER TABLE `watch_profile`
+ MODIFY `field` enum('nom', 'freetext', 'mobile', 'nationalite', 'nick',
+ 'networking', 'appli1', 'appli2', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo');
+
+-- Drop old web URL columns
+ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web`;
+ALTER TABLE `auth_user_quick` DROP COLUMN `profile_web_pub`;
+
+# vim:set syntax=mysql:
--- /dev/null
+CREATE TABLE IF NOT EXISTS profile_directory (
+ uid INT NOT NULL,
+ email_directory VARCHAR(255) DEFAULT NULL,
+ PRIMARY KEY (uid)
+) CHARSET=utf8;
+
+ALTER TABLE register_marketing MODIFY COLUMN type ENUM('user', 'staff', 'ax');
--- /dev/null
+CREATE TABLE IF NOT EXISTS `profile_phones` (
+ `uid` smallint unsigned NOT NULL,
+ `link_type` enum('address', 'pro', 'user') NOT NULL DEFAULT 'user' COMMENT 'type of parent element',
+ `link_id` tinyint unsigned NOT NULL COMMENT 'id of his parent element',
+ `tel_id` tinyint unsigned NOT NULL COMMENT 'index of this number for the couple (user, parent element)',
+ `tel_type` enum('fixed', 'mobile', 'fax') NOT NULL DEFAULT 'fixed',
+ `search_tel` varchar(25) NOT NULL COMMENT 'search number in an international format with only digits and the initial +',
+ `display_tel` varchar(30) NOT NULL COMMENT 'display number',
+ `pub` enum('private', 'ax', 'public') NOT NULL DEFAULT 'private',
+ `comment` varchar(80) NOT NULL,
+ PRIMARY KEY(`uid`, `link_type`, `link_id`, `tel_id`),
+ INDEX (`search_tel`),
+ INDEX uid (uid)
+);
+
+
+-- Adds a temporary column to convert phone prefixes from varchar to int
+ALTER TABLE `geoloc_pays` ADD COLUMN `tmp_phoneprf` smallint unsigned NULL;
+
+-- Adds phone format column
+ALTER TABLE `geoloc_pays` ADD COLUMN `phoneformat` varchar(25) NOT NULL AFTER `nat`;
+
+# vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE auth_user_md5 ADD COLUMN nationalite2 CHAR(2) DEFAULT NULL,
+ ADD COLUMN nationalite3 CHAR(2) DEFAULT NULL,
+ ADD KEY nationalite2 (nationalite2),
+ ADD KEY nationalite3 (nationalite3),
+ MODIFY nationalite CHAR(2) DEFAULT NULL;
+
+UPDATE auth_user_md5 SET nationalite=NULL WHERE nationalite="00" OR nationalite='';
+
+DELETE FROM geoloc_pays WHERE a2="00";
+
+ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2', 'nationalite3',
+ 'nick', 'web', 'networking', 'appli1', 'appli2', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo');
+
+# vim:set syntax=mysql:
--- /dev/null
+CREATE TABLE IF NOT EXISTS profile_education_field_enum (
+ id INT(2) NOT NULL AUTO_INCREMENT,
+ field VARCHAR(255) DEFAULT NULL,
+ PRIMARY KEY(id),
+ UNIQUE KEY(field)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS profile_education_degree_enum (
+ id INT(2) NOT NULL AUTO_INCREMENT,
+ degree VARCHAR(255) DEFAULT NULL,
+ abbreviation VARCHAR(255) DEFAULT '' NOT NULL,
+ level TINYINT (1) UNSIGNED DEFAULT 0 NOT NULL,
+ PRIMARY KEY(id),
+ UNIQUE KEY(degree)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS profile_education_degree (
+ eduid INT(4) NOT NULL DEFAULT 0,
+ degreeid INT(2) NOT NULL DEFAULT 0,
+ PRIMARY KEY(eduid, degreeid)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS profile_education_enum (
+ id INT(4) NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) DEFAULT NULL,
+ abbreviation VARCHAR(255) DEFAULT '' NOT NULL,
+ url VARCHAR(255) DEFAULT NULL,
+ country CHAR(2) NOT NULL DEFAULT 'FR',
+ PRIMARY KEY(id),
+ UNIQUE KEY(name)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS profile_education (
+ id TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
+ uid INT(11) NOT NULL DEFAULT 0,
+ eduid INT(4) NOT NULL DEFAULT 0,
+ degreeid INT(4) NOT NULL DEFAULT 0,
+ fieldid INT(2) NOT NULL DEFAULT 0,
+ entry_year INT(4) DEFAULT NULL,
+ grad_year INT(4) DEFAULT NULL,
+ program VARCHAR(255) DEFAULT NULL,
+ flags SET('primary') DEFAULT '' NOT NULL,
+ PRIMARY KEY(id, uid),
+ INDEX uid (uid)
+) CHARSET=utf8;
+
+INSERT INTO profile_education_field_enum (field)
+ VALUES ('Aéronautique'), ('Agronomie'), ('Assurance'), ('Biologie'),
+ ('Chimie'), ('Droit'), ('Économie'), ('Électronique/électricité'),
+ ('Environnement/développement durable'), ('Finance'), ('Géographie'),
+ ('Histoire'), ('Informatique'), ('Langues'), ('Mathématiques'),
+ ('Mathématiques appliquées'), ('Mécanique'), ('Médecine'),
+ ('Philosophie'), ('Physique'), ('Sciences politiques');
+
+INSERT INTO profile_education_degree_enum (degree)
+ VALUES ('Diplôme'), ('Ingénieur'), ('Corps'), ('MS'), ('PhD'),
+ ('DEA'), ('ME'), ('MBA'), ('MiF'), ('MPA'), ('Licence');
+
+INSERT INTO profile_education_degree (eduid, degreeid)
+ SELECT a.id, d.id
+ FROM applis_def AS a
+ INNER JOIN profile_education_degree_enum AS d ON (FIND_IN_SET(d.degree, a.type));
+
+INSERT INTO profile_education_enum (id, name, url)
+ SELECT id, text, url
+ FROM applis_def;
+
+INSERT INTO profile_education (id, uid, eduid, degreeid)
+ SELECT a.ordre, a.uid, a.aid, d.id
+ FROM applis_ins AS a
+ INNER JOIN profile_education_degree_enum AS d ON (a.type = d.degree);
+
+ UPDATE watch_profile AS w1
+ INNER JOIN watch_profile AS w2 ON (w1.uid = w2.uid AND w1.field = 'appli1' AND w2.field = 'appli2')
+ SET w1.ts = IF(w1.ts > w2.ts, w1.ts, w2.ts), w2.ts = IF(w1.ts > w2.ts, w1.ts, w2.ts);
+
+INSERT IGNORE INTO watch_profile (uid, ts, field)
+ SELECT uid, ts, 'appli1'
+ FROM watch_profile
+ WHERE field = 'appli2';
+
+ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',
+ 'nationalite3', 'nick', 'web', 'networking', 'appli1', 'appli2',
+ 'edus', 'addresses', 'section', 'binets', 'medals', 'cv', 'jobs',
+ 'photo');
+
+UPDATE watch_profile SET field = 'edus' WHERE field = 'appli1';
+
+DELETE FROM watch_profile WHERE field = 'appli2';
+
+ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',
+ 'nationalite3', 'nick', 'web', 'networking', 'edus', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo');
+
+# vim:set syntax=mysql:
+
--- /dev/null
+CREATE TABLE IF NOT EXISTS profile_corps (
+ uid INT(11) NOT NULL,
+ original_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 0,
+ current_corpsid INT(4) UNSIGNED NOT NULL DEFAULT 0,
+ rankid INT(4) UNSIGNED NOT NULL DEFAULT 0,
+ corps_pub ENUM('private', 'ax', 'public') NOT NULL DEFAULT 'private',
+ PRIMARY KEY(uid)
+) CHARSET=utf8;
+
+
+CREATE TABLE IF NOT EXISTS profile_corps_enum (
+ id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL DEFAULT '',
+ abbreviation CHAR(5) NOT NULL DEFAULT '',
+ still_exists TINYINT(1) UNSIGNED NOT NULL DEFAULT 1,
+ PRIMARY KEY(id),
+ UNIQUE KEY(name),
+ UNIQUE KEY(abbreviation)
+) CHARSET=utf8;
+
+
+CREATE TABLE IF NOT EXISTS profile_corps_rank_enum (
+ id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL DEFAULT '',
+ abbreviation CHAR(5) NOT NULL DEFAULT '',
+ PRIMARY KEY(id),
+ UNIQUE KEY(name),
+ UNIQUE KEY(abbreviation)
+) CHARSET=utf8;
+
+ UPDATE profile_corps AS c
+INNER JOIN profile_corps_enum AS e ON (c.original_corpsid = e.id)
+ LEFT JOIN profile_corps_enum AS a ON (a.name = "Aucun (anc. démissionnaire)")
+ SET c.original_corpsid = a.id
+ WHERE e.name = "Ancien élève étranger";
+
+UPDATE profile_corps_enum
+ SET name = "Aucun"
+ WHERE name = "Aucun (anc. démissionnaire)";
+
+DELETE FROM profile_corps_enum
+ WHERE name = "Ancien élève étranger";
+
+
+ALTER TABLE watch_profile MODIFY field enum('nom', 'freetext', 'mobile', 'nationalite', 'nationalite2',
+ 'nationalite3', 'nick', 'web', 'networking', 'edus', 'addresses',
+ 'section', 'binets', 'medals', 'cv', 'jobs', 'photo', 'corps');
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE geoloc_pays ADD COLUMN license_plate CHAR(4) DEFAULT NULL;
+
+CREATE TEMPORARY TABLE IF NOT EXISTS tmp_update_geoloc_pays (
+ a2 CHAR(2) DEFAULT NULL,
+ code CHAR(4) DEFAULT NULL,
+ PRIMARY KEY(a2),
+ UNIQUE KEY(code)
+) CHARSET=utf8;
+
+INSERT IGNORE INTO tmp_update_geoloc_pays (a2, code)
+ VALUES ('AF', 'AFG'),
+ ('ZA', 'ZA'),
+ ('AL', 'AL'),
+ ('DZ', 'DZ'),
+ ('DE', 'D'),
+ ('AD', 'AND'),
+ ('AO', 'ANG'),
+ ('AG', 'AG'),
+ ('AN', 'NA'),
+ ('SA', 'KSA'),
+ ('AR', 'RA'),
+ ('AM', 'ARM'),
+ ('AU', 'AUS'),
+ ('AT', 'A'),
+ ('AZ', 'AZ'),
+ ('BS', 'BS'),
+ ('BH', 'BRN'),
+ ('BD', 'BD'),
+ ('BB', 'BDS'),
+ ('BY', 'BY'),
+ ('BE', 'B'),
+ ('BZ', 'BZ'),
+ ('BJ', 'DY'),
+ ('BM', ''),
+ ('BT', 'BHT'),
+ ('BO', 'BOL'),
+ ('BA', 'BIH'),
+ ('BW', 'RB'),
+ ('BR', 'BR'),
+ ('BN', 'BRU'),
+ ('BG', 'BG'),
+ ('BF', 'BF'),
+ ('BI', 'BU'),
+ ('KH', 'K'),
+ ('CM', 'CAM'),
+ ('CA', 'CDN'),
+ ('CV', 'CV'),
+ ('CF', 'RCA'),
+ ('CG', 'CGO'),
+ ('CL', 'RCH'),
+ ('CN', 'CN'),
+ ('CY', 'CY'),
+ ('CO', 'CO'),
+ ('KM', 'COM'),
+ ('CG', 'RCB'),
+ ('CD', 'CD'),
+ ('KR', 'ROK'),
+ ('KP', 'DVRK'),
+ ('CR', 'CR'),
+ ('CI', 'CI'),
+ ('HR', 'HR'),
+ ('CU', 'C'),
+ ('DK', 'DK'),
+ ('DJ', 'DJI'),
+ ('DO', 'DOM'),
+ ('DM', 'WD'),
+ ('EG', 'ET'),
+ ('SV', 'ES'),
+ ('AE', 'UAE'),
+ ('EC', 'EC'),
+ ('ER', 'ER'),
+ ('ES', 'E'),
+ ('EE', 'EST'),
+ ('US', 'USA'),
+ ('ET', 'ETH'),
+ ('FO', 'FR'),
+ ('FJ', 'FJI'),
+ ('FI', 'FIN'),
+ ('FR', 'F'),
+ ('GA', 'G'),
+ ('GM', 'WAG'),
+ ('GE', 'GE'),
+ ('GH', 'GH'),
+ ('GI', 'GBZ'),
+ ('GR', 'GR'),
+ ('GD', 'WG'),
+ ('GL', 'KN'),
+ ('GT', 'GCA'),
+ ('GN', 'RG'),
+ ('GQ', 'GQ'),
+ ('GY', 'GUY'),
+ ('HT', 'RH'),
+ ('HN', 'HN'),
+ ('HK', 'HK'),
+ ('HU', 'H'),
+ ('VG', 'BVI'),
+ ('IN', 'IND'),
+ ('ID', 'RI'),
+ ('IR', 'IR'),
+ ('IQ', 'IRQ'),
+ ('IE', 'IRL'),
+ ('IS', 'IS'),
+ ('IL', 'IL'),
+ ('IT', 'I'),
+ ('JM', 'JA'),
+ ('JP', 'J'),
+ ('JO', 'JOR'),
+ ('KZ', 'KZ'),
+ ('KE', 'EAK'),
+ ('KG', 'KS'),
+ ('KI', 'KIR'),
+ ('KW', 'KWT'),
+ ('LA', 'LAO'),
+ ('LS', 'LS'),
+ ('LV', 'LV'),
+ ('LB', 'RL'),
+ ('LR', 'LB'),
+ ('LY', 'LAR'),
+ ('LI', 'FL'),
+ ('LT', 'LT'),
+ ('LU', 'L'),
+ ('MK', 'MK'),
+ ('MG', 'RM'),
+ ('MY', 'MAL'),
+ ('MW', 'MW'),
+ ('MV', 'MV'),
+ ('ML', 'RMM'),
+ ('MT', 'M'),
+ ('MA', 'MA'),
+ ('MH', 'MH'),
+ ('MU', 'MS'),
+ ('MR', 'RIM'),
+ ('MX', 'MEX'),
+ ('FM', 'FSM'),
+ ('MD', 'MD'),
+ ('MC', 'MC'),
+ ('MN', 'MGL'),
+ ('MZ', 'MOC'),
+ ('MM', 'MYA'),
+ ('NA', 'NAM'),
+ ('NR', 'NAU'),
+ ('NP', 'NEP'),
+ ('NI', 'NIC'),
+ ('NE', 'RN'),
+ ('NG', 'WAN'),
+ ('NO', 'N'),
+ ('NZ', 'NZ'),
+ ('OM', 'OM'),
+ ('UG', 'EAU'),
+ ('UZ', 'UZ'),
+ ('PK', 'PK'),
+ ('PW', 'PAL'),
+ ('PS', 'PS'),
+ ('PA', 'PA'),
+ ('PG', 'PNG'),
+ ('PY', 'PY'),
+ ('NL', 'NL'),
+ ('PE', 'PE'),
+ ('PH', 'RP'),
+ ('PL', 'PL'),
+ ('PT', 'P'),
+ ('QA', 'Q'),
+ ('RE', 'RE'),
+ ('RO', 'RO'),
+ ('GB', 'GB'),
+ ('RU', 'RUS'),
+ ('RW', 'RWA'),
+ ('LC', 'WL'),
+ ('KN', 'SCN'),
+ ('SM', 'RSM'),
+ ('VA', 'V'),
+ ('VC', 'WV'),
+ ('SB', 'SOL'),
+ ('WS', 'WS'),
+ ('ST', 'STP'),
+ ('SN', 'SN'),
+ ('CS', 'SCG'),
+ ('SC', 'SY'),
+ ('SL', 'WAL'),
+ ('SG', 'SGP'),
+ ('SK', 'SK'),
+ ('SI', 'SLO'),
+ ('SO', 'SP'),
+ ('SD', 'SUD'),
+ ('LK', 'CL'),
+ ('SE', 'S'),
+ ('CH', 'CH'),
+ ('SR', 'SME'),
+ ('SZ', 'SD'),
+ ('SY', 'SYR'),
+ ('TJ', 'TJ'),
+ ('TW', 'RC'),
+ ('TZ', 'EAT'),
+ ('TD', 'TCH'),
+ ('CZ', 'CZ'),
+ ('TH', 'THA'),
+ ('TL', 'TL'),
+ ('TG', 'RT'),
+ ('TO', 'TO'),
+ ('TT', 'TT'),
+ ('TN', 'TN'),
+ ('TM', 'TM'),
+ ('TR', 'TR'),
+ ('TV', 'TUV'),
+ ('UA', 'UA'),
+ ('UY', 'ROU'),
+ ('VU', 'VU'),
+ ('VE', 'YV'),
+ ('VN', 'VN'),
+ ('YE', 'YAR'),
+ ('YU', 'YU'),
+ ('ZM', 'Z'),
+ ('ZW', 'ZW');
+
+ UPDATE geoloc_pays AS g
+INNER JOIN tmp_update_geoloc_pays AS t ON (t.a2 = g.a2)
+ SET g.license_plate = t.code;
+
+-- vim:set syntax=mysql:
--- /dev/null
+-- Updates diplomas
+UPDATE profile_education_degree_enum SET abbreviation = 'PhD', degree = 'Doctorat', level = 8 WHERE degree = 'PhD';
+UPDATE profile_education_degree_enum SET abbreviation = 'Lic.', level = 3 WHERE degree = 'Licence';
+UPDATE profile_education_degree_enum SET abbreviation = 'MSc', degree = 'Master of Science', level = 5 WHERE degree = 'MS';
+UPDATE profile_education_degree_enum SET abbreviation = 'DEA', degree = "Diplôme d'Études Approfondies", level = 5 WHERE degree = 'DEA';
+UPDATE profile_education_degree_enum SET abbreviation = 'ME', degree = 'Master of Economics', level = 5 WHERE degree = 'ME';
+UPDATE profile_education_degree_enum SET abbreviation = 'MBA', degree = 'Master of Business Administration', level = 5 WHERE degree = 'MBA';
+UPDATE profile_education_degree_enum SET abbreviation = 'MiF', degree = 'Master in Finance', level = 5 WHERE degree = 'MiF';
+UPDATE profile_education_degree_enum SET abbreviation = 'MPA', degree = 'Master of Public Administration', level = 5 WHERE degree = 'MPA';
+UPDATE profile_education_degree_enum SET abbreviation = 'MIA', degree = 'Master of International Affairs', level = 5 WHERE degree = 'MIA';
+UPDATE profile_education_degree_enum SET abbreviation = 'Corps', degree = 'Corps', level = 5 WHERE degree = 'Corps';
+UPDATE profile_education_degree_enum SET abbreviation = 'Ing.', degree = 'Ingénieur', level = 5 WHERE degree = 'Ingénieur';
+UPDATE profile_education_degree_enum SET abbreviation = 'Dipl.', degree = 'Diplôme', level = 0 WHERE degree = 'Diplôme';
+
+INSERT INTO profile_education_degree_enum (abbreviation, degree, level)
+ VALUES ('Agr.', 'Agrégation', 4), ('CAPES', 'Certificat d\'Aptitude au Professorat de l\'Enseignement du Second degré', 4),
+ ('DESS', 'Diplôme d\'Études Supérieures Spécialisées', 5), ('BTS', 'Brevet de Technicien Supérieur', 2), ('MA', 'Master of Arts', 5),
+ ('Maîtr.', 'Maîtrise', 4), ('HDR', 'Habilitation à Diriger des Recherches', 8), ('DEUG', 'Diplôme d\'Études Universitaires Générales', 2),
+ ('MEE', 'Master of Electrical Engineering', 5), ('MPhil', 'Master of Philosophy', 5), ('MUP', 'Master of Urban Planning', 5),
+ ('MME', 'Master of Mechanical Engineering', 5), ('MCP', 'Master of City Planning', 5), ('BA', 'Bachelor of Arts', 3),
+ ('MEl', 'Master of Electronics', 5), ('MM', 'Master of Management', 5), ('MIB', 'Master of International Business', 5),
+ ('MC', 'Master of Chemistry', 5), ('MEM', 'Master of Engineering in Manufacturing', 5), ('MEng', 'Master of Engineering', 5),
+ ('MCE', 'Master of Chemical Engineering', 5), ('M', 'Master', 5), ('MMS', 'Master of Military Studies', 5),
+ ('MSI', 'Master of Science in Information', 5),
+ ('DESCF', 'Diplôme d\'Études Supérieures Comptables et Financières', 5), ('MB', 'Master of Biotechnology', 5);
+
+-- Updates universities
+UPDATE profile_education_enum
+SET abbreviation = 'Télécom', name = 'Télécom ParisTech', url = 'http://www.telecom-paristech.fr/'
+WHERE name = 'Télécom';
+UPDATE profile_education_enum
+SET abbreviation = 'ENGREF', name = 'École Nationale du Génie Rural des Eaux et des Forêts', url = 'http://www.agroparistech.fr/-Ecole-interne-ENGREF-.html'
+WHERE name = 'ENGREF';
+UPDATE profile_education_enum
+SET abbreviation = 'INSEE', name = 'Institut National de la Statistique et des Études Économiques'
+WHERE name = 'INSEE';
+UPDATE profile_education_enum
+SET abbreviation = 'Météo', name = 'École Nationale de la Météorologie'
+WHERE name = 'Météo';
+UPDATE profile_education_enum
+SET abbreviation = 'Mines', name = 'Mines ParisTech'
+WHERE name = 'Mines';
+UPDATE profile_education_enum
+SET abbreviation = 'Ponts', name = 'École des Ponts ParisTech'
+WHERE name = 'Ponts';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSAE', name = 'École Nationale de la Statistique et de l\'Administration Économique ParisTech'
+WHERE name = 'ENSAE';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSAM', name = 'Arts et Métiers ParisTech'
+WHERE name = 'ENSAM';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSEEIHT', name = 'École Nationale Supérieure d\'Électrotechnique, d\'Électronique, d\'Informatique, d\'Hydraulique et des Télécommunications'
+WHERE name = 'ENSEEIHT';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSIMAG', name = 'École Nationale Supérieure d\'Informatique et de Mathématiques Appliquées de Grenoble', url = 'http://ensimag.grenoble-inp.fr/'
+WHERE name = 'ENSIMAG';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSTA', name = 'École Nationale Supérieure de Techniques Avancées'
+WHERE name = 'ENSTA';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSPM', name = 'École Nationale Supérieure du Pétrole et des Moteurs'
+WHERE name = 'ENSPM';
+UPDATE profile_education_enum
+SET abbreviation = 'INAPG', name = 'Institut National Agronomique Paris-Grignon', url = 'http://www.agroparistech.fr/'
+WHERE name = 'INAPG';
+UPDATE profile_education_enum
+SET abbreviation = 'HEC', name = 'École des Hautes Études Commerciales'
+WHERE name = 'HEC';
+UPDATE profile_education_enum
+SET abbreviation = 'X', name = 'École polytechnique', url = 'http://www.polytechnique.edu/'
+WHERE name = 'X';
+UPDATE profile_education_enum
+SET abbreviation = 'SUPAERO', name = 'École Nationale Supérieure de l\'Aéronautique et de l\'Espace', url = 'http://www.isae.fr/'
+WHERE name = 'Supaéro';
+UPDATE profile_education_enum
+SET abbreviation = 'SupOptique', name = 'Institut d\'Optique Théorique et Appliquée'
+WHERE name = 'Supoptique';
+UPDATE profile_education_enum
+SET abbreviation = 'Supélec', name = 'École Supérieure d\'Électricité'
+WHERE name = 'Supélec';
+UPDATE profile_education_enum
+SET abbreviation = 'ENA', name = 'École Nationale d\'Administration'
+WHERE name = 'ENA';
+UPDATE profile_education_enum
+SET abbreviation = 'INSEAD', name = 'Institut Européen d\'Administration des Affaires', url = 'http://www.insead.edu/'
+WHERE name = 'INSEAD';
+UPDATE profile_education_enum
+SET abbreviation = 'Chimie Paris', name = 'Chimie Paris ParisTech', url = 'http://www.enscp.fr/'
+WHERE name = 'Chimie Paris';
+UPDATE profile_education_enum
+SET abbreviation = 'INSTN', name = 'Institut National des Sciences et Techniques Nucléaires'
+WHERE name = 'INSTN';
+UPDATE profile_education_enum
+SET abbreviation = 'UMPC', name = 'Université Pierre-et-Marie-Curie (Paris-VI)', url = 'http://www.upmc.fr/'
+WHERE name = 'Univ Paris 6 (Pierre et Marie Curie - Jussieu)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Sud', name = 'Université Paris-Sud (Paris-XI)'
+WHERE name = 'Univ Paris 11 (Orsay)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Diderot', name = 'Université Denis Diderot (Paris-VII)', url = 'http://www.univ-paris7.fr/'
+WHERE name = 'Univ Paris 7 (Denis Diderot - Jussieu)';
+UPDATE profile_education_enum
+SET abbreviation = 'Dauphine', name = 'Université de Technologie en Sciences des Organisations et de la Décision de Paris-Dauphine (Paris-IX)'
+WHERE name = 'Univ Paris 9 (Dauphine)';
+UPDATE profile_education_enum
+SET abbreviation = 'Panthéon-Sorbonne', name = 'Université Panthéon-Sorbonne (Paris-I)'
+WHERE name = 'Univ Paris 1 (Panthéon-Sorbonne)';
+UPDATE profile_education_enum
+SET abbreviation = 'Nanterre', name = 'Université de Paris Ouest - Nanterre La Défense (Paris-X)'
+WHERE name = 'Univ Paris 10 (Nanterre)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Descartes', name = 'Université Paris Descartes (Paris-V)'
+WHERE name = 'Univ Paris 5 (René Descartes)';
+UPDATE profile_education_enum
+SET abbreviation = 'Sorbonne Nouvelle', name = 'Université Sorbonne Nouvelle (Paris-III)'
+WHERE name = 'Univ Paris 3 (Sorbonne Nouvelle)';
+UPDATE profile_education_enum
+SET abbreviation = 'Vincennes-Saint-Denis', name = 'Université de Vincennes à Saint-Denis (Paris-VIII)'
+WHERE name = 'Univ Paris 8 (Vincennes - Saint Denis)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Val de Marne', name = 'Université Paris-Val de Marne (Paris-XII)'
+WHERE name = 'Univ Paris 12 (Val de Marne)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Nord', name = 'Université Paris-Nord (Paris-XIII)'
+WHERE name = 'Univ Paris 13 (Nord)';
+UPDATE profile_education_enum
+SET abbreviation = 'Paris-Sorbonne', name = 'Université Paris-Sorbonne (Paris-IV)'
+WHERE name = 'Univ Paris 4 (Sorbonne)';
+UPDATE profile_education_enum
+SET abbreviation = 'Assas', name = 'Université Panthéon-Assas (Paris-II)'
+WHERE name = 'Univ Paris 2 (Panthéon - Assas)';
+UPDATE profile_education_enum
+SET abbreviation = 'CDI', name = 'Collège des Ingénieurs'
+WHERE name = 'Collège des Ingénieurs';
+UPDATE profile_education_enum
+SET abbreviation = 'ENS Ulm', name = 'École Normale Supérieure'
+WHERE name = 'ENS Ulm';
+UPDATE profile_education_enum
+SET abbreviation = 'ENS Lyon', name = 'École Normale Supérieure de Lyon '
+WHERE name = 'ENS Lyon';
+UPDATE profile_education_enum
+SET abbreviation = 'ENS Cachan', name = 'École Normale Supérieure de Cachan'
+WHERE name = 'ENS Cachan';
+UPDATE profile_education_enum
+SET abbreviation = 'ESPCI', name = 'ESPCI ParisTech'
+WHERE name = 'ESPCI';
+UPDATE profile_education_enum
+SET abbreviation = 'Sciences Po', name = 'Institut d\'Études Politiques de Paris'
+WHERE name = 'IEP Paris';
+UPDATE profile_education_enum
+SET abbreviation = 'EHESS', name = 'École des Hautes Études en Sciences Sociales'
+WHERE name = 'EHESS';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSIC', name = 'École Nationale Supérieure des Industries Chimiques'
+WHERE name = 'ENSIC';
+UPDATE profile_education_enum
+SET abbreviation = 'Grenoble INP', name = 'Institut Polytechnique de Grenoble', url = 'http://www.grenoble-inp.fr/'
+WHERE name = 'INPG';
+UPDATE profile_education_enum
+SET abbreviation = 'ESSEC', name = 'École Supérieure des Sciences Économiques et Commerciales'
+WHERE name = 'ESSEC';
+UPDATE profile_education_enum
+SET abbreviation = 'INPL', name = 'Institut National Polytechnique de Lorraine'
+WHERE name = 'INPL';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSAPB', name = 'École Nationale Supérieure d\'Architecture de Paris-Belleville'
+WHERE name = 'EAPB (Ecole Architecture Paris Belleville)';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSAPLV', name = 'École Nationale Supérieure d\'Architecture de Paris-La Villette'
+WHERE name = 'EAPLV (Ecole Architecture Paris La Villette)';
+UPDATE profile_education_enum
+SET abbreviation = 'EAVT', name = 'École d\'Architecture de la Ville et des Territoires à Marne-la-Vallée'
+WHERE name = 'EAVT (Ecole d\'architecture de Marne La Vallee)';
+UPDATE profile_education_enum
+SET abbreviation = 'ENSP', name = 'École Nationale Supérieure du Paysage'
+WHERE name = 'ENSP Versailles';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'École Nationale Supérieure du Génie Maritime', url = 'http://www.ensta.fr/'
+WHERE name = 'Génie maritime (Ecole nationale supérieur du)';
+UPDATE profile_education_enum
+SET abbreviation = 'CPA de Paris', name = 'Centre de Perfectionnement aux Affaires de Paris', url = ''
+WHERE name = 'Centre de Perfectionnement aux Affaires';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'ESCP-EAP', url = 'http://www.escp-eap.eu/'
+WHERE name = 'ESCP-EAP';
+UPDATE profile_education_enum
+SET abbreviation = 'CEPE', name = 'Centre d\'Études des Programmes Économiques'
+WHERE name = 'CEPE';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Institut des Actuaires', url = 'http://www.institutdesactuaires.com/'
+WHERE name = 'Institut des actuaires';
+UPDATE profile_education_enum
+SET abbreviation = 'CEIPI', name = 'Centre d\'Études Internationales de la Propriété Industrielle'
+WHERE name = 'CEIPI';
+UPDATE profile_education_enum
+SET abbreviation = 'Université Paul-Sabatier', name = 'Université Paul-Sabatier (Toulouse III)'
+WHERE name = 'Univ Toulouse III (Paul Sabatier)';
+UPDATE profile_education_enum
+SET abbreviation = 'Université de Provence', name = 'Université de Provence (Aix-Marseille I)'
+WHERE name = 'Université de Provence';
+UPDATE profile_education_enum
+SET abbreviation = 'INSA Rouen', name = 'Institut National des Sciences Appliquées de Rouen'
+WHERE name = 'INSA Rouen';
+UPDATE profile_education_enum
+SET abbreviation = 'IAE de Paris', name = 'Institut d\'Administration des Entreprises de Paris', url = 'http://iae.univ-paris1.fr/'
+WHERE name = 'Institut d\'Administration des Entreprises';
+
+UPDATE profile_education_enum
+SET abbreviation = 'Berkeley', name = 'University of California, Berkeley', country = 'US'
+WHERE name = 'Univ Berkeley';
+UPDATE profile_education_enum
+SET abbreviation = 'CalTech', name = 'California Institute of Technology', country = 'US'
+WHERE name = 'CalTech';
+UPDATE profile_education_enum
+SET abbreviation = 'MIT', name = 'Massachusetts Institute of Technology', country = 'US'
+WHERE name = 'Massachusetts Institute of Technology';
+UPDATE profile_education_enum
+SET abbreviation = 'Cornell', name = 'Cornell University', country = 'US'
+WHERE name = 'Univ Cornell';
+UPDATE profile_education_enum
+SET abbreviation = 'Stanford', name = 'Stanford University', country = 'US'
+WHERE name = 'Univ Stanford';
+UPDATE profile_education_enum
+SET abbreviation = 'UCLA', name = 'University of California, Los Angeles', country = 'US'
+WHERE name = 'Univ UCLA';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'University of Illinois', country = 'US'
+WHERE name = 'Univ Illinois';
+UPDATE profile_education_enum
+SET abbreviation = 'Michigan', name = 'University of Michigan, Ann Arbor', country = 'US'
+WHERE name = 'Univ Michigan';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Seattle University', country = 'US'
+WHERE name = 'Univ Seattle';
+UPDATE profile_education_enum
+SET abbreviation = 'UGA', name = 'University of Georgia', country = 'US'
+WHERE name = 'Univ Georgia';
+UPDATE profile_education_enum
+SET abbreviation = 'UT Austin', name = 'University of Texas at Austin', country = 'US'
+WHERE name = 'Univ Texas';
+UPDATE profile_education_enum
+SET abbreviation = 'RIP', name = 'Rensselaer Polytechnic Institute', country = 'US'
+WHERE name = 'Univ Rensselaer';
+UPDATE profile_education_enum
+SET abbreviation = 'NYU', name = 'New York University', country = 'US'
+WHERE name = 'Univ New York';
+UPDATE profile_education_enum
+SET abbreviation = 'Harvard', name = 'Harvard University', country = 'US'
+WHERE name = 'Univ Harvard';
+UPDATE profile_education_enum
+SET abbreviation = 'The Wharton School', name = 'The Wharton School of the University of Pennsylvania', country = 'US', url = 'http://www.wharton.upenn.edu/'
+WHERE name = 'Univ Wharton';
+UPDATE profile_education_enum
+SET abbreviation = 'Columbia University', name = 'Columbia University in the City of New York', country = 'US'
+WHERE name = 'Univ Columbia';
+UPDATE profile_education_enum
+SET abbreviation = 'WSBS', name = 'Watson School of Biological Sciences', country = 'US'
+WHERE name = 'Watson School of Biological Sciences';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Colorado School of Mines', country = 'US'
+WHERE name = 'Univ Colorado School of Mines';
+UPDATE profile_education_enum
+SET abbreviation = 'Princeton', name = 'Princeton University', country = 'US'
+WHERE name = 'Univ Princeton';
+UPDATE profile_education_enum
+SET abbreviation = 'Georgia Tech', name = 'Georgia Institute of Technology', country = 'US'
+WHERE name = 'GeorgiaTech';
+UPDATE profile_education_enum
+SET abbreviation = 'JHU', name = 'Johns Hopkins University', country = 'US'
+WHERE name = 'Univ Johns Hopkins';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'University of Chicago', country = 'US'
+WHERE name = 'Univ Chicago';
+UPDATE profile_education_enum
+SET abbreviation = 'Yale', name = 'Yale University', country = 'US'
+WHERE name = 'Univ Yale';
+UPDATE profile_education_enum
+SET abbreviation = 'TAMU', name = 'Texas A&M University', country = 'US'
+WHERE name = 'Texas A&M University';
+UPDATE profile_education_enum
+SET abbreviation = 'UCSB', name = 'University of California, Santa Barbara', country = 'US'
+WHERE name = 'Univ Santa-Barbara';
+UPDATE profile_education_enum
+SET abbreviation = 'Kellogg', name = 'Kellogg School of Management', country = 'US'
+WHERE name = 'Kellogg School of Management';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'University of Iowa', country = 'US'
+WHERE name = 'Univ Iowa';
+UPDATE profile_education_enum
+SET abbreviation = 'UW-Madison', name = 'University of Wisconsin-Madison', country = 'US', url = 'http://www.wisc.edu/'
+WHERE name = 'Univ Wisconsin-Madison';
+UPDATE profile_education_enum
+SET abbreviation = 'UCSD', name = 'University of California, San Diego', country = 'US'
+WHERE name = 'Univ San Diego';
+UPDATE profile_education_enum
+SET abbreviation = 'NU', name = 'Northwestern University', country = 'US'
+WHERE name = 'Univ Northwestern';
+UPDATE profile_education_enum
+SET abbreviation = 'CU', name = 'University of Colorado at Boulder', country = 'US'
+WHERE name = 'Univ Colorado at Boulder';
+UPDATE profile_education_enum
+SET abbreviation = 'CMU', name = 'Carnegie Mellon University', country = 'US'
+WHERE name = 'Univ Carnegie Mellon';
+UPDATE profile_education_enum
+SET abbreviation = 'Carolina', name = 'University of North Carolina at Chapel Hill', country = 'US'
+WHERE name = 'Univ of North Carolina at Chapel Hill';
+
+UPDATE profile_education_enum
+SET abbreviation = 'TU Berlin', name = 'Technische Universität Berlin', country = 'DE'
+WHERE name = 'Univ TU Berlin';
+UPDATE profile_education_enum
+SET abbreviation = 'TU Darmstadt', name = 'Technische Universität Darmstadt', country = 'DE'
+WHERE name = 'Univ TU Darmstadt';
+UPDATE profile_education_enum
+SET abbreviation = 'TU München', name = 'Technische Universität München', country = 'DE'
+WHERE name = 'Univ TU München';
+UPDATE profile_education_enum
+SET abbreviation = 'Universität Karlsruhe', name = 'Universität Karlsruhe (TH)', country = 'DE'
+WHERE name = 'Univ Karlsruhe';
+UPDATE profile_education_enum
+SET abbreviation = 'RWTH', name = 'RWTH Aachen University', country = 'DE'
+WHERE name = 'Univ RWTH-Aachen';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Universität Stuttgart', country = 'DE'
+WHERE name = 'Univ Stuttgart';
+
+UPDATE profile_education_enum
+SET abbreviation = 'EPM', name = 'École Polytechnique de Montréal', country = 'CA'
+WHERE name = 'EP Montréal';
+UPDATE profile_education_enum
+SET abbreviation = 'UBC', name = 'University of British Columbia', country = 'CA'
+WHERE name = 'Univ British Columbia';
+UPDATE profile_education_enum
+SET abbreviation = 'McGill', name = 'McGill University', country = 'CA'
+WHERE name = 'Univ McGill';
+UPDATE profile_education_enum
+SET abbreviation = 'UQÀM', name = 'Université du Québec à Montréal', country = 'CA' WHERE id = 125;
+
+UPDATE profile_education_enum
+SET abbreviation = 'UPC', name = 'Universitat Politècnica de Catalunya', country = 'ES'
+WHERE name = 'Univ Catalunya';
+UPDATE profile_education_enum
+SET abbreviation = 'UPM', name = 'Universidad Politècnica de Madrid', country = 'ES'
+WHERE name = 'Univ Madrid';
+UPDATE profile_education_enum
+SET abbreviation = 'UPF', name = 'Universitat Pompeu Fabra', country = 'ES'
+WHERE name = 'Univ Pompeu Fabra';
+
+UPDATE profile_education_enum
+SET abbreviation = 'Chalmers', name = 'Chalmers Tekniska Högskola', country = 'SE'
+WHERE name = 'Univ Chalmers';
+UPDATE profile_education_enum
+SET abbreviation = 'KTH', name = 'Kungliga Tekniska Högskolan', country = 'SE'
+WHERE name = 'Univ KTH';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Stockholms Universitet', country = 'SE'
+WHERE name = 'Univ Stockholm';
+
+UPDATE profile_education_enum
+SET abbreviation = 'TU Delft', name = 'Technische Universiteit Delft', country = 'NL'
+WHERE name = 'Univ TU Delft';
+UPDATE profile_education_enum
+SET abbreviation = 'RSM', name = 'Rotterdam School of Management, Erasmus University', country = 'NL'
+WHERE name = 'RSM';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Universiteit Leiden', country = 'NL'
+WHERE name = 'Univ Leiden';
+
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Kyoto University', country = 'JP'
+WHERE name = 'Univ Kyoto';
+UPDATE profile_education_enum
+SET abbreviation = 'Todai', name = 'University of Tokyo', country = 'JP'
+WHERE name = 'Univ Tokyo';
+UPDATE profile_education_enum
+SET abbreviation = 'Tokyo Tech', name = 'Tokyo Institute of Technology', country = 'JP'
+WHERE name = 'Tokyo Institute of Technology';
+
+UPDATE profile_education_enum
+SET abbreviation = 'UNIL', name = 'Université de Lausanne', country = 'CH'
+WHERE name = 'Univ Lausanne';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Universität Zürich', country = 'CH'
+WHERE name = 'Univ Zürich';
+UPDATE profile_education_enum
+SET abbreviation = 'EPFL', name = 'École Polytechnique Fédérale de Lausanne', country = 'CH'
+WHERE name = 'EP Fédérale Lausanne';
+UPDATE profile_education_enum
+SET abbreviation = 'IMD', name = 'International Institute for Management Development', country = 'CH'
+WHERE name = 'Institute for Management Development';
+UPDATE profile_education_enum
+SET abbreviation = 'ETH Zürich', name = 'Eidgenössische Technische Hochschule Zürich', country = 'CH'
+WHERE name = 'ETH Zürich';
+
+UPDATE profile_education_enum
+SET abbreviation = 'UNIMI', name = 'Università degli Studi di Milano', country = 'IT'
+WHERE name = 'Univ Milano';
+UPDATE profile_education_enum
+SET abbreviation = 'UNITO', name = 'Università degli Studi di Torino', country = 'IT'
+WHERE name = 'Univ Torino';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Politecnico di Milano', country = 'IT'
+WHERE name = 'Politecnico di Milano';
+UPDATE profile_education_enum
+SET abbreviation = 'EUI', name = 'European University Institute', country = 'IT'
+WHERE name = 'Institut Universitaire Européen';
+UPDATE profile_education_enum
+SET abbreviation = 'Università Bocconi', name = 'Università Commerciale Luigi Bocconi', url = 'http://www.unibocconi.it/', country = 'IT'
+WHERE name = 'Université Bocconi';
+
+UPDATE profile_education_enum
+SET abbreviation = 'MGU', name = 'Lomonosov Moscow State University', country = 'RU'
+WHERE name = 'Univ Moscow (lomonosov)';
+UPDATE profile_education_enum
+SET abbreviation = 'Bauman MSTU', name = 'Bauman Moscow State Technical University', country = 'RU', url = 'http://www.bmstu.ru/'
+WHERE name = 'Univ Moscow (Bauman)';
+
+UPDATE profile_education_enum
+SET abbreviation = 'Technion', name = 'Israel Institute of Technology', country = 'IL'
+WHERE name = 'Univ Technion';
+
+UPDATE profile_education_enum
+SET abbreviation = 'Oxford', name = 'University of Oxford', country = 'GB'
+WHERE name = 'Univ Oxford';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'London Business School', country = 'GB'
+WHERE name = 'London Business School';
+UPDATE profile_education_enum
+SET abbreviation = 'LSE', name = 'The London School of Economics and Political Science', country = 'GB'
+WHERE name = 'London School of Economics';
+UPDATE profile_education_enum
+SET abbreviation = 'Cambridge', name = 'University of Cambridge', country = 'GB'
+WHERE name = 'Univ Cambridge';
+UPDATE profile_education_enum
+SET abbreviation = 'Imperial College', name = 'Imperial College London', country = 'GB', url = 'http://www3.imperial.ac.uk/'
+WHERE name = 'Imperial College';
+UPDATE profile_education_enum
+SET abbreviation = 'Henley', name = 'Henley Management College', country = 'GB', url = 'http://www.henley.reading.ac.uk/'
+WHERE name = 'Henley Management College';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'University of Southampton', country = 'GB', url = 'http://www.soton.ac.uk/'
+WHERE name = 'Univ Southampton';
+UPDATE profile_education_enum
+SET abbreviation = '', name = 'Cardiff University', country = 'GB'
+WHERE name = 'Univ Cardiff';
+
+UPDATE profile_education_enum
+SET abbreviation = 'UNSW', name = 'The University of New South Wales', country = 'AU'
+WHERE name = 'Univ New South Wales (Sydney Australia)';
+
+UPDATE profile_education_enum
+SET abbreviation = 'THU', name = 'Tsinghua University', country = 'CN'
+WHERE name = 'Univ Tsinghua';
+
+UPDATE profile_education_enum
+SET abbreviation = 'NUS', name = 'National University of Singapore', country = 'SG'
+WHERE name = 'National University of Singapore';
+
+UPDATE profile_education_enum
+SET abbreviation = 'NTNU', name = 'Norwegian University of Science and Technology', country = 'NO', url = 'http://www.ntnu.no/'
+WHERE name = 'Univ Trondheim';
+
+UPDATE profile_education_enum
+SET abbreviation = '', country = 'GB'
+WHERE name = 'University of Surrey';
+UPDATE profile_education_enum
+SET abbreviation = 'OIV', country = 'FR'
+WHERE name = 'Organisme International de la Vigne et du Vin';
+UPDATE profile_education_enum
+SET abbreviation = 'NSU', name = 'Novosibirsk State University', url = 'http://www.nsu.ru/', country = 'RU'
+WHERE name = 'Université de Novossibirsk (Новосибирский Государственный Университет)';
+
+-- Cleans duplicated entries
+UPDATE profile_education SET eduid = 0 WHERE eduid = 70;
+DELETE FROM profile_education_enum WHERE id = 70;
+DELETE FROM profile_education_degree WHERE eduid = 70;
+
+UPDATE profile_education SET eduid = 91 WHERE eduid = 106;
+DELETE FROM profile_education_enum WHERE id = 106;
+DELETE FROM profile_education_degree WHERE eduid = 106;
+
+-- Adds new universities needed for the AX directory
+INSERT INTO profile_education_enum (name, url, country, abbreviation)
+ VALUES ('Institut Supérieur de l\'Aéronautique et de l\'Espace', 'http://www.isae.fr/', 'FR', 'ISAE'),
+ ('Institut des Hautes Études de Défense Nationale', 'http://www.ihedn.fr/', 'FR', 'IHEDN'),
+ ('École du Personnel Navigant d\'Essais et de Réception',
+ 'http://www.defense.gouv.fr/dga/archives/l_epner_ecole_du_personnel_navigant_d_essais_et_de_reception', 'FR', 'EPNER'),
+ ('Agrocampus Ouest', 'http://www.agrocampus-ouest.fr/', 'FR', 'ENSAR'),
+ ('Montpellier SupAgro', 'http://www.supagro.fr/', 'fr', ''),
+ ('Institut Supérieur des Matériaux et de la Construction Mécanique Saint-Ouen', 'http://www.cefi.org/BOUCHON/BS/ISMCM_Saint-Ouen.htm',
+ 'FR', 'ISMCM Saint-Ouen'),
+ ('École Centrale d\'Électronique ', 'http://www.ece.fr/', 'FR', 'ECE'),
+ ('École Nationale de l\'Aviation Civile', 'http://www.enac.fr/', 'FR', 'ENAC'),
+ ('Centre des Hautes Études de la Construction', 'http://www.chec.fr/', 'FR', 'CHEC'),
+ ('École de l\'Air', 'http://www.ecole-air.air.defense.gouv.fr/index.php?option=com_content&task=view&id=203&Itemid=251', 'FR', ''),
+ ('Institut Supérieur des Affaires', '', 'FR', 'ISA'),
+ ('École Supérieure de Gestion de Paris', 'http://www.esg.fr/', 'FR', 'ESG Paris'),
+ ('Institut des Hautes Études Européennes', 'http://www-ihee.u-strasbg.fr/', 'FR', 'IHEE'),
+ ('École Nationale de la Magistrature', 'http://www.enm.justice.fr/', 'FR', 'ENM'),
+ ('Institut de Formation Supérieure BioMédicale', 'http://www.igr.fr/ifsbm/', 'FR', 'IFSBM'),
+ ('Institut Supérieur de l\'AgroAlimentaire', 'http://www.isaa.fr/', 'FR', 'ISAA'),
+ ('École des Mines d\'Alès', 'http://www.ema.fr/', 'FR', 'EMA'),
+ ('Syracuse University', 'http://www.syr.edu/', 'US', 'SU'),
+ ('Dartmouth College', 'http://www.dartmouth.edu/', 'US', ''),
+ ('International Teachers Programme', 'http://www.itp-schools.org/', '', 'ITP'),
+ ('University of Kentucky', 'http://www.uky.edu/', 'US', 'UK'),
+ ('Marine Corps University', 'http://www.mcu.usmc.mil/', 'US', 'MCU'),
+ ('Chartered Institute of Management Accountants', 'http://www.cimaglobal.com/', 'GB', 'CIMA'),
+ ('University College London', 'http://www.ucl.ac.uk/', 'GB', 'UCL'),
+ ('Chartered Financial Analyst Institute', 'http://www.cfainstitute.org/', 'US', 'CFA Institute'),
+ ('Naval Postgraduate School', 'http://www.nps.edu/', 'US', 'NPS'),
+ ('Royal College of Art', 'http://www.rca.ac.uk/', 'GB', 'RCA'),
+ ('Uniwersytet Gdański', 'http://www.univ.gda.pl/', 'PL', ''),
+ ('College of Europe', 'http://www.coleurope.eu/', '', ''),
+ ('Purdue University', 'http://www.purdue.edu/', 'US', ''),
+ ('Queen\'s University', 'http://www.queensu.ca/', 'CA', 'Queen\'s'),
+ ('Université de Bretagne Occidentale', 'http://www.univ-brest.fr/', 'FR', 'UBO'),
+ ('University of California, Davis', 'http://www.ucdavis.edu/', 'US', 'UC Davis'),
+ ('Universität Stuttgarti', 'http://www.uni-stuttgart.de/', 'DE', ''),
+ ('Universitatea Politehnica din Bucureşti', 'http://www.pub.ro/', 'RO', 'Politehnica din Bucureşti'),
+ ('University of Birmingham', 'http://www.bham.ac.uk/', 'GB', ''),
+ ('University of Pennsylvania', 'http://www.upenn.edu/', 'US', ''),
+ ('University of Rome', '', 'IT', ''),
+ ('University of Sheffield', 'http://www.shef.ac.uk/', 'GB', ''),
+ ('University of Utah', 'http://www.utah.edu/', 'US', ''),
+ ('University of Washington', 'http://www.washington.edu/', 'US', ''),
+ ('Urbana University', 'http://www.urbana.edu/', 'US', ''),
+ ('Université de Technologie de Compiègne', 'http://www.utc.fr/', 'FR', 'UTC'),
+ ('Virginia Polytechnic Institute and State University', 'http://www.vt.edu/', 'US', 'Virginia Tech'),
+ ('Université Claude Bernard (Lyon I)', 'http://www.univ-lyon1.fr/', 'FR', 'Université Claude Bernard'),
+ ('Cleveland State University', 'http://www.csuohio.edu/', 'US', 'CSU'),
+ ('Centre de Perfectionnement aux Affaires du Nord', '', 'FR', 'CPA du Nord'),
+ ('Centre de Perfectionnement aux Affaires de Lyon', '', '', 'CPA de Lyon'),
+ ('Amherst College', 'http://www.amherst.edu/', 'US', ''),
+ ('Ottawa University', 'http://www.ottawa.edu/', 'US', 'OU'),
+ ('Indiana University', 'http://www.indiana.edu/', 'US', ''),
+ ('University of Notre Dame du Lac', 'http://www.nd.edu/', 'US', 'Notre Dame'),
+ ('University of Maryland, College Park ', 'http://www.umd.edu/', 'US', 'UMCP'),
+ ('Vanderbilt University', 'http://www.vanderbilt.edu/', 'US', ''),
+ ('Institut National Polytechnique de Toulouse', 'http://www.inp-toulouse.fr/', 'FR', 'INP Toulouse'),
+ ('University of Houston', 'http://www.uh.edu/', 'US', 'UH'),
+ ('École Spéciale des Travaux Publics, du Bâtiment et de l\'Industrie', 'http://www.estp.fr/', 'FR', 'ESTP'),
+ ('Université Jean-Moulin (Lyon-III)', 'http://www.univ-lyon3.fr/', 'FR', 'Université Jean-Moulin'),
+ ('École Nationale Supérieure d\'Ingénieurs Électriciens de Grenoble', 'http://ense3.grenoble-inp.fr/', 'FR', 'ENSIEG'),
+ ('École Nationale Supérieure d\'Hydraulique et de Mécanique de Grenoble', 'http://ense3.grenoble-inp.fr/', 'FR', 'ENSHMG'),
+ ('Université de Rennes 1', 'http://www.univ-rennes1.fr/', 'FR', ''),
+ ('École Centrale Paris', 'http://www.ecp.fr/', 'FR', 'Centrale Paris'),
+ ('University of Dallas', 'http://www.udallas.edu/', 'US', ''),
+ ('Pontifical Catholic University of Chile', 'http://www.uc.cl/', 'CL', 'PUC'),
+ ('Universitat Oberta de Catalunya', 'http://www.uoc.edu/web/eng/', 'ES', 'UOC'),
+ ('University of California, Irvine', 'http://www.uci.edu/', 'US', 'UCI'),
+ ('Association Francophone de Management de Projet', 'http://www.afitep.fr/', 'FR', 'AFITEP'),
+ ('Centre Européen d\'Éducation Permanente', 'http://www.cedep.fr/', 'FR', 'CEDEP'),
+ ('Collège Interarmées de Défense', 'http://www.college.interarmees.defense.gouv.fr/', 'FR', ''),
+ ('Centre de Formation des Journalistes', 'http://www.cfpj.com/', 'FR', 'CFJ'),
+ ('Institut National des Hautes Études de Sécurité', 'http://www.inhes.interieur.gouv.fr/', 'FR', 'INHES'),
+ ('Université d\'Orléans', 'http://www.univ-orleans.fr/', 'FR', '');
+
+
+-- Médecine is not a university but an educational field
+REPLACE INTO profile_education (uid, id, fieldid, eduid, degreeid)
+ SELECT e.uid, e.id, f.id, 0, d.id
+ FROM profile_education AS e
+ INNER JOIN profile_education_enum AS l ON (l.id = e.eduid)
+ INNER JOIN profile_education_degree_enum AS d ON (d.degree = "Doctorat")
+ INNER JOIN profile_education_field_enum AS f ON (f.field = "Médecine")
+ WHERE l.name = "Médecine";
+
+DELETE FROM profile_education_enum
+ WHERE name = "Médecine";
+
+# vim:set syntax=mysql:
+
--- /dev/null
+INSERT INTO profile_education (id, uid, grad_year, entry_year, eduid, degreeid, flags)
+ SELECT 100, u.user_id, u.promo_sortie, u.promo, e.id, d.id, 'primary'
+ FROM auth_user_md5 AS u
+ LEFT JOIN profile_education_enum AS e ON (e.abbreviation = "X")
+ LEFT JOIN profile_education_degree_enum AS d ON (d.degree = "Ingénieur");
+
+ UPDATE profile_display AS d
+INNER JOIN profile_education AS e ON (d.pid = e.uid)
+ SET d.promo = CONCAT("X", entry_year)
+ WHERE FIND_IN_SET('primary', e.flags);
+
+-- vim:set syntax=mysql:
--- /dev/null
+DROP TABLE IF EXISTS profile_job_enum;
+
+CREATE TABLE IF NOT EXISTS profile_job_enum (
+ id INT(6) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL DEFAULT '',
+ acronym VARCHAR(255) NOT NULL DEFAULT '',
+ url VARCHAR(255) NOT NULL DEFAULT '',
+ email VARCHAR(255) NOT NULL DEFAULT '',
+ holdingid INT(6) UNSIGNED DEFAULT NULL,
+ NAF_code CHAR(5) NOT NULL DEFAULT '',
+ AX_code BIGINT(10) UNSIGNED NOT NULL,
+ PRIMARY KEY (id),
+ UNIQUE KEY (name)
+) CHARSET=utf8;
+
+DROP TABLE IF EXISTS profile_job;
+
+CREATE TABLE IF NOT EXISTS profile_job (
+ id TINYINT(1) UNSIGNED NOT NULL,
+ uid INT(11) NOT NULL DEFAULT 0,
+ jobid INT(6) UNSIGNED NOT NULL DEFAULT 0,
+ sectorid TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
+ subsectorid TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+ subsubsectorid SMALLINT(3) UNSIGNED NOT NULL DEFAULT 0,
+ description VARCHAR(255) NOT NULL DEFAULT '',
+ url VARCHAR(255) NOT NULL DEFAULT '',
+ email VARCHAR(255) NOT NULL DEFAULT '',
+ pub ENUM('private', 'ax', 'public') DEFAULT 'private',
+ email_pub ENUM('private', 'ax', 'public') DEFAULT 'private',
+ PRIMARY KEY (uid, id),
+ INDEX uid (uid)
+) CHARSET=utf8;
+
+INSERT IGNORE INTO profile_job_enum (name, url)
+ SELECT entreprise, web
+ FROM entreprises;
+
+INSERT INTO profile_job (id, uid, jobid, email, pub, email_pub, description)
+ SELECT e.entrid, e.uid, j.id, e.email, e.pub, e.email_pub,
+ CONCAT_WS(', ', IF(e.poste = '', NULL, e.poste), IF(e.fonction = 0, NULL, f.fonction_fr),
+ IF(e.ss_secteur IS NULL , IF(e.secteur IS NULL, NULL, s.label), ss.label))
+ FROM entreprises AS e
+ INNER JOIN profile_job_enum AS j ON (e.entreprise = j.name)
+ LEFT JOIN fonctions_def AS f ON (f.id = e.fonction)
+ LEFT JOIN emploi_ss_secteur AS ss ON (ss.id = e.ss_secteur)
+ LEFT JOIN emploi_secteur AS s ON (s.id = e.secteur);
+
+-- vim:set syntax=mysql:
--- /dev/null
+DROP TABLE IF EXISTS profile_job_sector_enum;
+
+CREATE TABLE IF NOT EXISTS profile_job_sector_enum (
+ id TINYINT(2) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(256) NOT NULL DEFAULT '',
+ PRIMARY KEY(id),
+ UNIQUE KEY(name)
+) CHARSET=utf8;
+
+DROP TABLE IF EXISTS profile_job_subsector_enum;
+
+CREATE TABLE IF NOT EXISTS profile_job_subsector_enum (
+ id TINYINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
+ sectorid TINYINT(2) UNSIGNED NOT NULL,
+ flags SET('optgroup') DEFAULT '' NOT NULL,
+ name VARCHAR(256) NOT NULL DEFAULT '',
+ PRIMARY KEY(id)
+) CHARSET=utf8;
+
+DROP TABLE IF EXISTS profile_job_subsubsector_enum;
+
+CREATE TABLE IF NOT EXISTS profile_job_subsubsector_enum (
+ id SMALLINT(3) UNSIGNED NOT NULL AUTO_INCREMENT,
+ sectorid TINYINT(2) UNSIGNED NOT NULL,
+ subsectorid TINYINT(3) UNSIGNED NOT NULL,
+ name VARCHAR(256) NOT NULL DEFAULT '',
+ flags SET('display') NOT NULL DEFAULT 'display',
+ PRIMARY KEY(id)
+) CHARSET=utf8;
+
+DROP TABLE IF EXISTS profile_job_alternates;
+
+CREATE TABLE IF NOT EXISTS profile_job_alternates (
+ id TINYINT(2) UNSIGNED NOT NULL DEFAULT 0,
+ subsubsectorid SMALLINT(3) UNSIGNED NOT NULL,
+ name VARCHAR(256) NOT NULL DEFAULT '',
+ PRIMARY KEY(id, subsubsectorid),
+ UNIQUE KEY(name)
+) CHARSET=utf8;
+
+
+ALTER TABLE profile_phones CHANGE COLUMN link_type link_type ENUM('address','pro','user', 'hq') NOT NULL DEFAULT 'user';
+
+-- vim:set syntax=mysql:
--- /dev/null
+DROP TABLE IF EXISTS profile_mentor;
+DROP TABLE IF EXISTS profile_mentor_country;
+DROP TABLE IF EXISTS profile_mentor_sector;
+
+CREATE TABLE IF NOT EXISTS profile_mentor (
+ uid INT(11) NOT NULL DEFAULT 0,
+ expertise TEXT NOT NULL,
+ PRIMARY KEY (uid),
+ FULLTEXT INDEX (expertise)
+) CHARSET=utf8;
+
+INSERT INTO profile_mentor (uid, expertise)
+ SELECT uid, expertise
+ FROM mentor;
+
+CREATE TABLE IF NOT EXISTS profile_mentor_country (
+ uid INT(11) NOT NULL DEFAULT 0,
+ country CHAR(2) NOT NULL DEFAULT "FR",
+ PRIMARY KEY (uid, country),
+ INDEX uid (uid)
+) CHARSET=utf8;
+
+INSERT INTO profile_mentor_country (uid, country)
+ SELECT uid, pid
+ FROM mentor_pays;
+
+CREATE TABLE IF NOT EXISTS profile_mentor_sector (
+ uid INT(11) NOT NULL DEFAULT 0,
+ sectorid TINYINT(2) UNSIGNED NOT NULL,
+ subsectorid TINYINT(3) UNSIGNED NOT NULL,
+ PRIMARY KEY (uid, sectorid, subsectorid),
+ INDEX uid (uid)
+) CHARSET=utf8;
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE watch_profile MODIFY field enum('search_names', 'nom', 'freetext', 'mobile', 'nationalite',
+ 'nationalite2', 'nationalite3', 'nick', 'web', 'networking',
+ 'edus', 'addresses', 'section', 'binets', 'medals', 'cv',
+ 'jobs', 'photo', 'corps');
+
+UPDATE watch_profile SET field = 'search_names' WHERE field = 'nom' OR field = 'nick';
+
+ALTER TABLE watch_profile MODIFY field enum('search_names', 'freetext', 'mobile', 'nationalite',
+ 'nationalite2', 'nationalite3', 'web', 'networking','edus',
+ 'addresses', 'section', 'binets', 'medals', 'cv', 'jobs',
+ 'photo', 'corps');
+
+# vim:set syntax=mysql:
--- /dev/null
+DROP TABLE IF EXISTS profile_addresses;
+
+CREATE TABLE IF NOT EXISTS profile_addresses (
+ pid INT(11) DEFAULT NULL,
+ jobid INT(6) UNSIGNED DEFAULT NULL,
+ type ENUM('home','job','hq') NOT NULL DEFAULT 'home',
+ id TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
+ flags SET('current','temporary','secondary','mail','cedex') DEFAULT NULL,
+ accuracy TINYINT(1) UNSIGNED NOT NULL DEFAULT 0,
+ text TEXT NOT NULL,
+ postalText TEXT NOT NULL,
+ postalCode VARCHAR(255) DEFAULT NULL,
+ localityId INT(11) DEFAULT NULL,
+ subAdministrativeAreaId INT(11) DEFAULT NULL,
+ administrativeAreaId INT(11) DEFAULT NULL,
+ countryId CHAR(2) DEFAULT NULL,
+ latitude FLOAT(10,7) DEFAULT NULL,
+ longitude FLOAT(10,7) DEFAULT NULL,
+ north FLOAT(10,7) DEFAULT NULL,
+ south FLOAT(10,7) DEFAULT NULL,
+ east FLOAT(10,7) DEFAULT NULL,
+ west FLOAT(10,7) DEFAULT NULL,
+ updateTime DATETIME NOT NULL DEFAULT 0,
+ pub ENUM('public','ax','private') NOT NULL DEFAULT 'private',
+ comment VARCHAR(255) DEFAULT NULL,
+ PRIMARY KEY(pid, jobid, type, id),
+ INDEX pid (pid),
+ INDEX jobid (jobid),
+ INDEX type (type),
+ INDEX adrid (id),
+ INDEX localityId (localityId),
+ INDEX administrativeAreaId (administrativeAreaId),
+ INDEX subAdministrativeAreaId (subAdministrativeAreaId),
+ INDEX countryId (countryId)
+) CHARSET=utf8;
+
+INSERT INTO profile_addresses (pid, id, postalCode, updateTime, pub, comment, latitude, longitude, countryId,
+ type, flags)
+ SELECT uid, adrid, postcode, datemaj, pub, comment, glat, glng, country,
+ IF(FIND_IN_SET('pro', 'statut'), 'job', 'home'),
+ CONCAT(IF(FIND_IN_SET('res-secondaire', 'statut'), 'secondary,', ''),
+ IF(FIND_IN_SET('courrier', 'statut'), 'mail,', ''),
+ IF(FIND_IN_SET('active', 'statut'), 'current,', ''),
+ IF(FIND_IN_SET('temporaire', 'statut'), 'temporary', ''))
+ FROM adresses;
+
+CREATE TABLE IF NOT EXISTS geoloc_countries (
+ iso_3166_1_a2 CHAR(2) NOT NULL,
+ iso_3166_1_a3 CHAR(3) NOT NULL,
+ iso_3166_1_num SMALLINT(3) UNSIGNED NOT NULL,
+ worldRegion CHAR(2) DEFAULT NULL,
+ countryFR VARCHAR(255) NOT NULL,
+ country VARCHAR(255) NOT NULL,
+ capital VARCHAR(255) NOT NULL,
+ nationalityFR VARCHAR(255) DEFAULT NULL,
+ nationality VARCHAR(255) DEFAULT NULL,
+ phonePrefix SMALLINT(5) UNSIGNED DEFAULT NULL,
+ phoneFormat VARCHAR(255) NOT NULL,
+ licensePlate CHAR(4) DEFAULT NULL,
+ belongsTo CHAR(2) DEFAULT NULL,
+ PRIMARY KEY(iso_3166_1_a2),
+ UNIQUE KEY(iso_3166_1_a3),
+ UNIQUE KEY(iso_3166_1_num),
+ INDEX(iso_3166_1_a2),
+ INDEX(phonePrefix)
+) CHARSET=utf8;
+
+UPDATE geoloc_pays
+ SET n3 = 450
+ WHERE a2 = "MG";
+
+UPDATE geoloc_pays
+ SET n3 = 807
+ WHERE a2 = "MK";
+
+INSERT INTO geoloc_countries (iso_3166_1_a2, iso_3166_1_a3, iso_3166_1_num, worldRegion,
+ countryFR, country, capital, nationalityFR,
+ phonePrefix, phoneFormat, licensePlate)
+ SELECT a2, a3, n3, worldrgn, pays, country, capital, nat, phoneprf, phoneformat, license_plate
+ FROM geoloc_pays;
+
+CREATE TABLE IF NOT EXISTS geoloc_administrativeareas (
+ id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ country CHAR(2) NOT NULL,
+ PRIMARY KEY(id),
+ UNIQUE KEY(id, name, country),
+ INDEX(id),
+ INDEX(name),
+ INDEX(country)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS geoloc_subadministrativeareas (
+ id INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ country CHAR(2) NOT NULL,
+ PRIMARY KEY(id),
+ UNIQUE KEY(id, name, country),
+ INDEX(id),
+ INDEX(name),
+ INDEX(country)
+) CHARSET=utf8;
+
+CREATE TABLE IF NOT EXISTS geoloc_localities (
+ id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+ name VARCHAR(255) NOT NULL,
+ country CHAR(2) NOT NULL,
+ PRIMARY KEY(id),
+ UNIQUE KEY(id, name, country),
+ INDEX(id),
+ INDEX(name),
+ INDEX(country)
+) CHARSET=utf8;
+
+-- vim:set syntax=mysql:
--- /dev/null
+ALTER TABLE geoloc_countries MODIFY COLUMN phoneFormat VARCHAR(255) NOT NULL DEFAULT "";
+
+DELETE FROM geoloc_countries
+ WHERE iso_3166_1_a2 = "TP" OR iso_3166_1_a2 = "YU";
+
+INSERT INTO geoloc_countries (iso_3166_1_a2, iso_3166_1_a3, iso_3166_1_num, worldRegion,
+ country, countryFR, capital, nationalityFR,
+ licensePlate, belongsTo, phonePrefix)
+ VALUES ("AX", "ALA", 248, "EU", "Åland, Îles", "Åland Islands", "Mariehamn", NULL, "AX", "FI", 358),
+ ("GG", "GGY", 831, "EU", "Guernsey", "Guernesey", "St Peter Port", NULL, "GBG", "GB", 44),
+ ("GY", "GUY", 328, NULL, "Guyana", "Guyana", "Georgetown", "Guyanien", "GUY", NULL, 592),
+ ("HK", "HKG", 344, NULL, "Hong Kong", "Hong-Kong", "Hong-Kong", "Hongkongais", "HK", NULL, 852),
+ ("IM", "IMN", 833, NULL, "Isle of Man", "Île de Man", "Douglas", "Mannois", "GBM", NULL, 44),
+ ("JE", "JEY", 832, NULL, "Jersey", "Jersey", "Saint-Hélier", "Jersiais", "GBJ", NULL, 44),
+ ("MO", "MAC", 446, NULL, "Macao", "Macao", "Macao", "Macanais", "MO", NULL, 853),
+ ("ME", "MNE", 499, NULL, "Montenegro", "Monténégro", "Podgorica", "Monténégrin", "MNE",
+ NULL, 382),
+ ("PS", "PSE", 275, NULL, "Palestinian Territory, Occupied", "Palestiniens occupé, Territoire",
+ "Jérusalem", "Palestinien", "PS", NULL, 970),
+ ("BL", "BLM", 652, "EU", "Saint Barthélemy", "Saint-Barthélemy", "Gustavia", NULL, "F", "FR", 33),
+ ("MF", "MAF", 663, "EU", "Saint Martin", "Saint-Martin", "Marigot", NULL, "F", "FR", 33),
+ ("PM", "SPM", 666, "EU", "Saint Pierre and Miquelon", "Saint-Pierre-et-Miquelon", "Saint-Pierre",
+ NULL, "F", "FR", 33),
+ ("RS", "SRB", 688, NULL, "Serbia", "Serbie", "Belgrade", "Serbe", "SRB", NULL, 381),
+ ("TL", "TLS", 626, NULL, "Timor-Leste", "Timor-Leste", "Dili", "Timorais", "TL", NULL, 670);
+
+UPDATE geoloc_countries
+ SET country = "Croatia"
+ WHERE iso_3166_1_a2 = "HR";
+
+UPDATE geoloc_countries
+ SET country = "Slovakia"
+ WHERE iso_3166_1_a2 = "SK";
+
+UPDATE geoloc_countries
+ SET country = "Saint Helena"
+ WHERE iso_3166_1_a2 = "SH";
+
+UPDATE geoloc_countries
+ SET countryFR = "Antigua-et-Barbuda"
+ WHERE iso_3166_1_a2 = "AG";
+
+UPDATE geoloc_countries
+ SET countryFR = "Cameroun"
+ WHERE iso_3166_1_a2 = "CM";
+
+UPDATE geoloc_countries
+ SET countryFR = "Centrafricaine, République"
+ WHERE iso_3166_1_a2 = "CF";
+
+UPDATE geoloc_countries
+ SET countryFR = "Cocos (Keeling), Îles"
+ WHERE iso_3166_1_a2 = "CC";
+
+UPDATE geoloc_countries
+ SET countryFR = "Égypte"
+ WHERE iso_3166_1_a2 = "EG";
+
+UPDATE geoloc_countries
+ SET countryFR = "Émirats arabes unis"
+ WHERE iso_3166_1_a2 = "AE";
+
+UPDATE geoloc_countries
+ SET countryFR = "Équateur"
+ WHERE iso_3166_1_a2 = "EC";
+
+UPDATE geoloc_countries
+ SET countryFR = "Érythrée"
+ WHERE iso_3166_1_a2 = "ER";
+
+UPDATE geoloc_countries
+ SET countryFR = "Èthiopie"
+ WHERE iso_3166_1_a2 = "ET";
+
+UPDATE geoloc_countries
+ SET countryFR = "États-Unis"
+ WHERE iso_3166_1_a2 = "US";
+
+UPDATE geoloc_countries
+ SET countryFR = "Géorgie du Sud et les Îles Sandwich du Sud"
+ WHERE iso_3166_1_a2 = "GS";
+
+UPDATE geoloc_countries
+ SET countryFR = "Guinée-Bissau"
+ WHERE iso_3166_1_a2 = "GW";
+
+UPDATE geoloc_countries
+ SET countryFR = "Heard, Île et MacDonald"
+ WHERE iso_3166_1_a2 = "HM";
+
+UPDATE geoloc_countries
+ SET countryFR = "Îles mineures éloignées des États-Unis"
+ WHERE iso_3166_1_a2 = "UM";
+
+UPDATE geoloc_countries
+ SET countryFR = "Îles vierges britanniques", country = "Virgin Islands, British"
+ WHERE iso_3166_1_a2 = "VG";
+
+UPDATE geoloc_countries
+ SET countryFR = "Îles vierges des États-Unis", country = "Virgin Islands, US"
+ WHERE iso_3166_1_a2 = "VI";
+
+UPDATE geoloc_countries
+ SET countryFR = "Iran, République islamique d'"
+ WHERE iso_3166_1_a2 = "IR";
+
+UPDATE geoloc_countries
+ SET countryFR = "Lao, République démocratique populaire"
+ WHERE iso_3166_1_a2 = "LA";
+
+UPDATE geoloc_countries
+ SET countryFR = "Macédoine, L'Ex-République Yougoslave"
+ WHERE iso_3166_1_a2 = "MK";
+
+UPDATE geoloc_countries
+ SET countryFR = "Micronésie, États fédérés de"
+ WHERE iso_3166_1_a2 = "FM";
+
+UPDATE geoloc_countries
+ SET countryFR = "Océan Indien, Territoire britannique de l'"
+ WHERE iso_3166_1_a2 = "IO";
+
+UPDATE geoloc_countries
+ SET countryFR = "Russie, Fédération de"
+ WHERE iso_3166_1_a2 = "RU";
+
+UPDATE geoloc_countries
+ SET countryFR = "Saint-Siège (État de la Cité du Vatican)"
+ WHERE iso_3166_1_a2 = "VA";
+
+UPDATE geoloc_countries
+ SET countryFR = "Saint-Kitts-et-Nevis"
+ WHERE iso_3166_1_a2 = "KN";
+
+UPDATE geoloc_countries
+ SET countryFR = "Congo, La République démocratique du"
+ WHERE iso_3166_1_a2 = "CD";
+
+UPDATE geoloc_countries
+ SET countryFR = "Saint-Vincent-et-les-Grenadines"
+ WHERE iso_3166_1_a2 = "VC";
+
+UPDATE geoloc_countries
+ SET countryFR = "Samoa"
+ WHERE iso_3166_1_a2 = "WS";
+
+UPDATE geoloc_countries
+ SET countryFR = "Sao Tomé-et-Principe"
+ WHERE iso_3166_1_a2 = "ST";
+
+UPDATE geoloc_countries
+ SET countryFR = "Svalbard et Île Jan Mayen"
+ WHERE iso_3166_1_a2 = "SJ";
+
+UPDATE geoloc_countries
+ SET countryFR = "Trinité-et-Tobago"
+ WHERE iso_3166_1_a2 = "TT";
+
+UPDATE geoloc_countries
+ SET countryFR = "Venezuela"
+ WHERE iso_3166_1_a2 = "VE";
+
+UPDATE geoloc_countries
+ SET countryFR = "Viet Nam"
+ WHERE iso_3166_1_a2 = "VN";
+
+UPDATE geoloc_countries
+ SET countryFR = "Wallis et Futuna", country = "Wallis and Futuna"
+ WHERE iso_3166_1_a2 = "WF";
+
+UPDATE geoloc_countries
+ SET countryFR = "Yémen"
+ WHERE iso_3166_1_a2 = "YE";
+
+UPDATE geoloc_countries
+ SET belongsTo = "FR"
+ WHERE iso_3166_1_a2 = "GF" OR iso_3166_1_a2 = "PF" OR iso_3166_1_a2 = "TF"
+ OR iso_3166_1_a2 = "GP" OR iso_3166_1_a2 = "MQ" OR iso_3166_1_a2 = "YT"
+ OR iso_3166_1_a2 = "NC" OR iso_3166_1_a2 = "RE";
+
+UPDATE geoloc_countries
+ SET belongsTo = "US", nationalityFR = NULL
+ WHERE iso_3166_1_a2 = "UM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Afghan"
+ WHERE iso_3166_1_a2 = "AF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Andorran"
+ WHERE iso_3166_1_a2 = "AD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "The Valley"
+ WHERE iso_3166_1_a2 = "AI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Angolais"
+ WHERE iso_3166_1_a2 = "AO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL
+ WHERE iso_3166_1_a2 = "AQ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Antiguais"
+ WHERE iso_3166_1_a2 = "AG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "NL", capital = "Willemstad"
+ WHERE iso_3166_1_a2 = "AN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Saoudien", capital = "Riyad"
+ WHERE iso_3166_1_a2 = "SA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Arménien"
+ WHERE iso_3166_1_a2 = "AM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Arubais", capital = "Oranjestad"
+ WHERE iso_3166_1_a2 = "AW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Azerbaïdjanais"
+ WHERE iso_3166_1_a2 = "AZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bahaméen"
+ WHERE iso_3166_1_a2 = "BS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bahreïnien"
+ WHERE iso_3166_1_a2 = "BH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bangladais"
+ WHERE iso_3166_1_a2 = "BD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Barbadien"
+ WHERE iso_3166_1_a2 = "BB";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Biélorusse", capital = "Minsk"
+ WHERE iso_3166_1_a2 = "BY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Béliziens"
+ WHERE iso_3166_1_a2 = "BZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB"
+ WHERE iso_3166_1_a2 = "BM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bolivien"
+ WHERE iso_3166_1_a2 = "BO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bosnien"
+ WHERE iso_3166_1_a2 = "BA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "NO"
+ WHERE iso_3166_1_a2 = "BV";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Brunéiens"
+ WHERE iso_3166_1_a2 = "BN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Burundais"
+ WHERE iso_3166_1_a2 = "BI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "George Town"
+ WHERE iso_3166_1_a2 = "KY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Cap-verdiens"
+ WHERE iso_3166_1_a2 = "CV";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Centrafricain"
+ WHERE iso_3166_1_a2 = "CF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "AU", capital = "Flying Fish Cove"
+ WHERE iso_3166_1_a2 = "CX";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Chypriotes"
+ WHERE iso_3166_1_a2 = "CY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "AU", capital = "West Island"
+ WHERE iso_3166_1_a2 = "CC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Comorien"
+ WHERE iso_3166_1_a2 = "KM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Congolais"
+ WHERE iso_3166_1_a2 = "CG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Nord-Coréens"
+ WHERE iso_3166_1_a2 = "CK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Maori des îles Cook"
+ WHERE iso_3166_1_a2 = "KP";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Djibouti"
+ WHERE iso_3166_1_a2 = "DJ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Dominicain"
+ WHERE iso_3166_1_a2 = "DO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Dominiquais"
+ WHERE iso_3166_1_a2 = "DM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Salvadorien"
+ WHERE iso_3166_1_a2 = "SV";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Émirien"
+ WHERE iso_3166_1_a2 = "AE";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Érythréen"
+ WHERE iso_3166_1_a2 = "ER";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Éthiopiens"
+ WHERE iso_3166_1_a2 = "ET";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Port Stanley"
+ WHERE iso_3166_1_a2 = "FK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "DK"
+ WHERE iso_3166_1_a2 = "FO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Fidjiens"
+ WHERE iso_3166_1_a2 = "FJ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Gambiens"
+ WHERE iso_3166_1_a2 = "GM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Grytviken"
+ WHERE iso_3166_1_a2 = "GS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Géorgien", capital = "Tbilissi"
+ WHERE iso_3166_1_a2 = "GE";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Ghanéen"
+ WHERE iso_3166_1_a2 = "GH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB"
+ WHERE iso_3166_1_a2 = "GI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Grenadien"
+ WHERE iso_3166_1_a2 = "GD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "DK", capital = "Nuuk"
+ WHERE iso_3166_1_a2 = "GL";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "US"
+ WHERE iso_3166_1_a2 = "GU";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Guatémaltèque"
+ WHERE iso_3166_1_a2 = "GT";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Guinéens"
+ WHERE iso_3166_1_a2 = "GN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Bissau-Guinéens"
+ WHERE iso_3166_1_a2 = "GW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Équato-Guinéens"
+ WHERE iso_3166_1_a2 = "GQ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "FR", capital = "Cayenne"
+ WHERE iso_3166_1_a2 = "GF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "AU"
+ WHERE iso_3166_1_a2 = "HM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Hondurien"
+ WHERE iso_3166_1_a2 = "HN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Road Town"
+ WHERE iso_3166_1_a2 = "VG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "US", capital = "Charlotte Amalie"
+ WHERE iso_3166_1_a2 = "VI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Indonésien", capital = "Jakarta"
+ WHERE iso_3166_1_a2 = "ID";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Irakien", capital = "Bagdad"
+ WHERE iso_3166_1_a2 = "IQ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Jordanien", capital = "Amman"
+ WHERE iso_3166_1_a2 = "JO";
+
+UPDATE geoloc_countries
+ SET capital = "New Delhi"
+ WHERE iso_3166_1_a2 = "IN";
+
+UPDATE geoloc_countries
+ SET capital = "Téhéran"
+ WHERE iso_3166_1_a2 = "IR";
+
+UPDATE geoloc_countries
+ SET capital = "Jérusalem"
+ WHERE iso_3166_1_a2 = "IL";
+
+UPDATE geoloc_countries
+ SET capital = "Tōkyō"
+ WHERE iso_3166_1_a2 = "JP";
+
+UPDATE geoloc_countries
+ SET capital = "Astana"
+ WHERE iso_3166_1_a2 = "KZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Kirghiz", capital = "Bichkek"
+ WHERE iso_3166_1_a2 = "KG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Koweïtien", capital = "Koweït"
+ WHERE iso_3166_1_a2 = "KW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Kényan"
+ WHERE iso_3166_1_a2 = "KE";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Gilbertins"
+ WHERE iso_3166_1_a2 = "KI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Laotien", capital = "Vientiane"
+ WHERE iso_3166_1_a2 = "LA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Lesothans"
+ WHERE iso_3166_1_a2 = "LS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Libérien"
+ WHERE iso_3166_1_a2 = "LR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Libyen"
+ WHERE iso_3166_1_a2 = "LY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Liechtensteinois"
+ WHERE iso_3166_1_a2 = "LI";
+
+UPDATE geoloc_countries
+ SET capital = "Beyrouth"
+ WHERE iso_3166_1_a2 = "LB";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Malaisien", capital = "Putrajaya"
+ WHERE iso_3166_1_a2 = "MY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Malawites"
+ WHERE iso_3166_1_a2 = "MW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Maldivien", capital = "Malé"
+ WHERE iso_3166_1_a2 = "MV";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Maltais"
+ WHERE iso_3166_1_a2 = "MT";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "US", capital = "Saipan"
+ WHERE iso_3166_1_a2 = "MP";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Marshallais"
+ WHERE iso_3166_1_a2 = "MH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Mauricien"
+ WHERE iso_3166_1_a2 = "MU";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Mauritanien"
+ WHERE iso_3166_1_a2 = "MR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Micronésien"
+ WHERE iso_3166_1_a2 = "FM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Moldave"
+ WHERE iso_3166_1_a2 = "MD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Monégasque"
+ WHERE iso_3166_1_a2 = "MC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Mongol", capital = "Oulan-Bator"
+ WHERE iso_3166_1_a2 = "MN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Plymouth["
+ WHERE iso_3166_1_a2 = "MS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Mozambicain"
+ WHERE iso_3166_1_a2 = "MZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Birman", capital = "Naypyidaw"
+ WHERE iso_3166_1_a2 = "MM";
+
+UPDATE geoloc_countries
+ SET capital = "Mamoudzou"
+ WHERE iso_3166_1_a2 = "YT";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Namibien"
+ WHERE iso_3166_1_a2 = "NA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Nauruan"
+ WHERE iso_3166_1_a2 = "NR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Népalais", capital = "Katmandou"
+ WHERE iso_3166_1_a2 = "NP";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Nicaraguayen"
+ WHERE iso_3166_1_a2 = "NI";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Nigérien"
+ WHERE iso_3166_1_a2 = "NE";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Nigérian"
+ WHERE iso_3166_1_a2 = "NG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Niuéen"
+ WHERE iso_3166_1_a2 = "NU";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "AU", capital = "Kingston"
+ WHERE iso_3166_1_a2 = "NF";
+
+UPDATE geoloc_countries
+ SET capital = "Nouméa"
+ WHERE iso_3166_1_a2 = "NC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Diego Garcia"
+ WHERE iso_3166_1_a2 = "IO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Omani", capital = "Mascate"
+ WHERE iso_3166_1_a2 = "OM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Ougandais"
+ WHERE iso_3166_1_a2 = "UG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Ouzbek", capital = "Tachkent"
+ WHERE iso_3166_1_a2 = "UZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Qatari", capital = "Doha"
+ WHERE iso_3166_1_a2 = "QA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Pakistanais", capital = "Islamabad"
+ WHERE iso_3166_1_a2 = "PK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Philippins", capital = "Manille"
+ WHERE iso_3166_1_a2 = "PH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Adamstown"
+ WHERE iso_3166_1_a2 = "PN";
+
+UPDATE geoloc_countries
+ SET capital = "Papeete"
+ WHERE iso_3166_1_a2 = "PF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Palaien"
+ WHERE iso_3166_1_a2 = "PW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Panaméen"
+ WHERE iso_3166_1_a2 = "PA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Papouasien"
+ WHERE iso_3166_1_a2 = "PG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Paraguayen"
+ WHERE iso_3166_1_a2 = "PY";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "US"
+ WHERE iso_3166_1_a2 = "PR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Congolais"
+ WHERE iso_3166_1_a2 = "CD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Rwandais"
+ WHERE iso_3166_1_a2 = "RW";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, capital = ""
+ WHERE iso_3166_1_a2 = "EH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Vatican"
+ WHERE iso_3166_1_a2 = "VA";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Kititien"
+ WHERE iso_3166_1_a2 = "KN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Saint-marinois"
+ WHERE iso_3166_1_a2 = "SM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Saint-Vincentais, Grenadin"
+ WHERE iso_3166_1_a2 = "VC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Jamestown"
+ WHERE iso_3166_1_a2 = "SH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Saint-Lucien"
+ WHERE iso_3166_1_a2 = "LC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Salomonien"
+ WHERE iso_3166_1_a2 = "SB";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "US", capital = "Fagatogo"
+ WHERE iso_3166_1_a2 = "AS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Samoan"
+ WHERE iso_3166_1_a2 = "WS";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Santoméen"
+ WHERE iso_3166_1_a2 = "ST";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Seychellois"
+ WHERE iso_3166_1_a2 = "SC";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Sierra-Léonais"
+ WHERE iso_3166_1_a2 = "SL";
+
+UPDATE geoloc_countries
+ SET capital = "Singapour"
+ WHERE iso_3166_1_a2 = "SG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Slovaques"
+ WHERE iso_3166_1_a2 = "SK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Somalien"
+ WHERE iso_3166_1_a2 = "SO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Soudanais"
+ WHERE iso_3166_1_a2 = "SD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Sri Lankais", capital = "Sri Jayawardenapura"
+ WHERE iso_3166_1_a2 = "LK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Surinamien"
+ WHERE iso_3166_1_a2 = "SR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "NO"
+ WHERE iso_3166_1_a2 = "SJ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Swazi", capital = "Mbabane"
+ WHERE iso_3166_1_a2 = "SZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Syrien", capital = "Damas"
+ WHERE iso_3166_1_a2 = "SY";
+
+UPDATE geoloc_countries
+ SET capital = "Douchanbé"
+ WHERE iso_3166_1_a2 = "TJ";
+
+UPDATE geoloc_countries
+ SET capital = "Taipei"
+ WHERE iso_3166_1_a2 = "TW";
+
+UPDATE geoloc_countries
+ SET capital = "Saint-Pierre", nationalityFR = NULL, belongsTo = "FR"
+ WHERE iso_3166_1_a2 = "TF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Thaïlandais", capital = "Bangkok"
+ WHERE iso_3166_1_a2 = "TH";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "NZ"
+ WHERE iso_3166_1_a2 = "TK";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Turkmène", capital = "Achgabat"
+ WHERE iso_3166_1_a2 = "TM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "GB", capital = "Cockburn Town"
+ WHERE iso_3166_1_a2 = "TC";
+
+UPDATE geoloc_countries
+ SET capital = "Ankara"
+ WHERE iso_3166_1_a2 = "TR";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Tanzanien"
+ WHERE iso_3166_1_a2 = "TZ";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Tchadien"
+ WHERE iso_3166_1_a2 = "TD";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Togolais"
+ WHERE iso_3166_1_a2 = "TG";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Tongien"
+ WHERE iso_3166_1_a2 = "TO";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Trinidadien"
+ WHERE iso_3166_1_a2 = "TT";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Tuvaluan"
+ WHERE iso_3166_1_a2 = "TV";
+
+UPDATE geoloc_countries
+ SET capital = "Hanoi"
+ WHERE iso_3166_1_a2 = "VN";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Vanuatais"
+ WHERE iso_3166_1_a2 = "VU";
+
+UPDATE geoloc_countries
+ SET nationalityFR = NULL, belongsTo = "FR", capital = "Mata-Utu"
+ WHERE iso_3166_1_a2 = "WF";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Yéménite", capital = "Sanaa"
+ WHERE iso_3166_1_a2 = "YE";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Zambien"
+ WHERE iso_3166_1_a2 = "ZM";
+
+UPDATE geoloc_countries
+ SET nationalityFR = "Zimbabwéen"
+ WHERE iso_3166_1_a2 = "ZW";
+
+-- vim:set syntax=mysql:
--- /dev/null
+Il faudra déplacer le yourself qui est mis dans profile_display dans le script 00_names.sql vers l'account.
+
+Le 12_secteurs.sql est à faire avant le alternate_subsubsectors.php et pour que ce dernier fonctionne, il faut que le fichier
+arbo-UTF8.xml soit dans le même dossier.
+
+Le script addresses.php *doit* être lancé dans un screen - il prend plusieurs jours à tourner.
--- /dev/null
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+require_once 'geocoding.inc.php';
+
+$globals->debug = 0; // Do not store backtraces.
+
+$res = XDB::query('SELECT MIN(user_id), MAX(user_id)
+ FROM auth_user_md5');
+
+$pids = $res->fetchOneRow();
+
+$minPid = $pids[0];
+$maxPid = $pids[1];
+
+echo "This will take a few minutes.\n".
+
+// Fills the 'text' field in profile_addresses.
+for ($pid = $minPid; $pid < $maxPid + 1; ++$pid) {
+ $res = XDB::iterator("SELECT a.adrid AS id, a.adr1, a.adr2, a.adr3,
+ UNIX_TIMESTAMP(a.datemaj) AS datemaj,
+ a.postcode, a.city, a.cityid, a.region, a.regiontxt,
+ a.pub, a.country, gp.pays AS countrytxt, gp.display,
+ FIND_IN_SET('coord-checked', a.statut) AS checked,
+ FIND_IN_SET('res-secondaire', a.statut) AS secondaire,
+ FIND_IN_SET('courrier', a.statut) AS mail,
+ FIND_IN_SET('temporaire', a.statut) AS temporary,
+ FIND_IN_SET('active', a.statut) AS current,
+ FIND_IN_SET('pro', a.statut) AS pro,
+ a.glat AS precise_lat, a.glng AS precise_lon
+ FROM adresses AS a
+ INNER JOIN geoloc_pays AS gp ON(gp.a2 = a.country)
+ WHERE uid = {?}
+ ORDER BY adrid",
+ $pid);
+
+ while ($address = $res->next()) {
+ $text = get_address_text($address);
+ XDB::iterator('UPDATE profile_addresses
+ SET text = {?}
+ WHERE pid = {?} AND type = {?} AND id = {?}',
+ $text, $pid, $address['pro'] ? 'job' : 'home', $address['id']);
+ }
+}
+
+echo "Filling the 'text' filles is over. Geocoding will start now and will take a few days\n";
+
+// Tries to geocode all the addresses.
+for ($pid = $minPid; $pid < $maxPid + 1; ++$pid) {
+ $res = XDB::iterator('SELECT *
+ FROM profile_addresses
+ WHERE pid = {?}',
+ $pid);
+
+ while ($address = $res->next()) {
+ $updateTime = $address['updateTime'];
+ $gmapsGeocoder = new GMapsGeocoder();
+ $address = $gmapsGeocoder->getGeocodedAddress($address);
+
+ if (!isset($address['geoloc'])) {
+ // TODO: use address and phone classes to update profile_job_enum and profile_phones once they are done.
+
+ XDB::execute('DELETE FROM profile_addresses
+ WHERE pid = {?} AND id = {?} AND type = {?}',
+ $address['pid'], $address['id'], $address['type']);
+
+ Geocoder::getAreaId($address, 'administrativeArea');
+ Geocoder::getAreaId($address, 'subAdministrativeArea');
+ Geocoder::getAreaId($address, 'locality');
+ XDB::execute('INSERT INTO profile_addresses (pid, type, id, flags, accuracy,
+ text, postalText, postalCode, localityId,
+ subAdministrativeAreaId, administrativeAreaId,
+ countryId, latitude, longitude, updateTime, pub, comment,
+ north, south, east, west)
+ VALUES ({?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?}, {?},
+ {?}, {?}, FROM_UNIXTIME({?}), {?}, {?}, {?}, {?}, {?}, {?})',
+ $address['pid'], $address['type'], $address['id'], $flags, $address['accuracy'],
+ $address['text'], $address['postalText'], $address['postalCode'], $address['localityId'],
+ $address['subAdministrativeAreaId'], $address['administrativeAreaId'],
+ $address['countryId'], $address['latitude'], $address['longitude'],
+ $updateTime, $address['pub'], $address['comment'],
+ $address['north'], $address['south'], $address['east'], $address['west']);
+ } else {
+ XDB::execute('UPDATE profile_addresses
+ SET postalText = {?}
+ WHERE pid = {?} AND id = {?} AND type = {?}',
+ $address['postalText'], $address['pid'], $address['id'], $address['type']);
+ }
+
+ sleep(60); // So we don't get blacklisted by Google.
+ }
+}
+
+echo "Geocoding is over.\n";
+
+function get_address_text($adr)
+{
+ $t = "";
+ if (isset($adr['adr1']) && $adr['adr1']) $t.= $adr['adr1'];
+ if (isset($adr['adr2']) && $adr['adr2']) $t.= "\n".$adr['adr2'];
+ if (isset($adr['adr3']) && $adr['adr3']) $t.= "\n".$adr['adr3'];
+ $l = "";
+ if (isset($adr['display']) && $adr['display']) {
+ $keys = explode(' ', $adr['display']);
+ foreach ($keys as $key) {
+ if (isset($adr[$key])) {
+ $l .= " ".$adr[$key];
+ } else {
+ $l .= " ".$key;
+ }
+ }
+ if ($l) substr($l, 1);
+ } elseif ($adr['country'] == 'US' || $adr['country'] == 'CA' || $adr['country'] == 'GB') {
+ if ($adr['city']) $l .= $adr['city'].",\n";
+ if ($adr['region']) $l .= $adr['region']." ";
+ if ($adr['postcode']) $l .= $adr['postcode'];
+ } else {
+ if (isset($adr['postcode']) && $adr['postcode']) $l .= $adr['postcode']." ";
+ if (isset($adr['city']) && $adr['city']) $l .= $adr['city'];
+ }
+ if ($l) $t .= "\n".trim($l);
+ if ($adr['country'] != '00' && (!$adr['countrytxt'] || $adr['countrytxt'] == strtoupper($adr['countrytxt']))) {
+ $res = XDB::query('SELECT pays
+ FROM geoloc_pays
+ WHERE a2 = {?}',
+ $adr['country']);
+ $adr['countrytxt'] = $res->fetchOneCell();
+ }
+ if (isset($adr['countrytxt']) && $adr['countrytxt']) {
+ $t .= "\n".$adr['countrytxt'];
+ }
+ return trim($t);
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>
--- /dev/null
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+
+$globals->debug = 0; //do not store backtraces
+
+$data = implode('', file('arbo-UTF8.xml'));
+$parser = xml_parser_create();
+xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
+xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1);
+xml_parse_into_struct($parser, $data, $values, $tags);
+xml_parser_free($parser);
+
+// loop through the structures
+foreach ($values as $val) {
+ if ($val['tag'] == 'grand-domaine' && $val['type'] == 'open') {
+ $res = XDB::execute('INSERT INTO profile_job_sector_enum (name)
+ VALUES ({?})',
+ ucfirst(mb_strtolower($val['attributes']['intitule'])));
+ $sectorid = XDB::insertId();
+ }
+ if ($val['tag'] == 'domaine' && $val['type'] == 'open') {
+ $res = XDB::execute('INSERT INTO profile_job_subsector_enum (sectorid, name)
+ VALUES ({?}, {?})',
+ $sectorid, $val['attributes']['intitule']);
+ $subsectorid = XDB::insertId();
+ }
+ if ($val['tag'] == 'domaine-intermediaire' && $val['type'] == 'open') {
+ $res = XDB::execute('INSERT INTO profile_job_subsector_enum (sectorid, name, flags)
+ VALUES ({?}, {?}, \'optgroup\')',
+ $sectorid, $val['attributes']['intitule']);
+ }
+ if ($val['tag'] == 'fiche' && $val['type'] == 'open') {
+ $res = XDB::execute('INSERT INTO profile_job_subsubsector_enum (sectorid, subsectorid, name)
+ VALUES ({?}, {?}, {?})',
+ $sectorid, $subsectorid, $val['attributes']['intitule']);
+ $subsubsectorid = XDB::insertId();
+ $id = 0;
+ }
+ if ($val['tag'] == 'appellation' && $val['type'] == 'complete') {
+ $res = XDB::execute('INSERT INTO profile_job_alternates (id, subsubsectorid, name)
+ VALUES ({?}, {?}, {?})',
+ $id, $subsubsectorid, $val['attributes']['intitule']);
+ ++$id;
+ }
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>
--- /dev/null
+../../bin/connect.db.inc.php
\ No newline at end of file
--- /dev/null
+#!/usr/bin/php5
+<?php
+require_once 'connect.db.inc.php';
+require_once 'profil.func.inc.php';
+
+$globals->debug = 0; //do not store backtraces
+
+// Convert phone prefixes from varchar to int
+$prefixes = XDB::iterRow("SELECT a2, phoneprf FROM geoloc_pays WHERE phoneprf IS NOT NULL");
+while (list($id, $pref) = $prefixes->next()) {
+ $pref = preg_replace('/[^0-9]/', '', $pref);
+ if ($pref[0] == '1') {
+ $pref = '1';
+ }
+ if ($pref[0] == '7') {
+ $pref = '7';
+ }
+ if ($pref != '' && strlen($pref) < 4) {
+ XDB::execute("UPDATE geoloc_pays SET tmp_phoneprf = {?} WHERE a2 = {?}", $pref, $id);
+ }
+}
+
+// geoloc_pays post operations
+// Drops old prfix column
+XDB::execute("ALTER TABLE geoloc_pays DROP COLUMN phoneprf");
+// Renames temporary column
+XDB::execute("ALTER TABLE geoloc_pays CHANGE COLUMN tmp_phoneprf phoneprf smallint unsigned NULL AFTER nat");
+// Adds an index on phoneprf column
+XDB::execute("ALTER TABLE geoloc_pays ADD INDEX (phoneprf)");
+// Adds French phone prefix
+XDB::execute("UPDATE geoloc_pays SET phoneprf = '33' WHERE a2 = 'FR'");
+// Adds some phone formats
+XDB::execute("UPDATE geoloc_pays SET phoneformat = '0# ## ## ## ##' WHERE phoneprf = '33'"); //France
+XDB::execute("UPDATE geoloc_pays SET phoneformat = '(+p) ### ### ####' WHERE phoneprf = '1'"); //USA and NANP countries
+
+
+
+//Phone number import
+
+$warnings = 0;
+
+// Import from auth_user_quick
+echo "\nImporting mobile phone numbers from auth_user_quick...\n";
+$phones = XDB::iterRow("SELECT user_id, profile_mobile_pub, profile_mobile FROM auth_user_quick WHERE profile_mobile <> ''");
+while (list($uid, $pub, $phone) = $phones->next()) {
+ $fmt_phone = format_phone_number($phone);
+ if ($fmt_phone != '') {
+ $display = format_display_number($fmt_phone, $error);
+ if (!XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type, search_tel, display_tel, pub)
+ VALUES ({?}, 'user', 0, 0, 'mobile', {?}, {?}, {?})", $uid, $fmt_phone, $display, $pub)) {
+ echo "WARNING: insert of profile mobile phone number failed for user $uid.\n";
+ $warnings++;
+ }
+ }
+}
+
+
+// Import from entreprises
+echo "\nImporting professional phone numbers from entreprises...\n";
+$phones = XDB::iterator("SELECT uid, entrid, tel, fax, mobile, tel_pub FROM entreprises ORDER BY uid");
+while ($row = $phones->next()) {
+ $request = "INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type, search_tel, display_tel, pub)
+ VALUES ({?}, 'pro', {?}, {?}, {?}, {?}, {?}, {?})";
+ $fmt_fixed = format_phone_number($row['tel']);
+ $fmt_mobile = format_phone_number($row['mobile']);
+ $fmt_fax = format_phone_number($row['fax']);
+ if ($fmt_fixed != '') {
+ $disp_fixed = format_display_number($fmt_fixed, $error);
+ if (!XDB::execute($request, $row['uid'], $row['entrid'], 0, 'fixed', $fmt_fixed, $disp_fixed, $row['tel_pub'])) {
+ echo 'WARNING: insert of professional fixed phone number failed for user ' . $row['uid'] . ' and entreprise ' . $row['entrid'] . ".\n";
+ $warnings++;
+ }
+ }
+ if ($fmt_mobile != '') {
+ $disp_mobile = format_display_number($fmt_mobile, $error);
+ if (!XDB::execute($request, $row['uid'], $row['entrid'], 1, 'mobile', $fmt_mobile, $disp_mobile, $row['tel_pub'])) {
+ echo 'WARNING: insert of professional mobile number failed for user ' . $row['uid'] . ' and entreprise ' . $row['entrid'] . ".\n";
+ $warnings++;
+ }
+ }
+ if ($fmt_fax != '') {
+ $disp_fax = format_display_number($fmt_fax, $error);
+ if (!XDB::execute($request, $row['uid'], $row['entrid'], 2, 'fax', $fmt_fax, $disp_fax, $row['tel_pub'])) {
+ echo 'WARNING: insert of professional fax number failed for user ' . $row['uid'] . ' and entreprise ' . $row['entrid'] . ".\n";
+ $warnings++;
+ }
+ }
+}
+
+
+//import from tels
+echo "\nImporting personnal phone numbers from tels...\n";
+$phones = XDB::iterator("SELECT uid, adrid, telid, tel_type, tel_pub, tel FROM tels");
+$conversions = array();
+$autre_count = 0;
+while ($row = $phones->next()) {
+ $fmt_phone = format_phone_number($row['tel']);
+ if ($fmt_phone != '') {
+ $display = format_display_number($fmt_phone, $error);
+ $guess_type = guess_phone_type($row['tel_type'], $fmt_phone);
+
+ switch ($guess_type) {
+ case 'fixed':
+ case 'fax':
+ case 'mobile':
+ if (!XDB::execute("INSERT INTO profile_phones (uid, link_type, link_id, tel_id, tel_type, search_tel, display_tel, pub)
+ VALUES ({?}, 'address', {?}, {?}, {?}, {?}, {?}, {?})",
+ $row['uid'], $row['adrid'], $row['telid'], $guess_type, $fmt_phone, $display, $row['tel_pub'])) {
+ echo 'WARNING: insert of address phone number failed for user ' . $row['uid'] . ', address ' . $row['adrid']
+ . ' and telephone id ' . $row['telid'] . ".\n";
+ $warnings++;
+ } else {
+ if ($row['tel_type'] == 'Autre') {
+ $autre_count++;
+ } else if (!isset($conversions[$row['tel_type']])) {
+ $conversions[$row['tel_type']] = $guess_type;
+ }
+ }
+ break;
+ case 'conflict':
+ echo 'WARNING: conflict for user ' . $row['uid'] . ', address ' . $row['adrid']
+ . ' and telephone id ' . $row['telid'] . ': type = "' . $row['tel_type']
+ . '", number = "' .$fmt_phone . "\"\n";
+ $warnings++;
+ break;
+ case 'unknown':
+ default:
+ echo 'WARNING: unknown phone type (' . $row['tel_type'] . ') for user ' . $row['uid'] . ', address ' . $row['adrid']
+ . ' and telephone id ' . $row['telid'] . "\n";
+ $warnings++;
+ }
+ }
+}
+
+echo "\nSummary of automatic phone type conversion\n";
+foreach ($conversions as $old => $new) {
+ echo "* $old => $new\n";
+}
+echo "There was also $autre_count conversions from old type 'Autre' to a new one determined by the phone number.\n";
+
+
+
+//end of import
+if ($warnings) {
+ echo "\n----------------------------------------------------------------------\n"
+ . " There is $warnings phone numbers that couldn't be imported.\n"
+ . " They need to be manually inserted.\n";
+}
+echo "\nAfter solving any import problem and checking automatic conversions,\n"
+ . "you can drop useless columns and tables by these requests:\n"
+ . "DROP TABLE IF EXISTS `tels`;\n"
+ . "ALTER TABLE `auth_user_quick` DROP COLUMN `profile_mobile`;\n"
+ . "ALTER TABLE `auth_user_quick` DROP COLUMN `profile_mobile_pub`;\n"
+ . "ALTER TABLE `entreprises` DROP COLUMN `tel`;\n"
+ . "ALTER TABLE `entreprises` DROP COLUMN `fax`;\n"
+ . "ALTER TABLE `entreprises` DROP COLUMN `mobile`;\n"
+ . "ALTER TABLE `entreprises` DROP COLUMN `tel_pub`;\n";
+
+
+// auxilliary functions
+
+function guess_phone_type($str_type, $phone)
+{
+ $str_type = strtolower(trim($str_type));
+
+ // special case for phone type 'autre', guessing by phone number
+ if ($str_type == 'autre') {
+ if (substr($phone, 3) == '336') {
+ return 'mobile';
+ } else {
+ return 'fixed';
+ }
+ }
+
+ if ((strpos($str_type, 'mob') !== false) || (strpos($str_type, 'cell') !== false) || (strpos($str_type, 'port') !== false) || (strpos($str_type, 'ptb') !== false)) {
+ if (substr($phone, 3) == '336' || substr($phone, 2) != '33') {
+ return 'mobile'; //for France check if number is a mobile one
+ } else {
+ return 'conflict';
+ }
+ }
+ if (strpos($str_type, 'fax') !== false) {
+ if (substr($phone, 3) == '336') {
+ return 'conflict';
+ } else {
+ return 'fax';
+ }
+ }
+ if ((strpos($str_type, 'fixe') !== false) || (strpos($str_type, 'tél') !== false) || (strpos($str_type, 'tel') !== false) || (strpos($str_type, 'free') !== false)) {
+ if (substr($phone, 3) == '336') {
+ return 'conflict';
+ } else {
+ return 'fixed';
+ }
+ }
+
+ return 'unknown';
+}
+
+/* vim:set et sw=4 sts=4 ts=4: */
+?>
--- /dev/null
+#!/bin/bash
+
+. ../inc/pervasive.sh
+
+mailman_stop
+mailman_templates
+mailman_start
+
+
+###########################################################
+for sql in *.sql
+do
+ echo -n $sql
+ $MYSQL x4dat < $sql &>/dev/null || echo -n " ERROR"
+ echo .
+done
+
+###########################################################
+
+echo "Importing phone numbers"
+
+./phones.php
+
+###########################################################
+
+echo "we will now upgrade the search table (this may be a long operation)
+
+please hit ^D to continue
+"
+
+cat
+
+pushd ../../bin
+./search.rebuild_db.php
+popd
+
+###########################################################
+