From: Stéphane Jacob Date: Fri, 22 Apr 2011 14:15:16 +0000 (+0200) Subject: Uses same constants for UserFilter::GRADE_*** and Profile::DEGREE_*. X-Git-Tag: xorg/1.1.1~70 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9a6abd1f1023ef0d49430e480eda8c0fc9676fb3;p=platal.git Uses same constants for UserFilter::GRADE_*** and Profile::DEGREE_*. Signed-off-by: Stéphane Jacob --- diff --git a/classes/userfilter.php b/classes/userfilter.php index 83cf251..9dd25c6 100644 --- a/classes/userfilter.php +++ b/classes/userfilter.php @@ -764,9 +764,9 @@ class UserFilter extends PlFilter /** 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); @@ -813,7 +813,7 @@ class UserFilter extends PlFilter 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');