require_once 'plmailer.php';
global $globals;
+$translations = array(
+ 'search_names' => 'Noms',
+ 'nationality1' => 'Nationalité',
+ 'nationality2' => '2e nationalité',
+ 'nationality3' => '3e nationalité',
+ 'promo_display' => 'Promotion affichée',
+ 'email_directory' => 'Email annuaire papier',
+ 'networking' => 'Messageries…',
+ 'tels' => 'Téléphones',
+ 'edus' => 'Formations',
+ 'promo' => 'Promotion de sortie',
+ 'birthdate' => 'Date de naissance',
+ 'yourself' => 'Nom affiché',
+ 'freetext' => 'Commentaire',
+ 'freetext_pub' => 'Affichage de ton commentaire',
+ 'photo_pub' => 'Affichage de ta photo',
+ 'addresses' => 'Adresses',
+ 'corps' => 'Corps',
+ 'cv' => 'CV',
+ 'jobs' => 'Emplois',
+ 'section' => 'Section',
+ 'binets' => 'Binets',
+ 'medals' => 'Décorations',
+ 'medals_pub' => 'Affichage de tes décorations',
+ 'competences' => 'Compétences',
+ 'langues' => 'Langues',
+ 'expertise' => 'Expertises (mentoring)',
+ 'terms' => 'Compétences (mentoring)',
+ 'countries' => 'Pays (mentoring)'
+);
$res = XDB::iterator('SELECT p.hrpid, pm.pid, a.full_name, pm.field, pm.oldText, pm.newText, p.sex, pd.yourself, al.alias
FROM profile_modifications AS pm
INNER JOIN accounts AS a ON (pm.uid = a.uid)
$modifications = array();
$modifications[] = array(
'full_name' => $values['full_name'],
- 'field' => $values['field'],
+ 'field' => $translations[$values['field']],
'oldText' => $values['oldText'],
'newText' => $values['newText'],
);
$hrpid = $values['hrpid'];
$modifications[] = array(
'full_name' => $values['full_name'],
- 'field' => $values['field'],
+ 'field' => $translations[$values['field']],
'oldText' => $values['oldText'],
'newText' => $values['newText'],
);
private function toString()
{
- $address = 'Adresse : ' . $this->text;
+ $address = $this->text;
if ($this->type == self::LINK_PROFILE || $this->type == self::LINK_JOB) {
- $address .= ', affichage : ' . $this->pub;
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
+ $address .= ' (affichage ' . $pubs[$this->pub];
}
if ($this->type == self::LINK_PROFILE) {
static $flags = array(
'cedex' => 'type cédex',
);
- $address .= ', commentaire : ' . $this->comment;
+ if (!$this->flags->hasFlag('temporary')) {
+ $address .= ', permanente';
+ }
+ if (!$this->flags->hasFlag('secondary')) {
+ $address .= ', principale';
+ }
foreach ($flags as $flag => $flagName) {
if ($this->flags->hasFlag($flag)) {
$address .= ', ' . $flagName;
}
}
+ if ($this->comment) {
+ $address .= ', commentaire : ' . $this->comment;
+ }
if ($phones = Phone::formArrayToString($this->phones)) {
$address .= ', ' . $phones;
}
+ } elseif ($this->type == self::LINK_JOB) {
+ $address .= ')';
}
return $address;
}
static public function formArrayToString(array $data)
{
- return implode(' ; ', self::formArrayWalk($data, 'toString'));
+ return implode(', ', self::formArrayWalk($data, 'toString'));
}
static public function iterate(array $pids = array(), array $types = array(),
private function toString()
{
- return 'type : ' . $this->type .', numéro : ' . $this->display
- . ', commentaire : « ' . $this->comment . ' », affichage : ' . $this->pub;
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
+ static $types = array('fax' => 'fax', 'fixed' => 'fixe', 'mobile' => 'mobile');
+ return $this->display . ' (' . $types[$this->type] . (($this->comment) ? ', commentaire : « ' . $this->comment . ' »' : '')
+ . ', affichage ' . $pubs[$this->pub] . ')';
}
private function isEmpty()
static public function formArrayToString(array $data)
{
- return implode(' ; ', self::formArrayWalk($data, 'toString'));
+ return implode(', ', self::formArrayWalk($data, 'toString'));
}
static public function iterate(array $pids = array(), array $link_types = array(),
$names = array();
foreach ($value as $name) {
if ($name['name'] != '') {
- $names[] = $name['type_name'] . ' : ' . $name['name'];
+ $names[] = mb_strtolower($name['type_name']) . ' : ' . $name['name'];
}
}
return implode(', ' , $names);
$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'];
+ foreach ($value as $id => $education) {
+ // XXX: the following condition should be removed once there are no more incomplete educations.
+ if (is_null($education['eduid']) || is_null($education['degreeid'])) {
+ if (is_null($education['eduid']) && is_null($education['degreeid'])) {
+ $educations[$id] = 'formation manquante';
+ } else {
+ $educations[$id] = (is_null($education['eduid']) ? 'université manquante' : $schoolsList[$education['eduid']]) . ', '
+ . (is_null($education['degreeid']) ? 'diplôme manquant' : $degreesList[$education['degreeid']]);
+ }
+ } else {
+ $educations[$id] = $schoolsList[$education['eduid']] . ', ' . $degreesList[$education['degreeid']];
+ }
+
+ $details = array();
+ if ($education['grad_year']) {
+ $details[] = $education['grad_year'];
+ }
+ if ($education['program']) {
+ $details[] = '« ' . $education['program'] . ' »';
+ }
+ if ($education['fieldid']) {
+ $details[] = $fieldsList[$education['fieldid']];
+ }
+ if (count($details)) {
+ $educations[$id] .= ' (' . implode(', ', $details) . ')';
+ }
}
return implode(', ', $educations);
}
}
public function getText($value) {
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
$networkings = array();
foreach ($value as $network) {
- $networkings[] = 'nom : ' . $network['name'] . ', adresse : ' . $network['address']
- . ', affichage : ' . $network['pub'];
+ $networkings[] = $network['name'] . ' : ' . $network['address'] . ' (affichage ' . $pubs[$network['pub']] . ')';
}
- return implode(' ; ' , $networkings);
+ return implode(', ' , $networkings);
}
}
public function getText($value)
{
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
$jobs = array();
foreach ($value as $id => $job) {
$address = Address::formArrayToString(array($job['w_address']));
$phones = Phone::formArrayToString($job['w_phone']);
- // TODO: add jobterms here.
- $jobs[] = 'Entreprise : ' . $job['name']
- . ', description : ' . $job['description'] . ', web : ' . $job['w_url']
- . ', email : ' . $job['w_email']
- . ($phones ? ', ' . $phones : '') . ($address ? ', ' . $address : '');
+ $jobs[$id] = $job['name'];
+ $jobs[$id] .= ($job['description'] ? (', ' . $job['description']) : '');
+ $jobs[$id] .= ' (affichage ' . $pubs[$job['pub']];
+ if (count($job['terms'])) {
+ $terms = array();
+ foreach ($job['terms'] as $term) {
+ $terms[] = $term['full_name'];
+ }
+ $jobs[$id] .= ', mots-clefs : ' . implode(', ', $terms);
+ }
+ if ($job['w_url']) {
+ $jobs[$id] .= ', page perso : ' . $job['w_url'];
+ }
+ if ($address) {
+ $jobs[$id] .= ', adresse : ' . $address;
+ }
+ if ($job['w_email']) {
+ $jobs[$id] .= ', email : ' . $job['w_email'];
+ }
+ if ($phones) {
+ $jobs[$id] .= ', téléphones : ' . $phones;
+ }
+ $jobs[$id] .= ')';
}
return implode(' ; ' , $jobs);
}
public function getText($value)
{
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
$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'];
+ return $corpsList[$value['current']] . ', ' . $corpsList[$value['rank']] . ' ('
+ . 'corps d\'origine : ' . $corpsList[$value['original']] . ', affichage ' . $pubs[$value['pub']] . ')';
}
}
}
public function getText($value) {
- return $value;
+ static $pubs = array('public' => 'publique', 'ax' => 'annuaire AX', 'private' => 'privé');
+ return $pubs[$value];
}
}
public function getText($value) {
$skills = array();
- foreach ($value as $skill) {
- $skills[] = 'Compétance : ' . $skill['text'] . ', niveau : ' . $skill['level'];
+
+ if ($this->table == 'langskill') {
+ static $levels = array(
+ 1 => 'connaissance basique',
+ 2 => 'maîtrise des bases',
+ 3 => 'maîtrise limitée',
+ 4 => 'maîtrise générale',
+ 5 => 'bonne maîtrise',
+ 6 => 'maîtrise complète'
+ );
+ foreach ($value as $skill) {
+ $skills[] = $skill['text'] . ' (' . $levels[$skill['level']] . ')';
+ }
+ } else {
+ foreach ($value as $skill) {
+ $skills[] = $skill['text'] . ' (' . $skill['level'] . ')';
+ }
}
- return implode(' ; ' , $skills);
+
+ return implode(', ' , $skills);
}
}