From: Pascal Corpet Date: Fri, 27 Aug 2010 18:58:57 +0000 (+0200) Subject: Moves referent search from profile to search module X-Git-Tag: xorg/1.0.1~246 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9dc65790548d3ad53842a80f91227d099ed199aa;p=platal.git Moves referent search from profile to search module --- diff --git a/modules/profile.php b/modules/profile.php index f38fbfd..1527e85 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -52,9 +52,6 @@ class ProfileModule extends PLModule 'profile/name_info' => $this->make_hook('name_info', AUTH_PUBLIC), 'referent' => $this->make_hook('referent', AUTH_COOKIE), - 'emploi' => $this->make_hook('ref_search', AUTH_COOKIE), - 'jobs' => $this->make_hook('ref_search', AUTH_COOKIE), - 'referent/search' => $this->make_hook('ref_search', AUTH_COOKIE), 'referent/ssect' => $this->make_hook('ref_sect', AUTH_COOKIE, 'user', NO_AUTH), 'referent/country' => $this->make_hook('ref_country', AUTH_COOKIE, 'user', NO_AUTH), 'referent/autocomplete' => $this->make_hook('ref_autocomplete', AUTH_COOKIE, 'user', NO_AUTH), @@ -578,36 +575,6 @@ class ProfileModule extends PLModule $page->addJsLink('close_on_esc.js'); } - function handler_ref_search(&$page, $action = null, $subaction = null) - { - $wp = new PlWikiPage('Docs.Emploi'); - $wp->buildCache(); - - $page->setTitle('Emploi et Carrières'); - - // nb de mentors - $res = XDB::query("SELECT count(distinct pid) FROM profile_mentor_term"); - $page->assign('mentors_number', $res->fetchOneCell()); - - $page->addJsLink('jquery.autocomplete.js'); - - // On vient d'un formulaire - require_once 'ufbuilder.inc.php'; - $ufb = new UFB_MentorSearch(); - if (!$ufb->isEmpty()) { - require_once 'userset.inc.php'; - $ufc = $ufb->getUFC(); - $set = new ProfileSet($ufc); - $set->addMod('mentor', 'Référents'); - $set->apply('referent/search', $page, $action, $subaction); - if ($set->count() > 100) { - $page->assign('recherche_trop_large', true); - } - } - - $page->changeTpl('profile/referent.tpl'); - } - function handler_ref_sect(&$page, $sect) { pl_content_headers("text/html"); diff --git a/modules/search.php b/modules/search.php index 2796ed1..190ee3b 100644 --- a/modules/search.php +++ b/modules/search.php @@ -29,6 +29,9 @@ class SearchModule extends PLModule 'advanced_search.php' => $this->make_hook('redir_advanced', AUTH_PUBLIC), 'search/autocomplete' => $this->make_hook('autocomplete', AUTH_COOKIE, 'directory_ax', NO_AUTH), 'search/list' => $this->make_hook('list', AUTH_COOKIE, 'directory_ax', NO_AUTH), + 'jobs' => $this->make_hook('referent', AUTH_COOKIE), + 'emploi' => $this->make_hook('referent', AUTH_COOKIE), + 'referent/search' => $this->make_hook('referent', AUTH_COOKIE), ); } @@ -331,6 +334,37 @@ class SearchModule extends PLModule $page->changeTpl('include/field.select.tpl', NO_SKIN); $page->assign('list', $ids); } + + function handler_referent(&$page, $action = null, $subaction = null) + { + $wp = new PlWikiPage('Docs.Emploi'); + $wp->buildCache(); + + $page->setTitle('Emploi et Carrières'); + + // nb de mentors + $res = XDB::query("SELECT count(distinct pid) FROM profile_mentor_term"); + $page->assign('mentors_number', $res->fetchOneCell()); + + $page->addJsLink('jquery.autocomplete.js'); + + // On vient d'un formulaire + require_once 'ufbuilder.inc.php'; + $ufb = new UFB_MentorSearch(); + if (!$ufb->isEmpty()) { + require_once 'userset.inc.php'; + $ufc = $ufb->getUFC(); + $set = new ProfileSet($ufc); + $set->addMod('mentor', 'Référents'); + $set->apply('referent/search', $page, $action, $subaction); + if ($set->count() > 100) { + $page->assign('recherche_trop_large', true); + } + } + + $page->changeTpl('search/referent.tpl'); + } + } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: diff --git a/templates/profile/referent.tpl b/templates/search/referent.tpl similarity index 100% rename from templates/profile/referent.tpl rename to templates/search/referent.tpl