$this->load('page.inc.php');
$wiz->addPage('ProfileSettingGeneral', 'Général', 'general');
$wiz->addPage('ProfileSettingAddresses', 'Adresses personnelles', 'adresses');
- $wiz->addPage('ProfileSettingGroups', 'Groupes X - Binets', 'poly');
- $wiz->addPage('ProfileSettingDecos', 'Décorations - Medailles', 'deco');
$wiz->addPage('ProfileSettingJobs', 'Informations professionnelles', 'emploi');
- $wiz->addPage('ProfileSettingSkills', 'Compétences diverses', 'skill');
- $wiz->addPage('ProfileSettingMentor', 'Mentoring', 'mentor');
+ if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ $wiz->addPage('ProfileSettingGroups', 'Groupes X - Binets', 'poly');
+ }
+ $wiz->addPage('ProfileSettingDecos', 'Décorations - Medailles', 'deco');
+ if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ $wiz->addPage('ProfileSettingSkills', 'Compétences diverses', 'skill');
+ $wiz->addPage('ProfileSettingMentor', 'Mentoring', 'mentor');
+ }
$wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode);
if (!$profile->birthdate) {
public function __construct(PlWizard &$wiz)
{
parent::__construct($wiz);
- $this->settings['cv'] = null;
+ if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ $this->settings['cv'] = null;
+ }
$this->settings['corps'] = new ProfileSettingCorps();
$this->settings['jobs'] = new ProfileSettingJob();
$this->watched = array('cv' => true, 'jobs' => true, 'corps' => true);
protected function _fetchData()
{
- // Checkout the CV
- $res = XDB::query("SELECT cv
- FROM profiles
- WHERE pid = {?}",
- $this->pid());
- $this->values['cv'] = $res->fetchOneCell();
+ if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ // Checkout the CV
+ $res = XDB::query("SELECT cv
+ FROM profiles
+ WHERE pid = {?}",
+ $this->pid());
+ $this->values['cv'] = $res->fetchOneCell();
+ }
// Build the jobs tree
$res = XDB::iterRow("SELECT j.id, j.jobid, je.name, j.sectorid, j.subsectorid, j.subsubsectorid,
protected function _saveData()
{
- if ($this->changed['cv']) {
- XDB::execute("UPDATE profiles
- SET cv = {?}
- WHERE pid = {?}",
- $this->values['cv'], $this->pid());
+ if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ if ($this->changed['cv']) {
+ XDB::execute("UPDATE profiles
+ SET cv = {?}
+ WHERE pid = {?}",
+ $this->values['cv'], $this->pid());
+ }
}
}
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">
+ <td colspan="3">
<div id="sn_add" class="center">
<a href="javascript:addSearchName({$isFemale});">
{icon name=add title="Ajouter un nom"} Ajouter un nom
</tr>
</table>
+{if $smarty.session.user->checkPerms('directory_private')}
<table class="bicol" summary="CV" style="margin-top: 1.5em">
<tr>
<th>
</td>
</tr>
</table>
+{/if}
{* vim:set et sw=2 sts=2 sws=2 enc=utf-8: *}