const FETCH_JOB_TERMS = 0x000200;
const FETCH_MENTOR_TERMS = 0x000400;
const FETCH_DELTATEN = 0x000800;
const FETCH_JOB_TERMS = 0x000200;
const FETCH_MENTOR_TERMS = 0x000400;
const FETCH_DELTATEN = 0x000800;
static public $descriptions = array(
'search_names' => 'Noms',
static public $descriptions = array(
'search_names' => 'Noms',
/** Number of years between the promotion year until the
* graduation year. In standard schools it's 0, but for
* Polytechnique the promo year is the entry year.
/** Number of years between the promotion year until the
* graduation year. In standard schools it's 0, but for
* Polytechnique the promo year is the entry year.
* Clears a profile.
* *always deletes in: profile_addresses, profile_binets, profile_deltaten,
* profile_job, profile_langskills, profile_mentor, profile_networking,
* Clears a profile.
* *always deletes in: profile_addresses, profile_binets, profile_deltaten,
* profile_job, profile_langskills, profile_mentor, profile_networking,
- * profile_phones, profile_skills, watch_profile
+ * profile_partnersharing_settings, profile_phones, profile_skills,
+ * watch_profile
* *always keeps in: profile_corps, profile_display, profile_education,
* profile_medals, profile_*_names, profile_photos, search_name
* *modifies: profiles
* *always keeps in: profile_corps, profile_display, profile_education,
* profile_medals, profile_*_names, profile_photos, search_name
* *modifies: profiles
'profile_job', 'profile_langskills', 'profile_mentor',
'profile_networking', 'profile_skills', 'watch_profile',
'profile_phones', 'profile_addresses', 'profile_binets',
'profile_job', 'profile_langskills', 'profile_mentor',
'profile_networking', 'profile_skills', 'watch_profile',
'profile_phones', 'profile_addresses', 'profile_binets',
- /** Sets the level of visibility of the profile
- * Sets $this->visibility to a list of valid visibilities.
- * @param one of the self::VIS_* values
- */
- public function setVisibilityLevel($visibility)
- {
- $this->visibility->setLevel($visibility);
- }
-
/** Determine whether an item with visibility $visibility can be displayed
* with the current level of visibility of the profile
* @param $visibility The level of visibility to be checked
/** Determine whether an item with visibility $visibility can be displayed
* with the current level of visibility of the profile
* @param $visibility The level of visibility to be checked
return XDB::fetchColumn('SELECT binet_id
FROM profile_binets
WHERE pid = {?}', $this->id());
return XDB::fetchColumn('SELECT binet_id
FROM profile_binets
WHERE pid = {?}', $this->id());
return XDB::fetchColumn('SELECT text
FROM profile_binets AS pb
LEFT JOIN profile_binet_enum AS pbe ON (pbe.id = pb.binet_id)
return XDB::fetchColumn('SELECT text
FROM profile_binets AS pb
LEFT JOIN profile_binet_enum AS pbe ON (pbe.id = pb.binet_id)
+ /** Sharing data with partner websites
+ */
+ private $partners_settings = null;
+ public function setPartnersSettings(ProfilePartnerSharing $partners_settings)
+ {
+ $this->partners_settings = $partners_settings;
+ }
+
+ public function getPartnerSettings($partner_id)
+ {
+ if ($this->partners_settings === null && !$this->fetched(self::FETCH_PARTNER)) {
+ $this->setPartnersSettings($this->getProfileField(self::FETCH_PARTNER));
+ }
+ if ($this->partners_settings === null) {
+ return PartnerSettings::getEmpty($partner_id);
+ }
+ return $this->partners_settings->get($partner_id);
+ }
+
public function compareNames($firstname, $lastname)
{
$_lastname = mb_strtoupper($this->lastName());
public function compareNames($firstname, $lastname)
{
$_lastname = mb_strtoupper($this->lastName());
$it = XDB::Iterator('SELECT p.pid, p.hrpid, p.xorg_id, p.ax_id, p.birthdate, p.birthdate_ref,
p.next_birthday, p.deathdate, p.deathdate_rec, p.sex = \'female\' AS sex,
IF ({?}, p.cv, NULL) AS cv, p.medals_pub, p.alias_pub, p.email_directory,
p.last_change, p.nationality1, p.nationality2, p.nationality3,
$it = XDB::Iterator('SELECT p.pid, p.hrpid, p.xorg_id, p.ax_id, p.birthdate, p.birthdate_ref,
p.next_birthday, p.deathdate, p.deathdate_rec, p.sex = \'female\' AS sex,
IF ({?}, p.cv, NULL) AS cv, p.medals_pub, p.alias_pub, p.email_directory,
p.last_change, p.nationality1, p.nationality2, p.nationality3,
- IF (p.freetext_pub IN {?}, p.freetext, NULL) AS freetext,
+ IF (p.freetext_pub >= {?}, p.freetext, NULL) AS freetext,
pe.entry_year, pe.grad_year, pe.promo_year, pe.program, pe.fieldid,
IF ({?}, pse.text, NULL) AS section,
ppn.firstname_main AS firstname, ppn.lastname_main AS lastname, IF ({?}, pn.name, NULL) AS nickname,
pe.entry_year, pe.grad_year, pe.promo_year, pe.program, pe.fieldid,
IF ({?}, pse.text, NULL) AS section,
ppn.firstname_main AS firstname, ppn.lastname_main AS lastname, IF ({?}, pn.name, NULL) AS nickname,
IF (ppn.lastname_ordinary = \'\', ppn.firstname_main, ppn.lastname_ordinary) AS lastname_ordinary,
pd.yourself, pd.promo, pd.short_name, pd.public_name AS full_name,
pd.directory_name, pd.public_name, pd.private_name,
IF (ppn.lastname_ordinary = \'\', ppn.firstname_main, ppn.lastname_ordinary) AS lastname_ordinary,
pd.yourself, pd.promo, pd.short_name, pd.public_name AS full_name,
pd.directory_name, pd.public_name, pd.private_name,
- IF (pp.pub IN {?}, pp.display_tel, NULL) AS mobile,
- (ph.pub IN {?} AND ph.attach IS NOT NULL) AS has_photo,
+ IF (pp.pub >= {?}, pp.display_tel, NULL) AS mobile,
+ (ph.pub >= {?} AND ph.attach IS NOT NULL) AS has_photo, ph.pub as photo_pub,
ph.x AS photo_width, ph.y AS photo_height,
p.last_change < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_old,
pm.expertise AS mentor_expertise,
ph.x AS photo_width, ph.y AS photo_height,
p.last_change < DATE_SUB(NOW(), INTERVAL 365 DAY) AS is_old,
pm.expertise AS mentor_expertise,
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // CV
- $visibility->levels(), // freetext
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // section
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // nickname
- $visibility->levels(), // mobile
- $visibility->levels(), // photo
- $visibility->isVisible(ProfileVisibility::VIS_PRIVATE), // deltaten_message
+ $visibility->isVisible(Visibility::EXPORT_PRIVATE), // CV
+ $visibility->level(), // freetext
+ $visibility->isVisible(Visibility::EXPORT_PRIVATE), // section
+ $visibility->isVisible(Visibility::EXPORT_PRIVATE), // nickname
+ $visibility->level(), // mobile
+ $visibility->level(), // photo
+ $visibility->isVisible(Visibility::EXPORT_PRIVATE), // deltaten_message
$pids
);
return new ProfileIterator($it, $pids, $fields, $visibility);
$pids
);
return new ProfileIterator($it, $pids, $fields, $visibility);
if (!($login instanceof PlUser)) {
$user = User::getSilent($login);
if ($user && $user->hasProfile()) {
if (!($login instanceof PlUser)) {
$user = User::getSilent($login);
if ($user && $user->hasProfile()) {
- public function __construct(PlIterator $it, array $pids, $fields = 0x0000, ProfileVisibility $visibility = null)
+ public function __construct(PlIterator $it, array $pids, $fields = 0x0000, $visibility = null)
$pf->setFetchedFields($this->fields);
if ($this->hasData(Profile::FETCH_PHONES, $vals)) {
$pf->setFetchedFields($this->fields);
if ($this->hasData(Profile::FETCH_PHONES, $vals)) {