+class MentorView extends MultipageView
+{
+ public function __construct(PlSet &$set, $data, array $params)
+ {
+ $this->entriesPerPage = 10;
+ $this->addSortKey('rand', array('RAND(' . S::i('uid') . ')'), 'aléatoirement');
+ $this->addSortKey('name', array('nom', 'prenom'), 'nom');
+ $this->addSortKey('promo', array('-promo', 'nom', 'prenom'), 'promotion');
+ $this->addSortKey('date_mod', array('-date', '-promo', 'nom', 'prenom'), 'dernière modification');
+ parent::__construct($set, $data, $params);
+ }
+
+ public function fields()
+ {
+ return "m.uid, u.prenom, u.nom, u.promo,
+ a.alias AS forlife, m.expertise, mp.pid,
+ ms.secteur, ms.ss_secteur";
+ }
+
+ 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';
+ }
+}
+