X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile%2Fgeneral.inc.php;h=c89c11c5a19323a9e3acf09b09376de541ac5710;hb=3c696b26901e971c2a0f20dbdee3e7af49a576b6;hp=db75a308f005f45d20817e45c44508f322639dd5;hpb=c710b211c16d68c00b9389515cdc014650ff0f29;p=platal.git diff --git a/modules/profile/general.inc.php b/modules/profile/general.inc.php index db75a30..c89c11c 100644 --- a/modules/profile/general.inc.php +++ b/modules/profile/general.inc.php @@ -126,6 +126,11 @@ class ProfileSettingSearchNames implements ProfileSetting $value[] = $sn; } while ($sn = $sn_all->next()); } + require_once 'validations.inc.php'; + $namesRequest = ProfileValidate::get_typed_requests($page->pid(), 'usage'); + if (count($namesRequest) > 0) { + Platal::page()->assign('validation', true); + } $value = $this->clean($value); } else { require_once 'name.func.inc.php'; @@ -218,7 +223,7 @@ class ProfileSettingSearchNames implements ProfileSetting // Only requires validation if modification in public names if ($has_new) { - $new_names = new NamesReq(S::user(), $this->profile, $this->search_names, $this->private_name_end); + $new_names = new NamesReq(S::user(), $page->profile, $this->search_names, $this->private_name_end); $new_names->submit(); Platal::page()->trigWarning('La demande de modification de tes noms a bien été prise en compte.' . ' Tu recevras un email dès que ces changements auront été effectués.'); @@ -226,9 +231,19 @@ class ProfileSettingSearchNames implements ProfileSetting $display_names = array(); build_display_names($display_names, $this->search_names, $page->profile->isFemale(), $this->private_name_end); - set_profile_display($display_names, $page->pid()); + set_profile_display($display_names, $page->profile); } } + + public function getText($value) { + $names = array(); + foreach ($value as $name) { + if ($name['name'] != '') { + $names[] = $name['type_name'] . ' : ' . $name['name']; + } + } + return implode(', ' , $names); + } } class ProfileSettingEdu implements ProfileSetting @@ -291,6 +306,21 @@ class ProfileSettingEdu implements ProfileSetting } } } + + public function getText($value) { + $schoolsList = DirEnum::getOptions(DirEnum::EDUSCHOOLS); + $degreesList = DirEnum::getOptions(DirEnum::EDUDEGREES); + $fieldsList = DirEnum::getOptions(DirEnum::EDUFIELDS); + $educations = array(); + foreach ($value as $education) { + $educations[] = 'Université : ' . $schoolsList[$education['eduid']] + . ', diplôme : ' . $degreesList[$education['degreeid']] + . ', domaine : ' . $fieldsList[$education['fieldid']] + . ', année d\'obtention : ' . $education['grad_year'] + . ', intitulé : ' . $education['program']; + } + return implode(', ', $educations); + } } class ProfileSettingEmailDirectory implements ProfileSetting @@ -316,6 +346,10 @@ class ProfileSettingEmailDirectory implements ProfileSetting } return $value; } + + public function getText($value) { + return $value; + } } class ProfileSettingNetworking implements ProfileSetting @@ -389,6 +423,15 @@ class ProfileSettingNetworking implements ProfileSetting $page->pid(), $id, $network['type'], $network['address'], $network['pub']); } } + + public function getText($value) { + $networkings = array(); + foreach ($value as $network) { + $networkings[] = 'nom : ' . $network['name'] . ', adresse : ' . $network['address'] + . ', affichage : ' . $network['pub']; + } + return implode(' ; ' , $networkings); + } } class ProfileSettingPromo implements ProfileSetting @@ -416,7 +459,7 @@ class ProfileSettingPromo implements ProfileSetting } else { require_once 'validations.inc.php'; - $myorange = new OrangeReq(S::user(), $this->profile, $gradYearNew); + $myorange = new OrangeReq(S::user(), $page->profile, $gradYearNew); $myorange->submit(); Platal::page()->trigSuccess('Tu pourras changer l\'affichage de ta promotion dès que ta nouvelle promotion aura été validée.'); } @@ -462,6 +505,10 @@ class ProfileSettingPromo implements ProfileSetting } return intval($value); } + + public function getText($value) { + return $value; + } }