{
global $globals;
- $res = XDB::query("SELECT MIN(diminutif), MAX(diminutif)
- FROM groups
- WHERE cat = 'Promotions'");
- list($min, $max) = $res->fetchOneRow();
- $page->assign('promo_min', $min);
- $page->assign('promo_max', $max);
-
if (Env::has('quick') || $action == 'geoloc') {
- $quick = trim(Env::v('quick'));
+ $quick = trim(Env::t('quick'));
if (S::logged() && !Env::has('page')) {
S::logger()->log('search', 'quick=' . $quick);
}
$url .= 'action=search&q=' . urlencode(substr($quick, 4));
$url .= '&group=' . urlencode('-Equipe,-Main,-PmWiki,-Site,-Review');
pl_redirect($url);
+ } elseif (strpos($quick, 'trombi:') === 0) {
+ $promo = substr($quick, 7);
+ $res = XDB::query("SELECT diminutif
+ FROM groups
+ WHERE cat = 'Promotions' AND diminutif = {?}",
+ $promo);
+ if ($res->numRows() == 0) {
+ $page->trigWarning("La promotion demandée n'est pas valide: $promo");
+ } else {
+ http_redirect('http://www.polytechnique.net/login/' . $promo . '/annuaire/trombi');
+ }
}
$page->assign('formulaire', 0);
die();
}
- require_once 'directory.enums.inc.php';
$enums = array(
'binetTxt' => DirEnum::BINETS,
'groupexTxt' => DirEnum::GROUPESX,
'nationaliteTxt' => DirEnum::NATIONALITIES,
'schoolTxt' => DirEnum::EDUSCHOOLS,
);
- if (!array_key_exists($enums, $type)) {
+ if (!array_key_exists($type, $enums)) {
exit();
}
function handler_list(&$page, $type = null, $idVal = null)
{
+ $page->assign('name', $type);
+ $page->assign('with_text_value', true);
+ $page->assign('onchange', "document.forms.recherche.{$type}Txt.value = this.options[this.selectedIndex].text");
+
// Give the list of all values possible of type and builds a select input for it
$ids = null;
- require_once 'directory.enums.inc.php';
switch ($type) {
case 'binet':
case 'nationalite':
$ids = DirEnum::getOptionsIter(DirEnum::NATIONALITIES);
break;
- case 'region':
- if ($isset($_REQUEST['country'])) {
- $ids = DirEnum::getOptionsIter(DirEnum::ADMINAREAS, $_REQUEST['country']);
+ case 'region':
+ if (Env::has('country')) {
+ $ids = DirEnum::getOptionsIter(DirEnum::ADMINAREAS, Env::v('country'));
} else {
$ids = DirEnum::getOptionsIter(DirEnum::ADMINAREAS);
}
}
pl_content_headers("text/xml");
$page->changeTpl('include/field.select.tpl', NO_SKIN);
- $page->assign('name', $type);
$page->assign('list', $ids);
- $page->assign('with_text_value', true);
- $page->assign('onchange', "document.forms.recherche.{$type}Txt.value = this.options[this.selectedIndex].text");
}
}