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);
return $this->raise("Le champ %s est trop court (minimum {$this->minlength}).");
} else if (strlen($this->val) > $this->maxlength) {
return $this->raise("Le champ %s est trop long (maximum {$this->maxlength}).");
- } else if (preg_match(":[\]\[<>{}~/§_`|%$^=+]|\*\*:u", $this->val)) {
+ } else if (preg_match(":[\]\[<>{}~§_`|%$^=]|\*\*:u", $this->val)) {
return $this->raise('Le champ %s contient un caractère interdit rendant la recherche impossible.');
}
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;
}
protected function buildUFC(UserFilterBuilder &$ufb) {
- return new UFC_Promo($this->comp, UserFilter::DISPLAY, 'X' . $this->val);
+ return new UFC_Promo($this->comp, UserFilter::GRADE_ING, $this->val);
}
}
// }}}
if ($this->val == 1) {
return new UFC_Registered();
} else if ($this->val == 2) {
- return new PFC_Not(UFC_Registered());
+ return new PFC_Not(new UFC_Registered());
}
}
}
protected function buildUFC(UserFilterBuilder &$ufb)
{
if ($this->val == 1) {
- return new PFC_Not(UFC_Dead());
+ return new PFC_Not(new UFC_Dead());
} else if ($this->val == 2) {
return new UFC_Dead();
}
return new PFC_False();
}
} else {
- $byname = new UFC_AddressText(null, UFC_Address::CONTAINS, UFC_Address::TYPE_ANY, $flags, null, $this->val);
+ $byname = new UFC_AddressText(null, XDB::WILDCARD_CONTAINS, UFC_Address::TYPE_ANY, $flags, null, $this->val);
$byzip = new UFC_AddressField($this->val, UFC_AddressField::FIELD_ZIPCODE, UFC_Address::TYPE_ANY, $flags);
if ($this->type & self::TYPE_ANY) {
return new PFC_Or($byname, $byzip);
}
// }}}
+// {{{ 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_Index
+class UFBF_MentorCountry extends UFBF_Text
{
protected function buildUFC(UserFilterBuilder &$ufb)
{
}
// }}}
+// {{{ 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
{