X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=c79a1233477c093c54bb3d1191b16f7e79e6d721;hb=7c8b692c4bc04cdac02c74f29a988f9f9f4ee398;hp=07e91897e6d4be5b59fb7932e8288036ef8e94bc;hpb=5289c142e04219cb8e846c86ccd9f5005d7d49e1;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index 07e9189..c79a123 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -329,14 +329,15 @@ class ProfileModule extends PLModule $wiz->addPage('ProfilePageGeneral', 'Général', 'general'); $wiz->addPage('ProfilePageAddresses', 'Adresses personnelles', 'adresses'); $wiz->addPage('ProfilePageJobs', 'Informations professionnelles', 'emploi'); - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + $viewPrivate = S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE); + if ($viewPrivate) { $wiz->addPage('ProfilePageGroups', 'Groupes X - Binets', 'poly'); } $wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco'); - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + if ($viewPrivate) { $wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor'); } - if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE) && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) { + if ($viewPrivate && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) { $wiz->addPage('ProfilePageDeltaten', 'Opération N N-10', 'deltaten'); } $wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode); @@ -348,6 +349,8 @@ class ProfileModule extends PLModule $page->setTitle('Mon Profil'); $page->assign('hrpid', $profile->hrid()); + $page->assign('viewPrivate', $viewPrivate); + $page->assign('isMe', S::user()->isMyProfile($profile)); if (isset($success) && $success) { $page->trigSuccess('Ton profil a bien été mis à jour.'); } @@ -355,7 +358,7 @@ class ProfileModule extends PLModule function handler_education_js($page) { - pl_cached_content_headers("text/javascript", "utf-8"); + pl_cached_content_headers('text/javascript', 'utf-8', 3600); $page->changeTpl('profile/education.js.tpl', NO_SKIN); require_once 'education.func.inc.php'; }