From 316120eb582c7293798eaeda0a3ee27f7f9c1faa Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 11 Apr 2010 16:31:44 +0200 Subject: [PATCH] Fix Xnet's trombi, fix display of bound in trombi. Signed-off-by: Florent Bruneau --- include/userset.inc.php | 71 +++++++++++++------------------------------------ modules/xnetgrp.php | 14 +++------- 2 files changed, 23 insertions(+), 62 deletions(-) diff --git a/include/userset.inc.php b/include/userset.inc.php index 92e041a..23a117e 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -152,6 +152,23 @@ abstract class ProfileView extends MultipageView } return null; } + + public function bounds() + { + $order = Env::v('order', $this->defaultkey); + $show_bounds = 0; + if (($order == "name") || ($order == "-name")) { + $this->bound_field = "name"; + $show_bounds = 1; + } elseif (($order == "promo") || ($order == "-promo")) { + $this->bound_field = "promo"; + $show_bounds = -1; + } + if ($order{0} == '-') { + $show_bounds = -$show_bounds; + } + return $show_bounds; + } } class MinificheView extends ProfileView @@ -185,23 +202,6 @@ class MinificheView extends ProfileView parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "name"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.minifiche.tpl'; @@ -227,23 +227,6 @@ class MentorView extends ProfileView parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "nom"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.referent.tpl'; @@ -255,6 +238,7 @@ class TrombiView extends ProfileView public function __construct(PlSet &$set, $data, array $params) { $this->entriesPerPage = 24; + $this->defaultkey = 'name'; if (@$params['with_score']) { $this->addSort(new PlViewOrder('score', array( new UFO_Score(true), @@ -263,32 +247,15 @@ class TrombiView extends ProfileView new UFO_Name(Profile::DN_SORT), ), 'pertinence')); } + $set->addCond(new UFC_Photo()); $this->addSort(new PlViewOrder('name', array(new UFO_Name(Profile::DN_SORT)), 'nom')); $this->addSort(new PlViewOrder('promo', array( new UFO_Promo(UserFilter::DISPLAY, true), new UFO_Name(Profile::DN_SORT), ), 'promotion')); - $set->addCond(new UFC_Photo()); parent::__construct($set, $data, $params); } - public function bounds() - { - $order = Env::v('order', $this->defaultkey); - $show_bounds = 0; - if (($order == "name") || ($order == "-name")) { - $this->bound_field = "nom"; - $show_bounds = 1; - } elseif (($order == "promo") || ($order == "-promo")) { - $this->bound_field = "promo"; - $show_bounds = -1; - } - if ($order{0} == '-') { - $show_bounds = -$show_bounds; - } - return $show_bounds; - } - public function templateName() { return 'include/plview.trombi.tpl'; diff --git a/modules/xnetgrp.php b/modules/xnetgrp.php index 1f58fd5..3c8861a 100644 --- a/modules/xnetgrp.php +++ b/modules/xnetgrp.php @@ -282,10 +282,7 @@ class XnetGrpModule extends PLModule { global $globals; - if ($action == 'search') { - http_redirect("https://www.polytechnique.org/search/adv?rechercher=Chercher&groupex={$globals->asso('id')}" - . "&cityid=" . Env::v('cityid') . "&mapid=" . Env::v('mapid')); - } else if ($action == 'geoloc' || $action == 'trombi') { + if ($action == 'trombi') { __autoload('userset'); if ($action == 'trombi') { $view = new ProfileSet(new UFC_Group($globals->asso('id'))); @@ -293,15 +290,12 @@ class XnetGrpModule extends PLModule $view = new UserSet(new UFC_Group($globals->asso('id'))); } $view->addMod('trombi', 'Trombinoscope'); - // TODO: Reactivate when the new map is completed. - // $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'annuaire/search')); $view->apply('annuaire', $page, $action, $subaction); - if ($action == 'geoloc' && $subaction) { - return; - } + $page->changeTpl('xnetgrp/annuaire.tpl'); + return; } - $page->changeTpl('xnetgrp/annuaire.tpl'); + $page->changeTpl('xnetgrp/annuaire.tpl'); $sort = Env::s('order', 'directory_name'); $ofs = Env::i('offset'); if ($ofs < 0) { -- 2.1.4