X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;fp=modules%2Fprofile.php;h=6714c4e805beeefc8abeee2f45113ccf36712874;hb=07c1b4bc8ebf1ec9d358ec8897a89287378acd63;hp=07e91897e6d4be5b59fb7932e8288036ef8e94bc;hpb=3a649523553bab610f9bbd30c986ec392a9151d1;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index 07e9189..6714c4e 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.'); }