From 46ae38a91773bca3645e78488aa0dae55d5dd574 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 23 Sep 2007 13:13:11 +0200 Subject: [PATCH] Move profile/edit javascript in .js files and activate PlWizard eye-candies for this page Signed-off-by: Florent Bruneau --- htdocs/javascript/profile.js | 494 ++++++++++++++++++++++++++ modules/profile.php | 61 +++- modules/profile/decos.inc.php | 12 +- modules/profile/groups.inc.php | 1 + templates/core/plwizard.tpl | 11 + templates/profile/adresses.address.tpl | 3 - templates/profile/adresses.tel.tpl | 3 - templates/profile/adresses.tpl | 113 ------ templates/profile/applis.js.tpl | 40 +-- templates/profile/deco.medal.tpl | 16 +- templates/profile/deco.tpl | 91 +---- templates/profile/general.tpl | 629 ++++++++++++++++----------------- templates/profile/grades.js.tpl | 37 ++ templates/profile/groups.tpl | 88 +---- templates/profile/jobs.job.tpl | 6 +- templates/profile/jobs.tpl | 77 ---- templates/profile/mentor.tpl | 98 ----- templates/profile/skill.skill.tpl | 5 +- templates/profile/skill.tpl | 47 +-- 19 files changed, 928 insertions(+), 904 deletions(-) create mode 100644 htdocs/javascript/profile.js create mode 100644 templates/profile/grades.js.tpl diff --git a/htdocs/javascript/profile.js b/htdocs/javascript/profile.js new file mode 100644 index 0000000..bbffc58 --- /dev/null +++ b/htdocs/javascript/profile.js @@ -0,0 +1,494 @@ +/*************************************************************************** + * Copyright (C) 2003-2007 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 * + ***************************************************************************/ + +// Page initialization + +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); + break; + case 'poly': + updateGroupSubLink(document.forms.prof_annu.groupesx_sub); + 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); + } + } + } + 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); + } + break; + } +} + +var applisType; +var applisTypeAll; + +// General + +var subgrades; +var names; +function fillType(selectCtrl, appli, fill) +{ + var i; + var i0=0; + + for (i = selectCtrl.options.length; i >=0; i--) { + selectCtrl.options[i] = null; + } + + if (fill || appli <0) { + selectCtrl.options[0] = new Option(' '); + i0=1; + } + 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 selectType(selectCtrl, type) +{ + for (i = 0; i < selectCtrl.options.length; i++) { + if (selectCtrl.options[i].text == type) + selectCtrl.selectedIndex=i; + } +} + + + +// Addresses + +function removeObject(id, pref) +{ + document.getElementById(id).style.display = "none"; + document.forms.prof_annu[pref + "[removed]"].value = "1"; +} + +function restoreObject(id, pref) +{ + document.getElementById(id).style.display = ''; + document.forms.prof_annu[pref + "[removed]"].value = "0"; +} + +function getAddressElement(adrid, adelement) +{ + return document.forms.prof_annu["addresses[" + adrid + "][" + adelement + "]"]; +} + +function checkCurrentAddress(newCurrent) +{ + 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; + } + 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++; + } + } +} + +function removeAddress(id, pref) +{ + removeObject(id, pref); + checkCurrentAddress(null); + if (document.forms.prof_annu[pref + '[datemaj]'].value != '') { + document.getElementById(id + '_grayed').style.display = ''; + } +} + +function restoreAddress(id, pref) +{ + document.getElementById(id + '_grayed').style.display = 'none'; + checkCurrentAddress(null); + restoreObject(id, pref); +} + +function addAddress() +{ + var i = 0; + while (getAddressElement(i, 'pub') != null) { + i++; + } + $("#add_adr").before('
'); + Ajax.update_html('addresses_' + i + '_cont', 'profile/ajax/address/' + i, checkCurrentAddress); +} + +function addTel(id) +{ + var i = 0; + var adid = 'addresses_' + id; + var tel = adid + '_tel_'; + while (document.getElementById(tel + i) != null) { + i++; + } + $('#' + adid + '_add_tel').before('
'); + Ajax.update_html(tel + i, 'profile/ajax/tel/' + id + '/' + i); +} + + +// Geoloc + +function validGeoloc(id, pref) +{ + 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; + attachEvent(document.forms.prof_annu[pref + "[text]"], "click", + function() { document.forms.prof_annu[pref + "[text]"].blur(); }); + document.forms.prof_annu[pref + "[text]"].className = ''; +} + +function validAddress(id, pref) +{ + 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 = "0"; + attachEvent(document.forms.prof_annu[pref + "[text]"], "click", + function() { document.forms.prof_annu[pref + "[text]"].blur(); }); + document.forms.prof_annu[pref + "[text]"].className = ''; +} + + +// Groups + +function updateGroup(type) +{ + 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 = ''; + } +} + +function removeGroup(cat, id) +{ + $('#' + cat + '_' + id).remove(); + updateGroup(cat); +} + +function addGroup(cat) +{ + var cb = document.forms.prof_annu[cat + '_sel']; + var id = cb.value; + var text = cb.options[cb.selectedIndex].text; + var html = '' + + ' ' + + ' ' + + ' ' + + ' ' + + '
' + + text + + '
' + + ' ' + + ' cross' + + ' ' + + ' ' + + ''; + $('#' + cat).after(html); + updateGroup(cat); +} + +function updateGroupSubLink(cb) +{ + var href = cb.value ? cb.value : "http://www.polytechnique.net"; + document.getElementById("groupesx_sub").href = href; +} + + +// 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'; + } else { + document.getElementById('medal_add').style.display = ''; + } +} + +function getMedalName(id) +{ + document.getElementById('medal_name_' + id).innerHTML = names[id]; +} + +function buildGrade(id, current) +{ + var grade; + var subg = subgrades[id]; + var obj = $('#medal_grade_' + id); + if (!subg) { + obj.prepend(''); + } else { + var html = 'Agrafe : '; + obj.prepend(html); + } +} + +function makeAddProcess(id) +{ + return function(data) + { + $('#medals').after(data); + updateMedal(); + getMedalName(id); + buildGrade(id, 0); + }; +} + +function addMedal() +{ + var id = document.forms.prof_annu['medal_sel'].value; + $.get(platal_baseurl + 'profile/ajax/medal/' + id, makeAddProcess(id)); +} + +function removeMedal(id) +{ + $("#medal_" + id).remove(); + updateMedal(); +} + + +// Jobs + +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('<', '<'); + } + document.forms.prof_annu[pref + "[removed]"].value = "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"; +} + +function updateJobSecteur(nb, id, pref, sel) +{ + var secteur = document.forms.prof_annu[pref + '[secteur]'].value; + if (secteur == '') { + secteur = '-1'; + } + Ajax.update_html(id + '_ss_secteur', 'profile/ajax/secteur/' +nb + '/' + secteur + '/' + sel); +} + +function makeAddJob(id) +{ + return function(data) + { + $('#add_job').before(data); + updateSecteur('job_' + id, 'jobs[' + id + ']', ''); + }; +} + +function addJob() +{ + var i = 0; + while (document.getElementById('job_' + i) != null) { + ++i; + } + $.get(platal_baseurl + 'profile/ajax/job/' + i, makeAddJob(i)); +} + + +// Skills + +function updateSkill(cat) +{ + 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'; +} + +function addSkill(cat) +{ + var sel = document.forms.prof_annu[cat + '_sel']; + var val = sel.value; + var text = sel.options[sel.selectedIndex].text; + $.get(platal_baseurl + 'profile/ajax/skill/' + cat + '/' + val, + function(data) { + $('#' + cat).append(data); + document.getElementById(cat + '_' + val + '_title').innerHTML = text; + updateSkill(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 == '') { + show = false; + } + if (document.getElementById('countries_' + val) != null) { + show = false; + } + document.getElementById('countries_add').style.display = show ? '' : 'none'; +} + +function addCountry() +{ + var cb = document.forms.prof_annu.countries_sel; + var val = cb.value; + var text = cb.options[cb.selectedIndex].text; + var html = '
' + + '
' + text + '
' + + ' ' + + ' ' + + ' ' + + ' ' + + '
'; + $('#countries').append(html); + updateCountry(); +} + +function removeCountry(id) +{ + $('#countries_' + id).remove(); + updateCountry(); +} +function updateSSecteur() +{ + 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'; +} + +function updateSecteur() +{ + var secteur = document.forms.prof_annu.secteur_sel.value; + if (secteur == '') { + secteur = '-1'; + } + $.get(platal_baseurl + 'profile/ajax/secteur/-1/' + secteur, + function(data) { + data = '' + data; + document.getElementById('ss_secteur_sel').innerHTML = data; + attachEvent(document.forms.prof_annu['jobs[-1][ss_secteur]'], 'change', updateSSecteur); + }); +} + +function addSecteur() +{ + 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 = '
' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + sst + + '
'; + $('#secteurs').append(html); + updateSSecteur(); +} + +function removeSecteur(s, ss) +{ + $('#secteurs_' + s + '_' + ss).remove(); + updateSSecteur(); +} + +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/modules/profile.php b/modules/profile.php index 00969c2..0559e6c 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -38,6 +38,8 @@ class ProfileModule extends PLModule '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), @@ -272,7 +274,7 @@ class ProfileModule extends PLModule http_redirect("http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&anc_id=$mat"); } - function handler_p_edit(&$page, $opened_tab = null) + function handler_p_edit(&$page, $opened_tab = null, $mode = null) { global $globals; @@ -328,8 +330,10 @@ class ProfileModule extends PLModule // TODO: Block if birth date is missing ? $page->addJsLink('ajax.js'); - $page->addJsLink('jquery.js'); - $wiz = new PlWizard('Profil', 'core/plwizard.tpl', true, false); + $page->addJsLink('profile.js'); + $page->addJsLink('applis.js'); + $page->addJsLink('grades.js'); + $wiz = new PlWizard('Profil', 'core/plwizard.tpl', true, true); require_once dirname(__FILE__) . '/profile/page.inc.php'; $wiz->addPage('ProfileGeneral', 'Général', 'general'); $wiz->addPage('ProfileAddresses', 'Adresses personnelles', 'adresses'); @@ -338,44 +342,82 @@ class ProfileModule extends PLModule $wiz->addPage('ProfileJobs', 'Informations professionnelles', 'emploi'); $wiz->addPage('ProfileSkills', 'Compétences diverses', 'skill'); $wiz->addPage('ProfileMentor', 'Mentoring', 'mentor'); - $wiz->apply($page, 'profile/edit', $opened_tab); + $wiz->apply($page, 'profile/edit', $opened_tab, $mode); $page->assign('xorg_title', 'Polytechnique.org - Mon Profil'); } + function handler_applis_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"; + } + + function handler_grades_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/grades.js.tpl', NO_SKIN); + $res = XDB::iterator("SELECT * + FROM profile_medals_grades + ORDER BY mid, pos"); + $grades = array(); + while ($tmp = $res->next()) { + $grades[$tmp['mid']][] = $tmp; + } + $page->assign('grades', $grades); + + $res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate + FROM profile_medals + ORDER BY type, text"); + $mlist = array(); + while ($tmp = $res->next()) { + $mlist[$tmp['type']][] = $tmp; + } + $page->assign('medal_list', $mlist); + } + function handler_ajax_address(&$page, $adid) { + 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('ajaxadr', true); } function handler_ajax_tel(&$page, $adid, $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->assign('tel', array()); - $page->assign('ajaxtel', true); } function handler_ajax_medal(&$page, $id) { + header('Content-Type: text/html; charset=utf-8'); $page->changeTpl('profile/deco.medal.tpl', NO_SKIN); $page->assign('id', $id); $page->assign('medal', array('valid' => 0, 'grade' => 0)); - $page->assign('ajaxdeco', true); } function handler_ajax_job(&$page, $id) { + header('Content-Type: text/html; charset=utf-8'); $page->changeTpl('profile/jobs.job.tpl', NO_SKIN); $page->assign('i', $id); $page->assign('job', array()); - $page->assign('ajaxjob', true); $page->assign('new', true); $page->assign('secteurs', XDB::iterator("SELECT id, label FROM emploi_secteur")); @@ -386,6 +428,7 @@ class ProfileModule extends PLModule function handler_ajax_secteur(&$page, $id, $sect, $ssect = -1) { + header('Content-Type: text/html; charset=utf-8'); $res = XDB::iterator("SELECT id, label FROM emploi_ss_secteur WHERE secteur = {?}", $sect); @@ -397,8 +440,8 @@ class ProfileModule extends PLModule function handler_ajax_skill(&$page, $cat, $id) { + header('Content-Type: text/html; charset=utf-8'); $page->changeTpl('profile/skill.skill.tpl', NO_SKIN); - $page->assign('ajaxskill', true); $page->assign('cat', $cat); $page->assign('id', $id); if ($cat == 'competences') { diff --git a/modules/profile/decos.inc.php b/modules/profile/decos.inc.php index 9aaea5e..1018e9b 100644 --- a/modules/profile/decos.inc.php +++ b/modules/profile/decos.inc.php @@ -33,7 +33,7 @@ class ProfileDeco implements ProfileSetting S::i('uid')); $value = array(); while (list($id, $grade) = $res->next()) { - $value[$id] = array('grade' => $grade, + $value[$id] = array('grade' => $grade, 'valid' => '1'); } @@ -118,15 +118,6 @@ class ProfileDecos extends ProfilePage public function prepare(PlatalPage &$page, $id) { parent::prepare($page, $id); - $res = XDB::iterator("SELECT * - FROM profile_medals_grades - ORDER BY mid, pos"); - $grades = array(); - while ($tmp = $res->next()) { - $grades[$tmp['mid']][] = $tmp; - } - $page->assign('grades', $grades); - $res = XDB::iterator("SELECT *, FIND_IN_SET('validation', flags) AS validate FROM profile_medals ORDER BY type, text"); @@ -135,7 +126,6 @@ class ProfileDecos extends ProfilePage $mlist[$tmp['type']][] = $tmp; } $page->assign('medal_list', $mlist); - $trad = Array('ordre' => 'Ordres', 'croix' => 'Croix', 'militaire' => 'Médailles militaires', diff --git a/modules/profile/groups.inc.php b/modules/profile/groups.inc.php index f274eb6..9a14ad8 100644 --- a/modules/profile/groups.inc.php +++ b/modules/profile/groups.inc.php @@ -120,6 +120,7 @@ class ProfileGroups extends ProfilePage WHERE a.inscriptible != 0 AND (a.cat = 'GroupesX' OR a.cat = 'Institutions') ORDER BY a.cat, a.dom, a.nom")); + $page->assign('old', (int)date('Y') >= S::i('promo_sortie')); } } diff --git a/templates/core/plwizard.tpl b/templates/core/plwizard.tpl index 095765d..a1ea50e 100644 --- a/templates/core/plwizard.tpl +++ b/templates/core/plwizard.tpl @@ -38,6 +38,9 @@ $(".wiz_tab").removeClass("active"); $("#wiz_tab_" + id).addClass("active"); $(".wiz_content").html(data).fadeIn('normal'); + if (typeof wizPage_onLoad == 'function') { + wizPage_onLoad(id); + } }); } }); @@ -52,6 +55,14 @@ } {/literal} {/if} + {literal} + $(document).ready( + function() { + if (typeof wizPage_onLoad == 'function') { + wizPage_onLoad({/literal}'{$lookup[$current]}'{literal}); + } + }); + {/literal} //]]>
diff --git a/templates/profile/adresses.address.tpl b/templates/profile/adresses.address.tpl index 1ae3caa..857a3ef 100644 --- a/templates/profile/adresses.address.tpl +++ b/templates/profile/adresses.address.tpl @@ -20,9 +20,6 @@ {* *} {**************************************************************************} -{if $ajaxadr} - -{/if} {assign var=adpref value="addresses[$i]"} {assign var=adid value="addresses_$i"} diff --git a/templates/profile/adresses.tel.tpl b/templates/profile/adresses.tel.tpl index a641895..952b01f 100644 --- a/templates/profile/adresses.tel.tpl +++ b/templates/profile/adresses.tel.tpl @@ -20,9 +20,6 @@ {* *} {**************************************************************************} -{if $ajaxtel} - -{/if} {assign var=telpref value="`$adpref`[tel][`$t`]"} {assign var=telid value="`$adid`_tel_`$t`"}
diff --git a/templates/profile/adresses.tpl b/templates/profile/adresses.tpl index 9d6f176..250922c 100644 --- a/templates/profile/adresses.tpl +++ b/templates/profile/adresses.tpl @@ -20,119 +20,6 @@ {* *} {**************************************************************************} - - {foreach key=i item=adr from=$addresses}
{include file="profile/adresses.address.tpl" i=$i adr=$adr} diff --git a/templates/profile/applis.js.tpl b/templates/profile/applis.js.tpl index 3134ee0..a0237b5 100644 --- a/templates/profile/applis.js.tpl +++ b/templates/profile/applis.js.tpl @@ -20,43 +20,7 @@ {* *} {**************************************************************************} - {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/deco.medal.tpl b/templates/profile/deco.medal.tpl index 280d256..e6eb14e 100644 --- a/templates/profile/deco.medal.tpl +++ b/templates/profile/deco.medal.tpl @@ -20,25 +20,19 @@ {* *} {**************************************************************************} -{if $ajaxdeco} - -{/if}
- {if !$medal.valid}(en attente de {if $ajaxdeco}validation{else}modération{/if}){/if}
+ {if !$medal.valid}(en attente de modération){/if}
- {icon name="cross" title="Supprimer cette médaille"} - {if !$ajaxdeco} - - {/if} + + {icon name="cross" title="Supprimer cette médaille"} + +
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/deco.tpl b/templates/profile/deco.tpl index e28ee82..b59614f 100644 --- a/templates/profile/deco.tpl +++ b/templates/profile/deco.tpl @@ -20,87 +20,6 @@ {* *} {**************************************************************************} - - -
@@ -118,7 +37,7 @@ function remove(id)
- {foreach from=$medal_list key=type item=list} @@ -128,8 +47,8 @@ function remove(id) {/foreach} - - {icon name=add title="Ajouter cette médaille"} +
{foreach from=$medals item=medal key=id} @@ -139,8 +58,4 @@ function remove(id)
- - {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/general.tpl b/templates/profile/general.tpl index 8d7c569..e5b5a5d 100644 --- a/templates/profile/general.tpl +++ b/templates/profile/general.tpl @@ -20,331 +20,320 @@ {* *} {**************************************************************************} - -{include file="profile/applis.js.tpl"} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Informations générales -
- - - - - site public - -
- Nom - - - -
- Prénom - - - -
- Promotion - - X{$promo}{if ($promo != $promo_sortie - 3)} - X{math equation="a - b" a=$promo_sortie b=3}{/if} - modifier{if ($promo_sortie -3 == $promo)} pour les oranges{/if} -
- Nom d'usage
- {if $smarty.session.sexe} - (Notamment nom d'épouse) - {else} - (si différent de {$nom} seulement) - {/if} -
- {$nom_usage|default:"Aucun"} - modifier -
- Nationalité - - -
- Application
- (4ème année de l'X) -
- -
- - -
- Post-application - - -
- - -
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Informations générales +
+ + + + + site public + +
+ Nom + + + +
+ Prénom + + + +
+ Promotion + + X{$promo}{if ($promo != $promo_sortie - 3)} - X{math equation="a - b" a=$promo_sortie b=3}{/if} + modifier{if ($promo_sortie -3 == $promo)} pour les oranges{/if} +
+ Nom d'usage
+ {if $smarty.session.sexe} + (Notamment nom d'épouse) + {else} + (si différent de {$nom} seulement) + {/if} +
+ {$nom_usage|default:"Aucun"} + modifier +
+ Nationalité + + +
+ Application
+ (4ème année de l'X) +
+ +
+ + +
+ Post-application + + +
+ + +
{if !$no_private_key} - - - - - - - - - - -
- Synchronisation avec l'AX -
-

- Le service annuaire de l'AX 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 fiche AX. -

-

- 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 fiche AX selon ce qui s'y trouve déjà. -

-

- -

-
- - - - - -
- - - Autoriser la synchronisation vers l'AX par des administrateurs ou des scripts automatiques. -
-
+ + + + + + + + + + +
+ Synchronisation avec l'AX +
+

+ Le service annuaire de l'AX 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 fiche AX. +

+

+ 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 fiche AX selon ce qui s'y trouve déjà. +

+

+ +

+
+ + + + + +
+ + + Autoriser la synchronisation vers l'AX par des administrateurs ou des scripts automatiques. +
+
{/if} - - - - - - - - - - {if $nouvellephoto} - - {/if} - - - + + +
- Trombinoscope -
- - site public -
-
Ta photo actuelle
-  [ PHOTO ] -
-
Photo en attente de validation
- -  [ PHOTO ] -
- Pour profiter de cette fonction intéressante, tu dois disposer - quelque part (sur ton ordinateur ou sur Internet) d'une photo - d'identité (dans un fichier au format JPEG, PNG ou GIF).
+ + + + + + + + + + {if $nouvellephoto} + + {/if} + + + + +
+ Trombinoscope +
+ + site public +
+
Ta photo actuelle
+  [ PHOTO ] +
+
Photo en attente de validation
+ +  [ PHOTO ] +
+ Pour profiter de cette fonction intéressante, tu dois disposer + quelque part (sur ton ordinateur ou sur Internet) d'une photo + d'identité (dans un fichier au format JPEG, PNG ou GIF).
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - -
+ Divers +
+ + + + + +
+ + + privé +
+
+ Surnom + + +
+ + + + + + + + + + +
+ + + site public + + + + transmis à l'AX + + + + privé + + Quelle couleur ?? +
+
+ Téléphone mobile + + +
+ + + + + + +
+ + + site public + + Quelle couleur ?? +
+
+ Page web Perso + + +
+ + + + + + +
+ + + site public + + Quelle couleur ?? +
+
+
+ Complément libre + Commentaire ? ICQ ? etc... +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- Divers -
- - - - - -
- - - privé -
-
- Surnom - - -
- - - - - - - - - - -
- - - site public - - - - transmis à l'AX - - - - privé - - Quelle couleur ?? -
-
- Téléphone mobile - - -
- - - - - - -
- - - site public - - Quelle couleur ?? -
-
- Page web Perso - - -
- - - - - - -
- - - site public - - Quelle couleur ?? -
-
-
- Complément libre - Commentaire ? ICQ ? etc... -
- -
- - -
+ +
+ + +
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/grades.js.tpl b/templates/profile/grades.js.tpl new file mode 100644 index 0000000..57ac91d --- /dev/null +++ b/templates/profile/grades.js.tpl @@ -0,0 +1,37 @@ +{**************************************************************************} +{* *} +{* Copyright (C) 2003-2007 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 *} +{* *} +{**************************************************************************} + +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} + +{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/groups.tpl b/templates/profile/groups.tpl index 67d9543..253c64b 100644 --- a/templates/profile/groups.tpl +++ b/templates/profile/groups.tpl @@ -20,74 +20,6 @@ {* *} {**************************************************************************} - -{literal} - -{/literal} - - + - + {foreach item=text key=bid from=$binets} @@ -131,7 +60,7 @@
{$text}
- {icon name="cross" title="Supprimer ce binet"} + {icon name="cross" title="Supprimer ce binet"} {/foreach} @@ -214,9 +143,4 @@
@@ -101,9 +33,7 @@
- - {if $old}ex-{/if}Section
- - {if $old}ex-{/if}Binet(s) - {select_db_table table="binets_def" valeur=0 champ="text" pad='1'} - {icon name="add" title="Ajouter ce binet"} +
- - {* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *} diff --git a/templates/profile/jobs.job.tpl b/templates/profile/jobs.job.tpl index bcda539..110768b 100644 --- a/templates/profile/jobs.job.tpl +++ b/templates/profile/jobs.job.tpl @@ -20,9 +20,6 @@ {* *} {**************************************************************************} -{if $ajaxjob} - -{/if} {assign var=jobid value="job_`$i`"} {assign var=jobpref value="jobs[`$i`]"}
@@ -62,7 +59,7 @@ Secteur d'activité - {iterate from=$secteurs item=secteur}