X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fsearch.php;h=383fadc1e14743ff81c705cd4bf61bac5e35a8fe;hb=fe5ccad978199cfbe71c583280b999769a27c9b2;hp=edf62efddc0817ab1a247d85d614ce845ccd9bb8;hpb=38f35d8935896a31c97d5628a04b9fb3eb6d9059;p=platal.git diff --git a/modules/search.php b/modules/search.php index edf62ef..383fadc 100644 --- a/modules/search.php +++ b/modules/search.php @@ -158,8 +158,8 @@ class SearchModule extends PLModule $networks[0] = '-'; ksort($networks); $page->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);