X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fuserset.inc.php;h=21d5b0b54767c8352eeb9dcd93e9f2029028ba43;hb=dbbfabe9138005367547465c13e50b98f121bc36;hp=63921604cb679b50dfbf8cde0fbdae33a0c28284;hpb=d0327f6de73e81c4bcc656471ca4161e4f1e1e1b;p=platal.git diff --git a/include/userset.inc.php b/include/userset.inc.php index 6392160..21d5b0b 100644 --- a/include/userset.inc.php +++ b/include/userset.inc.php @@ -19,7 +19,6 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ***************************************************************************/ -require_once('xorg.misc.inc.php'); require_once('user.func.inc.php'); global $globals; @@ -64,8 +63,7 @@ class SearchSet extends UserSet public function __construct($quick = false, $no_search = false, $join = '', $where = '') { - require_once dirname(__FILE__).'/../modules/search/search.inc.php'; - + Platal::load('search', 'search.inc.php'); if ($no_search) { return; } @@ -80,7 +78,7 @@ class SearchSet extends UserSet private function getQuick($join, $where) { - require_once dirname(__FILE__).'/../modules/search/search.inc.php'; + Platal::load('search', 'search.inc.php'); global $globals; if (!S::logged()) { Env::kill('with_soundex'); @@ -139,7 +137,7 @@ class ArraySet extends UserSet { $where = $this->getUids($users); if ($where) { - $where = "a.alias IN ($where)"; + $where = "u.hruid IN ($where)"; } else { $where = " 0 "; } @@ -148,7 +146,7 @@ class ArraySet extends UserSet private function getUids(array $users) { - $users = get_users_forlife_list($users, true, '_silent_user_callback'); + $users = User::getBulkHruid($users, array('User', '_silent_user_callback')); if (is_null($users)) { return ''; } @@ -186,7 +184,8 @@ class MinificheView extends MultipageView ad1.text AS app1text, ad1.url AS app1url, ai1.type AS app1type, adr.city, gp.a2, gp.pays AS countrytxt, gr.name AS region, IF(u.nom_usage<>'',u.nom_usage,u.nom) AS sortkey, - COUNT(em.email) > 0 AS actif" . (S::logged() ? ", c.contact AS contact" : ''); + (COUNT(em.email) > 0 OR FIND_IN_SET('googleapps', u.mail_storage) > 0) AS actif" . + (S::logged() ? ", c.contact AS contact" : ''); } public function joins() @@ -209,6 +208,23 @@ class MinificheView extends MultipageView : ""); } + 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.minifiche.tpl'; @@ -230,10 +246,27 @@ class MentorView extends MultipageView public function fields() { return "m.uid, u.prenom, u.nom, u.promo, - a.alias AS bestalias, m.expertise, mp.pid, + 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'; @@ -264,12 +297,29 @@ class TrombiView extends MultipageView return "INNER JOIN photo AS p ON (p.uid = u.user_id) "; } + 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'; } - public function apply(PlatalPage &$page) + public function apply(PlPage &$page) { if (!empty($GLOBALS['IS_XNET_SITE'])) { global $globals; @@ -306,7 +356,7 @@ class GeolocView implements PlView return $args; } - public function apply(PlatalPage &$page) + public function apply(PlPage &$page) { require_once 'geoloc.inc.php'; require_once '../modules/search/search.inc.php'; @@ -404,7 +454,7 @@ class GadgetView implements PlView : ""); } - public function apply(PlatalPage &$page) + public function apply(PlPage &$page) { $page->assign_by_ref('set', $this->set->get($this->fields(), $this->joins(), null, null, null, 5, 0));