}
// }}}
+// {{{ class UFC_Mentor
+class UFC_Mentor implements UserFilterCondition
+{
+ public function buildCondition(PlFilter &$uf)
+ {
+ $sub = $uf->addMentorFilter(UserFilter::MENTOR);
+ return $sub . '.expertise IS NOT NULL';
+ }
+}
+// }}}
+
+
// {{{ class UFC_Mentor_Expertise
/** Filters users by mentoring expertise
* @param $expertise Domain of expertise
private $pms = array();
private $mjtr = false;
- const MENTOR_EXPERTISE = 1;
- const MENTOR_COUNTRY = 2;
- const MENTOR_SECTOR = 3;
- const MENTOR_TERM = 4;
+ const MENTOR = 1;
+ const MENTOR_EXPERTISE = 2;
+ const MENTOR_COUNTRY = 3;
+ const MENTOR_SECTOR = 4;
+ const MENTOR_TERM = 5;
public function addMentorFilter($type)
{
$this->requireAccounts();
switch($type) {
+ case self::MENTOR:
+ $this->pms['pm'] = 'profile_mentor';
+ return 'pm';
case self::MENTOR_EXPERTISE:
$this->pms['pme'] = 'profile_mentor';
return 'pme';
new UFBF_Comment('free', 'Commentaire'),
new UFBF_Phone('phone_number', 'Téléphone'),
new UFBF_Networking('networking_address', 'networking_type', 'Networking et sites webs'),
+
+ new UFBF_Mentor('only_referent', 'Référent'),
);
parent::__construct($fields, $envprefix);
}
}
// }}}
+// {{{ class UFBF_Mentor
+class UFBF_Mentor extends UFBF_Bool
+{
+ protected function buildUFC(UserFilterBuilder &$ufb)
+ {
+ return new UFC_Mentor();
+ }
+}
+// }}}
+
// {{{ class UFBF_MentorCountry
class UFBF_MentorCountry extends UFBF_Text
{