<?php
/***************************************************************************
- * Copyright (C) 2003-2011 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
new UFBF_HasEmailRedirect('has_email_redirect', 'A une redirection active'),
new UFBF_Dead('alive', 'En vie'),
- new UFBF_AddressIndex('sublocality', 'Arrondissement', 'SUBLOCALITIES'),
+ new UFBF_AddressIndex('postal_code', 'Code postal', 'POSTALCODES'),
new UFBF_AddressIndex('administrative_area_level_3', 'Canton', 'ADMNISTRATIVEAREAS3'),
new UFBF_AddressIndex('administrative_area_level_2', 'Département', 'ADMNISTRATIVEAREAS2'),
new UFBF_AddressIndex('administrative_area_level_1', 'Région', 'ADMNISTRATIVEAREAS1'),
- new UFBF_AddressMixed('localityTxt', 'locality', 'Ville', 'LOCALITIES'),
- new UFBF_AddressMixed('countryTxt', 'country', 'Pays', 'COUNTRIES'),
+ new UFBF_AddressMixed('locality_text', 'locality', 'Ville', 'LOCALITIES'),
+ new UFBF_AddressMixed('country_text', 'country', 'Pays', 'COUNTRIES'),
new UFBF_JobCompany('entreprise', 'Entreprise'),
new UFBF_JobDescription('jobdescription', 'Fonction'),
new UFBF_CurrentCorps('current_corps', 'Corps actuel'),
new UFBF_CorpsRank('corps_rank', 'Grade'),
- new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'),
- new UFBF_Binet('binetTxt', 'binet', 'Binet'),
- new UFBF_Group('groupexTxt', 'groupex', 'Groupe X'),
- new UFBF_Section('sectionTxt', 'section', 'Section'),
+ new UFBF_Nationality('nationalite_text', 'nationalite', 'Nationalité'),
+ new UFBF_Binet('binet_text', 'binet', 'Binet'),
+ new UFBF_Group('groupex_text', 'groupex', 'Groupe X'),
+ new UFBF_Section('section_text', 'section', 'Section'),
- new UFBF_EducationSchool('schoolTxt', 'school', "École d'application"),
- new UFBF_EducationDegree('diplomaTxt', 'diploma', 'Diplôme'),
- new UFBF_EducationField('fieldTxt', 'field', "Domaine d'études"),
+ new UFBF_EducationSchool('school_text', 'school', "École d'application"),
+ new UFBF_EducationDegree('diploma_text', 'diploma', 'Diplôme'),
+ new UFBF_EducationField('field_text', 'field', "Domaine d'études"),
new UFBF_Comment('free', 'Commentaire'),
new UFBF_Phone('phone_number', 'Téléphone'),
}
// }}}
+// {{{ class UFB_DeltaTenSearch
+class UFB_DeltaTenSearch extends UserFilterBuilder
+{
+ public function __construct($envprefix = '')
+ {
+ $fields = array(
+ new UFBF_DeltaTenMessage('deltaten_message'),
+
+ new UFBF_AddressIndex('administrative_area_level_2', 'Département', 'ADMNISTRATIVEAREAS2'),
+ new UFBF_AddressIndex('administrative_area_level_1', 'Région', 'ADMNISTRATIVEAREAS1'),
+ new UFBF_AddressMixed('locality_text', 'locality', 'Ville', 'LOCALITIES'),
+ new UFBF_AddressMixed('country_text', 'country', 'Pays', 'COUNTRIES'),
+
+ new UFBF_EducationSchool('schoolTxt', 'school', "École d'application"),
+ new UFBF_EducationDegree('diplomaTxt', 'diploma', 'Diplôme'),
+ new UFBF_EducationField('fieldTxt', 'field', "Domaine d'études"),
+
+ new UFBF_JobCompany('entreprise', 'Entreprise'),
+ new UFBF_JobDescription('jobdescription', 'Fonction'),
+ new UFBF_JobTerms('jobterm', 'Mots-clefs'),
+
+ new UFBF_Nationality('nationaliteTxt', 'nationalite', 'Nationalité'),
+ new UFBF_Binet('binetTxt', 'binet', 'Binet'),
+ new UFBF_Group('groupexTxt', 'groupex', 'Groupe X'),
+ new UFBF_Section('sectionTxt', 'section', 'Section'),
+ new UFBF_Sex('woman', 'Sexe'),
+ );
+ parent::__construct($fields, $envprefix);
+ }
+}
+// }}}
+
// {{{ class UFB_NewsLetter
class UFB_NewsLetter extends UserFilterBuilder
{
{
$fields = array();
if ($flags->hasFlag(self::FIELDS_PROMO)) {
- $fields[] = new UFBF_Promo('promo1', 'Promotion', 'egal1');
- $fields[] = new UFBF_Promo('promo2', 'Promotion', 'egal2');
+ $fields[] = new UFBF_Promo('promo1', 'Promotion', 'egal1', 'edu_type');
+ $fields[] = new UFBF_Promo('promo2', 'Promotion', 'egal2', 'edu_type');
}
if ($flags->hasFlag(self::FIELDS_AXID)) {
$fields[] = new UFBF_SchoolIds('axid', 'Matricule AX', UFC_SchoolId::AX);
}
$value = $ufb->t($this->envfield);
- $values = explode("\r\n", $value);
+ $values = explode("\n", $value);
$ids = array();
foreach ($values as $val) {
+ $val = trim($val);
if (preg_match('/^[0-9A-Z]{0,8}$/', $val)) {
$ids[] = $val;
}
return true;
}
+ public function getEnvFieldNames()
+ {
+ return array($this->envfield, $this->reversed_envfield);
+ }
+
protected function buildUFC(UserFilterBuilder $ufb)
{
$ufc = new UFC_SchoolId($this->type, $this->val);
class UFBF_AddressMixed extends UFBF_Mixed
{
protected $onlycurrentfield;
+ protected $onlybestmailfield;
- public function __construct($envfieldtext, $envfieldindex, $formtext = '', $addressfield, $onlycurrentfield = 'only_current')
+ public function __construct($envfieldtext, $envfieldindex, $formtext = '', $addressfield, $onlycurrentfield = 'only_current', $onlybestmailfield = 'only_best_mail')
{
parent::__construct($envfieldtext, $envfieldindex, $formtext);
$this->onlycurrentfield = $onlycurrentfield;
+ $this->onlybestmailfield = $onlybestmailfield;
$this->direnum = constant('DirEnum::' . $addressfield);
}
protected function buildUFC(UserFilterBuilder $ufb)
{
+ $flags = UFC_Address::FLAG_NONE;
if ($ufb->isOn($this->onlycurrentfield)) {
- $flags = UFC_Address::FLAG_CURRENT;
- } else {
+ $flags |= UFC_Address::FLAG_CURRENT;
+ }
+ if ($ufb->isOn($this->onlybestmailfield)) {
+ $flags |= UFC_Address::FLAG_BEST_MAIL;
+ }
+ if ($flags == UFC_Address::FLAG_NONE) {
$flags = UFC_Address::FLAG_ANY;
}
public function getEnvFieldNames()
{
- return array($this->envfield, $this->envfieldindex, $this->onlycurrentfield);
+ return array($this->envfield, $this->envfieldindex, $this->onlycurrentfield, $this->onlybestmailfield);
}
}
// }}}
{
protected $direnum;
protected $onlycurrentfield;
+ protected $onlybestmailfield;
- public function __construct($envfield, $formtext = '', $addressfield, $onlycurrentfield = 'only_current')
+ public function __construct($envfield, $formtext = '', $addressfield, $onlycurrentfield = 'only_current', $onlybestmailfield = 'only_best_mail')
{
parent::__construct($envfield, $formtext);
$this->onlycurrentfield = $onlycurrentfield;
+ $this->onlybestmailfield = $onlybestmailfield;
$this->direnum = constant('DirEnum::' . $addressfield);
}
protected function buildUFC(UserFilterBuilder $ufb)
{
+ $flags = UFC_Address::FLAG_NONE;
if ($ufb->isOn($this->onlycurrentfield)) {
- $flags = UFC_Address::FLAG_CURRENT;
- } else {
+ $flags |= UFC_Address::FLAG_CURRENT;
+ }
+ if ($ufb->isOn($this->onlybestmailfield)) {
+ $flags |= UFC_Address::FLAG_BEST_MAIL;
+ }
+ if ($flags == UFC_Address::FLAG_NONE) {
$flags = UFC_Address::FLAG_ANY;
}
public function getEnvFieldNames()
{
- return array($this->envfield, $this->onlycurrentfield);
+ return array($this->envfield, $this->onlycurrentfield, $this->onlybestmailfield);
}
}
// }}}
// {{{ class UFBF_JobCompany
class UFBF_JobCompany extends UFBF_Text
{
- private $onlymentorfield;
-
- public function __construct($envfield, $formtext = '', $onlymentorfield = 'only_referent')
- {
- parent::__construct($envfield, $formtext);
- $this->onlymentorfield = $onlymentorfield;
- }
-
- public function check(UserFilterBuilder $ufb) {
- if (parent::check($ufb)) {
- # No company check for mentors
- if ($ufb->isOn($this->onlymentorfield)) {
- $this->empty = true;
- }
- return true;
- } else {
- return false;
- }
- }
-
protected function buildUFC(UserFilterBuilder $ufb)
{
return new UFC_Job_Company(UFC_Job_Company::JOBNAME, $this->val);
}
-
- public function getEnvFieldNames()
- {
- return array($this->envfield, $this->onlymentorfield);
- }
}
// }}}
}
// }}}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// {{{ class UFBF_DeltaTenMessage
+class UFBF_DeltaTenMessage extends UFBF_Text
+{
+ protected function buildUFC(UserFilterBuilder $ufb)
+ {
+ return new UFC_DeltaTen_Message($this->val);
+ }
+}
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>