return Env::blank($key, $strict);
}
+ public function hasAlnum($key)
+ {
+ $str = $this->s($key);
+ return preg_match('/[a-z0-9]/i', $str);
+ }
+
+ public function hasAlpha($key)
+ {
+ $str = $this->s($key);
+ return preg_match('/[a-z]/i', $str);
+ }
+
public function isOn($key)
{
return $this->has($key) && $this->t($key) == 'on';
new UFBF_JobSector('sector', 'Poste'),
new UFBF_JobDescription('jobdescription', 'Fonction'),
new UFBF_JobCv('cv', 'CV'),
+ new UFBF_JobTerms('jobterm', 'Mots-clefs'),
new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'),
new UFBF_Binet('binetTxt', 'binet', 'Binet'),
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);
}
public function __construct($envprefix = '')
{
$fields = array(
- new UFBF_MentorCountry('pays_sel'),
- new UFBF_MentorSectorization('sector', '', UFC_Mentor_Sectorization::SECTOR),
- new UFBF_MentorSectorization('subSector', '', UFC_Mentor_Sectorization::SUBSECTOR),
+ new UFBF_MentorCountry('country'),
+ new UFBF_MentorTerm('jobterm', 'jobtermText'),
new UFBF_MentorExpertise('expertise'),
);
parent::__construct($fields, $envprefix);
protected function check(UserFilterBuilder &$ufb)
{
- if ($ufb->blank($this->envfieldindex) && $ufb->blank($this->envfield)) {
+ if ($ufb->blank($this->envfieldindex) && !$ufb->hasAlnum($this->envfield)) {
$this->empty = true;
return true;
}
}
$this->val = array($index);
} else {
- $indexes = DirEnum::getIDs($this->direnum, $ufb->t($this->envfield),
+ $indexes = DirEnum::getIDs($this->direnum, $ufb->t($this->envfield),
$ufb->b('exact') ? XDB::WILDCARD_EXACT : XDB::WILDCARD_CONTAINS);
if (count($indexes) == 0) {
return false;
}
// }}}
+// {{{ class UFBF_JobTerms
+class UFBF_JobTerms extends UFBF_Index
+{
+ protected function buildUFC(UserFilterBuilder &$ufb)
+ {
+ return new UFC_Job_Terms($this->val);
+ }
+}
+// }}}
+
// {{{ class UFBF_JobDescription
class UFBF_JobDescription extends UFBF_Text
{
}
// }}}
+// {{{ 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
{
}
// }}}
+// {{{ class UFBF_Mentorterm
+class UFBF_MentorTerm extends UFBF_Index
+{
+ protected function buildUFC(UserFilterBuilder &$ufb)
+ {
+ return new UFC_Mentor_Terms($this->val);
+ }
+}
+// }}}
+
// {{{ class UFBF_MentorSectorization
class UFBF_MentorSectorization extends UFBF_Index
{