X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch.php;h=e3bfee7015a19e5d06cb4c614fc035c4b75e9df8;hb=ad47a0aa4c6a13b4e4d051f7159641204707d11c;hp=edf62efddc0817ab1a247d85d614ce845ccd9bb8;hpb=07d0a10adbc2578f9b85875e551a03b99d3650e8;p=platal.git diff --git a/modules/search.php b/modules/search.php index edf62ef..e3bfee7 100644 --- a/modules/search.php +++ b/modules/search.php @@ -1,6 +1,6 @@ assign('networking_types', $networks); - $origin_corps_list = DirEnum::getOptions(DirEnum::CURRENTCORPS); - $current_corps_list = DirEnum::getOptions(DirEnum::ORIGINCORPS); + $origin_corps_list = DirEnum::getOptions(DirEnum::ORIGINCORPS); + $current_corps_list = DirEnum::getOptions(DirEnum::CURRENTCORPS); $corps_rank_list = DirEnum::getOptions(DirEnum::CORPSRANKS); $origin_corps_list[0] = '-'; $current_corps_list[0] = '-'; @@ -213,7 +213,7 @@ class SearchModule extends PLModule $page->assign('public_directory',0); } - private function format_autocomplete(array $item) + static public function format_autocomplete(array $item) { return $item['field'] . ' (' . $item['nb'] . ' camarade' . ($item['nb'] > 1 ? 's' : '') . ')'; } @@ -262,7 +262,7 @@ class SearchModule extends PLModule 'nb' => $aux[1], 'id' => $aux[2] ); - $item['value'] = $this->format_autocomplete($item); + $item['value'] = self::format_autocomplete($item); array_push($list, $item); } } @@ -292,7 +292,7 @@ class SearchModule extends PLModule $to_cache = ''; foreach ($list as &$item) { $to_cache .= $item['field'] . "\t" . $item['nb'] . "\t" . $item['id'] . "\n"; - $item['value'] = $this->format_autocomplete($item); + $item['value'] = self::format_autocomplete($item); } } @@ -414,6 +414,7 @@ class SearchModule extends PLModule $wp->buildCache(); $page->setTitle('Emploi et Carrières'); + $page->addJsLink('jquery.ui.xorg.js'); // Count mentors $res = XDB::query("SELECT count(distinct pid) FROM profile_mentor_term"); @@ -423,6 +424,12 @@ class SearchModule extends PLModule require_once 'ufbuilder.inc.php'; $ufb = new UFB_MentorSearch(); if (!$ufb->isEmpty()) { + + // Search query is logged + if (S::logged() && !Env::has('page')) { + S::logger()->log('search_referent', 'adv=' . var_export($_GET, true)); + } + require_once 'userset.inc.php'; $ufc = $ufb->getUFC(); $set = new ProfileSet($ufc); @@ -464,5 +471,5 @@ class SearchModule extends PLModule } } -// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: +// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>