/** EDUCATION
*/
- const GRADE_ING = 'Ing.';
- const GRADE_PHD = 'PhD';
- const GRADE_MST = 'M%';
+ const GRADE_ING = Profile::DEGREE_X;
+ const GRADE_PHD = Profile::DEGREE_D;
+ const GRADE_MST = Profile::DEGREE_M;
static public function isGrade($grade)
{
return ($grade !== 0) && ($grade == self::GRADE_ING || $grade == self::GRADE_PHD || $grade == self::GRADE_MST);
foreach ($this->pepe as $grade => $sub) {
if ($this->isGrade($grade)) {
$joins['pe' . $sub] = PlSqlJoin::left('profile_education', '$ME.eduid = pee.id AND $ME.pid = $PID');
- $joins['pede' . $sub] = PlSqlJoin::inner('profile_education_degree_enum', '$ME.id = pe' . $sub . '.degreeid AND $ME.abbreviation LIKE {?}', $grade);
+ $joins['pede' . $sub] = PlSqlJoin::inner('profile_education_degree_enum', '$ME.id = pe' . $sub . '.degreeid AND $ME.degree LIKE {?}', $grade);
} else {
$joins['pe' . $sub] = PlSqlJoin::left('profile_education', '$ME.pid = $PID');
$joins['pee' . $sub] = PlSqlJoin::inner('profile_education_enum', '$ME.id = pe' . $sub . '.eduid');
* that email as a source email.
* @return Suffix to use to access the adequate table.
*/
- public function addAliasFilter($email = null)
+ public function addAliasFilter($email = null)
{
$this->requireAccounts();
return $this->register_optional($this->sa, $email);
}
+ private $with_rf = false;
+ /** Allows filtering by active redirection.
+ * @return Suffix to use to access the adequate table.
+ */
+ public function addActiveEmailRedirectFilter($email = null)
+ {
+ $this->requireAccounts();
+ $this->with_rf = true;
+ }
+
protected function emailJoins()
{
global $globals;
$joins['sa' . $sub] = PlSqlJoin::left('email_source_account', '$ME.uid = $UID AND FIND_IN_SET(\'bestalias\', $ME.flags)');
} else if ($key == self::ALIAS_FORLIFE) {
$joins['sa' . $sub] = PlSqlJoin::left('email_source_account', '$ME.uid = $UID AND $ME.type = \'forlife\'');
- } else if ($key == self::ALIAS_AUXILiIARY) {
+ } else if ($key == self::ALIAS_AUXILIARY) {
$joins['sa' . $sub] = PlSqlJoin::left('email_source_account', '$ME.uid = $UID AND $ME.type = \'alias_aux\'');
} else {
if (!is_array($emails)) {
$joins['sa' . $sub] = PlSqlJoin::left('email_source_account', '$ME.uid = $UID AND $ME.email IN {?}', $emails);
}
}
+ if ($this->with_rf) {
+ $joins['rf'] = PlSqlJoin::left('email_redirect_account', '$ME.uid = $UID AND $ME.type != \'imap\' AND $ME.flags = \'active\'');;
+ }
return $joins;
}
$this->requireProfiles();
$this->pc = true;
if ($type == UFC_Corps::CURRENT) {
- $pce['pcec'] = 'current_corpsid';
+ $this->pce['pcec'] = 'current_corpsid';
return 'pcec';
} else if ($type == UFC_Corps::ORIGIN) {
- $pce['pceo'] = 'original_corpsid';
+ $this->pce['pceo'] = 'original_corpsid';
return 'pceo';
}
}