'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_PUBLIC, 'user', NO_AUTH),
- 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH),
+ '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),
+ '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),
'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/groupes-x' => $this->make_hook('admin_groupesx', 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'),
exit;
}
+ function handler_medal(&$page, $mid)
+ {
+ $res = XDB::query("SELECT img
+ FROM profile_medals
+ WHERE id = {?}",
+ $mid);
+ $img = dirname(__FILE__).'/../htdocs/images/medals/' . $res->fetchOneCell();
+ $type = mime_content_type($img);
+ header("Content-Type: $type");
+ echo file_get_contents($img);
+ exit;
+ }
+
function handler_photo_change(&$page)
{
$page->changeTpl('profile/trombino.tpl');
$new = Env::v('modif') == 'new';
$user = get_user_details($login, S::v('uid'), $view);
- $user['freetext'] = MiniWiki::WikiToHTML($user['freetext']);
- $user['cv'] = MiniWiki::WikiToHTML($user['cv'], true);
$title = $user['prenom'] . ' ' . ( empty($user['nom_usage']) ? $user['nom'] : $user['nom_usage'] );
$page->assign('xorg_title', $title);
$wiz->addPage('ProfileGeneral', 'Général', 'general');
$wiz->addPage('ProfileAddresses', 'Adresses personnelles', 'adresses');
$wiz->addPage('ProfileGroups', 'Groupes X - Binets', 'poly');
- $wiz->addPage('ProfileDeco', 'Décorations - Medals', 'deco');
- $wiz->addPage('ProfilePro', 'Informations professionnelles', 'emploi');
+ $wiz->addPage('ProfileDecos', 'Décorations - Medailles', 'deco');
+ $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);
$page->assign('ajaxtel', true);
}
+ function handler_ajax_medal(&$page, $id)
+ {
+ $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)
+ {
+ $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"));
+ $page->assign('fonctions', XDB::iterator("SELECT id, fonction_fr, FIND_IN_SET('titre', flags) AS title
+ FROM fonctions_def
+ ORDER BY id"));
+ }
+
+ function handler_ajax_secteur(&$page, $id, $sect, $ssect = -1)
+ {
+ $res = XDB::iterator("SELECT id, label
+ FROM emploi_ss_secteur
+ WHERE secteur = {?}", $sect);
+ $page->changeTpl('profile/jobs.secteur.tpl', NO_SKIN);
+ $page->assign('id', $id);
+ $page->assign('ssecteurs', $res);
+ $page->assign('sel', $ssect);
+ }
+
+ function handler_ajax_skill(&$page, $cat, $id)
+ {
+ $page->changeTpl('profile/skill.skill.tpl', NO_SKIN);
+ $page->assign('ajaxskill', true);
+ $page->assign('cat', $cat);
+ $page->assign('id', $id);
+ if ($cat == 'competences') {
+ $page->assign('levels', array('initié' => 'initié',
+ 'bonne connaissance' => 'bonne connaissance',
+ 'expert' => 'expert'));
+ } else {
+ $page->assign('levels', array(1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'));
+ }
+ }
+
function handler_p_orange(&$page)
{
$page->changeTpl('profile/orange.tpl');
$table_editor->describe('url','site web',false);
$table_editor->apply($page, $action, $id);
}
- function handler_admin_groupesx(&$page, $action = 'list', $id = null) {
- $page->assign('xorg_title','Polytechnique.org - Administration - Groupes X');
- $page->assign('title', 'Gestion des Groupes X');
- $table_editor = new PLTableEditor('admin/groupes-x','groupesx_def','id');
- $table_editor->add_join_table('groupesx_ins','gid',true);
- $table_editor->describe('text','intitulé',true);
- $table_editor->describe('url','site web',false);
- $table_editor->apply($page, $action, $id);
- }
function handler_admin_sections(&$page, $action = 'list', $id = null) {
$page->assign('xorg_title','Polytechnique.org - Administration - Sections');
$page->assign('title', 'Gestion des Sections');
$mid = $id;
if (Post::v('act') == 'del') {
- XDB::execute('DELETE FROM profile_medals_grades WHERE mid={?} AND gid={?}', $mid, Post::i('gid'));
+ XDB::execute('DELETE FROM profile_medals_grades
+ WHERE mid={?} AND gid={?}', $mid, Post::i('gid'));
} elseif (Post::v('act') == 'new') {
- XDB::execute('INSERT INTO profile_medals_grades (mid,gid) VALUES({?},{?})',
+ XDB::execute('INSERT INTO profile_medals_grades (mid,gid)
+ VALUES ({?},{?})',
$mid, max(array_keys(Post::v('grades', array(0))))+1);
} else {
foreach (Post::v('grades', array()) as $gid=>$text) {
- XDB::execute('UPDATE profile_medals_grades SET pos={?}, text={?} WHERE gid={?}', $_POST['pos'][$gid], $text, $gid);
+ XDB::execute('UPDATE profile_medals_grades
+ SET pos={?}, text={?}
+ WHERE gid={?} AND mid={?}', $_POST['pos'][$gid], $text, $gid, $mid);
}
}
$res = XDB::iterator('SELECT gid, text, pos FROM profile_medals_grades WHERE mid={?} ORDER BY pos', $mid);