+ if (count($terms_values) > 0) {
+ XDB::execute('INSERT INTO profile_job_term (pid, jid, jtid, computed)
+ VALUES '.implode(', ', $terms_values));
+ }
+ }
+
+ public function getText($value) {
+ $jobs = array();
+ foreach ($value as $id => $job) {
+ $address = new ProfileSettingAddress();
+ $phones = Phone::formArrayToString($job['w_phone']);
+ $jobs[] = 'Entreprise : ' . $job['name'] . ', secteur : ' . $job['subSubSectorName']
+ . ', description : ' . $job['description'] . ', web : ' . $job['w_url']
+ . ', email : ' . $job['w_email']
+ . ($phones ? ', ' . $phones : '') . ', ' . $address->getText($job['w_address']);
+ }
+ return implode(' ; ' , $jobs);
+ }
+}
+
+class ProfileSettingCorps implements ProfileSetting
+{
+ public function value(ProfilePage &$page, $field, $value, &$success)
+ {
+ $success = true;
+ if (is_null($value)) {
+ $res = XDB::query("SELECT original_corpsid AS original, current_corpsid AS current,
+ rankid AS rank, corps_pub AS pub
+ FROM profile_corps
+ WHERE pid = {?}",
+ $page->pid());
+ return $res->fetchOneAssoc();
+ }
+ return $value;
+ }
+
+ public function save(ProfilePage &$page, $field, $value)
+ {
+ XDB::execute('REPLACE INTO profile_corps (original_corpsid, current_corpsid, rankid, corps_pub, pid)
+ VALUES ({?}, {?}, {?}, {?}, {?})',
+ $value['original'], $value['current'], $value['rank'], $value['pub'], $page->pid());
+ }
+
+ public function getText($value)
+ {
+ $corpsList = DirEnum::getOptions(DirEnum::CORPS);
+ $rankList = DirEnum::getOptions(DirEnum::CORPSRANKS);
+ return 'Corps actuel : ' . $corpsList[$value['current']] . ' , rang : ' . $corpsList[$value['rank']]
+ . ' , corps d\'origine : ' . $corpsList[$value['original']] . ' , affichage : ' . $value['pub'];