const FETCH_ALL = 0x0007FF; // OR of FETCH_*
+ static public $descriptions = 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 du commentaire',
+ 'photo' => 'Photographie',
+ 'photo_pub' => 'Affichage de la photographie',
+ 'addresses' => 'Adresses',
+ 'corps' => 'Corps',
+ 'cv' => 'CV',
+ 'jobs' => 'Emplois',
+ 'section' => 'Section',
+ 'binets' => 'Binets',
+ 'medals' => 'Décorations',
+ 'medals_pub' => 'Affichage des décorations',
+ 'competences' => 'Compétences',
+ 'langues' => 'Langues',
+ 'expertise' => 'Expertises (mentoring)',
+ 'terms' => 'Compétences (mentoring)',
+ 'countries' => 'Pays (mentoring)'
+ );
+
private $fetched_fields = 0x000000;
private $pid;
{
if ($this->has_photo) {
if ($data && ($this->photo == null || $this->photo->mimeType == null)) {
- $res = XDB::fetchOneAssoc('SELECT attach, attachmime, x, y
+ $res = XDB::fetchOneAssoc('SELECT attach, attachmime, x, y, last_update
FROM profile_photos
WHERE pid = {?}', $this->pid);
- $this->photo = PlImage::fromData($res['attach'], $res['attachmime'], $res['x'], $res['y']);
+ $this->photo = PlImage::fromData($res['attach'], 'image/' .$res['attachmime'], $res['x'], $res['y'], $res['last_update']);
} else if ($this->photo == null) {
$this->photo = PlImage::fromData(null, null, $this->photo_width, $this->photo_height);
}
return $this->photo;
} else if ($fallback) {
- return PlImage::fromFile(dirname(__FILE__).'/../htdocs/images/none.png',
- 'image/png');
+ if ($this->mainEducation() == 'X') {
+ return PlImage::fromFile(dirname(__FILE__) . '/../htdocs/images/none_x.png', 'image/png');
+ }
+ return PlImage::fromFile(dirname(__FILE__) . '/../htdocs/images/none_md.png', 'image/png');
}
return null;
}
}
}
- public static function rebuildSearchTokens($pids)
+ public static function rebuildSearchTokens($pids, $transaction = true)
{
if (!is_array($pids)) {
$pids = array($pids);
$eltScore, $key['public']);
}
}
- XDB::startTransaction();
+ if ($transaction) {
+ XDB::startTransaction();
+ }
XDB::execute('DELETE FROM search_name
WHERE pid IN {?}',
$pids);
XDB::rawExecute('INSERT INTO search_name (token, pid, soundex, score, flags)
VALUES ' . implode(', ', $names));
}
- XDB::commit();
+ if ($transaction) {
+ XDB::commit();
+ }
}
/** The school identifier consists of 6 digits. The first 3 represent the