{
public function buildCondition(PlFilter $uf)
{
- $sub_redirect = $uf->addEmailRedirectFilter();
- return 'ra' . $sub_redirect . '.flags = \'active\'';
+ $sub_redirect = $uf->addActiveEmailRedirectFilter();
+ return 'rf.redirect IS NOT NULL';
}
public function export()
if (count($foreign) > 0) {
$sub = $uf->addEmailRedirectFilter($foreign);
- $cond[] = XDB::format('ra' . $sub . '.redirect IS NOT NULL OR ra.redirect IN {?}', $foreign);
+ $cond[] = XDB::format('ra' . $sub . '.redirect IS NOT NULL OR ra' . $sub . '.redirect IN {?}', $foreign);
}
if (count($local) > 0) {
$sub = $uf->addAliasFilter($local);
const ORIGIN = 2;
private $corps;
+ private $id;
private $type;
- public function __construct($corps, $type = self::CURRENT)
+ public function __construct($corps, $id = null, $type = self::CURRENT)
{
$this->corps = $corps;
+ $this->id = $id;
$this->type = $type;
}
* pcec for profile_corps_enum - current
*/
$sub = $uf->addCorpsFilter($this->type);
- $cond = $sub . '.abbreviation = ' . $corps;
- $cond .= ' AND ' . $uf->getVisibilityCondition($sub . '.corps_pub');
+ if (is_null($this->id)) {
+ $cond = $sub . '.abbreviation = ' . $this->corps;
+ } else {
+ $cond = $sub . '.id = ' . $this->id;
+ }
+ // XXX(x2006barrois): find a way to get rid of that hardcoded
+ // reference to 'pc'.
+ $cond .= ' AND ' . $uf->getVisibilityCondition('pc.corps_pub');
return $cond;
}
}
class UFC_Corps_Rank extends UserFilterCondition
{
private $rank;
- public function __construct($rank)
+ private $id;
+
+ public function __construct($rank, $id = null)
{
$this->rank = $rank;
+ $this->id = $id;
}
public function buildCondition(PlFilter $uf)
* pcr for profile_corps_rank
*/
$sub = $uf->addCorpsRankFilter();
- $cond = $sub . '.abbreviation = ' . $rank;
+ if (is_null($this->id)) {
+ $cond = $sub . '.abbreviation = ' . $this->rank;
+ } else {
+ $cond = $sub . '.id = ' . $this->id;
+ }
// XXX(x2006barrois): find a way to get rid of that hardcoded
// reference to 'pc'.
$cond .= ' AND ' . $uf->getVisibilityCondition('pc.corps_pub');