UserFilter::assertGrade($this->grade);
}
if ($this->grade == UserFilter::DISPLAY && $this->comparison != '=') {
- Platal::page()->killError('Comparison ' . $this->comparison . ' not allowed on displaid promo');
+ // XXX: we might try to guess the grade from the first char of the promo and forbid only '<= 2004', but allow '<= X2004'
+ Platal::page()->killError("Il n'est pas possible d'appliquer la comparaison '" . $this->comparison . "' aux promotions sans spécifier de formation (X/M/D)");
}
}
$conds = array();
$conds[] = $sub . '.address ' . XDB::formatWildcards(XDB::WILDCARD_CONTAINS, $this->value);
if ($this->type != -1) {
- $conds[] = $sub . '.network_type = ' . XDB::format('{?}', $this->type);
+ $conds[] = $sub . '.nwid = ' . XDB::format('{?}', $this->type);
}
return implode(' AND ', $conds);
}
$this->buildQuery();
$lim = $limit->getSql();
$cond = '';
- if (!is_null($uids)) {
+ if (!empty($uids)) {
$cond = XDB::format(' AND a.uid IN {?}', $uids);
}
$fetched = XDB::fetchColumn('SELECT SQL_CALC_FOUND_ROWS a.uid
$key = array($key);
}
$joins['e' . $sub] = PlSqlJoin::left('emails', '$ME.uid = $UID AND $ME.flags != \'filter\'
- AND $ME.email IN {?}' . $key);
+ AND $ME.email IN {?}', $key);
}
}
foreach ($this->al as $sub=>$key) {